Prechádzať zdrojové kódy

Merge branch 'master' of http://git.zonelife.cn:3000/zhangtao/city-gather

wenjie 1 týždeň pred
rodič
commit
32281552e2

+ 1 - 1
package.json

@@ -80,6 +80,7 @@
     "@dcloudio/uni-mp-weixin": "3.0.0-4060620250520001",
     "@dcloudio/uni-mp-xhs": "3.0.0-4060620250520001",
     "@dcloudio/uni-quickapp-webview": "3.0.0-4060620250520001",
+    "@uni-helper/vite-plugin-uni-layouts": "0.1.10",
     "@vueuse/core": "^11.0.3",
     "alova": "^3.3.4",
     "echarts": "^6.0.0",
@@ -108,7 +109,6 @@
     "@uni-helper/uni-types": "^1.0.0-alpha.6",
     "@uni-helper/unocss-preset-uni": "^0.2.11",
     "@uni-helper/vite-plugin-uni-components": "^0.2.0",
-    "@uni-helper/vite-plugin-uni-layouts": "^0.1.11",
     "@uni-helper/vite-plugin-uni-manifest": "^0.2.8",
     "@uni-helper/volar-service-uni-pages": "^0.3.11",
     "@uni-ku/bundle-optimizer": "1.3.15-beta.2",

+ 0 - 50
pages.config.ts

@@ -1,50 +0,0 @@
-import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages'
-
-export default defineUniPages({
-  pages: [
-
-  ],
-  globalStyle: {
-    // 导航栏配置
-    navigationBarBackgroundColor: '@navBgColor',
-    navigationBarTextStyle: '@navTxtStyle',
-    navigationBarTitleText: 'wot',
-
-    // 页面背景配置
-    backgroundColor: '@bgColor',
-    backgroundTextStyle: '@bgTxtStyle',
-    backgroundColorTop: '@bgColorTop',
-    backgroundColorBottom: '@bgColorBottom',
-
-    // 下拉刷新配置
-    enablePullDownRefresh: false,
-    onReachBottomDistance: 50,
-
-    // 动画配置
-    animationType: 'pop-in',
-    animationDuration: 300,
-  },
-
-  tabBar: {
-    custom: true,
-    // #ifdef MP-ALIPAY
-    customize: true,
-    // 暂时不生效。4.71.2025061206-alpha已修复:https://uniapp.dcloud.net.cn/release-note-alpha.html#_4-71-2025061206-alpha,我们等正式版发布后更新。
-    overlay: true,
-    // #endif
-    height: '0',
-    color: '@tabColor',
-    selectedColor: '@tabSelectedColor',
-    backgroundColor: '@tabBgColor',
-    borderStyle: '@tabBorderStyle',
-    list: [{
-      pagePath: 'pages/index/index',
-    }, {
-      pagePath: 'pages/classfiy/index',
-    }, {
-      pagePath: 'pages/cart/index',
-    }, {
-      pagePath: 'pages/my/index',
-    }],
-  },
-})

+ 21 - 65
pnpm-lock.yaml

@@ -70,6 +70,9 @@ importers:
       '@dcloudio/uni-quickapp-webview':
         specifier: 3.0.0-4060620250520001
         version: 3.0.0-4060620250520001(@vueuse/core@11.0.3(vue@3.4.38(typescript@5.5.4)))(postcss@8.4.41)(rollup@4.21.1)(vue@3.4.38(typescript@5.5.4))
+      '@uni-helper/vite-plugin-uni-layouts':
+        specifier: 0.1.10
+        version: 0.1.10(rollup@4.21.1)
       '@vueuse/core':
         specifier: ^11.0.3
         version: 11.0.3(vue@3.4.38(typescript@5.5.4))
@@ -149,9 +152,6 @@ importers:
       '@uni-helper/vite-plugin-uni-components':
         specifier: ^0.2.0
         version: 0.2.0(rollup@4.21.1)
-      '@uni-helper/vite-plugin-uni-layouts':
-        specifier: ^0.1.11
-        version: 0.1.11(rollup@4.21.1)
       '@uni-helper/vite-plugin-uni-manifest':
         specifier: ^0.2.8
         version: 0.2.8(vite@5.2.8(@types/node@20.16.2)(sass@1.78.0)(terser@5.31.6))
@@ -453,11 +453,6 @@ packages:
     engines: {node: '>=6.0.0'}
     hasBin: true
 
