Commit 262f87f6 authored by 潘永坪's avatar 潘永坪

入口公司ID流程优化

parent da4f8294
......@@ -40,6 +40,8 @@ export default {
uni.removeStorageSync('alipayQrCode')
}
//#endif
//清除之前的companyId
uni.removeStorageSync('companyId')
/* 版本自动更新代码 */
const updateManager = uni.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
......
......@@ -46,6 +46,31 @@ export default{
var regss = new RegExp(':','g')//去掉时间里面的:冒号
var c = b.replace(regss,'')
return c
},
getUrlKey:function(name){//通过连接地址获取参数值
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || ''
},
/*
通过链接地址获取companyId,并保持在本地
页面获取companyI方法 let companyId=this.$commonjs.getCompanyId()
*/
getCompanyId:function(option){
let enterUrl=''
//#ifdef MP-WEIXIN
enterUrl=option.q
//#endif
//#ifdef MP-ALIPAY
enterUrl=uni.getStorageSync('alipayQrCode')
//#endif
let companyId=''
if(enterUrl){//普通二维码扫码进入
companyId=getUrlKey('companyId')||uni.getStorageSync('companyId')||''
}else{//小程序页面跳转进入
companyId=option.companyId||uni.getStorageSync('companyId')||''
}
uni.setStorageSync('companyId',companyId)
return companyId
}
}
//调用方法时--this.$commonjs.today()
\ No newline at end of file
......@@ -8,7 +8,7 @@ import commonjs from 'common/common.js'
Vue.prototype.$commonjs = commonjs
Vue.prototype.$request = request
Vue.prototype.imageError ='@/static/img/common/pangdingLogo.png' //餐饮类型
Vue.prototype.imageError ='@/static/img/common/pangdingLogo.png'
Vue.use(uView)
Vue.config.productionTip = false
......
......@@ -269,6 +269,24 @@
}
}
,{
"path" : "pages/my/couponCenter/myCouponList/myCouponList",
"style" :
{
"navigationBarTitleText": "我的券列表",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/my/travelList/travelList/travelList",
"style" :
{
"navigationBarTitleText": "行程单",
"enablePullDownRefresh": false
}
}
],
//分包加载配置,此配置为小程序的分包加载机制。
"subPackages": [
......
......@@ -12,7 +12,7 @@ export default {
}
},
onLoad(option) {
let companyId=option.companyId||''
let companyId=this.$commonjs.getCompanyId(option)
let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')||''
let pdCreateUserId=uni.getStorageSync('createUserId')||''
......
......@@ -41,7 +41,7 @@
亲子游
</view>
</view>
<view>
<view @click="goTravelList()">
<image src="@/static/img/index/classify7.png"></image>
<view>
行程订制
......@@ -207,7 +207,6 @@
export default {
data() {
return {
companyId:'',//公司Id
list: [
{
image: 'http://wx.pangdly.com/static/img/home1.69efcf8.jpg'
......@@ -222,8 +221,8 @@ export default {
}
},
onLoad(option){
this.companyId=option.companyId||''
if(!this.companyId){
let companyId=this.$commonjs.getCompanyId(option)
if(!companyId){
this.getCompanyId()
}
},
......@@ -235,7 +234,8 @@ export default {
this.$request('wechatUser/wxUser/getLastRecord',data).then((res) => {
if (res.code == '00'){
//公司Id,用于入口判断,跳入公众号页面时需要传入到公众号
this.companyId=res.data.companyId||''
let companyId=res.data.companyId||''
uni.setStorageSync('companyId',companyId)
}
})
},
......@@ -257,45 +257,51 @@ export default {
//---跳转景区首页
goScenic(){
uni.navigateTo({
url:'/pages/scenic/scenicIndex/scenicIndex?companyId='+this.companyId
url:'/pages/scenic/scenicIndex/scenicIndex'
})
},
//---跳转酒店首页
goHotel(){
uni.navigateTo({
url:'/pages/hotel/hotelIndex/hotelIndex?companyId='+this.companyId
url:'/pages/hotel/hotelIndex/hotelIndex'
})
},
//---跳转vlog
goVlog(){
uni.navigateTo({
url:'/pages/vlog/vlogIndex/vlogIndex?companyId='+this.companyId
url:'/pages/vlog/vlogIndex/vlogIndex'
})
},
//---跳转行程订制
goTravelList(){
uni.navigateTo({
url:'/pages/my/travelList/travelList/travelList'
})
},
//---跳转索道
goSuodao(){
uni.navigateTo({
url:'/pages/combination/distributionCombiChoose/distributionCombiChoose?channelId=1&merchantId=z0015605022691a5945bbe463141668c'+
'&groupId=z0016038113016708b8ad38c637b2f26&groupChannelId=z00160423712018998e6260ffcaf3369&companyId='+this.companyId
'&groupId=z0016038113016708b8ad38c637b2f26&groupChannelId=z00160423712018998e6260ffcaf3369'
})
},
//---跳转联合国际
goGuoji(){
uni.navigateTo({
url:'/pages/scenic/scenicProduct/scenicProduct?merchantId=z00160128940329482da6bd94d443a91&companyId='+this.companyId
url:'/pages/scenic/scenicProduct/scenicProduct?merchantId=z00160128940329482da6bd94d443a91'
})
},
//---跳转两江游
goLiangjiang(){
uni.navigateTo({
url:'/pages/scenic/scenicProduct/scenicProduct?merchantId=z001578652229233acd0134cf825fdbe&companyId='+this.companyId
url:'/pages/scenic/scenicProduct/scenicProduct?merchantId=z001578652229233acd0134cf825fdbe'
})
},
//---跳转湖广会馆
goHuiguan(){
uni.navigateTo({
url:'/pages/scenic/scenicProduct/scenicProduct?merchantId=cdd4da5d154a4512bd5f3bec2797557b&companyId='+this.companyId
url:'/pages/scenic/scenicProduct/scenicProduct?merchantId=cdd4da5d154a4512bd5f3bec2797557b'
})
}
......
......@@ -144,13 +144,13 @@ export default {
scenicList:[],//景区数据
list: [
{
image: 'http://wx.pangdly.com/static/img/test7.6d14c2d.jpg'
image: 'http://wx.pangdly.com/static/img/home1.69efcf8.jpg'
},
{
image: 'http://wx.pangdly.com/static/img/test8.1cf812b.jpg'
image: 'http://wx.pangdly.com/static/img/home2.2ec1a04.jpg'
},
{
image: 'http://wx.pangdly.com/static/img/test9.b3dd44c.jpg'
image: 'http://wx.pangdly.com/static/img/home3.df60ec3.jpg'
}
],
tabList: [{
......@@ -168,7 +168,10 @@ export default {
}
},
onLoad(option) {
let token = uni.getStorageSync('token')
//获取公司Id,保存到本地,支付等逻辑需要入口companyId
this.$commonjs.getCompanyId(option)
let token = uni.getStorageSync('token')||''
uni.setStorageSync('companyId',companyId)
if(token){
uni.getLocation({
type: 'wgs84',
......
......@@ -67,7 +67,7 @@ export default {
}
queryTotal = queryTotal.substr(1)
if (token) {
uni.redirectTo({
uni.reLaunch({
url: '/' + enterOptions.path + '?' + queryTotal
})
//保存当前日期
......
......@@ -19,7 +19,7 @@
</view>
</view>
<view class="middle1-list">
<view class="middle1-list" @click="goCoupon()">
<view>
0
</view>
......@@ -142,7 +142,7 @@
购物车
</view>
</view>
<view class="middle3-list">
<view class="middle3-list" @click="goTravelList()">
<view>
<image src="@/static/img/my/center/schedule.png"></image>
</view>
......@@ -208,6 +208,18 @@ export default {
url:'/pages/my/customerService/enterpriseWechat/enterpriseWechat'
})
},
//---跳转券中心
goCoupon(){
uni.navigateTo({
url:'/pages/my/couponCenter/myCouponList/myCouponList'
})
},
//---跳转行程单
goTravelList(){
uni.navigateTo({
url:'/pages/my/travelList/travelList/travelList'
})
},
}
}
</script>
......
......@@ -12,7 +12,7 @@ export default {
}
},
onLoad(option) {
let companyId=option.companyId||''
let companyId=this.$commonjs.getCompanyId(option)
let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')||''
let pdCreateUserId=uni.getStorageSync('createUserId')||''
......
<template>
<view>
<web-view :src="outUrl"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
outUrl:'',//跳出地址
}
},
onLoad(option) {
let companyId=this.$commonjs.getCompanyId(option)
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/#/myCoupon?companyId='
this.outUrl=baseUrl+companyId+'&pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
},
methods: {
}
}
</script>
<style>
</style>
\ No newline at end of file
......@@ -12,7 +12,7 @@ export default {
}
},
onLoad(option) {
let companyId=option.companyId||''
let companyId=this.$commonjs.getCompanyId(option)
let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')||''
let pdCreateUserId=uni.getStorageSync('createUserId')||''
......
......@@ -12,7 +12,7 @@ export default {
}
},
onLoad(option) {
let companyId=option.companyId||''
let companyId=this.$commonjs.getCompanyId(option)
let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')||''
let pdCreateUserId=uni.getStorageSync('createUserId')||''
......
......@@ -12,7 +12,7 @@ export default {
}
},
onLoad(option) {
let companyId=option.companyId||''
let companyId=this.$commonjs.getCompanyId(option)
let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')||''
let pdCreateUserId=uni.getStorageSync('createUserId')||''
......
<template>
<view>
<web-view :src="outUrl"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
outUrl:'',//跳出地址
}
},
onLoad(option) {
let companyId=this.$commonjs.getCompanyId(option)
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/#/travelList?companyId='
this.outUrl=baseUrl+companyId+'&pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
},
methods: {
}
}
</script>
<style>
</style>
\ No newline at end of file
......@@ -34,7 +34,7 @@
<label v-for="(items,a) in item.productListCopy" :key='a' :class="{'off':items.status==2}">
<view class="product" :class="{'on':items.ifChangeBg}">
<view class="product-left">
<checkbox class="blue" :disabled="items.status==2" :value="JSON.stringify(items)" :checked="items.ifChecked" />
<checkbox style="transform:scale(0.8)" class="blue" :disabled="items.status==2" :value="JSON.stringify(items)" :checked="items.ifChecked" />
</view>
<view class="product-right">
......@@ -227,6 +227,8 @@ export default {
},
onLoad(option){
//获取公司Id,保存到本地,支付等逻辑需要入口companyId
this.$commonjs.getCompanyId(option)
this.merchantId=option.merchantId||''
let token = uni.getStorageSync('token')
if(token){
......
......@@ -12,7 +12,7 @@ export default {
}
},
onLoad(option) {
let companyId=option.companyId||''
let companyId=this.$commonjs.getCompanyId(option)
let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')||''
let pdCreateUserId=uni.getStorageSync('createUserId')||''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment