去掉支付回调地址传参,由后端接口生成

This commit is contained in:
xiaogang 2024-08-27 18:28:33 +08:00
parent aae8438289
commit 56f9356a48
8 changed files with 12 additions and 28 deletions

View File

@ -9,8 +9,8 @@ const config = {
// pagesInclude: ['jlgh/coupon.vue', 'jlgh/redeem.vue'],
// pagesInclude: ['jlgh/index.vue'],
// pagesInclude: ['jlgh/login.vue'],
// pagesInclude: ['jlgh/orderDetail.vue'],
pagesInclude: ['index'],
pagesInclude: ['jlgh/orderDetail.vue'],
// pagesInclude: ['index'],
}
const { pages, pagesInclude } = config

2
env/.env vendored
View File

@ -5,7 +5,7 @@ VITE_UNI_APPID = 'H57F2ACE4'
VITE_WX_APPID = 'wxa2abb91f64032a2b'
# h5部署网站的base配置到 manifest.config.ts 里的 h5.router.base
VITE_APP_PUBLIC_BASE = ./
VITE_APP_PUBLIC_BASE = './'
# 测试线上
VITE_SERVER_BASEURL = 'https://gateway.dev.cdlsxd.cn'
# 曾徐平

8
env/.env.production vendored
View File

@ -7,12 +7,12 @@ VITE_SHOW_SOURCEMAP = false
# VITE_APP_PUBLIC_BASE = ./
# 测试线上
# VITE_SERVER_BASEURL = 'https://gateway.dev.cdlsxd.cn'
VITE_SERVER_BASEURL = 'https://gateway.dev.cdlsxd.cn'
# 正式环境
VITE_SERVER_BASEURL = 'https://scens.h5.86698.cn'
# VITE_SERVER_BASEURL = 'https://scens.h5.86698.cn'
# VITE_APP_PROXY = true
# 测试线上
# VITE_APP_PROXY_PREFIX = 'https://gateway.dev.cdlsxd.cn'
VITE_APP_PROXY_PREFIX = 'https://gateway.dev.cdlsxd.cn'
# 正式环境
VITE_APP_PROXY_PREFIX = 'https://scens.h5.86698.cn'
# VITE_APP_PROXY_PREFIX = 'https://scens.h5.86698.cn'

View File

@ -16,11 +16,12 @@
},
"pages": [
{
"path": "pages/index/index",
"path": "pages/jlgh/orderDetail",
"type": "home",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "首页"
"navigationBarTitleText": "订单详情",
"navigationBarBackgroundColor": "#FFF"
}
}
],

View File

@ -78,6 +78,7 @@ const query = reactive<any>({
const dui = (item) => {
item.activity_code = query.activity_code
item.lottery_code = query.lottery_code
uni.navigateTo({
url: '/pages/jlgh/redeem?item=' + encodeURIComponent(JSON.stringify(item)),
})

View File

@ -91,7 +91,6 @@
import { onMounted, reactive, ref, unref } from 'vue'
import { queryOrderDetail, goPay, getPayConfig } from './api'
import { debounce, throttle } from '@/utils/index'
// import { useUserStore } from '@/store'
const orderId = ref<string>('')
const activityCode = ref<string>('')
@ -109,7 +108,6 @@ const payConfig = {
label: '微信',
},
}
// const useStore = useUserStore()
const second = ref(5)
const current = ref(0)
@ -131,9 +129,6 @@ function countDown() {
onShow(async () => {
// eslint-disable-next-line camelcase
const { isPayBack } = getUrlParams() as any
// uni.setNavigationBarTitle({
// title: (useStore.getUserInfo.contentData as any).order_detail_templates.moduledesc,
// })
if (isPayBack) {
pageType.value = 1
countDown()
@ -202,7 +197,6 @@ const pay = throttle(async (item) => {
// eslint-disable-next-line camelcase
pay_center_channel_id,
// eslint-disable-next-line camelcase
...(pay_type === 1 && { return_url: window.location.href + '&isPayBack=true' }),
}
const res = await goPay(params)
const { code, message, data } = res as any

View File

@ -134,7 +134,6 @@
<script lang="ts" setup>
import api from './api'
// import { useUserStore } from '@/store'
import { debounce, throttle } from '@/utils/index'
const ismask = ref<boolean>(false)
const info = reactive<any>({})
@ -156,7 +155,6 @@ const pay_order_id = ref('')
const pay_order_no = ref('')
// eslint-disable-next-line camelcase
const wait_pay_amount = ref(0)
// const useStore = useUserStore()
onLoad((options) => {
const item = decodeURIComponent(options.item)
Object.assign(info, JSON.parse(item))
@ -226,26 +224,16 @@ function clickEvent() {
}
const payEvent = throttle(async (item) => {
const contentData: any = await api.getContent({ activity_code: info.activity_code })
// eslint-disable-next-line camelcase
const { pay_type, pay_center_channel_id } = item
// eslint-disable-next-line camelcase
const order_no = pay_order_no.value
// eslint-disable-next-line camelcase
const order_id = pay_order_id.value
// eslint-disable-next-line camelcase
const return_url =
// eslint-disable-next-line camelcase
contentData.data.order_detail_templates.source +
// eslint-disable-next-line camelcase
`?order_id=${order_id}&activity_code=${info.activity_code}&isPayBack=true`
const params = {
// eslint-disable-next-line camelcase
order_no,
// eslint-disable-next-line camelcase
pay_center_channel_id,
// eslint-disable-next-line camelcase
...(pay_type === 1 && { return_url }),
}
const res = await api.goPay(params)
const { code, message, data } = res as any

View File

@ -4,7 +4,7 @@
// Generated by vite-plugin-uni-pages
interface NavigateToOptions {
url: "/pages/index/index";
url: "/pages/jlgh/orderDetail";
}
interface RedirectToOptions extends NavigateToOptions {}