intelTicket.vue 1.78 KB
Newer Older
潘永坪's avatar
潘永坪 committed
1 2 3 4 5 6 7 8
<template>
	<!--联合国际电子门票页面-->
	<view>
		<web-view :src="outUrl"></web-view>
	</view>
</template>

<script>
9 10 11 12 13 14 15 16 17 18 19 20 21
export default {
  data() {
    return {
      outUrl:'',//跳出地址
      Brightness:'',//屏幕亮度
    }
  },
  onShow() {
    let _this=this
    uni.getScreenBrightness({
      success: function(res){
        // 这里是把获取到的手机屏幕亮度,存储到data里面,方便给到页面生命周期隐藏和卸载方法里面用
			   _this.Brightness = res.value
潘永坪's avatar
潘永坪 committed
22
			   if(res.value != 1){
23
          uni.setScreenBrightness({
潘永坪's avatar
潘永坪 committed
24
			        value: 1
25
          })
潘永坪's avatar
潘永坪 committed
26
			   }
27 28 29 30 31 32 33 34 35 36 37 38
      }
    })
  },
  onHide: function () {
    uni.setScreenBrightness({// 恢复之前屏幕亮度
      value: this.Brightness
    })
  },
  onLoad(option) {
    //#ifdef MP-WEIXIN
    this.enterUrl=option.q
    //#endif
潘永坪's avatar
潘永坪 committed
39
			
40 41 42
    //#ifdef MP-ALIPAY
    this.enterUrl=uni.getStorageSync('alipayQrCode')
    //#endif
潘永坪's avatar
潘永坪 committed
43
			
44 45 46 47 48 49 50 51 52
    if(this.enterUrl){//普通二维码扫码进入
      let pdOpenid=uni.getStorageSync('openid')//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
      let pdToken=uni.getStorageSync('token')
      let pdCreateUserId=uni.getStorageSync('createUserId')
      let pdUserId=uni.getStorageSync('userId')
      let orderId=this.getUrlKey('orderId')//订单Id
      let ifNotice=this.getUrlKey('ifNotice')//是否已经扫码
      this.outUrl=this.$wxurl+'intelDetail?orderId='+orderId+'&ifNotice='+ifNotice+'&pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
    }
潘永坪's avatar
潘永坪 committed
53
			
54 55 56 57 58 59 60
  },
  methods: {
    getUrlKey(name){//---获取url
			  return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || ''
    },
  }
}
潘永坪's avatar
潘永坪 committed
61 62 63 64 65
</script>

<style>

</style>