kevin.T 2 هفته پیش
والد
کامیت
d7aa38fa59

+ 5 - 4
packages/app/src/core/libs/requests.ts

@@ -276,6 +276,7 @@ export const getTasks = (query) =>
       createTime: string
       sort: number
       status: number
+      finish: boolean
     }[]
   }>('/app-api/basicsetting/set-task-center/page', query)
 /**
@@ -640,7 +641,7 @@ export const readCount = () => httpGet('/app-api/member/message-manage/readCount
 /**
  * 批量修改为已读
  */
-export const updateReadByMessageType = (data: { messageType: number}) =>
+export const updateReadByMessageType = (data: { messageType: number }) =>
   httpPut('/app-api/member/message-manage/updateReadByMessageType', data)
 /**
  * 积分订单取消
@@ -934,10 +935,10 @@ export const updateHonorPopUp = (query: { bizId: string; bizType: string }) =>
 export const getBadges = (query = {}) =>
   httpGet<{ [key: string]: Badge[] }>('/app-api/member/stylist-honor/get-badge-list', query)
 /**
-* 获取证书列表
-*/
+ * 获取证书列表
+ */
 export const getCertificates = (query = {}) =>
-httpGet<Certificate[]>('/app-api/member/stylist-honor/get-certificate-list', query)
+  httpGet<Certificate[]>('/app-api/member/stylist-honor/get-certificate-list', query)
 /**
  * 获取典藏徽章列表
  * */

+ 29 - 12
packages/app/src/pages/mine/components/tasks-card.vue

@@ -12,7 +12,7 @@ defineProps({
     default: '',
   },
   items: {
-    type: Array as PropType<(Task & { btnProps: any })[]>,
+    type: Array as PropType<(Task & { btnProps: any; finish: boolean })[]>,
     default: () => [],
   },
 })
@@ -55,7 +55,10 @@ onMounted(async () => {})
           任务中心
         </div>
         <div class="flex-grow mt-4 overflow-auto">
-          <template v-for="({ taskKey, taskValue, status, id, btnProps }, i) in items" :key="i">
+          <template
+            v-for="({ taskKey, taskValue, status, id, finish, btnProps }, i) in items"
+            :key="i"
+          >
             <div class="flex items-center my-6">
               <div class="text-black/90 text-sm font-normal font-['PingFang_SC'] leading-normal">
                 {{ taskKey }}
@@ -67,16 +70,30 @@ onMounted(async () => {})
                 +{{ taskValue }}积分
               </div>
               <div class="flex-1"></div>
-              <wd-button
-                type="info"
-                plain
-                size="small"
-                :disabled="btnProps?.disabled"
-                @click="clickByPermission('task', () => btnProps?.onClick())"
-              >
-                {{ btnProps?.content }}
-                <!-- {{ taskExtendsById[id]?.completed ? '已完成' : '去完成' }} -->
-              </wd-button>
+              <template v-if="id === 4">
+                <wd-button
+                  type="info"
+                  plain
+                  size="small"
+                  :disabled="finish"
+                  @click="clickByPermission('task', () => btnProps?.onClick())"
+                >
+                  {{ finish ? '已关注' : '去关注' }}
+                  <!-- {{ taskExtendsById[id]?.completed ? '已完成' : '去完成' }} -->
+                </wd-button>
+              </template>
+              <template v-else>
+                <wd-button
+                  type="info"
+                  plain
+                  size="small"
+                  :disabled="btnProps?.disabled"
+                  @click="clickByPermission('task', () => btnProps?.onClick())"
+                >
+                  {{ btnProps?.content }}
+                  <!-- {{ taskExtendsById[id]?.completed ? '已完成' : '去完成' }} -->
+                </wd-button>
+              </template>
             </div>
           </template>
         </div>

+ 38 - 32
packages/app/src/pages/mine/index.vue

@@ -74,7 +74,12 @@ const { data: taskStatusData, run: setTaskStatus } = useRequest(
         btnProps: {
           content: '去关注',
           // onClick: () => uni.showToast({ title: '敬请期待', icon: 'none' }),
-		  onClick: () => uni.previewImage({ urls: ["https://image.zhuchaohui.com/zhucaohui/de0f43be81ba577eda016a994ab203bb79149f09a7a919b7598ec2c0cb04c75d.png"] }),
+          onClick: () =>
+            uni.previewImage({
+              urls: [
+                'https://image.zhuchaohui.com/zhucaohui/de0f43be81ba577eda016a994ab203bb79149f09a7a919b7598ec2c0cb04c75d.png',
+              ],
+            }),
         },
       },
     ]),