-  '@babel/parser@7.28.0':
-    resolution: {integrity: sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g==}
-    engines: {node: '>=6.0.0'}
-    hasBin: true
-
   '@babel/parser@7.28.4':
     resolution: {integrity: sha512-yZbBqeM6TkpP9du/I2pUZnJsRMGGvOuIrhjzC1AwHwW+6he4mni6Bp/m8ijn0iOuZuPI2BfkCoSRunpyjnrQKg==}
     engines: {node: '>=6.0.0'}
@@ -2508,8 +2503,8 @@ packages:
   '@uni-helper/vite-plugin-uni-components@0.2.0':
     resolution: {integrity: sha512-h/rV8Z3N+wus/ZviYzkdRePNSUlkndn5H+wVC17ZXmG+2mqmUfLJdGskzrCbgE7Y1TT7u8E9yMz8Ah/RwMf0GQ==}
 
-  '@uni-helper/vite-plugin-uni-layouts@0.1.11':
-    resolution: {integrity: sha512-FXdFATBFsHAl7xY9q3KO0EexMRGua/7txIiQTm2rQi1/bXcft4CUXldtuHl9Upq0V6CT47aanmfzcOF5CpHK7Q==}
+  '@uni-helper/vite-plugin-uni-layouts@0.1.10':
+    resolution: {integrity: sha512-RJdGmJjZtpKNVfShiKYZrualMxdi+i8uh7zpPG+X3lzf6wyKSJgWwVAj3GUdqeE/QUEncNPmj2sqwuyeLXPxbA==}
 
   '@uni-helper/vite-plugin-uni-manifest@0.2.8':
     resolution: {integrity: sha512-6QtUcCTkvpR5GAPUxyKlEtm+KYxOk1RSVfdrxlWYW2q7Iws0D7UeNirA4GMuc/SaayEjURlU7cUrS7NceoPCfQ==}
@@ -3201,8 +3196,8 @@ packages:
     resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==}
     engines: {node: '>= 0.8'}
 
-  c12@1.11.1:
-    resolution: {integrity: sha512-KDU0TvSvVdaYcQKQ6iPHATGz/7p/KiVjPg4vQrB6Jg/wX9R0yl5RZxWm9IoZqaIHD2+6PZd81+KMGwRr/lRIUg==}
+  c12@1.11.2:
+    resolution: {integrity: sha512-oBs8a4uvSDO9dm8b7OCFW7+dgtVrwmwnrVXYzLm43ta7ep2jCn/0MhoUFygIWtxhyy6+/MG7/agvpY0U1Iemew==}
     peerDependencies:
       magicast: ^0.3.4
     peerDependenciesMeta:
@@ -3787,10 +3782,6 @@ packages:
     resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==}
     engines: {node: '>=8'}
 
-  dotenv@16.4.5:
-    resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==}
-    engines: {node: '>=12'}
-
   dotenv@16.6.1:
     resolution: {integrity: sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==}
     engines: {node: '>=12'}
@@ -4421,10 +4412,6 @@ packages:
   get-tsconfig@4.7.6:
     resolution: {integrity: sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==}
 
-  giget@1.2.3:
-    resolution: {integrity: sha512-8EHPljDvs7qKykr6uw8b+lqLiUc/vUg+KVTI0uND4s63TdsZM2Xus3mflvF0DDG9SiM4RlCkFGL+7aAjRmV7KA==}
-    hasBin: true
-
   giget@1.2.5:
     resolution: {integrity: sha512-r1ekGw/Bgpi3HLV3h1MRBIlSAdHoIMklpaQ3OQLFcRw9PwAj2rqigvIbg+dBUI51OxVI2jsEtDywDBjSiuf7Ug==}
     hasBin: true
@@ -5557,11 +5544,6 @@ packages:
   nwsapi@2.2.22:
     resolution: {integrity: sha512-ujSMe1OWVn55euT1ihwCI1ZcAaAU3nxUiDwfDQldc51ZXaB9m2AyOn6/jh1BLe2t/G8xd6uKG1UBF2aZJeg2SQ==}
 
-  nypm@0.3.11:
-    resolution: {integrity: sha512-E5GqaAYSnbb6n1qZyik2wjPDZON43FqOJO59+3OkWrnmQtjggrMOVnsyzfjxp/tS6nlYJBA4zRA5jSM2YaadMg==}
-    engines: {node: ^14.16.0 || >=16.10.0}
-    hasBin: true
-
   nypm@0.5.4:
     resolution: {integrity: sha512-X0SNNrZiGU8/e/zAB7sCTtdxWTMSIO73q+xuKgglm2Yvzwlo8UoC5FNySQFCvl84uPaeADkqHUZUkWy4aH4xOA==}
     engines: {node: ^14.16.0 || >=16.10.0}
