Kaynağa Gözat

```
feat(subPack-charge): 添加购券中心页面和相关配置

- 新增购券记录页面配置到 pages.json 和 uni-pages.d.ts
- 实现购券中心页面功能,包括导航栏、券列表展示、选择逻辑等
- 添加页面滚动透明度变化效果
- 更新开发环境API地址配置,注释旧地址并启用新地址
- 修复manifest.json文件格式问题
- 在首页添加购券中心入口,优化界面UI组件
```

zouzexu 6 gün önce
ebeveyn
işleme
fd2b6b44ef

+ 2 - 2
src/config/index.ts

@@ -11,9 +11,9 @@ const mapEnvVersion = {
   // develop: 'http://192.168.0.11:8080', // 王
   // develop: 'http://192.168.1.89:8080', // 田
   // develop: 'http://74949mkfh190.vicp.fun', // 付
-  develop: 'http://47.109.84.152:8081',
+  // develop: 'http://47.109.84.152:8081',
   // develop: 'https://5ed0f7cc.r9.vip.cpolar.cn',
-  // develop: 'https://smqjh.api.zswlgz.com',
+  develop: 'https://smqjh.api.zswlgz.com',
   /**
    * 体验版
    */

+ 8 - 0
src/pages.json

@@ -389,6 +389,14 @@
     {
       "root": "subPack-charge",
       "pages": [
+        {
+          "path": "chargeBuyaTicketList/chargeBuyaTicketList",
+          "name": "charge-buy-a-ticket-list",
+          "islogin": false,
+          "style": {
+            "navigationBarTitleText": "购券记录"
+          }
+        },
         {
           "path": "chargeDetail/chargeDetail",
           "name": "charge-detail",

+ 40 - 0
src/subPack-charge/chargeBuyaTicketList/chargeBuyaTicketList.vue

@@ -0,0 +1,40 @@
+<script setup lang="ts">
+definePage({
+  name: 'charge-buy-a-ticket-list',
+  islogin: false,
+  style: {
+    navigationBarTitleText: '购券记录',
+  },
+})
+</script>
+
+<template>
+  <view class="min-h-screen bg-#F5F7FB px-24rpx">
+    <view class="h-10rpx" />
+    <view v-for="item in 6" :key="item" class="mt-20rpx bg-#FFFFFF px-24rpx py-28rpx">
+      <view class="relative flex items-center justify-between">
+        <view class="text-32rpx font-bold">
+          50元充电费抵扣券
+        </view>
+        <view class="absolute right-[-24rpx] rounded-[30rpx_0rpx_0rpx_4rpx] px-14rpx py-8rpx text-28rpx text-#FFF" :class="item % 2 === 0 ? 'bg-#9ED605' : 'bg-#AAA'">
+          • 已到账
+        </view>
+      </view>
+      <view class="mt-28rpx h-2rpx w-full bg-#F0F0F0" />
+      <view class="mt-28rpx">
+        <view class="text-24rpx text-#AAAAAA">
+          订单编号:101121
+        </view>
+        <view class="mt-20rpx text-24rpx text-#AAAAAA">
+          购券时间:2023-10-19022:25:22
+        </view>
+        <view class="mt-20rpx text-24rpx text-#AAAAAA">
+          实付金额:50元
+        </view>
+      </view>
+    </view>
+    <view class="h-20rpx" />
+  </view>
+</template>
+
+<style lang="scss" scoped></style>

+ 96 - 3
src/subPack-charge/chargeVoucher/chargeVoucher.vue

@@ -1,10 +1,103 @@
 <script setup lang="ts">
-definePage({ name: 'charge-voucher', islogin: false, style: { navigationBarTitleText: '', navigationStyle: 'custom' } })
+import router from '@/router'
+import { StaticUrl } from '@/config'
+
+definePage({
+  name: 'charge-voucher',
+  islogin: false,
+  style: {
+    navigationBarTitleText: '',
+    navigationStyle: 'custom',
+  },
+})
+const { statusBarHeight, MenuButtonHeight, opcity } = storeToRefs(useSysStore())
+onMounted(() => {
+  opcity.value = 0
+})
+onPageScroll((e) => {
+  const calculatedOpacity = e.scrollTop / 100
+  opcity.value = Math.min(1, Math.max(0.1, calculatedOpacity))
+})
+
+const selectIndex = ref(0)
+function selectVoucher(index: number) {
+  selectIndex.value = index
+  console.log('Selected voucher index:', index)
+}
 </script>
 
 <template>
-  <view class="">
-    view
+  <view class="min-h-screen" :style="{ backgroundImage: `url(${StaticUrl}/buy-center-bg.png)`, backgroundSize: 'cover', backgroundPosition: 'center' }">
+    <wd-navbar
+      title="购券中心" :custom-style="`background-color: rgba(226, 255, 145, ${opcity})`" :bordered="false"
+      :z-index="99" safe-area-inset-top left-arrow fixed @click-left="router.back()"
+    />
+    <view :style="{ paddingTop: `${(Number(statusBarHeight) || 44) + MenuButtonHeight + 12}px` }" class="px24rpx">
+      <view class="h-342rpx" />
+      <view class="relative rounded-16rpx from-[#E1FF90] via-[#FAFFEE] to-[#FFFFFF] bg-gradient-to-b p-12rpx">
+        <image
+          class="absolute right-12rpx top-12rpx h-144rpx w-144rpx"
+          :src="`${StaticUrl}/buy-center-cardIcon.png`"
+          mode="scaleToFill"
+        />
+        <view class="mt-16rpx text-center">
+          <view class="text-28rpx">
+            平台券金额
+          </view>
+          <view class="mt-16rpx text-28rpx font-800">
+            100<text class="text-24rpx">
+              元
+            </text>
+          </view>
+        </view>
+        <view class="mb-16rpx mt-28rpx flex items-center justify-around text-28rpx">
+          <view @click="router.push({ name: 'charge-buy-a-ticket-list' })">
+            充值记录
+          </view>
+          <view class="h-40rpx w-2rpx bg-#E6E6E6" />
+          <view @click="router.push({ name: 'charge-buy-a-ticket-list' })">
+            退款
+          </view>
+        </view>
+      </view>
+      <view class="mt-20rpx">
+        <view class="text-32rpx font-bold">
+          本次充值
+        </view>
+        <view class="mt-24rpx flex flex-wrap items-center justify-start gap-20rpx">
+          <view v-for="(item, index) in 6" :key="index" class="h-136rpx w-220rpx text-center" :class="selectIndex === index ? 'text-[#9ED605]' : 'text-#2B303Ac'" :style="{ backgroundImage: `url(${StaticUrl}/${selectIndex === index ? 'buy-center-rechargesel' : 'buy-center-recharge'}.png)`, backgroundSize: 'cover', backgroundPosition: 'center' }" @click="selectVoucher(index)">
+            <view class="h-80rpx text-28rpx font-bold line-height-[80rpx]">
+              10<text class="text-24rpx">
+                元
+              </text>
+            </view>
+            <view class="h-46rpx text-28rpx font-bold line-height-[46rpx] font-italic">
+              充电优惠券
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="mt-24rpx">
+        <view class="font-bold">
+          温馨提示
+        </view>
+        <view class="mt-24rpx text-24rpx text-#AAAAAA">
+          <view>1.平台券仅限本平台使用,不可转赠和出售。</view>
+          <view class="mt-20rpx">
+            2.平台券仅可用于本平台充电服务,若订单金额超过平台券余额,
+            需补足差价;若余额有剩余,可留存下次使用;剩余平台券余额支
+            持手动退款。
+          </view>
+          <view class="mt-20rpx">
+            3.平台保留调整平台券使用规则的权利,调整前将提前公告。
+            如有疑问,请联系客服。
+          </view>
+        </view>
+      </view>
+      <view class="fixed bottom-66rpx left-24rpx h-100rpx w-702rpx rounded-16rpx bg-[linear-gradient(90deg,#DBFC81_0%,#9ED605_100%)] text-center text-28rpx font-800 line-height-[100rpx] shadow-[inset_0rpx_6rpx_20rpx_2rpx_#FFFFFF]">
+        立即支付
+      </view>
+    </view>
   </view>
 </template>
 

+ 16 - 4
src/subPack-charge/index/index.vue

@@ -117,9 +117,13 @@ function handleFilterClick(filterKey: number) {
         </view>
         <view class="mt-20rpx rounded-16rpx bg-#F3FFD1 px-24rpx py-30rpx">
           <view class="relative flex items-center justify-between">
-            <view class="flex items-center gap-30rpx">
+            <view class="flex items-center gap-16rpx">
               <view class="h-40rpx w-40rpx">
-                icon
+                <image
+                  class="h-40rpx w-40rpx"
+                  :src="`${StaticUrl}/charge-mine-wallet.png`"
+                  mode="scaleToFill"
+                />
               </view>
               <view class="text-32rpx font-bold">
                 我的钱包
@@ -168,7 +172,11 @@ function handleFilterClick(filterKey: number) {
             </view>
           </view>
           <view class="h-100rpx w-100rpx">
-            icon
+            <image
+              class="h-100rpx w-100rpx"
+              :src="`${StaticUrl}/charge-mine-order.png`"
+              mode="scaleToFill"
+            />
           </view>
         </view>
         <view class="flex items-center gap-18rpx rounded-16rpx bg-#FFF px-24rpx py-28rpx" @click="router.push({ name: 'charge-voucher' })">
@@ -186,7 +194,11 @@ function handleFilterClick(filterKey: number) {
             </view>
           </view>
           <view class="h-100rpx w-100rpx">
-            icon
+            <image
+              class="h-100rpx w-100rpx"
+              :src="`${StaticUrl}/charge-mine-voucher.png`"
+              mode="scaleToFill"
+            />
           </view>
         </view>
       </view>

+ 1 - 0
src/uni-pages.d.ts

@@ -35,6 +35,7 @@ interface NavigateToOptions {
        "/subPack-film/order-detail/index" |
        "/subPack-film/select-time/index" |
        "/subPack-film/submit-order/index" |
+       "/subPack-charge/chargeBuyaTicketList/chargeBuyaTicketList" |
        "/subPack-charge/chargeDetail/chargeDetail" |
        "/subPack-charge/chargeing/chargeing" |
        "/subPack-charge/chargeMap/chargeMap" |