Procházet zdrojové kódy

Merge branch 'main' of https://github.com/omnia96/designer-hub

Jake před 3 měsíci
rodič
revize
1bf3541e2a

+ 2 - 1
packages/app/src/core/libs/actions.ts

@@ -39,6 +39,7 @@ export const handleShareClick = () => {
     return useRouter().push('/pages/mine/authentication/index')
   }
   if (userStore.userInfo.level?.level < 2) {
-    return toast('请先升级为设计师')
+    toast('请先升级为设计师')
+    return false
   }
 }

+ 19 - 0
packages/app/src/core/libs/enums.ts

@@ -26,3 +26,22 @@ export enum QrCodeBusinessType {
    */
   InStoreClockIn = 'ISCI',
 }
+export enum PointStatus {
+  // 状态(待确认1,已完成2,已驳回3,已撤销4)
+  /**
+   * 待确认
+   */
+  PendingConfirmation = 1,
+  /**
+   * 已完成
+   */
+  Completed = 2,
+  /**
+   * 已驳回
+   */
+  Rejected = 3,
+  /**
+   * 已撤销
+   */
+  Revoked = 4,
+}

+ 41 - 0
packages/app/src/core/libs/models.ts

@@ -491,6 +491,7 @@ export interface Message {
   createTime: number
   viewCount: any
   viewTime: any
+  pointsDetail?: PointsDetail
 }
 export interface Coupon {
   id: number
@@ -527,6 +528,46 @@ export interface Coupon {
   materialName: string
   couponImgUrl: string
 }
+export interface PointsDetail {
+  id: number
+  pointsType: string
+  typeName: string
+  pointsCategory: string
+  categoryName: string
+  sourceId: any
+  name: string
+  pointsStauts: number
+  points: number
+  couponPoints: any
+  orderMoney: string
+  materialsId: number
+  materialsName: any
+  materialsBrand: string
+  stylistId: number
+  brokerId: number
+  stylistName: string
+  brokerName: string
+  generateTime: number
+  verifyTime?: number
+  completeTime?: number
+  turnDownTime: any
+  cancelTime: any
+  cancelReason: any
+  turnDownReason: any
+  remark: any
+  couponId: any
+  orderNo: any
+  createTime: number
+  businessType: any
+  customerName: string
+  customerPhone: string
+  orderImgUrl: any
+  pointsRate: any
+  commission: number
+  creator: string
+  creatorName: any
+}
+
 export enum DictType {
   /**
    *  擅长空间类型

+ 3 - 0
packages/app/src/core/themes/default.scss

@@ -13,3 +13,6 @@ page {
   background-color: #f3f3f3;
   border-radius: 100px;
 }
+.wd-textarea__inner {
+  height: 162rpx;
+}

+ 1 - 0
packages/app/src/pages/home/moment/index.vue

@@ -244,6 +244,7 @@ onShareAppMessage(async ({ from, target }) => {
             confirm-type="send"
             v-model="reviewContent"
             placeholder="说点什么..."
+            :cursor-spacing="140"
             @confirm="handleSend"
           ></wd-input>
         </div>

+ 5 - 16
packages/app/src/pages/home/spread/index.vue

@@ -1,5 +1,5 @@
-<route lang="json5">
-{ style: { navigationBarTitleText: '设计传播', navigationBarBackgroundColor: '#fff' } }
+<route lang="json">
+{ "style": { "navigationBarTitleText": "设计传播", "navigationBarBackgroundColor": "#fff" } }
 </route>
 
 <script setup lang="ts">
@@ -56,24 +56,13 @@ onMounted(async () => {
 </script>
 
 <template>
-  <view class="px-3.5 py-5.5">
-    <!-- <wd-swiper
-      custom-class="rounded-2xl overflow-hidden aspect-[2.71/1]"
-      width="100%"
-      height="100%"
-      :list="swiperList"
-      autoplay
-      v-model:current="current"
-      :indicator="{ type: 'dots-bar' } as any"
-      @click="handleClick"
-      @change="onChange"
-    ></wd-swiper> -->
+  <view class="px-3.5 py-5.5 flex-grow">
     <Banner :mode="BannerMode.Spread"></Banner>
 
     <view class="my-6 grid gap-2.5 grid-cols-2">
       <template v-for="it of menus" :key="it.title">
         <div :class="it.class" @click="router.push(it.path)">
-          <card :custom-class="['w-full h-full flex justify-between items-center']">
+          <Card :custom-class="'w-full h-full flex justify-between items-center'">
             <div
               class="my-3.5 text-black/40 text-base font-normal font-['PingFang_SC'] leading-[10.18px]"
             >
@@ -86,7 +75,7 @@ onMounted(async () => {
                 <wd-img :src="it.icon" width="23" height="23"></wd-img>
               </div>
             </view>
-          </card>
+          </Card>
         </div>
       </template>
     </view>

+ 14 - 7
packages/app/src/pages/messages/components/message-card.vue

@@ -4,7 +4,7 @@ import Card from '@/components/card.vue'
 import { integral, interact, message, system } from '../../../core/libs/svgs'
 import { beforeNow } from '../../../utils/date-util'
 import dayjs from 'dayjs'
-import { MessageType } from '../../../core/libs/enums'
+import { MessageType, PointStatus } from '../../../core/libs/enums'
 import { getPointsCoupons } from '../../../core/libs/requests'
 
 const props = withDefaults(defineProps<{ options?: Message }>(), {})
@@ -107,7 +107,8 @@ onMounted(async () => {
             v-if="
               [MessageType.Integral].includes(Number(options.messageType)) &&
               options.messageSubType === 31 &&
-              options.isRead !== '1'
+              options.isRead !== '1' &&
+              options.pointsDetail?.pointsStauts === PointStatus.PendingConfirmation
             "
           >
             <span class="text-black/40">
@@ -116,12 +117,17 @@ onMounted(async () => {
           </template>
           <template
             v-else-if="
-              [MessageType.Integral].includes(Number(options.messageType)) && options.isRead === '1'
+              [MessageType.Integral].includes(Number(options.messageType)) &&
+              options.messageSubType === 31 &&
+              options.isRead === '1'
             "
           >
-            <span class="text-black/40">
-              <!-- 确认积分后,即刻到账,如有问题请驳回,联系材料商修改积分后再次确认 -->
-            </span>
+            <template v-if="options.pointsDetail?.pointsStauts === PointStatus.Rejected">
+              <span class="text-black/40">
+                <!-- 确认积分后,即刻到账,如有问题请驳回,联系材料商修改积分后再次确认 -->
+                驳回原因:{{ options.pointsDetail?.cancelReason }}
+              </span>
+            </template>
           </template>
           <template
             v-else-if="
@@ -144,7 +150,8 @@ onMounted(async () => {
         v-if="
           [MessageType.Integral].includes(Number(options.messageType)) &&
           options.messageSubType === 31 &&
-          options.isRead !== '1'
+          options.isRead !== '1' &&
+          options.pointsDetail?.pointsStauts === PointStatus.PendingConfirmation
         "
       >
         <div class="flex gap-4">

+ 35 - 4
packages/app/src/pages/messages/index.vue

@@ -28,6 +28,7 @@ import { storeToRefs } from 'pinia'
 import MessageCard from './components/message-card.vue'
 import CouponCard from '../common/components/coupon-card.vue'
 import { select } from 'radash'
+import { useMessage } from 'wot-design-uni'
 
 const pageHelperRef = ref<ComponentExposed<typeof PageHelper>>()
 const userStore = useUserStore()
@@ -41,13 +42,31 @@ const tabs = ref([
 ])
 const selectedCoupon = ref()
 const coupons = ref<Coupon[]>([])
+const cancelReason = ref('')
+const { confirm } = useMessage('wd-message-box-slot')
+
 const query = computed(() => ({ messageType: tabs.value[tab.value]?.value }))
 
 const handleCancel = async (message: Message) => {
-  await requestToast(
-    () => orderPointsCancel({ id: message.businessId.toString(), cancelReason: '用户取消' }),
-    { success: true, successTitle: '积分确认已驳回' },
-  )
+  await confirm({
+    title: '驳回',
+    beforeConfirm: async ({ resolve }) => {
+      if (!cancelReason.value) {
+        resolve(false)
+        uni.showToast({ title: '请输入驳回原因', icon: 'none' })
+        return
+      }
+      await requestToast(
+        () =>
+          orderPointsCancel({
+            id: message.businessId.toString(),
+            cancelReason: cancelReason.value,
+          }),
+        { success: true, successTitle: '积分确认已驳回' },
+      )
+      resolve(true)
+    },
+  })
   // await deleteMessage(message.id.toString())
   await updateMessage({ id: message.id, isRead: '1' })
   await pageHelperRef.value?.refresh()
@@ -117,6 +136,18 @@ onShow(async () => {
         </div>
       </template>
     </PageHelper>
+    <wd-message-box selector="wd-message-box-slot">
+      <!-- <wd-rate custom-class="custom-rate-class" v-model="rate" /> -->
+      <wd-config-provider :themeVars="{ textareaBg: 'transparent', textareaCellHeight: '100rpx' }">
+        <wd-textarea
+          custom-class="bg-[#f6f6f6]! rounded-lg border border-solid border-[#9f9f9f]/20"
+          v-model="cancelReason"
+          line="2"
+          height="100rpx"
+          placeholder="请输入驳回原因"
+        />
+      </wd-config-provider>
+    </wd-message-box>
     <wd-action-sheet title="优惠券" v-model="show">
       <view class="">
         <wd-tabs>

+ 1 - 0
packages/app/src/pages/mine/components/tasks-card.vue

@@ -59,6 +59,7 @@ onMounted(async () => {})
                 {{ taskKey }}
               </div>
               <div
+                v-if="Number(taskValue) !== 0"
                 class="ml-1 text-[#dc753a] text-xs font-normal font-['PingFang_SC'] leading-normal"
               >
                 +{{ taskValue }}积分