Kaynağa Gözat

fix(app): 个人主页信息

EvilDragon 6 ay önce
ebeveyn
işleme
1576c7edbf

+ 3 - 1
packages/app/env/.env.development

@@ -5,9 +5,11 @@ VITE_DELETE_CONSOLE = false
 # 是否开启sourcemap
 VITE_SHOW_SOURCEMAP = true
 
-VITE_SERVER_BASEURL = 'https://www.zhuchaohui.com'
+# VITE_SERVER_BASEURL = 'https://www.zhuchaohui.com'
 # VITE_SERVER_BASEURL = 'http://39.106.91.179:48080'
 # VITE_SERVER_BASEURL = 'http://192.168.2.34:48080'
 # 王超
 # VITE_SERVER_BASEURL = 'http://192.168.2.39:48080'
 # VITE_SERVER_BASEURL = 'http://192.168.0.157:48080'
+# 刘
+VITE_SERVER_BASEURL = 'http://192.168.2.38:48080'

+ 1 - 0
packages/app/package.json

@@ -110,6 +110,7 @@
     "qs": "6.5.3",
     "radash": "^12.1.0",
     "vue": "^3.4.21",
+    "vue-component-type-helpers": "^2.1.8",
     "vue-i18n": "^9.1.9",
     "wot-design-uni": "^1.3.12",
     "z-paging": "^2.7.10"

+ 5 - 0
packages/app/src/components/page-helper.vue

