wangfukang 17 hours ago
parent
commit
805832a5b4
  1. 21
      components/tab-bar/delivery.vue
  2. 57
      components/tab-bar/myCenter.vue
  3. 30
      components/tab-bar/tab-bar.vue

21
components/tab-bar/delivery.vue

@ -184,12 +184,12 @@
</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/be29461437924dcfa4a7a6adfc771638.png"
alt="" style="width: 100%;height: 100rpx;background-size: 100%;" @tap="changeStatus(item,1)"/>
alt="" style="width: 100%;height: 100rpx;background-size: 100%;" @tap="changeStatus(index,item,1)"/>
<!-- <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(item,2)"/>
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(item,3)" />
alt="" style="width: 100%;height: 100rpx;background-size: 100%;" @tap="changeStatus(index,item,3)" />
</view>
</view>
</scroll-view>
@ -623,7 +623,7 @@
checkArea() {
this.isArea = !this.isArea
},
changeStatus(item,status){
changeStatus(index,item,status){
let url = ''
if(status == 2){
url = "/mall/delivery/pickup"
@ -635,12 +635,17 @@
let that = this
that.tui.request(url, "POST", {deliveryId:item.id,workerId:item.workerId}, false, true).then((res) => {
if (res.code == 200) {
that.tui.toast(res.message);
that.searchForm.pageNum = 1
that.getDelivery()
if(status == 2 || status == 3){
that.pageData.splice(index, 1)
}else{
that.pageData[index].arriveTime = "qq"
}
that.tui.toast(res.message,200);
/* that.searchForm.pageNum = 1
that.getDelivery() */
that.$forceUpdate();
} else {
that.tui.toast(res.message);
that.tui.toast(res.message,200);
return;
}
uni.hideLoading();

57
components/tab-bar/myCenter.vue

@ -2,9 +2,9 @@
<view class="page1">
<view>22222222</view>
<view style="margin-top: 100px;" @click="navigatorTo('merchant')">商家入驻</view>
<view style="margin-top: 100px;" @click="navigatorTo('merchantCenter')">商家中心</view>
<view style="margin-top: 100px;" @click="navigatorTo('merchantCenter')">商家中心-{{shopCounts}}</view>
<view style="margin-top: 100px;" @click="navigatorTo('jianzhizhuce')">兼职注册</view>
<view style="margin-top: 100px;" v-if="worker" @click="navigatorTo('jianzhizhuye')">兼职主页</view>
<view style="margin-top: 100px;" v-if="worker" @click="navigatorTo('jianzhizhuye')">兼职主页-{{workerCounts}}</view>
<!-- 未注册兼职弹窗 -->
<uni-popup ref="jianzhiPopup" background-color="rgba(2, 171, 255, 1)" borderRadius="40px 40px 40px 40px">
<view class="jianzhi-content" @tap="navigatorTo('partTimeReg')">
@ -33,6 +33,8 @@
data() {
return {
schoolShop:[],
workerCounts:0,
shopCounts:0,
worker:uni.getStorageSync('worker')
}
},
@ -46,6 +48,55 @@
init(){
console.log("我的初始化")
this.schoolShop = uni.getStorageSync('schoolShop')
this.worker = uni.getStorageSync('worker')
let shopId = uni.getStorageSync('shopId')
let worker = uni.getStorageSync('worker')
this.workerCounts = 0
this.shopCounts = 0
if(worker){
this.tui.request("/mall/delivery/countOrderByStatus", "POST", {workerId:uni.getStorageSync('worker').workerId,regionId:JSON.parse(uni.getStorageSync('area')).id}, 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 == 3){
this.workerCounts = Number(res.result[i].orderCount)
}
}
}
that.$forceUpdate();
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
}
if(shopId){
this.tui.request("/mall/order/countByShop/"+uni.getStorageSync('shopId'), "GET", {}, false, true).then((res) => {
if (res.code == 200) {
this.shopData = res.result
for(let i=0;i<this.shopData.orderStatusCount.length;i++){
if(this.shopData.orderStatusCount[i].counttype){
if(this.shopData.orderStatusCount[i].counttype == 'daisong'){
this.shopCounts += Number(this.shopData.orderStatusCount[i].count)
}else if(this.shopData.orderStatusCount[i].counttype == 'daiqu'){
this.shopCounts += Number(this.shopData.orderStatusCount[i].count)
}else if(this.shopData.orderStatusCount[i].counttype == 'daixiaofei'){
this.shopCounts += Number(this.shopData.orderStatusCount[i].count)
}else if(this.shopData.orderStatusCount[i].counttype == 'daichucan'){
this.shopCounts += Number(this.shopData.orderStatusCount[i].count)
}
}
}
this.shopCounts += Number(this.shopData.pendingBadReviewCount)
this.shopCounts += Number(this.shopData.refundCount)
that.$forceUpdate();
} else {
this.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
}
},
clickShop(item){
uni.setStorageSync('shopId',item.id)
@ -115,7 +166,7 @@
return
}
}else if(e=='jianzhizhuye'){
url = '/package2/partTimeJob/partTimeJobCenter'
url = '/package2/partTimeJob/partTimeJobCenter?type=worker'
}
uni.navigateTo({
url: url

30
components/tab-bar/tab-bar.vue

@ -122,7 +122,7 @@
let that = this
let shopId = uni.getStorageSync('shopId')
let worker = uni.getStorageSync('worker')
if(shopId || worker){
if(worker){
this.tui.request("/mall/delivery/countOrderByStatus", "POST", {workerId:uni.getStorageSync('worker').workerId,regionId:JSON.parse(uni.getStorageSync('area')).id}, false, true).then((res) => {
if (res.code == 200) {
if(res.result != null){
@ -132,7 +132,7 @@
}else if(res.result[i].status == 1 || res.result[i].status == 2){
this.indexWorkerCount += Number(res.result[i].orderCount)
}else{
this.indexMyCount = Number(res.result[i].orderCount)
this.indexMyCount += Number(res.result[i].orderCount)
}
}
}
@ -144,6 +144,32 @@
uni.hideLoading();
}).catch((res) => {});
}
if(shopId){
this.tui.request("/mall/order/countByShop/"+uni.getStorageSync('shopId'), "GET", {}, false, true).then((res) => {
if (res.code == 200) {
this.shopData = res.result
for(let i=0;i<this.shopData.orderStatusCount.length;i++){
if(this.shopData.orderStatusCount[i].counttype){
if(this.shopData.orderStatusCount[i].counttype == 'daisong'){
this.indexMyCount += Number(this.shopData.orderStatusCount[i].count)
}else if(this.shopData.orderStatusCount[i].counttype == 'daiqu'){
this.indexMyCount += Number(this.shopData.orderStatusCount[i].count)
}else if(this.shopData.orderStatusCount[i].counttype == 'daixiaofei'){
this.indexMyCount += Number(this.shopData.orderStatusCount[i].count)
}else if(this.shopData.orderStatusCount[i].counttype == 'daichucan'){
this.indexMyCount += Number(this.shopData.orderStatusCount[i].count)
}
}
}
this.indexMyCount += Number(this.shopData.pendingBadReviewCount)
this.indexMyCount += Number(this.shopData.refundCount)
that.$forceUpdate();
} else {
this.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
}
}
}
}

Loading…
Cancel
Save