@@ -124,7 +129,7 @@ const pieces = ref([
   {
     title: '设计师成长计划',
     desc: '赋能设计共同成长',
-    icon: "https://image.zhuchaohui.com/zhucaohui/e5f83b3b61868838b0947290242488a0f51e308ca66182f8563c9a305129b119.png",
+    icon: 'https://image.zhuchaohui.com/zhucaohui/e5f83b3b61868838b0947290242488a0f51e308ca66182f8563c9a305129b119.png',
     class: 'items-start! pb-0 pr-0',
     iconSize: 102,
     gridItemClass: 'col-start-1 row-start-1 row-end-3',
@@ -170,7 +175,7 @@ const nickNameClickHandle = async () => {
 }
 const handleToAuthentication = (event) => {
   // 阻止事件冒泡
-  event.stopPropagation();
+  event.stopPropagation()
   if (!isLogined.value) return router.push('/pages-sub/login/index')
   router.push('/pages-sub/mine/authentication/index')
 }
@@ -189,7 +194,8 @@ const handleClickScan = async () => {
   // console.log(qrCodeString2Object(toQrCodeString('到店', { a: 1, orderId: 2222 })))
   const { type, options } = qrCodeString2Object(result)
   if (type === QrCodeBusinessType.InStoreClockIn) {
-    if (!features.value.checkInAtStoreTask) return router.push('/pages-sub/mine/authentication/index')
+    if (!features.value.checkInAtStoreTask)
+      return router.push('/pages-sub/mine/authentication/index')
     try {
       await storeAndPunchIn({ id: options.id })
       option.value = {
@@ -263,21 +269,21 @@ onPageScroll(({ scrollTop }: { scrollTop: number }) => {
     >
       <div class="my-6.5 px-3.5 flex">
         <!-- <img class="w-[72px] h-[72px] rounded-full border border-white" :src="avatar" /> -->
-		<div class="relative">
-			<wd-img
-			  custom-class="rounded-full border border-white overflow-hidden"
-			  :width="72"
-			  :height="72"
-			  :src="avatar"
-			></wd-img>
-			<wd-img
-			  v-if="userInfo?.level"
-			  custom-class="absolute! level-circle"
-			  :width="79"
-			  :height="80"
-			  :src="userInfo?.level?.avatar"
-			></wd-img>
-		</div>
+        <div class="relative">
+          <wd-img
+            custom-class="rounded-full border border-white overflow-hidden"
+            :width="72"
+            :height="72"
+            :src="avatar"
+          ></wd-img>
+          <wd-img
+            v-if="userInfo?.level"
+            custom-class="absolute! level-circle"
+            :width="79"
+            :height="80"
+            :src="userInfo?.level?.avatar"
+          ></wd-img>
+        </div>
         <div class="ms-3.5 ml-3.5">
           <div class="flex items-center gap-1.25">
             <div
@@ -477,7 +483,7 @@ onPageScroll(({ scrollTop }: { scrollTop: number }) => {
       <SectionHeading custom-class="my-6" title="和筑巢荟一起共同成长"></SectionHeading>
       <CardMenu :items="pieces" custom-class="grid-cols-2" />
     </view>
-	<!-- <wd-overlay :show="official" @click="official = false">
+    <!-- <wd-overlay :show="official" @click="official = false">
 		<view class="wrapper" @click.stop="">
 		    <wd-img :width="'100%'" :height="'100%'" src="https://image.zhuchaohui.com/zhucaohui/de0f43be81ba577eda016a994ab203bb79149f09a7a919b7598ec2c0cb04c75d.png" mode="widthFix"></wd-img>
 			<wd-img @click="official = false" :src="close" width="28" height="28" custom-class="vertical-bottom"></wd-img>
@@ -509,19 +515,19 @@ onPageScroll(({ scrollTop }: { scrollTop: number }) => {
     transform: skewX(15deg);
   }
 }
-.wrapper{
-	position: absolute;
-	top:50%;
-	left:50%;
-	width:540rpx;
-	transform: translate(-50%,-50%);
+.wrapper {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  width: 540rpx;
+  transform: translate(-50%, -50%);
 }
-:deep(.vertical-bottom){
-	left:50%;
-	transform: translateX(-50%);
+:deep(.vertical-bottom) {
+  left: 50%;
+  transform: translateX(-50%);
 }
-:deep(.level-circle){
-	top: -18rpx;
-	left:-10rpx;
+:deep(.level-circle) {
+  top: -18rpx;
+  left: -10rpx;
 }
 </style>

+ 1 - 0
packages/merchant/src/components/data-form.ts

@@ -24,5 +24,6 @@ export type DataFormSchema<T = any> = {
     required?: boolean
     maxlength?: number
     props?: DataFormProps
+    callback?: (value: any) => void
   }
 }

+ 37 - 31
packages/merchant/src/pages/agent/designer/archives/index.vue

@@ -23,6 +23,7 @@ import {
   getEditRecords,
   updateDesignerFamilyInfo,
 } from '../../../../core/libs/agent-requests'
+import { addUnit } from 'wot-design-uni/components/common/util'
 import { messages } from '../../../../core/libs/messages'
 import { omit } from 'radash'
 import BottomAppBar from '@/components/bottom-app-bar.vue'
@@ -59,8 +60,10 @@ const eventsQuery = computed(() => ({ type: '3' }))
 const recordQuery = computed(() => ({ pageNo: 1, pageSize: 10 }))
 const actionSheetStatus = ref(false)
 const schema = ref<DataFormSchema>()
+const fileList = ref<any[]>([])
 const formData = ref({
   focus: '',
+  awardsFileUrl: '',
 })
 const formDataFoucs = ref<{
   focus: string
@@ -133,8 +136,21 @@ const handleAddFamilyInfo = async (item: DesignerFamilyInfo) => {
   schema.value = familySchema
   actionSheetStatus.value = true
 }
+const action = ref(`${import.meta.env.VITE_SERVER_BASEURL}/app-api/infra/file/upload`)
+const handleUploadChange = ({ fileList }) => {
+  formData.value.awardsFileUrl = fileList
+    .map((item: any) => {
+      if (item.response) {
+        return JSON.parse(item.response).data
+      } else {
+        return item.url
+      }
+    })
+    .join(',')
+}
 const handleAddAward = async () => {
   submitType.value = 'award'
+  fileList.value = []
   schema.value = {
     awardsName: {
       type: 'TextField',
@@ -159,10 +175,11 @@ const handleAddAward = async () => {
         type: 'date',
       },
     },
-    awardsFileUrl: {
-      type: 'ImageUploader',
-      label: messages.objects.designerAward.awardsFileUrl,
-    },
+    // awardsFileUrl: {
+    //   type: 'ImageUploader',
+    //   label: messages.objects.designerAward.awardsFileUrl,
+    //   callback: handleUploadChange,
+    // },
   }
   actionSheetStatus.value = true
 }
@@ -512,34 +529,7 @@ onShow(async () => {
               </wd-button>
             </div>
           </div>
-          <!--          :mock-list="[-->
-          <!--          { awardsName: '123', awardsRank: '123' },-->
-          <!--          {-->
-          <!--          awardsName: '筑巢奖',-->
-          <!--          },-->
-          <!--          ]"-->
           <ListHelperEvo ref="awardsListRef" :request="getAwards" :query="{ userId: id }">
-            <!--            <template #default="{ item, isLast }">-->
-            <!--              <div class="flex flex-col gap-4 py-4">-->
-            <!--                <SectionHeading-->
-            <!--                  title="奖项名称"-->
-            <!--                  size="base"-->
-            <!--                  :end-text="item.awardsName"-->
-            <!--                ></SectionHeading>-->
-            <!--                <SectionHeading-->
-            <!--                  title="奖项日期"-->
-            <!--                  :end-text="item.awardsTime && dayjs(item.awardsTime).format('YYYY-MM-DD')"-->
-            <!--                ></SectionHeading>-->
-            <!--                <SectionHeading title="奖项名次" :end-text="item.awardsRank"></SectionHeading>-->
-            <!--                <SectionHeading-->
-            <!--                  title="奖项照片"-->
-            <!--                  end-arrow-->
-            <!--                  :path="`/pages/agent/designer/archives/award/photos/index?urls=${item.awardsFileUrl ?? ''}`"-->
-            <!--                ></SectionHeading>-->
-            <!--                <wd-button type="text" @click="handleDeleteAward(item)">删除</wd-button>-->
-            <!--                <div v-if="!isLast" class="w-full h-1 bg-[#dadada]"></div>-->
-            <!--              </div>-->
-            <!--            </template>-->
             <template #list="{ list }">
               <template v-for="(item, i) in list" :key="i">
                 <div class="flex flex-col gap-4 py-4">
@@ -679,6 +669,22 @@ onShow(async () => {
     <wd-action-sheet v-model="actionSheetStatus">
       <div class="p-4">
         <DataForm :schema="schema" :direction="'horizontal'" v-model="formData"></DataForm>
+        <template v-if="submitType = 'award'">
+          <div
+            class="grid mb-4 items-start"
+            :style="{ 'grid-template-columns': `${addUnit(64)} auto` }"
+          >
+            <label class="text-sm font-normal leading-relaxed text-black/60 h-10 flex items-center">
+              附件
+            </label>
+            <wd-upload
+              :file-list="fileList"
+              image-mode="aspectFill"
+              :action="action"
+              @change="handleUploadChange"
+            ></wd-upload>
+          </div>
+        </template>
         <wd-button :round="false" block @click="handleSubmit">提交</wd-button>
       </div>
     </wd-action-sheet>