Kaynağa Gözat

```
feat(film): 更新电影模块功能和样式调整

- 将api.type.d.ts中的showSt类型从string改为number
- 更新开发环境配置,启用正式接口地址
- 注释掉购物车页面部分未完成的功能入口
- 修复购物车页面样式类名格式问题(添加减号分隔符)
- 在选座组件中设置最大可选座位数为4,关闭孤座检查
- 优化时间选择逻辑,避免重复选择
- 调整电影详情页购买按钮显示条件
- 完善订单状态显示逻辑
- 修复跳转参数传递问题
- 添加位置获取逻辑
- 优化订单列表时间格式化显示
- 修复点击事件冒泡问题
- 完善积分获取逻辑并添加错误处理
```

wenjie 1 hafta önce
ebeveyn
işleme
52e2c18dff

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

@@ -1575,7 +1575,7 @@ namespace Api {
     star?: string
     releaseTime?: string
     comingTitle?: string
-    showSt?: string
+    showSt?: number
     category?: string
     director?: string
     originPrice?: string

+ 2 - 2
src/config/index.ts

@@ -6,12 +6,12 @@ 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://74949mkfh190.vicp.fun', // 付
   // develop: 'http://47.109.84.152:8081',
-  // develop: 'https://smqjh.api.zswlgz.com',
+  develop: 'https://smqjh.api.zswlgz.com',
   /**
    * 体验版
    */

+ 38 - 38
src/pages/cart/index.vue

@@ -23,11 +23,11 @@ const navList = ref([
   { title: '全部', id: 1 },
   { title: '星闪豹', id: 2 },
   { title: '电影演出', id: 3 },
-  { title: '视频权益', id: 4 },
-  { title: '大牌点餐', id: 5 },
+  // { title: '视频权益', id: 4 },
+  // { title: '大牌点餐', id: 5 },
   { title: '加油', id: 6 },
-  { title: '酒店民宿', id: 7 },
-  { title: '代驾', id: 8 },
+  // { title: '酒店民宿', id: 7 },
+  // { title: '代驾', id: 8 },
 ])
 
 watch(() => cartList.value, async () => {
@@ -49,53 +49,53 @@ async function handleSelectAddress() {
       safe-area-inset-top fixed
     >
       <template #left>
-        <view class="ml10rpx flex items-center" @click.stop="handleSelectAddress">
-          <view class="mr20rpx text-36rpx font-semibold">
+        <view class="ml-10rpx flex items-center" @click.stop="handleSelectAddress">
+          <view class="mr-20rpx text-36rpx font-semibold">
             购物车
           </view>
-          <image :src="`${StaticUrl}/location-green.png`" class="h33.8rpx w29rpx" />
-          <view class="ml10rpx max-w-280rpx truncate text-32rpx text-#222 font-semibold">
+          <image :src="`${StaticUrl}/location-green.png`" class="h-33.8rpx w-29rpx" />
+          <view class="ml-10rpx max-w-280rpx truncate text-32rpx text-[#222] font-semibold">
             {{ smqjhSelectedAddress?.city || '请选择地址' }}
           </view>
         </view>
       </template>
     </wd-navbar>
-    <view class="xsb-linear h406rpx" />
+    <view class="xsb-linear h-406rpx" />
     <view class="-mt220rpx">
-      <view class="flex items-center justify-between pb16rpx">
-        <view class="w85%">
+      <view class="flex items-center justify-between pb-16rpx">
+        <view class="w-[85%]">
           <wd-tabs v-model="tab">
             <block v-for="tabs in navList" :key="tabs.id">
               <wd-tab :title="tabs.title" />
             </block>
           </wd-tabs>
         </view>
-        <view class="guanli h80rpx w104rpx flex flex-shrink-0 items-center justify-center text-28rpx font-semibold">
+        <view class="guanli h-80rpx w-104rpx flex flex-shrink-0 items-center justify-center text-28rpx font-semibold">
           管理
         </view>
       </view>
-      <scroll-view scroll-y class="content box-border px24rpx">
-        <view v-for="shop in cartList" :key="shop.shopId" class="mb24rpx rounded-16rpx bg-white px24rpx pb18rpx pt28rpx">
+      <scroll-view scroll-y class="content box-border px-24rpx">
+        <view v-for="shop in cartList" :key="shop.shopId" class="mb-24rpx rounded-16rpx bg-white px-24rpx pb-18rpx pt-28rpx">
           <wd-checkbox v-model="shop.AllShopGoods" size="large" @change="cartStore.cartStoreAllChecked($event, shop)">
             <view class="text-28rpx font-semibold">
               {{ shop.shopName }}
             </view>
           </wd-checkbox>
-          <view class="mt20rpx h2rpx w-full bg-#F0F0F0" />
+          <view class="mt-20rpx h-2rpx w-full bg-[#F0F0F0]" />
           <wd-checkbox-group v-model="shop.allGoods" size="large" @change="cartStore.cartGoodsChecked($event, shop)">
             <view
-              v-for="item in shop.skuList" :key="item.id" class="relative mt20rpx flex items-center"
+              v-for="item in shop.skuList" :key="item.id" class="relative mt-20rpx flex items-center"
             >
-              <view class="mr20rpx h32rpx w32rpx">
+              <view class="mr-20rpx h-32rpx w-32rpx">
                 <wd-checkbox :model-value="item.id" />
               </view>
               <view class="flex flex-1">
                 <image
                   :src="item.pic"
-                  class="h206rpx w200rpx flex-shrink-0"
+                  class="h-206rpx w-200rpx flex-shrink-0"
                   @click.stop="router.push({ name: 'xsb-goods', params: { id: String(item.prodId) } })"
                 />
-                <view class="ml20rpx flex-1">
+                <view class="ml-20rpx flex-1">
                   <view class="text-left text-28rpx font-semibold">
                     <!-- <view v-for="i in 2" :key="i" class="mr5px inline-block">
                         <wd-tag type="danger">
@@ -104,26 +104,26 @@ async function handleSelectAddress() {
                       </view> -->
                     {{ item.skuName }}
                   </view>
-                  <view class="mt14rpx text-24rpx text-#AAAAAA">
+                  <view class="mt-14rpx text-24rpx text-[#AAAAAA]">
                     规格:{{ item.spec }}
                   </view>
-                  <view class="mt14rpx flex items-center justify-between">
-                    <view class="text-36rpx text-#FF4A39 font-semibold">
+                  <view class="mt-14rpx flex items-center justify-between">
+                    <view class="text-36rpx text-[#FF4A39] font-semibold">
                       ¥{{ item.price }}
                     </view>
                     <!-- <wd-input-number v-model="item.num" disable-input @change="handleChangeNum($event, item)" /> -->
                     <view class="flex items-center">
                       <image
                         :src="` ${StaticUrl}/sub-cart.png`"
-                        class="h44rpx w44rpx"
+                        class="h-44rpx w-44rpx"
                         @click.stop="cartStore.cartSubGoods(item)"
                       />
-                      <view class="box-border h44rpx w84rpx flex items-center justify-center border border-#F0F0F0 border-solid text-24rpx text-#AAAAAA">
+                      <view class="box-border h-44rpx w-84rpx flex items-center justify-center border border-[#F0F0F0] border-solid text-24rpx text-[#AAAAAA]">
                         {{ item.num }}
                       </view>
                       <image
                         :src="` ${StaticUrl}/add-cart.png`"
-                        class="h44rpx w44rpx"
+                        class="h-44rpx w-44rpx"
                         @click.stop="cartStore.cartAddGoods(item)"
                       />
                     </view>
@@ -131,12 +131,12 @@ async function handleSelectAddress() {
                 </view>
               </view>
               <view v-if="item.shopSkuStocks == '0'" class="absolute left-0 top-0 z-1 h-full w-full flex items-center justify-center bg-[rgba(255,255,255,.6)]">
-                <view class="rounded-16rpx bg-[rgba(0,0,0,.5)] p20rpx text-white">
+                <view class="rounded-16rpx bg-[rgba(0,0,0,.5)] p-20rpx text-white">
                   商品已售罄
                 </view>
               </view>
               <view v-if="item.isDelete == '1'" class="absolute left-0 top-0 z-1 h-full w-full flex items-center justify-center bg-[rgba(255,255,255,.6)]">
-                <view class="rounded-16rpx bg-[rgba(0,0,0,.5)] p20rpx text-white">
+                <view class="rounded-16rpx bg-[rgba(0,0,0,.5)] p-20rpx text-white">
                   商品已删除
                 </view>
               </view>
@@ -145,9 +145,9 @@ async function handleSelectAddress() {
         </view>
 
         <view v-if="!cartList.length" class="box-border w-full flex items-center justify-center">
-          <view class="mt220rpx flex flex-col items-center">
-            <image :src="`${StaticUrl}/cart.png`" class="h110rpx w110rpx" />
-            <view class="mb20rpx mt20rpx text-24rpx">
+          <view class="mt-220rpx flex flex-col items-center">
+            <image :src="`${StaticUrl}/cart.png`" class="h-110rpx w-110rpx" />
+            <view class="mb-20rpx mt-20rpx text-24rpx">
               你还没有添加商品哦~
             </view>
             <wd-button plain @click=" useTabbar().setTabbarItemActive('smqjh-home'), router.pushTab({ name: 'smqjh-home' })">
@@ -155,38 +155,38 @@ async function handleSelectAddress() {
             </wd-button>
           </view>
         </view>
-        <view class="h140rpx" />
+        <view class="h-140rpx" />
       </scroll-view>
     </view>
-    <view v-if="cartList.length" class="fixedShadow fixed bottom-60rpx left-0 z-99 box-border w-full flex items-center justify-between rounded-t-16rpx bg-white px24rpx pb60rpx pt10rpx">
+    <view v-if="cartList.length" class="fixedShadow fixed bottom-60rpx left-0 z-99 box-border w-full flex items-center justify-between rounded-t-16rpx bg-white px-24rpx pb-60rpx pt-10rpx">
       <view class="ios w-full flex items-center justify-between">
         <view class="flex items-center">
           <image
             :src="`${StaticUrl}/cart-lanzi.png`"
-            class="h100rpx w100rpx"
+            class="h-100rpx w-100rpx"
           />
-          <view class="ml16rpx flex items-center">
+          <view class="ml-16rpx flex items-center">
             <wd-checkbox v-model="isCartAllChecked" size="large" @change="cartStore.cartAllChecked">
               全选
             </wd-checkbox>
-            <view class="ml10rpx text-24rpx text-#FF4A39" @click="cartStore.cartDeleteGoods">
+            <view class="ml-10rpx text-24rpx text-[#FF4A39]" @click="cartStore.cartDeleteGoods">
               删除
             </view>
           </view>
         </view>
         <view class="flex items-center">
           <view class="flex items-center font-semibold">
-            <view class="text-22rpx text-#222">
+            <view class="text-22rpx text-[#222]">
               总计:
             </view>
-            <view class="flex items-baseline text-24rpx text-#FF4A39">
+            <view class="flex items-baseline text-24rpx text-[#FF4A39]">
               <text class="text-36rpx">
                 {{ totalProduct?.price || '0.00' }}
               </text>
             </view>
           </view>
-          <view class="ml20rpx w160rpx">
+          <view class="ml-20rpx w-160rpx">
             <wd-button block size="large" @click="cartStore.cartOrderConfirm">
               结算
             </wd-button>

+ 3 - 1
src/subPack-film/choose-film/index.vue

@@ -93,6 +93,8 @@ function handleFilm(title: string = '保利万和学府影城', cinemaId: string
 
 async function getData() {
   uni.showLoading({ title: '加载中' })
+  console.log('qingind', query.value)
+
   const res = await Apis.film.getFilmList({ data: query.value })
   uni.hideLoading()
   if (res.data) {
@@ -306,7 +308,7 @@ onLoad((options) => {
             </view>
             <view
               v-for="(item, index) in cityList[currentCity].districts" :key="index" class="choose-item"
-              @click="choose(item.cityId, item.districtId)"
+              @click="choose(item.cityId, currentCity, item.districtId)"
             >
               <view class="name" :class="[query.districtId == item.districtId ? 'active' : '']">
                 {{ item.districtName }}

+ 2 - 2
src/subPack-film/choose-seat/components/pages/config.js

@@ -9,11 +9,11 @@ export default {
   topHeight: 40, // 画布距离视口顶部高度 用于计算坐标。
   hallHeight: 40, // 画布中荧幕高度
   footerHeight: 0, // 底部区域的高度
-  maxSelectNum: 0, // 最大可选座位数
+  maxSelectNum: 4, // 最大可选座位数
   seatMaxWidth: 35, // 座位的最大宽度
   seatMinWidth: 5, // 座位的最小宽度
   miniMapShowTime: 2000, // 停止操作后,过多久隐藏小图
-  isolateSeats: true, // 孤座检查是否开启
+  isolateSeats: false, // 孤座检查是否开启
   areaList: [], // 座位区域 格式见md文档
   SEAT_FIELDS: {
     ROW_ID: 'rowId', // 行ID字段名

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

@@ -369,6 +369,9 @@ onLoad(async (opt): Promise<void> => {
 })
 
 function handleTime(time: string, sessionId: string) {
+  if (time === active.value) {
+    return
+  }
   active.value = time
   router.push({ name: 'film-choose-seat', params: { sessionId, movieId: seatInfo.value.movieId as string, cinemaId: seatInfo.value.cinemaId } })
 }

+ 2 - 6
src/subPack-film/index/index.vue

@@ -23,10 +23,6 @@ function jump(active: any) {
   router.push({ name: 'film-movie', params: { active } })
 }
 
-function handleItem() {
-  console.log('dianji')
-}
-
 function handleBuy(item: Api.filmMovieList) {
   console.log('goumai')
   router.push({ name: 'film-movie-detail', params: { id: item.id as string, movieId: item.movieId as string } })
@@ -69,7 +65,7 @@ onMounted(() => {
       <view class="p-0r gap-y-10r grid grid-cols-4 w-full gap-x-20rpx">
         <view
           v-for="(item, index) in hotList" :key="index" class="item relative aspect-square w-152rpx"
-          @click="handleItem"
+          @click="handleBuy(item)"
         >
           <view class="tag absolute rounded-8rpx bg-[rgba(34,34,34,0.7)] px-10rpx text-18rpx text-[#fff] leading-26rpx">
             {{ item.version }}
@@ -98,7 +94,7 @@ onMounted(() => {
       <view class="gap-y-10r p-0r grid grid-cols-4 w-full gap-x-20rpx">
         <view
           v-for="(item, index) in comingSoonList" :key="index" class="item relative aspect-square w-152rpx"
-          @click="handleItem"
+          @click="handleBuy(item)"
         >
           <view class="tag absolute rounded-8rpx bg-[rgba(34,34,34,0.7)] px-10rpx text-18rpx text-[#fff] leading-26rpx">
             {{ item.version }}

+ 1 - 1
src/subPack-film/movie-detail/index.vue

@@ -122,7 +122,7 @@ onLoad((options) => {
       </scroll-view>
     </view> -->
 
-    <view class="btn-box">
+    <view v-if="info.showSt as number == 1 " class="btn-box">
       <button class="buy-btn" type="default" @click="buy">
         特惠购票
       </button>

+ 12 - 6
src/subPack-film/movie/index.vue

@@ -108,11 +108,11 @@ function addPageNum() {
 onLoad((options) => {
   console.log('onload', options)
 
-  active.value = options?.active || 0
+  active.value = Number(options?.active || 0)
   refreshData()
 })
 onReachBottom(() => {
-  console.log('onReachBottom')
+  console.log('onReachBottom', state.value)
   addPageNum()
 })
 
@@ -123,14 +123,14 @@ function handleItem(index: number) {
   loadData()
 }
 
-function handleFilm(title: string = '保利万和学府影城') {
-  console.log(title)
-
+function handleFilm(title: string, movieId: string, cinemaId: string) {
   router.push({
     name: 'film-select-time',
     params: {
       id: '2221',
       title,
+      movieId,
+      cinemaId,
     },
   })
 }
@@ -143,6 +143,12 @@ function handleBuy(item: Api.filmMovieList) {
 function handleWant() {
   useGlobalToast().show('敬请期待')
 }
+
+onMounted(() => {
+  if (!Location.value.latitude) {
+    useAddressStore().getLocation()
+  }
+})
 </script>
 
 <template>
@@ -219,7 +225,7 @@ function handleWant() {
 
     <!-- 影院 列表 -->
     <view v-else-if="active == 1" class="film-list">
-      <view v-for="(item, index) in filmList" :key="index" class="film-item" @click="handleFilm()">
+      <view v-for="(item, index) in filmList" :key="index" class="film-item" @click="handleFilm(item.name, '', item.cinemaId)">
         <view class="name-box">
           <view class="name w-450rpx overflow-hidden text-ellipsis whitespace-nowrap">
             {{ item.name }}

+ 1 - 1
src/subPack-film/order-detail/index.vue

@@ -75,7 +75,7 @@ onLoad((options) => {
   <view class="film-order-detail">
     <view class="status">
       <!-- 支付成功,待出票  -->
-      {{ handleCommonOrderStatusText(orderInfo) }}
+      {{ orderInfo.hbOrderStatus == 0 ? "待支付" : handleCommonOrderStatusText(orderInfo) }}
     </view>
     <view class="status-desc">
       如需改签、退款,请直接联系商家

+ 10 - 5
src/subPack-film/order/index.vue

@@ -1,7 +1,9 @@
 <script setup lang="ts">
 import Tabbar from '../components/tabbar.vue'
 import { OrderStatus, handleCommonCancelOrder, handleCommonOrderStatusText } from '../utils/order-data'
+import { getWxCommonPayment, handleCommonPayMent } from '../utils/confirm-order'
 // import { StaticUrl } from '@/config'
+import { timeFormat } from '../utils'
 import { createGlobalLoadingMiddleware } from '@/api/core/middleware'
 import router from '@/router'
 
@@ -101,7 +103,10 @@ onLoad(() => {
 
     <!-- 列表 -->
     <view class="order-list">
-      <view v-for="(item, index) in orderList" :key="index" class="order-item block" @click.self="handleOrder(item.orderNumber as string)">
+      <view
+        v-for="(item, index) in orderList" :key="index" class="order-item block"
+        @click.self="handleOrder(item.orderNumber as string)"
+      >
         <view class="top-box">
           <view class="title">
             {{ item.movieName }}
@@ -136,7 +141,7 @@ onLoad(() => {
               影院:{{ item.cinemaName }}
             </view>
             <view class="info-item">
-              场次:2025-12-23 21:00
+              场次:{{ timeFormat(item.session) }}
             </view>
             <view class="info-item">
               数量:{{ item.orderMovieItems?.length }}张
@@ -152,14 +157,14 @@ onLoad(() => {
             <view
               class="btn cancel"
               custom-style="width: 128rpx;height: 38rpx;font-size: 24rpx;color: #AAAAAA;box-sizing: border-box;"
-              @click="handleCancel(item)"
+              @click.stop="handleCancel(item)"
             >
               取消订单
             </view>
             <view
               class="btn"
               custom-style="width: 128rpx;height: 38rpx;font-size: 24rpx;color: #222222;box-sizing: border-box"
-              @click="handlePay(item.orderNumber as string)"
+              @click.stop="handlePay(item.orderNumber as string)"
             >
               付款
             </view>
@@ -167,7 +172,7 @@ onLoad(() => {
           <wd-button
             v-if="item.orderMovieItems[0].ticketCode"
             custom-style="width: 188rpx;height: 44rpx;font-size: 28rpx;box-sizing: border-box"
-            @click="handleCopy(item.orderMovieItems[0].ticketCode as string)"
+            @click.stop="handleCopy(item.orderMovieItems[0].ticketCode as string)"
           >
             复制取票码
           </wd-button>

+ 7 - 4
src/subPack-film/select-time/index.vue

@@ -55,7 +55,9 @@ const movieShows = computed(() => {
 function handleClick(index: number, movieId: string) {
   current.value = index
   query.value.movieId = movieId
-  getData()
+  getData().then(() => {
+    getDate(movieId)
+  })
   console.log(333333, current.value)
 }
 function changeTime(val: string) {
@@ -91,7 +93,7 @@ async function getData() {
 }
 
 async function getDate(movieId: string) {
-  const res = await Apis.film.getFilmDateList({ data: { movieId } })
+  const res = await Apis.film.getFilmDateList({ data: { movieId, cinemaId: query.value.cinemaId } })
   dayList.value = res.data
 }
 
@@ -101,8 +103,9 @@ onLoad((options) => {
   uni.setNavigationBarTitle({ title: options?.title })
   query.value.movieId = options?.movieId
   query.value.cinemaId = options?.cinemaId
-  getDate(options?.movieId)
-  getData()
+  getData().then(() => {
+    getDate(options?.movieId || filmInfo.value.movieShows?.[0].movieId)
+  })
 })
 </script>
 

+ 8 - 2
src/subPack-film/submit-order/index.vue

@@ -108,6 +108,7 @@ async function pay() {
   })
   const { data: orderNumber } = await Apis.film.addFilmOrder({ data: query.value })
   const res = await handleCommonPayMent(orderNumber)
+  loading.value = false
   if (res.payType !== 1) {
     await getWxCommonPayment(res)
     await paySuccess()
@@ -115,7 +116,6 @@ async function pay() {
   else {
     await paySuccess()
   }
-  loading.value = false
 }
 
 function call() {
@@ -125,7 +125,13 @@ function call() {
 }
 async function getPoints() {
   const res = await Apis.xsb.findUserPoints({})
-  info.value.points = res.data.availablePointsTotal as number
+  if (res.data) {
+    info.value.points = res.data.availablePointsTotal as number
+  }
+  else {
+    info.value.points = 0
+  }
+  console.log(11111111, info.value.points)
 }
 getPoints()
 

+ 4 - 4
src/subPack-smqjh/components/film-orderList/film-orderList.vue

@@ -98,7 +98,7 @@ function handleOrder(orderNo: string) {
           影院:{{ item.cinemaName }}
         </view>
         <view class="info-item">
-          场次:2025-12-23 21:00
+          场次:{{ item.session.replace('T', ' ') }}
         </view>
         <view class="info-item">
           数量:{{ item.orderMovieItems?.length }}张
@@ -114,14 +114,14 @@ function handleOrder(orderNo: string) {
         <view
           class="btn cancel"
           custom-style="width: 128rpx;height: 38rpx;font-size: 24rpx;color: #AAAAAA;box-sizing: border-box;"
-          @click="handleCancel(item)"
+          @click.stop="handleCancel(item)"
         >
           取消订单
         </view>
         <view
           class="btn"
           custom-style="width: 128rpx;height: 38rpx;font-size: 24rpx;color: #222222;box-sizing: border-box"
-          @click="handlePay(item.orderNumber as string)"
+          @click.stop="handlePay(item.orderNumber as string)"
         >
           付款
         </view>
@@ -129,7 +129,7 @@ function handleOrder(orderNo: string) {
       <wd-button
         v-if="item.orderMovieItems[0].ticketCode"
         custom-style="width: 188rpx;height: 44rpx;font-size: 28rpx;box-sizing: border-box"
-        @click="handleCopy(item.orderMovieItems[0].ticketCode as string)"
+        @click.stop="handleCopy(item.orderMovieItems[0].ticketCode as string)"
       >
         复制取票码
       </wd-button>