Ver código fonte

Merge branch 'zzx'

zouzexu 19 horas atrás
pai
commit
714a57bf06

+ 20 - 0
src/api/api.type.d.ts

@@ -53,6 +53,26 @@ namespace Api {
     [property: string]: any
   }
 
+  interface MemberPointsClaimVO {
+    /**
+     * 所属顶级企业ID
+     */
+    channelId?: number
+    /**
+     * 所属顶级企业名称
+     */
+    channelName?: string
+    /**
+     * 是否领取(true:已领取,false:未领取)
+     */
+    isClaimed?: boolean
+    /**
+     * 可领取积分
+     */
+    points?: number
+    [property: string]: any
+  }
+
   interface xsbCategoriesChildren {
     id: number
     name: string

+ 3 - 0
src/api/apiDefinitions.ts

@@ -34,6 +34,9 @@ export default {
   'sys.addressesDetail': ['GET', '/smqjh-system/app-api/v1/addresses/{addressId}'],
   'sys.uploadFile': ['POST', '/smqjh-system/api/v1/files'],
   'sys.updateUserInfo': ['PUT', '/smqjh-system/app-api/v1/members/{memberId}'],
+  'sys.selectZhUser': ['GET', '/smqjh-system/app-api/v1/claim/select'],
+  'sys.zhUserReceived': ['POST', '/smqjh-system/app-api/v1/claim/received'],
+
   'xsb.categories':['GET', '/smqjh-pms/app-api/v1/categories'],
   'xsb.getCategoryProductList':['POST', '/smqjh-pms/app-api/v1/spu/getCategoryProductList'],
   'xsb.getProductDetail':['GET', '/smqjh-pms/app-api/v1/spu/getProductDetails'],

+ 13 - 0
src/api/globals.d.ts

@@ -181,6 +181,19 @@ declare global {
       >(
         config: Config
       ): Alova2Method<apiResData<Api.addressList>, 'sys.addressesDetail', Config>;
+
+      selectZhUser<
+        Config extends Alova2MethodConfig<apiResData<Api.MemberPointsClaimVO>> & {}
+      >(
+        config: Config
+      ): Alova2Method<apiResData<Api.MemberPointsClaimVO>, 'sys.selectZhUser', Config>;
+
+      zhUserReceived<
+        Config extends Alova2MethodConfig<apiResData<any>> & {}
+      >(
+        config: Config
+      ): Alova2Method<apiResData<any>, 'sys.zhUserReceived', Config>;
+
       dictPage<
         Config extends Alova2MethodConfig<listData<Api.sysDict>> & {
           data: {

+ 2 - 0
src/auto-imports.d.ts

@@ -9,6 +9,7 @@ declare global {
   const Apis: typeof import('./api/index')['Apis']
   const CommonUtil: typeof import('wot-design-uni')['CommonUtil']
   const EffectScope: typeof import('vue')['EffectScope']
+  const InputFormatUtil: typeof import('./utils/index')['InputFormatUtil']
   const OrderStatus: typeof import('./subPack-xsb/utils/order-data')['OrderStatus']
   const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
   const alovaInstance: typeof import('./api/index')['alovaInstance']
@@ -387,6 +388,7 @@ declare module 'vue' {
     readonly Apis: UnwrapRef<typeof import('./api/index')['Apis']>
     readonly CommonUtil: UnwrapRef<typeof import('wot-design-uni')['CommonUtil']>
     readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
+    readonly InputFormatUtil: UnwrapRef<typeof import('./utils/index')['InputFormatUtil']>
     readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
     readonly alovaInstance: UnwrapRef<typeof import('./api/index')['alovaInstance']>
     readonly api: UnwrapRef<typeof import('./api/index')['default']>

+ 1 - 0
src/config/index.ts

@@ -8,6 +8,7 @@ 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.0.11:8080', // 王
   // develop: 'http://192.168.1.89:8080', // 田
   // develop: 'http://74949mkfh190.vicp.fun', // 付
   // develop: 'http://47.109.84.152:8081',

+ 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": "订单确认"
           }

+ 33 - 2
src/pages/index/index.vue

@@ -34,11 +34,10 @@ const state = computed(() => {
   return error.value ? 'error' : !isLastPage.value ? 'loading' : 'finished'
 })
 const loading = ref(true)
-
 onShow(async () => {
   useSysStore().getAudit()
   useSmqjhCartStore().getCartList('XSB')
-
+  getSelectZhUser()
   xsbStore.value = await AsyncImport('@/subPack-xsb/store-xsb/sys')
   refresh()
 })
@@ -87,6 +86,21 @@ onShareAppMessage(() => {
     title: '市民请集合',
   }
 })
+const showoverlay = ref(false)
+async function getSelectZhUser() {
+  const res = await Apis.sys.selectZhUser({})
+  if (res.data.channelId === 54 && !res.data.isClaimed) {
+    showoverlay.value = true
+  }
+}
+
+async function getZhUserReceived() {
+  useGlobalLoading().loading({ msg: '领取中...' })
+  await Apis.sys.zhUserReceived({})
+  useGlobalLoading().close()
+  show({ msg: '领取成功 !' })
+}
+
 function handleGo() {
   show({ msg: '敬请期待 !' })
 }
@@ -244,6 +258,23 @@ function handleGo() {
           </view>
         </wd-skeleton>
         <wd-loadmore :state="state" :loading-props="{ color: '#9ED605', size: 20 }" @reload="reload" />
+        <wd-overlay :show="showoverlay" @click="showoverlay = false">
+          <view class="mt-280rpx flex items-center justify-center">
+            <view class="relative h-906rpx w-644rpx flex flex-col justify-center text-center" :style="{ backgroundImage: `url(${StaticUrl}/home-overlay-img.png)`, backgroundSize: 'cover', backgroundPosition: 'center' }">
+              <view>
+                <view class="text-80rpx text-#FF1B51 font-600">
+                  ¥200
+                </view>
+                <view class="text-28rpx font-800">
+                  现金抵扣券
+                </view>
+              </view>
+              <view class="absolute bottom-110rpx left-42% text-60rpx text-#FF1B51 font-bold" @click="getZhUserReceived">
+                领
+              </view>
+            </view>
+          </view>
+        </wd-overlay>
       </view>
     </view>
   </view>

+ 1 - 1
src/subPack-common/afterSales/index.vue

@@ -29,7 +29,7 @@ const remark = ref('')
 onLoad((options: any) => {
   orderList.value = JSON.parse(options.order)
   orderList.value = orderList.value.map((item: Api.xsbOmsOrderItem) => {
-    item.num = 1
+    item.num = item.prodCount as number
     return item
   })
 })

+ 63 - 0
src/subPack-smqjh/components/videoRights-orderList/videoRights-orderList.vue

@@ -0,0 +1,63 @@
+<script setup lang="ts">
+import router from '@/router'
+import { StaticUrl } from '@/config'
+
+defineProps<{
+  orderList: Api.xsbOrderList[]
+}>()
+
+function handleItemClick(item: Api.xsbOrderList) {
+  const orderNumber = item.orderNumber
+  if (orderNumber) {
+    router.push({
+      name: 'video-rights-order-info',
+      params: { orderNo: orderNumber },
+    })
+  }
+  else {
+    console.warn('订单号不存在,无法跳转到详情页')
+  }
+}
+</script>
+
+<template>
+  <view class="">
+    <view v-for=" order in orderList" :key="order.orderNumber" class="mt-28rpx rounded-16rpx bg-#FFF p-24rpx" @click="handleItemClick(order)">
+      <view class="flex items-center justify-between">
+        <view class="text-28rpx">
+          {{ order.createTime }}
+        </view>
+        <view class="text-28rpx font-bold">
+          {{ order.rechargeStatusDesc }}
+        </view>
+      </view>
+      <view class="mt-24rpx h-2rpx w-full bg-#F0F0F0" />
+      <view class="mt-24rpx flex items-center justify-between">
+        <view class="flex items-center gap-20rpx">
+          <view class="h-160rpx w-160rpx">
+            <image class="h-160rpx w-160rpx" :src="`${StaticUrl}/list-page-img.png`" />
+          </view>
+          <view>
+            <view class="text-32rpx font-bold">
+              {{ order?.orderItemList?.[0]?.prodName || '' }}
+            </view>
+            <view class="mt-16rpx text-#FF4D3A">
+              <text class="text-22rpx font-500">
+                ¥
+              </text>
+              <text class="text-36rpx font-800">
+                {{ order?.orderItemList?.[0]?.price || 0 }}
+              </text>
+            </view>
+            <view class="mt-16rpx text-24rpx">
+              {{ order.orderNumber }}
+            </view>
+          </view>
+        </view>
+        <wd-icon name="chevron-right" size="22px" color="#222222" />
+      </view>
+    </view>
+  </view>
+</template>
+
+<style lang="scss" scoped></style>

+ 3 - 0
src/subPack-smqjh/order/components/OrderRenderer.vue

@@ -2,6 +2,7 @@
 import chargeList from '../../components/charge-orderList/charge-orderList.vue'
 import xsbList from '../../components/xsb-orderList/xsb-orderList.vue'
 import filmList from '../../components/film-orderList/film-orderList.vue'
+import videoRightsList from '../../components/videoRights-orderList/videoRights-orderList.vue'
 
 interface Props {
   orderList: Api.xsbOrderList[]
@@ -46,6 +47,7 @@ onMounted(async () => {
         @submit="$emit('submit', $event)" @del="$emit('del', $event)" @after-sale="$emit('after-sale', $event)"
         @refresh="$emit('refresh')"
       />
+      <videoRightsList v-else-if="order.businessType === 'XNSP'" :order-list="[order]" />
     </template>
   </template>
   <xsbList
@@ -61,4 +63,5 @@ onMounted(async () => {
     @submit="$emit('submit', $event)" @del="$emit('del', $event)" @after-sale="$emit('after-sale', $event)"
     @refresh="$emit('refresh')"
   />
+  <videoRightsList v-else-if="navActiveTab === 'XNSP'" :order-list="orderList" />
 </template>

+ 4 - 0
src/subPack-smqjh/order/index.vue

@@ -49,6 +49,7 @@ function createFilteredList(businessType: string) {
 const xsbOrderList = createFilteredList('XSB')
 const chargeOrderList = createFilteredList('CD')
 const filmOrderList = createFilteredList('DYY')
+const videoRightsOrderList = createFilteredList('XNSP')
 
 const currentOrderList = computed(() => {
   if (navActiveTab.value === 'all') {
@@ -63,6 +64,9 @@ const currentOrderList = computed(() => {
   else if (navActiveTab.value === 'DYY') {
     return filmOrderList.value
   }
+  else if (navActiveTab.value === 'XNSP') {
+    return videoRightsOrderList.value
+  }
   return []
 })
 

+ 1 - 1
src/subPack-smqjh/order/order-data.ts

@@ -3,7 +3,7 @@ export const navTabTypeList = [
   { name: '星闪豹', value: 'XSB' },
   { name: '充电', value: 'CD' },
   { name: '电影演出', value: 'DYY' },
-  { name: '视频权益', value: 'VIDEO' },
+  { name: '视频权益', value: 'XNSP' },
   { name: '大牌点餐', value: 'SHOP' },
 ]
 

+ 1 - 1
src/subPack-videoRights/commonTab/components/home.vue

@@ -65,8 +65,8 @@ onReachBottom(() => {
               </view>
             </view>
           </view>
-          <StatusTip v-if="!videoDataList.length" tip="暂无内容" />
         </grid-view>
+        <StatusTip v-if="!videoDataList.length" tip="暂无内容" />
       </scroll-view>
     </view>
   </view>

+ 1 - 0
src/subPack-videoRights/commonTab/components/order.vue

@@ -25,6 +25,7 @@ onShow(() => {
 onReachBottom(() => {
   if (!isLastPage.value) {
     page.value++
+    refresh()
   }
 })
 

+ 1 - 1
src/subPack-videoRights/videoRightsDetail/videoRightsDetail.vue

@@ -4,7 +4,7 @@ import router from '@/router'
 
 definePage({
   name: 'video-rights-detail',
-  islogin: false,
+  islogin: true,
   style: {
     navigationBarTitleText: '详情',
   },

+ 1 - 1
src/subPack-videoRights/videoRightsOrderInfo/videoRightsOrderInfo.vue

@@ -5,7 +5,7 @@ import router from '@/router'
 
 definePage({
   name: 'video-rights-order-info',
-  islogin: false,
+  islogin: true,
   style: {
     navigationBarTitleText: '订单确认',
   },

+ 33 - 3
src/subPack-videoRights/videoRightsSubmitOrder/videoRightsSubmitOrder.vue

@@ -1,10 +1,11 @@
 <script setup lang="ts">
+import { InputFormatUtil } from '../../utils/index'
 import { StaticUrl } from '@/config'
 import router from '@/router'
 
 definePage({
   name: 'video-rights-submit-order',
-  islogin: false,
+  islogin: true,
   style: {
     navigationBarTitleText: '订单确认',
   },
@@ -36,9 +37,38 @@ function selectAccountType(type: number) {
   submitFrom.value.accountType = type
 }
 
+function validateRechargeAccount(formData: Api.videoRightsubmitOrder): {
+  isValid: boolean
+  errorMessage: string | null
+} {
+  if (formData.rechargeAccount === '') {
+    return {
+      isValid: false,
+      errorMessage: '请输入充值账号',
+    }
+  }
+  if (formData.accountType === 1 && !InputFormatUtil.isPhone(formData.rechargeAccount || '')) {
+    return {
+      isValid: false,
+      errorMessage: '请输入正确的手机号',
+    }
+  }
+  if (formData.accountType === 2 && !InputFormatUtil.isQQ(formData.rechargeAccount || '')) {
+    return {
+      isValid: false,
+      errorMessage: '请输入正确的QQ号',
+    }
+  }
+  return {
+    isValid: true,
+    errorMessage: null,
+  }
+}
+
 function submitPay() {
-  if (submitFrom.value.rechargeAccount === '') {
-    useGlobalToast().show({ msg: '请输入充值账号' })
+  const validation = validateRechargeAccount(submitFrom.value)
+  if (!validation.isValid) {
+    useGlobalToast().show({ msg: validation.errorMessage! })
     return
   }
   submitFrom.value.productId = previewGoods.value.id

+ 21 - 0
src/utils/index.ts

@@ -75,3 +75,24 @@ export function calculateCenterPointSpherical(
     lng: toDegrees(centerLng),
   }
 }
+
+/**
+ * 输入框格式校验工具类
+ */
+export class InputFormatUtil {
+  /**
+   * 手机号校验
+   * @param phone
+   */
+  static isPhone(phone: string) {
+    return /^1[3-9]\d{9}$/.test(phone)
+  }
+
+  /**
+   * QQ号校验
+   * @param qq
+   */
+  static isQQ(qq: string) {
+    return /^[1-9]\d{4,10}$/.test(qq)
+  }
+}