Explorar o código

feat(api): 更新API配置和接口定义

- 修改开发和测试环境的API基础URL为本地IP地址
- 更新alova配置中的OpenAPI文档输入源
- 替换原有的PetStore API定义为新的会员优惠券相关API
- 更新全局类型定义文件以匹配新的API结构
- 添加隐藏滚动条样式和iOS安全区域适配
- 注册用户存储和新增组件到自动导入列表中
zhangtao hai 1 semana
pai
achega
f455e0f82f

+ 1 - 1
.env.development

@@ -2,7 +2,7 @@
 # 在开发模式下使用 (npm run dev)
 
 # API 基础 URL - 开发环境
-VITE_API_BASE_URL=https://petstore3.swagger.io/api/v3
+VITE_API_BASE_URL=http://192.168.0.11:8080
 
 # 静态资源基础 URL - 测试环境
 VITE_STATIC_BASE_URL=https://zswl-smqjh.oss-cn-chengdu.aliyuncs.com/static/static

+ 1 - 1
.env.staging

@@ -2,7 +2,7 @@
 # 在测试环境构建时使用
 
 # API 基础 URL - 测试环境
-VITE_API_BASE_URL=https://staging-api.yourapp.com
+VITE_API_BASE_URL=http://192.168.0.11:8080
 
 
 # 静态资源基础 URL - 测试环境

+ 1 - 1
alova.config.ts

