完善订单列表
This commit is contained in:
parent
f2d6b4dadf
commit
0ff138613f
|
@ -61,7 +61,6 @@ export default {
|
|||
components: {},
|
||||
created() {},
|
||||
mounted() {
|
||||
// console.log(this.order);
|
||||
let [typeText, typeTextBg] = this.$models.order.orderTypeText(this.order.listType, this.order.orderType);
|
||||
this.typeText = typeText;
|
||||
this.typeTextBg = typeTextBg ? typeTextBg : "#8b9beb";
|
||||
|
|
|
@ -41,5 +41,18 @@ export default {
|
|||
return reject(response.msg);
|
||||
}).catch(e => { });
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取详情
|
||||
*/
|
||||
getDetail(options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
prototype.$request(options.request).then(response => {
|
||||
if (response.code == 1) {
|
||||
return resolve(response.data);
|
||||
}
|
||||
return reject(response.msg);
|
||||
}).catch(e => { });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,9 +37,8 @@
|
|||
<view class="title">上门时间:</view>
|
||||
<view class="content service-time">
|
||||
<text class="datetime">
|
||||
{{ order.serviceDateTime.date }} {{ order.serviceDateTime.time[0] }}-{{
|
||||
order.serviceDateTime.time[1]
|
||||
}}
|
||||
{{ order.serviceDateTime.date }}
|
||||
{{ order.serviceDateTime.time[0] }}-{{ order.serviceDateTime.time[1] }}
|
||||
</text>
|
||||
<text class="iconfont icon-bianji"></text>
|
||||
</view>
|
||||
|
@ -78,12 +77,7 @@
|
|||
<text class="text">客服</text>
|
||||
</view>
|
||||
<view class="action">
|
||||
<block v-if="type == 'detail'">
|
||||
<order-action :order="order" @confirmPrice="confirmPrice(order.id)" />
|
||||
</block>
|
||||
<block v-if="type == 'preview'">
|
||||
<get-action :order="order" @postPrice="postPrice(order.id)" />
|
||||
</block>
|
||||
<order-action :order="order" @confirmPrice="confirmPrice(order.id)" />
|
||||
</view>
|
||||
</view>
|
||||
<order-confirm-price v-show="showConfirmModal" @close="showConfirmModal = false" @confirm="showConfirmModal = false" />
|
||||
|
@ -106,7 +100,9 @@ export default {
|
|||
pageConfig: {},
|
||||
showPriceModal: false,
|
||||
showConfirmModal: false,
|
||||
type: "detail",
|
||||
listType: "",
|
||||
typeText: "",
|
||||
typeTextBg: "",
|
||||
order: {
|
||||
id: 1,
|
||||
orderId: "xxgfdkgn1223",
|
||||
|
@ -145,7 +141,7 @@ export default {
|
|||
OrderConfirmPrice,
|
||||
GetPostPrice,
|
||||
},
|
||||
onLoad(e) {
|
||||
async onLoad(e) {
|
||||
this.pageConfig = getApp().globalData.pageConfig;
|
||||
if (e.id && e.id > 0) {
|
||||
this.id = e.id;
|
||||
|
@ -153,9 +149,11 @@ export default {
|
|||
this.$utils.toast("参数错误");
|
||||
return;
|
||||
}
|
||||
if (e.type == "preview") {
|
||||
this.type = e.type;
|
||||
}
|
||||
this.listType = e.type;
|
||||
await this.loadDetail();
|
||||
let [typeText, typeTextBg] = this.$models.order.orderTypeText(this.listType, this.order.orderType);
|
||||
this.typeText = typeText;
|
||||
this.typeTextBg = typeTextBg ? typeTextBg : "#8b9beb";
|
||||
},
|
||||
onShow() {},
|
||||
onReady() {},
|
||||
|
@ -178,9 +176,23 @@ export default {
|
|||
this.$store.commit("order/setConfirmId", id);
|
||||
this.showConfirmModal = true;
|
||||
},
|
||||
postPrice(id) {
|
||||
this.$store.commit("order/setPostId", id);
|
||||
this.showPriceModal = true;
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
loadDetail() {
|
||||
this.$models.order
|
||||
.getDetail({
|
||||
request: {
|
||||
api: "order.detail." + this.listType,
|
||||
data: {
|
||||
id: this.id,
|
||||
},
|
||||
},
|
||||
listType: this.listType,
|
||||
})
|
||||
.then((response) => {
|
||||
console.log(response);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -168,7 +168,8 @@ export default {
|
|||
});
|
||||
},
|
||||
toDetail(id) {
|
||||
this.$utils.toPage("/pages/order/detail?type=detail&id=" + id);
|
||||
let currentTab = this.tabList[this.tabIndex];
|
||||
this.$utils.toPage("/pages/order/detail?list=" + currentTab.listType + "&id=" + id);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue