wangfukang 1 month ago
parent
commit
8920fc2234
  1. 62
      pages/index/index.vue

62
pages/index/index.vue

@ -16,13 +16,7 @@
</view> </view>
<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay"
:interval="interval" :duration="duration"> :interval="interval" :duration="duration">
<swiper-item> <swiper-item v-if="item.position == 'home_top' " v-for="(item,index) in mallAds" :key="index" @tap="goAdPage(item)">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/eaae29a344a241b3b46e7b91882ca197.png" alt="" />
</swiper-item>
<swiper-item>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/eaae29a344a241b3b46e7b91882ca197.png" alt="" />
</swiper-item>
<swiper-item>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/eaae29a344a241b3b46e7b91882ca197.png" alt="" /> <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/eaae29a344a241b3b46e7b91882ca197.png" alt="" />
</swiper-item> </swiper-item>
</swiper> </swiper>
@ -101,35 +95,35 @@
style="width: 28rpx;height: 28rpx;position: absolute;top: 20rpx;right: 12rpx;"> style="width: 28rpx;height: 28rpx;position: absolute;top: 20rpx;right: 12rpx;">
</view> </view>
<view class="like-content"> <view class="like-content">
<view class="content-list"> <view class="content-list" v-if="item.position == 'home_center_left_top' " v-for="(item,index) in mallAds" :key="index" @tap="goAdPage(item)">
<view class="list-img"> <view class="list-img">
<img src="/static/images/img/shangpintu.png" alt=""> <img src="/static/images/img/shangpintu.png" alt="">
<view class="list-type">3人团</view> <view class="list-type">{{item.productList[0].groupMembers}}人团</view>
</view> </view>
<view class="list-product"> <view class="list-product">
<view class="list-name"> <view class="list-name">
<view class="list-text">炸鸡薯片零食大礼包</view> <view class="list-text">{{item.title}}</view>
</view> </view>
<view class="list-price" style="color: #00231C;">12.90</view> <view class="list-price" style="color: #00231C;">{{item.productList[0].originalPrice}}</view>
<view class="list-total"> <view class="list-total">
拼团<text style="color: red;">9.90</text> 拼团<text style="color: red;">{{item.productList[0].groupPrice}}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="content-list"> <view class="content-list" v-if="item.position == 'home_center_left_bottom' " v-for="(item,index) in mallAds" :key="index" @tap="goAdPage(item)">
<view class="list-img"> <view class="list-img">
<img src="/static/images/img/shangpintu.png" alt=""> <img src="/static/images/img/shangpintu.png" alt="">
<view class="list-type">3人团</view> <view class="list-type">{{item.productList[0].groupMembers}}人团</view>
</view> </view>
<view class="list-product"> <view class="list-product">
<view class="list-name"> <view class="list-name">
<view class="list-text">炸鸡薯片零食大礼包</view> <view class="list-text">{{item.title}}</view>
</view> </view>
<view class="list-price" style="color: #00231C;">12.90</view> <view class="list-price" style="color: #00231C;">{{item.productList[0].originalPrice}}</view>
<view class="list-total"> <view class="list-total">
拼团<text style="color: red;">9.90</text> 拼团<text style="color: red;">{{item.productList[0].groupPrice}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -144,35 +138,35 @@
style="width: 28rpx;height: 28rpx;position: absolute;top: 20rpx;right: 12rpx;"> style="width: 28rpx;height: 28rpx;position: absolute;top: 20rpx;right: 12rpx;">
</view> </view>
<view class="like-content"> <view class="like-content">
<view class="content-list"> <view class="content-list" v-if="item.position == 'home_center_right_top' " v-for="(item,index) in mallAds" :key="index" @tap="goAdPage(item)">
<view class="list-img"> <view class="list-img">
<img src="/static/images/img/shangpintu.png" alt=""> <img src="/static/images/img/shangpintu.png" alt="">
<view class="list-type">3人团</view> <view class="list-type">{{item.productList[0].groupMembers}}人团</view>
</view> </view>
<view class="list-product"> <view class="list-product">
<view class="list-name"> <view class="list-name">
<view class="list-text">炸鸡薯片零食大礼包</view> <view class="list-text">{{item.title}}</view>
</view> </view>
<view class="list-price" style="color: #00231C;">12.90</view> <view class="list-price" style="color: #00231C;">{{item.productList[0].originalPrice}}</view>
<view class="list-total"> <view class="list-total">
拼团<text style="color: red;">9.90</text> 拼团<text style="color: red;">{{item.productList[0].groupPrice}}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="content-list"> <view class="content-list" v-if="item.position == 'home_center_right_bottom' " v-for="(item,index) in mallAds" :key="index" @tap="goAdPage(item)">
<view class="list-img"> <view class="list-img">
<img src="/static/images/img/shangpintu.png" alt=""> <img src="/static/images/img/shangpintu.png" alt="">
<view class="list-type">3人团</view> <view class="list-type">{{item.productList[0].groupMembers}}人团</view>
</view> </view>
<view class="list-product"> <view class="list-product">
<view class="list-name"> <view class="list-name">
<view class="list-text">炸鸡薯片零食大礼包</view> <view class="list-text">{{item.title}}</view>
</view> </view>
<view class="list-price" style="color: #00231C;">12.90</view> <view class="list-price" style="color: #00231C;">{{item.productList[0].originalPrice}}</view>
<view class="list-total"> <view class="list-total">
拼团<text style="color: red;">9.90</text> 拼团<text style="color: red;">{{item.productList[0].groupPrice}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -494,6 +488,7 @@
areaName:'', areaName:'',
indicatorDots: false, indicatorDots: false,
autoplay: true, autoplay: true,
mallAds:[],
deliveryItem:[], deliveryItem:[],
interval: 4000, interval: 4000,
onlineWorkerInterval:4000, onlineWorkerInterval:4000,
@ -529,6 +524,7 @@
pageNum:1, pageNum:1,
getAreaId:'', getAreaId:'',
putAreaId:'', putAreaId:'',
paths:['home_top','home_center_left_top','home_center_left_bottom','home_center_right_top','home_center_right_bottom'],
order:'', order:'',
regionId:'', regionId:'',
deliveryType: 1, deliveryType: 1,
@ -756,6 +752,7 @@
this.tui.request("/mall/delivery/page", "POST", this.searchForm, false, false).then((res) => { this.tui.request("/mall/delivery/page", "POST", this.searchForm, false, false).then((res) => {
that.loadStatus = 'nomore'; that.loadStatus = 'nomore';
if (res.code == 200) { if (res.code == 200) {
that.mallAds = res.result.mallAds
that.deliveryItem = res.result.records; that.deliveryItem = res.result.records;
if(res.result.orderCount != null){ if(res.result.orderCount != null){
for(let i =0;i<res.result.orderCount.length;i++){ for(let i =0;i<res.result.orderCount.length;i++){
@ -779,6 +776,11 @@
uni.hideLoading(); uni.hideLoading();
}).catch((res) => {}); }).catch((res) => {});
}, },
goAdPage(item){
uni.navigateTo({
url: item.linkUrl + JSON.stringify(item.linkParams)
})
},
checkTab(index) { checkTab(index) {
for (let i = 0; i < this.menuList.length; i++) { for (let i = 0; i < this.menuList.length; i++) {
this.menuList[i].checked = (i === index); this.menuList[i].checked = (i === index);

Loading…
Cancel
Save