@@ -5594,8 +5576,8 @@ packages:
   ofetch@1.3.4:
     resolution: {integrity: sha512-KLIET85ik3vhEfS+3fDlc/BAZiAp+43QEC/yCo5zkNoY2YaKvNkOaFr/6wCFgFH1kuYQM5pMNi0Tg8koiIemtw==}
 
-  ohash@1.1.3:
-    resolution: {integrity: sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==}
+  ohash@1.1.6:
+    resolution: {integrity: sha512-TBu7PtV8YkAZn0tSxobKY2n2aAQva936lhRrj6957aDaCf9IEtqsKbgMzXE/F/sjqYOwmrukeORHNLe5glk7Cg==}
 
   ohash@2.0.11:
     resolution: {integrity: sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==}
@@ -7502,10 +7484,6 @@ snapshots:
     dependencies:
       '@babel/types': 7.27.1
 
-  '@babel/parser@7.28.0':
-    dependencies:
-      '@babel/types': 7.28.2
-
   '@babel/parser@7.28.4':
     dependencies:
       '@babel/types': 7.28.4
@@ -10418,18 +10396,18 @@ snapshots:
       - rollup
       - supports-color
 
-  '@uni-helper/vite-plugin-uni-layouts@0.1.11(rollup@4.21.1)':
+  '@uni-helper/vite-plugin-uni-layouts@0.1.10(rollup@4.21.1)':
     dependencies:
-      '@babel/types': 7.28.2
+      '@babel/types': 7.28.4
       '@uni-helper/uni-env': 0.1.7
-      '@vue/compiler-core': 3.4.21
-      '@vue/compiler-sfc': 3.4.21
+      '@vue/compiler-core': 3.4.38
+      '@vue/compiler-sfc': 3.4.38
       ast-kit: 0.11.3(rollup@4.21.1)
-      c12: 1.11.1
+      c12: 1.11.2
       chokidar: 3.6.0
       fast-glob: 3.3.3
       jsonc-parser: 3.3.1
-      magic-string: 0.30.17
+      magic-string: 0.30.21
       scule: 1.3.0
     transitivePeerDependencies:
       - magicast
@@ -11085,7 +11063,7 @@ snapshots:
 
   ast-kit@0.11.3(rollup@4.21.1):
     dependencies:
-      '@babel/parser': 7.28.0
+      '@babel/parser': 7.28.4
       '@rollup/pluginutils': 5.1.0(rollup@4.21.1)
       pathe: 1.1.2
     transitivePeerDependencies:
@@ -11293,16 +11271,16 @@ snapshots:
 
   bytes@3.1.2: {}
 
-  c12@1.11.1:
+  c12@1.11.2:
     dependencies:
       chokidar: 3.6.0
       confbox: 0.1.8
       defu: 6.1.4
-      dotenv: 16.4.5
-      giget: 1.2.3
+      dotenv: 16.6.1
+      giget: 1.2.5
       jiti: 1.21.7
       mlly: 1.7.4
-      ohash: 1.1.3
+      ohash: 1.1.6
       pathe: 1.1.2
       perfect-debounce: 1.0.0
       pkg-types: 1.3.1
@@ -11874,8 +11852,6 @@ snapshots:
     dependencies:
       is-obj: 2.0.0
 
-  dotenv@16.4.5: {}
-
   dotenv@16.6.1: {}
 
   dotgitignore@2.1.0:
@@ -12701,17 +12677,6 @@ snapshots:
     dependencies:
       resolve-pkg-maps: 1.0.0
 
-  giget@1.2.3:
-    dependencies:
-      citty: 0.1.6
-      consola: 3.2.3
-      defu: 6.1.4
-      node-fetch-native: 1.6.4
-      nypm: 0.3.11
-      ohash: 1.1.3
-      pathe: 1.1.2
-      tar: 6.2.1
-
   giget@1.2.5:
     dependencies:
       citty: 0.1.6
@@ -14015,15 +13980,6 @@ snapshots:
 
   nwsapi@2.2.22: {}
 
-  nypm@0.3.11:
-    dependencies:
-      citty: 0.1.6
-      consola: 3.2.3
-      execa: 8.0.1
-      pathe: 1.1.2
-      pkg-types: 1.3.1
-      ufo: 1.6.1
-
   nypm@0.5.4:
     dependencies:
       citty: 0.1.6
