lilei 4 tahun lalu
induk
melakukan
719d30ad12
3 mengubah file dengan 33 tambahan dan 15 penghapusan
  1. 9 7
      libs/axios.js
  2. 2 2
      pages/getOrder/getOrder.vue
  3. 22 6
      pages/index/index.vue

+ 9 - 7
libs/axios.js

@@ -21,7 +21,7 @@ const request = (opts, hasToken) => {
 	let promise = new Promise(function(resolve, reject) {
 		uni.request(DefaultOpts).then(
 			(res) => {
-				console.log(res)
+				console.log(res,opts.url)
 				// 是否超时已跳转
 				let loginTimeOut = uni.getStorageSync('loginTimeOut');
 				if(res[0]&&res[0].errMsg.indexOf('request:fail')>=0){
@@ -52,12 +52,14 @@ const request = (opts, hasToken) => {
 						}, 1000);
 					}
 					else{
-						uni.showToast({
-							icon:'none',
-							title: ret.message,
-							mask: true,
-							duration: 3000 
-						})
+						if(!(ret.status == 500 && opts.url.indexOf("store/validateStoreAndDevice")>=0)){
+							uni.showToast({
+								icon:'none',
+								title: ret.message,
+								mask: true,
+								duration: 3000 
+							})
+						}
 					}
 					resolve(ret)
 				}

+ 2 - 2
pages/getOrder/getOrder.vue

@@ -173,8 +173,8 @@
 				this.$store.state.vuex_orderInfo.bizId = bizId
 				this.$store.state.vuex_orderInfo.storeId = storeId
 				// 判断当前门店是否已运营
-				// this.getStoreStatus(storeId,bizId)
-				this.dataInit()
+				this.getStoreStatus(storeId,bizId)
+				// this.dataInit()
 			} else {
 				// 判断是否扫码过
 				if (this.$store.state.vuex_orderInfo.bizId != '') {

+ 22 - 6
pages/index/index.vue

@@ -65,6 +65,9 @@
 	import {
 		getLookUpDatas
 	} from '@/api/data.js'
+	import {
+		getUnFinishedOrder
+	} from '@/api/order.js'
 	export default {
 		components: {
 			uniNavBar,
@@ -72,7 +75,7 @@
 		},
 		data() {
 			return {
-				workStatus: 'stop',
+				workStatus: '',
 				mapCtx: null, // 地图对象
 				markers: [], // 标注点
 				lng: '',
@@ -84,8 +87,9 @@
 			this.mapCtx = uni.createMapContext('map')
 		},
 		onShow() {
-			this.workStatus = this.$store.state.vuex_workStatus
 			this.getUserLocation()
+			// 查询是否有未完成的订单
+			this.getUnFinishedOrder()
 		},
 		onLoad() {
 			// 获取订单状态数据字典
@@ -96,6 +100,15 @@
 			this.getCodeList('STORE_LABEL')
 		},
 		methods: {
+			// 查询是否有未完成的订单
+			getUnFinishedOrder(){
+				getUnFinishedOrder().then(res => {
+					console.log(res)
+					if(res.status == 200){
+						this.workStatus = ''
+					}
+				})
+			},
 			// 获取数据字典
 			getCodeList(code) {
 				getLookUpDatas({
@@ -241,6 +254,8 @@
 						uni.navigateTo({
 							url: `/pages/login/login?lanuch=${false}&path=` + encodeURIComponent('/pages/userCenter/index')
 						})
+					}else if (res.status == '6000'){
+						this.toashMsg(res.message)
 					}
 				})
 			},
@@ -288,16 +303,17 @@
 								uni.navigateTo({
 									url: res.result
 								})
+								// uni.navigateTo({
+								// 	url: `/pages/getOrder/getOrder?scene=100032,9691`
+								// })
 						    }
 						});
-						
-						// uni.navigateTo({
-						// 	url: `/pages/getOrder/getOrder?scene=100037,9998`
-						// })
 					} else if (res.status == '9001') {
 						uni.navigateTo({
 							url: `/pages/login/login?lanuch=${false}&path=` + encodeURIComponent('/pages/index/index')
 						})
+					} else if (res.status == '6000'){
+						this.toashMsg(res.message)
 					}
 				})
 			},