瀏覽代碼

散户加气3.1

chenlei 1 年之前
父節點
當前提交
26966872f5

+ 2 - 1
.eslintrc-auto-import.json

@@ -93,6 +93,7 @@
     "watchSyncEffect": true,
     "webapi": true,
     "func": true,
-    "aop": true
+    "aop": true,
+    "mock": true
   }
 }

+ 8 - 6
README.md

@@ -1,6 +1,6 @@
-由 `uniapp` + `Vue3` + `Ts` + `Vite5` + `UnoCss` + `uni-ui` + `z-paging` 构成,使用了最新的前端技术栈,无需依靠 `HBuilderX`,通过命令行方式运行 `web`、`小程序` 和 `App`(编辑器推荐 `VSCode`,可选 `webstorm`)。
+由 `uniapp` + `Vue3` + `Ts` + `Vite5` + `UnoCss` + `uni-ui` 构成,使用了最新的前端技术栈,无需依靠 `HBuilderX`,通过命令行方式运行 `web`、`小程序` 和 `App`(编辑器推荐 `VSCode`,可选 `webstorm`)。
 
-内置了 `页面底座`、`公共请求框架`、`公共状态中心`、 `配置中心`、`UnoCSS`、`i18n多语言` 等基础功能,提供了 `代码提示`、`自动格式化`、`接口信息一键导入`、`自动生成路由` 等辅助功能。
+内置了 `页面底座`、`公共请求框架`、`公共状态中心`、 `配置中心`、`UnoCSS`、`i18n多语言` 等基础功能,提供了 `代码提示`、`自动格式化`、`接口信息拉取(from swagger)`、`自动生成路由` 、`内置接口mock` 等辅助功能。
 
 ## ⚙️ 环境
 
@@ -26,7 +26,7 @@
 ## 📦 运行(支持热更新)
 
 - web平台: `pnpm dev:h5`, 然后打开 [http://localhost:9000/](http://localhost:9000/)。
-- weixin平台:`pnpm dev:mp-weixin` 然后打开微信开发者工具,导入本地文件夹,选择本项目的`dist/dev/mp-weixin` 文件。
+- weixin平台:`pnpm dev:mp` 然后打开微信开发者工具,导入本地文件夹,选择本项目的`dist/dev/mp-weixin` 文件。
 - APP平台:`pnpm dev:app`, 然后打开 `HBuilderX`,导入刚刚生成的`dist/dev/app` 文件夹,选择运行到模拟器(开发时优先使用),或者运行的安卓/ios基座。
 
 ## 🔗 发布
@@ -62,11 +62,13 @@
 - 18.开发环境,通过generateBundle钩子函数实现增量修改微信小程序的js文件,以便提高小程序ide工具的编译速度。
 - 19.全局sass变量自动引入,全局sass变量、样式表定义。
 - 20.公共请求框架,根据swagger导入接口信息支持增量导入。
-- 21.页面方法公共初始化,对页面方法进行集中拦截、公共管控,已支持自动为对象内所有方法增加防重提功能(同步方法、异步方法执行中再次触发不执行) 
-- 22.微信小程序环境支持websocket-stomp协议,收银员扫描驾驶员二维码创建订单后,驾驶员端自动跳转待支付页面。
+- 21.页面方法公共初始化,对页面方法进行集中拦截、公共管控,已支持自动为对象内所有方法增加防重提功能(同步方法、异步方法执行中再次触发不执行)。
+- 22.微信小程序环境支持websocket-stomp协议,收银员扫描驾驶员二维码创建订单后,驾驶员端自动跳转待支付页面。
 - 23.构建项目时自动化上传体验版至小程序后台。√
 - 24.构建项目时可区分开发、测试、生成环境,编写对应的命令。√
 - 25.在页面跳转时支持页面预初始化。
-- 26.容器组件根据页面公共配置,自动识别支持自定义头部,呈现头部区域标题、返回按钮。
+- 26.容器组件根据页面公共配置,自动识别支持自定义头部,呈现头部区域标题、返回按钮。
 - 27.编写公共组件:计数器、抽屉、详情页模板、流光加载效果、浮点单位、刷新、骨架屏、吸顶。
 - 28.编写业务组件:车牌号输入、拨打电话、加气站模块。
+- 29.本地调试时,通过编写unocss插件去掉unicss默认无用样式变量,提高浏览器环境样式调试性能。
+- 30.公共请求框架支持mock机制,支持划分mock场景。√

+ 1 - 1
package.json

@@ -102,7 +102,7 @@
     "qs": "6.5.3",
     "stompjs": "^2.3.3",
     "vant": "3.6.12",
-    "vue": "3.4.21",
+    "vue": "3.4.30",
     "vue-i18n": "^9.1.9",
     "z-paging": "^2.7.10"
   },

