首页入驻提示以及接单大厅订单详情查看及接单功能
This commit is contained in:
parent
72eb677974
commit
bc8a301d06
|
|
@ -13,8 +13,8 @@ export default {
|
||||||
})
|
})
|
||||||
let userInfo = _this.getCurUserInfo();
|
let userInfo = _this.getCurUserInfo();
|
||||||
// request 触发前拼接 url
|
// request 触发前拼接 url
|
||||||
args.url = 'https://www.opsoul.com' + args.url;
|
// args.url = 'https://www.opsoul.com' + args.url;
|
||||||
// args.url = 'http://127.0.0.1:80' + args.url;
|
args.url = 'http://127.0.0.1:80' + args.url;
|
||||||
// args.url = 'http://192.168.2.42:80' + args.url;
|
// args.url = 'http://192.168.2.42:80' + args.url;
|
||||||
|
|
||||||
if (!args.data) {
|
if (!args.data) {
|
||||||
|
|
@ -382,6 +382,14 @@ export default {
|
||||||
})
|
})
|
||||||
return res[1].data;
|
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 = {}) {
|
async updateOrder(params = {}) {
|
||||||
let res = await uni.request({
|
let res = await uni.request({
|
||||||
url: '/order/master/editOrderMaster',
|
url: '/order/master/editOrderMaster',
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,7 @@
|
||||||
<view class="flex justify-between margin-tb-xs align-center" v-for="(item,index) in pickedList" :key="index">
|
<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='cu-tag padding line-main-color basis-df'>{{item[valFieldArr[0]]}}</view>
|
||||||
<view class="flex justify-end basis-sm text-center">
|
<view class="flex justify-end basis-sm text-center">
|
||||||
<view class="basis-df">{{item[valFieldArr[1]]}}</view>
|
<view class="basis-df" v-for="(item1,index1) in valFieldArr" v-if="index1 >= 1">{{item[item1]}}</view>
|
||||||
<view class="basis-df">{{item[valFieldArr[2]]}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
||||||
|
|
@ -72,14 +72,14 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="padding-top-sm flex justify-end">
|
<view class="padding-top-sm flex justify-end">
|
||||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur" data-modal="showForwardModal"
|
<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"
|
<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" v-if="task.canQuote">报价</button>
|
||||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur"
|
<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"
|
<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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -220,16 +220,18 @@
|
||||||
areaList: [],
|
areaList: [],
|
||||||
areaMultiIndex: [0, 0, 0],
|
areaMultiIndex: [0, 0, 0],
|
||||||
categoryList: [],
|
categoryList: [],
|
||||||
categoryMultiIndex: [0, 0, 0]
|
categoryMultiIndex: [0, 0, 0],
|
||||||
|
curUserInfo: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onShow() {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadData() {
|
async loadData() {
|
||||||
// this.tasks = await this.$api.data('tasks');
|
// this.tasks = await this.$api.data('tasks');
|
||||||
this.loadMasterOrderPage();
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
|
this.reloadMasterOrderPage();
|
||||||
this.takeCertify = await this.$api.data('takeCertify');
|
this.takeCertify = await this.$api.data('takeCertify');
|
||||||
this.areaList = await this.$api.data('areaList');
|
this.areaList = await this.$api.data('areaList');
|
||||||
this.categoryList = await this.$api.data('categoryList');
|
this.categoryList = await this.$api.data('categoryList');
|
||||||
|
|
@ -305,31 +307,44 @@
|
||||||
}
|
}
|
||||||
this.taskConditions[this.tabCur].value = chosenCategory;
|
this.taskConditions[this.tabCur].value = chosenCategory;
|
||||||
},
|
},
|
||||||
showDemandDetail(e, taskIndex) {
|
showDemandDetail(e, task) {
|
||||||
let paramObj = {
|
let paramObj = {
|
||||||
orderId: this.tasks[taskIndex].id
|
orderMasterId: task.orderMasterId
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/demand-center/demand-detail?paramObj=' + encodeURIComponent(JSON.stringify(
|
url: '/pages/demand-center/demand-detail?paramObj=' + encodeURIComponent(JSON.stringify(
|
||||||
paramObj))
|
paramObj))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
takeTask(e, taskIndex) {
|
async takeTask(e, task) {
|
||||||
if (this.takeCertify) {
|
if (this.curUserInfo.status !== 0 || this.curUserInfo.type !== 0) {
|
||||||
// 已认证可直接接单
|
// 未认证需提示前往认证
|
||||||
e.currentTarget.dataset.modal = e.currentTarget.dataset.takeModal;
|
|
||||||
this.showModal(e, taskIndex);
|
|
||||||
} else {
|
|
||||||
// 未认证需提示前往认证
|
|
||||||
e.currentTarget.dataset.modal = e.currentTarget.dataset.certifyModal;
|
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) {
|
showModal(e, task) {
|
||||||
this.curTask = this.tasks[taskIndex];
|
this.curTask = task;
|
||||||
this[e.currentTarget.dataset.modal] = true;
|
this[e.currentTarget.dataset.modal] = true;
|
||||||
},
|
},
|
||||||
hideModal(e) {
|
hideModal(e) {
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,15 @@
|
||||||
</cu-custom>
|
</cu-custom>
|
||||||
<view class="padding bg-white margin-top-sm margin-lr-sm">
|
<view class="padding bg-white margin-top-sm margin-lr-sm">
|
||||||
<view class="flex justify-between">
|
<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-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">
|
<view v-if="order.expeditedPrice">
|
||||||
<text>加急:</text><text class="text-price text-red text-bold">{{order.expeditedPrice}}</text>
|
<text>加急:</text><text class="text-price text-red text-bold">{{order.expeditedPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</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 v-for="(tagContent, index1) in order.tag" class='cu-tag margin-right-xs'>{{tagContent}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-top-sm">
|
<view class="margin-top-sm">
|
||||||
|
|
@ -24,12 +24,12 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-top-sm">
|
<view class="margin-top-sm">
|
||||||
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-timefill"></text></text>
|
<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>
|
||||||
<view class="margin-top-sm">
|
<view class="margin-top-sm">
|
||||||
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-phone"></text></text>
|
<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 class="margin-right-xs">{{order.customerName}}</text>
|
||||||
<text>{{order.phoneNum}}</text>
|
<text>{{order.customerPhone}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-top-sm bg-white margin-lr-sm margin-bottom-with-bar">
|
<view class="margin-top-sm bg-white margin-lr-sm margin-bottom-with-bar">
|
||||||
|
|
@ -39,12 +39,15 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="padding">
|
<view class="padding">
|
||||||
<view class="cu-avatar margin-bottom-sm" :style="'background-image:url(' + order.picUrl + '); width: 180rpx; height: 180rpx'"></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.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.servType}}</view> -->
|
||||||
<view class="margin-bottom-sm"><text class="text-bold">订单编码:</text>{{order.serialId}}</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.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>
|
</view>
|
||||||
<view class="cu-bar tabbar border shop fixed-bottom-bar">
|
<view class="cu-bar tabbar border shop fixed-bottom-bar">
|
||||||
|
|
@ -82,31 +85,53 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import productPicked from '@/components/goods-card/product-picked.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
productPicked
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
inParams: {},
|
||||||
order: {},
|
order: {},
|
||||||
takeCertify: false,
|
takeCertify: false,
|
||||||
showTakeCertifiedModal: false,
|
showTakeCertifiedModal: false,
|
||||||
showTakeSuccessModal: false
|
showTakeSuccessModal: false,
|
||||||
|
specColumnHeaders: ['商品规格', '购买量'],
|
||||||
|
specValFields: ['standardName', 'standardNum'],
|
||||||
|
curUserInfo: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let paramObj = JSON.parse(decodeURIComponent(options.paramObj));
|
this.inParams = JSON.parse(decodeURIComponent(options.paramObj));
|
||||||
this.loadData(paramObj.orderId);
|
},
|
||||||
|
onShow() {
|
||||||
|
this.loadData(this.inParams.orderMasterId);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadData(orderId) {
|
async loadData(orderMasterId) {
|
||||||
this.order = await this.$api.data('order');
|
// 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');
|
this.takeCertify = await this.$api.data('takeCertify');
|
||||||
},
|
},
|
||||||
takeTask(e) {
|
async takeTask(e) {
|
||||||
if (this.takeCertify) {
|
if (this.curUserInfo.status !== 0 || this.curUserInfo.type !== 0) {
|
||||||
// 已认证可直接接单
|
|
||||||
e.currentTarget.dataset.modal = e.currentTarget.dataset.takeModal;
|
|
||||||
} else {
|
|
||||||
// 未认证需提示前往认证
|
// 未认证需提示前往认证
|
||||||
e.currentTarget.dataset.modal = e.currentTarget.dataset.certifyModal;
|
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);
|
this.showModal(e);
|
||||||
},
|
},
|
||||||
|
|
@ -120,7 +145,17 @@
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: -1
|
delta: -1
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
goToCertify() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/my/master-settled-info'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
contactCustomer(e) {
|
||||||
|
uni.makePhoneCall({
|
||||||
|
phoneNumber: this.order.customerPhone
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -95,12 +95,27 @@
|
||||||
<view>请您选择入驻类型!到家服务类请选择-服务商;商品销售类请选择-配件商。</view>
|
<view>请您选择入驻类型!到家服务类请选择-服务商;商品销售类请选择-配件商。</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-bar bg-white">
|
<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>
|
||||||
<view class="action margin-0 flex-sub text-main-color solid-left" @tap="hideModal"
|
<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>
|
||||||
|
</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>
|
||||||
<!-- 强制要求用户授权登录的弹窗 -->
|
<!-- 强制要求用户授权登录的弹窗 -->
|
||||||
<view class="cu-modal" :class="isAuthWxLoginModal?'show':''">
|
<view class="cu-modal" :class="isAuthWxLoginModal?'show':''">
|
||||||
|
|
@ -186,7 +201,8 @@
|
||||||
myInfo: {},
|
myInfo: {},
|
||||||
isShowSteer: false,
|
isShowSteer: false,
|
||||||
isAuthWxLoginModal: false,
|
isAuthWxLoginModal: false,
|
||||||
isAuthWxPhoneModal: false
|
isAuthWxPhoneModal: false,
|
||||||
|
showTakeCertifiedModal: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
|
|
@ -209,8 +225,10 @@
|
||||||
this.curUserInfo = curUserInfo;
|
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.myInfo = await this.$api.data('myInfo');
|
||||||
// this.isShowSteer = !this.myInfo.entryType;
|
// this.isShowSteer = !this.myInfo.entryType;
|
||||||
let newServModules = this.servModules.concat();
|
let newServModules = this.servModules.concat();
|
||||||
|
|
@ -244,7 +262,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hideModal(e) {
|
hideModal(e) {
|
||||||
this.isShowSteer = false
|
this[e.currentTarget.dataset.modal] = false;
|
||||||
},
|
},
|
||||||
showMasterRule() {
|
showMasterRule() {
|
||||||
let paramObj = {
|
let paramObj = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue