|
|
|
@ -1,9 +1,10 @@ |
|
|
|
<template> |
|
|
|
<view class="page1"> |
|
|
|
<common-loading /> |
|
|
|
<view class="title"> |
|
|
|
<view class="title-sreach"> |
|
|
|
<view style="position: absolute;display: flex;" :style="{'top': menuButtonInfo.top +'px'}"> |
|
|
|
<view class="sort-member" style="width: 260rpx;"> |
|
|
|
<view class="sort-member delivery-title-tabs"> |
|
|
|
<view class="tab1"> |
|
|
|
<view class="tabs1" @tap="checkTab1('daiqu')" |
|
|
|
:style="{'color':tab1Checked == 'daiqu'?'#000':'#777','font-size':tab1Checked== 'daiqu'?'36rpx':'30rpx'}"> |
|
|
|
@ -30,11 +31,14 @@ |
|
|
|
style="width: 80rpx;height: 14rpx;position: absolute;bottom: 4rpx;left: 32rpx;" /> |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
<view class="title-refresh" :class="{'title-refresh--loading': refreshLoading}" @tap.stop="refreshCurrentTab"> |
|
|
|
<uni-icons type="refresh" size="20" color="#0b6b5a" style="margin-top: 6rpx;"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="height: 50rpx;width: 95%;margin: -200rpx auto 0;display: flex;line-height: 50rpx;"> |
|
|
|
</view> |
|
|
|
<view class="delivery-filter-row"> |
|
|
|
|
|
|
|
<view class="guize-box1" |
|
|
|
:style="{'background':tab1Checked1 == 'fantuan'?'rgba(130, 255, 130, 1)':'rgba(247, 248, 248, 0.6)'}" |
|
|
|
@ -54,14 +58,11 @@ |
|
|
|
<uni-icons type="info" size="10"></uni-icons> |
|
|
|
跑腿 |
|
|
|
</view> |
|
|
|
<view style="padding-right: 12rpx;">|</view> |
|
|
|
<view class="filter-divider">|</view> |
|
|
|
<view class="guize-box" @tap="openPopup()"> |
|
|
|
<uni-icons type="info" size="10"></uni-icons> |
|
|
|
接单规则 |
|
|
|
</view> |
|
|
|
<view class="refresh-box" @tap.stop="refreshCurrentTab"> |
|
|
|
刷新 |
|
|
|
</view> |
|
|
|
<view class=""> |
|
|
|
<view @tap="changeOnline(0)" class="shangxia-btn shangxian-btn" v-if="isOnLine==1"> |
|
|
|
<text>已上线</text> |
|
|
|
@ -201,20 +202,32 @@ |
|
|
|
用户申请退款中 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-else style="width: 100%;height: 100rpx;margin-top: 32rpx;"> |
|
|
|
<img v-if="item.status == 1 && item.arriveTime == null" |
|
|
|
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/d649c22310874f19a74cf8dfbb1c7240.png" |
|
|
|
alt="" style="width: 100%;height: 100rpx;background-size: 100%;" |
|
|
|
@tap="changeStatus(index,item,1)" /> |
|
|
|
<view v-else class="order-action"> |
|
|
|
<view v-if="item.status == 1 && item.arriveTime == null" |
|
|
|
class="order-action-btn order-action-btn--arrive" |
|
|
|
@tap="changeStatus(index,item,1)"> |
|
|
|
<view class="order-action-icon"> |
|
|
|
<uni-icons type="hand-up-filled" size="24" color="#fff"></uni-icons> |
|
|
|
</view> |
|
|
|
<text>已到店</text> |
|
|
|
</view> |
|
|
|
<!-- <view style="width: 20%;" @tap="changeOthers(item,1)">转单</view> --> |
|
|
|
<img v-if="item.status == 1 && item.arriveTime != null" |
|
|
|
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c318cf292a4f40b296995c30e5e539ea.png" |
|
|
|
alt="" style="width: 100%;height: 100rpx;background-size: 100%;" |
|
|
|
@tap="changeStatus(index,item,2)" /> |
|
|
|
<img v-if="item.status == 2 && item.arriveTime != null" |
|
|
|
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/a8cdd6d86e9140df86d3c3c60356bd53.png" |
|
|
|
alt="" style="width: 100%;height: 100rpx;background-size: 100%;" |
|
|
|
@tap="changeStatus(index,item,3)" /> |
|
|
|
<view v-if="item.status == 1 && item.arriveTime != null" |
|
|
|
class="order-action-btn order-action-btn--pickup" |
|
|
|
@tap="changeStatus(index,item,2)"> |
|
|
|
<view class="order-action-icon"> |
|
|
|
<uni-icons type="hand-up-filled" size="24" color="#fff"></uni-icons> |
|
|
|
</view> |
|
|
|
<text>已取货</text> |
|
|
|
</view> |
|
|
|
<view v-if="item.status == 2 && item.arriveTime != null" |
|
|
|
class="order-action-btn order-action-btn--complete" |
|
|
|
@tap="changeStatus(index,item,3)"> |
|
|
|
<view class="order-action-icon"> |
|
|
|
<uni-icons type="hand-up-filled" size="24" color="#fff"></uni-icons> |
|
|
|
</view> |
|
|
|
<text>已送达</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<uni-load-more :status="loadStatus" @change="onChange" /> |
|
|
|
@ -402,6 +415,10 @@ |
|
|
|
selectRuleList: [], |
|
|
|
totalPages: 1, |
|
|
|
paotuiRuleList: [], |
|
|
|
loginRedirecting: false, |
|
|
|
refreshLoading: false, |
|
|
|
refreshLoadingStartTime: 0, |
|
|
|
refreshLoadingTimer: null, |
|
|
|
lineStatus: [{ |
|
|
|
title: '上线', |
|
|
|
value: 0 |
|
|
|
@ -422,6 +439,16 @@ |
|
|
|
onReachBottom() { |
|
|
|
this.onReachPage(); |
|
|
|
}, |
|
|
|
beforeDestroy() { |
|
|
|
if (this.refreshLoadingTimer) { |
|
|
|
clearTimeout(this.refreshLoadingTimer) |
|
|
|
this.refreshLoadingTimer = null |
|
|
|
} |
|
|
|
if (this.refreshLoading) { |
|
|
|
this.refreshLoading = false |
|
|
|
uni.hideLoading() |
|
|
|
} |
|
|
|
}, |
|
|
|
filters: { |
|
|
|
formatHourMinute(value) { |
|
|
|
if (!value) return ''; |
|
|
|
@ -484,10 +511,38 @@ |
|
|
|
urls: [url] |
|
|
|
}); |
|
|
|
}, |
|
|
|
ensureLogin() { |
|
|
|
const token = uni.getStorageSync('hiver_token') |
|
|
|
if (token && typeof token === 'string' && token.trim() && token !== 'null' && token !== 'undefined') { |
|
|
|
return true |
|
|
|
} |
|
|
|
if (this.loginRedirecting) return false |
|
|
|
this.loginRedirecting = true |
|
|
|
const pages = getCurrentPages() |
|
|
|
const current = pages && pages.length ? pages[pages.length - 1] : null |
|
|
|
const route = current ? '/' + current.route : '/pages/index/index' |
|
|
|
const query = current && current.options |
|
|
|
? Object.keys(current.options).map(key => key + '=' + encodeURIComponent(current.options[key])).join('&') |
|
|
|
: '' |
|
|
|
const target = route + (query ? '?' + query : '') |
|
|
|
const redirectKey = 'login_redirect_' + Date.now() |
|
|
|
uni.setStorageSync(redirectKey, target) |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/package2/login/login?redirect=' + redirectKey, |
|
|
|
complete: () => { |
|
|
|
setTimeout(() => { |
|
|
|
this.loginRedirecting = false |
|
|
|
}, 1200) |
|
|
|
} |
|
|
|
}) |
|
|
|
return false |
|
|
|
}, |
|
|
|
init() { |
|
|
|
if (!this.ensureLogin()) return |
|
|
|
let worker = uni.getStorageSync('worker') |
|
|
|
if (worker == '' || worker == undefined || worker == null) { |
|
|
|
this.tui.toast('您还没有注册兼职') |
|
|
|
return |
|
|
|
} |
|
|
|
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() |
|
|
|
this.isOnLine = uni.getStorageSync('worker').isOnLine |
|
|
|
@ -506,6 +561,7 @@ |
|
|
|
}, |
|
|
|
// 获取用户位置 |
|
|
|
getUserLocation(item) { |
|
|
|
if (!this.ensureLogin()) return |
|
|
|
let that = this; |
|
|
|
uni.getLocation({ |
|
|
|
type: 'gcj02', |
|
|
|
@ -524,6 +580,7 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
onReachPage() { |
|
|
|
if (!this.ensureLogin()) return |
|
|
|
if (this.isLoadingPage || this.searchForm.pageNum >= this.totalPages) return; |
|
|
|
this.isLoadingPage = true; |
|
|
|
this.searchForm.pageNum++; |
|
|
|
@ -554,6 +611,7 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
chooseType(type) { |
|
|
|
if (!this.ensureLogin()) return |
|
|
|
if (this.tab1Checked1 == type) { |
|
|
|
this.tab1Checked1 = '' |
|
|
|
this.searchForm.deliveryType = null |
|
|
|
@ -587,6 +645,7 @@ |
|
|
|
return diffMs <= 0 || diffMs < 10 * 60 * 1000; |
|
|
|
}, |
|
|
|
getDelivery() { |
|
|
|
if (!this.ensureLogin()) return |
|
|
|
let that = this |
|
|
|
that.isLoadingPage = true; |
|
|
|
this.tui.request("/mall/delivery/pagebyworker", "POST", this.searchForm, false, false).then((res) => { |
|
|
|
@ -613,11 +672,17 @@ |
|
|
|
that.$forceUpdate(); |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (that.refreshLoading) { |
|
|
|
that.finishRefreshLoading() |
|
|
|
} else { |
|
|
|
uni.hideLoading(); |
|
|
|
} |
|
|
|
}).catch((res) => { |
|
|
|
that.isLoadingPage = false; |
|
|
|
if (that.refreshLoading) { |
|
|
|
that.finishRefreshLoading() |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
//查看大图 |
|
|
|
@ -686,6 +751,7 @@ |
|
|
|
workerRelaPriceList: this.selectRuleList, |
|
|
|
getPushOrder: this.zhipaiCheck ? 1 : 0 |
|
|
|
}; |
|
|
|
if (!this.ensureLogin()) return |
|
|
|
let that = this; |
|
|
|
this.tui.request('/app/workerRelaPrice/batchUpdate', 'post', submitData).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
@ -725,12 +791,18 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
openPopup() { |
|
|
|
if (!this.ensureLogin()) return |
|
|
|
const worker = uni.getStorageSync('worker') |
|
|
|
if (!worker || !worker.workerId) { |
|
|
|
this.tui.toast('您还没有注册兼职') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.isOnLine != 1) { |
|
|
|
this.tui.toast('请先上线后配置'); |
|
|
|
return; |
|
|
|
} |
|
|
|
let that = this |
|
|
|
that.tui.request("/app/workerRelaPrice/getByWorkerId?workerId=" + uni.getStorageSync('worker').workerId, |
|
|
|
that.tui.request("/app/workerRelaPrice/getByWorkerId?workerId=" + worker.workerId, |
|
|
|
"GET", {}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
if (res.result != null) { |
|
|
|
@ -793,6 +865,7 @@ |
|
|
|
this.isArea = !this.isArea |
|
|
|
}, |
|
|
|
changeStatus(index, item, status) { |
|
|
|
if (!this.ensureLogin()) return |
|
|
|
let regionId = JSON.parse(uni.getStorageSync('area')).id |
|
|
|
let url = '' |
|
|
|
if (status == 2) { |
|
|
|
@ -857,6 +930,7 @@ |
|
|
|
}).catch((res) => {}); |
|
|
|
}, |
|
|
|
checkTab1(type) { |
|
|
|
if (!this.ensureLogin()) return |
|
|
|
this.tab1Checked = type |
|
|
|
if (type == 'daiqu') { |
|
|
|
this.searchForm.status = 1 |
|
|
|
@ -868,16 +942,46 @@ |
|
|
|
this.getDelivery() |
|
|
|
}, |
|
|
|
refreshCurrentTab() { |
|
|
|
if (!this.ensureLogin()) return |
|
|
|
if (this.refreshLoading) return |
|
|
|
this.refreshLoading = true |
|
|
|
this.refreshLoadingStartTime = Date.now() |
|
|
|
if (this.refreshLoadingTimer) { |
|
|
|
clearTimeout(this.refreshLoadingTimer) |
|
|
|
this.refreshLoadingTimer = null |
|
|
|
} |
|
|
|
uni.showLoading({ |
|
|
|
title: '刷新中...', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
this.searchForm.pageNum = 1 |
|
|
|
this.scrollToTop() |
|
|
|
this.getDelivery() |
|
|
|
}, |
|
|
|
finishRefreshLoading() { |
|
|
|
const elapsed = Date.now() - this.refreshLoadingStartTime |
|
|
|
const delay = Math.max(1000 - elapsed, 0) |
|
|
|
if (this.refreshLoadingTimer) { |
|
|
|
clearTimeout(this.refreshLoadingTimer) |
|
|
|
} |
|
|
|
this.refreshLoadingTimer = setTimeout(() => { |
|
|
|
this.refreshLoading = false |
|
|
|
this.refreshLoadingTimer = null |
|
|
|
uni.hideLoading() |
|
|
|
}, delay) |
|
|
|
}, |
|
|
|
makeCall(phone) { |
|
|
|
uni.makePhoneCall({ |
|
|
|
phoneNumber: phone |
|
|
|
}); |
|
|
|
}, |
|
|
|
changeOnline(value) { |
|
|
|
if (!this.ensureLogin()) return |
|
|
|
const worker = uni.getStorageSync('worker') |
|
|
|
if (!worker || !worker.workerId) { |
|
|
|
this.tui.toast('您还没有注册兼职') |
|
|
|
return |
|
|
|
} |
|
|
|
let url = '' |
|
|
|
if (this.isOnLine == value) { |
|
|
|
if (value == 0) { |
|
|
|
@ -896,7 +1000,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
this.tui.request(url, "POST", { |
|
|
|
id: uni.getStorageSync('worker').workerId |
|
|
|
id: worker.workerId |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
let worker = uni.getStorageSync('worker') || {}; // 避免取不到时出错 |
|
|
|
@ -968,6 +1072,49 @@ |
|
|
|
height: 60rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.delivery-title-tabs { |
|
|
|
width: 380rpx; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
.delivery-title-tabs .tab1 { |
|
|
|
width: 260rpx; |
|
|
|
flex-shrink: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.title-refresh { |
|
|
|
width: 58rpx; |
|
|
|
height: 58rpx; |
|
|
|
margin-left: 18rpx; |
|
|
|
flex-shrink: 0; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
border: 2rpx solid rgba(166, 255, 234, 0.88); |
|
|
|
border-radius: 50%; |
|
|
|
background: rgba(255, 255, 255, 0.7); |
|
|
|
box-shadow: 0 8rpx 20rpx rgba(0, 35, 28, 0.08); |
|
|
|
} |
|
|
|
|
|
|
|
.title-refresh:active { |
|
|
|
opacity: 0.75; |
|
|
|
} |
|
|
|
|
|
|
|
.title-refresh--loading { |
|
|
|
animation: refresh-rotate 0.8s linear infinite; |
|
|
|
} |
|
|
|
|
|
|
|
@keyframes refresh-rotate { |
|
|
|
0% { |
|
|
|
transform: rotate(0deg); |
|
|
|
} |
|
|
|
|
|
|
|
100% { |
|
|
|
transform: rotate(360deg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.tab1 { |
|
|
|
height: 60rpx; |
|
|
|
line-height: 60rpx; |
|
|
|
@ -982,6 +1129,22 @@ |
|
|
|
flex: 1; |
|
|
|
} |
|
|
|
|
|
|
|
.delivery-filter-row { |
|
|
|
width: 95%; |
|
|
|
height: 72rpx; |
|
|
|
margin: -200rpx auto 0; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
line-height: 64rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.filter-divider { |
|
|
|
flex-shrink: 0; |
|
|
|
padding: 0 14rpx 0 2rpx; |
|
|
|
color: rgba(0, 35, 28, 0.72); |
|
|
|
font-weight: 700; |
|
|
|
} |
|
|
|
|
|
|
|
.content { |
|
|
|
flex: 1; |
|
|
|
width: 95%; |
|
|
|
@ -1094,6 +1257,64 @@ |
|
|
|
font-weight: 700; |
|
|
|
} |
|
|
|
|
|
|
|
.order-action { |
|
|
|
width: 100%; |
|
|
|
height: 104rpx; |
|
|
|
margin-top: 32rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.order-action-btn { |
|
|
|
position: relative; |
|
|
|
width: 100%; |
|
|
|
height: 96rpx; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
overflow: hidden; |
|
|
|
border-radius: 48rpx; |
|
|
|
color: #fff; |
|
|
|
font-size: 34rpx; |
|
|
|
font-weight: 900; |
|
|
|
letter-spacing: 2rpx; |
|
|
|
box-shadow: 0 14rpx 30rpx rgba(0, 70, 58, 0.18); |
|
|
|
} |
|
|
|
|
|
|
|
.order-action-btn::before { |
|
|
|
content: ''; |
|
|
|
position: absolute; |
|
|
|
top: 0; |
|
|
|
left: -20%; |
|
|
|
width: 56%; |
|
|
|
height: 100%; |
|
|
|
background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)); |
|
|
|
transform: skewX(-18deg); |
|
|
|
} |
|
|
|
|
|
|
|
.order-action-btn:active { |
|
|
|
transform: scale(0.98); |
|
|
|
opacity: 0.9; |
|
|
|
} |
|
|
|
|
|
|
|
.order-action-btn--arrive, |
|
|
|
.order-action-btn--pickup, |
|
|
|
.order-action-btn--complete { |
|
|
|
background: |
|
|
|
radial-gradient(circle at 88% 45%, rgba(166, 255, 234, 0.52) 0, rgba(166, 255, 234, 0) 120rpx), |
|
|
|
linear-gradient(90deg, #07372f 0%, #005849 52%, #0aa385 100%); |
|
|
|
} |
|
|
|
|
|
|
|
.order-action-icon { |
|
|
|
position: relative; |
|
|
|
width: 52rpx; |
|
|
|
height: 52rpx; |
|
|
|
margin-right: 12rpx; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
border-radius: 50%; |
|
|
|
background: rgba(255, 255, 255, 0.18); |
|
|
|
} |
|
|
|
|
|
|
|
.guize-list { |
|
|
|
width: 600rpx; |
|
|
|
padding: 20rpx 20rpx 0; |
|
|
|
@ -1230,45 +1451,44 @@ |
|
|
|
} |
|
|
|
|
|
|
|
.shangxia-btn { |
|
|
|
width: 132rpx; |
|
|
|
height: 50rpx; |
|
|
|
background-size: 100%; |
|
|
|
width: 150rpx; |
|
|
|
height: 64rpx; |
|
|
|
line-height: 64rpx; |
|
|
|
flex-shrink: 0; |
|
|
|
background-size: 132rpx 50rpx; |
|
|
|
background-position: center; |
|
|
|
font-size: 20rpx; |
|
|
|
font-weight: 700; |
|
|
|
box-sizing: border-box; |
|
|
|
} |
|
|
|
|
|
|
|
.guize-box { |
|
|
|
font-size: 20rpx; |
|
|
|
font-weight: 700; |
|
|
|
background: rgba(166, 255, 234, 1); |
|
|
|
width: 140rpx; |
|
|
|
height: 50rpx; |
|
|
|
border-radius: 50rpx; |
|
|
|
margin-right: 15rpx; |
|
|
|
padding-left: 10rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.refresh-box { |
|
|
|
font-size: 20rpx; |
|
|
|
font-weight: 700; |
|
|
|
background: rgba(223, 255, 176, 1); |
|
|
|
color: #0b6b5a; |
|
|
|
width: 90rpx; |
|
|
|
height: 50rpx; |
|
|
|
width: 132rpx; |
|
|
|
height: 64rpx; |
|
|
|
line-height: 64rpx; |
|
|
|
border-radius: 50rpx; |
|
|
|
margin-right: 15rpx; |
|
|
|
margin-right: 12rpx; |
|
|
|
padding: 0 4rpx; |
|
|
|
text-align: center; |
|
|
|
box-sizing: border-box; |
|
|
|
flex-shrink: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.guize-box1 { |
|
|
|
font-size: 20rpx; |
|
|
|
font-weight: 700; |
|
|
|
text-align: center; |
|
|
|
width: 140rpx; |
|
|
|
height: 50rpx; |
|
|
|
width: 110rpx; |
|
|
|
height: 64rpx; |
|
|
|
line-height: 64rpx; |
|
|
|
border-radius: 50rpx; |
|
|
|
margin-right: 15rpx; |
|
|
|
padding-left: 10rpx; |
|
|
|
margin-right: 12rpx; |
|
|
|
padding: 0 4rpx; |
|
|
|
box-sizing: border-box; |
|
|
|
flex-shrink: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.product-popup-content { |
|
|
|
|