文件差異過大導致無法顯示
+ 230 - 178
pnpm-lock.yaml


+ 1 - 1
scripts/upload.js

@@ -25,7 +25,7 @@ const project = new ci.Project({
 cl.logw('上传中...')
 ci.upload({
   project,
-  version: '2.1.0',
+  version: '1.0.0',
   desc: `${os.hostname()}于 ${dayjs().format('YYYY-MM-DD HH:mm:ss')} 自动提交上传`,
   setting: {
     es6: true,

+ 15 - 1
src/App.vue

@@ -1,9 +1,23 @@
 <script setup lang="ts">
 onLaunch(() => {
   //   uni.hideHomeButton()
+  store.common.data.mockScenes = ''
 })
 onShow((options) => {
-  ay.staticData.args.options = options
+  // ay.staticData.args.options = options
+  webapi.strategy
+    .mina_fake()
+    .then((res) => {
+      // 开关打开时 设置场景值
+      if (res) {
+        store.common.data.mockScenes = config.common.mockScenes.examine
+      } else {
+        store.common.data.mockScenes = ''
+      }
+    })
+    .catch(() => {
+      store.common.data.mockScenes = ''
+    })
 })
 // onHide(() => {
 //   console.log('App Hide')

+ 4 - 2
src/components/business/carNumber.vue

@@ -9,7 +9,7 @@
         <div class="cn-center">
           <div class="input_box">
             <template v-for="(n, i) in cnumbers" :key="i">
-              <div class="ibitem" :class="{ active: n.active }">
+              <div class="ibitem" :class="{ active: n.active, green: i === cnumbers.length - 1 }">
                 {{ n.value }}
               </div>
               <span class="center point" v-if="n.afterPoint">•</span>
@@ -312,7 +312,6 @@ defineExpose(methods)
     font-size: $b-fz;
     .ibitem {
       position: relative;
-
       flex: 1;
       height: $b-fz * 2;
       margin: 2rpx;
@@ -320,6 +319,9 @@ defineExpose(methods)
       text-align: center;
       border: 1rpx solid #ced0d2;
       border-radius: $p-spacd2;
+      &.green {
+        background-color: #9eefa4;
+      }
       &.active::after {
         position: absolute;
         right: 0;

+ 3 - 1
src/components/flowLine/index.vue

@@ -54,7 +54,9 @@ $speed: 1s;
 $lineWidth: 2rpx;
 .flow-line {
   position: relative;
+  /* #ifdef MP */
   height: 100%;
+  /* #endif */
   overflow: hidden;
   border-radius: $p-spacd2;
 }
@@ -75,7 +77,7 @@ $lineWidth: 2rpx;
 // }
 .line {
   position: absolute;
-  // z-index: 1;
+  z-index: 1;
 }
 
 // $map:(1:(top:0,left:0))

+ 1 - 1
src/components/sticky/index.vue

@@ -44,7 +44,7 @@ onMounted(() => {
 .sticky {
   // 防止顶部镂空
   top: -1rpx;
-  z-index: 1;
+  z-index: 100;
   // 防止部分真机误判相交状态
   margin-bottom: 1px;
   background-color: $bg-color;

+ 1 - 1
src/manifest.json

@@ -83,7 +83,7 @@
   },
   "quickapp": {},
   "mp-weixin": {
-    "appid": "wxf69daeba7aec5be4",
+    "appid": "wx72ba78af2cf68cf0",
     "setting": {
       "urlCheck": false,
       "minified": true

+ 1 - 27
src/pages.json

@@ -39,10 +39,6 @@
       "type": "page"
     },
     {
-      "path": "pages/list/index",
-      "type": "page"
-    },
-    {
       "path": "pages/login/index",
       "type": "page",
       "style": {
@@ -115,27 +111,5 @@
       "type": "page"
     }
   ],
-  "subPackages": [
-    {
-      "root": "pagesSubExample",
-      "pages": [
-        {
-          "path": "index",
-          "type": "page"
-        },
-        {
-          "path": "list/index",
-          "type": "page"
-        },
-        {
-          "path": "login/index",
-          "type": "page"
-        },
-        {
-          "path": "webview/index",
-          "type": "page"
-        }
-      ]
-    }
-  ]
+  "subPackages": []
 }

+ 17 - 9
src/pages/index/index.vue

@@ -285,6 +285,10 @@ const methods = ay.initMethods(
       })
     },
     truckManage() {
+      if (store.common.data.mockScenes === config.common.mockScenes.examine) {
+        return
+      }
+
       if (data.truckInfo.length) {
         ay.goPage(config.pages.truckInfo_index)
       } else {
@@ -307,6 +311,9 @@ const methods = ay.initMethods(
       }
     },
     goPerson() {
+      if (store.common.data.mockScenes === config.common.mockScenes.examine) {
+        return
+      }
       ay.goPage(config.pages.personCenter_index)
     },
     goPage(menu) {
@@ -484,8 +491,11 @@ const methods = ay.initMethods(
           (price.qrcode === 2 && ret.gasstationId === ret.cashierId) // 设置的收银员
         ) {
           func.native.showModal({
-            title: '错误提示',
-            content: '加气站收款码已禁用,请选择收银员收款码扫码。',
+            title: '温馨提示',
+            content:
+              price.qrcode === 2
+                ? '加气站收款码已禁用,请选择收银员收款码扫码。'
+                : '收银员收款码已禁用,请选择加气站收款码扫码。',
           })
         } else {
           const gasJudge = await webapi.strategy.driver_gas_judge({
@@ -497,14 +507,14 @@ const methods = ay.initMethods(
             ay.goPage(config.pages.order_createOrder, { params: ret })
           } else if (gasJudge === 2) {
             func.native.showModal({
-              title: '错误提示',
+              title: '温馨提示',
               content: `该加气站未及时补充平台气源,已无法通过大象平台为您提供优质气源,给您带来的不便深感其歉意,如有疑问可以与加气站沟通,亦可拨打大象加气平台客服电话:"${store.common.data.phone}"`,
             })
           }
         }
       } else {
         func.native.showModal({
-          title: '错误提示',
+          title: '温馨提示',
           content: '当前收银员所属企业和二维码对应的企业不一致,请联系加气站管理员。',
         })
       }
@@ -552,10 +562,8 @@ const methods = ay.initMethods(
     async getListApp({
       cras = config.common.defAyContainerRefreshArgs,
       activation = false,
-      checkScope = false,
+      // checkScope = false,
     } = {}) {
-      if (checkScope) {
-      }
       // 非激活 && 未授权
       if (!activation && !data.userLocation) {
         // 取消加载中效果
@@ -583,7 +591,7 @@ const methods = ay.initMethods(
               latitude: location.latitude.toString(),
             },
           },
-          { showLoading: activation }, // || !cras.isAdd },
+          // { showLoading: activation }, // || !cras.isAdd },
         )
         .then((res) => {
           if (cras.isAdd) {
@@ -639,7 +647,7 @@ ay.entrance(
       methods.initWS()
       methods.getCityList()
       data.station.curCity = uni.getStorageSync(staticData.cctkn) || staticData.defCity
-      methods.getListApp({ cras: args.cras, checkScope: true })
+      methods.getListApp({ cras: args.cras })
       await init()
       // 无未支付订单
       if (!data.hasnopayfordriver) {

+ 0 - 64
src/pages/list/index.vue

@@ -1,64 +0,0 @@
-<template>
-  <ay-container>
-    {{ store.webapi.strategy.list_app.ing }}
-    <!-- <button @click="methods.test">aaa</button> -->
-    <div class="item" v-for="item in data.list" :key="item">
-      <!-- {{ item }} -->
-      <img class="img" mode="aspectFit" :src="item.url" />
-    </div>
-  </ay-container>
-</template>
-
-<script lang="ts" setup>
-const data = ay.initData({
-  list: [] as GasstationVO对象[],
-  loading: false,
-  pageInfo: {},
-})
-const methods = {}
-
-ay.entrance(
-  (args) => {
-    console.log('oncload66', args)
-
-    webapi.strategy.list_app
-      .post<{ param: { truckId } }>(
-        {
-          page: args.cras.page,
-          size: args.cras.size,
-          param: {
-            city: '',
-            longitude: '',
-            latitude: '',
-            truckId: '800136756804452355',
-          },
-        },
-        { showLoading: !args.cras.isAdd },
-      )
-      .then((res) => {
-        if (args.cras.isAdd) {
-          data.list.push(...res.records)
-        } else {
-          data.list = res.records
-        }
-      })
-  },
-  {
-    // defAyContainerRefreshArgs: {
-    //   size: 10,
-    // },
-    // addLoadTypes: [enums.LoadType.onShow],
-  },
-)
-</script>
-
-<style lang="scss" scoped>
-.item {
-  width: 100%;
-  text-wrap: wrap;
-  .img {
-    width: 200rpx;
-    height: 300rpx;
-  }
-}
-</style>

+ 5 - 1
src/pages/login/index.vue

@@ -35,7 +35,11 @@
           <span class="p-color" @click="methods.agreement">服务条款、隐私协议</span>
         </div>
       </div>
-      <div class="p-color login-H5" @click="methods.goLoginH5">大象加气“驾驶员”账号登录</div>
+      <div
+        v-if="store.common.data.mockScenes === config.common.mockScenes.examine"
+        class="login-H5"
+      ></div>
+      <div v-else class="p-color login-H5" @click="methods.goLoginH5">大象加气“驾驶员”账号登录</div>
     </div>
   </ay-container>
 </template>

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

@@ -60,7 +60,7 @@ const methods = {
     }
 
     webapi.pay
-      .add({
+      .add_v2({
         cashierId: pageConfig.value.params.cashierId,
         driverId: user.value.user_id,
         gasQty: gasQty.value,

+ 4 - 0
src/style/index.scss

@@ -440,4 +440,8 @@ page {
 
   // 修改按钮背景色
   // --wot-button-primary-bg-color: green;
+}
+
+.uni-popup {
+  z-index: 999 !important;
 }

+ 3 - 0
src/types/auto-import.d.ts

@@ -26,6 +26,7 @@ declare global {
   const isReadonly: typeof import('vue')['isReadonly']
   const isRef: typeof import('vue')['isRef']
   const markRaw: typeof import('vue')['markRaw']
+  const mock: typeof import('@/utils/mock')['default']
   const nextTick: typeof import('vue')['nextTick']
   const onActivated: typeof import('vue')['onActivated']
   const onAddToFavorites: typeof import('@dcloudio/uni-app')['onAddToFavorites']
@@ -123,6 +124,7 @@ declare module 'vue' {
     readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
     readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
     readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
+    readonly mock: UnwrapRef<typeof import('@/utils/mock')['default']>
     readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
     readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
     readonly onAddToFavorites: UnwrapRef<typeof import('@dcloudio/uni-app')['onAddToFavorites']>
@@ -211,6 +213,7 @@ declare module '@vue/runtime-core' {
     readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
     readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
     readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
+    readonly mock: UnwrapRef<typeof import('@/utils/mock')['default']>
     readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
     readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
     readonly onAddToFavorites: UnwrapRef<typeof import('@dcloudio/uni-app')['onAddToFavorites']>

+ 2 - 0
src/types/schemas/allinpay.d.ts

@@ -223,6 +223,8 @@ interface GasOrder对象 {
   /** 订单结算状态(1.待支付 2.已支付 3.取消 4.支付中 5.退款中 6.退款完成) */
   settleStatus?: number
   /** 中石化零售价 */
+  snpCostPrice?: number
+  /** 中石化零售价 */
   snpPrice?: number
   /** 站服务费清分方式(1线上实时,2 线下月度) */
   splitType?: number

+ 42 - 0
src/types/schemas/pay.d.ts

@@ -225,6 +225,8 @@ interface GasOrder对象 {
   /** 订单结算状态数组,用于前端同时查询多个状态订单时使用(旗舰站) */
   settleStatusList?: array
   /** 中石化零售价 */
+  snpCostPrice?: number
+  /** 中石化零售价 */
   snpPrice?: number
   /** 站服务费清分方式(1线上实时,2 线下月度) */
   splitType?: number
@@ -1084,6 +1086,46 @@ interface 气瓶检测订单附件信息 {
   /** 气瓶检测订单id */
   gctOrderId?: number
 }
+interface 订单查询参数实体类 {
+  /** 车牌号 */
+  carNumber?: string
+  /** 物流公司id(user.org.org_id) */
+  carrierOrgId?: number
+  /** 物流公司 */
+  carrierOrgName?: string
+  /** 收银员姓名 */
+  cashierName?: string
+  /** 司机id(user.user.user_id) */
+  driverId?: number
+  /** 驾驶员姓名 */
+  driverName?: string
+  /** 创建时间查询结束时间,格式:yyyy-MM-dd HH:mm:ss */
+  endCreateDate?: string
+  /** 支付时间查询结束时间,格式:yyyy-MM-dd HH:mm:ss */
+  endUpdateDate?: string
+  /** 加气站id */
+  gasstationId?: number
+  /** 加气站名称 */
+  gasstationName?: string
+  /** 经营模式: 0-一体化 1-新营销 */
+  marketType?: number
+  /** 订单编号 */
+  orderId?: number
+  /** 销售方式,null(不传参).全部  1.大象线上,2.加注机线下-优惠,3.加注机线下-标准,4.三方线上-团液,5.三方线上-万金油,6.试机,7.CNG,8.三方线上-车旺,9.三方线上-解放,10.三方线上-成丰,多个状态查询,逗号间隔 */
+  orderTypes?: string
+  /** 支付方式,null(不传参).全部  0.所属物流-大象余额 1.所属物流-微信 2.所属物流-大象余额+微信 3.个人支付-微信 10:其他,多个状态查询,逗号间隔 */
+  payType?: string
+  /** 结算状态,null(不传参).全部  1.待支付 2.已支付 3.已取消 4.支付中 5.退款中 6.已退款 7.支付异常 10.其他,多个结算状态查询,逗号间隔 */
+  settleStatus?: string
+  /** 站清分方式,null(不传参).全部 1 线上实时,2 线下月度 */
+  splitType?: number
+  /** 创建时间查询开始时间,格式:yyyy-MM-dd HH:mm:ss */
+  startCreateDate?: string
+  /** 支付时间查询开始时间,格式:yyyy-MM-dd HH:mm:ss */
+  startUpdateDate?: string
+  /** 交易模式,null(不传参)全部  1大象经销 2大象直销 10.其他,多个状态查询,逗号间隔 */
+  tradeType?: string
+}
 interface 身份证二要素认证参数 {
   /** 身份证号 */
   idcardNo?: string

+ 8 - 0
src/utils/api/web/request/index.ts

@@ -25,6 +25,14 @@ const setRequestResult = ({ options, resolve, reject }) => {
 }
 
 const http = async <T>(options: IRequestOption) => {
+  if (store.common.data.mockScenes) {
+    const curMocks = mock.request()
+    const curMock = curMocks[store.common.data.mockScenes][options.urlObj.name]
+    if (curMock) {
+      // store.webapi[options.urlObj.group][options.urlObj.name].set(enums.ReqState.success)
+      return curMock.data
+    }
+  }
   if (options.urlObj.isUpload) {
     options.ext.choosFiles = await func.native.choose({ count: options.ext.fileCount })
   }

+ 6 - 2
src/utils/config/index.ts

@@ -5,6 +5,10 @@ const common = {
   isH5: __UNI_PLATFORM__ === 'h5',
   isApp: __UNI_PLATFORM__ === 'app',
   isMp: __UNI_PLATFORM__.startsWith('mp-'),
+  mockScenes: {
+    /** 提交审核假数据 */
+    examine: ' examine',
+  },
   /** 骨架屏默认 */
   skeletons: [
     ...Array(20).fill({
@@ -26,7 +30,8 @@ const common = {
    * 1.无任何信息 2.显示物流公司信息 3.显示退出申请 4.显示加入申请 5.显示预添加信息
    */
   get safeAreaTopHeight() {
-    return config.common.SystemInfo.safeArea.top + 44
+    return (config.common.SystemInfo.statusBarHeight || 40) + 44
+    // return config.common.SystemInfo.safeArea.top + 44
   },
   get orgDetailType() {
     return { 3: '申请退出', 4: '申请加入' }
@@ -100,7 +105,6 @@ const common = {
     return {
       1: '大象经销',
       2: '大象直销',
-      // 待定
       10: '其他',
     }
   },

+ 12 - 0
src/utils/config/interFaces/pay.ts

@@ -5,6 +5,12 @@ export default {
     reqType: {} as GasOrder对象,
     resType: {} as any,
   },
+  /** 创建加气订单 */
+  add_v2: {
+    realUrl: '/pay/gas_order/add_v2' as const,
+    reqType: {} as GasOrder对象,
+    resType: {} as any,
+  },
   /** 取消订单for收银员 */
   cancel_forcashier: {
     realUrl: '/pay/gas_order/cancel_forcashier' as const,
@@ -107,6 +113,12 @@ export default {
     reqType: {} as 通用id参数,
     resType: {} as Array<GasOrderRebate对象>,
   },
+  /** 查询订单 */
+  get_orders: {
+    realUrl: '/pay/gas_order/get_orders' as const,
+    reqType: {} as IPageParams<订单查询参数实体类>,
+    resType: {} as any,
+  },
   /** 获取gas_order列表 */
   list: {
     realUrl: '/pay/gas_order/list' as const,

+ 12 - 0
src/utils/config/interFaces/strategy.ts

@@ -1541,6 +1541,12 @@ export default {
     reqType: {} as GasOrder对象,
     resType: {} as GasOrder对象,
   },
+  /** 计算gasOrder价格 */
+  calculate_v2: {
+    realUrl: '/strategy/price/calculate_v2' as const,
+    reqType: {} as GasOrder对象,
+    resType: {} as GasOrder对象,
+  },
   /** 计算气瓶检测订单价格及补充信息 */
   gct_calculate: {
     realUrl: '/strategy/price/gct_calculate' as const,
@@ -2228,6 +2234,12 @@ export default {
     reqType: {} as SystemConfig对象,
     resType: {} as any,
   },
+  /** 前端数据拟造开关查询 */
+  mina_fake: {
+    realUrl: '/strategy/system_config/switch/mina_fake' as const,
+
+    resType: {} as boolean,
+  },
   /** 根据name修改value */
   update_by_Name: {
     realUrl: '/strategy/system_config/update_by_Name' as const,

+ 0 - 7
src/utils/config/pages.ts

@@ -1,11 +1,4 @@
 export default {
-  list_index: {
-    _url: '/pages/list/index',
-    _type: 'page',
-    title: 'list_index',
-    identity: true,
-    isPager: true
-  } as ayPage,
   webview_index: {
     _url: '/pages/webview/index',
     _type: 'page',

+ 12 - 0
src/utils/func/native.ts

@@ -1,5 +1,7 @@
 export default {
   async scan() {
+    // #ifdef H5
+    // debug模式模拟 扫码信息
     if (store.common.data.debug) {
       return {
         cashierId: '710613333157822464',
@@ -8,6 +10,7 @@ export default {
         orgId: '720613316032479232',
       }
     }
+    // #endif
     const reqStr = await uni
       .scanCode({
         scanType: ['qrcode'],
@@ -75,6 +78,15 @@ export default {
         latitude: string
       }
   > {
+    // #ifdef H5
+    // debug 模式模拟经纬度
+    if (store.common.data.debug) {
+      return {
+        longitude: '120.582334',
+        latitude: '36.180647',
+      }
+    }
+    // #endif
     if (!returnDef) {
       const rv = await func.native.openSetting('scope.userLocation')
       if (!rv) {

文件差異過大導致無法顯示
+ 185 - 0
src/utils/mock/index.ts


+ 2 - 0
src/utils/store/common.ts

@@ -7,6 +7,8 @@ export default defineStore('common', () => {
     preferWeight: 800,
     /** 客服电话 */
     phone: '400-016-5388',
+    /** mock场景值 */
+    mockScenes: '',
   })
   return {
     data,

+ 3 - 0
src/utils/store/user.ts

@@ -33,6 +33,9 @@ const useUserStore = defineStore(
       }
       userInfo.value = data
       userInfo.value.mobileDes = func.convert.mobileDes(data.mobile)
+      if (store.common.data.mockScenes === config.common.mockScenes.examine) {
+        userInfo.value.mobileDes = ''
+      }
       userInfo.value.token = val.access_token
       userInfo.value.orgId = val.user.authorities[0].orgId
       userInfo.value.roleId = val.user.authorities[0].roles[0].roleId

+ 1 - 0
vite.config.ts

@@ -107,6 +107,7 @@ export default ({ command, mode }) => {
             '@/utils/config': [['default', 'config']],
             '@/utils/func': [['default', 'func']],
             '@/utils/aop': [['default', 'aop']],
+            '@/utils/mock': [['default', 'mock']],
           },
         ],
         dts: 'src/types/auto-import.d.ts',