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

入口公司ID流程优化

parent da4f8294
...@@ -40,6 +40,8 @@ export default { ...@@ -40,6 +40,8 @@ export default {
uni.removeStorageSync('alipayQrCode') uni.removeStorageSync('alipayQrCode')
} }
//#endif //#endif
//清除之前的companyId
uni.removeStorageSync('companyId')
/* 版本自动更新代码 */ /* 版本自动更新代码 */
const updateManager = uni.getUpdateManager() const updateManager = uni.getUpdateManager()
updateManager.onCheckForUpdate(function (res) { updateManager.onCheckForUpdate(function (res) {
......
...@@ -46,6 +46,31 @@ export default{ ...@@ -46,6 +46,31 @@ export default{
var regss = new RegExp(':','g')//去掉时间里面的:冒号 var regss = new RegExp(':','g')//去掉时间里面的:冒号
var c = b.replace(regss,'') var c = b.replace(regss,'')
return c 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() //调用方法时--this.$commonjs.today()
\ No newline at end of file
...@@ -8,7 +8,7 @@ import commonjs from 'common/common.js' ...@@ -8,7 +8,7 @@ import commonjs from 'common/common.js'
Vue.prototype.$commonjs = commonjs Vue.prototype.$commonjs = commonjs
Vue.prototype.$request = request Vue.prototype.$request = request
Vue.prototype.imageError ='@/static/img/common/pangdingLogo.png' //餐饮类型 Vue.prototype.imageError ='@/static/img/common/pangdingLogo.png'
Vue.use(uView) Vue.use(uView)
Vue.config.productionTip = false Vue.config.productionTip = false
......
...@@ -269,6 +269,24 @@ ...@@ -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": [ "subPackages": [
......
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
} }
}, },
onLoad(option) { onLoad(option) {
let companyId=option.companyId||'' let companyId=this.$commonjs.getCompanyId(option)
let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除 let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')||'' let pdToken=uni.getStorageSync('token')||''
let pdCreateUserId=uni.getStorageSync('createUserId')||'' let pdCreateUserId=uni.getStorageSync('createUserId')||''
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
亲子游 亲子游
</view> </view>
</view> </view>
<view> <view @click="goTravelList()">
<image src="@/static/img/index/classify7.png"></image> <image src="@/static/img/index/classify7.png"></image>
<view> <view>
行程订制 行程订制
...@@ -207,7 +207,6 @@ ...@@ -207,7 +207,6 @@
export default { export default {
data() { data() {
return { return {
companyId:'',//公司Id
list: [ list: [
{ {
image: 'http://wx.pangdly.com/static/img/home1.69efcf8.jpg' image: 'http://wx.pangdly.com/static/img/home1.69efcf8.jpg'
...@@ -222,8 +221,8 @@ export default { ...@@ -222,8 +221,8 @@ export default {
} }
}, },
onLoad(option){ onLoad(option){
this.companyId=option.companyId||'' let companyId=this.$commonjs.getCompanyId(option)
if(!this.companyId){ if(!companyId){
this.getCompanyId() this.getCompanyId()
} }
}, },
...@@ -234,70 +233,77 @@ export default { ...@@ -234,70 +233,77 @@ export default {
let data={openid} let data={openid}
this.$request('wechatUser/wxUser/getLastRecord',data).then((res) => { this.$request('wechatUser/wxUser/getLastRecord',data).then((res) => {
if (res.code == '00'){ if (res.code == '00'){
//公司Id,用于入口判断,跳入公众号页面时需要传入到公众号 //公司Id,用于入口判断,跳入公众号页面时需要传入到公众号
this.companyId=res.data.companyId||'' let companyId=res.data.companyId||''
uni.setStorageSync('companyId',companyId)
} }
}) })
}, },
//---轮播图点击 //---轮播图点击
swiperClick(index){ swiperClick(index){
//长江索道 //长江索道
if(index==0){ if(index==0){
this.goSuodao() this.goSuodao()
} }
//湖广会馆 //湖广会馆
if(index==1){ if(index==1){
this.goHuiguan() this.goHuiguan()
} }
//联合国际 //联合国际
if(index==2){ if(index==2){
this.goGuoji() this.goGuoji()
} }
}, },
//---跳转景区首页 //---跳转景区首页
goScenic(){ goScenic(){
uni.navigateTo({ uni.navigateTo({
url:'/pages/scenic/scenicIndex/scenicIndex?companyId='+this.companyId url:'/pages/scenic/scenicIndex/scenicIndex'
}) })
}, },
//---跳转酒店首页 //---跳转酒店首页
goHotel(){ goHotel(){
uni.navigateTo({ uni.navigateTo({
url:'/pages/hotel/hotelIndex/hotelIndex?companyId='+this.companyId url:'/pages/hotel/hotelIndex/hotelIndex'
}) })
}, },
//---跳转vlog //---跳转vlog
goVlog(){ goVlog(){
uni.navigateTo({ uni.navigateTo({
url:'/pages/vlog/vlogIndex/vlogIndex?companyId='+this.companyId url:'/pages/vlog/vlogIndex/vlogIndex'
}) })
}, },
//---跳转索道 //---跳转行程订制
goSuodao(){ goTravelList(){
uni.navigateTo({ uni.navigateTo({
url:'/pages/combination/distributionCombiChoose/distributionCombiChoose?channelId=1&merchantId=z0015605022691a5945bbe463141668c'+ url:'/pages/my/travelList/travelList/travelList'
'&groupId=z0016038113016708b8ad38c637b2f26&groupChannelId=z00160423712018998e6260ffcaf3369&companyId='+this.companyId })
}) },
}, //---跳转索道
//---跳转联合国际 goSuodao(){
goGuoji(){ uni.navigateTo({
uni.navigateTo({ url:'/pages/combination/distributionCombiChoose/distributionCombiChoose?channelId=1&merchantId=z0015605022691a5945bbe463141668c'+
url:'/pages/scenic/scenicProduct/scenicProduct?merchantId=z00160128940329482da6bd94d443a91&companyId='+this.companyId '&groupId=z0016038113016708b8ad38c637b2f26&groupChannelId=z00160423712018998e6260ffcaf3369'
}) })
}, },
//---跳转两江游 //---跳转联合国际
goLiangjiang(){ goGuoji(){
uni.navigateTo({ uni.navigateTo({
url:'/pages/scenic/scenicProduct/scenicProduct?merchantId=z001578652229233acd0134cf825fdbe&companyId='+this.companyId url:'/pages/scenic/scenicProduct/scenicProduct?merchantId=z00160128940329482da6bd94d443a91'
}) })
},
//---跳转两江游
goLiangjiang(){
uni.navigateTo({
url:'/pages/scenic/scenicProduct/scenicProduct?merchantId=z001578652229233acd0134cf825fdbe'
})
}, },
//---跳转湖广会馆 //---跳转湖广会馆
goHuiguan(){ goHuiguan(){
uni.navigateTo({ 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 { ...@@ -144,13 +144,13 @@ export default {
scenicList:[],//景区数据 scenicList:[],//景区数据
list: [ 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: [{ tabList: [{
...@@ -168,7 +168,10 @@ export default { ...@@ -168,7 +168,10 @@ export default {
} }
}, },
onLoad(option) { onLoad(option) {
let token = uni.getStorageSync('token') //获取公司Id,保存到本地,支付等逻辑需要入口companyId
this.$commonjs.getCompanyId(option)
let token = uni.getStorageSync('token')||''
uni.setStorageSync('companyId',companyId)
if(token){ if(token){
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'wgs84',
......
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
} }
queryTotal = queryTotal.substr(1) queryTotal = queryTotal.substr(1)
if (token) { if (token) {
uni.redirectTo({ uni.reLaunch({
url: '/' + enterOptions.path + '?' + queryTotal url: '/' + enterOptions.path + '?' + queryTotal
}) })
//保存当前日期 //保存当前日期
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</view> </view>
</view> </view>
<view class="middle1-list"> <view class="middle1-list" @click="goCoupon()">
<view> <view>
0 0
</view> </view>
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
购物车 购物车
</view> </view>
</view> </view>
<view class="middle3-list"> <view class="middle3-list" @click="goTravelList()">
<view> <view>
<image src="@/static/img/my/center/schedule.png"></image> <image src="@/static/img/my/center/schedule.png"></image>
</view> </view>
...@@ -208,6 +208,18 @@ export default { ...@@ -208,6 +208,18 @@ export default {
url:'/pages/my/customerService/enterpriseWechat/enterpriseWechat' 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> </script>
......
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
} }
}, },
onLoad(option) { onLoad(option) {
let companyId=option.companyId||'' let companyId=this.$commonjs.getCompanyId(option)
let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除 let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')||'' let pdToken=uni.getStorageSync('token')||''
let pdCreateUserId=uni.getStorageSync('createUserId')||'' 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 { ...@@ -12,7 +12,7 @@ export default {
} }
}, },
onLoad(option) { onLoad(option) {
let companyId=option.companyId||'' let companyId=this.$commonjs.getCompanyId(option)
let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除 let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')||'' let pdToken=uni.getStorageSync('token')||''
let pdCreateUserId=uni.getStorageSync('createUserId')||'' let pdCreateUserId=uni.getStorageSync('createUserId')||''
......
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
} }
}, },
onLoad(option) { onLoad(option) {
let companyId=option.companyId||'' let companyId=this.$commonjs.getCompanyId(option)
let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除 let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')||'' let pdToken=uni.getStorageSync('token')||''
let pdCreateUserId=uni.getStorageSync('createUserId')||'' let pdCreateUserId=uni.getStorageSync('createUserId')||''
......
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
} }
}, },
onLoad(option) { onLoad(option) {
let companyId=option.companyId||'' let companyId=this.$commonjs.getCompanyId(option)
let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除 let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')||'' let pdToken=uni.getStorageSync('token')||''
let pdCreateUserId=uni.getStorageSync('createUserId')||'' 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 @@ ...@@ -34,7 +34,7 @@
<label v-for="(items,a) in item.productListCopy" :key='a' :class="{'off':items.status==2}"> <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" :class="{'on':items.ifChangeBg}">
<view class="product-left"> <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>
<view class="product-right"> <view class="product-right">
...@@ -227,6 +227,8 @@ export default { ...@@ -227,6 +227,8 @@ export default {
}, },
onLoad(option){ onLoad(option){
//获取公司Id,保存到本地,支付等逻辑需要入口companyId
this.$commonjs.getCompanyId(option)
this.merchantId=option.merchantId||'' this.merchantId=option.merchantId||''
let token = uni.getStorageSync('token') let token = uni.getStorageSync('token')
if(token){ if(token){
......
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
} }
}, },
onLoad(option) { onLoad(option) {
let companyId=option.companyId||'' let companyId=this.$commonjs.getCompanyId(option)
let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除 let pdOpenid=uni.getStorageSync('openid')||''//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')||'' let pdToken=uni.getStorageSync('token')||''
let pdCreateUserId=uni.getStorageSync('createUserId')||'' 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