适配新版本秒杀插件
parent
0fdea5ac0b
commit
ffd1d12cbc
2
App.vue
2
App.vue
|
|
@ -34,7 +34,7 @@
|
|||
"/pages/user/user"
|
||||
],
|
||||
// 请求地址
|
||||
request_url: 'https://d1.shopxo.vip/',
|
||||
request_url: 'https://dev.shopxo.vip/',
|
||||
// 静态资源地址
|
||||
static_url: 'https://d1.shopxo.vip/',
|
||||
// 基础信息
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<template>
|
||||
<view>
|
||||
<swiper :indicator-dots="propData.length > 0" :indicator-color="indicator_color" :indicator-active-color="indicator_active_color" :autoplay="propData.length > 0" :circular="circular" class="banner" v-if="propData.length > 0">
|
||||
<swiper :indicator-dots="propData.length > 0" :indicator-color="indicator_color" :indicator-active-color="indicator_active_color" :autoplay="propData.length > 0" :circular="circular" :class="'banner banner-'+(propSize || 'default')" v-if="propData.length > 0">
|
||||
<block v-for="(item, index) in propData" :key="index">
|
||||
<swiper-item>
|
||||
<image :src="item.images_url" mode="widthFix" :data-value="item.event_value" :data-type="item.event_type" @tap="banner_event"></image>
|
||||
<image :src="item.images_url" mode="widthFix" :data-value="item.event_value || item.url" :data-type="item.event_type == undefined ? 1 : item.event_type" @tap="banner_event"></image>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
|
|
@ -24,8 +24,15 @@
|
|||
},
|
||||
|
||||
components: {},
|
||||
props: {
|
||||
propData: Array
|
||||
props: {
|
||||
propData: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
propSize: {
|
||||
type: String,
|
||||
default: 'default'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
banner_event(e) {
|
||||
|
|
@ -44,9 +51,17 @@
|
|||
}
|
||||
.banner image {
|
||||
min-width: 100%;
|
||||
}
|
||||
.banner-mini,
|
||||
.banner-mini image {
|
||||
height: 200rpx !important;
|
||||
}
|
||||
.banner,
|
||||
.banner image {
|
||||
.banner-default,
|
||||
.banner-default image {
|
||||
height: 320rpx !important;
|
||||
}
|
||||
.banner-max,
|
||||
.banner-max image {
|
||||
height: 420rpx !important;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -207,6 +207,13 @@
|
|||
"navigationBarTitleText": "页面设计"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/plugins/seckill/index/index",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "限时秒杀"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/plugins/coupon/index/index",
|
||||
"style": {
|
||||
|
|
|
|||
|
|
@ -54,9 +54,9 @@
|
|||
</block>
|
||||
|
||||
<!-- 价格信息 -->
|
||||
<view :class="'goods-base-price bg-white oh spacing-mb '+((plugins_limitedtimediscount_is_valid == 1) ? 'goods-base-price-countdown' : '')">
|
||||
<view :class="'goods-base-price bg-white oh spacing-mb '+((plugins_seckill_is_valid == 1) ? 'goods-base-price-countdown' : '')">
|
||||
<!-- 价格 -->
|
||||
<view class="price-content padding-lg" :style="(plugins_limitedtimediscount_is_valid == 1) ? 'background-image: url('+plugins_limitedtimediscount_data.bg_img+')' : ''">
|
||||
<view class="price-content padding-lg" :style="(plugins_seckill_is_valid == 1) ? 'background-image: url('+plugins_seckill_data.bg_img+')' : ''">
|
||||
<view class="single-text">
|
||||
<text v-if="(show_field_price_text || null) != null" class="price-icon radius va-m">{{show_field_price_text}}</text>
|
||||
<text class="sales-price va-m">{{currency_symbol}}{{goods.min_price}}</text>
|
||||
|
|
@ -64,9 +64,9 @@
|
|||
<view v-if="(goods.min_original_price || null) != null && goods.min_original_price > 0" class="original-price margin-top-sm single-text">{{currency_symbol}}{{goods.min_original_price}}</view>
|
||||
</view>
|
||||
<!-- 秒杀 -->
|
||||
<view v-if="plugins_limitedtimediscount_is_valid == 1" class="countdown-content padding-lg fr tc">
|
||||
<view class="time-title cr-white single-text">{{plugins_limitedtimediscount_data.title || '限时秒杀'}}</view>
|
||||
<component-countdown :prop-hour="plugins_limitedtimediscount_data.time.hours" :prop-minute="plugins_limitedtimediscount_data.time.minutes" :prop-second="plugins_limitedtimediscount_data.time.seconds" :prop-msec-show="true" prop-time-size="32" prop-time-padding="0" prop-time-weight="bold" prop-time-background-color="transparent" prop-time-color="#ffe500" prop-ds-color="#fff"></component-countdown>
|
||||
<view v-if="plugins_seckill_is_valid == 1" class="countdown-content padding-lg fr tc">
|
||||
<view class="time-title cr-white single-text">{{plugins_seckill_data.title || '限时秒杀'}}</view>
|
||||
<component-countdown :prop-hour="plugins_seckill_data.time.hours" :prop-minute="plugins_seckill_data.time.minutes" :prop-second="plugins_seckill_data.time.seconds" :prop-msec-show="true" prop-time-size="32" prop-time-padding="0" prop-time-weight="bold" prop-time-background-color="transparent" prop-time-color="#ffe500" prop-ds-color="#fff"></component-countdown>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -565,8 +565,8 @@
|
|||
"brand_info": {}
|
||||
},
|
||||
// 限时秒杀插件
|
||||
plugins_limitedtimediscount_is_valid: 0,
|
||||
plugins_limitedtimediscount_data: null,
|
||||
plugins_seckill_is_valid: 0,
|
||||
plugins_seckill_data: null,
|
||||
// 优惠劵
|
||||
plugins_coupon_data: null,
|
||||
temp_coupon_receive_index: null,
|
||||
|
|
@ -759,8 +759,8 @@
|
|||
goods_spec_base_inventory: data.goods.inventory,
|
||||
goods_spec_base_images: data.goods.images,
|
||||
show_field_price_text: data.goods.show_field_price_text == '价格' ? null : data.goods.show_field_price_text.replace(/<[^>]+>/g, "") || null,
|
||||
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null,
|
||||
plugins_limitedtimediscount_is_valid: (data.plugins_limitedtimediscount_data || null) != null && (data.plugins_limitedtimediscount_data.is_valid || 0) == 1 ? 1 : 0,
|
||||
plugins_seckill_data: data.plugins_seckill_data || null,
|
||||
plugins_seckill_is_valid: (data.plugins_seckill_data || null) != null && (data.plugins_seckill_data.is_valid || 0) == 1 ? 1 : 0,
|
||||
plugins_coupon_data: data.plugins_coupon_data || null,
|
||||
quick_nav_cart_count: data.common_cart_total || 0,
|
||||
plugins_salerecords_data: (data.plugins_salerecords_data || null) == null || data.plugins_salerecords_data.length <= 0 ? null : data.plugins_salerecords_data,
|
||||
|
|
|
|||
|
|
@ -1,41 +1,41 @@
|
|||
/**
|
||||
* 顶部内容
|
||||
*/
|
||||
.top-content {
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
min-height: 410rpx;
|
||||
}
|
||||
.nav-top-title {
|
||||
font-size: 42rpx;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
padding: 2px 250rpx 0 20rpx;
|
||||
height: 37px;
|
||||
}
|
||||
/**
|
||||
* 顶部内容
|
||||
*/
|
||||
.top-content {
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
min-height: 410rpx;
|
||||
}
|
||||
.nav-top-title {
|
||||
font-size: 42rpx;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
padding: 2px 250rpx 0 20rpx;
|
||||
height: 37px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
.search-fixed-seat {
|
||||
padding-top: 70rpx;
|
||||
}
|
||||
.search-content-fixed {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
padding-top: 25px;
|
||||
padding-bottom: 20rpx;
|
||||
width: 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 轮播
|
||||
*/
|
||||
.banner-content {
|
||||
margin-top: 26rpx;
|
||||
*/
|
||||
.search-fixed-seat {
|
||||
padding-top: 70rpx;
|
||||
}
|
||||
.search-content-fixed {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
padding-top: 25px;
|
||||
padding-bottom: 20rpx;
|
||||
width: 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 轮播
|
||||
*/
|
||||
.banner-content {
|
||||
margin-top: 26rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -43,9 +43,9 @@
|
|||
*/
|
||||
.floor-list {
|
||||
position: relative;
|
||||
}
|
||||
.floor-list .word .word-icon:not(:last-child) {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.floor-list .word .word-icon:not(:last-child) {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.floor-list .word image {
|
||||
max-width: 100%;
|
||||
|
|
@ -54,11 +54,11 @@
|
|||
.floor-list .goods-list .goods {
|
||||
width: calc(50% - 10rpx);
|
||||
float: left;
|
||||
padding-bottom: 10rpx;
|
||||
padding-bottom: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.floor-list .goods-list .goods:nth-of-type(2n + 1) {
|
||||
margin-right: 10rpx;
|
||||
.floor-list .goods-list .goods:nth-of-type(2n + 1) {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.floor-list .goods-list .goods:nth-of-type(2n) {
|
||||
margin-left: 10rpx;
|
||||
|
|
@ -71,38 +71,29 @@
|
|||
/*
|
||||
* 限时秒杀 - 插件
|
||||
*/
|
||||
.limitedtimediscount .goods-list .item {
|
||||
width: 260rpx;
|
||||
height: 460rpx;
|
||||
border: 1px solid #f5f5f5;
|
||||
background: white;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
.seckill .goods-list swiper {
|
||||
height: 425rpx !important;
|
||||
}
|
||||
.limitedtimediscount .goods-list .item:not(:last-child) {
|
||||
margin-right: 10px;
|
||||
.seckill .goods-list .item image {
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
}
|
||||
.limitedtimediscount .goods-list .item image {
|
||||
width: 260rpx;
|
||||
height: 260rpx;
|
||||
}
|
||||
.limitedtimediscount .goods-list .goods-base .icon {
|
||||
position: absolute;
|
||||
right: 15rpx;
|
||||
bottom: 15rpx;
|
||||
.seckill .goods-list .goods-base .icon {
|
||||
right: 20rpx;
|
||||
bottom: 13rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 购买记录 - 插件
|
||||
*/
|
||||
.plugins-salerecords swiper {
|
||||
height: 506rpx;
|
||||
}
|
||||
.plugins-salerecords swiper-item {
|
||||
height: 100% !important;
|
||||
}
|
||||
.plugins-salerecords .item {
|
||||
border-bottom: 1px solid #fbfbfb;
|
||||
*/
|
||||
.plugins-salerecords swiper {
|
||||
height: 506rpx;
|
||||
}
|
||||
.plugins-salerecords swiper-item {
|
||||
height: 100% !important;
|
||||
}
|
||||
.plugins-salerecords .item {
|
||||
border-bottom: 1px solid #fbfbfb;
|
||||
}
|
||||
.plugins-salerecords image {
|
||||
width: 40rpx !important;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<view v-if="search_is_fixed == 1" class="search-fixed-seat"></view>
|
||||
<view v-if="load_status == 1" :class="search_is_fixed == 1 ? 'search-content-fixed bg-main' : ''" :style="search_is_fixed == 1 ? top_content_style : ''">
|
||||
<view :style="search_style">
|
||||
<view class="margin-horizontal-main">
|
||||
<view class="margin-horizontal-main">
|
||||
<component-search prop-bg-color="#fff"></component-search>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -32,29 +32,32 @@
|
|||
<view class="notice-content spacing-mb" v-if="load_status == 1 && (common_shop_notice || null) != null">{{common_shop_notice}}</view>
|
||||
|
||||
<!-- 限时秒杀 -->
|
||||
<view v-if="plugins_limitedtimediscount_is_valid == 1 && plugins_limitedtimediscount_data.goods.length > 0" class="limitedtimediscount spacing-mb">
|
||||
<view v-if="plugins_seckill_is_valid == 1 && plugins_seckill_data.goods.length > 0" class="seckill spacing-mb">
|
||||
<view class="spacing-nav-title">
|
||||
<text class="text-wrapper va-m">限时秒杀</text>
|
||||
<view class="dis-inline-block va-m margin-left-sm">
|
||||
<component-countdown :prop-hour="plugins_limitedtimediscount_data.time.hours" :prop-minute="plugins_limitedtimediscount_data.time.minutes" :prop-second="plugins_limitedtimediscount_data.time.seconds"></component-countdown>
|
||||
</view>
|
||||
<navigator url="/pages/goods-search/goods-search" hover-class="none" class="arrow-right padding-right-xxxl cr-gray fr">更多</navigator>
|
||||
<text class="text-wrapper va-m">限时秒杀</text>
|
||||
<view class="dis-inline-block va-m margin-left-sm">
|
||||
<component-countdown :prop-hour="plugins_seckill_data.time.hours" :prop-minute="plugins_seckill_data.time.minutes" :prop-second="plugins_seckill_data.time.seconds"></component-countdown>
|
||||
</view>
|
||||
<navigator url="/pages/plugins/seckill/index/index" hover-class="none" class="arrow-right padding-right-xxxl cr-gray fr">更多</navigator>
|
||||
</view>
|
||||
<view class="goods-list scroll-view-horizontal border-radius-main oh">
|
||||
<scroll-view scroll-x>
|
||||
<view v-for="(item, index) in plugins_limitedtimediscount_data.goods" :key="index"
|
||||
class="item bg-white border-radius-main oh">
|
||||
<navigator :url="'/pages/goods-detail/goods-detail?goods_id=' + item.goods_id" hover-class="none">
|
||||
<image class="dis-block" :src="item.images" mode="aspectFit"></image>
|
||||
<view class="goods-base padding-left padding-right">
|
||||
<view class="goods-title multi-text margin-bottom-sm">{{item.title}}</view>
|
||||
<view class="sales-price single-text">{{currency_symbol}}{{item.min_price}}</view>
|
||||
<view v-if="(item.min_original_price || null) != null && item.min_original_price > 0" class="original-price single-text">{{currency_symbol}}{{item.min_original_price}}</view>
|
||||
<uni-icons type="cart" size="16" color="#E02020" class="icon"></uni-icons>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<swiper :vertical="false" :autoplay="(plugins_seckill_data.base || null) != null && (plugins_seckill_data.base.is_home_auto_play || 0) == 1" :circular="true" display-multiple-items="3" interval="3000">
|
||||
<block v-for="(item, index) in plugins_seckill_data.goods" :key="index">
|
||||
<swiper-item class="padding-right-main">
|
||||
<view class="item bg-white border-radius-main oh pr ht-auto">
|
||||
<navigator :url="'/pages/goods-detail/goods-detail?goods_id=' + item.goods_id" hover-class="none">
|
||||
<image class="dis-block" :src="item.images" mode="aspectFit"></image>
|
||||
<view class="goods-base padding-left padding-right">
|
||||
<view class="goods-title multi-text margin-bottom-sm">{{item.title}}</view>
|
||||
<view class="sales-price single-text">{{currency_symbol}}{{item.min_price}}</view>
|
||||
<view v-if="(item.min_original_price || null) != null && item.min_original_price > 0" class="original-price single-text">{{currency_symbol}}{{item.min_original_price}}</view>
|
||||
<uni-icons type="cart" size="16" color="#E02020" class="icon pa"></uni-icons>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -97,12 +100,12 @@
|
|||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :prop-status="data_list_loding_status" :prop-msg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :prop-status="data_list_loding_status" :prop-msg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!--- 底部购买记录 -->
|
||||
<view v-if="(plugins_salerecords_data || null) != null && (plugins_salerecords_data.data || null) != null && plugins_salerecords_data.data.length > 0" class="spacing-mb plugins-salerecords">
|
||||
<view class="spacing-nav-title">
|
||||
|
|
@ -110,7 +113,7 @@
|
|||
<text v-if="(plugins_salerecords_data.base || null) != null && (plugins_salerecords_data.base.home_bottom_desc || null) != null" class="vice-name margin-left-lg cr-gray">{{plugins_salerecords_data.base.home_bottom_desc}}</text>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main oh">
|
||||
<swiper vertical="true" autoplay="true" circular="true" display-multiple-items="6" interval="3000">
|
||||
<swiper :vertical="true" :autoplay="true" :circular="true" display-multiple-items="6" interval="3000">
|
||||
<block v-for="(item, index) in plugins_salerecords_data.data" :key="index">
|
||||
<swiper-item>
|
||||
<view class="item oh padding-lg">
|
||||
|
|
@ -140,42 +143,42 @@
|
|||
</navigator>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :prop-status="data_bottom_line_status"></component-bottom-line>
|
||||
|
||||
<!-- 版权信息 -->
|
||||
<view v-if="load_status == 1">
|
||||
<!-- 版权信息 -->
|
||||
<view v-if="load_status == 1">
|
||||
<component-copyright></component-copyright>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 在线客服 -->
|
||||
</view>
|
||||
|
||||
<!-- 在线客服 -->
|
||||
<component-online-service :prop-is-nav="true"></component-online-service>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav :prop-is-nav="true"></component-quick-nav>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav :prop-is-nav="true"></component-quick-nav>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const app = getApp();
|
||||
const app = getApp();
|
||||
import componentSearch from "../../components/search/search";
|
||||
import componentQuickNav from "../../components/quick-nav/quick-nav";
|
||||
import componentIconNav from "../../components/icon-nav/icon-nav";
|
||||
import componentBanner from "../../components/slider/slider";
|
||||
import componentBanner from "../../components/slider/slider";
|
||||
import componentCountdown from "../../components/countdown/countdown";
|
||||
import componentLayout from "../../components/layout/layout";
|
||||
import componentNoData from "../../components/no-data/no-data";
|
||||
import componentBottomLine from "../../components/bottom-line/bottom-line";
|
||||
import componentCopyright from "../../components/copyright/copyright";
|
||||
import componentLayout from "../../components/layout/layout";
|
||||
import componentNoData from "../../components/no-data/no-data";
|
||||
import componentBottomLine from "../../components/bottom-line/bottom-line";
|
||||
import componentCopyright from "../../components/copyright/copyright";
|
||||
import componentOnlineService from "../../components/online-service/online-service";
|
||||
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
var static_url = app.globalData.get_static_url('home');
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
common_static_url: common_static_url,
|
||||
return {
|
||||
common_static_url: common_static_url,
|
||||
static_url: static_url,
|
||||
load_status: 0,
|
||||
data_list_loding_status: 1,
|
||||
|
|
@ -193,29 +196,29 @@
|
|||
common_app_is_header_nav_fixed: 0,
|
||||
common_app_is_online_service: 0,
|
||||
// 限时秒杀插件
|
||||
plugins_limitedtimediscount_is_valid: 0,
|
||||
plugins_limitedtimediscount_data: null,
|
||||
plugins_seckill_is_valid: 0,
|
||||
plugins_seckill_data: null,
|
||||
// 购买记录插件
|
||||
plugins_salerecords_data: null,
|
||||
// 顶部+搜索样式配置
|
||||
plugins_salerecords_data: null,
|
||||
// 顶部+搜索样式配置
|
||||
top_content_style: 'background-image: url("'+static_url+'nav-top.png");'+'padding-top:'+(parseInt(app.globalData.get_system_info('statusBarHeight'))+5)+'px;',
|
||||
search_style: '',
|
||||
search_is_fixed: 0,
|
||||
// 名称
|
||||
search_is_fixed: 0,
|
||||
// 名称
|
||||
application_title: app.globalData.data.application_title,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
components: {
|
||||
componentSearch,
|
||||
componentQuickNav,
|
||||
componentIconNav,
|
||||
componentBanner,
|
||||
componentBanner,
|
||||
componentCountdown,
|
||||
componentLayout,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentCopyright,
|
||||
componentLayout,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentCopyright,
|
||||
componentOnlineService
|
||||
},
|
||||
props: {},
|
||||
|
|
@ -275,11 +278,9 @@
|
|||
|
||||
// 获取数据
|
||||
init() {
|
||||
var self = this;
|
||||
this.setData({
|
||||
data_list_loding_status: 1
|
||||
});
|
||||
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "index"),
|
||||
method: "POST",
|
||||
|
|
@ -287,27 +288,26 @@
|
|||
dataType: "json",
|
||||
success: res => {
|
||||
uni.stopPullDownRefresh();
|
||||
|
||||
// 获取最新缓存
|
||||
if (this.load_status == 0) {
|
||||
self.init_config(true);
|
||||
this.init_config(true);
|
||||
}
|
||||
|
||||
// 设置首次加载状态
|
||||
self.setData({
|
||||
this.setData({
|
||||
load_status: 1
|
||||
});
|
||||
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
self.setData({
|
||||
this.setData({
|
||||
data_bottom_line_status: true,
|
||||
banner_list: data.banner_list || [],
|
||||
navigation: data.navigation || [],
|
||||
data_list: data.data_list,
|
||||
data_list_loding_status: data.data_list.length == 0 ? 0 : 3,
|
||||
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null,
|
||||
plugins_limitedtimediscount_is_valid: (data.plugins_limitedtimediscount_data || null) != null && (data.plugins_limitedtimediscount_data.is_valid || 0) == 1 ? 1 : 0,
|
||||
plugins_seckill_data: data.plugins_seckill_data || null,
|
||||
plugins_seckill_is_valid: (data.plugins_seckill_data || null) != null && (data.plugins_seckill_data.is_valid || 0) == 1 ? 1 : 0,
|
||||
plugins_salerecords_data: (data.plugins_salerecords_data || null) == null || data.plugins_salerecords_data.length <= 0 ? null : data.plugins_salerecords_data
|
||||
});
|
||||
|
||||
|
|
@ -319,7 +319,7 @@
|
|||
app.globalData.set_tab_bar_badge(2, 1, cart_total);
|
||||
}
|
||||
} else {
|
||||
self.setData({
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true
|
||||
});
|
||||
|
|
@ -328,7 +328,7 @@
|
|||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
self.setData({
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_bottom_line_status: true,
|
||||
load_status: 1
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@
|
|||
onShareAppMessage() {
|
||||
var user_id = app.globalData.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data_base.seo_title || '积分商城 - ' + app.globalData.data.application_title,
|
||||
title: this.data_base.seo_title || this.data_base.application_name || '积分商城 - ' + app.globalData.data.application_title,
|
||||
desc: this.data_base.seo_desc || '积分抵扣、兑换 - ' + app.globalData.data.application_describe,
|
||||
path: '/pages/plugins/points/index/index?referrer=' + user_id
|
||||
};
|
||||
|
|
@ -124,7 +124,7 @@
|
|||
onShareTimeline() {
|
||||
var user_id = app.globalData.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data_base.seo_title || '积分商城 - ' + app.globalData.data.application_title,
|
||||
title: this.data_base.seo_title || this.data_base.application_name || '积分商城 - ' + app.globalData.data.application_title,
|
||||
query: 'referrer=' + user_id,
|
||||
imageUrl: this.data_base.right_images || ''
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,97 @@
|
|||
/**
|
||||
* 签到
|
||||
*/
|
||||
.coming-container {
|
||||
background-color: #f6b015;
|
||||
padding: 80rpx 0 120rpx 0;
|
||||
}
|
||||
.coming-submit {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
line-height: 200rpx;
|
||||
background-color: #F37B1D;
|
||||
color: #f8fb0b;
|
||||
border: 12rpx solid #f9f420;
|
||||
font-size: 62rpx;
|
||||
}
|
||||
.already-coming {
|
||||
border: 12rpx solid #bebebe;
|
||||
background-color: #ccc;
|
||||
color: #9f9f9f;
|
||||
}
|
||||
.coming-tips-msg {
|
||||
color: #ffe7b2;
|
||||
}
|
||||
.signin-user-menu-submit {
|
||||
border: 1px solid #fff900;
|
||||
color: #fffb62;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
}
|
||||
.submit-container {
|
||||
bottom: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.submit-container button {
|
||||
display: inline-flex;
|
||||
}
|
||||
.submit-container button:not(:first-child) {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.submit-container button.team-submit {
|
||||
color: #5eb95e;
|
||||
background-color: #E4F3E4;
|
||||
border-color: #d2e8d2;
|
||||
}
|
||||
.submit-container button.share-submit {
|
||||
color: #F37B1D;
|
||||
background-color: #ffe5be;
|
||||
border-color: #f8d093;
|
||||
}
|
||||
|
||||
/**
|
||||
* 签到成功提示
|
||||
*/
|
||||
.coming-tips-container {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
top: calc(88rpx + constant(safe-area-inset-top));
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1050;
|
||||
background: rgb(0 0 0 / 0.6);
|
||||
padding-top: 30%;
|
||||
}
|
||||
.coming-content {
|
||||
max-width: 300px;
|
||||
height: 305px;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
}
|
||||
.coming-content .icon-close-submit {
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
}
|
||||
.coming-tips-container image {
|
||||
max-width: 100%;
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
.data-list .item {
|
||||
width: calc(50% - 50rpx);
|
||||
}
|
||||
.data-list .item:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
.data-list .item:nth-child(2n+1) {
|
||||
float: left;
|
||||
}
|
||||
.data-list .item image {
|
||||
width: 100%;
|
||||
height: 380rpx !important;
|
||||
}
|
||||
|
|
@ -0,0 +1,164 @@
|
|||
<template>
|
||||
<view>
|
||||
<view v-if="(data_base || null) != null">
|
||||
<view class="padding-horizontal-main padding-top-main">
|
||||
<!-- 轮播 -->
|
||||
<view v-if="slider.length > 0">
|
||||
<component-banner :prop-data="slider" prop-size="mini"></component-banner>
|
||||
</view>
|
||||
|
||||
<!-- 公告信息 -->
|
||||
<view v-if="(data_base.content_notice || null) != null && data_base.content_notice.length > 0" class="spacing-mb">
|
||||
<view class="notice-content">
|
||||
<view v-for="(item, index) in data_base.content_notice" :key="index" class="item">{{item}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 基础信息、倒计时 -->
|
||||
<view class="oh spacing-mb">
|
||||
<text :class="'va-m '+(is_valid == 1 ? 'cr-base' : 'cr-red')">{{time.msg}}</text>
|
||||
<view v-if="is_valid == 1" class="dis-inline-block va-m margin-left-sm">
|
||||
<component-countdown :prop-hour="time.hours" :prop-minute="time.minutes" :prop-second="time.seconds"></component-countdown>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品 -->
|
||||
<view v-if="goods.length > 0">
|
||||
<view class="data-list oh">
|
||||
<view v-for="(item, index) in goods" :key="index" class="item padding-main border-radius-main bg-white margin-bottom-main">
|
||||
<navigator :url="'/pages/goods-detail/goods-detail?goods_id=' + item.id" hover-class="none">
|
||||
<image :src="item.images" mode="aspectFit"></image>
|
||||
<view class="margin-top-sm">
|
||||
<view class="multi-text">{{item.title}}</view>
|
||||
<view class="single-text margin-top-sm">
|
||||
<text v-if="time.status == 0 || time.status == 1" class="text-size-xs bg-red cr-white round padding-left-sm padding-right-sm padding-top-xs padding-bottom-xs">{{data_base.goods_detail_icon || '秒杀价'}}</text>
|
||||
<text class="sales-price va-m">{{currency_symbol}}{{item.min_price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :prop-status="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :prop-status="data_list_loding_status" :prop-msg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentBanner from "../../../../components/slider/slider";
|
||||
import componentCountdown from "../../../../components/countdown/countdown";
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_base: null,
|
||||
time: null,
|
||||
goods: [],
|
||||
slider: [],
|
||||
is_valid: 0,
|
||||
currency_symbol: app.globalData.data.currency_symbol
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentBanner,
|
||||
componentCountdown,
|
||||
componentNoData,
|
||||
componentBottomLine
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad() {},
|
||||
|
||||
onShow() {
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
|
||||
// 显示分享菜单
|
||||
app.globalData.show_share_menu();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 自定义分享
|
||||
onShareAppMessage() {
|
||||
var user_id = app.globalData.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data_base.seo_title || this.data_base.application_name || '限时秒杀 - ' + app.globalData.data.application_title,
|
||||
desc: this.data_base.seo_desc || '限时秒杀 - ' + app.globalData.data.application_describe,
|
||||
path: '/pages/plugins/seckill/index/index?referrer=' + user_id
|
||||
};
|
||||
},
|
||||
|
||||
// 分享朋友圈
|
||||
onShareTimeline() {
|
||||
var user_id = app.globalData.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data_base.seo_title || this.data_base.application_name || '限时秒杀 - ' + app.globalData.data.application_title,
|
||||
query: 'referrer=' + user_id,
|
||||
imageUrl: this.data_base.right_images || ''
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "index", "seckill"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
time: data.time || null,
|
||||
goods: data.goods || [],
|
||||
slider: data.slider || [],
|
||||
is_valid: data.is_valid || 0,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错'
|
||||
});
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
Loading…
Reference in New Issue