接口对接
This commit is contained in:
parent
74b719b427
commit
e8db1977a0
|
|
@ -1,5 +1,6 @@
|
|||
export default {
|
||||
CONFIRM: 'confirmCallback',
|
||||
CANCEL: 'cancelCallback',
|
||||
VERTICAL_NAV_GET_ITEM: 'verticalNavGetItem',
|
||||
VERTICAL_NAV_SEARCH: 'verticalNavSearch',
|
||||
CHOOSE_ADDRESS: 'chooseAddress'
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ export default {
|
|||
addInterceptor() {
|
||||
uni.addInterceptor('request', {
|
||||
invoke(args) {
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
title: '加载中'
|
||||
})
|
||||
// request 触发前拼接 url
|
||||
// args.url = 'https://www.opsoul.com' + args.url;
|
||||
// args.url = 'http://10.45.137.214:80' + args.url;
|
||||
|
|
@ -35,7 +39,7 @@ export default {
|
|||
})
|
||||
},
|
||||
complete(res) {
|
||||
console.log('interceptor-complete', res)
|
||||
uni.hideLoading();
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -373,6 +377,14 @@ export default {
|
|||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async updateOrder(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/order/master/editOrderMaster',
|
||||
method: 'POST',
|
||||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async getHotGoods(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/goods/goods/hot/list',
|
||||
|
|
@ -384,5 +396,5 @@ export default {
|
|||
}
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@
|
|||
</view>
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action margin-0 flex-sub text-black" @tap="hideModal">{{cancelMsg}}</view>
|
||||
<view class="action margin-0 flex-sub text-main-color solid-left" @tap="hideModal"
|
||||
@click="confirmCallback">{{confirmMsg}}</view>
|
||||
<view class="action margin-0 flex-sub text-main-color solid-left" @click="confirmCallback">{{confirmMsg}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -19,6 +18,7 @@
|
|||
<script>
|
||||
export default {
|
||||
name: 'confirm-modal',
|
||||
emits: ["confirm", 'cancel'],
|
||||
props: {
|
||||
content: {
|
||||
type: String,
|
||||
|
|
@ -43,10 +43,12 @@
|
|||
this.isShow = true
|
||||
},
|
||||
hideModal(e) {
|
||||
this.isShow = false
|
||||
this.$emit('cancel');
|
||||
this.isShow = false;
|
||||
},
|
||||
confirmCallback(e) {
|
||||
uni.$emit(this.$globalFun.CONFIRM);
|
||||
this.$emit('confirm');
|
||||
this.hideModal();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,6 +139,10 @@
|
|||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
title: '加载中'
|
||||
})
|
||||
// 更新缓存中的userInfo
|
||||
let res = await this.$request.storageExistUser();
|
||||
// 获取缓存中的userInfo
|
||||
|
|
@ -151,6 +155,8 @@
|
|||
if (this.isAuthWxPhoneModal) {
|
||||
return;
|
||||
}
|
||||
uni.hideLoading();
|
||||
|
||||
// 加载区域信息
|
||||
this.loadRegionList();
|
||||
// 加载热门商品
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
<block>{{myInfo.serOrderNum.wait2Serv}}</block>
|
||||
</view>
|
||||
</view>
|
||||
<text>待服务</text>
|
||||
<text>待排期</text>
|
||||
</view>
|
||||
<view class="cu-item" @click="showMyOrders(servOrderTabList, 2, servOrderType)">
|
||||
<view class="cuIcon-repair">
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
<block>{{myInfo.serOrderNum.processing}}</block>
|
||||
</view>
|
||||
</view>
|
||||
<text>进行中</text>
|
||||
<text>待上门</text>
|
||||
</view>
|
||||
<view class="cu-item" @click="showMyOrders(servOrderTabList, 3, servOrderType)">
|
||||
<view class="cuIcon-comment">
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
<block>{{myInfo.serOrderNum.afterServ}}</block>
|
||||
</view>
|
||||
</view>
|
||||
<text>售后中</text>
|
||||
<text>服务中</text>
|
||||
</view>
|
||||
<view class="cu-item" @click="showMyOrders(servOrderTabList, 4, servOrderType)">
|
||||
<view class="cuIcon-forward">
|
||||
|
|
@ -112,7 +112,7 @@
|
|||
<block>{{myInfo.serOrderNum.wait2Forward}}</block>
|
||||
</view>
|
||||
</view>
|
||||
<text>待转发</text>
|
||||
<text>已完成</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 商品订单 -->
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
<script>
|
||||
export default {
|
||||
nama: 'new-serv-price',
|
||||
emits: ['hideModal'],
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
|
|
@ -64,7 +65,7 @@
|
|||
},
|
||||
methods: {
|
||||
hideModal(e) {
|
||||
this.$emit(this.$globalFun.HIDE_MODAL, e);
|
||||
this.$emit('hideModal', e);
|
||||
},
|
||||
sendUrgentMsg(e) {
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
<button class="cu-btn bg-main-color long-btn margin-lr-sm shadow-blur" @click="addEditAddress(null)">新增地址</button>
|
||||
</view>
|
||||
<!-- 模态框 -->
|
||||
<confirm-modal ref="confirmModal" :content="'是否确定删除?'"></confirm-modal>
|
||||
<confirm-modal ref="confirmModal" :content="'是否确定删除?'" @confirm="delAddress"></confirm-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -50,14 +50,10 @@
|
|||
if (Boolean(options)) {
|
||||
this.chooseMode = options.chooseMode === 'true' ? true : false;
|
||||
}
|
||||
this.bindEvent();
|
||||
},
|
||||
onShow() {
|
||||
this.loadData();
|
||||
},
|
||||
onUnload() {
|
||||
this.offBindEvent();
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
// this.myAddressList = await this.$api.data('myAddressList');
|
||||
|
|
@ -66,12 +62,6 @@
|
|||
});
|
||||
this.myAddressList = res.data;
|
||||
},
|
||||
bindEvent() {
|
||||
uni.$on(this.$globalFun.CONFIRM, this.delAddress);
|
||||
},
|
||||
offBindEvent() {
|
||||
uni.$off(this.$globalFun.CONFIRM);
|
||||
},
|
||||
addEditAddress(addressInfo) {
|
||||
let url = null;
|
||||
let params = null;
|
||||
|
|
@ -122,12 +112,6 @@
|
|||
})
|
||||
}
|
||||
},
|
||||
showModal(e) {
|
||||
this.modalName = typeof e === 'string' ? e : e.currentTarget.dataset.target
|
||||
},
|
||||
hideModal(e) {
|
||||
this.modalName = null
|
||||
},
|
||||
chooseAddress(addressInfo) {
|
||||
if (this.chooseMode) {
|
||||
uni.$emit(this.$globalFun.CHOOSE_ADDRESS, addressInfo);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<view class="cuIcon-right"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='cu-tag bg-yellow radius margin-right-sm' v-if="shopOrder.mainProcess === 'ordersServing'" @click="showServDetail(shopOrder)">查看订单详情</view>
|
||||
<view class='cu-tag bg-yellow radius margin-right-sm' v-if="tabCur === 3" @click="showServDetail(shopOrder)">查看订单详情</view>
|
||||
</view>
|
||||
<view class="padding-lr">
|
||||
<view class="margin-top-sm">
|
||||
|
|
@ -41,25 +41,27 @@
|
|||
<view class="text-lg"><text>需付款</text><text
|
||||
class="text-price text-red text-lg text-bold">{{shopOrder.payMoney}}</text></view>
|
||||
</view>
|
||||
<view v-if="orderType === 0">
|
||||
<!-- <view class="padding-tb-sm flex justify-end oper-bar" v-if="">
|
||||
|
||||
<view v-if="orderType === 0" class="padding-tb-sm">
|
||||
<view class="flex justify-end" v-if="tabCur === 0">
|
||||
<button class="cu-btn bg-gray margin-right-sm shadow-blur" @click="showModalByRef('confirmModal', shopOrder)">取消订单</button>
|
||||
<button v-if="shopOrder.payStatus === 0" class="cu-btn bg-main-color shadow-blur" @click="wxpay(shopOrder)">付款</button>
|
||||
</view>
|
||||
<view class="flex justify-end" v-if="tabCur === 1">
|
||||
<button class="cu-btn bg-gray margin-right-sm shadow-blur">取消订单</button>
|
||||
<button class="cu-btn bg-gray margin-right-sm shadow-blur">撤换师傅</button>
|
||||
<button class="cu-btn bg-main-color margin-right-sm shadow-blur">催单</button>
|
||||
</view>
|
||||
<view class="flex justify-end" v-if="tabCur === 2">
|
||||
<button class="cu-btn bg-gray margin-right-sm shadow-blur">取消订单</button>
|
||||
<button class="cu-btn bg-gray margin-right-sm shadow-blur">撤换师傅</button>
|
||||
</view>
|
||||
<view class="flex justify-end" v-if="tabCur === 3">
|
||||
<!-- <button class="cu-btn bg-gray margin-right-sm shadow-blur">申请售后</button> -->
|
||||
<button class="cu-btn bg-main-color margin-right-sm shadow-blur">加价</button>
|
||||
</view>
|
||||
<!-- <view class="flex justify-end" v-if="tabCur === 4">
|
||||
<button class="cu-btn bg-main-color margin-right-sm shadow-blur">评价</button>
|
||||
</view> -->
|
||||
<button v-if="shopOrder.subProcessStatus <= 4 && shopOrder.mainProcess !== 'ordersWait2Serv'"
|
||||
class="cu-btn line-black margin-right-sm">取消订单</button>
|
||||
<button v-if="shopOrder.subProcessStatus >= 1 && shopOrder.subProcessStatus <= 2"
|
||||
class="cu-btn line-black margin-right-sm">催单</button>
|
||||
<button v-if="shopOrder.subProcessStatus >= 2 && shopOrder.subProcessStatus <= 3"
|
||||
class="cu-btn line-black margin-right-sm">撤换师傅</button>
|
||||
<button v-if="shopOrder.subProcessStatus >= 1 && shopOrder.subProcessStatus <= 3"
|
||||
class="cu-btn line-black margin-right-sm">加价</button>
|
||||
<button v-if="shopOrder.subProcessStatus === 5"
|
||||
class="cu-btn line-black margin-right-sm">申请售后</button>
|
||||
<button v-if="shopOrder.subProcessStatus >= 4 && shopOrder.subProcessStatus <= 5"
|
||||
class="cu-btn line-black margin-right-sm">评价</button>
|
||||
<button v-if="shopOrder.subProcessStatus === 6"
|
||||
class="cu-btn line-black margin-right-sm">查看进度</button>
|
||||
<button v-if="shopOrder.payStatus === 0" class="cu-btn bg-main-color">付款</button>
|
||||
</view>
|
||||
<view v-if="orderType === 0 && shopOrder.subProcessStatus === 4"
|
||||
class="padding-tb-sm solid-top">
|
||||
|
|
@ -82,7 +84,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="orderType === 0 && (shopOrder.subProcessStatus === 2 || shopOrder.subProcessStatus === 3)"
|
||||
v-if="orderType === 0 && (tabCur === 1 || tabCur === 2)"
|
||||
class="padding-tb-sm solid-top">
|
||||
<view>约定服务时间:</view>
|
||||
<view class="flex justify-between align-end">
|
||||
|
|
@ -109,7 +111,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<load-status-bar ref="loadStatusBar"></load-status-bar>
|
||||
<confirm-modal ref="confirmModal" :content="'是否确定取消订单?'" @confirm="cancelOrder"></confirm-modal>
|
||||
<confirm-modal ref="confirmModal" :content="'是否确定取消订单?'" @confirm="cancelOrder" @cancel="blurCurOrder"></confirm-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -130,7 +132,8 @@
|
|||
orderType: '',
|
||||
myOrders: [],
|
||||
pageParams: [],
|
||||
stickyTop: this.CustomBar
|
||||
stickyTop: this.CustomBar,
|
||||
curOrder: null
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
|
@ -213,11 +216,50 @@
|
|||
url: '/pages/my/serv-detail'
|
||||
})
|
||||
},
|
||||
decideIfCancelOrder() {
|
||||
this.$refs.confirmModal.showModal();
|
||||
showModalByRef(refName, curOrder) {
|
||||
this.$refs[refName].showModal();
|
||||
this.curOrder = curOrder;
|
||||
},
|
||||
cancelOrder() {
|
||||
console.log("取消订单")
|
||||
blurCurOrder() {
|
||||
this.curOrder = null;
|
||||
},
|
||||
async cancelOrder() {
|
||||
let res = await this.$request.updateOrder({
|
||||
id: this.curOrder.orderMasterId,
|
||||
orderStatus: 5
|
||||
});
|
||||
if (res.code === 0) {
|
||||
uni.showToast({
|
||||
title: '取消成功',
|
||||
icon: 'success'
|
||||
})
|
||||
this.reloadOrderPage();
|
||||
}
|
||||
},
|
||||
async wxpay(curOrder) {
|
||||
try {
|
||||
// 获取微信支付所需参数
|
||||
let wxPayParams = {
|
||||
code: this.$request.getCurUserInfo().openId,
|
||||
orderMasterCode: curOrder.orderMasterCode
|
||||
}
|
||||
let wxPayParamRes = await this.$request.getWxPayParams(wxPayParams);
|
||||
// 拉起微信支付窗口,支付成功跳转到支付成功页面
|
||||
let payInfo = JSON.parse(wxPayParamRes.data.expend.pay_info);
|
||||
let wxPayRes = await wx.requestPayment(payInfo);
|
||||
if (wxPayRes.errMsg === "requestPayment:ok") {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/pay-result?payResult=0'
|
||||
})
|
||||
} else {
|
||||
throw 'err';
|
||||
}
|
||||
} catch(e) {
|
||||
// 支付失败弹出提示并跳转到我的订单待支付页
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/pay-result?payResult=1'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,13 +111,13 @@
|
|||
<!-- <view class="bg-main-color submit">立即上门</view> -->
|
||||
</view>
|
||||
<uni-popup ref="orderManage" type="bottom" @change="changePopupState">
|
||||
<view class="bg-white text-center">
|
||||
<view v-for="(menu,index) in orderManageMenu" class="padding solid-bottom" :data-action="menu.action" @click="clickOrderManageMenu">
|
||||
{{menu.name}}
|
||||
<view class="cu-bar bg-white tabbar border fixed-bottom-bar">
|
||||
<view class="bg-white text-center" style="width: 100%;">
|
||||
<view v-for="(menu,index) in orderManageMenu" class="padding solid-bottom" :data-action="menu.action" @click="clickOrderManageMenu">
|
||||
{{menu.name}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部占位 -->
|
||||
<view class="cu-bar bg-white fixed-bottom-bar"></view>
|
||||
</uni-popup>
|
||||
<!-- 模态框 -->
|
||||
<urgent-msg :show="sendUrgentMsgModal" @hideModal="hideModal"></urgent-msg>
|
||||
|
|
@ -131,7 +131,8 @@
|
|||
|
||||
export default {
|
||||
components: {
|
||||
productPicked
|
||||
productPicked,
|
||||
urgentMsg
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -151,10 +152,6 @@
|
|||
},
|
||||
onLoad() {
|
||||
this.loadData();
|
||||
// this.bindEvent();
|
||||
},
|
||||
onUnload() {
|
||||
// this.offBindEvent();
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
|
|
@ -168,12 +165,6 @@
|
|||
this.finishList4Show[i].finishList = finishList;
|
||||
}
|
||||
},
|
||||
// bindEvent() {
|
||||
// uni.$on(this.$globalFun.CONFIRM, this.cancelOrder);
|
||||
// },
|
||||
// offBindEvent() {
|
||||
// uni.$off(this.$globalFun.CONFIRM);
|
||||
// },
|
||||
changePopupState(e) {
|
||||
this.ifShowPageMeta = e.show;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -22,22 +22,21 @@
|
|||
payResult: false,
|
||||
customTip: null,
|
||||
servOrderTabList: [{
|
||||
type: 'ordersWait2Pay',
|
||||
name: '待付款'
|
||||
}, {
|
||||
type: 'ordersWait2Serv',
|
||||
name: '待服务'
|
||||
type: 1,
|
||||
name: '待排期'
|
||||
}, {
|
||||
type: 'ordersServing',
|
||||
type: 2,
|
||||
name: '待上门'
|
||||
}, {
|
||||
type: 3,
|
||||
name: '服务中'
|
||||
}, {
|
||||
type: 'ordersAfterServ',
|
||||
name: '售后中'
|
||||
}, {
|
||||
type: 'ordersFinish',
|
||||
type: 4,
|
||||
name: '已完成'
|
||||
}],
|
||||
servOrderType: 'servOrder'
|
||||
servOrderType: 0
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
bottom: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
z-index: 98;
|
||||
padding-bottom: constant(safe-area-inset-bottom / 2) !important; /*兼容 IOS<11.2*/
|
||||
padding-bottom: env(safe-area-inset-bottom / 2) !important; /*兼容 IOS>11.2*/
|
||||
padding-bottom: constant(safe-area-inset-bottom / 2) !important;/*兼容 IOS<11.2*/
|
||||
padding-bottom: env(safe-area-inset-bottom / 2) !important;/*兼容 IOS>11.2*/
|
||||
}
|
||||
|
||||
.cu-bar.tabbar.border .action checkbox {
|
||||
|
|
|
|||
Loading…
Reference in New Issue