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>
......@@ -3,70 +3,50 @@
<view class="middle" v-show="bodyShow">
<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>
<text>
{{item.merchantName}}{{item.productName}}
</text>
<text> {{ item.merchantName }}{{ item.productName }}</text>
<text>
<text style="font-size:24rpx;">¥</text>{{item.unitPrice}}
<text>x</text>
{{item.orderNum}}
<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>x</text> {{ item.orderNum }}
<text style="margin-top:10rpx;font-size:22rpx;display:block;color:#f45803;" v-if="item.depositReceived"> 押金:{{ item.depositReceived }} </text>
</text>
</view>
<view class="coupon" v-if="item.pdDiscountMoney">
<text>
</text>
<text>
<text style="font-size:24rpx;"></text>{{item.pdDiscountMoney}}
</text>
<text></text> <text> <text style="font-size:24rpx;"></text>{{ item.pdDiscountMoney }} </text>
</view>
</view>
<!-- --------------------------------------单票----------------------------------------------- -->
<view v-if="orderList==''" class="product">
<view v-if="orderList == ''" class="product">
<view>
<text>
{{merchantName}}{{productName}}
</text>
<text> {{ merchantName }}{{ productName }}</text>
<text style="text-align: right;">
<small style="font-size:24rpx;">¥</small>{{unitPrice}}
<text>x</text>
{{orderNum}}
<text style="margin-top:10rpx;font-size:22rpx;display:block;color:#f45803;" v-if="depositReceived">押金:{{depositReceived}}</text>
<text style="font-size:24rpx;">¥</text>{{ unitPrice }} <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>
<text></text> <text> <text style="font-size:24rpx;"></text>{{ pdDiscountMoney }} </text>
</view>
</view>
<view class="mainP3">
<text>
实际支付
</text>
<text> 实际支付 </text>
<text>
<!--<i>
¥{{totalMoney}}
</i>-->
<text>
<text style="font-size:28rpx;">¥</text>{{pdOrderMoney}}
</text>
<text> <text style="font-size:28rpx;">¥</text>{{ pdOrderMoney }} </text>
</text>
</view>
<view class="mainview">
<image src="@/static/img/orderPayment/weixin.png" style="width:70rpx;height:62rpx;" />
<view>
微信支付
</view>
<!-- #ifdef MP-WEIXIN -->
<image src="@/static/img/orderPayment/weixin.png" style="width:70rpx;height:62rpx;" /> <view> 微信支付 </view>
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<image src="@/static/img/orderPayment/alipayLogo.png" style="width:70rpx;height:62rpx;" /> <view> 支付宝支付 </view>
<!-- #endif -->
<image src="@/static/img/orderPayment/input.png" style="width:32rpx;height: 32rpx;" />
</view>
</view>
......@@ -74,30 +54,24 @@
<view class="bottom" v-show="bodyShow">
<view class="bottomFirst">
<text>
实付款
</text>
<text> 实付款 </text>
<text>
<text>¥</text>{{pdOrderMoney}}
</text>
<text> <text>¥</text>{{ pdOrderMoney }} </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>
<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>
</template>
<script>
export default {
export default {
data() {
return {
enterUrl:'',//进入页面路由
enterUrl: '', //进入页面路由
merchantName: '', //商户名称
productName: '', //产品名称
orderList: '', //订单列表
......@@ -109,81 +83,86 @@
totalMoney: '', //原价总价
errorMessage: '', //错误信息
bodyShow: false, //控制初始化数据成功显示
timeStamp:'',//支付参数
nonceStr:'',
package:'',
signType:'',
paySign:'',
orderInfo:'',//支付宝订单号
background:'',//去支付的背景颜色
orderId:'',//订单Id
openid:'',//用户Id
afterBuyUrl:'',//支付成功后地址跳转
ifyukuaiCode:'',//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
payType: '', //支付类型
timeStamp: '', //支付参数
nonceStr: '',
package: '',
signType: '',
paySign: '',
orderInfo: '', //支付宝订单号
background: '', //去支付的背景颜色
orderId: '', //订单Id
openid: '', //用户Id
afterBuyUrl: '', //支付成功后地址跳转
ifyukuaiCode: '' //是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
}
},
onLoad(option){
onLoad(option) {
//#ifdef MP-WEIXIN
this.enterUrl=option.q
this.enterUrl = option.q
this.payType = 42
//#endif
//#ifdef MP-ALIPAY
this.enterUrl=uni.getStorageSync('alipayQrCode')
this.enterUrl = uni.getStorageSync('alipayQrCode')
this.payType = 33
//#endif
if(this.enterUrl){
this.orderId=this.getUrlKey('orderId')
}else{
this.orderId=option.orderId
if (this.enterUrl) {
this.orderId = this.getUrlKey('orderId')
} else {
this.orderId = option.orderId
}
this.ifyukuaiCode=option.ifyukuaiCode
this.afterBuyUrl=option.afterBuyUrl||'/pages/my/order/orderList/orderList'
this.openid=uni.getStorageSync('openid')||''
if(this.openid){
this.ifyukuaiCode = option.ifyukuaiCode||''
this.afterBuyUrl = option.afterBuyUrl || '/pages/my/order/orderList/orderList'
this.openid = uni.getStorageSync('openid') || ''
if (this.openid) {
this.initDetail()
}else{
this.login()//极个别手机从公众号跳转回来没有openid,再次获取openid
} else {
this.login() //极个别手机从公众号跳转回来没有openid,再次获取openid
}
},
methods:{
login(){//---登录
let _this=this
methods: {
login() {
//---登录
let _this = this
uni.getProvider({
service: 'oauth',
success(proRes){
success(proRes) {
uni.login({
provider:proRes.provider[0],
success: function (res) {
if(res.code){
let source=''
if(proRes.provider[0]=='weixin'){
source=3
}else if(proRes.provider[0]=='alipay'){
source=4
provider: proRes.provider[0],
success: function(res) {
if (res.code) {
let source = ''
if (proRes.provider[0] == 'weixin') {
source = 3
} else if (proRes.provider[0] == 'alipay') {
source = 4
}
let data={
code:res.code,
source,//微信小程序3,支付宝小程序4
let data = {
code: res.code,
source //微信小程序3,支付宝小程序4
}
_this.$request('wechat/wx/getUserInfoByCode',data).then(res => {
if(res.code=='00'){
_this.openid=res.data.openid
uni.setStorageSync('openid',_this.openid)
_this.$request('wechat/wx/getUserInfoByCode', data)
.then(res => {
if (res.code == '00') {
_this.openid = res.data.openid
uni.setStorageSync('openid', _this.openid)
_this.initDetail()
}else{
} else {
uni.showToast({
title:res.message,
icon:'none'
title: res.message,
icon: 'none'
})
}
}).catch((err)=>{
})
.catch(err => {
uni.showToast({
title:'登录失败',
icon:'none'
title: '登录失败',
icon: 'none'
})
setTimeout(()=>{
setTimeout(() => {
_this.login()
},2000)
}, 2000)
})
}
}
......@@ -191,34 +170,37 @@
}
})
},
initDetail(){//---初始化产品信息,以及获取支付需要的参数
initDetail() {
//---初始化产品信息,以及获取支付需要的参数
let data = {
orderId:this.orderId, //订单Id
userId:this.openid, //用户Id
payType:42, //支付类型
orderId: this.orderId, //订单Id
userId: this.openid, //用户Id
payType: this.payType //支付类型
}
this.$request('orderc/order/findOrderInfo', data).then((res) => {
this.$request('orderc/order/findOrderInfo', data).then(res => {
if (res.code == '00') {
this.bodyShow = true
//支付参数开始
this.timeStamp=res.data.timestamp
this.nonceStr=res.data.noncestr
this.package=res.data.package
this.signType=res.data.signType
this.paySign=res.data.sign
this.timeStamp = res.data.timestamp
this.nonceStr = res.data.noncestr
this.package = res.data.package
this.signType = res.data.signType
this.paySign = res.data.sign
//支付宝入参
this.orderInfo = res.data.payInfo || ''
//支付参数结束
this.pdOrderMoney = res.data.pdOrderMoney
if(this.pdOrderMoney==0&&res.data.subOrderType == -1){//0元购直接跳电子门票页面
if (this.pdOrderMoney == 0 && res.data.subOrderType == -1) {
//0元购直接跳电子门票页面
uni.navigateTo({
url:'/pages/my/order/electronicTicket/electronicTicket?orderId='+this.orderId+'&ifyukuaiCode='+this.ifyukuaiCode
url: '/pages/my/order/electronicTicket/electronicTicket?orderId=' + this.orderId + '&ifyukuaiCode=' + this.ifyukuaiCode
})
}
this.errorMessage = res.data.errorMessage
this.totalMoney = res.data.totalMoney
this.orderList = res.data.orderList
if (typeof(this.orderList) == 'undefined') { //单票
if (typeof this.orderList == 'undefined') {
//单票
this.orderList = ''
this.merchantName = res.data.merchantName
this.productName = res.data.productName
......@@ -227,46 +209,46 @@
this.depositReceived = res.data.depositReceived
this.pdDiscountMoney = res.data.pdDiscountMoney
}
}else{
} else {
uni.showToast({
title:res.message,
icon:'none'
title: res.message,
icon: 'none'
})
}
})
},
goPay(){//-------------------------------------------------------去支付
let _this=this
goPay() {
//-------------------------------------------------------去支付
let _this = this
if (this.errorMessage) {
uni.showToast({
title:this.errorMessage,
icon:'none'
title: this.errorMessage,
icon: 'none'
})
return
}
this.background='#E6E6E6'
this.background = '#E6E6E6'
setTimeout(() => {
this.background='f9690e'
this.background = 'f9690e'
}, 1000)
// #ifdef MP-WEIXIN
uni.requestPayment({
provider: 'wxpay',
timeStamp:this.timeStamp,
nonceStr:this.nonceStr,
package:this.package,
signType:this.signType,
paySign:this.paySign,
success: function (res) {
timeStamp: this.timeStamp,
nonceStr: this.nonceStr,
package: this.package,
signType: this.signType,
paySign: this.paySign,
success: function(res) {
uni.navigateTo({
url:_this.afterBuyUrl+'?orderId='+_this.orderId+'&ifyukuaiCode='+_this.ifyukuaiCode
url: _this.afterBuyUrl + '?orderId=' + _this.orderId + '&ifyukuaiCode=' + _this.ifyukuaiCode
})
},
fail: function (err) {
fail: function(err) {
uni.showToast({
title:err.errMsg,
icon:'none'
title: err.errMsg,
icon: 'none'
})
}
})
......@@ -276,49 +258,153 @@
uni.requestPayment({
provider: 'alipay', // 服务提供商 支付宝支付: alipay 微信支付: wxpay
orderInfo: this.orderInfo, // 支付宝订单号
success: function (res) {
success: function(res) {
uni.navigateTo({
url:_this.afterBuyUrl+'?orderId='+_this.orderId+'&ifyukuaiCode='+_this.ifyukuaiCode
url: _this.afterBuyUrl + '?orderId=' + _this.orderId + '&ifyukuaiCode=' + _this.ifyukuaiCode
})
},
fail: function (err) {
fail: function(err) {
uni.showToast({
title:err.errMsg,
icon:'none'
title: err.errMsg,
icon: 'none'
})
}
})
// #endif
},
getUrlKey(name){//---------------------------------------------------------------获取url
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || ''
},
getUrlKey(name) {
//---------------------------------------------------------------获取url
return (new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || ''
}
}
}
</script>
<style>
.bigBox{height: 100%;background: #fafafc;}
.middle{padding: 30rpx 24rpx 0 24rpx;}
.main{padding: 10rpx 24rpx 20rpx 24rpx;background: #FFFFFF;border-radius: 20rpx;box-shadow: 0 0 15rpx #e6e6e8;}
.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;}
.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;}
.bigBox {
height: 100%;
background: #fafafc;
}
.middle {
padding: 30rpx 24rpx 0 24rpx;
}
.main {
padding: 10rpx 24rpx 20rpx 24rpx;
background: #ffffff;
border-radius: 20rpx;
box-shadow: 0 0 15rpx #e6e6e8;
}
.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;
}
.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>
......@@ -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