wangfukang 2 weeks ago
parent
commit
9940c89a6b
  1. 89
      pages/index/index.vue

89
pages/index/index.vue

@ -2,7 +2,6 @@
<view class="page1">
<view class="swiper-container">
<view class="swiper-page" v-if="currentIndex == 0">
<view style="position: relative;height: 545rpx;">
<view style="width:100%;height: 180rpx;position: fixed;top: 0;background: #fff;z-index: 90;" v-if="lastScrollTop>583"></view>
<view style="position: absolute;top: 110rpx;left: 20rpx;z-index: 999;">
@ -67,7 +66,7 @@
<view class="like-box">
<view class="like-title">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/e0c44bc9b69a46559d3aa4160d3cf4a5.png" alt="" />
底部点击哪个都要请求一遍getWorkerCounts数字显示出来,配送页需要定时1分钟请求一次其他页面不用
</view>
<view class="like-content-box">
@ -248,11 +247,11 @@
</view>
<view class="order-page">
<view class="maotou">
#<text>{{item.numberCode != null ? item.numberCode : ''}}</text>
#样式要改<text>{{item.numberCode != null ? item.numberCode : ''}}</text>
</view>
<view class="shangjia">
<text style="font-weight: 700;">{{item.shopName != null ? item.shopName : ''}}</text>
<view
<view @tap="productDetail(item)"
style="width: 32rpx;height: 30rpx;font-weight: 700;font-size: 20rpx;color: #fff;text-align: center;background: #00BFFF;border-radius: 10rpx;margin: 20rpx 0 0 10rpx;line-height: 30rpx;">
</view>
@ -304,7 +303,7 @@
<text style="color: #777;font-size: 22rpx;" v-if="item.deliveryFeeMarketplace > 0">包含{{item.deliveryFeeMarketplace}}平台佣金</text>
</view>
</view>
<view class="beizhu" v-if="item.remark != null">
<view class="beizhu" v-if="item.remark != null && item.remark != ''">
备注{{item.remark}}
</view>
<view class="qiangdan-btn" @tap="getOrder(item,index)">
@ -348,6 +347,17 @@
</view>
</view>
</uni-popup>
<uni-popup ref="productPopup" background-color="#fff">
<view class="popup-area-content" style="height: 1200rpx;overflow: scroll;">
<view class="popup-area-title">
<text>订单详情</text>
</view>
<view class="popup-area-container" v-for="(item,index) in productData" :key="index">
<text style="display: inline-block">{{item.productName}} {{item.specs}} * {{item.quantity}}</text>
</view>
</view>
</uni-popup>
<tab-bar :width="width" @tab-index="changeIndex" :currentIndex="currentIndex"></tab-bar>
</view>
</template>
@ -477,6 +487,7 @@
waimaiCount:0,
kuaidiCount:0,
paotuiCount:0,
productData:[],
zhipaiCount:0,
searchForm:{
hallOnly: true,
@ -497,6 +508,8 @@
lastScrollTop: 0,
worker:null,
isSwitching: true,
indexZhipaiCount:0,
indexWorkerCount:0,
getAreaData:{},
putAreaData:{},
yongjin:false,
@ -516,12 +529,20 @@
filters: {
formatHourMinute(value) {
if (!value) return '';
// 使 Date
return new Date(value).toLocaleTimeString('zh-CN', {
hour: '2-digit',
minute: '2-digit',
hour12: false
});
const date = new Date(value);
// (getDate)0
const day = String(date.getDate()).padStart(2, '0');
// (getHours)0
const hour = String(date.getHours()).padStart(2, '0');
// (getMinutes)0
const minute = String(date.getMinutes()).padStart(2, '0');
// --:
return `${day}-${hour}:${minute}`;
}
},
onPageScroll(e) {
@ -596,6 +617,7 @@
}
this.getDelivery();
this.getShopArea();
this.getWorkerCounts();
}
// sticky offsetstatusBarHeight + 40px
const info = uni.getSystemInfoSync();
@ -619,6 +641,10 @@
// 400ms200ms200ms
setTimeout(() => { this.isSwitching = false; }, 400);
},
productDetail(item){
this.productData = item.goodsList;
this.$refs.productPopup.open()
},
getOrder(item,index){
let data = {
groupId:item.groupId ? item.groupId : '',
@ -632,15 +658,16 @@
if (res.code == 200) {
that.deliveryItem.splice(index,1)
that.tui.toast(res.message);
if(item.deliveryType == 1){
that.waimaiCount -= 1
}else if(item.deliveryType == 2){
that.kuaidiCount -= 1
}else if(item.deliveryType == 3){
that.paotuiCount -= 1
}
if(item.workerId != null && item.workerId != undefined && item.workerId != ''){
that.zhipaiCount -= 1
}else{
if(item.deliveryType == 1){
that.waimaiCount -= 1
}else if(item.deliveryType == 2){
that.kuaidiCount -= 1
}else if(item.deliveryType == 3){
that.paotuiCount -= 1
}
}
that.$forceUpdate();
} else {
@ -678,6 +705,30 @@
uni.hideLoading();
}).catch((res) => {});
},
getWorkerCounts(){
if(!uni.getStorageSync('worker')){
return;
}
let that = this
this.tui.request("/mall/delivery/countOrderByStatus", "POST", {workerId:uni.getStorageSync('worker').workerId}, false, true).then((res) => {
if (res.code == 200) {
if(res.result != null){
for(let i = 0;i<res.result.length;i++){
if(res.result[i].status == 0){
this.indexZhipaiCount = Number(res.result[i].orderCount)
}else{
this.indexWorkerCount += Number(res.result[i].orderCount)
}
}
}
that.$forceUpdate();
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
},
checkTab(index) {
for (let i = 0; i < this.menuList.length; i++) {
this.menuList[i].checked = (i === index);
@ -1214,7 +1265,7 @@
}
.daoda-time {
width: 200rpx;
width: 242rpx;
height: 48rpx;
font-size: 24rpx;
padding-left: 10rpx;

Loading…
Cancel
Save