|
|
@@ -31,7 +31,8 @@
|
|
|
<uni-swiper-dot :info="bannerList" mode="dot" :dotsStyles="dotStyle" :current="current">
|
|
|
<swiper class="swiper" @change="change">
|
|
|
<swiper-item v-for="(item,i) in bannerList" :key="i">
|
|
|
- <image class="swiper-item" :src="item.image" mode="aspectFill" @click="bannerClock(item)"></image>
|
|
|
+ <image class="swiper-item" :src="item.image" mode="aspectFill" @click="bannerClock(item)">
|
|
|
+ </image>
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
</uni-swiper-dot>
|
|
|
@@ -47,7 +48,7 @@
|
|
|
</view>
|
|
|
<!-- 通知 -->
|
|
|
<view class="box-border-box plr-24">
|
|
|
- <view class="msg-box align-items-center box-border-box mb-32">
|
|
|
+ <view class="msg-box align-items-center box-border-box">
|
|
|
<image class="image-1" src="@/static/img/index/index-tz.png" mode="scaleToFill"></image>
|
|
|
<view class="box-1 fs-20 fc-41ABF5">公告</view>
|
|
|
<swiper class="tz-swiper" :vertical="true" circular :autoplay="true" :interval="3000"
|
|
|
@@ -60,11 +61,11 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 限时秒杀 -->
|
|
|
- <view class="box-border-box plr-24" v-if="seckillGoodsList.length > 0">
|
|
|
+ <view class="spike-box box-border-box" v-if="seckillGoodsList.length > 0">
|
|
|
<view class="xsms-box mb-32">
|
|
|
<image class="image-title" src="@/static/img/index/index-xsms.png" mode="scaleToFill"></image>
|
|
|
<view class="xsms-box-list-f box-border-box plr-12">
|
|
|
- <view class="xsms-box-list display-flex ">
|
|
|
+ <scroll-view class="xsms-box-list display-flex" scroll-x="true">
|
|
|
<view class="xsms-box-list-item box-border-box p-8" v-for="(item,i) in seckillGoodsList"
|
|
|
:key="i" @click="toShop(item)">
|
|
|
<image class="xsms-box-list-item-img-1 mb-4" :src="item.goods_image" mode="aspectFill">
|
|
|
@@ -78,20 +79,28 @@
|
|
|
<image class="xsms-box-list-item-img-2" src="@/static/img/index/index-q.png"
|
|
|
mode="scaleToFill"></image>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </scroll-view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 类型选择 -->
|
|
|
- <view class="type-list-box display-flex" :style="[{'background':bgckgroundType}]">
|
|
|
+ <view class="type-list-box display-flex bgc-F5F4F9" :style="[{'background':bgckgroundType}]">
|
|
|
<view class="type-item-box view-nowrap" :class="category_id==item.id?'s-type':'n-type'"
|
|
|
v-for="(item,i) in typeList" :key="i" @click="selectType(item.id)">{{item.name}}</view>
|
|
|
</view>
|
|
|
<!-- 商品列表 -->
|
|
|
- <view class="box-border-box plr-24">
|
|
|
+ <view class="" v-if="goodsList.length<=0">
|
|
|
+ <enBlankVue></enBlankVue>
|
|
|
+ </view>
|
|
|
+ <view class="box-border-box plr-24" v-else>
|
|
|
<view class="goos-list-box box-border-box p-24 display-flex" v-for="(item,i) in goodsList" :key="i"
|
|
|
@click="toShop(item)">
|
|
|
- <image class="left-img" :src="item.shop_logo" mode="aspectFill"></image>
|
|
|
+ <view class="left-img-box">
|
|
|
+ <image class="left-img" :src="item.shop_logo" mode="aspectFill"></image>
|
|
|
+ <view class="status-box fc-f" v-if="item.status != 1">
|
|
|
+ 休息中
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="flex-1">
|
|
|
<view class="align-items-center mb-8">
|
|
|
<view class="right-box-title fs-32 fw-600 text-overflow-ellipsis-one">{{item.shop_name}}
|
|
|
@@ -166,6 +175,7 @@
|
|
|
|
|
|
</template>
|
|
|
<script>
|
|
|
+ import enBlankVue from "@/components/en-utils/en-blank/en-blank.vue";
|
|
|
import tools from "@/service/tools";
|
|
|
import {
|
|
|
getNotice,
|
|
|
@@ -185,6 +195,9 @@
|
|
|
receiveCoupon
|
|
|
} from '@/api/coupon.js'
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ enBlankVue
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
BarH: 0,
|
|
|
@@ -303,14 +316,20 @@
|
|
|
this.getNotice();
|
|
|
this.getSeckillGoods();
|
|
|
this.getTakeaway();
|
|
|
- this.page = 1;
|
|
|
- this.goodsList = [];
|
|
|
- this.getGoodsList();
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
let userToken = uni.getStorageSync('token')
|
|
|
- if(userToken){
|
|
|
+ if (userToken) {
|
|
|
this.couponHome()
|
|
|
}
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ this.page = 1;
|
|
|
+ this.goodsList = [];
|
|
|
+ this.getGoodsList();
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+
|
|
|
},
|
|
|
onPageScroll(e) {
|
|
|
if (e.scrollTop > 1) {
|
|
|
@@ -349,64 +368,67 @@
|
|
|
this.current = e.detail.current
|
|
|
},
|
|
|
bannerClock(item) {
|
|
|
- if(item.type == 1) {
|
|
|
+ if (item.type == 1) {
|
|
|
// 外卖首页
|
|
|
uni.navigateTo({
|
|
|
url: '/pages-takeout/takeout'
|
|
|
})
|
|
|
- }else if(item.type == 2) {
|
|
|
- if(item.to_id != 0) {
|
|
|
+ } else if (item.type == 2) {
|
|
|
+ if (item.to_id != 0) {
|
|
|
// 外卖商家
|
|
|
uni.navigateTo({
|
|
|
url: '/pages-takeout/shop?shop_id=' + item.to_id
|
|
|
})
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
// 外卖首页
|
|
|
uni.navigateTo({
|
|
|
url: '/pages-takeout/takeout'
|
|
|
})
|
|
|
}
|
|
|
- }else if(item.type == 3) {
|
|
|
+ } else if (item.type == 3) {
|
|
|
// 代取页
|
|
|
uni.navigateTo({
|
|
|
url: '/pages-takeout/replace-take'
|
|
|
})
|
|
|
- }else if (item.type === 4) {
|
|
|
+ } else if (item.type === 4) {
|
|
|
// 团购页
|
|
|
uni.navigateTo({
|
|
|
url: '/pages-buy/group'
|
|
|
})
|
|
|
- }else if(item.type === 5) {
|
|
|
+ } else if (item.type === 5) {
|
|
|
// 票务页
|
|
|
uni.navigateTo({
|
|
|
url: '/pages-buy/ticket'
|
|
|
})
|
|
|
- }else if(item.type === 6) {
|
|
|
+ } else if (item.type === 6) {
|
|
|
// 干洗页
|
|
|
uni.navigateTo({
|
|
|
url: '/pages-buy/dry-clean'
|
|
|
})
|
|
|
- }else if(item.type === 7) {
|
|
|
+ } else if (item.type === 7) {
|
|
|
// 校友圈
|
|
|
uni.navigateTo({
|
|
|
url: '/pages-school/school-circle'
|
|
|
})
|
|
|
- }else if(item.type === 8) {
|
|
|
+ } else if (item.type === 8) {
|
|
|
// 骑手申请页
|
|
|
uni.navigateTo({
|
|
|
url: '/pages-my/rider-recruit'
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- receive(item,index) {
|
|
|
- receiveCoupon({grant_id: item.grant_id,coupon_id: item.coupon_id}).then((res) => {
|
|
|
- if(res.code == 1) {
|
|
|
+ receive(item, index) {
|
|
|
+ receiveCoupon({
|
|
|
+ grant_id: item.grant_id,
|
|
|
+ coupon_id: item.coupon_id
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 1) {
|
|
|
tools.success(res.msg)
|
|
|
this.couponData.splice(index, 1)
|
|
|
- if(this.couponData.length<=0) {
|
|
|
+ if (this.couponData.length <= 0) {
|
|
|
this.gbPOp()
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
tools.error(res.msg)
|
|
|
}
|
|
|
})
|
|
|
@@ -549,6 +571,9 @@
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+ .spike-box{
|
|
|
+ padding: 24rpx 24rpx 0;
|
|
|
+ }
|
|
|
.wh32 {
|
|
|
width: 32rpx;
|
|
|
height: 32rpx;
|
|
|
@@ -738,7 +763,7 @@
|
|
|
}
|
|
|
|
|
|
.xsms-box-list {
|
|
|
- overflow-y: scroll;
|
|
|
+ white-space: nowrap;
|
|
|
|
|
|
.xsms-box-list-item:last-child {
|
|
|
margin-right: 0;
|
|
|
@@ -751,6 +776,7 @@
|
|
|
border-radius: 8rpx;
|
|
|
margin-right: 8rpx;
|
|
|
position: relative;
|
|
|
+ display: inline-block;
|
|
|
|
|
|
.xsms-box-list-item-img-1 {
|
|
|
width: 164rpx;
|
|
|
@@ -774,8 +800,9 @@
|
|
|
left: 0;
|
|
|
// top: calc(var(BarH)px + 93rpx);
|
|
|
top: calc(86px + 93rpx);
|
|
|
- padding: 0 24rpx 24rpx 24rpx;
|
|
|
+ padding: 24rpx;
|
|
|
overflow-x: scroll;
|
|
|
+ z-index: 666;
|
|
|
|
|
|
.type-item-box {
|
|
|
margin-right: 16rpx;
|
|
|
@@ -828,13 +855,31 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .left-img {
|
|
|
+ .left-img-box {
|
|
|
width: 100rpx;
|
|
|
height: 100rpx;
|
|
|
- border-radius: 12rpx;
|
|
|
margin-right: 16rpx;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ .left-img {
|
|
|
+ width: 100rpx;
|
|
|
+ height: 100rpx;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ }
|
|
|
+ .status-box{
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ padding: 4rpx 0;
|
|
|
+ text-align: center;
|
|
|
+ background: rgba(0,0,0, 0.5);
|
|
|
+ font-size: 17rpx;
|
|
|
+ border-radius: 0 0 12rpx 12rpx;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
.img-x {
|
|
|
width: 24rpx;
|
|
|
height: 24rpx;
|