Commit b52df2e5 authored by 潘永坪's avatar 潘永坪

长江索道公众号页面改成小程序页面

parent 44040ee8
var baseUrl = ''
if(process.env.NODE_ENV === 'development'){//开发环境
baseUrl= "http://pay.tuyoyoo.com/"
baseUrl= 'http://pay.tuyoyoo.com/'
}else{
baseUrl= "https://manager.pangdly.com/"
baseUrl= 'https://manager.pangdly.com/'
}
const request = (url = '', data = {}, type = 'POST') => {
......@@ -10,18 +10,18 @@ const request = (url = '', data = {}, type = 'POST') => {
return new Promise((resolve, reject) => {
uni.request({
method: type,
url: baseUrl + url+'?token='+uni.getStorageSync("token"),
url: baseUrl + url+'?token='+uni.getStorageSync('token'),
data:data,
dataType: 'json',
}).then((response) => {
uni.hideLoading()
let [error,res] = response;
resolve(res.data);
let [error,res] = response
resolve(res.data)
}).catch(error => {
uni.hideLoading()
let [err, res] = error;
let [err, res] = error
reject(err)
})
});
})
}
export default request
\ No newline at end of file
{
"name" : "uni-pdtravel",
"appid" : "",
"appid" : "__UNI__17F18E2",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
......
......@@ -320,6 +320,15 @@
}
}
,{
"path" : "pages/common/getTicket/getTicket",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "white",
......
......@@ -5,32 +5,32 @@
</template>
<script>
export default {
export default {
data() {
return {
enterUrl:"",//进入页面路由
outUrl:"",//跳出页面路由
enterUrl:'',//进入页面路由
outUrl:'',//跳出页面路由
}
},
onLoad(option){
let groupId=option.groupId
let groupChannelId=option.groupChannelId
let companyId=option.companyId
let productIdList=option.productIdList
let orderSource=option.orderSource
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/#/combiOrder?pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId
let url="&groupId="+groupId+"&groupChannelId="+groupChannelId+"&productIdList="+productIdList+"&orderSource="+orderSource+"&companyId="+companyId+"&ifyukuaiCode="+ifyukuaiCode
let groupId=option.groupId||''
let groupChannelId=option.groupChannelId||''
let companyId=option.companyId||''
let productIdList=option.productIdList||''
let orderSource=option.orderSource||''
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/#/combiOrder?pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
let url='&groupId='+groupId+'&groupChannelId='+groupChannelId+'&productIdList='+productIdList+'&orderSource='+orderSource+'&companyId='+companyId+'&ifyukuaiCode='+ifyukuaiCode
this.outUrl=baseUrl+url
},
methods: {
}
}
}
</script>
<style>
......
<template>
<!-- 1.获取购票凭证页面,索道等景区进入添加企业微信获取电子门票 -->
<!--2.判断是否添加,已经添加直接进入订单列表页面 ,没有添加就添加企业微信-->
<!-- 3.如果企业微信人数达到上线,直接跳转到订单列表页面 -->
<!-- 4.如果企业微信码停用,走公众号流程 -->
<view class="bigBox">
<image src="../../../static/img/common/getTicketBg.jpg" class="bigImg"></image>
<view class="title">获取购票凭证</view>
<!-- 企业微信流程 -->
<view v-if="showCompany">
<view class="imgbox">
<image :src="imgUrl" style="width:360rpx;height:360rpx;"></image>
</view>
<view class="content1">长按二维码,添加“客服”</view>
<view class="content2">获取您的电子门票</view>
</view>
<!-- 公众号流程 -->
<div v-if="showPublic">
<view class="imgbox">
<image :src="imgUrl" style="width:360rpx;height:360rpx;"></image>
</view>
<view class="content1">长按二维码,关注“胖丁旅游”</view>
<view class="content2">获取您的电子门票</view>
</div>
</view>
</template>
<script>
export default {
data() {
return {
showCompany:false,//企业微信流程
showPublic:false,//公众号流程
merchantId:'',//商户Id
companyId:'',//公司Id
imgUrl:'',//图片地址
}
},
onLoad(option) {
this.merchantId=option.merchantId
this.companyId=option.companyId
this.ifAddWxUser()
},
methods: {
//---是否添加企业微信
ifAddWxUser(){
let data = {
openid:uni.getStorageSync('openid'),//openId
}
this.$request('wechatUser/wxUser/findWxUser',data).then(res => {
if (res.code == '00') {
if(res.data.alreadyAddAttendant=='1'){
//已添加
uni.navigateTo({
url: '/pages/my/order/orderList/orderList'
})
}else{
//未添加
this.getCompanyCode()
}
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
//---获取企业微信二维码编号
getCompanyCode() {
let data = {
merchantId: this.merchantId,
companyId:this.companyId
}
this.$request('scenic/wechatCodeConfig/load',data).then(res => {
if (res.code == '00') {
//微信码正常
if(res.data.status=='0'){
//达到上线跳转小程序页面
if(res.data.alreadyAddNumber>=res.data.canAddNumber){
uni.navigateTo({
url: '/pages/my/order/orderList/orderList'
})
}else{
this.showCompany=true
this.imgUrl = res.data.codeUrl
}
}else{
//微信码停用获取公众号二维码
this.showPublic=true
this.getCode()
}
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
//---获取公众号二维码编号
getCode() {
let data = {
codeType: 1,
select: 1,
companyId: this.companyId
}
this.$request('user/company/generateQrCodeUrl', data).then(res => {
if (res.code == '00') {
this.imgUrl = res.data.codeImgUrl
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
}
}
</script>
<style>
.bigBox {
height: 100%;
padding-top: 18vh;
text-align: center;
font-weight: bold;
font-size:28rpx;
box-sizing: border-box;
position: relative;
}
.bigImg{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}
.title {
font-size:66rpx;
font-weight: bold;
color: #ff570e;
}
.imgbox {
margin-top: 6vh;
}
.content1 {
margin-top: 6vh;
}
.content2 {
margin-top: 3vh;
}
@media only screen and (max-height:760px) {
.bigBox {
padding-top: 16vh;
}
.imgbox {
margin-top: 5vh;
}
.content1 {
margin-top: 5vh;
}
.content2 {
margin-top: 2vh;
}
}
</style>
......@@ -63,25 +63,25 @@
}
}else{
uni.showToast({
title:res.message,
title:res.message+'请退出并重新登录',
icon:'none'
})
}
}).catch((err)=>{
uni.showToast({
title:'登录失败',
title:'登录失败,请退出并重新登录',
icon:'none'
})
})
}else{
uni.showToast({
title:res.message,
title:res.message='请退出并重新登录',
icon:'none'
})
}
}).catch((err)=>{
uni.showToast({
title:'登录失败',
title:'登录失败,请退出并重新登录',
icon:'none'
})
})
......
......@@ -5,11 +5,11 @@
</template>
<script>
export default {
export default {
data() {
return {
outUrl:"",//跳出地址
Brightness:"",//屏幕亮度
outUrl:'',//跳出地址
Brightness:'',//屏幕亮度
}
},
onShow() {
......@@ -17,11 +17,11 @@
uni.getScreenBrightness({
success: function(res){
// 这里是把获取到的手机屏幕亮度,存储到data里面,方便给到页面生命周期隐藏和卸载方法里面用
_this.Brightness = res.value;
_this.Brightness = res.value
if(res.value != 1){
uni.setScreenBrightness({
value: 1
});
})
}
}
})
......@@ -32,17 +32,17 @@
})
},
onLoad(option) {
let pdOpenid=uni.getStorageSync("openid")//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync("token")
let pdCreateUserId=uni.getStorageSync("createUserId")
let pdUserId=uni.getStorageSync("userId")
let ifyukuaiCode=option.ifyukuaiCode//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
this.outUrl="https://wx.pangdly.com/#/unusedDetail?id="+option.orderId+"&pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId+"&ifyukuaiCode="+ifyukuaiCode
let pdOpenid=uni.getStorageSync('openid')//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')
let pdCreateUserId=uni.getStorageSync('createUserId')
let pdUserId=uni.getStorageSync('userId')
let ifyukuaiCode=option.ifyukuaiCode||''//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
this.outUrl='https://wx.pangdly.com/#/unusedDetail?id='+option.orderId+'&pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId+'&ifyukuaiCode='+ifyukuaiCode
},
methods: {
}
}
}
</script>
<style>
......
......@@ -5,24 +5,24 @@
</template>
<script>
export default {
export default {
data() {
return {
outUrl:"",//跳出地址
outUrl:'',//跳出地址
}
},
onLoad(option) {
let pdOpenid=uni.getStorageSync("openid")//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync("token")
let pdCreateUserId=uni.getStorageSync("createUserId")
let pdUserId=uni.getStorageSync("userId")
let ifyukuaiCode=option.ifyukuaiCode//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
this.outUrl="https://wx.pangdly.com/#/ordersList1?pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId+"&ifyukuaiCode="+ifyukuaiCode
let pdOpenid=uni.getStorageSync('openid')//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')
let pdCreateUserId=uni.getStorageSync('createUserId')
let pdUserId=uni.getStorageSync('userId')
let ifyukuaiCode=option.ifyukuaiCode||''//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
this.outUrl='https://wx.pangdly.com/#/ordersList1?pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId+'&ifyukuaiCode='+ifyukuaiCode
},
methods: {
}
}
}
</script>
<style>
This diff is collapsed.
......@@ -5,31 +5,31 @@
</template>
<script>
export default {
export default {
data() {
return {
enterUrl:"",//进入页面路由
outUrl:"",//跳出页面路由
enterUrl:'',//进入页面路由
outUrl:'',//跳出页面路由
}
},
onLoad(option){
let merchantId=option.merchantId
let productId=option.productId
let companyId=option.companyId
let orderSource=option.orderSource
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/#/scenicJointOrder?pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId
let url="&merchantId="+merchantId+"&productId="+productId+"&orderSource="+orderSource+"&companyId="+companyId+"&ifyukuaiCode="+ifyukuaiCode
let merchantId=option.merchantId||''
let productId=option.productId||''
let companyId=option.companyId||''
let orderSource=option.orderSource||''
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/#/scenicJointOrder?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: {
}
}
}
</script>
<style>
......
......@@ -5,11 +5,11 @@
</template>
<script>
export default {
export default {
data() {
return {
enterUrl:"",//进入页面路由
outUrl:"",//跳出页面路由
enterUrl:'',//进入页面路由
outUrl:'',//跳出页面路由
}
},
onLoad(option) {
......@@ -18,43 +18,43 @@
//#endif
//#ifdef MP-ALIPAY
this.enterUrl=uni.getStorageSync("alipayQrCode")
this.enterUrl=uni.getStorageSync('alipayQrCode')
//#endif
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
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
}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
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') || "";
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || ''
},
}
}
}
</script>
<style>
......
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