Commit 8f215cd6 by huangzhi

feat: 拼团二维码参数

parent e83ebbf2
...@@ -211,13 +211,14 @@ export default { ...@@ -211,13 +211,14 @@ export default {
// const aa = // const aa =
// 'orderId=90230307003008&totalAmount=0.03&balance=9779&payType=5&title=%E6%94%AF%E4%BB%98%E4%B8%AD%E9%97%B4%E9%A1%B5%E9%9D%A2' // 'orderId=90230307003008&totalAmount=0.03&balance=9779&payType=5&title=%E6%94%AF%E4%BB%98%E4%B8%AD%E9%97%B4%E9%A1%B5%E9%9D%A2'
// uni.navigateTo({ // uni.navigateTo({
// url: `/pages/pay/pay?${aa}`, // url: `/pages/pay/pay`,
// }) // })
if (!this.isLogin) { if (!this.isLogin) {
this.handleLogin() this.handleLogin()
return return
} }
const url = `${hostPrefix}/h5-course/my/components/Buylist` const url = `${hostPrefix}/h5-course/my/components/Buylist`
// const url = `${hostPrefix}/h5-course/detail/7747?uid&accessToken&appId=wx1106c32a36d87d49&isFromMin=weapp&miniType=groupActivity&ffrom=AppletWechatCourseFuLi&timestamp=1678689403156`
uni.navigateTo({ uni.navigateTo({
url: `/pages/web/web?title=已购订单&loadUrl=${encodeURIComponent(url)}`, url: `/pages/web/web?title=已购订单&loadUrl=${encodeURIComponent(url)}`,
......
<template> <template>
<view class="pay-page"> <view class="pay-page">
<div>正在支付中.12...</div> <div>正在支付中</div>
<div>正在支付中.22...</div>
<div>正在支付中.32...</div>
</view> </view>
</template> </template>
...@@ -192,14 +190,14 @@ export default { ...@@ -192,14 +190,14 @@ export default {
title: '支付成功', title: '支付成功',
duration: 1500, duration: 1500,
}) })
// todo 如何是 非拼团购买,就跳普通页面。
// 当前只有拼团业务才会被分享出来,在微信小程序中支付 // 当前只有拼团业务才会被分享出来,在微信小程序中支付
const url = `${hostPrefix}/h5-course/pay/groupSuccess?ccc=qwe&ttt=123` const url = `${hostPrefix}/h5-course/pay/groupSuccess?ccc=qwe&ttt=123`
// const url = `${hostPrefix}/h5-course/detail/7934?uid&accessToken&appId=wx1106c32a36d87d49&isFromMin=weapp&miniType=groupActivity&ffrom=AppletWechatCourseFuLi&timestamp=1678689403156`
uni.navigateTo({ uni.navigateTo({
url: `/pages/web/web?title=${ url: `/pages/web/web?title=${'支付成功'}&loadUrl=${encodeURIComponent(url)}`,
this.doctor.name ? `${this.doctor.name}的评价` : ''
}&loadUrl=${encodeURIComponent(url)}`,
}) })
}, },
}, },
......
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
methods: { methods: {
// 设置页面地址额外的通用参数 // 设置页面地址额外的通用参数
setCommonUrlParams(pageUrl) { setCommonUrlParams(pageUrl, urlParmas) {
let url = decodeURIComponent(pageUrl) let url = decodeURIComponent(pageUrl)
const query = { const query = {
...@@ -65,6 +65,7 @@ export default { ...@@ -65,6 +65,7 @@ export default {
miniType: 'groupActivity', miniType: 'groupActivity',
ffrom, ffrom,
timestamp: +new Date(), timestamp: +new Date(),
...urlParmas,
} }
// 更新 url 中的参数 // 更新 url 中的参数
Object.keys(query).forEach(prop => { Object.keys(query).forEach(prop => {
...@@ -93,12 +94,28 @@ export default { ...@@ -93,12 +94,28 @@ export default {
.finally(() => (this.loading = false)) .finally(() => (this.loading = false))
if (res) { if (res) {
// todo
this.options.courseId = res.courseId || res.doctorId
// https://testnewm.ydl.com/h5-course/detail/7529 // https://testnewm.ydl.com/h5-course/detail/7529
const url = `${hostPrefix}/h5-course/detail/${res.courseId || res.doctorId}` const url = `${hostPrefix}/h5-course/detail/${res.productId}`
this.loadUrl = this.setCommonUrlParams(`${url}`)
// productId 商品id
// activityId 拼团活动id
// channel 活动渠道
// recordId 成团id
// shareUid 分享人id
// moreId 待定
const params = ['activityId', 'channel', 'recordId', 'shareUid'].reduce((acc, key) => {
// groupRecordId
if (res[key] || res[key] === 0) {
// 为了保证参数连贯性,使用通用的 groupRecordId
if (key === 'recordId') {
acc['groupRecordId'] = res[key]
} else {
acc[key] = res[key]
}
}
return acc
}, {})
this.loadUrl = this.setCommonUrlParams(`${url}`, params)
console.log(res, '二维码参数解析') console.log(res, '二维码参数解析')
uni.hideLoading() uni.hideLoading()
} else { } else {
......
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