Explorar el Código

feat(components): Zpopup组件添加footer显示控制

- 在Zpopup组件中添加showfooter条件渲染,控制底部占位视图的显示

config: 更新开发环境API配置

- 将开发环境API地址从本地IP切换为线上测试地址
- 注释掉多个本地开发地址配置

fix(pages): 视频权益相关页面设置登录验证

- 将视频权益详情、订单确认等页面的islogin设置为true
- 确保这些页面需要用户登录才能访问

feat(store): 添加订单列表刷新状态管理

- 在sys store中添加refreshOrderList状态字段
- 用于监听并触发订单列表页面的刷新操作

feat(djk): 福利活动页面增加登录检查和商品选择功能

- 添加handleGo函数对福利活动跳转进行登录检查
- 实现商品选择确认弹窗,包含电话授权选项
- 增加福利商品价格展示逻辑

feat(djk): 商品详情页支持不同类型展示

- 添加type参数控制商品价格显示逻辑
- 支持福利价和原价的同时展示
- 根据类型禁用购买按钮

fix(djk): 订单详情页调用用户store方法

- 将订单取消、支付、删除等操作迁移到用户store中
- 通过refreshOrderList状态触发订单列表刷新

fix(xsbs): 分类组件优化用户体验

- 添加分类无子项时的"敬请期待"提示
- 调整网格布局间距和样式
- 修复导航栏层级问题
zhangtao hace 1 día
padre
commit
ac7e75724b

+ 1 - 1
src/components/Zpopup.vue

@@ -15,7 +15,7 @@ const show = defineModel({ default: false })
   <wd-popup v-model="show" lock-scroll custom-style="border-radius:32rpx;32rpx 0rpx 0rpx" :z-index="zindex" position="bottom">
     <view :style="{ background: bg }">
       <slot />
-      <view class="h150rpx" />
+      <view v-if="showfooter" class="h150rpx" />
       <view v-if="showfooter" class="ios footer fixed bottom-0 left-0 box-border w-full rounded-t-32rpx bg-white px24rpx pt20rpx">
         <slot name="footer" />
       </view>

+ 2 - 2
src/config/index.ts

