|
|
|
@ -24,15 +24,18 @@ |
|
|
|
|
|
|
|
<view class="box1"> |
|
|
|
<view class="reg-name"> |
|
|
|
<text style="color:red;">*</text> 学生证上传 <text |
|
|
|
学生证上传 <text |
|
|
|
style="font-weight: 400;color: #777;font-size: 11px;">身份信息仅用于认证身份,平台会严格保密</text> |
|
|
|
</view> |
|
|
|
<view class="reg-value"> |
|
|
|
<image @tap="pictureAdd('mentou')" |
|
|
|
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/89d37db7e34c490da24c5dd62183bf2d.png" alt="" |
|
|
|
style="width: 160rpx;height: 160rpx;background-size: 100%;margin-right: 20rpx;" /> |
|
|
|
<image @tap="largeImg" :src="formData.studentCard" alt="" |
|
|
|
style="width: 160rpx;height: 160rpx;background-size: 100%;" /> |
|
|
|
<view class="student-card-preview" v-if="formData.studentCard"> |
|
|
|
<image @tap="largeImg" :src="formData.studentCard" alt="" |
|
|
|
style="width: 160rpx;height: 160rpx;background-size: 100%;" /> |
|
|
|
<view class="student-card-delete" @tap.stop="clearStudentCard">×</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="box1"> |
|
|
|
@ -87,9 +90,9 @@ |
|
|
|
</view> |
|
|
|
<view class="box1" v-if="formData.waima != false || formData.paotui != false"> |
|
|
|
<view class="reg-name rule-section-title"> |
|
|
|
<text style="color:red;">*</text> 我的赚钱地盘 |
|
|
|
<text v-if="formData.waima" style="color:red;">*</text> 我的赚钱地盘 |
|
|
|
</view> |
|
|
|
<view class="rule-section-desc">选择你愿意配送的取货点和楼栋,再设置最低配送费。系统只会按这些范围给你派单。</view> |
|
|
|
<view class="rule-section-desc">外卖需选择愿意配送的取货点和楼栋;快递接单范围可稍后再设置。</view> |
|
|
|
<view class="reg-value"> |
|
|
|
<view class="value1" v-if="formData.waima"> |
|
|
|
<view class="value-title"> |
|
|
|
@ -150,7 +153,7 @@ |
|
|
|
<view class="rule-empty-card" v-if="paotuiRuleList.length == 0" @tap="checkAddress('paotui')"> |
|
|
|
<view class="rule-empty-icon">地盘</view> |
|
|
|
<view class="rule-empty-title">你还没有划定快递赚钱地盘</view> |
|
|
|
<view class="rule-empty-desc">选择快递站和宿舍楼,系统才会把符合范围的快递单派给你。</view> |
|
|
|
<view class="rule-empty-desc">可先提交注册,之后再选择快递站和宿舍楼来开启对应范围派单。</view> |
|
|
|
</view> |
|
|
|
<view class="guize-list"> |
|
|
|
<view class="guize1 route-card" v-for="(item, index) in paotuiRuleList" :key="index"> |
|
|
|
@ -259,9 +262,16 @@ |
|
|
|
<view class="area-popup-title">{{currentConfigType == 'waima' ? '生成外卖接单路线' : '生成快递接单路线'}}</view> |
|
|
|
<view class="area-popup-scroll"> |
|
|
|
<view class="area-popup-desc">选中的取货点和送达区域会两两组合生成路线,新路线默认使用本弹窗填写的最低配送费和备注。</view> |
|
|
|
<view class="full-area-btn" v-if="currentConfigType == 'waima'" @tap="toggleWaimaFullAreaOrder" |
|
|
|
:class="{'full-area-btn--active': waimaFullAreaOrder}"> |
|
|
|
{{waimaFullAreaOrder ? '已开启全域接单' : '全域接单'}} |
|
|
|
</view> |
|
|
|
<view class="full-area-tip" v-if="currentConfigType == 'waima' && waimaFullAreaOrder"> |
|
|
|
因校内区域较多,请手动选择接送单区域 |
|
|
|
</view> |
|
|
|
<view class="route-default-card"> |
|
|
|
<view class="route-default-row"> |
|
|
|
<view class="route-default-label">本次最低配送费</view> |
|
|
|
<view class="route-default-label">统一设置配送费</view> |
|
|
|
<view class="route-default-input"> |
|
|
|
<text>¥</text> |
|
|
|
<input type="digit" v-model="defaultRoutePrice" placeholder="如 1" |
|
|
|
@ -422,7 +432,8 @@ |
|
|
|
dispatchSaving: false, |
|
|
|
zhipaiCheck: false, |
|
|
|
pendingNewDispatchRuleKeys: [], |
|
|
|
workerNameAuditTip: '' |
|
|
|
workerNameAuditTip: '', |
|
|
|
waimaFullAreaOrder: false |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
@ -461,6 +472,15 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getCurrentRegionId() { |
|
|
|
try { |
|
|
|
const area = uni.getStorageSync('area') |
|
|
|
if (!area) return '' |
|
|
|
return (typeof area == 'string' ? JSON.parse(area) : area).regionId || '' |
|
|
|
} catch (e) { |
|
|
|
return '' |
|
|
|
} |
|
|
|
}, |
|
|
|
formatMoneyInput(value) { |
|
|
|
value = String(value || ''); |
|
|
|
value = value.replace(/[^\d.]/g, ''); |
|
|
|
@ -594,8 +614,9 @@ |
|
|
|
getWorkerMessage(openDispatchAfterLoad, enablePushOrderAfterLoad) { |
|
|
|
const worker = uni.getStorageSync('worker') |
|
|
|
if (!worker || !worker.workerId) return |
|
|
|
const regionId = this.getCurrentRegionId() |
|
|
|
let that = this |
|
|
|
this.NB.sendRequest("/app/workerRelaPrice/getByWorkerId?workerId=" + worker.workerId, {}, false, 'get', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
this.NB.sendRequest("/app/workerRelaPrice/getByWorkerId?workerId=" + worker.workerId + "®ionId=" + regionId, {}, false, 'get', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
if (res.result != null) { |
|
|
|
let data = res.result; |
|
|
|
@ -642,14 +663,14 @@ |
|
|
|
uni.showToast({ |
|
|
|
title: res.message, |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getShopArea() { |
|
|
|
let that = this |
|
|
|
this.NB.sendRequest("/app/shopArea/getByParentId/" + JSON.parse(uni.getStorageSync('area')).regionId, {}, false, 'get', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
this.NB.sendRequest("/app/shopArea/getByParentId/" + JSON.parse(uni.getStorageSync('area')).regionId, {}, false, 'GET', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
if (res.result != null) { |
|
|
|
for (let m = 0; m < res.result.length; m++) { |
|
|
|
@ -660,10 +681,9 @@ |
|
|
|
uni.showToast({ |
|
|
|
title: res.message, |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
back() { |
|
|
|
@ -674,6 +694,10 @@ |
|
|
|
this.bigImg = this.formData.studentCard; |
|
|
|
this.$refs.imgPopup.open() |
|
|
|
}, |
|
|
|
clearStudentCard() { |
|
|
|
this.formData.studentCard = '' |
|
|
|
this.bigImg = '' |
|
|
|
}, |
|
|
|
waimaOrpaotui(type) { |
|
|
|
if (type == 'waima') { |
|
|
|
this.formData.waima = !this.formData.waima |
|
|
|
@ -701,6 +725,45 @@ |
|
|
|
}) |
|
|
|
this.$forceUpdate() |
|
|
|
}, |
|
|
|
toggleWaimaFullAreaOrder() { |
|
|
|
this.waimaFullAreaOrder = !this.waimaFullAreaOrder |
|
|
|
this.buildRouteAreaOptions('waima') |
|
|
|
}, |
|
|
|
buildRouteAreaOptions(type) { |
|
|
|
let that = this |
|
|
|
this.qucan = []; |
|
|
|
this.songcan = []; |
|
|
|
let currentRuleList = type == 'waima' ? this.waimaRuleList : this.paotuiRuleList; |
|
|
|
let isCanteenVal = type == 'waima' ? 1 : 2; |
|
|
|
let isFullAreaOrder = type == 'waima' && this.waimaFullAreaOrder; |
|
|
|
|
|
|
|
this.shopArea.forEach(item => { |
|
|
|
let isGetChecked = currentRuleList.some(r => r.getAreaId == item.id); |
|
|
|
let isPutChecked = currentRuleList.some(r => r.putAreaId == item.id); |
|
|
|
|
|
|
|
if (isFullAreaOrder) { |
|
|
|
that.qucan.push({ |
|
|
|
...item, |
|
|
|
checked: isGetChecked |
|
|
|
}); |
|
|
|
that.songcan.push({ |
|
|
|
...item, |
|
|
|
checked: isPutChecked |
|
|
|
}); |
|
|
|
} else if (item.isCanteen == isCanteenVal) { |
|
|
|
that.qucan.push({ |
|
|
|
...item, |
|
|
|
checked: isGetChecked |
|
|
|
}); |
|
|
|
} else { |
|
|
|
that.songcan.push({ |
|
|
|
...item, |
|
|
|
checked: isPutChecked |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
this.$forceUpdate() |
|
|
|
}, |
|
|
|
closeGuize() { |
|
|
|
let selectedQucan = this.qucan.filter(item => item.checked); |
|
|
|
let selectedSongcan = this.songcan.filter(item => item.checked); |
|
|
|
@ -725,6 +788,7 @@ |
|
|
|
let currentRuleList = this.currentConfigType == 'waima' ? this.waimaRuleList : this.paotuiRuleList; |
|
|
|
let newRules = []; |
|
|
|
let userId = uni.getStorageSync('id') || ''; |
|
|
|
let regionId = this.getCurrentRegionId(); |
|
|
|
selectedQucan.forEach(q => { |
|
|
|
selectedSongcan.forEach(s => { |
|
|
|
let existing = currentRuleList.find(r => r.getAreaId == q.id && r.putAreaId == s |
|
|
|
@ -734,6 +798,7 @@ |
|
|
|
} else { |
|
|
|
newRules.push({ |
|
|
|
workerId: "W" + userId, |
|
|
|
regionId: regionId, |
|
|
|
getAreaId: q.id, |
|
|
|
getAreaName: q.title, |
|
|
|
putAreaId: s.id, |
|
|
|
@ -832,11 +897,12 @@ |
|
|
|
}) |
|
|
|
} |
|
|
|
this.dispatchSaving = true |
|
|
|
this.NB.sendRequest("/app/workerRelaPrice/batchUpdate", { |
|
|
|
this.NB.sendRequest('/app/workerRelaPrice/batchUpdate', { |
|
|
|
userId: uni.getStorageSync('id'), |
|
|
|
regionId: this.getCurrentRegionId(), |
|
|
|
workerRelaPriceList: selectRuleList, |
|
|
|
getPushOrder: this.zhipaiCheck ? 1 : 0 |
|
|
|
}, false, 'post', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
}, false, 'post', 'application/json').then((res) => { |
|
|
|
this.dispatchSaving = false |
|
|
|
if (res.code == 200) { |
|
|
|
let worker = uni.getStorageSync('worker') || {} |
|
|
|
@ -858,35 +924,13 @@ |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
this.dispatchSaving = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
checkAddress(type) { |
|
|
|
let that = this |
|
|
|
this.currentConfigType = type; |
|
|
|
this.qucan = []; |
|
|
|
this.songcan = []; |
|
|
|
let currentRuleList = type == 'waima' ? this.waimaRuleList : this.paotuiRuleList; |
|
|
|
let isCanteenVal = type == 'waima' ? 1 : 2; |
|
|
|
|
|
|
|
this.shopArea.forEach(item => { |
|
|
|
let isGetChecked = currentRuleList.some(r => r.getAreaId == item.id); |
|
|
|
let isPutChecked = currentRuleList.some(r => r.putAreaId == item.id); |
|
|
|
|
|
|
|
if (item.isCanteen == isCanteenVal) { |
|
|
|
that.qucan.push({ |
|
|
|
...item, |
|
|
|
checked: isGetChecked |
|
|
|
}); |
|
|
|
} else { |
|
|
|
that.songcan.push({ |
|
|
|
...item, |
|
|
|
checked: isPutChecked |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
this.buildRouteAreaOptions(type) |
|
|
|
this.$refs.guizePopup.open() |
|
|
|
}, |
|
|
|
removeRule(type, index) { |
|
|
|
@ -903,10 +947,6 @@ |
|
|
|
title: '请填写姓名', |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
if (!this.formData.studentCard) return uni.showToast({ |
|
|
|
title: '请上传学生证', |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
if (!this.formData.waima && !this.formData.paotui) return uni.showToast({ |
|
|
|
title: '请至少选择一种兼职类型', |
|
|
|
icon: 'none' |
|
|
|
@ -918,13 +958,6 @@ |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
} |
|
|
|
if (this.formData.paotui && this.paotuiRuleList.length == 0) { |
|
|
|
return uni.showToast({ |
|
|
|
title: '请先划定快递赚钱地盘', |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
let workerRelaPriceList = []; |
|
|
|
if (this.formData.waima) { |
|
|
|
this.waimaRuleList.forEach(item => this.normalizeOrderBkge(item)); |
|
|
|
@ -947,8 +980,11 @@ |
|
|
|
workerRelaPriceList = workerRelaPriceList.concat(this.paotuiRuleList); |
|
|
|
} |
|
|
|
|
|
|
|
const regionId = this.getCurrentRegionId(); |
|
|
|
workerRelaPriceList.forEach(item => item.regionId = regionId); |
|
|
|
let submitData = { |
|
|
|
userId: uni.getStorageSync('id'), |
|
|
|
regionId: regionId, |
|
|
|
workerName: this.formData.name, |
|
|
|
cardPicture: this.formData.studentCard, |
|
|
|
highFloorFee: this.formatOneDecimalInput(this.formData.highFloorFee), |
|
|
|
@ -965,7 +1001,7 @@ |
|
|
|
title: '提交中...', |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
this.NB.sendRequest("/app/workerRelaPrice/batchAdd", submitData, false, 'post', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
this.NB.sendRequest("/app/workerRelaPrice/batchAdd", submitData, false, 'post', 'application/json').then((res) => { |
|
|
|
uni.hideLoading(); |
|
|
|
if (res.code == 200) { |
|
|
|
let user = res.result; |
|
|
|
@ -978,7 +1014,7 @@ |
|
|
|
worker1.workerName = this.formData.name |
|
|
|
if (hasNewRule) worker1.getPushOrder = 1 |
|
|
|
uni.setStorageSync('worker', worker1) |
|
|
|
this.getWorkerMessage(true, hasNewRule) |
|
|
|
this.getWorkerMessage(workerRelaPriceList.length > 0, hasNewRule) |
|
|
|
} else { |
|
|
|
const message = this.getResponseMessage(res, '提交失败') |
|
|
|
if (this.isWorkerNameAuditMessage(message)) { |
|
|
|
@ -990,7 +1026,6 @@ |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
uni.hideLoading(); |
|
|
|
const message = this.getResponseMessage(err, '提交失败,请稍后再试') |
|
|
|
@ -1003,6 +1038,7 @@ |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
pictureAdd() { |
|
|
|
let that = this |
|
|
|
@ -1088,7 +1124,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
.back-btn { |
|
|
|
padding-top:80rpx; |
|
|
|
padding-top:110rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.content { |
|
|
|
@ -1128,6 +1164,33 @@ |
|
|
|
height: 500rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.student-card-preview { |
|
|
|
display: inline-block; |
|
|
|
position: relative; |
|
|
|
width: 160rpx; |
|
|
|
height: 160rpx; |
|
|
|
vertical-align: top; |
|
|
|
} |
|
|
|
|
|
|
|
.student-card-preview image { |
|
|
|
display: block; |
|
|
|
} |
|
|
|
|
|
|
|
.student-card-delete { |
|
|
|
position: absolute; |
|
|
|
top: -14rpx; |
|
|
|
right: -14rpx; |
|
|
|
width: 36rpx; |
|
|
|
height: 36rpx; |
|
|
|
line-height: 34rpx; |
|
|
|
border-radius: 50%; |
|
|
|
background: rgba(0, 0, 0, 0.65); |
|
|
|
color: #fff; |
|
|
|
font-size: 30rpx; |
|
|
|
text-align: center; |
|
|
|
z-index: 2; |
|
|
|
} |
|
|
|
|
|
|
|
.liangge-popup-content { |
|
|
|
background: #fff; |
|
|
|
border-radius: 10px; |
|
|
|
@ -1606,6 +1669,35 @@ |
|
|
|
line-height: 36rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.full-area-btn { |
|
|
|
margin-top: 16rpx; |
|
|
|
height: 70rpx; |
|
|
|
line-height: 70rpx; |
|
|
|
border-radius: 70rpx; |
|
|
|
background: rgba(247, 248, 248, 0.9); |
|
|
|
border: 1px solid rgba(0, 35, 28, 0.12); |
|
|
|
color: #00624f; |
|
|
|
font-size: 26rpx; |
|
|
|
font-weight: 900; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
|
|
|
|
.full-area-btn--active { |
|
|
|
background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1)); |
|
|
|
border-color: rgba(166, 255, 234, 1); |
|
|
|
color: #00231C; |
|
|
|
} |
|
|
|
|
|
|
|
.full-area-tip { |
|
|
|
margin-top: 12rpx; |
|
|
|
padding: 16rpx 18rpx; |
|
|
|
border-radius: 18rpx; |
|
|
|
background: rgba(255, 244, 214, 0.8); |
|
|
|
color: #9A5A00; |
|
|
|
font-size: 24rpx; |
|
|
|
line-height: 34rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.area-popup-scroll { |
|
|
|
flex: 1; |
|
|
|
min-height: 0; |
|
|
|
|