加入支付时间字段

This commit is contained in:
xiaogang 2024-07-26 09:54:24 +08:00
parent 72c7bcfcef
commit 29b06bcb91
3 changed files with 46 additions and 8 deletions

View File

@ -17,8 +17,45 @@
<div id="app"><!--app-html--></div>
<script src="/static/ycnc/YT_Client_api.js"></script>
<script type="module" src="/src/main.js"></script>
<!-- 调试工具 -->
<script src="https://fastly.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script>
<script>
var clickCount = 0
var timer = null
var isShow = false
function insertScript() {
isShow = true
// 创建一个新的script元素
var src = 'https://fastly.jsdelivr.net/npm/eruda'
var script = document.createElement('script')
script.type = 'text/javascript'
script.src = src
// 插入到head中
document.head.appendChild(script)
script.onload = function () {
eruda.init()
}
}
document.addEventListener('click', function () {
if (isShow) return false
if (clickCount < 6) {
clickCount++
console.log(`Clicked ${clickCount} times`)
// 如果是第一次点击,则开始计时
if (clickCount === 1) {
timer = setTimeout(() => {
clickCount = 0 // 重置点击计数
}, 2000)
}
// 如果点击次数达到6次则清除计时器并重置状态
if (clickCount >= 6) {
clearTimeout(timer)
insertScript()
clickCount = 0 // 重置点击计数
}
}
})
</script>
</body>
</html>

View File

@ -70,14 +70,14 @@
onMounted(async ()=>{
queryProducts();
// let testToken = import.meta.env.VITE_TEST_TOKEN
// uni.setStorageSync('token',testToken)
const token = uni.getStorageSync('token') || '';
// window.localStorage.setItem('token',testToken)
const token = window.localStorage.getItem('token') || '';
if(!token){
console.log('进入登录过程');
const code = await useCode();
authCode.value = code
const {token} = await login({params:{code:unref(authCode)}});
uni.setStorageSync('token',token);
window.localStorage.setItem('token',token);
}
});

View File

@ -32,7 +32,8 @@
</view>
<view class="order-info">
<view class="info-item">订单编号{{ orderDetail.order_no }}</view>
<view class="info-item">支付时间{{ orderDetail.create_time }}</view>
<!-- <view class="info-item" v-if="![1].includes(orderDetail.state)">支付时间{{ orderDetail.exchange_time || '' }}</view> -->
<view class="info-item" v-if="!!orderDetail.exchange_time">支付时间{{ orderDetail.exchange_time }}</view>
<view class="info-item">下单时间{{ orderDetail.create_time }}</view>
<view class="info-item" style="margin-bottom: 24rpx;">订单金额{{ orderDetail.price }}</view>
</view>
@ -55,7 +56,6 @@
const orderDetail = reactive({});
onLoad((options) => {
console.log('href',window.location.href);
console.log('options',options);
const {order_id,order_no} = options;
id.value = order_id
@ -67,6 +67,7 @@
url:`/pages/ycnc/index`
})
}
const viewPwd = (detailData) => {
const {voucher_link} = detailData
if(voucher_link){