重新打包一个主模版页
This commit is contained in:
parent
1e4d22a17b
commit
dfae9d705d
|
@ -1 +0,0 @@
|
|||
.main-title-color[data-v-07b3976d]{color:#d14328}
|
|
@ -0,0 +1 @@
|
|||
.main-title-color[data-v-441c737e]{color:#d14328}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
<!doctype html>
|
||||
<html build-date="2024-08-23 18:37:31">
|
||||
<html build-date="2024-08-26 13:34:34">
|
||||
<head>
|
||||
<link rel="stylesheet" href="./assets/uni.ad4bcb33.css">
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
|||
<title>场景营销</title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
<script type="module" crossorigin src="./assets/index-D7ox9T_c.js"></script>
|
||||
<script type="module" crossorigin src="./assets/index-ChsP0NUI.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-DqQ4aJDv.css">
|
||||
</head>
|
||||
|
||||
|
|
|
@ -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'
|
||||
# 曾徐平
|
||||
|
|
|
@ -115,7 +115,6 @@ window.addEventListener('message', function (event) {
|
|||
window.location.replace(event.data.data.url)
|
||||
break
|
||||
case 'orderDetail':
|
||||
console.log('主模版触发')
|
||||
// eslint-disable-next-line no-case-declarations
|
||||
const queryParams = event.data.data.query ? handleParams(event.data.data.query) + '&' : ''
|
||||
srcList.url =
|
||||
|
|
|
@ -96,7 +96,6 @@ const gomypre = (item) => {
|
|||
'*',
|
||||
)
|
||||
} else if (item.order_no) {
|
||||
console.log('列表页触发')
|
||||
window.parent.postMessage(
|
||||
{
|
||||
data: {
|
||||
|
@ -110,8 +109,6 @@ const gomypre = (item) => {
|
|||
'*',
|
||||
)
|
||||
}
|
||||
|
||||
// window.location.href = itemInfo.order_info
|
||||
}
|
||||
|
||||
function getData() {
|
||||
|
|
|
@ -10,7 +10,15 @@
|
|||
|
||||
<template>
|
||||
<view class="flex flex-col flex-items-center page">
|
||||
<view class="wrapper" v-if="!showLoading">
|
||||
<view
|
||||
class="w-full h-full flex flex-items-center flex-justify-center flex-col countdown"
|
||||
v-if="pageType == 1"
|
||||
>
|
||||
<wd-circle v-model="current" :text="`订单查询中`"></wd-circle>
|
||||
<!-- <text>{{ second }}s</text>
|
||||
<text>订单查询中</text> -->
|
||||
</view>
|
||||
<view class="wrapper" v-if="pageType === 3">
|
||||
<view class="pro-info">
|
||||
<view class="title">订单详情</view>
|
||||
<view class="content flex">
|
||||
|
@ -33,19 +41,13 @@
|
|||
</view>
|
||||
<view class="order-info">
|
||||
<view class="info-item">订单编号:{{ orderInfo.order_no }}</view>
|
||||
<!-- <view
|
||||
class="info-item"
|
||||
v-if="!!orderDetail.exchange_time && ![9].includes(orderDetail.state)"
|
||||
>
|
||||
支付时间:{{ orderDetail.exchange_time }}
|
||||
</view> -->
|
||||
<view class="info-item">下单时间:{{ orderInfo.order_time }}</view>
|
||||
<view class="info-item" style="margin-bottom: 24rpx">
|
||||
订单金额:{{ orderInfo.order_amount }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btns" v-if="!showLoading">
|
||||
<view class="btns" v-if="pageType === 3">
|
||||
<view class="btn pwd" @click="toPay" v-if="[1].includes(orderInfo.status)">立即付款</view>
|
||||
<view
|
||||
class="btn pwd"
|
||||
|
@ -87,14 +89,15 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref, unref } from 'vue'
|
||||
import { queryOrderDetail, goPay, getPayConfig } from './api'
|
||||
import { useUserStore } from '@/store'
|
||||
import { debounce, throttle } from '@/utils/index'
|
||||
// import { useUserStore } from '@/store'
|
||||
|
||||
const orderNo = ref<string>('')
|
||||
const activityCode = ref<string>('')
|
||||
const orderInfo = reactive<any>({})
|
||||
const productInfo = reactive<any>({})
|
||||
const couponInfo = reactive<any>({})
|
||||
const showLoading = ref(true)
|
||||
const pageType = ref(2)
|
||||
const showPayConfig = ref(false)
|
||||
const payList = ref([])
|
||||
const payConfig = {
|
||||
|
@ -105,29 +108,49 @@ const payConfig = {
|
|||
label: '微信',
|
||||
},
|
||||
}
|
||||
const useStore = useUserStore()
|
||||
// const useStore = useUserStore()
|
||||
const second = ref(5)
|
||||
const current = ref(0)
|
||||
|
||||
function countDown() {
|
||||
const timer = setInterval(() => {
|
||||
second.value -= 1
|
||||
current.value = (5 - second.value) * 20
|
||||
if (current.value > 100) {
|
||||
clearInterval(timer)
|
||||
pageType.value = 3
|
||||
second.value = 5
|
||||
current.value = 0
|
||||
queryEvent()
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
// 用onshow 解决h5页面被缓存的问题
|
||||
onShow(async () => {
|
||||
// eslint-disable-next-line camelcase
|
||||
const { isPayBack } = getUrlParams() as any
|
||||
// uni.setNavigationBarTitle({
|
||||
// title: (useStore.getUserInfo.contentData as any).order_detail_templates.moduledesc,
|
||||
// })
|
||||
uni.showLoading({
|
||||
title: '订单查询中',
|
||||
})
|
||||
await sleep(5000)
|
||||
uni.hideLoading()
|
||||
showLoading.value = false
|
||||
if (isPayBack) {
|
||||
pageType.value = 1
|
||||
countDown()
|
||||
} else {
|
||||
pageType.value = 3
|
||||
queryEvent()
|
||||
}
|
||||
})
|
||||
|
||||
function queryEvent() {
|
||||
// eslint-disable-next-line camelcase
|
||||
const { order_no, activity_code } = getUrlParams() as any
|
||||
// eslint-disable-next-line camelcase
|
||||
if (!order_no) return
|
||||
// eslint-disable-next-line camelcase
|
||||
orderNo.value = order_no
|
||||
// eslint-disable-next-line camelcase
|
||||
activityCode.value = activity_code
|
||||
getDetail()
|
||||
})
|
||||
}
|
||||
|
||||
function sleep(delay) {
|
||||
return new Promise((resolve) => setTimeout(resolve, delay))
|
||||
|
@ -169,7 +192,7 @@ async function toPay() {
|
|||
showPayConfig.value = true
|
||||
}
|
||||
|
||||
async function pay(item) {
|
||||
const pay = throttle(async (item) => {
|
||||
// eslint-disable-next-line camelcase
|
||||
const { order_no } = orderInfo
|
||||
// eslint-disable-next-line camelcase
|
||||
|
@ -180,7 +203,7 @@ async function pay(item) {
|
|||
// eslint-disable-next-line camelcase
|
||||
pay_center_channel_id,
|
||||
// eslint-disable-next-line camelcase
|
||||
return_url: window.location.href,
|
||||
...(pay_type === 1 && { return_url: window.location.href }),
|
||||
}
|
||||
const res = await goPay(params)
|
||||
const { code, message, data } = res as any
|
||||
|
@ -198,7 +221,38 @@ async function pay(item) {
|
|||
title: message,
|
||||
})
|
||||
}
|
||||
}
|
||||
}, 1500)
|
||||
|
||||
// async function pay(item) {
|
||||
// // eslint-disable-next-line camelcase
|
||||
// const { order_no } = orderInfo
|
||||
// // eslint-disable-next-line camelcase
|
||||
// const { pay_type, pay_center_channel_id } = item
|
||||
// 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: window.location.href }),
|
||||
// }
|
||||
// const res = await goPay(params)
|
||||
// const { code, message, data } = res as any
|
||||
// if (code === 200) {
|
||||
// const { url, order } = data
|
||||
// if (url) {
|
||||
// window.location.href = data.url
|
||||
// }
|
||||
// if (order) {
|
||||
// Object.assign(orderInfo, order)
|
||||
// }
|
||||
// } else {
|
||||
// uni.showToast({
|
||||
// icon: 'none',
|
||||
// title: message,
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
|
||||
onMounted(() => {})
|
||||
|
||||
|
@ -225,6 +279,17 @@ const getDetail = () => {
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// .countdown {
|
||||
// font-weight: 400;
|
||||
// > :first-child {
|
||||
// font-size: 36rpx;
|
||||
// color: red;
|
||||
// }
|
||||
// > :last-child {
|
||||
// font-size: 30rpx;
|
||||
// color: #9e9e9e;
|
||||
// }
|
||||
// }
|
||||
.pay-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
|
@ -108,7 +108,6 @@
|
|||
v-model="showPayConfig"
|
||||
position="bottom"
|
||||
custom-style="max-height:400rpx;background-color:#fff !important"
|
||||
@close="handleClose"
|
||||
>
|
||||
<view style="padding-bottom: 20rpx">
|
||||
<view class="pay-top">
|
||||
|
@ -135,7 +134,8 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import api from './api'
|
||||
import { useUserStore } from '@/store'
|
||||
// import { useUserStore } from '@/store'
|
||||
import { debounce, throttle } from '@/utils/index'
|
||||
const ismask = ref<boolean>(false)
|
||||
const info = reactive<any>({})
|
||||
const linkUrl = ref<string>('')
|
||||
|
@ -154,7 +154,7 @@ const payConfig = {
|
|||
const pay_order_no = ref('')
|
||||
// eslint-disable-next-line camelcase
|
||||
const wait_pay_amount = ref(0)
|
||||
const useStore = useUserStore()
|
||||
// const useStore = useUserStore()
|
||||
onLoad((options) => {
|
||||
const item = decodeURIComponent(options.item)
|
||||
Object.assign(info, JSON.parse(item))
|
||||
|
@ -223,7 +223,8 @@ function clickEvent() {
|
|||
showPayConfig.value = false
|
||||
}
|
||||
|
||||
async function payEvent(item) {
|
||||
const payEvent = throttle(async (item) => {
|
||||
console.log('item->>>>>', 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
|
||||
|
@ -234,16 +235,15 @@ async function payEvent(item) {
|
|||
// eslint-disable-next-line camelcase
|
||||
contentData.data.order_detail_templates.source +
|
||||
// eslint-disable-next-line camelcase
|
||||
`?order_no=${order_no}&activity_code=${info.activity_code}`
|
||||
`?order_no=${order_no}&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
|
||||
return_url,
|
||||
...(pay_type === 1 && { return_url }),
|
||||
}
|
||||
console.log(params)
|
||||
const res = await api.goPay(params)
|
||||
const { code, message, data } = res as any
|
||||
if (code === 200) {
|
||||
|
@ -257,7 +257,43 @@ async function payEvent(item) {
|
|||
title: message,
|
||||
})
|
||||
}
|
||||
}
|
||||
}, 1500)
|
||||
|
||||
// async function payEvent(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 return_url =
|
||||
// // eslint-disable-next-line camelcase
|
||||
// contentData.data.order_detail_templates.source +
|
||||
// // eslint-disable-next-line camelcase
|
||||
// `?order_no=${order_no}&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 }),
|
||||
// }
|
||||
// console.log(params)
|
||||
// const res = await api.goPay(params)
|
||||
// const { code, message, data } = res as any
|
||||
// if (code === 200) {
|
||||
// const { url } = data
|
||||
// if (url) {
|
||||
// window.location.href = data.url
|
||||
// }
|
||||
// } else {
|
||||
// uni.showToast({
|
||||
// icon: 'none',
|
||||
// title: message,
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
|
||||
async function dui() {
|
||||
uni.showLoading({
|
||||
|
@ -298,8 +334,6 @@ async function dui() {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
function handleClose() {}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
Loading…
Reference in New Issue