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