@@ -14074,7 +14030,7 @@ snapshots:
       node-fetch-native: 1.6.4
       ufo: 1.5.4
 
-  ohash@1.1.3: {}
+  ohash@1.1.6: {}
 
   ohash@2.0.11: {}
 

+ 14 - 1
src/api/api.type.d.ts

@@ -2063,6 +2063,19 @@ namespace Api {
     /**
      * 实际充电度数(单位:0.001 kw/h)
      */
-    totalCharge?: number
+    totalPower?: number
+    /**
+     * 停止类型
+     */
+    stopMethod?: number
+    /**
+     * 终端编号
+     */
+    connectorId?: string
+    /**
+     * 充电电费
+     */
+    totalMoney?: number
+
   }
 }

+ 1 - 1
src/api/globals.d.ts

@@ -449,7 +449,7 @@ declare global {
         Config extends Alova2MethodConfig<listData<Api.xsbOrderList>> & {
           data: {
             businessType?: string;
-            orderStatus?: string;
+            orderStatus?: string|number;
             pageNum?: number;
             pageSize?: number;
             dvyType?: number | string;

+ 2 - 2
src/config/index.ts

@@ -6,11 +6,11 @@ const mapEnvVersion = {
   // develop: 'http://192.168.1.101:8080',
   // develop: 'http://192.168.0.157:8080',
   // develop: 'http://192.168.1.253:8080',
-  // develop: 'http://192.168.0.19:8080',
+  develop: 'http://192.168.0.19:8080',
   // develop: 'http://192.168.0.217:8080',
   // develop: 'http://192.168.1.89:8080', // 田
   // develop: 'http://47.109.84.152:8081',
-  develop: 'https://smqjh.api.zswlgz.com',
+  // develop: 'https://smqjh.api.zswlgz.com',
   /**
    * 体验版
    */

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

@@ -148,7 +148,6 @@ function handleGo(item: { name: string }) {
         退出登录
       </wd-button>
     </view>
-    <QCode text="123" :qwidth="100" />
   </view>
 </template>
 

+ 8 - 7
src/subPack-charge/chargeOrderDetail/chargeOrderDetail.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { chargeOrderStatus } from '../utils/index'
+import { chargeOrderStatus, secondToTime, stopType } from '../utils/index'
 import router from '@/router'
 import { StaticUrl } from '@/config'
 
@@ -52,7 +52,7 @@ async function getOrderDetail() {
           </view>
         </view>
         <view class="mt-20rpx text-28rpx text-#9ED605 font-bold">
-          {{ chargeOrderDetail?.totalCharge }}度电
+          {{ chargeOrderDetail?.totalPower }}度电
         </view>
       </view>
       <view class="mt-20rpx rounded-16rpx bg-#FFF p-24rpx">
@@ -77,7 +77,8 @@ async function getOrderDetail() {
             终止方式
           </view>
           <view class="mt-20rpx text-32rpx font-bold">
-            {{ '--' }}
+            <!-- 0:用户手动停止充电;1:客户归属地运营商平台停止充电;2:BMS停止充电;3:充电机设备故障;4:连接器断开;其它:自定义 -->
+            {{ stopType(chargeOrderDetail?.stopMethod) }}
           </view>
         </view>
       </view>
@@ -103,7 +104,7 @@ async function getOrderDetail() {
             订单时间
           </view>
           <view class="text-28rpx text-#AAA">
-            {{ chargeOrderDetail?.chargeTime }}
+            {{ secondToTime(Number(chargeOrderDetail?.chargeTime)) }}
           </view>
         </view>
         <view class="mt-28rpx flex items-center justify-between">
@@ -111,7 +112,7 @@ async function getOrderDetail() {
             充电电站
           </view>
           <view class="text-28rpx text-#AAA">
-            {{ chargeOrderDetail?.powerStationName }}
+            {{ chargeOrderDetail?.powerStationName || '--' }}
           </view>
         </view>
         <view class="mt-28rpx flex items-center justify-between">
@@ -119,7 +120,7 @@ async function getOrderDetail() {
             终端编号
           </view>
           <view class="text-28rpx text-#AAA">
-            {{ '--' }}
+            {{ chargeOrderDetail?.connectorId || '--' }}
           </view>
         </view>
         <view class="mt-28rpx flex items-center justify-between">
@@ -127,7 +128,7 @@ async function getOrderDetail() {
             电费
           </view>
           <view class="text-28rpx text-#AAA">
-            {{ '--' }}元
+            {{ chargeOrderDetail?.totalMoney }}元
           </view>
         </view>
         <view class="mt-28rpx flex items-center justify-between">

+ 2 - 1
src/subPack-charge/chargeOrderList/chargeOrderList.vue

@@ -19,7 +19,7 @@ const { data: orderList, refresh, isLastPage, page, reload } = usePagination((pa
   businessType: 'CD',
   pageNum,
   pageSize,
-  dvyType: unref(navActiveTab) === 0 ? '' : unref(navActiveTab),
+  orderStatus: unref(navActiveTab) === 0 ? '' : unref(navActiveTab),
 } }), {
   immediate: false,
   pageNum: 1,
@@ -125,6 +125,7 @@ function handleItemClick(item: Api.xsbOrderList) {
           </view>
         </view>
       </view>
+      <StatusTip v-if="!orderList.length" tip="暂无内容" />
     </view>
   </view>
 </template>

+ 36 - 0
src/subPack-charge/utils/index.ts

@@ -36,6 +36,42 @@ export function chargeOrderStatus(status: any) {
   return statusObj
 }
 
+/**
+ * 停止方式
+ * @param stopMethod
+ */
+export function stopType(stopMethod: any) {
+  // 0:用户手动停止充电;1:客户归属地运营商平台停止充电;2:BMS停止充电;3:充电机设备故障;4:连接器断开;其它:自定义
+  let stopText = ''
+  switch (stopMethod) {
+    case 0:
+      stopText = '用户手动停止充电'
+      break
+    case 1:
+      stopText = '客户归属地运营商平台停止充电'
+      break
+    case 2:
+      stopText = 'BMS停止充电'
+      break
+    case 3:
+      stopText = '充电机设备故障'
+      break
+    case 4:
+      stopText = '连接器断开'
+  }
+  return stopText
+}
+
+/**
+ * 秒转为时间格式
+ */
+export function secondToTime(second: number) {
+  const h = Math.floor(second / 3600)
+  const m = Math.floor((second - h * 3600) / 60)
+  const s = Math.floor(second - h * 3600 - m * 60)
+  return `${h < 10 ? `0${h}` : h}:${m < 10 ? `0${m}` : m}:${s < 10 ? `0${s}` : s}`
+}
+
 /**
  * 扫码工具类
  */

+ 1 - 1
src/subPack-smqjh/components/charge-orderList/charge-orderList.vue

@@ -9,7 +9,7 @@ defineProps<{
 }>()
 
 function handleItemClick(item: Api.xsbOrderList) {
-  const orderNumber = item.chargeOrder?.orderNumber
+  const orderNumber = item.orderNumber
   if (orderNumber) {
     router.push({
       name: 'charge-order-detail',

+ 12 - 3
vite.config.ts

@@ -1,4 +1,5 @@
 import process from 'node:process'
+import path from 'node:path'
 import Uni from '@dcloudio/vite-plugin-uni'
 import UniHelperComponents from '@uni-helper/vite-plugin-uni-components'
 import { WotResolver } from '@uni-helper/vite-plugin-uni-components/resolvers'
@@ -23,8 +24,8 @@ export default async () => {
       UniHelperManifest(),
       // https://github.com/uni-helper/vite-plugin-uni-pages
       pagesJson({
-        dts: 'src/uni-pages.d.ts',
-        pageDir: 'pages',
+        dts: path.resolve(process.cwd(), 'src/uni-pages.d.ts'),
+        pagesDir: 'pages',
         subPackageDirs: [
           'subPack-xsb',
           'subPack-common',
@@ -36,7 +37,15 @@ export default async () => {
          * @default []
          */
         exclude: ['**/components/**/*.*'],
-        hooks: [hookUniPlatform],
+        hooks: [
+          hookUniPlatform,
+          // 简单调试 hook:在生成时打印上下文,帮助定位问题
+          (ctx) => {
+            console.log('[pages-json] pages type:', Object.prototype.toString.call(ctx.pages))
+            console.log('[pages-json] pages count:', Array.isArray(ctx.pages) ? ctx.pages.length : 'not array')
+            console.log('[pages-json] output dts:', path.resolve(process.cwd(), 'src/uni-pages.d.ts'))
+          },
+        ],
       }),
       // https://github.com/uni-helper/vite-plugin-uni-layouts
       UniHelperLayouts(),