From fb88961c02fdff4498a527c86e7fbe253ebb4897 Mon Sep 17 00:00:00 2001 From: zhangds Date: Fri, 31 May 2024 13:48:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- detail-style.css | 1 - detail.html | 99 ++++++++++++++++++++++++++++++++++++++++++------ index-style.css | 4 ++ index.html | 55 ++++++++++++++++++++------- readme.md | 9 +++++ 5 files changed, 143 insertions(+), 25 deletions(-) diff --git a/detail-style.css b/detail-style.css index c336a69..7b0f59b 100644 --- a/detail-style.css +++ b/detail-style.css @@ -60,7 +60,6 @@ .goods-info-box > img { width: 0.64rem; height: 0.64rem; - outline: 1px solid red; } .goods-info-box .name { diff --git a/detail.html b/detail.html index 0e5914a..8e5978b 100644 --- a/detail.html +++ b/detail.html @@ -25,26 +25,27 @@ +
-
+
-

充值成功

+

{{ orderState(state.order.state) }}

商品信息

- +
-

爱奇艺黄金VIP会员月卡

-

VIP会员 1个月

+

{{ sliceStr(state.order.prize_name)[0] }}

+

{{ sliceStr(state.order.prize_name)[1] }}

x1

@@ -56,33 +57,109 @@
订单编号 - 20249990000999909 + {{ state.order.order_no }}
充值账号 - 13556666999 + {{ state.order.mobile }}
充值时间 - 2024-05-29 09:37 + {{ state.order.create_time }}
充值状态 - 充值成功 + {{ orderState(state.order.state) }}
+ +
+
+ {{ state.toastText }} +
+
diff --git a/index-style.css b/index-style.css index 6f661de..824ac0e 100644 --- a/index-style.css +++ b/index-style.css @@ -204,3 +204,7 @@ .ok-btn { background: linear-gradient(180deg, #88def0 0%, #69b5d8 100%); } + +.grayscale-image { + filter: grayscale(100%); +} diff --git a/index.html b/index.html index 481e260..4975761 100644 --- a/index.html +++ b/index.html @@ -40,16 +40,17 @@

兑换商品列表

-
- +

{{ sliceStr(item.name)[0] }}

{{ sliceStr(item.name)[1] }}

-
+
@@ -65,8 +66,8 @@
-
- 立即兑换 +
+ {{ state.isExchange === -1 ? '立即兑换' : '查询详情' }}
@@ -120,7 +121,9 @@ showToast: false, toastText: "", goodsList: [], - isChecked: -1 + isChecked: -1, + isExchange: -1, + userPhone: "" }) // toast @@ -143,6 +146,7 @@ // 选中颜色 const selectGoods = (id) => { + if (state.isExchange !== -1) return state.isChecked = id; } @@ -196,11 +200,9 @@ // 获取用户信息 const getUserInfo = () => { try { - req.axiosGet("/front/getAccountInfo", { - token: state.token - }).then(res => { + req.axiosGet("/front/getAccountInfo").then(res => { if (res.code === 200) { - state.showPage = true; + state.userPhone = res.data.phone; } else { openToast(res.message); } @@ -220,6 +222,7 @@ let el = res.data.prizes.find(item => item.is_receive === 1); if (el) { state.isChecked = el.id; + state.isExchange = el.id; } } else { openToast(res.message); @@ -230,6 +233,31 @@ } } + // 兑换 + const exchangeBtn = () => { + // 判断是否被选中 + if (state.isExchange !== -1) { + console.log("去详情") + window.location.href = "./detail.html"; + } else { + if (state.isChecked !== -1) { + + state.showPop = true; + return + + req.axiosPost("/front/order/create", { prize_id: state.isChecked }).then(res => { + if (res.code === 200) { + + } else { + openToast(res.message); + } + }) + } else { + openToast("请选择兑换商品"); + } + } + } + onMounted(() => { const url = new URL(window.location.href); const searchParams = new URLSearchParams(url.search); @@ -240,15 +268,16 @@ state.showPage = true; getGoodsList(); - return getUserInfo(); - + return } else { openToast("未登录"); } }) return { + exchangeBtn, + selectGoods, selectColor, sliceStr, state diff --git a/readme.md b/readme.md index bbea8d2..90c09af 100644 --- a/readme.md +++ b/readme.md @@ -4,3 +4,12 @@ https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/department-of-finance/im https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/department-of-finance/img/ele-box-icon.png 饿了么 https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/department-of-finance/img/aqy-box-icon.png 爱奇艺 https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/department-of-finance/img/wyy-box-icon.png 网易云 + + +logo +https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/department-of-finance/logo/aiqiyi.png 爱奇艺 +https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/department-of-finance/logo/eleme.png 饿了么 +https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/department-of-finance/logo/keep.png keep +https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/department-of-finance/logo/qju.png 青橘 +https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/department-of-finance/logo/txsp.png 腾讯视频 +https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/department-of-finance/logo/wyy.png 网易云 \ No newline at end of file