lilei hace 4 años
padre
commit
616e3f8156
Se han modificado 4 ficheros con 30 adiciones y 22 borrados
  1. 3 3
      App.vue
  2. 15 7
      pages/getOrder/getOrder.vue
  3. 10 12
      pages/index/index.vue
  4. 2 0
      pages/userCenter/index.vue

+ 3 - 3
App.vue

@@ -1,7 +1,7 @@
 <script>
-	const uat_URL = 'http://carwash.test.zyucgj.com/cw-wechat/' // 预发布
-	// const uat_URL = 'http://192.168.16.102:8103/cw-wechat/' // 本地
-	const pro_URL = 'http://carwash.zyucgj.com/saas/clz/'  // 生产
+	const uat_URL = 'https://carwash.test.zyucgj.com/cw-wechat/' // 预发布
+	// const uat_URL = 'http://192.168.16.103:8103/cw-wechat/' // 本地
+	const pro_URL = 'https://carwash.zyucgj.com/saas/clz/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url
 	const envText = ['预发布环境','生产环境']

+ 15 - 7
pages/getOrder/getOrder.vue

@@ -171,7 +171,6 @@
 				//其他逻辑处理。。。。。
 				this.$store.state.vuex_orderInfo.bizId = bizId
 				this.$store.state.vuex_orderInfo.storeId = storeId
-
 				// 判断当前门店是否已运营
 				this.getStoreStatus(storeId,bizId)
 			} else {
@@ -185,6 +184,9 @@
 					this.getServerList()
 				} else {
 					// 返回首页
+					uni.reLaunch({
+						url: "/pages/index/index"
+					})
 				}
 			}
 		},
@@ -210,12 +212,18 @@
 					uni.hideLoading()
 					console.log(res)
 					if(res.status != 200 && res.status != 401) {
-						this.toashMsg(res.message)
-						setTimeout(()=>{
-							uni.reLaunch({
-								url:'/pages/index/index'
-							})
-						},1000)
+						uni.showModal({
+						    title: '提示',
+						    content: res.message,
+							showCancel: false,
+						    success: function (res) {
+						        if (res.confirm) {
+									uni.reLaunch({
+										url:'/pages/index/index'
+									})
+						        }
+						    }
+						});
 					}
 				})
 			},

+ 10 - 12
pages/index/index.vue

@@ -16,7 +16,7 @@
 			<map id="map" :latitude="lat" :longitude="lng" scale="10" show-compass :markers="markers" @markertap="markertap"
 			 show-location style="width: 100%; height:100%;">
 			 <!-- 信息提示 -->
-			 <cover-view class="work-message"  @click="toWork" v-if="workStatus!='stop'">
+			 <cover-view class="work-message" v-if="workStatus!='stop'" @click="toWork">
 				 <cover-view class="work-message-in">
 					 <cover-view class="view">洗车机正在工作中...</cover-view>
 					 <cover-view class="view">点击进入</cover-view>
@@ -77,8 +77,6 @@
 			this.mapCtx = uni.createMapContext('map')
 		},
 		onShow() {
-			console.log(this.$store.state.vuex_orderInfo,'vuex_orderInfo')
-			console.log(this.$store.state.vuex_workStatus,'vuex_workStatus')
 			this.workStatus = this.$store.state.vuex_workStatus
 		},
 		onLoad() {
@@ -253,15 +251,15 @@
 			},
 			// 扫码洗车
 			scanCode () {
-				uni.navigateTo({
-					url: `/pages/getOrder/getOrder?scene=100033,9695`
-				})
-				// uni.scanCode({
-				//     success: function (res) {
-				//         console.log('条码类型:' + res.scanType);
-				//         console.log('条码内容:' + res.result);
-				//     }
-				// });
+				uni.scanCode({
+				    success: function (res) {
+				        console.log('条码类型:' + res.scanType);
+				        console.log('条码内容:' + res.result);
+						uni.navigateTo({
+							url: `/pages/getOrder/getOrder?scene=100033,9996`
+						})
+				    }
+				});
 			},
 			// 创建标记点 OPEN :正常营业  CLOSED:暂停营业  TO_BE_OPENED:待开业
 			createMarker(point) {

+ 2 - 0
pages/userCenter/index.vue

@@ -56,6 +56,8 @@
 				      logout({}).then(res => {
 				       getApp().globalData.token = ''
 				       _this.$u.vuex('vuex_token','')
+					   // 关闭socket
+					   _this.$store.commit("$closeWebsocket")
 				        uni.reLaunch({
 				        	url: '/pages/index/index'
 				        });