ソースを参照

refactor(app): 优化多个组件和页面的样式及功能

- 移除了不必要的导入和函数
- 调整了部分组件的样式
- 优化了待办页面的表单和数据处理逻辑
- 简化了请求接口的定义
- 用背景图片替代了 ImageEvo组件
EvilDragon 1 ヶ月 前
コミット
09cbfd4e4b

+ 1 - 1
packages/app/src/components/image-evo.vue

@@ -6,7 +6,7 @@ const imgClass = ref('blur-lg transition duration-500 hover:blur-none')
 const handleLoad = async () => {
   visible.value = true
   imgClass.value = 'transition duration-500'
-  nextTick(() => {
+  await nextTick(() => {
     emits('displayed')
   })
 }

+ 2 - 33
packages/app/src/core/libs/requests.ts

@@ -1,4 +1,4 @@
-import { http, httpDelete, httpGet, httpPost, httpPut } from '@/utils/http'
+import { http, httpDelete, httpGet, httpPost, httpPut } from '../../utils/http'
 import { Schedule } from '../models/schedule'
 import {
   Category,
@@ -385,38 +385,7 @@ export const getProducts = (query: { oneCategory?: string; secondCategory?: stri
  * 获取超值划算商品
  */
 export const getFavourableProducts = () =>
-  httpPost<
-    {
-      id: number
-      prodcutName: string
-      productId: string
-      oneCategory: string
-      oneCategoryName: string
-      secondCategory: string
-      secondCategoryName: string
-      isRestrict: number
-      productRepertory: number
-      productPrice: string
-      productType: number
-      vendorId: number
-      vendorName: string
-      needPoints: number
-      points: number
-      gainType: number
-      exchangeDesc: string
-      productCoverImgUrl: string
-      productDetailsImgUrl: string
-      contentDesc: string
-      status: number
-      exchangeCount: number
-      memberLevelIds: string
-      memberLevelName: string
-      favourablePoints: number
-      favourableEndDate: string
-      createTime: string
-      updateTime: string
-    }[]
-  >('/app-api/member/product/listFavourableProduct')
+  httpPost<Product[]>('/app-api/member/product/listFavourableProduct')
 export const getProduct = (id: string) =>
   httpGet<Product>('/app-api/member/product/detail', { productId: id })
 export const getProductItemBuy = (query: { userId: number }) =>

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

@@ -2,6 +2,14 @@
 page {
   --evo-theme-primary: black;
 }
+
+::-webkit-scrollbar{
+  width: 0;
+  height: 0;
+  color: transparent;
+  display:none;
+}
+
 .wd-button {
   line-height: 0;
 }

+ 2 - 1
packages/app/src/pages/home/activity/detail/index.vue

@@ -233,7 +233,8 @@ onShareTimeline(() => ({ title: data.value.name, imageUrl: data.value.thumbnailU
         canvas-id="firstCanvas"
         id="firstCanvas"
       ></canvas>
-      <ImageEvo :src="data?.bannerUrl"></ImageEvo>
+      <!--      <ImageEvo :src="data?.bannerUrl" mode="aspectFill"></ImageEvo>-->
+      <div class="w-full h-full bg-[length:100%_auto]" :style="{ backgroundImage: `url(${data?.bannerUrl})` }"></div>
       <!-- <wd-img width="100%" height="100%" :src="data?.backgroundUrl"></wd-img> -->
       <div class="absolute left-3.5 bottom-3" @click="isActivity && (listShow = true)">
         <!--        <div-->

+ 2 - 4
packages/app/src/pages/home/mall/index.vue

@@ -202,9 +202,7 @@ onShareTimeline(() => ({
                 </div>
                 <div class="flex items-end gap-1 mt-5">
                   <div class="text-[#ef4343] text-[22px] font-normal font-['D-DIN_Exp'] pb-3">
-                    <!-- 1600 -->
-<!--                    {{ it.showFavourable ? it.favourablePoints : it.points }}-->
-                    {{it.favourablePoints}}
+                    {{ it.favourablePoints }}
                   </div>
                   <div class="text-black/60 text-sm font-normal font-['PingFang_SC'] pb-3">
                     积分
@@ -234,7 +232,7 @@ onShareTimeline(() => ({
         </SwiperEvo>
       </div>
     </div>
-    <div class="w-full inline-flex gap-2">
+    <div class="w-full inline-flex gap-2 overflow-x-scroll whitespace-nowrap">
       <template v-for="(it, i) in categories" :key="i">
         <div>
           <wd-button

+ 3 - 0
packages/merchant/src/components/data-form.vue

@@ -62,6 +62,9 @@ const horizontalDefaultProps = {
   TimePick: {
     customClass: 'm-0! bg-[#f5f7f9]! py-.75 px-4 rounded-lg!',
   },
+  Textarea: {
+    customClass: 'bg-[#f5f7f9]! rounded-lg',
+  },
 }
 const themeVars: ConfigProviderThemeVars = {
   cellPadding: '0',

+ 0 - 25
packages/merchant/src/core/libs/actions.ts

@@ -1,29 +1,4 @@
-import { cancelCircleUpvote, createCircleUpvote } from './requests'
-
 const toast = (title: string) => uni.showToast({ title, icon: 'none' })
-export const handleUpvoteClick = async (
-  {
-    upvote,
-    circleId,
-    userId,
-    userName,
-  }: {
-    upvote: boolean
-    circleId: number
-    userId: number
-    userName: string
-  },
-  callback?: () => void,
-) => {
-  if (!upvote) {
-    const { code, msg } = await createCircleUpvote({ circleId, userId, userName })
-    code === 0 && toast('点赞成功')
-  } else {
-    const { code } = await cancelCircleUpvote({ id: circleId.toString() })
-    code === 0 && toast('取消点赞成功')
-  }
-  callback && callback()
-}
 
 export const toHomePage = (id: string) => {
   console.log(id)

+ 1 - 14
packages/merchant/src/pages/agent/designer/index.vue

@@ -12,8 +12,7 @@ import Card from '@/components/card.vue'
 import DataForm from '@/components/data-form.vue'
 import PageHelperEvo from '@/components/page-helper-evo.vue'
 import { createFollowUp, focusOrCancel, getDesigners } from '../../../core/libs/agent-requests'
-import { vipIcon, rightArrowIcon, filterIcon } from '@designer-hub/assets/src/svgs'
-import { toHomePage } from '../../../core/libs/actions'
+import { filterIcon } from '@designer-hub/assets/src/svgs'
 import { Designer } from '@designer-hub/app/src/core/libs/models'
 import { requestToast } from '@designer-hub/app/src/core/utils/common'
 import { ComponentExposed } from 'vue-component-type-helpers'
@@ -24,7 +23,6 @@ import { storeToRefs } from 'pinia'
 import { useUserStore } from '../../../store'
 import link from '@designer-hub/assets/src/libs/assets/link'
 import { beforeNow } from '@/utils/date-util'
-import { getDesignerList } from '@/core/libs/requests'
 import { NetImages } from '@/core/libs/enums'
 
 const userStore = useUserStore()
@@ -151,17 +149,6 @@ onLoad(async (params: { title?: string; filter?: string; tags?: string }) => {
     tags: filterQuery.value.tags.join(','),
     levels: filterQuery.value.levels.join(','),
   }
-  // const {
-  //   data: { list },
-  // } = await getDesignerList({
-  //   brokerId: String(userInfo.value.userId),
-  //   pageNo: 1,
-  //   pageSize: -1,
-  // })
-  // schema.value.stylistId.props.columns = list.map((item) => ({
-  //   value: item.id,
-  //   label: item.name,
-  // }))
 })
 </script>
 

+ 5 - 6
packages/merchant/src/pages/agent/todo/index.vue

@@ -2,7 +2,6 @@
 { "style": { "navigationBarTitleText": "待办", "navigationBarBackgroundColor": "#f2f3f6" } }
 </route>
 <script setup lang="ts">
-import PageHelperEvo from '@/components/page-helper-evo.vue'
 import { createTodo, deleteTodo, getTodos, updateTodo } from '../../../core/libs/requests'
 import { useUserStore } from '../../../store'
 import { storeToRefs } from 'pinia'
@@ -36,10 +35,10 @@ const schema = ref<DataFormSchema>({
   executionTime: {
     type: 'TimePick',
     label: '时间:',
-    labelWidth: 44,
+    labelWidth: 52,
     props: { defaultValue: dayjs().toDate().getTime() },
   },
-  content: { type: 'Textarea', label: '备注:', labelWidth: 44, props: {} },
+  content: { type: 'Textarea', label: '备注:', labelWidth: 52, props: {} },
 })
 const formData = ref({
   // executionTime: '',
@@ -50,7 +49,7 @@ const handleAddTodo = () => {
 const handleSubmit = async () => {
   console.log('提交')
   await requestToast(
-    () => createTodo({ ...formData.value, creator: userInfo.value.userId.toString(), status: 0 }),
+    () => createTodo({ ...formData.value, creator: String(userInfo.value.userId), status: 0 }),
     {
       successTitle: '添加成功',
       success: true,
@@ -58,6 +57,7 @@ const handleSubmit = async () => {
   )
   await setData()
   addSheetVisible.value = false
+  formData.value = {}
 }
 const handleDelete = async (todo: Todo) => {
   console.log('删除')
@@ -80,7 +80,6 @@ onMounted(async () => {
     <wd-calendar-view v-model="current" @change="handleCalendarChange" />
     <wd-floating-panel v-if="!addSheetVisible" :anchors="[260, 490]" :custom-class="'h-auto'">
       <div class="box-border p-4 flex flex-col gap-3.5">
-        <!-- <PageHelperEvo :request=""></PageHelperEvo> -->
         <div class="flex items-center gap-2.5">
           <div class="w-1 h-4 bg-[#2357e9] rounded-[20px]"></div>
 
@@ -92,7 +91,7 @@ onMounted(async () => {
               <wd-checkbox
                 :modelValue="it.status === 1"
                 shape="square"
-                @change="(e) => handleClick(e, it)"
+                @change="(e: any) => handleClick(e, it)"
               ></wd-checkbox>
               <div
                 class="text-base font-normal font-['PingFang_SC'] leading-relaxed"