@@ -13,7 +13,7 @@ export default <Config>{
        * 1. openapi json file url
        * 2. local file
        */
-      // input: 'https://petstore3.swagger.io/api/v3/openapi.json',
+      input: 'http://127.0.0.1:4523/export/openapi/4?version=2.0',
       /**
        * input file platform. Currently only swagger is supported.
        * When this parameter is specified, the input field only needs to specify the document address without specifying the openapi file

+ 12 - 0
src/App.vue

@@ -14,4 +14,16 @@ onLaunch(() => {})
 .wot-theme-dark.page-wraper {
   background: #222;
 }
+/* 隐藏滚动条安卓机会出现滚动条 */
+::-webkit-scrollbar {
+  display: none;
+  width: 0;
+  height: 0;
+  color: transparent;
+}
+
+.ios {
+  padding-bottom: constant(safe-area-inset-bottom);
+  padding-bottom: env(safe-area-inset-bottom);
+}
 </style>

+ 10 - 30
src/api/apiDefinitions.ts

@@ -2,20 +2,12 @@
 /* tslint:disable */
 /* eslint-disable */
 /**
- * Swagger Petstore - OpenAPI 3.0 - version 1.0.27
+ * smjqh-reful - version 1.0.0
  *
- * This is a sample Pet Store Server based on the OpenAPI 3.0 specification.  You can find out more about
-Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we&#x27;ve switched to the design first approach!
-You can now help us improve the API whether it&#x27;s by making changes to the definition itself or to the code.
-That way, with time, we can improve the API in general, and expose some of the new features in OAS3.
-
-Some useful links:
-- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)
-- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
  *
- * OpenAPI version: 3.0.4
  *
- * Contact: 
+ * OpenAPI version: 3.0.0
+ *
  *
  * NOTE: This file is auto generated by the alova's vscode plugin.
  *
@@ -24,23 +16,11 @@ Some useful links:
  * **Do not edit the file manually.**
  */
 export default {
-  'pet.updatePet': ['PUT', '/pet'],
-  'pet.addPet': ['POST', '/pet'],
-  'pet.findPetsByStatus': ['GET', '/pet/findByStatus'],
-  'pet.findPetsByTags': ['GET', '/pet/findByTags'],
-  'pet.getPetById': ['GET', '/pet/{petId}'],
-  'pet.updatePetWithForm': ['POST', '/pet/{petId}'],
-  'pet.deletePet': ['DELETE', '/pet/{petId}'],
-  'pet.uploadFile': ['POST', '/pet/{petId}/uploadImage'],
-  'store.getInventory': ['GET', '/store/inventory'],
-  'store.placeOrder': ['POST', '/store/order'],
-  'store.getOrderById': ['GET', '/store/order/{orderId}'],
-  'store.deleteOrder': ['DELETE', '/store/order/{orderId}'],
-  'user.createUser': ['POST', '/user'],
-  'user.createUsersWithListInput': ['POST', '/user/createWithList'],
-  'user.loginUser': ['GET', '/user/login'],
-  'user.logoutUser': ['GET', '/user/logout'],
-  'user.getUserByName': ['GET', '/user/{username}'],
-  'user.updateUser': ['PUT', '/user/{username}'],
-  'user.deleteUser': ['DELETE', '/user/{username}']
+  'app.get_smqjh_system_app_api_membercoupon_page': ['GET', '/smqjh-system/app-api/memberCoupon/page'],
+  'app.get_smqjh_system_app_api_membercoupon_findbyid': ['GET', '/smqjh-system/app-api/memberCoupon/findById'],
+  'app.get_smqjh_system_app_api_coupon_page': ['GET', '/smqjh-system/app-api/coupon/page'],
+  'app.get_smqjh_system_app_api_coupon_findbyid': ['GET', '/smqjh-system/app-api/coupon/findById'],
+  'app.get_smqjh_system_app_api_coupon_exchangeinfo': ['GET', '/smqjh-system/app-api/coupon/exchangeInfo'],
+  'app.get_smqjh_system_app_api_coupon_exchangepoints': ['GET', '/smqjh-system/app-api/coupon/exchangePoints'],
+  'general.post_smqjh_auth_oauth2_token': ['POST', '/smqjh-auth/oauth2/token']
 };

+ 1 - 3
src/api/core/instance.ts

@@ -1,13 +1,11 @@
 import AdapterUniapp from '@alova/adapter-uniapp'
 import { createAlova } from 'alova'
 import vueHook from 'alova/vue'
-import mockAdapter from '../mock/mockAdapter'
 import { handleAlovaError, handleAlovaResponse } from './handlers'
 
 export const alovaInstance = createAlova({
-  baseURL: import.meta.env.VITE_API_BASE_URL || 'https://petstore3.swagger.io/api/v3',
+  baseURL: import.meta.env.VITE_API_BASE_URL,
   ...AdapterUniapp({
-    mockRequest: mockAdapter,
   }),
   statesHook: vueHook,
   beforeRequest: (method) => {

+ 3 - 11
src/api/createApis.ts

@@ -1,20 +1,12 @@
 /* tslint:disable */
 /* eslint-disable */
 /**
- * Swagger Petstore - OpenAPI 3.0 - version 1.0.27
+ * smjqh-reful - version 1.0.0
+ *
  *
- * This is a sample Pet Store Server based on the OpenAPI 3.0 specification.  You can find out more about
-Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we&#x27;ve switched to the design first approach!
-You can now help us improve the API whether it&#x27;s by making changes to the definition itself or to the code.
-That way, with time, we can improve the API in general, and expose some of the new features in OAS3.
-
-Some useful links:
-- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)
-- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
  *
- * OpenAPI version: 3.0.4
+ * OpenAPI version: 3.0.0
  *
- * Contact: 
  *
  * NOTE: This file is auto generated by the alova's vscode plugin.
  *

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 507 - 477
src/api/globals.d.ts


+ 2 - 0
src/auto-imports.d.ts

@@ -317,6 +317,7 @@ declare global {
   const useTransition: typeof import('@vueuse/core')['useTransition']
   const useUrlSearchParams: typeof import('@vueuse/core')['useUrlSearchParams']
   const useUserMedia: typeof import('@vueuse/core')['useUserMedia']
+  const useUserStore: typeof import('./store/user')['useUserStore']
   const useVModel: typeof import('@vueuse/core')['useVModel']
   const useVModels: typeof import('@vueuse/core')['useVModels']
   const useVibrate: typeof import('@vueuse/core')['useVibrate']
@@ -666,6 +667,7 @@ declare module 'vue' {
     readonly useTransition: UnwrapRef<typeof import('@vueuse/core')['useTransition']>
     readonly useUrlSearchParams: UnwrapRef<typeof import('@vueuse/core')['useUrlSearchParams']>
     readonly useUserMedia: UnwrapRef<typeof import('@vueuse/core')['useUserMedia']>
+    readonly useUserStore: UnwrapRef<typeof import('./store/user')['useUserStore']>
     readonly useVModel: UnwrapRef<typeof import('@vueuse/core')['useVModel']>
     readonly useVModels: UnwrapRef<typeof import('@vueuse/core')['useVModels']>
     readonly useVibrate: UnwrapRef<typeof import('@vueuse/core')['useVibrate']>

+ 8 - 0
src/components.d.ts

@@ -8,16 +8,24 @@ export {}
 declare module 'vue' {
   export interface GlobalComponents {
     DemoBlock: typeof import('./components/DemoBlock.vue')['default']
+    FixedLayout: typeof import('./components/FixedLayout.vue')['default']
     GlobalLoading: typeof import('./components/GlobalLoading.vue')['default']
     GlobalMessage: typeof import('./components/GlobalMessage.vue')['default']
     GlobalToast: typeof import('./components/GlobalToast.vue')['default']
     PrivacyPopup: typeof import('./components/PrivacyPopup.vue')['default']
+    WdButton: typeof import('wot-design-uni/components/wd-button/wd-button.vue')['default']
     WdConfigProvider: typeof import('wot-design-uni/components/wd-config-provider/wd-config-provider.vue')['default']
     WdGap: typeof import('wot-design-uni/components/wd-gap/wd-gap.vue')['default']
+    WdIcon: typeof import('wot-design-uni/components/wd-icon/wd-icon.vue')['default']
     WdMessageBox: typeof import('wot-design-uni/components/wd-message-box/wd-message-box.vue')['default']
     WdNotify: typeof import('wot-design-uni/components/wd-notify/wd-notify.vue')['default']
+    WdPopup: typeof import('wot-design-uni/components/wd-popup/wd-popup.vue')['default']
+    WdRadio: typeof import('wot-design-uni/components/wd-radio/wd-radio.vue')['default']
+    WdRadioGroup: typeof import('wot-design-uni/components/wd-radio-group/wd-radio-group.vue')['default']
+    WdSticky: typeof import('wot-design-uni/components/wd-sticky/wd-sticky.vue')['default']
     WdTabbar: typeof import('wot-design-uni/components/wd-tabbar/wd-tabbar.vue')['default']
     WdTabbarItem: typeof import('wot-design-uni/components/wd-tabbar-item/wd-tabbar-item.vue')['default']
     WdToast: typeof import('wot-design-uni/components/wd-toast/wd-toast.vue')['default']
+    Zpopup: typeof import('./components/Zpopup.vue')['default']
   }
 }

+ 15 - 0
src/components/FixedLayout.vue

@@ -0,0 +1,15 @@
+<script setup lang="ts">
+
+</script>
+
+<template>
+  <view class="ios fixed bottom-0 box-border w-full bg-white px24rpx">
+    <view class="pb20rpx pt10rpx">
+      <slot />
+    </view>
+  </view>
+</template>
+
+<style scoped>
+
+</style>

+ 28 - 0
src/components/Zpopup.vue

@@ -0,0 +1,28 @@
+<script setup lang="ts">
+withDefaults(defineProps<{
+  bg?: string
+  showfooter?: boolean
+  zindex?: number
+}>(), {
+  bg: '#f6f6f6',
+  showfooter: true,
+  zindex: 999,
+})
+const show = defineModel({ default: false })
+</script>
+
+<template>
+  <wd-popup v-model="show" lock-scroll custom-style="border-radius:32rpx;32rpx 0rpx 0rpx" :z-index="zindex" position="bottom">
+    <view :style="{ background: bg }">
+      <slot />
+      <view v-if="showfooter" class="h150rpx" />
+      <view v-if="showfooter" class="ios footer fixed bottom-0 left-0 box-border w-full rounded-t-32rpx bg-white px24rpx pt20rpx">
+        <slot name="footer" />
+      </view>
+    </view>
+  </wd-popup>
+</template>
+
+<style scoped>
+
+</style>

+ 25 - 4
src/pages.json

@@ -5,24 +5,45 @@
       "name": "home",
       "layout": "tabbar",
       "style": {
-        "navigationBarTitleText": "加油"
+        "navigationBarTitleText": "加油",
+        "navigationStyle": "custom"
+      }
+    },
+    {
+      "path": "pages/confirmOrder/index",
+      "name": "confimOrder",
+      "islogin": true,
+      "style": {
+        "navigationBarTitleText": "下单",
+        "navigationStyle": "custom"
       }
     },
     {
       "path": "pages/order/index",
       "name": "order",
-      "islogin": false,
+      "islogin": true,
       "style": {
-        "navigationBarTitleText": "订单"
+        "navigationBarTitleText": "订单",
+        "navigationStyle": "custom"
       },
       "layout": "tabbar"
     },
+    {
+      "path": "pages/refuelDetaile/index",
+      "name": "refuelDetaile",
+      "islogin": false,
+      "style": {
+        "navigationBarTitleText": "加油站详情",
+        "navigationStyle": "custom"
+      }
+    },
     {
       "path": "pages/voucher/index",
       "name": "voucher",
       "layout": "tabbar",
       "style": {
-        "navigationBarTitleText": "抵扣卷"
+        "navigationBarTitleText": "抵扣卷",
+        "navigationStyle": "custom"
       }
     }
   ],

+ 230 - 0
src/pages/confirmOrder/index.vue

@@ -0,0 +1,230 @@
+<script setup lang="ts">
+definePage({ name: 'confimOrder', islogin: true, style: { navigationBarTitleText: '下单', navigationStyle: 'custom' } })
+const showModel = ref(false)
+const refuelNumber = ref()
+const refuelGun = ref()
+const showModelJf = ref(false)
+const selectDk = ref()
+</script>
+
+<template>
+  <view class="p24rpx">
+    <view class="rounded-16rpx bg-white px24rpx py28rpx">
+      <view class="text-36rpx font-semibold">
+        中国石化 | 富源加油站
+      </view>
+      <view class="mt20rpx text-#aaa">
+        西湖区文三路100号
+      </view>
+      <view class="my24rpx h2rpx w-full bg-#F0F0F0" />
+      <view class="flex items-center justify-between">
+        <view class="text-#ff4d3a font-semibold">
+          平台价
+        </view>
+        <view class="text-#aaa">
+          门店价:¥7.60/L
+        </view>
+      </view>
+      <view class="mt16rpx flex items-center justify-between">
+        <view class="text-32rpx text-#ff4d3a font-semibold">
+          ¥6.45/L
+        </view>
+        <view class="text-#aaa">
+          国标价:¥7.20/L
+        </view>
+      </view>
+    </view>
+    <view class="mt20rpx rounded-16rpx bg-white px24rpx py28rpx">
+      <view class="text-28rpx font-semibold">
+        选择油号/油枪
+      </view>
+      <view class="mt24rpx flex items-center" @click="showModel = true">
+        <view class="relative w47% rounded-8rpx bg-#F9F9F9 px24rpx py20rpx">
+          <view class="text-center text-28rpx font-semibold">
+            请选择油号
+          </view>
+          <view class="absolute right-24rpx top-50% h32rpx w32rpx -transform-translate-y-50%">
+            <wd-icon name="arrow-down" size="32rpx" />
+          </view>
+        </view>
+        <view class="relative ml18rpx w47% rounded-8rpx bg-#F9F9F9 px24rpx py20rpx">
+          <view class="text-center text-28rpx font-semibold">
+            请选择油枪
+          </view>
+          <view class="absolute right-24rpx top-50% h32rpx w32rpx -transform-translate-y-50%">
+            <wd-icon name="arrow-down" size="32rpx" />
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="mt20rpx rounded-16rpx bg-white px24rpx py28rpx">
+      <view class="text-28rpx font-semibold">
+        加油金额
+      </view>
+      <view class="mt20rpx bg-#F9F9F9 px24rpx py20rpx">
+        <input type="number" class="w-full" placeholder="请输入加油金额,优惠价格计算">
+      </view>
+      <view class="mt20rpx text-#ff4d3a">
+        最小金额10元
+      </view>
+    </view>
+    <view class="mt20rpx rounded-16rpx bg-white px24rpx py28rpx">
+      <view class="flex items-center">
+        <view class="mr20rpx text-28rpx font-semibold">
+          抵扣券
+        </view>
+        <wd-button size="small">
+          去兑换
+        </wd-button>
+      </view>
+      <view class="mt24rpx flex items-center justify-between rounded-8rpx bg-#F9F9F9 px24rpx py20rpx" @click="showModelJf = true">
+        <view class="text-28rpx text-#aaa">
+          暂无抵扣券
+        </view>
+        <wd-icon name="arrow-down" size="32rpx" color="#aaa" />
+      </view>
+      <view class="mt16rpx">
+        已选:满200元可抵扣100元(最优)
+      </view>
+      <view class="mt16rpx">
+        抵扣金额:-¥100
+      </view>
+      <view class="mb20rpx mt24rpx text-32rpx font-semibold">
+        价格明细
+      </view>
+      <view class="flex items-center justify-between text-28rpx">
+        <view class="text-#aaa">
+          加油金额
+        </view>
+        <view>¥200.00</view>
+      </view>
+      <view class="mt20rpx flex items-center justify-between text-28rpx">
+        <view class="text-#aaa">
+          抵扣券
+        </view>
+        <view>-¥100</view>
+      </view>
+      <view class="mt20rpx flex items-center justify-between text-28rpx">
+        <view class="text-#aaa">
+          服务费
+        </view>
+        <view>+¥1.00</view>
+      </view>
+
+      <view class="my24rpx h2rpx w-full bg-#F0F0F0" />
+      <view class="flex items-center justify-between text-28rpx">
+        <view class="text-#aaa">
+          实付金额
+        </view>
+        <view class="text-#ff4d3a font-semibold">
+          ¥200.00
+        </view>
+      </view>
+    </view>
+  </view>
+  <view class="h200rpx" />
+  <Zpopup v-model="showModel" bg="#fff">
+    <view class="px24rpx py28rpx">
+      <view class="text-center text-32rpx font-semibold">
+        选择油号油枪
+      </view>
+      <view class="mb20rpx text-32rpx font-semibold">
+        油号
+      </view>
+      <wd-radio-group v-model="refuelNumber" shape="button">
+        <wd-radio :value="1">
+          92#
+        </wd-radio>
+        <wd-radio :value="2">
+          95#
+        </wd-radio>
+      </wd-radio-group>
+      <view class="mb20rpx mt20rpx text-32rpx font-semibold">
+        油号
+      </view>
+      <wd-radio-group v-model="refuelGun" shape="button">
+        <wd-radio :value="1">
+          1
+        </wd-radio>
+        <wd-radio :value="2">
+          2
+        </wd-radio>
+      </wd-radio-group>
+    </view>
+    <view class="h200rpx" />
+    <template #footer>
+      <view class="text-center text-28rpx text-#ff4d3a">
+        请与加油员确认油枪号
+      </view>
+      <view class="my24rpx h2rpx w-full bg-#F0F0F0" />
+      <wd-button block size="large">
+        确认
+      </wd-button>
+    </template>
+  </Zpopup>
+  <Zpopup v-model="showModelJf" bg="#fff">
+    <view class="px24rpx py28rpx">
+      <view class="mb24rpx text-center text-32rpx font-semibold">
+        选择抵扣券
+      </view>
+      <wd-radio-group v-model="selectDk" shape="dot">
+        <view class="flex items-center justify-between">
+          <view class="text-28rpx">
+            不使用抵扣券
+          </view>
+          <wd-radio :value="1" />
+        </view>
+        <view class="mt24rpx">
+          <view class="text-28rpx">
+            自动推荐
+          </view>
+          <view class="relative mt20rpx box-border h144rpx flex items-center justify-between rounded-16rpx bg-[rgba(255,77,58,0.1)] px28rpx py24rpx">
+            <view class="flex-1">
+              <view class="flex items-center">
+                <view class="text-40rpx text-#ff4d3a font-semibold">
+                  <text class="text-24rpx">
+                    ¥
+                  </text> 100
+                </view>
+                <view class="ml20rpx text-32rpx font-semibold">
+                  满200元可用
+                </view>
+              </view>
+              <view class="mt24rpx flex items-center text-#aaa">
+                <view class="text-center text-20rpx">
+                  可抵扣
+                </view>
+                <view class="ml20rpx text-24rpx font-semibold">
+                  有效期:2022-01-01至2022-01-01
+                </view>
+              </view>
+            </view>
+            <view class="h-full w134rpx flex items-center justify-center border-l-2rpx border-l-#FF4D3A border-l-dashed">
+              <wd-radio :value="1" />
+            </view>
+            <view class="absolute right-150rpx h30rpx w30rpx rounded-full bg-white -top-10rpx" />
+            <view class="absolute right-150rpx h30rpx w30rpx rounded-full bg-white -bottom-10rpx" />
+          </view>
+        </view>
+      </wd-radio-group>
+    </view>
+    <view class="h200rpx" />
+    <template #footer>
+      <view class="my24rpx h2rpx w-full bg-#F0F0F0" />
+      <wd-button block size="large">
+        确认选择
+      </wd-button>
+    </template>
+  </Zpopup>
+  <FixedLayout>
+    <wd-button block size="large">
+      立即支付
+    </wd-button>
+  </FixedLayout>
+</template>
+
+<style lang="scss" scoped>
+:deep(.wd-radio){
+  margin-top: 0 !important;
+}
+</style>

+ 22 - 7
src/pages/index/index.vue

@@ -1,10 +1,13 @@
 <script setup lang="ts">
+import router from '@/router'
+
 definePage({
   name: 'home',
   layout: 'tabbar',
   type: 'home',
   style: {
     navigationBarTitleText: '加油',
+    navigationStyle: 'custom',
   },
 })
 const staticUrl = import.meta.env.VITE_STATIC_BASE_URL
@@ -13,6 +16,11 @@ const tabList = ref([
   { label: '价格从低到高', value: 2 },
 ])
 const currentTab = ref(1)
+function handleView(_item: any) {
+  router.push({
+    name: 'refuelDetaile',
+  })
+}
 </script>
 
 <template>
@@ -20,12 +28,15 @@ const currentTab = ref(1)
     <view class="w132rpx">
       轮播图展位
     </view>
-    <view class="mt20rpx flex items-center">
-      <view v-for="item in tabList" :key="item.value" class="mr28rpx rounded-24rpx px16rpx py8rpx text-24rpx" :class="[currentTab === item.value ? 'bg-[var(--them-color)] text-white ' : 'bg-white']" @click="currentTab = item.value">
-        {{ item.label }}
+    <wd-sticky :offset-top="-44">
+      <view class="w-100vw flex items-center bg-#f9f9f9 pb20rpx pt20rpx">
+        <view v-for="item in tabList" :key="item.value" class="mr28rpx rounded-24rpx px16rpx py8rpx text-24rpx" :class="[currentTab === item.value ? 'bg-[var(--them-color)] text-white ' : 'bg-white']" @click="currentTab = item.value">
+          {{ item.label }}
+        </view>
       </view>
-    </view>
-    <view v-for="item in 10" :key="item" class="relative mt20rpx rounded-16rpx bg-white p24rpx">
+    </wd-sticky>
+
+    <view v-for="item in 10" :key="item" class="relative mb20rpx rounded-16rpx bg-white p24rpx" @click="handleView(item)">
       <view class="mt80rpx flex items-center justify-between">
         <view class="text-36rpx font-semibold">
           中国石化 | 富源加油站
@@ -44,11 +55,11 @@ const currentTab = ref(1)
             满200前100升半价
           </view>
         </view>
-        <view class="flex items-center">
+        <view class="flex items-end">
           <view class="text-28rpx">
             92#
           </view>
-          <view class="mx8rpx ml12rpx flex items-center text-#ff4d3a">
+          <view class="mx8rpx ml12rpx flex items-end text-#ff4d3a">
             特惠价 <view class="font-semibold">
               <text class="text-20rpx">
@@ -61,5 +72,9 @@ const currentTab = ref(1)
       </view>
       <image :src="`${staticUrl}/smqjh-jy-cz.png`" class="absolute left-0 top-0 h80rpx w234rpx" />
     </view>
+    <image
+      :src="`${staticUrl}/smqjh-jy-dkj.png`"
+      class="fixed bottom-524rpx right-24rpx h114rpx w124rpx"
+    />
   </view>
 </template>

+ 1 - 1
src/pages/order/index.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-definePage({ name: 'order', islogin: false, style: { navigationBarTitleText: '订单' }, layout: 'tabbar' })
+definePage({ name: 'order', islogin: true, style: { navigationBarTitleText: '订单', navigationStyle: 'custom' }, layout: 'tabbar' })
 </script>
 
 <template>

+ 175 - 0
src/pages/refuelDetaile/index.vue

@@ -0,0 +1,175 @@
+<script setup lang="ts">
+import router from '@/router'
+
+definePage({ name: 'refuelDetaile', islogin: false, style: { navigationBarTitleText: '加油站详情', navigationStyle: 'custom' } })
+const StaticUrl = import.meta.env.VITE_STATIC_BASE_URL
+const showModel = ref(false)
+</script>
+
+<template>
+  <view class="p24rpx">
+    <view class="h336rpx">
+      轮播占位ie
+    </view>
+    <view class="mt20rpx h160rpx flex items-center justify-between rounded-16rpx bg-white bg-cover bg-center px24rpx" :style="{ backgroundImage: `url(${StaticUrl}/djk-shop-nav-bg.png)` }">
+      <view>
+        <view class="flex items-center text-36rpx font-semibold">
+          中国石化 | 富源加油站
+        </view>
+        <view class="mt20rpx text-#aaa">
+          西湖区文三路100号
+        </view>
+      </view>
+      <view class="flex items-center">
+        <view class="mr40rpx flex flex-col items-center justify-center">
+          <image
+            :src="`${StaticUrl}/djk-shop-dh.png`"
+            class="h40rpx w40rpx"
+          />
+          <view class="mt20rpx text-28rpx">
+            导航
+          </view>
+        </view>
+        <view class="flex flex-col items-center justify-center">
+          <image
+            :src="`${StaticUrl}/smqjh-jy-kf.png`"
+            class="h40rpx w40rpx"
+          />
+          <view class="mt20rpx text-28rpx">
+            电话
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="mt20rpx rounded-16rpx bg-white px24rpx py28rpx">
+      <view class="flex items-center">
+        <wd-icon name="check-circle-filled" size="22px" color="#52C41A" />
+        <view class="ml20rpx text-28rpx font-semibold">
+          本站可用抵扣券
+        </view>
+      </view>
+      <view class="mt24rpx flex overflow-x-scroll">
+        <view v-for="item in 10" :key="item" class="jf-box mr16rpx flex-shrink-0 rounded-16rpx p20rpx">
+          <view class="text-center text-36rpx text-#FF4D3A font-semibold">
+            <text class="text-20rpx">
+              ¥
+            </text> 50
+          </view>
+          <view class="my8rpx text-center">
+            无门槛使用
+          </view>
+          <view class="rounded-26rpx bg-#FF4A39 px24rpx py6rpx text-center text-white" @click="showModel = true">
+            积分兑换
+          </view>
+        </view>
+      </view>
+    </view>
+    <view v-for="item in 10" :key="item" class="mt20rpx rounded-16rpx bg-white px24rpx py28rpx">
+      <view class="flex items-center justify-between">
+        <view class="text-32rpx font-semibold">
+          92#汽油
+        </view>
+        <view class="text-36rpx text-#FF4D3A">
+          <text class="text-20rpx">
+            平台价:
+          </text> ¥6.45/L
+        </view>
+      </view>
+      <view class="text-end text-#aaa">
+        国标价:¥7.20/L 门店价:¥7.60L
+      </view>
+      <view class="mt24rpx w-fit flex items-center rounded-8rpx bg-#FF4A39 px12rpx py8rpx">
+        <image :src="`${StaticUrl}/smqjh-jy-idicon.png`" class="h30rpx w30rpx" />
+        <view class="text-22rpx text-white">
+          满200前100升半价
+        </view>
+      </view>
+      <view class="mt18rpx text-#aaa">
+        (加油满200原可享前10升优惠价格)
+      </view>
+      <view class="mt20rpx">
+        枪号:1,2,3,4,5
+      </view>
+    </view>
+    <view class="h200rpx" />
+  </view>
+  <FixedLayout>
+    <wd-button block size="large" @click="router.push({ name: 'confimOrder' })">
+      立即加油
+    </wd-button>
+  </FixedLayout>
+  <Zpopup v-model="showModel" bg="#fff">
+    <view class="px24rpx py28rpx">
+      <view class="text-center text-32rpx font-semibold">
+        积分兑换
+      </view>
+      <view class="mt20rpx flex items-center">
+        <view class="jf-box mr16rpx flex-shrink-0 rounded-16rpx p20rpx">
+          <view class="text-center text-48rpx text-#FF4D3A font-semibold">
+            ¥ 50
+          </view>
+          <view class="my8rpx text-center">
+            满20元可用
+          </view>
+        </view>
+        <view class="ml20rpx">
+          <view class="text-32rpx font-semibold">
+            兑换需50积分
+          </view>
+          <view class="text-#aaa">
+            <view class="mt10rpx">
+              已兑换:232/1000
+            </view>
+            <view class="mt10rpx">
+              兑换期截至:2026-07-06 23:59:59
+            </view>
+            <view class="mt10rpx">
+              使用有效期:兑换后15天有效
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="my24rpx h2rpx w-full bg-#F0F0F0" />
+      <view class="text-28rpx font-semibold">
+        使用规则:
+      </view>
+      <view class="text-#aaa">
+        <view class="mt20rpx">
+          ·订单满20元可用
+        </view>
+        <view class="mt20rpx">
+          ·每单限用1张,不与其他优惠同享
+        </view>
+        <view class="mt20rpx">
+          ·兑换成功后,不可再逆兑换成积分
+        </view>
+      </view>
+      <view class="mt24rpx text-28rpx font-semibold">
+        适用油站:
+      </view>
+      <view class="text-#aaa">
+        <view class="mt20rpx flex items-center">
+          <wd-icon name="check-circle-filled" size="30rpx" color="#52C41A" class="mr10rpx" /> 全部合作油站
+        </view>
+        <view class="mt20rpx flex items-center">
+          <wd-icon name="close-circle-filled" size="30rpx" color="#FF4A39" class="mr10rpx" /> 部分特殊油站不可用
+        </view>
+      </view>
+    </view>
+    <FixedLayout>
+      <view class="my24rpx h2rpx w-full bg-#F0F0F0" />
+      <view class="box-border w-full flex items-center justify-end gap20rpx px24rpx">
+        <wd-button type="info" @click="showModel = false">
+          取消
+        </wd-button>
+        <wd-button>确认兑换</wd-button>
+      </view>
+    </FixedLayout>
+  </Zpopup>
+</template>
+
+<style lang="scss" scoped>
+.jf-box{
+  background: linear-gradient( 180deg, #FFC2BC 0%, rgba(255,238,238,0.16) 57.27%, #FFEFEF 100%);
+}
+</style>

+ 1 - 0
src/pages/voucher/index.vue

@@ -4,6 +4,7 @@ definePage({
   layout: 'tabbar',
   style: {
     navigationBarTitleText: '抵扣卷',
+    navigationStyle: 'custom',
   },
 })
 </script>

+ 4 - 32
src/router/index.ts

@@ -37,14 +37,9 @@ const router = createRouter({
 // }
 router.beforeEach((to, from, next) => {
   console.log('🚀 beforeEach 守卫触发:', { to, from }, '')
-  // const { token, redirectName } = storeToRefs(useUserStore())
-  // if (to.name === 'smqjh-login') {
-  //   redirectName.value = appendParamsToPath(String(from.path), from.params as any)
-  //   console.log(redirectName.value, ' redirectName.value')
-  // }
+  // const { token } = storeToRefs(useUserStore())
   // if (!whitePathName().includes(to.name) && !token.value) {
-  //   const { confirm: showConfirm } = useGlobalMessage()
-
+  //   const { confirm: showConfirm, close } = useGlobalMessage()
   //   return new Promise<void>((resolve, reject) => {
   //     showConfirm({
   //       title: '警告',
@@ -52,10 +47,10 @@ router.beforeEach((to, from, next) => {
   //       confirmButtonText: '登录',
   //       cancelButtonText: '取消',
   //       success() {
-  //         redirectName.value = String(to.path)
   //         // console.log('✅ 用户确认访问,允许导航')
-  //         router.replace({ name: 'smqjh-login' })
   //         // resolve()
+  //         close()
+  //         useUserStore().wxAuthLogin()
   //       },
   //       fail() {
   //         // console.log('❌ 用户取消访问,阻止导航')
@@ -84,26 +79,3 @@ router.afterEach((to, from) => {
 })
 
 export default router
-/**
- * 将 params 参数拼接到 path 路径后面
- * @param path 基础路径
- * @param params 参数对象
- * @returns 拼接后的完整路径
- */
-// function appendParamsToPath(path: string, params: Record<string, any>): string {
-//   if (!params || Object.keys(params).length === 0) {
-//     return path
-//   }
-//   const queryParams: string[] = []
-//   Object.entries(params).forEach(([key, value]) => {
-//     if (value !== undefined && value !== null) {
-//       // 对参数进行 URL 编码
-//       const encodedKey = encodeURIComponent(key)
-//       const encodedValue = encodeURIComponent(String(value))
-//       queryParams.push(`${encodedKey}=${encodedValue}`)
-//     }
-//   })
-
-//   const queryString = queryParams.join('&')
-//   return queryString ? `${path}?${queryString}` : path
-// }

+ 65 - 0
src/store/user.ts

@@ -0,0 +1,65 @@
+import { defineStore } from 'pinia'
+
+interface userStroe {
+  token: string
+  /**
+   * 用户登录信息
+   */
+  userInfo: {
+    /**
+     * 顶级id
+     */
+    channelTopId?: number
+    /**
+     * 运费(单位:分)
+     */
+    freightFee?: number
+    /**
+     * 企业名称
+     */
+    channelName: string
+    /**
+     * 渠道(企业ID)
+     */
+    channelId: number
+    /**
+     * 会员头像地址
+     */
+    avatarUrl?: string
+    /**
+     * 会员余额(单位:分)
+     */
+    balance?: number
+    /**
+     * 会员ID
+     */
+    id: number
+    /**
+     * 会员手机号
+     */
+    mobile?: string
+    /**
+     * 会员昵称
+     */
+    nickName?: string
+    [property: string]: any
+  }
+  isShowLogin: boolean
+}
+export const useUserStore = defineStore('user', {
+  state: (): userStroe => ({
+    token: '',
+    userInfo: {
+      id: 0,
+      channelId: 0,
+      channelName: '',
+    },
+    isShowLogin: false,
+  }),
+  actions: {
+
+    wxAuthLogin() {
+
+    },
+  },
+})

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

@@ -3,7 +3,10 @@
 // @ts-nocheck
 // Generated by @uni-ku/pages-json
 
-interface NavigateToOptions {}
+interface NavigateToOptions {
+  url: "/pages/confirmOrder/index" |
+       "/pages/refuelDetaile/index";
+}
 
 interface RedirectToOptions extends NavigateToOptions {}
 

+ 3 - 0
vite.config.ts

@@ -69,4 +69,7 @@ export default defineConfig({
     // see unocss.config.ts for config
     UnoCSS(),
   ],
+  server: {
+    host: '0.0.0.0',
+  },
 })

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio