首页入驻提示以及接单大厅订单详情查看及接单功能

This commit is contained in:
donqi 2022-06-29 18:07:15 +08:00
parent 72eb677974
commit bc8a301d06
5 changed files with 131 additions and 56 deletions

View File

@ -13,8 +13,8 @@ export default {
})
let userInfo = _this.getCurUserInfo();
// request 触发前拼接 url
args.url = 'https://www.opsoul.com' + args.url;
// args.url = 'http://127.0.0.1:80' + args.url;
// args.url = 'https://www.opsoul.com' + args.url;
args.url = 'http://127.0.0.1:80' + args.url;
// args.url = 'http://192.168.2.42:80' + args.url;
if (!args.data) {
@ -382,6 +382,14 @@ export default {
})
return res[1].data;
},
async getOrderMasterDetail(params = {}) {
let res = await uni.request({
url: '/order/master/app/detail',
method: 'POST',
data: params
})
return res[1].data;
},
async updateOrder(params = {}) {
let res = await uni.request({
url: '/order/master/editOrderMaster',

View File

@ -12,8 +12,7 @@
<view class="flex justify-between margin-tb-xs align-center" v-for="(item,index) in pickedList" :key="index">
<view class='cu-tag padding line-main-color basis-df'>{{item[valFieldArr[0]]}}</view>
<view class="flex justify-end basis-sm text-center">
<view class="basis-df">{{item[valFieldArr[1]]}}</view>
<view class="basis-df">{{item[valFieldArr[2]]}}</view>
<view class="basis-df" v-for="(item1,index1) in valFieldArr" v-if="index1 >= 1">{{item[item1]}}</view>
</view>
</view>
</view>

View File

@ -72,14 +72,14 @@
</view>
<view class="padding-top-sm flex justify-end">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur" data-modal="showForwardModal"
@click="showModal($event, index)">转发</button>
@click="showModal($event, task)">转发</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur" data-modal="showAddPriceModal"
@click="showModal($event, index)">加价</button>
@click="showModal($event, task)">加价</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur" v-if="task.canQuote">报价</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur"
@click="showDemandDetail($event, index)">查看</button>
@click="showDemandDetail($event, task)">查看</button>
<button class="cu-btn bg-main-color shadow-blur" data-take-modal="showTakeSuccessModal"
data-certify-modal="showTakeCertifiedModal" @click="takeTask($event, index)">接单</button>
data-certify-modal="showTakeCertifiedModal" @click="takeTask($event, task)">接单</button>
</view>
</view>
</view>
@ -220,16 +220,18 @@
areaList: [],
areaMultiIndex: [0, 0, 0],
categoryList: [],
categoryMultiIndex: [0, 0, 0]
categoryMultiIndex: [0, 0, 0],
curUserInfo: {}
}
},
onLoad() {
this.loadData();
},
onShow() {
this.loadData();
},
methods: {
async loadData() {
// this.tasks = await this.$api.data('tasks');
this.loadMasterOrderPage();
this.curUserInfo = this.$request.getCurUserInfo();
this.reloadMasterOrderPage();
this.takeCertify = await this.$api.data('takeCertify');
this.areaList = await this.$api.data('areaList');
this.categoryList = await this.$api.data('categoryList');
@ -305,31 +307,44 @@
}
this.taskConditions[this.tabCur].value = chosenCategory;
},
showDemandDetail(e, taskIndex) {
showDemandDetail(e, task) {
let paramObj = {
orderId: this.tasks[taskIndex].id
orderMasterId: task.orderMasterId
}
uni.navigateTo({
url: '/pages/demand-center/demand-detail?paramObj=' + encodeURIComponent(JSON.stringify(
paramObj))
})
},
takeTask(e, taskIndex) {
if (this.takeCertify) {
//
e.currentTarget.dataset.modal = e.currentTarget.dataset.takeModal;
this.showModal(e, taskIndex);
} else {
//
async takeTask(e, task) {
if (this.curUserInfo.status !== 0 || this.curUserInfo.type !== 0) {
//
e.currentTarget.dataset.modal = e.currentTarget.dataset.certifyModal;
this.showModal(e, taskIndex);
}
} else {
//
let res = await this.$request.updateOrder({
workerId: this.curUserInfo.workerId,
id: task.orderMasterId
});
if (res && res.code === 0) {
e.currentTarget.dataset.modal = e.currentTarget.dataset.takeModal;
this.reloadMasterOrderPage();
}
}
this.showModal(e, task);
},
contactCustomer() {
//
contactCustomer(e) {
uni.makePhoneCall({
phoneNumber: this.curTask.customerPhone
})
},
goToCertify() {
uni.navigateTo({
url: '/pages/my/master-settled-info'
})
},
showModal(e, taskIndex) {
this.curTask = this.tasks[taskIndex];
showModal(e, task) {
this.curTask = task;
this[e.currentTarget.dataset.modal] = true;
},
hideModal(e) {

View File

@ -7,15 +7,15 @@
</cu-custom>
<view class="padding bg-white margin-top-sm margin-lr-sm">
<view class="flex justify-between">
<view class="text-lg text-bold text-cut" style="width: 70%;">{{order.title}}</view>
<view class="text-lg text-bold text-cut" style="width: 70%;">{{order.goodsName}}</view>
<view class="text-right">
<view class="text-lg text-price text-red text-bold">{{order.price}}</view>
<view class="text-lg text-price text-red text-bold">{{order.totalMoney}}</view>
<view v-if="order.expeditedPrice">
<text>加急</text><text class="text-price text-red text-bold">{{order.expeditedPrice}}</text>
</view>
</view>
</view>
<view class="flex justify-start">
<view class="flex justify-start" v-if="order.tag">
<view v-for="(tagContent, index1) in order.tag" class='cu-tag margin-right-xs'>{{tagContent}}</view>
</view>
<view class="margin-top-sm">
@ -24,12 +24,12 @@
</view>
<view class="margin-top-sm">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-timefill"></text></text>
<text>{{order.doorTime}}</text>
<text>{{order.expectTimeStart + '~' + order.expectTimeEnd}}</text>
</view>
<view class="margin-top-sm">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-phone"></text></text>
<text class="margin-right-xs">{{order.contactPerson}}</text>
<text>{{order.phoneNum}}</text>
<text class="margin-right-xs">{{order.customerName}}</text>
<text>{{order.customerPhone}}</text>
</view>
</view>
<view class="margin-top-sm bg-white margin-lr-sm margin-bottom-with-bar">
@ -39,12 +39,15 @@
</view>
</view>
<view class="padding">
<view class="cu-avatar margin-bottom-sm" :style="'background-image:url(' + order.picUrl + '); width: 180rpx; height: 180rpx'"></view>
<view class="margin-bottom-sm"><text class="text-bold">商品规格</text>{{order.spec}}</view>
<view class="margin-bottom-sm"><text class="text-bold">服务类别</text>{{order.servType}}</view>
<view class="margin-bottom-sm"><text class="text-bold">订单编码</text>{{order.serialId}}</view>
<!-- <view class="cu-avatar margin-bottom-sm" :style="'background-image:url(' + order.goodsLogoUrl + '); width: 180rpx; height: 180rpx'"></view> -->
<!-- <view class="margin-bottom-sm"><text class="text-bold">商品规格</text>{{order.spec}}</view> -->
<!-- <view class="margin-bottom-sm"><text class="text-bold">服务类别</text>{{order.servType}}</view> -->
<view class="margin-bottom-sm">
<product-picked :product="order" :pickedList="order.standardList" :columnTitleArr="specColumnHeaders" :valFieldArr="specValFields"></product-picked>
</view>
<view class="margin-bottom-sm"><text class="text-bold">订单编码</text>{{order.orderMasterCode}}</view>
<view class="margin-bottom-sm"><text class="text-bold">订单时间</text>{{order.createTime}}</view>
<view class="margin-bottom-sm"><text class="text-bold">备注</text>{{order.comments}}</view>
<view class="margin-bottom-sm"><text class="text-bold">备注</text>{{order.remark}}</view>
</view>
</view>
<view class="cu-bar tabbar border shop fixed-bottom-bar">
@ -82,31 +85,53 @@
</template>
<script>
import productPicked from '@/components/goods-card/product-picked.vue';
export default {
components: {
productPicked
},
data() {
return {
inParams: {},
order: {},
takeCertify: false,
showTakeCertifiedModal: false,
showTakeSuccessModal: false
showTakeSuccessModal: false,
specColumnHeaders: ['商品规格', '购买量'],
specValFields: ['standardName', 'standardNum'],
curUserInfo: {}
}
},
onLoad(options) {
let paramObj = JSON.parse(decodeURIComponent(options.paramObj));
this.loadData(paramObj.orderId);
this.inParams = JSON.parse(decodeURIComponent(options.paramObj));
},
onShow() {
this.loadData(this.inParams.orderMasterId);
},
methods: {
async loadData(orderId) {
this.order = await this.$api.data('order');
async loadData(orderMasterId) {
// this.order = await this.$api.data('order');
this.curUserInfo = this.$request.getCurUserInfo();
let servDetailRes = await this.$request.getOrderMasterDetail({
id: orderMasterId
});
this.order = servDetailRes.data;
this.takeCertify = await this.$api.data('takeCertify');
},
takeTask(e) {
if (this.takeCertify) {
//
e.currentTarget.dataset.modal = e.currentTarget.dataset.takeModal;
} else {
async takeTask(e) {
if (this.curUserInfo.status !== 0 || this.curUserInfo.type !== 0) {
//
e.currentTarget.dataset.modal = e.currentTarget.dataset.certifyModal;
} else {
//
let res = await this.$request.updateOrder({
workerId: this.curUserInfo.workerId,
id: this.order.orderMasterId
});
if (res && res.code === 0) {
e.currentTarget.dataset.modal = e.currentTarget.dataset.takeModal;
}
}
this.showModal(e);
},
@ -120,7 +145,17 @@
uni.navigateBack({
delta: -1
})
}
},
goToCertify() {
uni.navigateTo({
url: '/pages/my/master-settled-info'
})
},
contactCustomer(e) {
uni.makePhoneCall({
phoneNumber: this.order.customerPhone
})
},
}
}
</script>

View File

@ -95,12 +95,27 @@
<view>请您选择入驻类型到家服务类请选择-服务商商品销售类请选择-配件商</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-black" @tap="hideModal" @click="chooseEntryType(1)">配件商
<view class="action margin-0 flex-sub text-black" @tap="hideModal" data-modal="isShowSteer" @click="chooseEntryType(1)">配件商
</view>
<view class="action margin-0 flex-sub text-main-color solid-left" @tap="hideModal"
@click="chooseEntryType(0)">服务商</view>
data-modal="isShowSteer" @click="chooseEntryType(0)">服务商</view>
</view>
</view>
</view>
<!-- 接单认证模态框 -->
<view class="cu-modal" :class="showTakeCertifiedModal?'show':''">
<view class="cu-dialog">
<view class="padding-xl">
<view class="cuIcon-profile big-icon padding-tb text-main-color"></view>
<view>您还未进行认证</view>
</view>
<view class="cu-bar bg-white solid-top">
<view class="action margin-0 flex-sub text-black" data-modal="showTakeCertifiedModal"
@tap="hideModal">以后认证</view>
<view class="action margin-0 flex-sub text-main-color solid-left"
data-modal="showTakeCertifiedModal" @tap="hideModal" @click="chooseEntryType(0)">立即认证</view>
</view>
</view>
</view>
<!-- 强制要求用户授权登录的弹窗 -->
<view class="cu-modal" :class="isAuthWxLoginModal?'show':''">
@ -186,7 +201,8 @@
myInfo: {},
isShowSteer: false,
isAuthWxLoginModal: false,
isAuthWxPhoneModal: false
isAuthWxPhoneModal: false,
showTakeCertifiedModal: false
}
},
onReady() {
@ -209,8 +225,10 @@
this.curUserInfo = curUserInfo;
//
this.isShowSteer = this.curUserInfo.type == null || this.curUserInfo.status !== 0 ? true : false;
this.isShowSteer = this.curUserInfo.type == null ? true : false;
//
this.showTakeCertifiedModal = this.curUserInfo.type === 0 && this.curUserInfo.status !== 0 ? true : false;
this.myInfo = await this.$api.data('myInfo');
// this.isShowSteer = !this.myInfo.entryType;
let newServModules = this.servModules.concat();
@ -244,7 +262,7 @@
}
},
hideModal(e) {
this.isShowSteer = false
this[e.currentTarget.dataset.modal] = false;
},
showMasterRule() {
let paramObj = {