scenicSingleOrder.vue 2.43 KB
Newer Older
1 2 3 4 5 6 7
<template>
	<view>
		<web-view :src="outUrl"></web-view>
	</view>
</template>

<script>
8 9 10 11 12 13 14 15 16 17 18
export default {
  data() {
    return {
      enterUrl:'',//进入页面路由
      outUrl:'',//跳出页面路由
    }
  },
  onLoad(option) {
    //#ifdef MP-WEIXIN
    this.enterUrl=option.q
    //#endif
19
			
20 21 22
    //#ifdef MP-ALIPAY
    this.enterUrl=uni.getStorageSync('alipayQrCode')
    //#endif
23
			
24 25 26 27 28 29 30 31 32 33 34 35
    if(this.enterUrl){//普通二维码扫码进入
      let merchantId=this.getUrlKey('merchantId')
      let productId=this.getUrlKey('productId')
      let orderSource=this.getUrlKey('orderSource')
      let companyId=this.getUrlKey('companyId')
      let pdOpenid=uni.getStorageSync('openid')//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
      let pdToken=uni.getStorageSync('token')
      let pdCreateUserId=uni.getStorageSync('createUserId')
      let pdUserId=uni.getStorageSync('userId')
      let baseUrl='https://wx.pangdly.com/#/scenicSingleOrder?pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
      let url='&merchantId='+merchantId+'&productId='+productId+'&orderSource='+orderSource+'&companyId='+companyId
      this.outUrl=baseUrl+url
36
					
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
    }else{//小程序页面跳转进入
      let merchantId=option.merchantId||''
      let productId=option.productId||''
      let orderSource=option.orderSource||''
      let companyId=option.companyId||''
      let ifyukuaiCode=option.ifyukuaiCode||''//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
      let pdOpenid=uni.getStorageSync('openid')//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
      let pdToken=uni.getStorageSync('token')
      let pdCreateUserId=uni.getStorageSync('createUserId')
      let pdUserId=uni.getStorageSync('userId')
      let baseUrl='https://wx.pangdly.com/#/scenicSingleOrder?pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
      let url='&merchantId='+merchantId+'&productId='+productId+'&orderSource='+orderSource+'&companyId='+companyId+'&ifyukuaiCode='+ifyukuaiCode
      this.outUrl=baseUrl+url	
    }
  },
  methods: {
    getUrlKey(name){//---------------------------------------------------------------获取url
			  return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || ''
    },
  }
}
58 59 60 61 62
</script>

<style>

</style>