فهرست منبع

Merge branch 'master' into zhangtao

zhangtao 1 روز پیش
والد
کامیت
025bfbda82

+ 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('./utils/index')['OrderStatus']
   const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
   const alovaInstance: typeof import('./api/index')['alovaInstance']
@@ -392,6 +393,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 OrderStatus: UnwrapRef<typeof import('./utils/index')['OrderStatus']>
     readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
     readonly alovaInstance: UnwrapRef<typeof import('./api/index')['alovaInstance']>

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

@@ -35,11 +35,10 @@ const state = computed(() => {
 })
 const currentIndex = ref(0)
 const loading = ref(true)
-
 onShow(async () => {
   useSysStore().getAudit()
   useSmqjhCartStore().getCartList('XSB')
-
+  getSelectZhUser()
   xsbStore.value = await AsyncImport('@/subPack-xsb/store-xsb/sys')
   refresh()
 })
@@ -89,6 +88,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: '敬请期待 !' })
 }
@@ -263,6 +277,23 @@ function handleChangeSwiper(e: UniHelper.SwiperOnChangeEvent) {
           </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
   })
 })

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

@@ -0,0 +1,61 @@
+<script setup lang="ts">
+import router from '@/router'
+import { StaticUrl } from '@/config'
+
+defineProps<{
+  order: 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="mb-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>
+</template>
+
+<style lang="scss" scoped></style>

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

@@ -3,6 +3,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 djkorder from '../../components/djk-order/index.vue'
+import videoRightsList from '../../components/videoRights-orderList/videoRights-orderList.vue'
 
 interface Props {
   orderList: Api.xsbOrderList
@@ -31,5 +32,6 @@ defineEmits<{
       v-else-if="orderList.businessType === 'DJK' || orderList.businessType === 'all'" :order="orderList"
       @refresh="$emit('refresh')"
     />
+    <videoRightsList v-else-if="navActiveTab === 'XNSP' || orderList.businessType === 'all'" :order="orderList" />
   </block>
 </template>

+ 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

+ 20 - 0
src/utils/index.ts

@@ -121,3 +121,23 @@ export enum OrderStatus {
 export function boolToNumber(value: boolean): number {
   return value ? 1 : 0
 }
+/**
+ * 输入框格式校验工具类
+ */
+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)
+  }
+}