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

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

parent 44040ee8
var baseUrl = '' var baseUrl = ''
if(process.env.NODE_ENV === 'development'){//开发环境 if(process.env.NODE_ENV === 'development'){//开发环境
baseUrl= "http://pay.tuyoyoo.com/" baseUrl= 'http://pay.tuyoyoo.com/'
}else{ }else{
baseUrl= "https://manager.pangdly.com/" baseUrl= 'https://manager.pangdly.com/'
} }
const request = (url = '', data = {}, type = 'POST') => { const request = (url = '', data = {}, type = 'POST') => {
data.reqId = new Date().getTime() //获取时间戳 data.reqId = new Date().getTime() //获取时间戳
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request({ uni.request({
method: type, method: type,
url: baseUrl + url+'?token='+uni.getStorageSync("token"), url: baseUrl + url+'?token='+uni.getStorageSync('token'),
data:data, data:data,
dataType: 'json', dataType: 'json',
}).then((response) => { }).then((response) => {
uni.hideLoading() uni.hideLoading()
let [error,res] = response; let [error,res] = response
resolve(res.data); resolve(res.data)
}).catch(error => { }).catch(error => {
uni.hideLoading() uni.hideLoading()
let [err, res] = error; let [err, res] = error
reject(err) reject(err)
}) })
}); })
} }
export default request export default request
\ No newline at end of file
{ {
"name" : "uni-pdtravel", "name" : "uni-pdtravel",
"appid" : "", "appid" : "__UNI__17F18E2",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : "100", "versionCode" : "100",
......
...@@ -320,6 +320,15 @@ ...@@ -320,6 +320,15 @@
} }
} }
,{
"path" : "pages/common/getTicket/getTicket",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
......
...@@ -5,32 +5,32 @@ ...@@ -5,32 +5,32 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
enterUrl:"",//进入页面路由 enterUrl:'',//进入页面路由
outUrl:"",//跳出页面路由 outUrl:'',//跳出页面路由
} }
}, },
onLoad(option){ onLoad(option){
let groupId=option.groupId let groupId=option.groupId||''
let groupChannelId=option.groupChannelId let groupChannelId=option.groupChannelId||''
let companyId=option.companyId let companyId=option.companyId||''
let productIdList=option.productIdList let productIdList=option.productIdList||''
let orderSource=option.orderSource let orderSource=option.orderSource||''
let ifyukuaiCode=option.ifyukuaiCode//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程 let ifyukuaiCode=option.ifyukuaiCode||''//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
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')
let pdUserId=uni.getStorageSync("userId") let pdUserId=uni.getStorageSync('userId')
let baseUrl="https://wx.pangdly.com/#/combiOrder?pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId 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 url='&groupId='+groupId+'&groupChannelId='+groupChannelId+'&productIdList='+productIdList+'&orderSource='+orderSource+'&companyId='+companyId+'&ifyukuaiCode='+ifyukuaiCode
this.outUrl=baseUrl+url this.outUrl=baseUrl+url
}, },
methods: { methods: {
} }
} }
</script> </script>
<style> <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 @@ ...@@ -63,25 +63,25 @@
} }
}else{ }else{
uni.showToast({ uni.showToast({
title:res.message, title:res.message+'请退出并重新登录',
icon:'none' icon:'none'
}) })
} }
}).catch((err)=>{ }).catch((err)=>{
uni.showToast({ uni.showToast({
title:'登录失败', title:'登录失败,请退出并重新登录',
icon:'none' icon:'none'
}) })
}) })
}else{ }else{
uni.showToast({ uni.showToast({
title:res.message, title:res.message='请退出并重新登录',
icon:'none' icon:'none'
}) })
} }
}).catch((err)=>{ }).catch((err)=>{
uni.showToast({ uni.showToast({
title:'登录失败', title:'登录失败,请退出并重新登录',
icon:'none' icon:'none'
}) })
}) })
......
...@@ -5,44 +5,44 @@ ...@@ -5,44 +5,44 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
outUrl:"",//跳出地址 outUrl:'',//跳出地址
Brightness:"",//屏幕亮度 Brightness:'',//屏幕亮度
} }
}, },
onShow() { onShow() {
let _this=this let _this=this
uni.getScreenBrightness({ uni.getScreenBrightness({
success: function(res){ success: function(res){
// 这里是把获取到的手机屏幕亮度,存储到data里面,方便给到页面生命周期隐藏和卸载方法里面用 // 这里是把获取到的手机屏幕亮度,存储到data里面,方便给到页面生命周期隐藏和卸载方法里面用
_this.Brightness = res.value; _this.Brightness = res.value
if(res.value != 1){ if(res.value != 1){
uni.setScreenBrightness({ uni.setScreenBrightness({
value: 1 value: 1
}); })
} }
} }
}) })
}, },
onHide: function () { onHide: function () {
uni.setScreenBrightness({// 恢复之前屏幕亮度 uni.setScreenBrightness({// 恢复之前屏幕亮度
value: this.Brightness value: this.Brightness
}) })
}, },
onLoad(option) { onLoad(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')
let pdUserId=uni.getStorageSync("userId") let pdUserId=uni.getStorageSync('userId')
let ifyukuaiCode=option.ifyukuaiCode//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程 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 this.outUrl='https://wx.pangdly.com/#/unusedDetail?id='+option.orderId+'&pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId+'&ifyukuaiCode='+ifyukuaiCode
}, },
methods: { methods: {
} }
} }
</script> </script>
<style> <style>
......
...@@ -5,24 +5,24 @@ ...@@ -5,24 +5,24 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
outUrl:"",//跳出地址 outUrl:'',//跳出地址
} }
}, },
onLoad(option) { onLoad(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')
let pdUserId=uni.getStorageSync("userId") let pdUserId=uni.getStorageSync('userId')
let ifyukuaiCode=option.ifyukuaiCode//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程 let ifyukuaiCode=option.ifyukuaiCode||''//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
this.outUrl="https://wx.pangdly.com/#/ordersList1?pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId+"&ifyukuaiCode="+ifyukuaiCode this.outUrl='https://wx.pangdly.com/#/ordersList1?pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId+'&ifyukuaiCode='+ifyukuaiCode
}, },
methods: { methods: {
} }
} }
</script> </script>
<style> <style>
<template> <template>
<view> <view>
<view class="middle" v-show="bodyShow"> <view class="middle" v-show="bodyShow">
<view class="main"> <view class="main">
<!-- --------------------------------------复票----------------------------------------------- --> <!-- --------------------------------------复票----------------------------------------------- -->
<view v-if="orderList!=''" v-for="item of orderList" :key="item.id" class="product"> <view v-if="orderList != ''" v-for="item of orderList" :key="item.id" class="product">
<view> <view>
<text> <text> {{ item.merchantName }}{{ item.productName }}</text>
{{item.merchantName}}{{item.productName}}
</text> <text>
<text style="font-size:24rpx;">¥</text>{{ item.unitPrice }} <text>x</text> {{ item.orderNum }}
<text> <text style="margin-top:10rpx;font-size:22rpx;display:block;color:#f45803;" v-if="item.depositReceived"> 押金:{{ item.depositReceived }} </text>
<text style="font-size:24rpx;">¥</text>{{item.unitPrice}} </text>
<text>x</text> </view>
{{item.orderNum}} <view class="coupon" v-if="item.pdDiscountMoney">
<text style="margin-top:10rpx;font-size:22rpx;display:block;color:#f45803;" v-if="item.depositReceived">押金:{{item.depositReceived}}</text> <text></text> <text> <text style="font-size:24rpx;"></text>{{ item.pdDiscountMoney }} </text>
</text> </view>
</view> </view>
<view class="coupon" v-if="item.pdDiscountMoney"> <!-- --------------------------------------单票----------------------------------------------- -->
<text> <view v-if="orderList == ''" class="product">
<view>
</text> <text> {{ merchantName }}{{ productName }}</text>
<text>
<text style="font-size:24rpx;"></text>{{item.pdDiscountMoney}} <text style="text-align: right;">
</text> <text style="font-size:24rpx;">¥</text>{{ unitPrice }} <text>x</text> {{ orderNum }}
</view> <text style="margin-top:10rpx;font-size:22rpx;display:block;color:#f45803;" v-if="depositReceived">押金:{{ depositReceived }}</text>
</view> </text>
<!-- --------------------------------------单票----------------------------------------------- --> </view>
<view v-if="orderList==''" class="product"> <view class="coupon" v-if="pdDiscountMoney">
<view> <text></text> <text> <text style="font-size:24rpx;"></text>{{ pdDiscountMoney }} </text>
<text> </view>
{{merchantName}}{{productName}} </view>
</text> <view class="mainP3">
<text> 实际支付 </text>
<text style="text-align: right;"> <text>
<small style="font-size:24rpx;">¥</small>{{unitPrice}} <!--<i>
<text>x</text>
{{orderNum}}
<text style="margin-top:10rpx;font-size:22rpx;display:block;color:#f45803;" v-if="depositReceived">押金:{{depositReceived}}</text>
</text>
</view>
<view class="coupon" v-if="pdDiscountMoney">
<text>
</text>
<text>
<text style="font-size:24rpx;"></text>{{pdDiscountMoney}}
</text>
</view>
</view>
<view class="mainP3">
<text>
实际支付
</text>
<text>
<!--<i>
¥{{totalMoney}} ¥{{totalMoney}}
</i>--> </i>-->
<text> <text> <text style="font-size:28rpx;">¥</text>{{ pdOrderMoney }} </text>
<text style="font-size:28rpx;">¥</text>{{pdOrderMoney}} </text>
</text> </view>
</text> <view class="mainview">
</view> <!-- #ifdef MP-WEIXIN -->
<view class="mainview"> <image src="@/static/img/orderPayment/weixin.png" style="width:70rpx;height:62rpx;" /> <view> 微信支付 </view>
<image src="@/static/img/orderPayment/weixin.png" style="width:70rpx;height:62rpx;" /> <!-- #endif -->
<view>
微信支付 <!-- #ifdef MP-ALIPAY -->
</view> <image src="@/static/img/orderPayment/alipayLogo.png" style="width:70rpx;height:62rpx;" /> <view> 支付宝支付 </view>
<image src="@/static/img/orderPayment/input.png" style="width:32rpx;height: 32rpx;" /> <!-- #endif -->
</view> <image src="@/static/img/orderPayment/input.png" style="width:32rpx;height: 32rpx;" />
</view> </view>
</view>
</view> </view>
<view class="bottom" v-show="bodyShow"> <view class="bottom" v-show="bodyShow">
<view class="bottomFirst"> <view class="bottomFirst">
<text> <text> 实付款 </text>
实付款
</text> <text> <text>¥</text>{{ pdOrderMoney }} </text>
</view>
<text>
<text>¥</text>{{pdOrderMoney}} <view class="bottomLast">
</text> <text href="tel:400-072-0368"> <!-- <img src="@/assets/img/combination/kefu11.png" style="width: 0.31rpx;" /> --> </text>
</view> <text @click="goPay()" :style="{ background: background }">去支付</text>
</view>
<view class="bottomLast">
<text href="tel:400-072-0368">
<!-- <img src="@/assets/img/combination/kefu11.png" style="width: 0.31rpx;" /> -->
</text>
<text @click="goPay()" :style="{background:background}">去支付</text>
</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
enterUrl:'',//进入页面路由 enterUrl: '', //进入页面路由
merchantName: '', //商户名称 merchantName: '', //商户名称
productName: '', //产品名称 productName: '', //产品名称
orderList: '', //订单列表 orderList: '', //订单列表
unitPrice: '', //单价 unitPrice: '', //单价
depositReceived: 0, //押金 depositReceived: 0, //押金
pdDiscountMoney: '', //优惠价格 pdDiscountMoney: '', //优惠价格
orderNum: '', //数量 orderNum: '', //数量
pdOrderMoney: '', //实际总价 pdOrderMoney: '', //实际总价
totalMoney: '', //原价总价 totalMoney: '', //原价总价
errorMessage: '', //错误信息 errorMessage: '', //错误信息
bodyShow: false, //控制初始化数据成功显示 bodyShow: false, //控制初始化数据成功显示
timeStamp:'',//支付参数 payType: '', //支付类型
nonceStr:'', timeStamp: '', //支付参数
package:'', nonceStr: '',
signType:'', package: '',
paySign:'', signType: '',
orderInfo:'',//支付宝订单号 paySign: '',
background:'',//去支付的背景颜色 orderInfo: '', //支付宝订单号
orderId:'',//订单Id background: '', //去支付的背景颜色
openid:'',//用户Id orderId: '', //订单Id
afterBuyUrl:'',//支付成功后地址跳转 openid: '', //用户Id
ifyukuaiCode:'',//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程 afterBuyUrl: '', //支付成功后地址跳转
} ifyukuaiCode: '' //是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
}, }
onLoad(option){ },
//#ifdef MP-WEIXIN onLoad(option) {
this.enterUrl=option.q //#ifdef MP-WEIXIN
//#endif this.enterUrl = option.q
this.payType = 42
//#ifdef MP-ALIPAY //#endif
this.enterUrl=uni.getStorageSync('alipayQrCode')
//#endif //#ifdef MP-ALIPAY
if(this.enterUrl){ this.enterUrl = uni.getStorageSync('alipayQrCode')
this.orderId=this.getUrlKey('orderId') this.payType = 33
}else{ //#endif
this.orderId=option.orderId if (this.enterUrl) {
} this.orderId = this.getUrlKey('orderId')
this.ifyukuaiCode=option.ifyukuaiCode } else {
this.afterBuyUrl=option.afterBuyUrl||'/pages/my/order/orderList/orderList' this.orderId = option.orderId
this.openid=uni.getStorageSync('openid')||'' }
if(this.openid){ this.ifyukuaiCode = option.ifyukuaiCode||''
this.initDetail() this.afterBuyUrl = option.afterBuyUrl || '/pages/my/order/orderList/orderList'
}else{ this.openid = uni.getStorageSync('openid') || ''
this.login()//极个别手机从公众号跳转回来没有openid,再次获取openid if (this.openid) {
} this.initDetail()
} else {
}, this.login() //极个别手机从公众号跳转回来没有openid,再次获取openid
methods:{ }
login(){//---登录 },
let _this=this methods: {
uni.getProvider({ login() {
service: 'oauth', //---登录
success(proRes){ let _this = this
uni.login({ uni.getProvider({
provider:proRes.provider[0], service: 'oauth',
success: function (res) { success(proRes) {
if(res.code){ uni.login({
let source='' provider: proRes.provider[0],
if(proRes.provider[0]=='weixin'){ success: function(res) {
source=3 if (res.code) {
}else if(proRes.provider[0]=='alipay'){ let source = ''
source=4 if (proRes.provider[0] == 'weixin') {
} source = 3
let data={ } else if (proRes.provider[0] == 'alipay') {
code:res.code, source = 4
source,//微信小程序3,支付宝小程序4 }
} let data = {
_this.$request('wechat/wx/getUserInfoByCode',data).then(res => { code: res.code,
if(res.code=='00'){ source //微信小程序3,支付宝小程序4
_this.openid=res.data.openid }
uni.setStorageSync('openid',_this.openid) _this.$request('wechat/wx/getUserInfoByCode', data)
_this.initDetail() .then(res => {
}else{ if (res.code == '00') {
uni.showToast({ _this.openid = res.data.openid
title:res.message, uni.setStorageSync('openid', _this.openid)
icon:'none' _this.initDetail()
}) } else {
} uni.showToast({
}).catch((err)=>{ title: res.message,
uni.showToast({ icon: 'none'
title:'登录失败', })
icon:'none' }
}) })
setTimeout(()=>{ .catch(err => {
_this.login() uni.showToast({
},2000) title: '登录失败',
}) icon: 'none'
} })
} setTimeout(() => {
}) _this.login()
} }, 2000)
}) })
}, }
initDetail(){//---初始化产品信息,以及获取支付需要的参数 }
let data = { })
orderId:this.orderId, //订单Id }
userId:this.openid, //用户Id })
payType:42, //支付类型 },
} initDetail() {
this.$request('orderc/order/findOrderInfo', data).then((res) => { //---初始化产品信息,以及获取支付需要的参数
if (res.code == '00') { let data = {
this.bodyShow = true orderId: this.orderId, //订单Id
//支付参数开始 userId: this.openid, //用户Id
this.timeStamp=res.data.timestamp payType: this.payType //支付类型
this.nonceStr=res.data.noncestr }
this.package=res.data.package this.$request('orderc/order/findOrderInfo', data).then(res => {
this.signType=res.data.signType if (res.code == '00') {
this.paySign=res.data.sign this.bodyShow = true
//支付宝入参 //支付参数开始
this.orderInfo = res.data.payInfo || '' this.timeStamp = res.data.timestamp
//支付参数结束 this.nonceStr = res.data.noncestr
this.pdOrderMoney = res.data.pdOrderMoney this.package = res.data.package
if(this.pdOrderMoney==0&&res.data.subOrderType == -1){//0元购直接跳电子门票页面 this.signType = res.data.signType
uni.navigateTo({ this.paySign = res.data.sign
url:'/pages/my/order/electronicTicket/electronicTicket?orderId='+this.orderId+'&ifyukuaiCode='+this.ifyukuaiCode //支付宝入参
}) this.orderInfo = res.data.payInfo || ''
} //支付参数结束
this.errorMessage = res.data.errorMessage this.pdOrderMoney = res.data.pdOrderMoney
this.totalMoney = res.data.totalMoney if (this.pdOrderMoney == 0 && res.data.subOrderType == -1) {
this.orderList = res.data.orderList //0元购直接跳电子门票页面
if (typeof(this.orderList) == 'undefined') { //单票 uni.navigateTo({
this.orderList = '' url: '/pages/my/order/electronicTicket/electronicTicket?orderId=' + this.orderId + '&ifyukuaiCode=' + this.ifyukuaiCode
this.merchantName = res.data.merchantName })
this.productName = res.data.productName }
this.unitPrice = res.data.unitPrice this.errorMessage = res.data.errorMessage
this.orderNum = res.data.orderNum this.totalMoney = res.data.totalMoney
this.depositReceived = res.data.depositReceived this.orderList = res.data.orderList
this.pdDiscountMoney = res.data.pdDiscountMoney if (typeof this.orderList == 'undefined') {
} //单票
this.orderList = ''
}else{ this.merchantName = res.data.merchantName
uni.showToast({ this.productName = res.data.productName
title:res.message, this.unitPrice = res.data.unitPrice
icon:'none' this.orderNum = res.data.orderNum
}) this.depositReceived = res.data.depositReceived
} this.pdDiscountMoney = res.data.pdDiscountMoney
}) }
}, } else {
goPay(){//-------------------------------------------------------去支付 uni.showToast({
let _this=this title: res.message,
if (this.errorMessage) { icon: 'none'
uni.showToast({ })
title:this.errorMessage, }
icon:'none' })
}) },
return goPay() {
} //-------------------------------------------------------去支付
this.background='#E6E6E6' let _this = this
setTimeout(() => { if (this.errorMessage) {
this.background='f9690e' uni.showToast({
}, 1000) title: this.errorMessage,
icon: 'none'
// #ifdef MP-WEIXIN })
uni.requestPayment({ return
provider: 'wxpay', }
timeStamp:this.timeStamp, this.background = '#E6E6E6'
nonceStr:this.nonceStr, setTimeout(() => {
package:this.package, this.background = 'f9690e'
signType:this.signType, }, 1000)
paySign:this.paySign,
success: function (res) { // #ifdef MP-WEIXIN
uni.navigateTo({ uni.requestPayment({
url:_this.afterBuyUrl+'?orderId='+_this.orderId+'&ifyukuaiCode='+_this.ifyukuaiCode provider: 'wxpay',
}) timeStamp: this.timeStamp,
}, nonceStr: this.nonceStr,
fail: function (err) { package: this.package,
uni.showToast({ signType: this.signType,
title:err.errMsg, paySign: this.paySign,
icon:'none' success: function(res) {
}) uni.navigateTo({
} url: _this.afterBuyUrl + '?orderId=' + _this.orderId + '&ifyukuaiCode=' + _this.ifyukuaiCode
}) })
//#endif },
fail: function(err) {
// #ifdef MP-ALIPAY uni.showToast({
uni.requestPayment({ title: err.errMsg,
provider: 'alipay', // 服务提供商 支付宝支付: alipay 微信支付: wxpay icon: 'none'
orderInfo: this.orderInfo, // 支付宝订单号 })
success: function (res) { }
uni.navigateTo({ })
url:_this.afterBuyUrl+'?orderId='+_this.orderId+'&ifyukuaiCode='+_this.ifyukuaiCode //#endif
})
}, // #ifdef MP-ALIPAY
fail: function (err) { uni.requestPayment({
uni.showToast({ provider: 'alipay', // 服务提供商 支付宝支付: alipay 微信支付: wxpay
title:err.errMsg, orderInfo: this.orderInfo, // 支付宝订单号
icon:'none' success: function(res) {
}) uni.navigateTo({
} url: _this.afterBuyUrl + '?orderId=' + _this.orderId + '&ifyukuaiCode=' + _this.ifyukuaiCode
}) })
// #endif },
}, fail: function(err) {
getUrlKey(name){//---------------------------------------------------------------获取url uni.showToast({
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || '' title: err.errMsg,
}, icon: 'none'
} })
} }
})
// #endif
},
getUrlKey(name) {
//---------------------------------------------------------------获取url
return (new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || ''
}
}
}
</script> </script>
<style> <style>
.bigBox{height: 100%;background: #fafafc;} .bigBox {
.middle{padding: 30rpx 24rpx 0 24rpx;} height: 100%;
.main{padding: 10rpx 24rpx 20rpx 24rpx;background: #FFFFFF;border-radius: 20rpx;box-shadow: 0 0 15rpx #e6e6e8;} background: #fafafc;
.product{border-bottom: 1px solid #e5e5e5;padding: 25rpx 0;} }
.product view{color: #000000;padding-left:10rpx;display: flex;align-items: center;box-sizing: border-box;} .middle {
.product view text:first-child{flex: 1;} padding: 30rpx 24rpx 0 24rpx;
.product view text:nth-child(2){color:#666666;font-size:28rpx;text-align: right;} }
.product view.coupon{color: #F9690E;margin-top:10rpx;} .main {
.product view.coupon text{font-size:30rpx;} padding: 10rpx 24rpx 20rpx 24rpx;
.mainP3{height:120rpx;color: #000000;border-bottom: 1px solid #e5e5e5;padding:25rpx 0 25rpx 10rpx;display: flex;align-items: center;box-sizing: border-box;justify-content: space-between;} background: #ffffff;
.mainP3 text:nth-child(2){font-size: 24rpx;color: #666666;} border-radius: 20rpx;
.mainP3 text:nth-child(2) text:nth-child(1){font-size:36rpx;color:#F9690E;margin-left: 20rpx;font-weight: bold;} box-shadow: 0 0 15rpx #e6e6e8;
.mainview{margin-top:50rpx;display: flex;align-items: center;} }
.mainview>image:first-child{margin:0 20rpx 0 10rpx;} .product {
.mainview>view{flex: 1;} border-bottom: 1px solid #e5e5e5;
.bottom{position: fixed;bottom: 0;height: 100rpx;background: #FFFFFF;border-top:1px solid #e5e5e5;width: 100%;display: flex;align-items: center;} padding: 25rpx 0;
.bottomFirst{border-right: 1px solid #cccccc;padding-left:40rpx;width: 40%;box-sizing: border-box;} }
.bottomFirst text:nth-child(2){font-size:40rpx;color: #f9690e;margin-left:10rpx;font-weight: bold;} .product view {
.bottomFirst text:nth-child(2) text{font-size:28rpx;} color: #000000;
.bottomLast{padding-left:20rpx;display: flex;width: 60%;padding-right:20rpx;box-sizing: border-box;align-items: center;} padding-left: 10rpx;
.bottomLast text:first-child{display: block;text-align: center;width:60rpx;} display: flex;
.bottomLast text:first-child text{margin-top:10rpx;display: inline-block;font-size:24rpx;color: #666666;} align-items: center;
.bottomLast text:nth-child(2){flex: 1;height:70rpx;display: inline-block;text-align: center;line-height:70rpx;background: #f9690e;color: #FFFFFF;margin-left:30rpx;border-radius: 20rpx;font-size:32rpx;} box-sizing: border-box;
}
.product view text:first-child {
flex: 1;
}
.product view text:nth-child(2) {
color: #666666;
font-size: 28rpx;
text-align: right;
}
.product view.coupon {
color: #f9690e;
margin-top: 10rpx;
}
.product view.coupon text {
font-size: 30rpx;
}
.mainP3 {
height: 120rpx;
color: #000000;
border-bottom: 1px solid #e5e5e5;
padding: 25rpx 0 25rpx 10rpx;
display: flex;
align-items: center;
box-sizing: border-box;
justify-content: space-between;
}
.mainP3 text:nth-child(2) {
font-size: 24rpx;
color: #666666;
}
.mainP3 text:nth-child(2) text:nth-child(1) {
font-size: 36rpx;
color: #f9690e;
margin-left: 20rpx;
font-weight: bold;
}
.mainview {
margin-top: 50rpx;
display: flex;
align-items: center;
}
.mainview > image:first-child {
margin: 0 20rpx 0 10rpx;
}
.mainview > view {
flex: 1;
}
.bottom {
position: fixed;
bottom: 0;
height: 100rpx;
background: #ffffff;
border-top: 1px solid #e5e5e5;
width: 100%;
display: flex;
align-items: center;
}
.bottomFirst {
border-right: 1px solid #cccccc;
padding-left: 40rpx;
width: 40%;
box-sizing: border-box;
}
.bottomFirst text:nth-child(2) {
font-size: 40rpx;
color: #f9690e;
margin-left: 10rpx;
font-weight: bold;
}
.bottomFirst text:nth-child(2) text {
font-size: 28rpx;
}
.bottomLast {
padding-left: 20rpx;
display: flex;
width: 60%;
padding-right: 20rpx;
box-sizing: border-box;
align-items: center;
}
.bottomLast text:first-child {
display: block;
text-align: center;
width: 60rpx;
}
.bottomLast text:first-child text {
margin-top: 10rpx;
display: inline-block;
font-size: 24rpx;
color: #666666;
}
.bottomLast text:nth-child(2) {
flex: 1;
height: 70rpx;
display: inline-block;
text-align: center;
line-height: 70rpx;
background: #f9690e;
color: #ffffff;
margin-left: 30rpx;
border-radius: 20rpx;
font-size: 32rpx;
}
</style> </style>
...@@ -5,31 +5,31 @@ ...@@ -5,31 +5,31 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
enterUrl:"",//进入页面路由 enterUrl:'',//进入页面路由
outUrl:"",//跳出页面路由 outUrl:'',//跳出页面路由
} }
}, },
onLoad(option){ onLoad(option){
let merchantId=option.merchantId let merchantId=option.merchantId||''
let productId=option.productId let productId=option.productId||''
let companyId=option.companyId let companyId=option.companyId||''
let orderSource=option.orderSource let orderSource=option.orderSource||''
let ifyukuaiCode=option.ifyukuaiCode//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程 let ifyukuaiCode=option.ifyukuaiCode||''//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
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')
let pdUserId=uni.getStorageSync("userId") let pdUserId=uni.getStorageSync('userId')
let baseUrl="https://wx.pangdly.com/#/scenicJointOrder?pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId 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 url='&merchantId='+merchantId+'&productId='+productId+'&orderSource='+orderSource+'&companyId='+companyId+'&ifyukuaiCode='+ifyukuaiCode
this.outUrl=baseUrl+url this.outUrl=baseUrl+url
}, },
methods: { methods: {
} }
} }
</script> </script>
<style> <style>
......
...@@ -5,56 +5,56 @@ ...@@ -5,56 +5,56 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
enterUrl:"",//进入页面路由 enterUrl:'',//进入页面路由
outUrl:"",//跳出页面路由 outUrl:'',//跳出页面路由
} }
}, },
onLoad(option) { onLoad(option) {
//#ifdef MP-WEIXIN //#ifdef MP-WEIXIN
this.enterUrl=option.q this.enterUrl=option.q
//#endif //#endif
//#ifdef MP-ALIPAY //#ifdef MP-ALIPAY
this.enterUrl=uni.getStorageSync("alipayQrCode") this.enterUrl=uni.getStorageSync('alipayQrCode')
//#endif //#endif
if(this.enterUrl){//普通二维码扫码进入 if(this.enterUrl){//普通二维码扫码进入
let merchantId=this.getUrlKey("merchantId") let merchantId=this.getUrlKey('merchantId')
let productId=this.getUrlKey("productId") let productId=this.getUrlKey('productId')
let orderSource=this.getUrlKey("orderSource") let orderSource=this.getUrlKey('orderSource')
let companyId=this.getUrlKey("companyId") let companyId=this.getUrlKey('companyId')
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')
let pdUserId=uni.getStorageSync("userId") let pdUserId=uni.getStorageSync('userId')
let baseUrl="https://wx.pangdly.com/#/scenicSingleOrder?pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId 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 url='&merchantId='+merchantId+'&productId='+productId+'&orderSource='+orderSource+'&companyId='+companyId
this.outUrl=baseUrl+url this.outUrl=baseUrl+url
}else{//小程序页面跳转进入 }else{//小程序页面跳转进入
let merchantId=option.merchantId let merchantId=option.merchantId||''
let productId=option.productId let productId=option.productId||''
let orderSource=option.orderSource let orderSource=option.orderSource||''
let companyId=option.companyId let companyId=option.companyId||''
let ifyukuaiCode=option.ifyukuaiCode//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程 let ifyukuaiCode=option.ifyukuaiCode||''//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
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')
let pdUserId=uni.getStorageSync("userId") let pdUserId=uni.getStorageSync('userId')
let baseUrl="https://wx.pangdly.com/#/scenicSingleOrder?pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId 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 url='&merchantId='+merchantId+'&productId='+productId+'&orderSource='+orderSource+'&companyId='+companyId+'&ifyukuaiCode='+ifyukuaiCode
this.outUrl=baseUrl+url this.outUrl=baseUrl+url
} }
}, },
methods: { methods: {
getUrlKey(name){//---------------------------------------------------------------获取url 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> </script>
<style> <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