Unipay-H5/detail.html

166 lines
5.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<!-- A11Y注意设置页面的 lang 属性 -->
<html lang="zh">
<head>
<meta charset="utf-8" />
<!-- A11Y打开页面时屏幕阅读器会首先阅读 title 的内容,确保 title 准确描述页面 -->
<title>兑换详情</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no, email=no" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" />
<!-- A11Y如果有无障碍方面的需求建议使用下面的 viewport 设置,不要禁止页面缩放 -->
<!--<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />-->
<script>
var docEl = document.documentElement;
docEl.style.fontSize = 100 / 375 * docEl.clientWidth + 'px';
window.addEventListener('resize', function () {
docEl.style.fontSize = 100 / 375 * docEl.clientWidth + 'px';
});
</script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/axios.js?v=1367936144999"></script>
<script src="./dof-api.js"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/libs/vue.global.js"></script>
<link rel="stylesheet" href="https://gw.alipayobjects.com/as/g/antui/antui/10.1.10/rem/widget/toast.css">
<link rel="stylesheet" href="./detail-style.css">
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div id="app">
<div class="header" v-if="state.showPage">
<img src="https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/department-of-finance/img/detail-bg.png"
alt="">
<div class="detail-box">
<p class="order-status">{{ orderState(state.order.state) }}</p>
<div class="goods-info">
<p class="goods-title">商品信息</p>
<div class="goods-info-box">
<img :src="state.product.icon" alt="">
<div style="padding-left: 0.09rem;">
<p class="name">{{ sliceStr(state.order.prize_name)[0] }}</p>
<p class="type">{{ sliceStr(state.order.prize_name)[1] }}</p>
</div>
<p class="num">x1</p>
</div>
</div>
</div>
<div class="order-info">
<p class="order-title">订单信息</p>
<div class="order-list">
<span>订单编号</span>
<span>{{ state.order.order_no }}</span>
</div>
<div class="order-list">
<span>充值账号</span>
<span>{{ state.order.mobile }}</span>
</div>
<div class="order-list">
<span>充值时间</span>
<span>{{ state.order.create_time }}</span>
</div>
<div class="order-list">
<span>充值状态</span>
<span>{{ orderState(state.order.state) }}</span>
</div>
</div>
</div>
<div class="am-toast text" v-show="state.showToast">
<div class="am-toast-text">
{{ state.toastText }}
</div>
</div>
</div>
</body>
<script>
const { createApp, reactive, onMounted } = Vue
createApp({
setup() {
const state = reactive({
showToast: false,
toastText: "",
product: {},
order: {},
showPage: false
})
// 状态
const orderState = (status) => {
switch (status) {
case 1:
return "充值成功";
case 2:
return "已兑换"
case 3:
return "兑换失败"
case 4:
return "充值异常"
default:
return ""
}
}
const sliceStr = (str) => {
if (str) {
return str.split("|")
}
return []
}
// toast
const openToast = (msg) => {
if (state.showToast) return;
state.toastText = msg;
state.showToast = true;
setTimeout(() => {
state.showToast = false;
}, 1500);
};
// 获取订单详情
const getOrderDetail = () => {
try {
req.axiosGet("/front/order/list").then(res => {
if (res.code === 200) {
state.product = res.data.data[0].product;
state.order = res.data.data[0];
state.showPage = true;
} else {
openToast(res.message);
}
})
} catch (err) {
}
}
onMounted(() => {
getOrderDetail();
})
return {
orderState,
state,
sliceStr
}
}
}).mount('#app')
</script>
</html>