wangfukang 3 days ago
parent
commit
276f8ad29a
  1. 22
      components/tab-bar/delivery.vue
  2. 5
      components/tab-bar/tab-bar.vue
  3. 28
      package1/group/shopEvaluate.vue
  4. 7
      package1/order/orderEvaluate.vue
  5. 2
      package2/shop/merchantCenter.vue
  6. 124
      package2/shop/shopOrderList.vue
  7. 5
      pages/index/index.vue

22
components/tab-bar/delivery.vue

@ -79,7 +79,9 @@
<view v-if="item.deliveryType == 3" style="height: 40rpx;line-height: 40rpx;background: rgba(130, 255, 130, 1);padding: 0 16rpx;border-radius: 40rpx;margin: 14rpx 20rpx 0 0;"> <view v-if="item.deliveryType == 3" style="height: 40rpx;line-height: 40rpx;background: rgba(130, 255, 130, 1);padding: 0 16rpx;border-radius: 40rpx;margin: 14rpx 20rpx 0 0;">
代跑腿 代跑腿
</view> </view>
{{item.mustFinishTime != null ? item.mustFinishTime : '' | formatHourMinute }}前送达 <view class="" :style="{'color':shouldNotify(item.mustFinishTime)?'red':''}">
{{item.mustFinishTime != null ? item.mustFinishTime : '' | formatHourMinute }}前送达
</view>
</view> </view>
<view class="" v-if="item.remark != '' && item.remark != null" <view class="" v-if="item.remark != '' && item.remark != null"
style="background: #f5f5f5;height: 80rpx;line-height: 80rpx;font-weight: 500;padding: 0 20rpx;border-radius: 20rpx;"> style="background: #f5f5f5;height: 80rpx;line-height: 80rpx;font-weight: 500;padding: 0 20rpx;border-radius: 20rpx;">
@ -370,7 +372,7 @@
const minute = String(date.getMinutes()).padStart(2, '0'); const minute = String(date.getMinutes()).padStart(2, '0');
// --: // --:
return `${day}-${hour}:${minute}`; return `${day}${hour}:${minute}`;
} }
}, },
methods: { methods: {
@ -408,6 +410,20 @@
this.getDelivery() this.getDelivery()
this.$forceUpdate(); this.$forceUpdate();
}, },
shouldNotify(mustFinishTimeStr) {
// ISO 8601
const targetTime = new Date(mustFinishTimeStr);
//
if (isNaN(targetTime.getTime())) {
throw new Error('Invalid date format: ' + mustFinishTimeStr);
}
const currentTime = new Date();
const diffMs = targetTime - currentTime; //
// diffMs <= 0 100 < diffMs < 600000
return diffMs <= 0 || diffMs < 10 * 60 * 1000;
},
getDelivery(){ getDelivery(){
let that = this let that = this
this.tui.request("/mall/delivery/pagebyworker", "POST", this.searchForm, false, false).then((res) => { this.tui.request("/mall/delivery/pagebyworker", "POST", this.searchForm, false, false).then((res) => {
@ -756,7 +772,7 @@
} }
.maotou { .maotou {
width: 90rpx; width: 280rpx;
background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/a1584a13e9db4b6fbcc66890219d0018.png') no-repeat; background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/a1584a13e9db4b6fbcc66890219d0018.png') no-repeat;
height: 90rpx; height: 90rpx;
background-size: 100%; background-size: 100%;

5
components/tab-bar/tab-bar.vue

@ -120,6 +120,11 @@
this.indexWorkerCount = 0 this.indexWorkerCount = 0
this.indexMyCount = 0 this.indexMyCount = 0
let that = this let that = this
let shopId = uni.getStorageSync('shopId')
let worker = uni.getStorageSync('worker')
if(!shopId && !worker){
return
}
this.tui.request("/mall/delivery/countOrderByStatus", "POST", {workerId:uni.getStorageSync('worker').workerId}, false, true).then((res) => { this.tui.request("/mall/delivery/countOrderByStatus", "POST", {workerId:uni.getStorageSync('worker').workerId}, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if(res.result != null){ if(res.result != null){

28
package1/group/shopEvaluate.vue

@ -45,7 +45,7 @@
{{item.createByName}} {{item.createByName}}
</view> </view>
<view class="eval-time"> <view class="eval-time">
{{item.createTime}} {{item.createTime | formatTime}}
</view> </view>
</view> </view>
</view> </view>
@ -125,6 +125,32 @@
}, },
components: { components: {
},
filters:{
formatTime(value) {
const date = new Date(value);
//
const year = date.getFullYear();
// (getMonth 0-11 +1)0
const month = String(date.getMonth() + 1).padStart(2, '0');
// (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');
// (getSeconds)0
const second = String(date.getSeconds()).padStart(2, '0');
// -- ::
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
}
}, },
onLoad(option) { onLoad(option) {
this.shopItem = JSON.parse(option.item) this.shopItem = JSON.parse(option.item)

7
package1/order/orderEvaluate.vue

@ -211,7 +211,9 @@
score:this.shopEvaluateNum, score:this.shopEvaluateNum,
orderId:this.shopData.id, orderId:this.shopData.id,
shopId:this.shopData.shopId, shopId:this.shopData.shopId,
},{ // }]
if(this.shopData.deliveryType == 1){
data.push({ //
parentId:'', parentId:'',
leve:0, leve:0,
remark:this.shopRemark, remark:this.shopRemark,
@ -222,7 +224,8 @@
score:this.manEvaluateNum, score:this.manEvaluateNum,
orderId:this.shopData.id, orderId:this.shopData.id,
shopId:this.manId, shopId:this.manId,
}] })
}
that.tui.request("/app/comment/save", "POST", data, false, false).then((res) => { that.tui.request("/app/comment/save", "POST", data, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({

2
package2/shop/merchantCenter.vue

@ -281,7 +281,7 @@
case 'pj': case 'pj':
let item = { let item = {
shopScore:uni.getStorageSync('shopScore'), shopScore:uni.getStorageSync('shopScore'),
id:uni.getStorageSync('id') id:uni.getStorageSync('shopId')
} }
url = '/package1/group/shopEvaluate?item=' + JSON.stringify(item) url = '/package1/group/shopEvaluate?item=' + JSON.stringify(item)
break; break;

124
package2/shop/shopOrderList.vue

@ -53,13 +53,84 @@
</view> </view>
</view> </view>
<view style="height: 80rpx;border-top: 1px solid #eee;display: flex;"> <view style="height: 80rpx;border-top: 1px solid #eee;display: flex;">
<view v-if="item.orderType != 1" style="margin: 20rpx 0;background: linear-gradient(90deg, #FF4500, #FFA07A);width: 40rpx;height: 40rpx;line-height: 40rpx;text-align: center;border-radius: 10rpx;color: #fff;"></view> <view class="pinzi" @tap.stop="tanchuang(item.deliveryType)" style="width:80rpx;font-weight:700;margin-right: 20rpx;color:#00231C;background:linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1))">
{{item.deliveryType == 1?'配送':'自取'}}
</view>
<view v-if="item.orderType != 1" @tap.stop="getGroupOrders(item.id)" class="pinzi">
</view>
<view style="flex: 1;"></view> <view style="flex: 1;"></view>
<view @tap.stop="mealServing(item)" v-if="currentIndex == 13" class="btn" style="margin: 10rpx 0 0 20rpx;"> <view @tap.stop="mealServing(item)" v-if="currentIndex == 13" class="btn" style="margin: 10rpx 0 0 20rpx;">
已出餐 已出餐
</view> </view>
</view> </view>
</view> </view>
<!-- 拼团详情弹窗 -->
<uni-popup ref="pintuanPopup" background-color="#fff">
<view class="guize-list">
<view v-for="(item,index) in tuanzhangOrder" :key="index">
<view style="height: 80rpx;line-height: 80rpx;font-size: 36rpx;font-weight: 700;">
订单{{index + 1}}
</view>
<view class="">
<view class="dingdan">
<view class="pt-title">
配送信息
</view>
<view style="display:flex">
<view style="width:300rpx;">
配送编号
</view>
<view class="pituan-text">
{{item.numberCode}}
</view>
</view>
<view style="display:flex">
<view style="width:300rpx;">
订单号
</view>
<view class="pituan-text">
{{item.id}}
</view>
</view>
<view style="display:flex">
<view style="width:300rpx;">
订单时间
</view>
<view class="pituan-text">
{{item.createTime | formatISOTime}}
</view>
</view>
</view>
<view class="dingdan" v-for="(item1,index1) in item.goodsList" :key="index1">
<view class="pt-title">
商品信息
</view>
<view style="display: flex;font-weight: 700;">
<view style="flex:1">
商品名{{item1.productName}}
</view>
<view style="width:100rpx;">
X{{item1.quantity}}
</view>
<view style="width:220rpx;text-align: right;padding-right:20rpx;">
{{item1.price}}
</view>
</view>
</view>
<view class="dingdan">
<view style="text-align: right;padding-right: 20rpx;color: #777;">
餐盒费{{item.packageFee}} 配送费{{item.deliveryFee}}
</view>
<view style="text-align: right;padding-right: 20rpx;font-size: 28rpx;font-weight: 700;color: red;">
总计{{item.totalAmount}}
</view>
</view>
</view>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
@ -77,6 +148,7 @@
regionId: JSON.parse(uni.getStorageSync('area')).id regionId: JSON.parse(uni.getStorageSync('area')).id
}, },
totalPages: 1, totalPages: 1,
tuanzhangOrder:[],
orderList: [], orderList: [],
currentIndex: 10, currentIndex: 10,
menuButtonInfo: {}, menuButtonInfo: {},
@ -197,6 +269,21 @@
uni.hideLoading(); uni.hideLoading();
}).catch((res) => {}); }).catch((res) => {});
}, },
tanchuang(v){
this.tui.toast('该订单为'+(v==1?'配送':'自取')+'单')
},
getGroupOrders(id){
this.tui.request("/mall/order/selectAllOrderByOrderId/"+id, "GET", {}, false, true).then((res) => {
if (res.code == 200) {
this.tuanzhangOrder = res.result;
this.$refs.pintuanPopup.open('bottom')
} else {
that.tui.toast(res.message)
return
}
uni.hideLoading()
}).catch((res) => {})
},
openPopup(){ openPopup(){
this.$refs.groupPopup.open() this.$refs.groupPopup.open()
}, },
@ -373,4 +460,39 @@
font-weight: 700; font-weight: 700;
margin-top: 20rpx; margin-top: 20rpx;
} }
.pinzi{
margin: 20rpx 0;
background: linear-gradient(90deg, #FF4500, #FFA07A);
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
text-align: center;
border-radius: 10rpx;
color: #fff;
}
.guize-list {
width: 100%;
padding: 20rpx;
overflow: scroll;
background: #fff;
max-height: 1000rpx;
line-height: 25px;
}
.pt-title{
font-size: 28rpx;
font-weight: 700;
color: #777;
}
.dingdan{
border-top: 1px solid #eee;
}
.uni-popup__wrapper{
border-radius: 20rpx !important;
}
.pituan-text{
flex:1;
text-align:right;
padding-right:20rpx;
font-weight: 700;
}
</style> </style>

5
pages/index/index.vue

@ -26,8 +26,9 @@
<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>
<view class="" style="background: #fff;">
<swiper class="swiper" vertical circular :autoplay="orderLists.length > 0" <swiper class="swiper" vertical circular :autoplay="orderLists.length > 0"
:interval="onlineWorkerInterval" :duration="onlineWorkerDuration"> :interval="onlineWorkerInterval" :duration="onlineWorkerDuration" style="height: 74px;margin-top: -50px;">
<swiper-item v-if="orderLists.length > 0" v-for="(item,index) in orderLists" :key="index" @tap="goOrderDetail(item)"> <swiper-item v-if="orderLists.length > 0" v-for="(item,index) in orderLists" :key="index" @tap="goOrderDetail(item)">
<view class="order-msg-box"> <view class="order-msg-box">
<view class="order-msg-left"> <view class="order-msg-left">
@ -58,6 +59,8 @@
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view>
<view class="menu-box"> <view class="menu-box">
<view class="menu-list" @tap="goDetail('1')"> <view class="menu-list" @tap="goDetail('1')">

Loading…
Cancel
Save