@@ -24,6 +24,11 @@ onMounted(async () => {
 onReachBottom(() => {
   console.log(1111)
 })
+defineExpose({
+  refresh: () => {
+    setData()
+  },
+})
 </script>
 <template>
   <div class="flex-grow flex flex-col" :class="customClass">

+ 4 - 7
packages/app/src/pages/home/components/test.vue

@@ -1,11 +1,8 @@
-<script setup lang="ts">
-
+<script setup lang="ts" generic="T extends Object">
+defineProps<{ value: T }>()
+defineExpose({ aaa: () => {} })
 </script>
 
 <template>
-  $END$
+  <div></div>
 </template>
-
-<style scoped lang="scss">
-
-</style>

+ 20 - 21
packages/app/src/pages/home/mall/index.vue

@@ -16,6 +16,7 @@ import { getBanners, getProductCategories, getProducts } from '../../../core/lib
 import PageHelper from '@/components/page-helper.vue'
 import { BannerMode } from '../../../core/models/moment'
 import Banner from '../components/banner.vue'
+import BottomAppBar from '@/components/bottom-app-bar.vue'
 
 const router = useRouter()
 
@@ -96,29 +97,27 @@ onMounted(async () => {
       </div>
       <!-- </wd-skeleton> -->
     </PageHelper>
-    <div class="h-16">
-      <div class="fixed bottom-0 left-0 right-0">
-        <div class="h-16 bg-white flex items-center justify-between px-7">
-          <div>
-            <!-- <wd-button type="text" size="small"> -->
-            <wd-img :round="false" width="32" height="32" :src="shoppingBag"></wd-img>
-            <!-- </wd-button> -->
-          </div>
-          <div @click="router.push('/pages/home/mall/shopping-cart/index')">
-            <TiltedButton custom-class="text-center! items-center">
-              <span
-                class="h-[22px] text-white text-base font-normal font-['PingFang_SC'] leading-tight"
-              >
-                购物车
-              </span>
-              <span class="h-[22px] text-white text-sm font-normal font-['PingFang_SC']">
-                (已选2件)
-              </span>
-            </TiltedButton>
-          </div>
+    <BottomAppBar fixed>
+      <div class="h-16 bg-white flex items-center justify-between px-7">
+        <div>
+          <!-- <wd-button type="text" size="small"> -->
+          <wd-img :round="false" width="32" height="32" :src="shoppingBag"></wd-img>
+          <!-- </wd-button> -->
+        </div>
+        <div @click="router.push('/pages/home/mall/shopping-cart/index')">
+          <TiltedButton custom-class="text-center! items-center">
+            <span
+              class="h-[22px] text-white text-base font-normal font-['PingFang_SC'] leading-tight"
+            >
+              购物车
+            </span>
+            <span class="h-[22px] text-white text-sm font-normal font-['PingFang_SC']">
+              (已选2件)
+            </span>
+          </TiltedButton>
         </div>
       </div>
-    </div>
+    </BottomAppBar>
   </view>
 </template>
 

+ 63 - 32
packages/app/src/pages/home/mall/shopping-cart/index.vue

@@ -19,7 +19,18 @@ import BottomAppBar from '@/components/bottom-app-bar.vue'
 import { useUserStore } from '../../../../store'
 import { storeToRefs } from 'pinia'
 import { requestToast } from '../../../../core/utils/common'
+import Test from '../components/test.vue'
+import type { ComponentExposed } from 'vue-component-type-helpers'
 
+import { Activity } from '@/core/models/moment'
+
+// typeof PageHelper<string, {list: string[]}>
+// const pageHelperRef =
+//   ref<InstanceType<ReturnType<typeof PageHelper<string, typeof { list: string[] }>>>()
+// const a2 = ref<InstanceType<ReturnType<typeof PageHelper<any, {an}>>>>()
+// const testRef = ref<ComponentExposed<typeof Test<{ aaa: string }>> | undefined>()
+const pageHelperRef = ref<ComponentExposed<typeof PageHelper>>()
+// testRef1.value?
 const userStore = useUserStore()
 const { userInfo } = storeToRefs(userStore)
 const data = ref([{}, {}, {}])
@@ -42,49 +53,69 @@ const handleDelete = async (product: any) => {
       success: true,
     },
   )
+  await pageHelperRef.value?.refresh()
 }
 </script>
 
 <template>
-  <view class="flex-grow flex flex-col gap-14 bg-white px-3.5">
-    <PageHelper :request="getProductItemBuy" :query="{ userId: userInfo.userId }">
+  <view class="flex-grow flex flex-col gap-14 bg-white px-3.5 py-6">
+    <PageHelper
+      ref="pageHelperRef"
+      :request="getProductItemBuy"
+      :query="{ userId: userInfo.userId }"
+      class="flex-grow flex flex-col"
+    >
       <template #default="{ source }">
-        <template v-for="(it, i) in source.list" :key="i">
-          <div class="flex gap-3" @click="handleDelete(it)">
-            <div class="flex items-center">
-              <div class="w-4 h-4 rounded-full border border-black/60 border-solid"></div>
-            </div>
-            <div class="w-[110px] h-[110px] bg-[#f6f6f6] rounded-2xl"></div>
-            <div class="flex flex-col justify-between flex-1">
-              <div class="text-black/40 text-base font-normal font-['PingFang_SC'] leading-normal">
-                {{ it.prodcutName }}
-              </div>
-              <div class="flex items-center">
-                <div
-                  class="text-[#ef4343] text-[22px] font-normal font-['D-DIN Exp'] leading-normal"
-                >
-                  1000
+        <div class="flex-grow flex flex-col gap-8">
+          <template v-for="(it, i) in source.list" :key="i">
+            <wd-swipe-action>
+              <div class="flex gap-3">
+                <div class="flex items-center">
+                  <div class="w-4 h-4 rounded-full border border-black/60 border-solid"></div>
                 </div>
-                <div class="text-black/40 text-sm font-normal font-['PingFang_SC'] leading-[34px]">
-                  积分
+                <div class="w-[110px] h-[110px] bg-[#f6f6f6] rounded-2xl"></div>
+                <div class="flex flex-col justify-between flex-1">
+                  <div
+                    class="text-black/40 text-base font-normal font-['PingFang_SC'] leading-normal"
+                  >
+                    {{ it.prodcutName }}
+                  </div>
+                  <div class="flex items-center">
+                    <div
+                      class="text-[#ef4343] text-[22px] font-normal font-['D-DIN Exp'] leading-normal"
+                    >
+                      1000
+                    </div>
+                    <div
+                      class="text-black/40 text-sm font-normal font-['PingFang_SC'] leading-[34px]"
+                    >
+                      积分
+                    </div>
+                    <div class="flex-1"></div>
+                    <wd-input-number v-model="it.count" />
+                  </div>
                 </div>
-                <div class="flex-1"></div>
-                <wd-input-number v-model="it.count" />
               </div>
-            </div>
-          </div>
-        </template>
+              <template #right>
+                <view class="h-full">
+                  <view
+                    class="inline-block h-full bg-[#ef4343] text-white flex items-center px-5"
+                    @click="handleDelete(it)"
+                  >
+                    删除
+                  </view>
+                </view>
+              </template>
+            </wd-swipe-action>
+          </template>
+        </div>
       </template>
     </PageHelper>
-    <BottomAppBar fixed>
+    <BottomAppBar fixed border>
       <div class="h-[63px] bg-white backdrop-blur-[20px] flex px-3.5 items-center justify-between">
-        <div class="flex">
-          <div class="text-[#ef4343] text-2xl font-normal font-['D-DIN Exp'] leading-normal">
-            1360
-          </div>
-          <div class="text-black/40 text-base font-normal font-['PingFang_SC'] leading-[34px]">
-            积分
-          </div>
+        <div class="flex items-end gap-1.25">
+          <div class="text-[#ef4343] text-2xl font-normal font-['D-DIN_Exp'] leading-6">1360</div>
+          <div class="text-black text-base font-normal font-['PingFang_SC'] leading-5">积分</div>
         </div>
         <div class="">
           <TiltedButton size="large">

+ 16 - 3
packages/app/src/pages/mine/homepage/edit/index.vue

@@ -80,17 +80,30 @@ const handleChange = () => {}
     </Card>
     <Card>
       <div>
-        <SectionHeading title="设计费"></SectionHeading>
+        <SectionHeading title="设计费">
+          <template #append>
+            <div class="flex">
+              <wd-input no-border></wd-input>
+              <div class="text-black/40 text-base font-normal font-['PingFang_SC'] leading-relaxed">
+                元/㎡
+              </div>
+            </div>
+          </template>
+        </SectionHeading>
       </div>
     </Card>
     <Card>
       <div>
-        <SectionHeading title="服务客户数"></SectionHeading>
+        <SectionHeading title="服务客户数">
+          <template #append><wd-input label="请输入真实客户数" no-border></wd-input></template>
+        </SectionHeading>
       </div>
     </Card>
     <Card>
       <div>
-        <SectionHeading title="从业年限"></SectionHeading>
+        <SectionHeading title="从业年限">
+          <template #append><wd-input placehoder="请输入年限" no-border></wd-input></template>
+        </SectionHeading>
       </div>
     </Card>
     <!-- <BottomAppBar>

BIN
packages/app/src/static/font-faces/subset-D-DINExp.woff


BIN
packages/app/src/static/font-faces/subset-D-DINExp.woff2


+ 9 - 0
packages/app/src/style/fonts.css

@@ -7,3 +7,12 @@
     url('/static/font-faces/subset-AlimamaShuHeiTi-Bold.woff') format('woff');
   font-display: swap;
 }
+@font-face {
+  font-family: 'D-DIN Exp';
+  font-style: normal;
+  font-weight: normal;
+  src:
+    url('/static/font-faces/subset-D-DINExp.woff2') format('woff2'),
+    url('/static/font-faces/subset-D-DINExp.woff') format('woff');
+  font-display: swap;
+}

+ 8 - 0
pnpm-lock.yaml

@@ -88,6 +88,9 @@ importers:
       vue:
         specifier: ^3.4.21
         version: 3.4.21(typescript@4.9.5)
+      vue-component-type-helpers:
+        specifier: ^2.1.8
+        version: 2.1.8
       vue-i18n:
         specifier: ^9.1.9
         version: 9.14.1(vue@3.4.21(typescript@4.9.5))
@@ -8553,6 +8556,9 @@ packages:
     deprecated: The library contains critical security issues and should not be used for production! The maintenance of the project has been discontinued. Consider migrating your code to isolated-vm.
     hasBin: true
 
+  vue-component-type-helpers@2.1.8:
+    resolution: {integrity: sha512-ii36gDzrYAfOQIkOlo44yceDdT5269gKmNGxf07Qx6seH2U50+tQ2ol02XLhYPmxrh6YabAsOdte8WDrpaO6Tw==}
+
   vue-demi@0.14.10:
     resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==}
     engines: {node: '>=12'}
@@ -19675,6 +19681,8 @@ snapshots:
       acorn: 8.12.1
       acorn-walk: 8.3.4
 
+  vue-component-type-helpers@2.1.8: {}
+
   vue-demi@0.14.10(vue@3.4.21(typescript@4.9.5)):
     dependencies:
       vue: 3.4.21(typescript@4.9.5)