lilei 4 年 前
コミット
745e0617e8
3 ファイル変更26 行追加8 行削除
  1. 1 1
      App.vue
  2. 14 4
      pages/index/index.vue
  3. 11 3
      pages/work/index/index.vue

+ 1 - 1
App.vue

@@ -1,7 +1,7 @@
 <script>
 	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 pro_URL = 'https://carwash.zyucgj.com/cw-wecaht/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url
 	const envText = ['预发布环境','生产环境']

+ 14 - 4
pages/index/index.vue

@@ -29,10 +29,10 @@
 							<cover-image class="img" src="/static/img/index-call.png"></cover-image>
 							<cover-view>联系客服</cover-view>
 						</cover-view>
-						<!-- <cover-view class="flex-item">
+						<cover-view @click="scanCoupon" class="flex-item">
 							<cover-image class="img" src="/static/img/index-discount.png"></cover-image>
 							<cover-view>优惠活动</cover-view>
-						</cover-view> -->
+						</cover-view>
 					</view>
 				</view>
 				<!-- 地图移动后返回原位置控件 -->
@@ -109,8 +109,6 @@
 						// 还未启动
 						if(res.data.dataStatus == "PAID"){
 							this.$u.vuex('vuex_workStatus','linking')
-						}else{
-							this.$u.vuex('vuex_workStatus','working')
 						}
 					}else{
 						this.workStatus = 'hide'
@@ -300,6 +298,18 @@
 					phoneNumber: '18237162131'
 				})
 			},
+			// 扫描领取优惠卷
+			scanCoupon(){
+				uni.scanCode({
+				    success: function (res) {
+				        console.log('条码类型:' + res.scanType);
+				        console.log('条码内容:' + res.result);
+						uni.navigateTo({
+							url: res.result
+						})
+				    }
+				});
+			},
 			// 扫码洗车
 			scanCode () {
 				let _this = this

+ 11 - 3
pages/work/index/index.vue

@@ -132,12 +132,20 @@ export default {
 		};
 	},
 	onShow() {
-		console.log("onShow")
+		console.log(this.$store.state.vuex_workStatus,"onShow")
+		this.status = this.$store.state.vuex_workStatus
 		// 更新进度条
 		if(this.$store.state.vuex_workStatus == 'working'){
 			this.step = this.$store.state.vuex_workStep
 			this.loading()
 		}
+		// 如果是复位状态
+		if(this.$store.state.vuex_workStatus == 'rest'){
+			this.showReset()
+		}
+		if(this.$store.state.vuex_workStatus == 'starting'){
+			this.starting()
+		}
 	},
 	onLoad(options) {
 		console.log("onLoad")
@@ -250,7 +258,7 @@ export default {
 					}
 				}
 				// 进度消息
-				if(e.data.level == 'C'&&this.status!="reseting"){
+				if(e.data.level == 'C'&&this.status!="rest"){
 					this.curWorkStutesText= e.data.msgCodeInfo
 					if(e.data.msgCodeInfo != '开始洗车'){
 						// 启动成功
@@ -266,7 +274,7 @@ export default {
 					 }
 				}
 				// 错误消息
-				if(e.data.level == 'F'&&this.status!="reseting"){
+				if(e.data.level == 'F'&&this.status!="rest"){
 					this.curWorkStutesText= e.data.msgCodeInfo
 					// 启动成功
 					this.startWashCarSuccess()