Commit c687c692 authored by zhoucong's avatar zhoucong

Merge branch 'develop' of http://git.tbd.yanzuoguang.com/panyongping/uni-pdtravel into zhoucong

# Conflicts:
#	unpackage/dist/dev/.sourcemap/mp-weixin/pages/vlog/myVlog/myVlog.js.map
#	unpackage/dist/dev/.sourcemap/mp-weixin/pages/vlog/photoAlbum/photoAlbum.js.map
#	unpackage/dist/dev/.sourcemap/mp-weixin/pages/vlog/scenicList/scenicList.js.map
#	unpackage/dist/dev/.sourcemap/mp-weixin/pages/vlog/share/share.js.map
#	unpackage/dist/dev/.sourcemap/mp-weixin/pages/vlog/vlogIndex/vlogIndex.js.map
#	unpackage/dist/dev/.sourcemap/mp-weixin/pages/vlog/vlogList/vlogList.js.map
#	unpackage/dist/dev/.sourcemap/mp-weixin/pages/vlog/vlogface/vlogface.js.map
parents 30cfdad1 c54574d0
...@@ -2,10 +2,15 @@ ...@@ -2,10 +2,15 @@
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0", "version": "0.0",
"configurations": [{ "configurations": [{
"type": "uniCloud", "default" :
"default": { {
"launchtype": "local" "launchtype" : "local"
} },
} "mp-weixin" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
] ]
} }
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
export default { export default {
onLaunch: function(options) {//初始化完成时触发(全局只触发一次 onLaunch: function(options) {//初始化完成时触发(全局只触发一次
let path=options.path let path=options.path
let openid=uni.getStorageSync("openid") uni.setStorageSync("enterOptions",options)
if(!openid&&path.indexOf("pages/ourPayment/ourPayment")==-1){//扫码支付页面不需要在此登录 let token=uni.getStorageSync("token")
if(!token&&path.indexOf("pages/ourPayment/ourPayment")==-1){//扫码支付页面不需要在此登录
setTimeout(()=>{//解决关联普通二维码扫码首次进入时一直显示登录中 setTimeout(()=>{//解决关联普通二维码扫码首次进入时一直显示登录中
uni.navigateTo({ uni.navigateTo({
url: "/pages/login/login" url: "/pages/login/login"
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<view> <view>
{{item.useStartDate}}-{{item.useEndDate}} {{item.useStartDate}}-{{item.useEndDate}}
<text> <text>
<text>¥</text>{{item.savedMoney.toFixed(2)}} <text>¥</text>{{parseFloat(item.savedMoney.toFixed(2))}}
</text> </text>
</view> </view>
</label> </label>
...@@ -50,8 +50,8 @@ ...@@ -50,8 +50,8 @@
</view> </view>
<view> <view>
{{item.couponRule}} {{item.couponRule}}
<text> <text v-if="item.savedMoney">
<text>¥</text>{{item.savedMoney.toFixed(2)}} <text>¥</text>{{parseFloat(item.savedMoney.toFixed(2))}}
</text> </text>
</view> </view>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
"path" : "pages/login/login", "path" : "pages/login/login",
"style" : "style" :
{ {
"navigationBarTitleText": "登录中", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
...@@ -126,6 +126,33 @@ ...@@ -126,6 +126,33 @@
} }
} }
,{
"path" : "pages/combination/combiChoose/combiChoose",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/my/order/electronicTicket/electronicTicket",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/combination/distributionCombiChoose/distributionCombiChoose",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{ ,{
"path" : "pages/vlog/vlogIndex/vlogIndex", "path" : "pages/vlog/vlogIndex/vlogIndex",
"style" : { "style" : {
......
<template> <template>
<view> <view>
<!--#ifdef MP-WEIXIN -->
<web-view :src="outUrl"></web-view> <web-view :src="outUrl"></web-view>
<!--#endif-->
</view> </view>
</template> </template>
...@@ -31,12 +28,16 @@ ...@@ -31,12 +28,16 @@
let groupId=this.getUrlKey("groupId") let groupId=this.getUrlKey("groupId")
let groupChannelId=this.getUrlKey("groupChannelId") let groupChannelId=this.getUrlKey("groupChannelId")
let pageType=this.getUrlKey("pageType") let pageType=this.getUrlKey("pageType")
let pdOpenid=uni.getStorageSync("openid")//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync("token")
let pdCreateUserId=uni.getStorageSync("createUserId")
let pdUserId=uni.getStorageSync("userId")
if(pageType==1){//组合 if(pageType==1){//组合
this.outUrl="https://wx.pangdly.com/#/combiChoose?channelId="+channelId+"&merchantId="+merchantId+"&groupId="+groupId+"&groupChannelId="+groupChannelId+"&companyId="+companyId this.outUrl="https://wx.pangdly.com/#/combiChoose?channelId="+channelId+"&merchantId="+merchantId+"&groupId="+groupId+"&groupChannelId="+groupChannelId+"&companyId="+companyId+"&pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId
}else{//分销 }else{//分销
uni.navigateTo({ uni.navigateTo({
url:"../distributionCombiChoose/distributionCombiChoose?channelId="+channelId+"&merchantId="+merchantId+"&groupId="+groupId+"&groupChannelId="+groupChannelId+"&companyId="+companyId url:"../distributionCombiChoose/distributionCombiChoose?channelId="+channelId+"&merchantId="+merchantId+"&groupId="+groupId+"&groupChannelId="+groupChannelId+"&companyId="+companyId+"&pdOpenid="+pdOpenid
}) })
} }
}else{//小程序页面跳转进入 }else{//小程序页面跳转进入
...@@ -47,12 +48,14 @@ ...@@ -47,12 +48,14 @@
let groupChannelId=option.groupChannelId let groupChannelId=option.groupChannelId
let thirdOpenid=option.thirdOpenid//第三方openid let thirdOpenid=option.thirdOpenid//第三方openid
let touristType=option.touristType//游客类型 let touristType=option.touristType//游客类型
let pdOpenid=uni.getStorageSync("openid")//胖丁小程序openid let pdOpenid=uni.getStorageSync("openid")//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let baseUrl="https://wx.pangdly.com/#/combiChoose?pdOpenid="+pdOpenid let pdToken=uni.getStorageSync("token")
this.outUrl=baseUrl+"&thirdOpenid="+thirdOpenid+"&touristType="+touristType+"&channelId="+channelId+"&merchantId="+merchantId+"&groupId="+groupId+"&groupChannelId="+groupChannelId+"&companyId="+companyId let pdCreateUserId=uni.getStorageSync("createUserId")
let pdUserId=uni.getStorageSync("userId")
let baseUrl="https://wx.pangdly.com/#/combiChoose?thirdOpenid="+thirdOpenid+"&touristType="+touristType
this.outUrl=baseUrl+"&channelId="+channelId+"&merchantId="+merchantId+"&groupId="+groupId+"&groupChannelId="+groupChannelId+"&companyId="+companyId+"&pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId
} }
}, },
methods: { methods: {
getUrlKey(name){//---------------------------------------------------------------获取url getUrlKey(name){//---------------------------------------------------------------获取url
......
<template> <template>
<view> <view>
<!--#ifdef MP-WEIXIN -->
<web-view :src="outUrl"></web-view> <web-view :src="outUrl"></web-view>
<!--#endif-->
</view> </view>
</template> </template>
...@@ -30,12 +28,16 @@ ...@@ -30,12 +28,16 @@
let groupId=this.getUrlKey("groupId") let groupId=this.getUrlKey("groupId")
let groupChannelId=this.getUrlKey("groupChannelId") let groupChannelId=this.getUrlKey("groupChannelId")
let pageType=this.getUrlKey("pageType") let pageType=this.getUrlKey("pageType")
let pdOpenid=uni.getStorageSync("openid")//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync("token")
let pdCreateUserId=uni.getStorageSync("createUserId")
let pdUserId=uni.getStorageSync("userId")
if(pageType==1){//组合 if(pageType==1){//组合
uni.navigateTo({ uni.navigateTo({
url:"../combiChoose/combiChoose?channelId="+channelId+"&merchantId="+merchantId+"&groupId="+groupId+"&groupChannelId="+groupChannelId+"&companyId="+companyId url:"../combiChoose/combiChoose?channelId="+channelId+"&merchantId="+merchantId+"&groupId="+groupId+"&groupChannelId="+groupChannelId+"&companyId="+companyId+"&pdOpenid="+pdOpenid
}) })
}else{//分销 }else{//分销
this.outUrl="https://wx.pangdly.com/#/distributionCombiChoose?channelId="+channelId+"&merchantId="+merchantId+"&groupId="+groupId+"&groupChannelId="+groupChannelId+"&companyId="+companyId this.outUrl="https://wx.pangdly.com/#/distributionCombiChoose?channelId="+channelId+"&merchantId="+merchantId+"&groupId="+groupId+"&groupChannelId="+groupChannelId+"&companyId="+companyId+"&pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId
} }
}else{//小程序页面跳转进入 }else{//小程序页面跳转进入
...@@ -44,7 +46,14 @@ ...@@ -44,7 +46,14 @@
let merchantId=option.merchantId let merchantId=option.merchantId
let groupId=option.groupId let groupId=option.groupId
let groupChannelId=option.groupChannelId let groupChannelId=option.groupChannelId
this.outUrl="https://wx.pangdly.com/#/distributionCombiChoose?channelId="+channelId+"&merchantId="+merchantId+"&groupId="+groupId+"&groupChannelId="+groupChannelId+"&companyId="+companyId let thirdOpenid=option.thirdOpenid//第三方openid
let touristType=option.touristType//游客类型
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/#/distributionCombiChoose?thirdOpenid="+thirdOpenid+"&touristType="+touristType
this.outUrl=baseUrl+"&channelId="+channelId+"&merchantId="+merchantId+"&groupId="+groupId+"&groupChannelId="+groupChannelId+"&companyId="+companyId+"&pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId
} }
}, },
......
...@@ -35,21 +35,57 @@ ...@@ -35,21 +35,57 @@
} }
_this.$request('wechat/wx/getUserInfoByCode',data).then(res => { _this.$request('wechat/wx/getUserInfoByCode',data).then(res => {
if(res.code=='00'){ if(res.code=='00'){
console.log(res);
let openid=res.data.openid let openid=res.data.openid
uni.setStorageSync('openid',openid) uni.setStorageSync('openid',openid)
uni.navigateBack({ let userId=res.data.userId||""
delta:1 let datas={openid,source,userId}
_this.$request("wechatUser/login/findWxUserAndLogin",datas).then((res)=>{//通过openid获取token
if(res.code=="00"){
let token=res.data.token||""
uni.setStorageSync('token',token)
let createUserId=res.data.personId||""
uni.setStorageSync('createUserId',createUserId)
let userId=res.data.userId||""
uni.setStorageSync('userId',userId)
let enterOptions=uni.getStorageSync("enterOptions")
let queryTotal=""
for(let key in enterOptions.query){
queryTotal+="&"+key+"="+enterOptions.query[key]
}
queryTotal=queryTotal.substr(1)
if(token){
uni.redirectTo({
url:"/"+enterOptions.path+"?"+queryTotal
})
// uni.navigateBack({
// delta:1
// })
}
}else{
uni.showToast({
title:res.message,
icon:"none"
})
}
}).catch((err)=>{
uni.showToast({
title:"登录失败",
icon:"none"
})
}) })
}else{ }else{
uni.removeStorageSync('openid') // uni.removeStorageSync('openid')
uni.showToast({ uni.showToast({
title:res.message, title:res.message,
icon:"none" icon:"none"
}) })
} }
}).catch((err)=>{ }).catch((err)=>{
uni.removeStorageSync('openid') // uni.removeStorageSync('openid')
uni.showToast({
title:"登录失败",
icon:"none"
})
}) })
} }
} }
......
<template> <template>
<view> <view>
<!--#ifdef MP-WEIXIN -->
<web-view :src="outUrl"></web-view> <web-view :src="outUrl"></web-view>
<!--#endif-->
</view> </view>
</template> </template>
...@@ -14,7 +12,11 @@ ...@@ -14,7 +12,11 @@
} }
}, },
onLoad(option) { onLoad(option) {
this.outUrl="https://wx.pangdly.com/#/unusedDetail?id="+option.orderId let pdOpenid=uni.getStorageSync("openid")//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync("token")
let pdCreateUserId=uni.getStorageSync("createUserId")
let pdUserId=uni.getStorageSync("userId")
this.outUrl="https://wx.pangdly.com/#/unusedDetail?id="+option.orderId+"&pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId
}, },
methods: { methods: {
......
...@@ -137,6 +137,11 @@ ...@@ -137,6 +137,11 @@
this.paySign=res.data.sign this.paySign=res.data.sign
//支付参数结束 //支付参数结束
this.pdOrderMoney = res.data.pdOrderMoney this.pdOrderMoney = res.data.pdOrderMoney
if(this.pdOrderMoney==0&&res.data.subOrderType == -1){//0元购直接跳电子门票页面
uni.navigateTo({
url:"../my/order/electronicTicket/electronicTicket?orderId="+this.orderId
})
}
this.errorMessage = res.data.errorMessage this.errorMessage = res.data.errorMessage
this.totalMoney = res.data.totalMoney this.totalMoney = res.data.totalMoney
this.orderList = res.data.orderList this.orderList = res.data.orderList
......
...@@ -16,19 +16,19 @@ ...@@ -16,19 +16,19 @@
</view> </view>
</view> </view>
<!-- -----------------------------有可用优惠券,并且未选中----------------------------------------------------- --> <!-- -----------------------------有可用优惠券,并且未选中----------------------------------------------------- -->
<!-- <view class="topCoupon" v-if="couponData.usableCouponList&&couponData.usableCouponList.length>0&&chooseCouponObj==''" @click="showCoupon()"> <view class="topCoupon" v-if="couponData.masterSlaveCouponList&&couponData.masterSlaveCouponList.length>0&&chooseCouponObj==''" @click="showCoupon()">
<view class="couponLeft"> <view class="couponLeft">
<text></text> <text></text>
<text>{{couponData.usableCouponList[0].couponName}}</text> <text>{{couponData.masterSlaveCouponList[0].couponName}}</text>
</view> </view>
<view class="couponRight"> <view class="couponRight">
<text>未选优惠券</text> <text>未选优惠券</text>
<text class="iconfont icon-you" style="font-size:32rpx;"></text> <text class="iconfont icon-you" style="font-size:32rpx;"></text>
</view> </view>
</view> --> </view>
<!-- -----------------------------有可用优惠券----------------------------------------------------- --> <!-- -----------------------------有可用优惠券----------------------------------------------------- -->
<!-- <view class="topCoupon" v-if="chooseCouponObj!=''" @click="showCoupon()"> <view class="topCoupon" v-if="chooseCouponObj!=''&&savedMoney>0" @click="showCoupon()">
<view class="couponLeft"> <view class="couponLeft">
<text></text> <text></text>
<text>{{chooseCouponObj.couponName}}</text> <text>{{chooseCouponObj.couponName}}</text>
...@@ -36,12 +36,12 @@ ...@@ -36,12 +36,12 @@
<view class="couponRight"> <view class="couponRight">
<text>-</text> <text>-</text>
<text>{{chooseCouponObj.savedMoney.toFixed(2)}}</text> <text>{{parseFloat(savedMoney.toFixed(2))}}</text>
<text class="iconfont icon-you" style="font-size:32rpx;"></text> <text class="iconfont icon-you" style="font-size:32rpx;"></text>
</view> </view>
</view> --> </view>
<!-- -----------------------------------------------可用优惠券条件--------------------------------------- --> <!-- -----------------------------------------------可用优惠券条件--------------------------------------- -->
<!-- <view class="topCoupon" v-if="ableConpon!=''" @click="showCoupon()"> <view class="topCoupon" v-if="ableConpon!=''" @click="showCoupon()">
<view class="couponLeft"> <view class="couponLeft">
<text></text> <text></text>
<text>{{ableConpon.couponName}}</text> <text>{{ableConpon.couponName}}</text>
...@@ -51,20 +51,6 @@ ...@@ -51,20 +51,6 @@
<text>{{ableConpon.couponRule}}</text> <text>{{ableConpon.couponRule}}</text>
<text class="iconfont icon-you" style="font-size:32rpx;"></text> <text class="iconfont icon-you" style="font-size:32rpx;"></text>
</view> </view>
</view> -->
<view class="topCoupon" v-if="chooseCouponObj">
<view class="couponLeft">
<text></text>
<text>{{chooseCouponObj.couponName}}</text>
</view>
<view class="couponRight">
<text style="font-weight: bold;">
<text style="font-size:26rpx;font-weight:400;"></text>
{{parseFloat(savedMoney.toFixed(2))}}
</text>
</view>
</view> </view>
</view> </view>
...@@ -90,7 +76,7 @@ ...@@ -90,7 +76,7 @@
</view> </view>
</view> </view>
<!-------------------------------------------券弹窗------------------------------> <!-------------------------------------------券弹窗------------------------------>
<!-- <orderCoupon :couponData="couponData" ref="orderCoupon" @couponChoose="couponChoose" :chooseCouponObj="chooseCouponObj"></orderCoupon> --> <orderCoupon :couponData="couponData" ref="orderCoupon" @couponChoose="couponChoose" :chooseCouponObj="chooseCouponObj"></orderCoupon>
</view> </view>
</template> </template>
...@@ -180,9 +166,7 @@ ...@@ -180,9 +166,7 @@
} else { //小商家没有merchantId } else { //小商家没有merchantId
this.initTwo() this.initTwo()
} }
//#ifdef MP-WEIXIN
this.initCoupon() this.initCoupon()
//#endif
}else{ }else{
this.login() this.login()
} }
...@@ -217,15 +201,42 @@ ...@@ -217,15 +201,42 @@
} else { //小商家没有merchantId } else { //小商家没有merchantId
_this.initTwo() _this.initTwo()
} }
//#ifdef MP-WEIXIN
_this.initCoupon() _this.initCoupon()
//#endif //用于获取token等信息
let userId=res.data.userId||""
let openid=res.data.openid||""
let datas={openid,source,userId}
_this.$request("wechatUser/login/findWxUserAndLogin",datas).then((res)=>{
if(res.code=="00"){
let token=res.data.token||""
uni.setStorageSync('token',token)
let createUserId=res.data.personId||""
uni.setStorageSync('createUserId',createUserId)
let userId=res.data.userId||""
uni.setStorageSync('userId',userId)
}else{
uni.showToast({
title:res.message,
icon:"none"
})
}
}).catch((err)=>{
uni.showToast({
title:"登录失败",
icon:"none"
})
})
}else{ }else{
uni.removeStorageSync('openid') uni.showToast({
title:res.message,
icon:"none"
})
} }
}).catch((err)=>{ }).catch((err)=>{
uni.removeStorageSync('openid') uni.showToast({
title:"登录失败",
icon:"none"
})
}) })
} }
} }
...@@ -244,9 +255,7 @@ ...@@ -244,9 +255,7 @@
},200) },200)
clearTimeout(this.flag) clearTimeout(this.flag)
this.flag = setTimeout(()=>{ this.flag = setTimeout(()=>{
//#ifdef MP-WEIXIN
this.initCoupon() this.initCoupon()
//#endif
}, 1500) }, 1500)
}, },
clickEnter(){//---------------------------------------------------------------------退格 clickEnter(){//---------------------------------------------------------------------退格
...@@ -257,13 +266,13 @@ ...@@ -257,13 +266,13 @@
},200) },200)
clearTimeout(this.flag) clearTimeout(this.flag)
this.flag = setTimeout(()=>{ this.flag = setTimeout(()=>{
//#ifdef MP-WEIXIN
this.initCoupon() this.initCoupon()
//#endif
}, 1500) }, 1500)
}, },
couponChoose(data) { //---------------------------------------------------------------子组件券选择之后触发的事件 couponChoose(data) { //---------------------------------------------------------------子组件券选择之后触发的事件
this.chooseCouponObj = data this.chooseCouponObj = data
this.savedMoney=this.chooseCouponObj.savedMoney||0
}, },
showCoupon() { //---------------------------------------------------------------------展示券列表 showCoupon() { //---------------------------------------------------------------------展示券列表
this.$refs.orderCoupon.showCoupon() this.$refs.orderCoupon.showCoupon()
...@@ -319,34 +328,39 @@ ...@@ -319,34 +328,39 @@
openid:this.openid openid:this.openid
} }
this.$request("wechatUser/myPage/usableCouponList",data).then((res) => { this.$request("wechatUser/myPage/usableCouponList",data).then((res) => {
if (res.code == "00") { if (res.data.code == "00") {
this.chooseCouponObj=res.data.masterSlaveCouponList[0] this.couponData = res.data.data
if(this.chooseCouponObj.slaveList.length>0){ let masterSlaveCouponList=res.data.data.masterSlaveCouponList
this.savedMoney=this.chooseCouponObj.slaveList[0].savedMoney if (masterSlaveCouponList.length>0) {
}else{ masterSlaveCouponList.forEach((item) => { //获取最优券
this.savedMoney=this.chooseCouponObj.savedMoney savedMoneyList.push(item.savedMoney)
} })
// this.couponData = res.data let maxMoney = Math.max.apply(null, savedMoneyList)
// if (res.data.usableCouponList.length > 0) { let arr=masterSlaveCouponList.filter((item)=>{//找到最大值的数组
// res.data.usableCouponList.forEach((item) => { //获取最优券 return item.savedMoney==maxMoney
// savedMoneyList.push(item.savedMoney) })
// }) if(arr.length==1){
// let maxMoney = Math.max.apply(null, savedMoneyList) this.chooseCouponObj=arr[0]
// let index = res.data.usableCouponList.findIndex((item) => { }else{
// return maxMoney == item.savedMoney let index=arr.findIndex((item)=>{//如果有多个,找到是否有平台券,平台劵优先
// }) return item.createSource==1
// if(index>-1){ })
// this.chooseCouponObj = res.data.usableCouponList[index] if(index>-1){
// } this.chooseCouponObj=arr[index]
// } else { }else{
// if (res.data.unusableCouponList.length > 0) { this.chooseCouponObj=arr[0]
// res.data.unusableCouponList.forEach((item, i) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券 }
// if (item.isProduct == 1) { }
// this.ableConpon = item this.savedMoney=this.chooseCouponObj.savedMoney
// } } else {
// }) if (res.data.data.unusableCouponList.length > 0) {
// } res.data.data.unusableCouponList.forEach((item, i) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券
// } if (item.isProduct == 1) {
this.ableConpon = item
}
})
}
}
} }
}) })
}, },
...@@ -360,15 +374,27 @@ ...@@ -360,15 +374,27 @@
} }
let couponList = [] let couponList = []
if (this.chooseCouponObj != '') { if (this.chooseCouponObj != '') {
couponList = [ //券列表 if(this.chooseCouponObj.slaveList.length>0){//有从卷取值从卷,没有从卷取值主劵
{ couponList=[//券列表
couponId: this.chooseCouponObj.couponId, //券id {
couponPrice: this.chooseCouponObj.savedMoney, //券价格 couponId:this.chooseCouponObj.slaveCouponId,//券id
isMerchant: this.chooseCouponObj.createSource, //是否是商户的券 isMerchant:this.chooseCouponObj.slaveCreateSource,//是否是商户的券
myCouponId: this.chooseCouponObj.id, //领取人编号 myCouponId:this.chooseCouponObj.slaveId,//领取人编号
couponType:this.chooseCouponObj.couponType//券类型 couponType:this.chooseCouponObj.couponType,//券类型
} couponPrice:this.chooseCouponObj.savedMoney,//券价格
] }
]
}else{
couponList=[
{
couponId:this.chooseCouponObj.couponId,//券id
isMerchant:this.chooseCouponObj.createSource,//是否是商户的券
myCouponId:this.chooseCouponObj.id,//领取人编号
couponType:this.chooseCouponObj.couponType,//券类型
couponPrice:this.chooseCouponObj.savedMoney,//券价格
}
]
}
} }
let data = { let data = {
companyId: this.companyId, companyId: this.companyId,
...@@ -441,9 +467,9 @@ ...@@ -441,9 +467,9 @@
provider: 'alipay', // 服务提供商 支付宝支付: alipay 微信支付: wxpay provider: 'alipay', // 服务提供商 支付宝支付: alipay 微信支付: wxpay
orderInfo: this.orderInfo, // 支付宝订单号 orderInfo: this.orderInfo, // 支付宝订单号
success: function (res) { success: function (res) {
// uni.redirectTo({ uni.redirectTo({
// url:"../paySuccess/paySuccess" url:"../paySuccess/paySuccess?orderId="+_this.orderId
// }) })
}, },
fail: function (err) { fail: function (err) {
uni.showToast({ uni.showToast({
......
...@@ -12,7 +12,11 @@ ...@@ -12,7 +12,11 @@
} }
}, },
onLoad(option) { onLoad(option) {
this.outUrl="https://wx.pangdly.com/#/paySuccess?orderId="+option.orderId let pdOpenid=uni.getStorageSync("openid")//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync("token")
let pdCreateUserId=uni.getStorageSync("createUserId")
let pdUserId=uni.getStorageSync("userId")
this.outUrl="https://wx.pangdly.com/#/paySuccess?orderId="+option.orderId+"&pdOpenid="+pdOpenid+"&pdToken="+pdToken+"&pdCreateUserId="+pdCreateUserId+"&pdUserId="+pdUserId
}, },
methods: { methods: {
......
项目介绍文件 项目介绍文件
一、本地存储数据 一、本地存储数据
1.uni.getStorageSync("openid") 1.uni.getStorageSync("openid") //openid
2.uni.getStorageSync("alipayQrCode") 2.uni.getStorageSync("token") //token
3.uni.getStorageSync("createUserId") //当前用户的id
4.uni.getStorageSync("userId") //平台id
5.uni.getStorageSync("alipayQrCode") //支付宝参数码
6.uni.getStorageSync("enterOptions") //进入项目参数
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