wangfukang 18 hours ago
parent
commit
5cdb8dcd33
  1. 105
      package3/myCenter/problemFeedback.vue
  2. 127
      package3/shop/transferDeliveryOrderList.vue

105
package3/myCenter/problemFeedback.vue

@ -11,6 +11,13 @@
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<view class="service-phone-card" @tap="callPlatformService">
<view>
<view class="service-phone-label">平台客服电话</view>
<view class="service-phone-value">{{servicePhoneLoading ? '正在获取客服热线...' : '遇到问题可联系平台客服'}}</view>
</view>
<view class="service-phone-action">联系客服</view>
</view>
<view class="list-head"> <view class="list-head">
<text>我的反馈</text> <text>我的反馈</text>
<text class="list-tip">按处理状态和时间排序</text> <text class="list-tip">按处理状态和时间排序</text>
@ -79,6 +86,8 @@
typeOptions: ['投诉', '吐槽', '建议', '其他'], typeOptions: ['投诉', '吐槽', '建议', '其他'],
pictureList: [], pictureList: [],
loading: false, loading: false,
servicePhone: '',
servicePhoneLoading: false,
totalPages: 0, totalPages: 0,
feedbackList: [], feedbackList: [],
form: { form: {
@ -97,6 +106,7 @@
onLoad() { onLoad() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect ? uni.getMenuButtonBoundingClientRect() : {} this.menuButtonInfo = uni.getMenuButtonBoundingClientRect ? uni.getMenuButtonBoundingClientRect() : {}
this.form.contactPhone = uni.getStorageSync('mobile') || uni.getStorageSync('phone') || '' this.form.contactPhone = uni.getStorageSync('mobile') || uni.getStorageSync('phone') || ''
this.getPlatformServicePhone()
this.getFeedbackList() this.getFeedbackList()
}, },
computed: { computed: {
@ -116,11 +126,65 @@
}, },
getArea() { getArea() {
try { try {
return uni.getStorageSync('area') ? JSON.parse(uni.getStorageSync('area')) : {} const area = uni.getStorageSync('area')
if (!area) return {}
if (typeof area === 'object') return area
return JSON.parse(area)
} catch (e) { } catch (e) {
return {} return {}
} }
}, },
getCurrentRegionId() {
const area = this.getArea()
return area && area.id ? area.id : ''
},
makeCall(phone) {
if (!phone) {
this.tui.toast('暂无联系电话')
return
}
uni.makePhoneCall({
phoneNumber: phone
})
},
getPlatformServicePhone(callAfterFetch = false) {
if (this.servicePhone) {
if (callAfterFetch) {
this.makeCall(this.servicePhone)
}
return
}
if (this.servicePhoneLoading) return
const regionId = this.getCurrentRegionId()
if (!regionId) {
if (callAfterFetch) {
this.tui.toast('请选择区域')
}
return
}
this.servicePhoneLoading = true
this.tui.request('/mall/admin/seckillGroup/customerPhone/get', 'GET', {
regionId: regionId
}, false, true).then((res) => {
this.servicePhoneLoading = false
if (res.code == 200 && res.result) {
this.servicePhone = res.result
if (callAfterFetch) {
this.makeCall(res.result)
}
} else if (callAfterFetch) {
this.tui.toast(res.message || '获取客服电话失败')
}
}).catch(() => {
this.servicePhoneLoading = false
if (callAfterFetch) {
this.tui.toast('获取客服电话失败')
}
})
},
callPlatformService() {
this.getPlatformServicePhone(true)
},
getFeedbackList() { getFeedbackList() {
if (this.loading) return if (this.loading) return
this.loading = true this.loading = true
@ -305,6 +369,43 @@
padding: 0 24rpx 180rpx; padding: 0 24rpx 180rpx;
} }
.service-phone-card {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 4rpx 24rpx;
padding: 24rpx 10rpx;
border-radius: 28rpx;
background: linear-gradient(135deg, #FFFFFF 0%, #ECFFF7 100%);
box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
}
.service-phone-label {
color: #60706C;
font-size: 24rpx;
font-weight: 700;
}
.service-phone-value {
margin-top: 8rpx;
color: #00231C;
font-size: 26rpx;
font-weight: 700;
}
.service-phone-action {
min-width: 108rpx;
height: 56rpx;
padding: 0 24rpx;
border-radius: 999rpx;
background: #34C8A0;
color: #fff;
font-size: 24rpx;
font-weight: 900;
line-height: 56rpx;
text-align: center;
}
.feedback-popup, .feedback-popup,
.feedback-item { .feedback-item {
border-radius: 28rpx; border-radius: 28rpx;
@ -436,7 +537,7 @@
} }
.feedback-scroll { .feedback-scroll {
height: calc(100vh - 348rpx); height: calc(100vh - 476rpx);
min-height: 520rpx; min-height: 520rpx;
} }

127
package3/shop/transferDeliveryOrderList.vue

@ -3,11 +3,13 @@
<view class="fixed-head"> <view class="fixed-head">
<view class="nav" :style="{'height': navHeight + 'px'}"> <view class="nav" :style="{'height': navHeight + 'px'}">
<view class="back" :style="{'top': backTop + 'px'}" @tap="back"><uni-icons type="left" size="26"></uni-icons></view> <view class="back" :style="{'top': backTop + 'px'}" @tap="back"><uni-icons type="left" size="26"></uni-icons></view>
<view class="title" :style="{'top': titleTop + 'px','height': capsuleHeight + 'px','line-height': capsuleHeight + 'px'}">中转配送</view> <view class="title" :style="{'top': titleTop + 'px','height': capsuleHeight + 'px','line-height': capsuleHeight + 'px'}">{{isWorkerMode ? '中转单' : '中转配送'}}</view>
</view> </view>
<view class="tabs"> <view class="tabs">
<view class="tab" :class="{active: tab === 'wait'}" @tap="switchTab('wait')">待送达</view> <view class="tab" v-if="isWorkerMode" :class="{active: tab === 'wait'}" @tap="switchTab('wait')">待接单</view>
<view class="tab" :class="{active: tab === 'done'}" @tap="switchTab('done')">已送达</view> <view class="tab" v-if="isWorkerMode" :class="{active: tab === 'accepted'}" @tap="switchTab('accepted')">待送达中转点({{transferTodoCount}})</view>
<view class="tab" v-if="!isWorkerMode" :class="{active: tab === 'wait'}" @tap="switchTab('wait')">待送达</view>
<view class="tab" v-if="!isWorkerMode" :class="{active: tab === 'done'}" @tap="switchTab('done')">已送达</view>
</view> </view>
</view> </view>
<scroll-view class="list" :style="{'top': listTop + 'px'}" scroll-y @scrolltolower="loadMore"> <scroll-view class="list" :style="{'top': listTop + 'px'}" scroll-y @scrolltolower="loadMore">
@ -17,6 +19,13 @@
<view class="appointment-delivery-tag" v-if="item.appointmentDelivery == 1">预约配送</view> <view class="appointment-delivery-tag" v-if="item.appointmentDelivery == 1">预约配送</view>
<view class="code" v-if="item.numberCode">#{{item.numberCode}}</view> <view class="code" v-if="item.numberCode">#{{item.numberCode}}</view>
</view> </view>
<view class="row">
<view class="label">商家</view>
<view class="value phone-value" @tap.stop="makeCall(item.shopPhone)">
<text>{{item.shopName || '-'}}</text>
<text v-if="item.shopPhone" class="phone">{{item.shopPhone}}</text>
</view>
</view>
<view class="row"> <view class="row">
<view class="label">中转点</view> <view class="label">中转点</view>
<view class="value">{{item.transferAddressName || item.shopName}}</view> <view class="value">{{item.transferAddressName || item.shopName}}</view>
@ -37,13 +46,20 @@
<view class="label">取餐码</view> <view class="label">取餐码</view>
<view class="value pickup-code">{{item.transferPickupCode || '配送员接单后生成'}}</view> <view class="value pickup-code">{{item.transferPickupCode || '配送员接单后生成'}}</view>
</view> </view>
<view class="row"> <view class="row" v-if="!isWorkerMode">
<view class="label">配送员</view> <view class="label">配送员</view>
<view class="value phone-value" @tap.stop="makeCall(item.workerPhone)"> <view class="value phone-value" @tap.stop="makeCall(item.workerPhone)">
<text>{{item.workerName || '未分配'}}</text> <text>{{item.workerName || '未分配'}}</text>
<text v-if="item.workerPhone" class="phone">{{item.workerPhone}}</text> <text v-if="item.workerPhone" class="phone">{{item.workerPhone}}</text>
</view> </view>
</view> </view>
<view class="row" v-if="item.transferWorkerId">
<view class="label">中转员</view>
<view class="value phone-value" @tap.stop="makeCall(item.transferWorkerMobile)">
<text>{{item.transferWorkerName || '未分配'}}</text>
<text v-if="item.transferWorkerMobile" class="phone">{{item.transferWorkerMobile}}</text>
</view>
</view>
<view class="row"> <view class="row">
<view class="label">用户</view> <view class="label">用户</view>
<view class="value phone-value" @tap.stop="makeCall(item.receiverPhone)"> <view class="value phone-value" @tap.stop="makeCall(item.receiverPhone)">
@ -58,12 +74,18 @@
<view class="arrive-info" v-if="item.transferArriveTime"> <view class="arrive-info" v-if="item.transferArriveTime">
已送达中转点{{formatTime(item.transferArriveTime)}} 已送达中转点{{formatTime(item.transferArriveTime)}}
</view> </view>
<view class="actions" v-else-if="isWorkerMode && tab === 'wait'">
<view class="main-btn" :class="{'main-btn-disabled': item.transferAccepting}" @tap.stop="transferAccept(index,item)">
{{item.transferAccepting ? '接单中...' : '接单'}}
</view>
</view>
<view class="actions" v-else> <view class="actions" v-else>
<view class="photo-btn" @tap.stop="chooseImage(index)">拍照</view> <view class="photo-btn" @tap.stop="chooseImage(index)">拍照</view>
<view class="main-btn" @tap.stop="transferArrive(index,item)">送达中转点</view> <view class="main-btn" @tap.stop="transferArrive(index,item)">送达中转点</view>
</view> </view>
</view> </view>
<view class="empty" v-if="list.length === 0 && loadStatus === 'nomore'">暂无中转配送单</view> <uni-load-more :status="loadStatus" />
<view class="empty" v-if="list.length === 0 && loadStatus === 'nomore'">{{isWorkerMode ? (tab === 'accepted' ? '暂无待送达中转点订单' : '暂无待接中转单') : '暂无中转配送单'}}</view>
</scroll-view> </scroll-view>
<uni-popup ref="productPopup" background-color="transparent"> <uni-popup ref="productPopup" background-color="transparent">
<view class="product-popup-content"> <view class="product-popup-content">
@ -104,8 +126,13 @@
data() { data() {
return { return {
tab: 'wait', tab: 'wait',
isWorkerMode: false,
currentWorker: {},
transferTodoCount: 0,
acceptingTransferId: '',
list: [], list: [],
productData: [], productData: [],
isLoadingPage: false,
loadStatus: 'more', loadStatus: 'more',
totalPages: 1, totalPages: 1,
searchForm: { searchForm: {
@ -114,6 +141,9 @@
deliveryType: 1, deliveryType: 1,
transferDelivery: 1, transferDelivery: 1,
transferArriveEmpty: true, transferArriveEmpty: true,
transferWorkerView: false,
transferWorkerAccepted: false,
transferWorkerId: '',
shopId: '', shopId: '',
regionId: '' regionId: ''
}, },
@ -124,6 +154,9 @@
listTop: 210 listTop: 210
} }
}, },
onLoad(options) {
this.isWorkerMode = !!(options && options.role === 'worker')
},
onShow() { onShow() {
this.initNavMetrics() this.initNavMetrics()
this.resetList() this.resetList()
@ -165,27 +198,67 @@
this.totalPages = 1 this.totalPages = 1
this.list = [] this.list = []
this.loadStatus = 'more' this.loadStatus = 'more'
this.searchForm.transferArriveEmpty = this.tab === 'wait' this.isLoadingPage = false
this.searchForm.shopId = uni.getStorageSync('shopId')
const area = uni.getStorageSync('area') const area = uni.getStorageSync('area')
this.searchForm.regionId = area ? JSON.parse(area).id : '' this.searchForm.regionId = area ? JSON.parse(area).id : ''
this.searchForm.transferWorkerView = this.isWorkerMode
if (this.isWorkerMode) {
this.currentWorker = uni.getStorageSync('worker') || {}
this.searchForm.shopId = ''
this.searchForm.transferWorkerId = this.currentWorker.workerId || ''
this.searchForm.transferArriveEmpty = true
this.searchForm.transferWorkerAccepted = this.tab === 'accepted'
} else {
this.searchForm.shopId = uni.getStorageSync('shopId')
this.searchForm.transferWorkerId = ''
this.searchForm.transferArriveEmpty = this.tab === 'wait'
this.searchForm.transferWorkerAccepted = false
}
this.getList() this.getList()
}, },
loadMore() { loadMore() {
if (this.searchForm.pageNum >= this.totalPages) return if (this.isLoadingPage || this.searchForm.pageNum >= this.totalPages) return
this.searchForm.pageNum++ this.searchForm.pageNum++
this.getList() this.getList()
}, },
getList() { getList() {
if (this.isLoadingPage) return
this.isLoadingPage = true
this.tui.request('/mall/delivery/pageTransferDelivery', 'POST', this.searchForm, false, false).then((res) => { this.tui.request('/mall/delivery/pageTransferDelivery', 'POST', this.searchForm, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
const records = res.result.records || [] const records = res.result.records || []
this.list = this.searchForm.pageNum == 1 ? records : this.list.concat(records) this.list = this.searchForm.pageNum == 1 ? records : this.list.concat(records)
this.totalPages = res.result.pages || 1 this.totalPages = res.result.pages || 1
this.loadStatus = this.searchForm.pageNum >= this.totalPages ? 'nomore' : 'more' this.loadStatus = this.searchForm.pageNum >= this.totalPages ? 'nomore' : 'more'
if (this.isWorkerMode) {
if (this.tab === 'accepted') {
this.transferTodoCount = Number(res.result.total) || 0
} else {
this.getTransferTodoCount()
}
}
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }
this.isLoadingPage = false
}).catch(() => {
this.isLoadingPage = false
})
},
getTransferTodoCount() {
if (!this.isWorkerMode || !this.searchForm.transferWorkerId) {
this.transferTodoCount = 0
return
}
const params = Object.assign({}, this.searchForm, {
pageNum: 1,
pageSize: 1,
transferWorkerAccepted: true
})
this.tui.request('/mall/delivery/pageTransferDelivery', 'POST', params, false, false).then((res) => {
if (res.code == 200) {
this.transferTodoCount = Number((res.result || {}).total) || 0
}
}) })
}, },
chooseImage(index) { chooseImage(index) {
@ -227,6 +300,43 @@
} }
}) })
}, },
transferAccept(index, item) {
if (this.acceptingTransferId) return
const worker = this.currentWorker && this.currentWorker.workerId ? this.currentWorker : (uni.getStorageSync('worker') || {})
if (!worker.workerId) {
this.tui.toast('您还没有注册兼职')
return
}
this.acceptingTransferId = item.id
this.$set(this.list[index], 'transferAccepting', true)
uni.showLoading({
title: '接单中...',
mask: true
})
this.tui.request('/mall/delivery/transferAccept', 'POST', {
deliveryId: item.id,
workerId: worker.workerId,
workerName: worker.workerName || '',
workerMobile: worker.mobile || ''
}, false, true).then((res) => {
if (res.code == 200) {
this.list.splice(index, 1)
this.transferTodoCount += 1
this.tui.toast('接单成功')
} else {
this.tui.toast(res.message)
this.resetList()
}
}).catch(() => {
this.tui.toast('接单失败,请重试')
}).then(() => {
this.acceptingTransferId = ''
if (this.list[index] && this.list[index].id === item.id) {
this.$set(this.list[index], 'transferAccepting', false)
}
uni.hideLoading()
})
},
productDetail(item) { productDetail(item) {
const goodsList = item.goodsList || item.mallOrderGoodsList || item.orderGoodsList || [] const goodsList = item.goodsList || item.mallOrderGoodsList || item.orderGoodsList || []
this.productData = goodsList this.productData = goodsList
@ -290,6 +400,7 @@
.photo-btn,.main-btn{flex:1;height:76rpx;line-height:76rpx;text-align:center;border-radius:38rpx;font-weight:700;} .photo-btn,.main-btn{flex:1;height:76rpx;line-height:76rpx;text-align:center;border-radius:38rpx;font-weight:700;}
.photo-btn{background:#f2f6f4;color:#0b9b73;} .photo-btn{background:#f2f6f4;color:#0b9b73;}
.main-btn{background:linear-gradient(90deg,#e3ff96,#a6ffea);color:#00231c;} .main-btn{background:linear-gradient(90deg,#e3ff96,#a6ffea);color:#00231c;}
.main-btn-disabled{opacity:.58;}
.empty{text-align:center;color:#8a9692;padding:80rpx 0;} .empty{text-align:center;color:#8a9692;padding:80rpx 0;}
.product-popup-content { .product-popup-content {
width: 680rpx; width: 680rpx;

Loading…
Cancel
Save