重新打包一个主模版页

This commit is contained in:
xiaogang 2024-08-26 13:35:48 +08:00
parent 1e4d22a17b
commit dfae9d705d
11 changed files with 139 additions and 44 deletions

View File

@ -1 +0,0 @@
.main-title-color[data-v-07b3976d]{color:#d14328}

View File

@ -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

View File

@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html build-date="2024-08-23 18:37:31"> <html build-date="2024-08-26 13:34:34">
<head> <head>
<link rel="stylesheet" href="./assets/uni.ad4bcb33.css"> <link rel="stylesheet" href="./assets/uni.ad4bcb33.css">
@ -19,7 +19,7 @@
<title>场景营销</title> <title>场景营销</title>
<!--preload-links--> <!--preload-links-->
<!--app-context--> <!--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"> <link rel="stylesheet" crossorigin href="./assets/index-DqQ4aJDv.css">
</head> </head>

2
env/.env vendored
View File

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

View File

@ -115,7 +115,6 @@ window.addEventListener('message', function (event) {
window.location.replace(event.data.data.url) window.location.replace(event.data.data.url)
break break
case 'orderDetail': case 'orderDetail':
console.log('主模版触发')
// eslint-disable-next-line no-case-declarations // eslint-disable-next-line no-case-declarations
const queryParams = event.data.data.query ? handleParams(event.data.data.query) + '&' : '' const queryParams = event.data.data.query ? handleParams(event.data.data.query) + '&' : ''
srcList.url = srcList.url =

View File

@ -96,7 +96,6 @@ const gomypre = (item) => {
'*', '*',
) )
} else if (item.order_no) { } else if (item.order_no) {
console.log('列表页触发')
window.parent.postMessage( window.parent.postMessage(
{ {
data: { data: {
@ -110,8 +109,6 @@ const gomypre = (item) => {
'*', '*',
) )
} }
// window.location.href = itemInfo.order_info
} }
function getData() { function getData() {

View File

@ -10,7 +10,15 @@
<template> <template>
<view class="flex flex-col flex-items-center page"> <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="pro-info">
<view class="title">订单详情</view> <view class="title">订单详情</view>
<view class="content flex"> <view class="content flex">
@ -33,19 +41,13 @@
</view> </view>
<view class="order-info"> <view class="order-info">
<view class="info-item">订单编号{{ orderInfo.order_no }}</view> <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">下单时间{{ orderInfo.order_time }}</view>
<view class="info-item" style="margin-bottom: 24rpx"> <view class="info-item" style="margin-bottom: 24rpx">
订单金额{{ orderInfo.order_amount }} 订单金额{{ orderInfo.order_amount }}
</view> </view>
</view> </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" @click="toPay" v-if="[1].includes(orderInfo.status)">立即付款</view>
<view <view
class="btn pwd" class="btn pwd"
@ -87,14 +89,15 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, reactive, ref, unref } from 'vue' import { onMounted, reactive, ref, unref } from 'vue'
import { queryOrderDetail, goPay, getPayConfig } from './api' 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 orderNo = ref<string>('')
const activityCode = ref<string>('') const activityCode = ref<string>('')
const orderInfo = reactive<any>({}) const orderInfo = reactive<any>({})
const productInfo = reactive<any>({}) const productInfo = reactive<any>({})
const couponInfo = reactive<any>({}) const couponInfo = reactive<any>({})
const showLoading = ref(true) const pageType = ref(2)
const showPayConfig = ref(false) const showPayConfig = ref(false)
const payList = ref([]) const payList = ref([])
const payConfig = { const payConfig = {
@ -105,29 +108,49 @@ const payConfig = {
label: '微信', 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 h5
onShow(async () => { onShow(async () => {
// eslint-disable-next-line camelcase
const { isPayBack } = getUrlParams() as any
// uni.setNavigationBarTitle({ // uni.setNavigationBarTitle({
// title: (useStore.getUserInfo.contentData as any).order_detail_templates.moduledesc, // title: (useStore.getUserInfo.contentData as any).order_detail_templates.moduledesc,
// }) // })
uni.showLoading({ if (isPayBack) {
title: '订单查询中', pageType.value = 1
}) countDown()
await sleep(5000) } else {
uni.hideLoading() pageType.value = 3
showLoading.value = false queryEvent()
}
})
function queryEvent() {
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
const { order_no, activity_code } = getUrlParams() as any const { order_no, activity_code } = getUrlParams() as any
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
if (!order_no) return
// eslint-disable-next-line camelcase
orderNo.value = order_no orderNo.value = order_no
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
activityCode.value = activity_code activityCode.value = activity_code
getDetail() getDetail()
}) }
function sleep(delay) { function sleep(delay) {
return new Promise((resolve) => setTimeout(resolve, delay)) return new Promise((resolve) => setTimeout(resolve, delay))
@ -169,7 +192,7 @@ async function toPay() {
showPayConfig.value = true showPayConfig.value = true
} }
async function pay(item) { const pay = throttle(async (item) => {
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
const { order_no } = orderInfo const { order_no } = orderInfo
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
@ -180,7 +203,7 @@ async function pay(item) {
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
pay_center_channel_id, pay_center_channel_id,
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
return_url: window.location.href, ...(pay_type === 1 && { return_url: window.location.href }),
} }
const res = await goPay(params) const res = await goPay(params)
const { code, message, data } = res as any const { code, message, data } = res as any
@ -198,7 +221,38 @@ async function pay(item) {
title: message, 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(() => {}) onMounted(() => {})
@ -225,6 +279,17 @@ const getDetail = () => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// .countdown {
// font-weight: 400;
// > :first-child {
// font-size: 36rpx;
// color: red;
// }
// > :last-child {
// font-size: 30rpx;
// color: #9e9e9e;
// }
// }
.pay-top { .pay-top {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -108,7 +108,6 @@
v-model="showPayConfig" v-model="showPayConfig"
position="bottom" position="bottom"
custom-style="max-height:400rpx;background-color:#fff !important" custom-style="max-height:400rpx;background-color:#fff !important"
@close="handleClose"
> >
<view style="padding-bottom: 20rpx"> <view style="padding-bottom: 20rpx">
<view class="pay-top"> <view class="pay-top">
@ -135,7 +134,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import api from './api' import api from './api'
import { useUserStore } from '@/store' // import { useUserStore } from '@/store'
import { debounce, throttle } from '@/utils/index'
const ismask = ref<boolean>(false) const ismask = ref<boolean>(false)
const info = reactive<any>({}) const info = reactive<any>({})
const linkUrl = ref<string>('') const linkUrl = ref<string>('')
@ -154,7 +154,7 @@ const payConfig = {
const pay_order_no = ref('') const pay_order_no = ref('')
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
const wait_pay_amount = ref(0) const wait_pay_amount = ref(0)
const useStore = useUserStore() // const useStore = useUserStore()
onLoad((options) => { onLoad((options) => {
const item = decodeURIComponent(options.item) const item = decodeURIComponent(options.item)
Object.assign(info, JSON.parse(item)) Object.assign(info, JSON.parse(item))
@ -223,7 +223,8 @@ function clickEvent() {
showPayConfig.value = false 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 }) const contentData: any = await api.getContent({ activity_code: info.activity_code })
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
const { pay_type, pay_center_channel_id } = item const { pay_type, pay_center_channel_id } = item
@ -234,16 +235,15 @@ async function payEvent(item) {
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
contentData.data.order_detail_templates.source + contentData.data.order_detail_templates.source +
// eslint-disable-next-line camelcase // 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 = { const params = {
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
order_no, order_no,
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
pay_center_channel_id, pay_center_channel_id,
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
return_url, ...(pay_type === 1 && { return_url }),
} }
console.log(params)
const res = await api.goPay(params) const res = await api.goPay(params)
const { code, message, data } = res as any const { code, message, data } = res as any
if (code === 200) { if (code === 200) {
@ -257,7 +257,43 @@ async function payEvent(item) {
title: message, 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() { async function dui() {
uni.showLoading({ uni.showLoading({
@ -298,8 +334,6 @@ async function dui() {
}) })
} }
} }
function handleClose() {}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>