Просмотр исходного кода

chore(config): 优化配置与调整部分功能显示逻辑

- vite.config.ts 中新增本地开发服务器端口配置为 9527
- env.d.ts 添加 Vue 组件类型声明,完善类型支持
- 调整接口请求中 X-Tenant-code 头部设置逻辑,改为响应式读取 tenantCode
- tabbar 组件增加 isShow 属性,支持动态控制标签显示
- 根据 isOnlineAudit 状态过滤 tabbar 项,隐藏分类页签
- 更新 config/index.ts 中部分接口与环境地址的注释和默认值
- iconfont 样式中新增对 ttf 和 svg 格式的支持,提升兼容性
- 修正 tabbar.vue 移除多余空行
- 用户 store 查询时加入 tenantCode 参数
- 三方支付页面改进 tenantCode 传递及登录逻辑
- 影片选座页面修正座位列号和行号的参数映射
- 订单确认页调整券标签的主题色样式,用 CSS 变量替代硬编码颜色
zhangtao 1 неделя назад
Родитель
Сommit
f910b0f1e9

+ 4 - 2
src/api/core/instance.ts

@@ -15,8 +15,10 @@ export const alovaInstance = createAlova({
     }
     const { token } = useUserStore()
     method.config.headers.Authorization = token || 'Basic c21xamgtYXBwbGV0OjEyMzQ1Ng=='
-
-    method.config.headers['X-Tenant-code'] = useSysStore().tenantCode || 'zswl'
+    const { tenantCode } = storeToRefs(useSysStore())
+    const code = tenantCode.value || 'zswl'
+    method.config.headers['X-Tenant-code'] = code
+    console.log(code, 'tenantCode======================')
 
     if (method.type === 'GET' && CommonUtil.isObj(method.config.params)) {
       method.config.params._t = Date.now()

+ 14 - 5
src/composables/useTabbar.ts

@@ -5,17 +5,26 @@ export interface TabbarItem {
   title: string
   icon2: string
   icon1: string
+  isShow: boolean
 }
 
 const tabbarItems = ref<TabbarItem[]>([
-  { name: 'smqjh-home', value: null, active: true, title: '首页', icon1: '', icon2: '' },
-  { name: 'smqjh-classfiy', value: null, active: false, title: '分类', icon1: '', icon2: '' },
-  { name: 'smqjh-cart', value: null, active: false, title: '购物车', icon1: '', icon2: '' },
-  { name: 'smqjh-my', value: null, active: false, title: '我的', icon1: '', icon2: '' },
+  { name: 'smqjh-home', value: null, active: true, title: '首页', icon1: '', icon2: '', isShow: true },
+  { name: 'smqjh-classfiy', value: null, active: false, title: '分类', icon1: '', icon2: '', isShow: true },
+  { name: 'smqjh-cart', value: null, active: false, title: '购物车', icon1: '', icon2: '', isShow: true },
+  { name: 'smqjh-my', value: null, active: false, title: '我的', icon1: '', icon2: '', isShow: true },
 ])
 
 export function useTabbar() {
-  const tabbarList = computed(() => tabbarItems.value)
+  const { isOnlineAudit } = storeToRefs(useSysStore())
+  const tabbarList = computed(() => {
+    if (isOnlineAudit.value) {
+      return tabbarItems.value.filter(item => item.name !== 'smqjh-classfiy')
+    }
+    else {
+      return tabbarItems.value
+    }
+  })
 
   const activeTabbar = computed(() => {
     const item = tabbarItems.value.find(item => item.active)

+ 5 - 4
src/config/index.ts

@@ -8,19 +8,20 @@ const mapEnvVersion = {
   // develop: 'http://192.168.1.253:8080',
   // develop: 'http://192.168.0.19:8080', // 邓
   // develop: 'http://192.168.1.20:8080', // 黄
-  develop: 'http://192.168.0.11:8081', // 王
+  // develop: 'http://192.168.0.11:8081', // 王
   // develop: 'http://192.168.1.21:8080', // 田
   // develop: 'http://74949mkfh190.vicp.fun', // 付
   // develop: 'http://47.109.84.152:8081', // 测试代理
   // develop: 'https://5ed0f7cc.r9.vip.cpolar.cn',
   // develop: 'https://25740642.r3.cpolar.top',
-  // develop: 'https://smqjh.api.zswlgz.com',
+  develop: 'https://smqjh.api.zswlgz.com',
   /**
    * 体验版
    */
   // trial: "http://192.168.1.166:8080/jeecg-boot",
   // trial: 'http://192.168.0.157:8080',
   trial: 'http://47.109.84.152:8081',
+  // trial: 'http://192.168.0.11:8081', // 王
   // trial: 'http://192.168.1.166:8080,
   // trial: 'https://smqjh.api.zswlgz.com',
   /**
@@ -45,9 +46,9 @@ function handleEnvVersion() {
   // #ifdef H5
   const mode = import.meta.env.MODE
   const h5Server = {
-    development: 'http://47.109.84.152:8081',
+    // development: 'http://47.109.84.152:8081',
     // development: 'http://192.168.0.157:8080',
-    // development: 'http://192.168.0.11:8081',
+    development: 'http://192.168.0.11:8081',
     // development: 'http://192.168.1.21:8080',
     // development: 'https://smqjh.api.zswlgz.com',
     // production: 'https://smqjh.api.zswlgz.com',

+ 7 - 0
src/env.d.ts

@@ -1 +1,8 @@
 /// <reference types="vite/client" />
+
+declare module '*.vue' {
+  import type { DefineComponent } from 'vue'
+
+  const component: DefineComponent<Record<string, never>, Record<string, never>, any>
+  export default component
+}

+ 2 - 0
src/iconfont/index.css

@@ -2,6 +2,8 @@
   font-family: "iconfont"; /* Project id 5175205 */
   src: url('iconfont.woff2?t=1778556699734') format('woff2'),
        url('iconfont.woff?t=1778556699734') format('woff'),
+       url('iconfont.ttf?t=1778556699734') format('truetype'),
+       url('iconfont.svg?t=1778556699734#iconfont') format('svg');
 }
 
 .iconfont {

+ 0 - 1
src/layouts/tabbar.vue

@@ -4,7 +4,6 @@ const route = useRoute()
 const { opcity } = storeToRefs(useSysStore())
 
 const { activeTabbar, getTabbarItemValue, setTabbarItemActive, tabbarList } = useTabbar()
-
 function handleTabbarChange({ value }: { value: string }) {
   setTabbarItemActive(value)
   router.pushTab({ name: value })

+ 1 - 0
src/store/user.ts

@@ -554,6 +554,7 @@ export const useUserStore = defineStore('user', {
       const query = {
         orderNumber,
         phone: String(this.userInfo.mobile),
+        tenantCode: useSysStore().tenantCode,
       }
       const queryString = Object.entries(query)
         .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)

+ 4 - 7
src/subPack-common/threePay/index.vue

@@ -5,15 +5,12 @@ import router from '@/router'
 definePage({ name: 'smqjh-threePay', islogin: false, style: { navigationBarTitleText: '支付', navigationStyle: 'custom' } })
 
 const { token } = storeToRefs(useUserStore())
+const { tenantCode } = storeToRefs(useSysStore())
 const orderNumber = ref()
 onLoad((options: any) => {
   orderNumber.value = options.orderNumber
-  if (options.phone && !token.value) {
-    handleLogin(options.phone)
-  }
-  else {
-    handlePay()
-  }
+  tenantCode.value = options.tenantCode
+  handleLogin(options.phone)
   console.log(options, '============options=======')
 })
 const priceInfo = ref<wxpay>()
@@ -122,7 +119,7 @@ onUnload(() => {
 
 <template>
   <view>
-    <wd-navbar title="支付" :bordered="false" :z-index="99" safe-area-inset-top fixed />
+    <wd-navbar title="支付" :bordered="false" :z-index="99" placeholder safe-area-inset-top fixed />
     <view v-if="priceInfo" class="px20rpx pt20rpx">
       <view class="text-center text-48rpx text-#FF4A39">
         ¥{{ (priceInfo?.price / 100).toFixed(2) }}

+ 5 - 3
src/subPack-film/choose-seat/index.vue

@@ -250,8 +250,11 @@ async function getData(sessionId: string, movieId: string, cinemaId: string): Pr
         seatType,
         seatName: seat.seatName,
         seatId: seat.originSeatID,
-        columnId: seat.colId,
-        rowId: item.rowsId,
+        columnId: seat.colNum,
+        rowId: item.rowsNum,
+        // columnId: i,
+        // rowId: index,
+
         areaId: seat.areaId,
         marketPrice,
         ticketPrice: price,
@@ -262,7 +265,6 @@ async function getData(sessionId: string, movieId: string, cinemaId: string): Pr
   }
 
   console.log(2222, areaList.value)
-
   // 赋值座位图配置项(严格符合 SeatmapOptions 接口)
   options.value = {
     title: '',

+ 2 - 2
src/subPack-xsb/confirmOrder/index.vue

@@ -509,14 +509,14 @@ async function handlePay() {
           <view class="mb-24rpx flex items-center">
             <view
               class="mr-16rpx flex-1 rounded-full py-18rpx text-center text-28rpx"
-              :class="couponTabActive === 0 ? 'bg-[#9ED605] text-white font-semibold' : 'bg-[#F0F0F0] text-[#666]'"
+              :class="couponTabActive === 0 ? 'bg-[var(--them-color)] text-white font-semibold' : 'bg-[#F0F0F0] text-[#666]'"
               @click="couponTabActive = 0"
             >
               可用券({{ availableCoupons.length }})
             </view>
             <view
               class="flex-1 rounded-full py-18rpx text-center text-28rpx"
-              :class="couponTabActive === 1 ? 'bg-[#9ED605] text-white font-semibold' : 'bg-[#F0F0F0] text-[#666]'"
+              :class="couponTabActive === 1 ? 'bg-[var(--them-color)] text-white font-semibold' : 'bg-[#F0F0F0] text-[#666]'"
               @click="couponTabActive = 1"
             >
               不可用券({{ unavailableCoupons.length }})

+ 3 - 0
vite.config.ts

@@ -21,6 +21,9 @@ export default async () => {
     build: {
       outDir: process.env.UNI_PLATFORM === 'h5' ? 'smqjhh5' : undefined,
     },
+    server: {
+      port: 9527,
+    },
     plugins: [
       // https://github.com/uni-helper/vite-plugin-uni-manifest
       UniHelperManifest(),