diff --git a/components/QuickOrderEntry.vue b/components/QuickOrderEntry.vue
index b8d99ca..393fb70 100644
--- a/components/QuickOrderEntry.vue
+++ b/components/QuickOrderEntry.vue
@@ -52,10 +52,13 @@ export default {
this.getQuickOrderInfo()
// 开启定时器,每30秒更新一次数据
this.startTimer()
+
+ uni.$on('getQuickOrderInfo', this.getQuickOrderInfo)
},
beforeDestroy() {
// 组件销毁前清除定时器
this.clearTimer()
+ uni.$off('getQuickOrderInfo', this.getQuickOrderInfo)
},
methods: {
// 处理点击事件
@@ -190,7 +193,7 @@ export default {
if (uni.getStorageSync('token')) {
this.getQuickOrderInfo()
}
- }, 15000)
+ }, 30000)
},
// 清除定时器
diff --git a/config.js b/config.js
index 56cbd86..4c91149 100644
--- a/config.js
+++ b/config.js
@@ -7,11 +7,14 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
-const type = 'prod'
+const type = 'local'
// 环境配置
const config = {
+ local : {
+ baseUrl : 'http://127.0.0.1:8002/building-admin',
+ },
dev : {
baseUrl : 'http://h5.xzaiyp.top/building-admin',
},
diff --git a/pages_order/order/firmOrder.vue b/pages_order/order/firmOrder.vue
index a307017..1c93417 100644
--- a/pages_order/order/firmOrder.vue
+++ b/pages_order/order/firmOrder.vue
@@ -19,7 +19,8 @@
商品信息
-
+
{
if (res.code === 200 && res.result) {
// 如果返回商品信息,则设置商品信息 commonShop
- this.productInfo = res.result;
- this.productInfo.commonShop.forEach(n => {
+ if(res.result.shopRecommends){
+ res.result.shopRecommends = JSON.parse(res.result.shopRecommends)
+ }
+
+ res.result.commonShop.forEach(n => {
this.checkboxValue.push(n.id)
+
+ if(typeof res.result.shopRecommends == 'object'){
+ n.selectNum = res.result.shopRecommends[n.id]
+ }
})
+
+ console.log(res.result);
+
+ this.productInfo = res.result;
}
});
},
@@ -323,6 +335,7 @@
this.$api('createSumOrder', data, res => {
uni.hideLoading();
if (res.code === 200) {
+ uni.$emit('getQuickOrderInfo')
uni.requestPaymentWxPay(res)
.then(e => {
uni.showToast({
@@ -357,6 +370,7 @@
this.$api('cancelOrderFast', {
orderId : this.orderId
}).then(res => {
+ uni.$emit('getQuickOrderInfo')
uni.showToast({
title: '取消成功',
icon: 'none',