chenlei 1 год назад
Родитель
Сommit
95523ee960

+ 7 - 0
README.md

@@ -23,6 +23,13 @@
 
 
 执行 `pnpm uvm`
 执行 `pnpm uvm`
 
 
+如果出现:\config\interFaces\strategy.ts SyntaxError: Unexpected identifier 'as'
+很有可能是未找到 as 后面的类型导致的,更新一下接口配置信息:
+
+```
+pnpm gif
+```
+
 ## 📦 运行(支持热更新)
 ## 📦 运行(支持热更新)
 
 
 - web平台: `pnpm dev:h5`, 然后打开 [http://localhost:9000/](http://localhost:9000/)。
 - web平台: `pnpm dev:h5`, 然后打开 [http://localhost:9000/](http://localhost:9000/)。

+ 1 - 0
src/components/pull/index.vue

@@ -55,6 +55,7 @@ const methods = {
 }
 }
 
 
 onMounted(() => {
 onMounted(() => {
+  store.curPage.pageConfig.zpager = paging
   watch(
   watch(
     () => store.curPage.pagerInfo.loading,
     () => store.curPage.pagerInfo.loading,
     (nv) => {
     (nv) => {

+ 18 - 8
src/pages/index/index.vue

@@ -1,5 +1,6 @@
 <template>
 <template>
   <ay-container>
   <ay-container>
+    <span class="i-to-top" v-if="data.station.stickyed" @click="methods.goTop" />
     <div class="chunk p-b-0">
     <div class="chunk p-b-0">
       <div class="center justify-between top">
       <div class="center justify-between top">
         <div class="center" @click="methods.goPerson">
         <div class="center" @click="methods.goPerson">
@@ -95,13 +96,13 @@
       </div>
       </div>
     </div>
     </div>
     <div class="chuck list-app">
     <div class="chuck list-app">
-      <ay-sticky :top="0" relativeTo="#stations" targetSelector="#stationTop">
-        <div
-          class="center justify-between sticky"
-          id="stationTop"
-          :class="{ stickyed: data.station.stickyed }"
-          @click="methods.hiddenDoora"
-        >
+      <ay-sticky
+        :top="0"
+        relativeTo="#stations"
+        targetSelector="#stationTop"
+        @stickChange="methods.stickChange"
+      >
+        <div class="center justify-between sticky" id="stationTop" @click="methods.hiddenDoora">
           <div class="title" @click.stop="methods.hiddenDoorb">附近加气站</div>
           <div class="title" @click.stop="methods.hiddenDoorb">附近加气站</div>
           <div v-if="data.userLocation" @click="methods.drawerOpen">
           <div v-if="data.userLocation" @click="methods.drawerOpen">
             {{ data.station.curCity }}
             {{ data.station.curCity }}
@@ -131,7 +132,7 @@
       </div>
       </div>
       <div
       <div
         class="center p-color"
         class="center p-color"
-        v-show="!data.userLocation"
+        v-if="!data.userLocation"
         @click="methods.getListApp({ activation: true })"
         @click="methods.getListApp({ activation: true })"
       >
       >
         查看附近加气站
         查看附近加气站
@@ -296,6 +297,15 @@ const methods = ay.initMethods(
         data.hiddenDoor.push(0)
         data.hiddenDoor.push(0)
       }
       }
     },
     },
+    goTop() {
+      store.curPage.pageConfig.zpager.scrollToTop()
+      // uni.pageScrollTo({
+      //   scrollTop: 0,
+      // })
+    },
+    stickChange(e: any) {
+      data.station.stickyed = e.stickyed
+    },
     phone(num) {
     phone(num) {
       uni.makePhoneCall({
       uni.makePhoneCall({
         phoneNumber: num,
         phoneNumber: num,

+ 11 - 0
src/style/icon.scss

@@ -0,0 +1,11 @@
+.i-material-symbols-vertical-align-top-rounded {
+    --un-icon: url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M5 5q-.425 0-.712-.288T4 4t.288-.712T5 3h14q.425 0 .713.288T20 4t-.288.713T19 5zm7 16q-.425 0-.712-.288T11 20v-9.2l-1.9 1.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l3.6-3.6q.15-.15.325-.212T12 7.425t.375.063t.325.212l3.6 3.6q.275.275.275.7t-.275.7t-.7.275t-.7-.275L13 10.8V20q0 .425-.287.713T12 21'/%3E%3C/svg%3E");
+    -webkit-mask: var(--un-icon) no-repeat;
+    mask: var(--un-icon) no-repeat;
+    -webkit-mask-size: 100% 100%;
+    mask-size: 100% 100%;
+    background-color: currentColor;
+    color: inherit;
+    width: 1.2em;
+    height: 1.2em;
+}

+ 26 - 0
src/style/index.scss

@@ -507,4 +507,30 @@ page {
 // 修改zpaging最内层容器样式
 // 修改zpaging最内层容器样式
 .zp-paging-container-content {
 .zp-paging-container-content {
   padding: 0 $p-spac;
   padding: 0 $p-spac;
+}
+
+.i-to-top {
+  position: fixed;
+  right: $p-spac;
+  bottom: calc($p-spac * 4);
+  z-index: 1;
+  display: inline-block;
+  padding: calc($p-spac / 1.5);
+  font-size: 0;
+  background-color: $bg-color;
+  border: 2rpx solid $p-color;
+  border-radius: 50%;
+
+  &::after {
+    display: inline-block;
+    width: calc($p-fz * 2);
+    height: calc($p-fz * 2);
+    content: '';
+    background-color: $p-color;
+    -webkit-mask: var(--un-icon) no-repeat;
+    mask: var(--un-icon) no-repeat;
+    -webkit-mask-size: 100% 100%;
+    mask-size: 100% 100%;
+    --un-icon: url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 16 16' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' d='M2 2.5h12M7.979 13.906V4.957m4.13 3.889L7.98 4.715l-4.131 4.13'/%3E%3C/svg%3E");
+  }
 }
 }

+ 2 - 0
src/types/page.d.ts

@@ -31,6 +31,8 @@ interface ayPage {
   onceBackReloadArgs?: AyContainerEntryArgs
   onceBackReloadArgs?: AyContainerEntryArgs
   /** 当前页面的数据加载完毕接收函数 */
   /** 当前页面的数据加载完毕接收函数 */
   curCallBack?(args: AyContainerRefreshArgs): void
   curCallBack?(args: AyContainerRefreshArgs): void
+
+  zpager:
 }
 }
 /** 分页组件数据 */
 /** 分页组件数据 */
 interface PagerInfo {
 interface PagerInfo {

+ 66 - 0
src/types/schemas/strategy.d.ts

@@ -3392,6 +3392,42 @@ interface SnpPriceVO对象 {
   /** 中石化零售价(元/公斤) */
   /** 中石化零售价(元/公斤) */
   snpPrice?: number
   snpPrice?: number
 }
 }
+interface StationMap对象 {
+  /** 地址 */
+  address?: string
+  /** 城市 */
+  city?: string
+  /** 联系人 */
+  contacts?: string
+  /** 加气站名称 */
+  gasstationName?: string
+  /** undefined */
+  groad?: string
+  /** 主键id */
+  id?: string
+  /** 合作意向 */
+  intention?: string
+  /** 纬度 */
+  latitude?: string
+  /** 经度 */
+  longitude?: string
+  /** 业务经理姓名 */
+  managerName?: string
+  /** 手机号 */
+  mobile?: string
+  /** 省份 */
+  province?: string
+  /** 地区 */
+  region?: string
+  /** 备注 */
+  remark?: string
+  /** 所在路段及位置 */
+  road?: string
+  /** 站点类型:中石化站,社会站,中石油站,中海油站,合作经营站 */
+  stationType?: string
+  /** 车流量 */
+  truckFlow?: string
+}
 interface StatisticsGasstationParam {
 interface StatisticsGasstationParam {
   /** 日期 */
   /** 日期 */
   date?: string
   date?: string
@@ -4035,6 +4071,18 @@ interface manPriceStandard对象 {
   /** 类型(1-定时生效 2-立即生效) */
   /** 类型(1-定时生效 2-立即生效) */
   type?: number
   type?: number
 }
 }
+interface 三方对接_关停或者重启站推送_参数实体类 {
+  /** 物流公司id(推送的三方id) */
+  orgId?: number
+  /** 推送加气站id列表 */
+  stations?: 三方对接_关停或者重启站推送_站状态[]
+}
+interface 三方对接_关停或者重启站推送_站状态 {
+  /** 加气站id */
+  gasstationId?: number
+  /** 状态(0:启用 1:停用) */
+  status?: number
+}
 interface 三方线上数据查询参数 {
 interface 三方线上数据查询参数 {
   /** 查询结束时间,格式:yyyy-MM-dd HH:mm:ss */
   /** 查询结束时间,格式:yyyy-MM-dd HH:mm:ss */
   endTime?: string
   endTime?: string
@@ -4149,6 +4197,14 @@ interface 加气站交班信息管理表实体类 {
   /** 更新人姓名 */
   /** 更新人姓名 */
   updaterName?: string
   updaterName?: string
 }
 }
+interface 加气站运营管理查询实体类 {
+  /** 查询结束日期 */
+  end?: string
+  /** 站id */
+  gasstationId?: number
+  /** 查询开始日期 */
+  start?: string
+}
 interface 加注机全量数据查询参数 {
 interface 加注机全量数据查询参数 {
   /** 加注机卡号 */
   /** 加注机卡号 */
   cardNo?: string
   cardNo?: string
@@ -4581,11 +4637,21 @@ interface 待支付订单_可选支付方式物流支付实体类 {
   /** 所属物流支付微信支付金额 */
   /** 所属物流支付微信支付金额 */
   wxAmount?: number
   wxAmount?: number
 }
 }
+interface 待支付订单_可选支付方式站价格和优惠的快照信息 {
+  /** 平台挂牌价 */
+  platformPrice?: number
+  /** 满减优惠明细文字提示 */
+  reduceRebateStr?: string
+  /** 特价优惠明细文字提示 */
+  specialRebateStr?: string
+}
 interface 待支付订单_可选支付方式获取实体类 {
 interface 待支付订单_可选支付方式获取实体类 {
   /** 物流支付 */
   /** 物流支付 */
   carrierPay?: 待支付订单_可选支付方式物流支付实体类
   carrierPay?: 待支付订单_可选支付方式物流支付实体类
   /** 个人支付 */
   /** 个人支付 */
   personPay?: 待支付订单_可选支付方式个人支付实体类
   personPay?: 待支付订单_可选支付方式个人支付实体类
+  /** 站价格和优惠快照信息 */
+  stationVo?: 待支付订单_可选支付方式站价格和优惠的快照信息
 }
 }
 interface 成丰三方对接对象 {
 interface 成丰三方对接对象 {
   /** 组织名称 */
   /** 组织名称 */

+ 12 - 12
src/utils/config/interFaces/index.ts

@@ -1,30 +1,30 @@
 import websocket from './websocket'
 import websocket from './websocket'
-import settle from './settle'
+import allinpay from './allinpay'
 import tms from './tms'
 import tms from './tms'
-import account from './account'
 import message from './message'
 import message from './message'
-import user from './user'
+import account from './account'
+import settle from './settle'
 import pay from './pay'
 import pay from './pay'
-import allinpay from './allinpay'
 import strategy from './strategy'
 import strategy from './strategy'
+import user from './user'
 
 
 export default {
 export default {
   /** websocket打印中心 */
   /** websocket打印中心 */
   websocket,
   websocket,
-  /** 结算中心 */
-  settle,
+  /** 通联支付 */
+  allinpay,
   /** 运力中心 */
   /** 运力中心 */
   tms,
   tms,
-  /** 账户中心 */
-  account,
   /** 消息中心 */
   /** 消息中心 */
   message,
   message,
-  /** 用户中心 */
-  user,
+  /** 账户中心 */
+  account,
+  /** 结算中心 */
+  settle,
   /** 支付中心 */
   /** 支付中心 */
   pay,
   pay,
-  /** 通联支付 */
-  allinpay,
   /** 运营策略中心 */
   /** 运营策略中心 */
   strategy,
   strategy,
+  /** 用户中心 */
+  user,
 }
 }

+ 20 - 8
src/utils/config/interFaces/strategy.ts

@@ -539,7 +539,7 @@ export default {
   /** 查询站的历史概况汇总信息(运营销量监控) */
   /** 查询站的历史概况汇总信息(运营销量监控) */
   get_overview_gway: {
   get_overview_gway: {
     realUrl: '/strategy/flag_station_info/get_overview_gway' as const,
     realUrl: '/strategy/flag_station_info/get_overview_gway' as const,
-    reqType: {} as 站历史概况查询参数实体类,
+    reqType: {} as 加气站运营管理查询实体类,
     resType: {} as 站当日概况信息实体类,
     resType: {} as 站当日概况信息实体类,
   },
   },
   /** 查询站的历史概况信息 */
   /** 查询站的历史概况信息 */
@@ -2186,6 +2186,12 @@ export default {
     reqType: {} as ReleaseManage对象,
     reqType: {} as ReleaseManage对象,
     resType: {} as any,
     resType: {} as any,
   },
   },
+  /** 获取所有的站信息列表 */
+  list_58: {
+    realUrl: '/strategy/station_map/list' as const,
+
+    resType: {} as StationMap对象,
+  },
   /** 添加库存变动日志 */
   /** 添加库存变动日志 */
   add_33: {
   add_33: {
     realUrl: '/strategy/stock_log/add' as const,
     realUrl: '/strategy/stock_log/add' as const,
@@ -2253,7 +2259,7 @@ export default {
     resType: {} as any,
     resType: {} as any,
   },
   },
   /** 获取库存变动日志列表 */
   /** 获取库存变动日志列表 */
-  list_58: {
+  list_59: {
     realUrl: '/strategy/stock_log/list' as const,
     realUrl: '/strategy/stock_log/list' as const,
     reqType: {} as IPageParams<StockLog对象>,
     reqType: {} as IPageParams<StockLog对象>,
     resType: {} as any,
     resType: {} as any,
@@ -2307,7 +2313,7 @@ export default {
     resType: {} as any,
     resType: {} as any,
   },
   },
   /** 获取system_config_log列表 */
   /** 获取system_config_log列表 */
-  list_59: {
+  list_60: {
     realUrl: '/strategy/system_config_log/list' as const,
     realUrl: '/strategy/system_config_log/list' as const,
     reqType: {} as IPageParams<SystemConfigLog对象>,
     reqType: {} as IPageParams<SystemConfigLog对象>,
     resType: {} as any,
     resType: {} as any,
@@ -2337,7 +2343,7 @@ export default {
     resType: {} as any,
     resType: {} as any,
   },
   },
   /** 获取tag列表 */
   /** 获取tag列表 */
-  list_60: {
+  list_61: {
     realUrl: '/strategy/tag/list' as const,
     realUrl: '/strategy/tag/list' as const,
     reqType: {} as Tag对象,
     reqType: {} as Tag对象,
     resType: {} as any,
     resType: {} as any,
@@ -2408,6 +2414,12 @@ export default {
     reqType: {} as 成丰对接_站全量查询参数,
     reqType: {} as 成丰对接_站全量查询参数,
     resType: {} as any,
     resType: {} as any,
   },
   },
+  /** pushStationStatus */
+  push_station_status: {
+    realUrl: '/strategy/third_party/push_station_status' as const,
+    reqType: {} as 三方对接_关停或者重启站推送_参数实体类,
+    resType: {} as any,
+  },
   /** 查询全量加气站信息列表 */
   /** 查询全量加气站信息列表 */
   qr_gasstation: {
   qr_gasstation: {
     realUrl: '/strategy/third_party/qr_gasstation' as const,
     realUrl: '/strategy/third_party/qr_gasstation' as const,
@@ -2706,7 +2718,7 @@ export default {
     resType: {} as any,
     resType: {} as any,
   },
   },
   /** 卡车列表 */
   /** 卡车列表 */
-  list_61: {
+  list_62: {
     realUrl: '/strategy/truck/list' as const,
     realUrl: '/strategy/truck/list' as const,
     reqType: {} as IPageParams<Truck对象>,
     reqType: {} as IPageParams<Truck对象>,
     resType: {} as AnyObject,
     resType: {} as AnyObject,
@@ -2832,7 +2844,7 @@ export default {
     resType: {} as Array<TruckComContract对象>,
     resType: {} as Array<TruckComContract对象>,
   },
   },
   /** 获取truck_com_contract列表 */
   /** 获取truck_com_contract列表 */
-  list_62: {
+  list_63: {
     realUrl: '/strategy/truck_com_contract/list' as const,
     realUrl: '/strategy/truck_com_contract/list' as const,
     reqType: {} as IPageParams<TruckComContract对象>,
     reqType: {} as IPageParams<TruckComContract对象>,
     resType: {} as any,
     resType: {} as any,
@@ -2928,7 +2940,7 @@ export default {
     resType: {} as any,
     resType: {} as any,
   },
   },
   /** 获取truck_driver_log列表 */
   /** 获取truck_driver_log列表 */
-  list_63: {
+  list_64: {
     realUrl: '/strategy/truck_driver_log/list' as const,
     realUrl: '/strategy/truck_driver_log/list' as const,
     reqType: {} as IPageParams<TruckDriverLog对象>,
     reqType: {} as IPageParams<TruckDriverLog对象>,
     resType: {} as any,
     resType: {} as any,
@@ -2946,7 +2958,7 @@ export default {
     resType: {} as any,
     resType: {} as any,
   },
   },
   /** 获取truck_log列表 */
   /** 获取truck_log列表 */
-  list_64: {
+  list_65: {
     realUrl: '/strategy/truck_log/list' as const,
     realUrl: '/strategy/truck_log/list' as const,
     reqType: {} as IPageParams<TruckLog对象>,
     reqType: {} as IPageParams<TruckLog对象>,
     resType: {} as any,
     resType: {} as any,

+ 2 - 1
vite.config.ts

@@ -17,7 +17,7 @@ import AutoImport from 'unplugin-auto-import/vite'
 import { visualizer } from 'rollup-plugin-visualizer'
 import { visualizer } from 'rollup-plugin-visualizer'
 import ViteRestart from 'vite-plugin-restart'
 import ViteRestart from 'vite-plugin-restart'
 
 
-import { slimMPPlugin, generatePageConfig } from './vitePlugin'
+import { slimMPPlugin, UnoCssMPPlugin, generatePageConfig } from './vitePlugin'
 
 
 // https://vitejs.dev/config/
 // https://vitejs.dev/config/
 export default ({ command, mode }) => {
 export default ({ command, mode }) => {
@@ -56,6 +56,7 @@ export default ({ command, mode }) => {
     },
     },
     plugins: [
     plugins: [
       slimMPPlugin(),
       slimMPPlugin(),
+      UnoCssMPPlugin(),
       UniPages({
       UniPages({
         exclude: ['**/components/**/**.*'],
         exclude: ['**/components/**/**.*'],
         homePage: 'pages/index/index',
         homePage: 'pages/index/index',

+ 32 - 1
vitePlugin.ts

@@ -263,6 +263,37 @@ const convert = {
     }
     }
   },
   },
 }
 }
+/** 对 uno.config.ts 功能的不充 */
+function UnoCssMPPlugin(): Plugin {
+  return {
+    name: 'UnoCssMPPlugin',
+    /** 拦截app.wxss写入时修改 uno中的样式名称增加.container 前缀,提高样式权重 */
+    writeBundle(options, bundle) {
+      for (const filename in bundle) {
+        if (filename.includes('app.wxss')) {
+          const chunk = bundle[filename]
+          if (chunk.type === 'asset') {
+            const tempFilePath = `${options.dir}/${filename}`
+            const code = chunk.source as string
+            const allCss = code.split('/* stylelint-disable comment-empty-line-before */')
+            let unoCss = allCss[0]
+            unoCss = unoCss
+              .replaceAll('}', '}\n')
+              .replace(/(\.(?:(?!container).+))\{/g, '.container $1{')
+            files.write(tempFilePath, unoCss + allCss[1])
+
+            // bundle[filename] = {
+            //   fileName: 'app.wxss',
+            //   needsCodeReference: false,
+            //   source: '6666',
+            //   type: 'asset',
+            // }
+          }
+        }
+      }
+    },
+  }
+}
 /** 小程序瘦身插件 */
 /** 小程序瘦身插件 */
 function slimMPPlugin(): Plugin {
 function slimMPPlugin(): Plugin {
   if (config.env.UNI_PLATFORM === 'h5') {
   if (config.env.UNI_PLATFORM === 'h5') {
@@ -386,4 +417,4 @@ function generatePageConfig(ctx: PageContext) {
     })
     })
   }
   }
 }
 }
-export { slimMPPlugin, generatePageConfig }
+export { slimMPPlugin, UnoCssMPPlugin, generatePageConfig }