liuf 1 рік тому
батько
коміт
133e6f915f
2 змінених файлів з 18 додано та 4 видалено
  1. 10 1
      App.vue
  2. 8 3
      pages/index/index.vue

+ 10 - 1
App.vue

@@ -11,6 +11,7 @@
 		uni.removeStorageSync("device_sn")
 		uni.removeStorageSync("sessionId")
 		uni.removeStorageSync("title")
+		uni.removeStorageSync("channel")
 	console.log('option>onLaunch>>>>'+JSON.stringify( option.query))
 	if(  option.query.sn!=''&&option.query.sn!=null){
 		uni.setStorageSync("device_sn",option.query.sn)
@@ -56,12 +57,20 @@
 		uni.removeStorageSync("device_sn")
 		uni.removeStorageSync("sessionId")
 		uni.removeStorageSync("title")
+		uni.removeStorageSync("channel")
 		console.log('option>onLaunch>>>>'+JSON.stringify( option.query))
 		if(  option.query.sn!=''&&option.query.sn!=null){
 			uni.setStorageSync("device_sn",option.query.sn)
 		}else{
-		uni.setStorageSync("device_sn",'')
+			uni.setStorageSync("device_sn",'')
 		}
+		
+		if(  option.query.channel!=''&&option.query.channel!=null){
+			uni.setStorageSync("channel",option.query.channel)
+		}else{
+			uni.setStorageSync("channel",'')
+		}
+		
 		//Object.keys(option.query).includes('sessionId') && 
 		if( option.query.sessionId!=''&&option.query.sessionId!=null){
 			uni.setStorageSync("sessionId",option.query.sessionId)

+ 8 - 3
pages/index/index.vue

@@ -445,6 +445,7 @@
 				hasPop:false,
 				title: '',
 				showMask: true,
+				scanChannel:0,
 				// alipay
 				params: [{
 					//活动id
@@ -519,15 +520,19 @@
 			this.$scope.onAdError = this.onAdError.bind(this)
 			//保险
 			
+		
 			var _this = this
 			_this.device_sn = uni.getStorageSync("device_sn")
 			_this.title = uni.getStorageSync("title")
+			_this.scanChannel = uni.getStorageSync("channel")
 			_this.sessionId = 'we7sid-' + uni.getStorageSync("sessionId")
-			 // _this.device_sn = 'GD1B406633'
-			// _this.sessionId = 'we7sid-' + '9908b0533fb8af82dba4cd59daa93870';
+
+			//  _this.device_sn = 'GD1B397202'
+			// _this.sessionId = 'we7sid-' + '01deee25ece67d8f799372954746638d';
 			uni.setNavigationBarTitle({
 				title: _this.title
 			})
+			
 
 		},
 		methods: {
@@ -740,7 +745,7 @@
 					method: 'get',
 					url: config.baseUrl +
 						'/app/index.php?i=1&j=1&c=entry&debugSkip=true&debug=1&isajax=1&m=wdl_shopping&do=wepay&sn=' +
-						sn + '&state=' +
+						sn + '&channel='+_this.scanChannel+'&state=' +
 						_this
 						.sessionId,
 					success(res) {