@@ -8,10 +8,10 @@ const mapEnvVersion = {
   // develop: 'http://192.168.1.253:8080',
   // develop: 'http://192.168.0.19:8080',
   // develop: 'http://192.168.0.217:8080', // 黄
-  develop: 'http://192.168.1.89: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',
   /**
    * 体验版
    */

+ 3 - 3
src/pages.json

@@ -488,7 +488,7 @@
         {
           "path": "videoRightsDetail/videoRightsDetail",
           "name": "video-rights-detail",
-          "islogin": false,
+          "islogin": true,
           "style": {
             "navigationBarTitleText": "详情"
           }
@@ -496,7 +496,7 @@
         {
           "path": "videoRightsOrderInfo/videoRightsOrderInfo",
           "name": "video-rights-order-info",
-          "islogin": false,
+          "islogin": true,
           "style": {
             "navigationBarTitleText": "订单确认"
           }
@@ -504,7 +504,7 @@
         {
           "path": "videoRightsSubmitOrder/videoRightsSubmitOrder",
           "name": "video-rights-submit-order",
-          "islogin": false,
+          "islogin": true,
           "style": {
             "navigationBarTitleText": "订单确认"
           }

+ 5 - 0
src/store/sys.ts

@@ -32,6 +32,10 @@ interface SysState {
    * 是否上线审核
    */
   isOnlineAudit: boolean
+  /**
+   * 如果是组件模式加tabbar,从订单详情返回订单列表页面需要刷新,监听此字段刷新页面
+   */
+  refreshOrderList: boolean
 
 }
 export const useSysStore = defineStore('system', {
@@ -43,6 +47,7 @@ export const useSysStore = defineStore('system', {
     payFailPath: '',
     opcity: 0,
     isOnlineAudit: true,
+    refreshOrderList: false,
   }),
   actions: {
     getSystemData() {

+ 6 - 2
src/subPack-djk/commonTab/components/fl.vue

@@ -15,6 +15,10 @@ const mapStatus = [
   { status: 2, name: '进行中', color: '#52C41A' },
   { status: 3, name: '已结束', color: '#AAAAAA' },
 ]
+async function handleGo(item: Api.DjkWelfareVO) {
+  await useUserStore().checkLogin()
+  router.push({ name: 'djk-welfare', params: { id: String(item.id) } })
+}
 </script>
 
 <template>
@@ -29,8 +33,8 @@ const mapStatus = [
     />
     <scroll-view scroll-y :style="{ height: `calc(100vh - ${(statusBarHeight + MenuButtonHeight) * 4}rpx)` }">
       <view class="px24rpx">
-        <view v-for="item in flList" :key="item.id" class="mt20rpx rounded-16rpx bg-white p24rpx" @click="router.push({ name: 'djk-welfare', params: { id: String(item.id) } })">
-          <view class="h248rpx w-full">
+        <view v-for="item in flList" :key="item.id" class="mt20rpx rounded-16rpx bg-white p24rpx" @click="handleGo(item)">
+          <view class="h248rpx w-full overflow-hidden rounded-16rpx">
             <image
               :src="item.activityImg"
               class="h-full w-full"

+ 1 - 1
src/subPack-djk/commonTab/components/index.vue

@@ -49,7 +49,7 @@ function handleBottom() {
             </view>
           </view>
           <view class="ml164rpx">
-            <view v-for="its in item.goodsList" :key="its.id" class="mt14rpx flex items-center justify-between" @click="router.push({ name: 'djk-goods', params: { id: `${its.id}` } })">
+            <view v-for="its in item.goodsList" :key="its.id" class="mt14rpx flex items-center justify-between" @click="router.push({ name: 'djk-goods', params: { id: `${its.id}`, type: '0' } })">
               <view class="text-28rpx text-#FF4D3A font-semibold">
                 <text class="text-20rpx">

+ 5 - 1
src/subPack-djk/commonTab/components/order.vue

@@ -2,7 +2,7 @@
 import djkorder from '@/subPack-smqjh/components/djk-order/index.vue?async'
 import { createGlobalLoadingMiddleware } from '@/api/core/middleware'
 
-const { statusBarHeight, MenuButtonHeight } = storeToRefs(useSysStore())
+const { statusBarHeight, MenuButtonHeight, refreshOrderList } = storeToRefs(useSysStore())
 const { data: orderList, refresh, isLastPage, page, reload, error } = usePagination((pageNum, pageSize) => Apis.xsb.orderList({ data: {
   businessType: 'DJK',
   pageNum,
@@ -15,6 +15,7 @@ const { data: orderList, refresh, isLastPage, page, reload, error } = usePaginat
   data: res => res.data?.list,
   append: true,
   middleware: createGlobalLoadingMiddleware(),
+  immediate: false,
 })
 const state = computed(() => {
   return error.value ? 'error' : !isLastPage.value ? 'loading' : 'finished'
@@ -24,6 +25,9 @@ function handleBottom() {
     page.value++
   }
 }
+watch(() => refreshOrderList.value, () => {
+  console.log('刷新页面')
+})
 </script>
 
 <template>

+ 16 - 6
src/subPack-djk/goodsinfo/index.vue

@@ -14,7 +14,9 @@ const current = ref<number>(0)
 
 const isShowTab = ref(false)
 const goodsId = ref()
+const type = ref(0)
 onLoad((option: any) => {
+  type.value = option.type
   goodsId.value = option.id
   getGoodsDetaile()
 })
@@ -61,12 +63,20 @@ async function handlePay() {
     <template v-if="goodsInfo">
       <wd-swiper v-model:current="current" :list="swiperList" :autoplay="false" :height="375" />
       <view class="relative z999 rounded-t-48rpx bg-white px24rpx py28rpx -mt20rpx">
-        <view class="flex items-end text-#FF4D3A font-semibold">
-          <view class="text-24rpx">
-            
+        <view class="flex items-center">
+          <view v-if="type" class="text-24rpx text-#FF4D3A">
+            福利价
           </view>
-          <view class="text-36rpx line-height-[36rpx]">
-            {{ goodsInfo?.price }}
+          <view class="flex items-end text-#FF4D3A font-semibold">
+            <view class="text-24rpx">
+              ¥
+            </view>
+            <view class="text-36rpx line-height-[36rpx]">
+              {{ type ? 0 : goodsInfo?.price }}
+            </view>
+          </view>
+          <view v-if="type" class="ml16rpx text-24rpx text-gray line-through">
+            ¥{{ goodsInfo?.price }}
           </view>
         </view>
         <view class="mt20rpx text-32rpx font-semibold">
@@ -143,7 +153,7 @@ async function handlePay() {
             </view>
           </view>
           <view class="ml24rpx flex-1">
-            <wd-button block class="w-full" @click="handlePay">
+            <wd-button block class="w-full" :disabled="Boolean(type)" @click="handlePay">
               立即购买
             </wd-button>
           </view>

+ 6 - 4
src/subPack-djk/orderDetaile/index.vue

@@ -13,6 +13,7 @@ definePage({
 const collapse = ref(true)
 const orderInfo = ref<Api.xsbOrderList>()
 const orderNum = ref()
+const { refreshOrderList } = storeToRefs(useSysStore())
 onLoad((options: any) => {
   orderNum.value = options.id
   getDetail(options.id)
@@ -30,13 +31,13 @@ function handleCollapse() {
   collapse.value = !collapse.value
 }
 async function handleCancel() {
-  await handleCommonCancelOrder(orderInfo.value as Api.xsbOrderList)
+  await useUserStore().handleCommonCancelOrder(orderInfo.value as Api.xsbOrderList)
   getDetail(String(unref(orderInfo)?.orderNumber))
 }
 async function handlePay() {
-  const res = await handleCommonPayMent(String(unref(orderInfo)?.orderNumber))
+  const res = await useUserStore().handleCommonPayMent(String(unref(orderInfo)?.orderNumber))
   if (res.payType !== 1) {
-    await getWxCommonPayment(res)
+    await useUserStore().getWxCommonPayment(res)
     getDetail(String(unref(orderInfo)?.orderNumber))
   }
   else {
@@ -44,7 +45,8 @@ async function handlePay() {
   }
 }
 async function handelDel() {
-  await handleCommonDeleteOrder(unref(orderInfo) as Api.xsbOrderList)
+  await useUserStore().handleCommonDeleteOrder(unref(orderInfo) as Api.xsbOrderList)
+  refreshOrderList.value = true
   router.back()
 }
 async function handleFinish() {

+ 1 - 1
src/subPack-djk/shopinfo/index.vue

@@ -100,7 +100,7 @@ function handlePhone() {
         </view>
         <scroll-view scroll-y type="custom">
           <grid-view type="masonry" cross-axis-count="2" main-axis-gap="10" cross-axis-gap="10">
-            <view v-for="item in shopInfo.goodsList" :key="item.id" class="overflow-hidden rounded-16rpx" @click="router.push({ name: 'djk-goods', params: { id: `${item.id}` } })">
+            <view v-for="item in shopInfo.goodsList" :key="item.id" class="overflow-hidden rounded-16rpx" @click="router.push({ name: 'djk-goods', params: { id: `${item.id}`, type: '0' } })">
               <image
                 class="h318rpx w318rpx"
                 :src="item.goodsImg"

+ 71 - 3
src/subPack-djk/welfare/index.vue

@@ -3,27 +3,48 @@ import router from '@/router'
 
 definePage({ name: 'djk-welfare', islogin: false, style: { navigationBarTitleText: '活动详情' } })
 const welfare = ref<Api.DjkWelfareVO>()
+const show = ref(false)
+const isAllow = ref(true)
+const isEdit = ref(false)
 
 onLoad((options: any) => {
   getWelfare(options.id)
 })
 const mapUser = ['全部用户', '仅限新用户', '特定用户标签', '指定用户']
+const phone = ref(useUserStore().userInfo.mobile)
+const selectGoods = ref<Api.PmsDjkGoods>()
 async function getWelfare(id: number) {
   const res = await Apis.djk.welfareInfo({ data: { id } })
   welfare.value = res.data
 }
 async function handleSelect(item: Api.PmsDjkGoods) {
+  show.value = true
+  selectGoods.value = item
+}
+async function handelSubmit() {
+  uni.showLoading({ mask: true })
   try {
     await Apis.djk.welfareClaimInfo({
       data: {
         welfareId: Number(welfare.value?.id),
-        goodsId: item.id,
+        goodsId: selectGoods.value?.id,
         memberId: useUserStore().userInfo.id,
+        customerAuthorization: boolToNumber(isAllow.value),
       },
     })
+    const data = await Apis.djk.addWelfareOrder({ data: { shopId: selectGoods.value?.shopId, channelId: useUserStore().userInfo.channelId, phone: phone.value, goodsId: selectGoods.value?.id, goodsNum: 1, customerAuthorization: boolToNumber(isAllow.value) } })
     useGlobalToast().show('领取成功!')
+    uni.hideLoading()
+
+    setTimeout(() => {
+      router.push({
+        name: 'djk-orderDetaile',
+        params: { id: data.data },
+      })
+    }, 1500)
   }
   catch {
+    uni.hideLoading()
     console.log('领取失败')
   }
 }
@@ -46,8 +67,8 @@ async function handleSelect(item: Api.PmsDjkGoods) {
       <view class="text-28rpx">
         请选择商品(二选一)
       </view>
-      <view v-for="item, idx in welfare.welfareGoodList" :key="item.goodsCode" class="mt20rpx">
-        <view class="flex" @click="router.push({ name: 'djk-goods', params: { id: `${item.id}` } })">
+      <view v-for="item, idx in welfare.welfareGoodList" :key="item.id" class="mt20rpx">
+        <view class="flex" @click="router.push({ name: 'djk-goods', params: { id: `${item.id}`, type: '1' } })">
           <image
             :src="item.goodsImg?.split(',')[0]"
             class="h160rpx w160rpx flex-shrink-0"
@@ -89,6 +110,53 @@ async function handleSelect(item: Api.PmsDjkGoods) {
         2.到店使用需提前预约
       </view>
     </view>
+
+    <Zpopup v-model="show">
+      <view class="bg-white p24rpx">
+        <view class="text-center text-32rpx font-semibold">
+          确认选择
+        </view>
+        <view class="mt20rpx text-32rpx font-semibold">
+          您确认选择【{{ selectGoods?.goodsName }}】吗?
+        </view>
+        <view class="mt20rpx rounded-16rpx bg-white p24rpx">
+          <view class="flex items-center justify-between">
+            <view class="text-28rpx text-gray">
+              允许商户通过此号码致电沟通到店时间
+            </view>
+            <wd-checkbox v-model="isAllow" />
+          </view>
+          <view class="mt16rpx flex items-center text-28rpx">
+            <view v-if="!isEdit" class="mr10rpx">
+              {{ phone?.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2') }}
+            </view>
+            <view v-else>
+              <input v-model="phone" type="number" :maxlength="11" @blur="isEdit = false">
+            </view>
+            <view v-if="!isEdit" class="flex items-center" @click="isEdit = true">
+              <view class="mr5rpx">
+                修改
+              </view>
+              <wd-icon name="arrow-right" size="18px" color="#000" />
+            </view>
+          </view>
+        </view>
+      </view>
+      <template #footer>
+        <view class="flex items-center justify-between">
+          <view class="w48%">
+            <wd-button block type="info" @click="show = false">
+              取消
+            </wd-button>
+          </view>
+          <view class="w48%">
+            <wd-button block @click="handelSubmit">
+              确认领取
+            </wd-button>
+          </view>
+        </view>
+      </template>
+    </Zpopup>
   </view>
 </template>
 

+ 7 - 3
src/subPack-xsb/commonTab/components/classfiy.vue

@@ -202,12 +202,16 @@ onMounted(async () => {
   if (leftActive.value) {
     handleChange({ value: leftActive.value })
   }
+  else {
+    goodsLoading.value = 'finished'
+  }
   if (topNavActive.value) {
     topScrollView.value = null
     nextTick(() => {
       topScrollView.value = topNavActive.value
     })
   }
+  console.log(topNavActive.value, '  ==', leftActive.value)
 
   getCartBox()
   if (token.value) {
@@ -332,7 +336,7 @@ function handlePay() {
 <template>
   <view class="page-xsb">
     <wd-navbar
-      title="" custom-style="background-color:#F4FFD1" :bordered="false" :z-index="99" safe-area-inset-top
+      title="" custom-style="background-color:#F4FFD1" :bordered="false" :z-index="9999" safe-area-inset-top
       fixed
     >
       <template #left>
@@ -400,7 +404,7 @@ function handlePay() {
         展开
         <image :src="`${StaticUrl}/xia.png`" class="mt20rpx h20rpx w20rpx" />
       </view>
-      <wd-popup v-model="show" position="top" custom-style="border-radius:32rpx;">
+      <wd-popup v-model="show" :z-index="9998" position="top" custom-style="border-radius:32rpx;">
         <view
           class="box-border bg-#F4FFD1 p24rpx"
           :style="{ paddingTop: `${(Number(statusBarHeight) || 44) + MenuButtonHeight + 12}px` }"
@@ -648,7 +652,7 @@ function handlePay() {
       <template #footer>
         <view class="box-border w-full flex items-center justify-between py20rpx">
           <view class="w-48%">
-            <wd-button plain hairline block @click="selectGoods = false">
+            <wd-button hairline plain block @click="selectGoods = false">
               取消
             </wd-button>
           </view>

+ 17 - 5
src/subPack-xsb/commonTab/components/index.vue

@@ -38,6 +38,10 @@ onMounted(() => {
 
 function handleCommonClass(item: Api.xsbCategories) {
   console.log(item, '===================')
+  if (!item.children) {
+    useGlobalToast().show('敬请期待!')
+    return
+  }
 
   topNavActive.value = item.code
   leftActive.value = item.children && item.children[0].code
@@ -176,11 +180,16 @@ function handleChangeSwiper(e: UniHelper.SwiperOnChangeEvent) {
                 ]"
               >
                 <view class="px24rpx pt24rpx">
-                  <view class="grid grid-cols-5 gap-x-38rpx gap-y-24rpx">
-                    <view v-for="item, index in classfiylist" :key="index" @click="handleCommonClass(item)">
-                      <image :src="item.icon" class="h100rpx w100rpx" />
-                      <view class="mt12rpx text-24rpx text-#222">
-                        {{ item.name }}
+                  <view class="grid grid-cols-5 gap-x-24rpx gap-y-24rpx">
+                    <view v-for="item, index in classfiylist" :key="index" class="relative">
+                      <view @click="handleCommonClass(item)">
+                        <image :src="item.icon" class="h100rpx w100rpx" />
+                        <view class="mt12rpx whitespace-nowrap text-nowrap text-24rpx text-#222">
+                          {{ item.name }}
+                        </view>
+                      </view>
+                      <view v-if="!item.children" class="absolute left-0 top-0 h100rpx w100rpx flex items-center justify-center rounded-26rpx bg-[rgba(0,0,0,0.6)] text-16rpx text-white">
+                        敬请期待
                       </view>
                     </view>
                   </view>
@@ -195,6 +204,9 @@ function handleChangeSwiper(e: UniHelper.SwiperOnChangeEvent) {
                       <view class="text-24rpx text-#222">
                         {{ item.name }}
                       </view>
+                      <view v-if="!item.children" class="absolute left-50% top-0 h72rpx w72rpx flex items-center justify-center rounded-26rpx bg-[rgba(0,0,0,0.6)] text-16rpx text-white -translate-x-50%">
+                        敬请期待
+                      </view>
                     </swiper-item>
                   </swiper>
                   <view class="mt24rpx flex items-center justify-center">

+ 4 - 4
src/subPack-xsb/orderDetaile/index.vue

@@ -73,13 +73,13 @@ function handleCollapse() {
   collapse.value = !collapse.value
 }
 async function handleCancel() {
-  await handleCommonCancelOrder(orderInfo.value as Api.xsbOrderList)
+  await useUserStore().handleCommonCancelOrder(orderInfo.value as Api.xsbOrderList)
   getDetail(String(unref(orderInfo)?.orderNumber))
 }
 async function handlePay() {
-  const res = await handleCommonPayMent(String(unref(orderInfo)?.orderNumber))
+  const res = await useUserStore().handleCommonPayMent(String(unref(orderInfo)?.orderNumber))
   if (res.payType !== 1) {
-    await getWxCommonPayment(res)
+    await useUserStore().getWxCommonPayment(res)
     getDetail(String(unref(orderInfo)?.orderNumber))
   }
   else {
@@ -87,7 +87,7 @@ async function handlePay() {
   }
 }
 async function handelDel() {
-  await handleCommonDeleteOrder(unref(orderInfo) as Api.xsbOrderList)
+  await useUserStore().handleCommonDeleteOrder(unref(orderInfo) as Api.xsbOrderList)
   router.back()
 }
 async function handleFinish() {