浏览代码

获取服务

lilei 4 年之前
父节点
当前提交
f584bbf881
共有 2 个文件被更改,包括 13 次插入8 次删除
  1. 1 1
      App.vue
  2. 12 7
      pages/getOrder/getOrder.vue

+ 1 - 1
App.vue

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

+ 12 - 7
pages/getOrder/getOrder.vue

@@ -145,11 +145,6 @@
 			}
 		},
 		onLoad(option) {
-			uni.removeStorageSync('stepIndex')
-			// 注册全局监听事件
-			uni.$once('read', this.read)
-			this.getUserPhone()
-			this.getServerList()
 			// 存储当前扫码的设备及网点id
 			// if(options.scene){
 			// 	let scene=decodeURIComponent(options.scene);
@@ -159,7 +154,12 @@
 			// 	//其他逻辑处理。。。。。
 			//   }
 			this.$store.state.vuex_orderInfo.bizId = option.bizId || '9898'
-			this.$store.state.vuex_orderInfo.storeId = option.storeId || ''
+			this.$store.state.vuex_orderInfo.storeId = option.storeId || '100000'
+			uni.removeStorageSync('stepIndex')
+			// 注册全局监听事件
+			uni.$once('read', this.read)
+			this.getUserPhone()
+			this.getServerList()
 		},
 		onUnload() {
 			uni.removeStorageSync('stepIndex')
@@ -186,7 +186,8 @@
 			},
 			// 获取服务列表
 			getServerList () {
-				getStoreItems({storeId:100000}).then(res =>{
+				let storeId = this.$store.state.vuex_orderInfo.storeId
+				getStoreItems({storeId:storeId}).then(res =>{
 					if (res.status == 200) {
 						this.itemList = res.data 
 						this.serverIndex = 0
@@ -266,6 +267,10 @@
 			},
 			// 去付款 保存订单
 			handleSubmit (){
+				if(this.itemList.length==0){
+					this.toashMsg('请先选择服务')
+					return 
+				}
 				if (this.isRead !='read') {
 					this.toashMsg('请先阅读并同意无人洗车《注意事项及服务协议》!')
 					return