4 次代码提交 b7b0186d2f ... 5b70f9b89f

作者 SHA1 备注 提交日期
  EvilDragon 5b70f9b89f refactor(app): 优化首页 - 时刻 - 图片展示逻辑- 修改了 bannerUrls 数组的遍历方式,移除了之前不必要的切片操作 3 周之前
  EvilDragon a29132a7a7 refactor(app): 优化设计案例信息展示样式 3 周之前
  EvilDragon 55541de590 style(app): 优化会员等级卡片组件样式 3 周之前
  EvilDragon 348ddb5d70 feat(mine): 会员等级组件增强 3 周之前

+ 28 - 17
packages/app/src/components/moment-item.vue

@@ -145,28 +145,39 @@ onMounted(async () => {
           ></wd-img>
         </view>
       </view>
+      <div
+        v-if="options.circleType === '2'"
+        class="text-black/90 text-xl font-normal font-['PingFang_SC']"
+      >
+        设计案例:{{ options?.caseName }}
+      </div>
       <view class="text-[rgba(0,0,0,0.85)] text-4 font-400 my-1 flex items-center">
         <template v-if="options.circleType === '2'">
-          <span>
-            {{ getOptionLabel(DictType.circleSpaceType, options.spaceType) }}
-          </span>
-          <div class="mx-2 h-3.5 w-[1.5px] bg-black/40"></div>
-          <span>
-            {{ getOptionLabel(DictType.memberDesignStyle, options.designStyle) }}
-          </span>
-          <div class="mx-2 h-3.5 w-[1.5px] bg-black/40"></div>
-          <span>{{ options.caseName }}</span>
+          <!--          <span>-->
+          <!--            {{ getOptionLabel(DictType.circleSpaceType, options.spaceType) }}-->
+          <!--          </span>-->
+          <!--          <div class="mx-2 h-3.5 w-[1.5px] bg-black/40"></div>-->
+          <!--          <span>-->
+          <!--            {{ getOptionLabel(DictType.memberDesignStyle, options.designStyle) }}-->
+          <!--          </span>-->
+          <!--          <div class="mx-2 h-3.5 w-[1.5px] bg-black/40"></div>-->
+          <!--          <span>{{ options.caseName }}</span>-->
+          <div class="w-full mt-4 flex items-center justify-between text-black/40 text-sm">
+            <div class="font-normal font-['PingFang_SC']">
+              类别:{{ getOptionLabel(DictType.circleSpaceType, options?.spaceType) }}
+            </div>
+            |
+            <div class="text-black/40 text-sm font-normal font-['PingFang_SC']">
+              风格:{{ getOptionLabel(DictType.memberDesignStyle, options.designStyle) }}
+            </div>
+            |
+            <div class="text-black/40 text-sm font-normal font-['PingFang_SC']">
+              面积:{{ options.spaceExtent }}
+            </div>
+          </div>
         </template>
         <template v-else>{{ options.circleDesc }}</template>
       </view>
-      <div
-        v-if="options.circleType === '2'"
-        class="mt-4 text-black/40 text-sm font-normal font-['PingFang_SC']"
-      >
-        <!-- 龙湖狮山天街生活广场三期·780 m²·全案定制 -->
-        <!-- {{ options.spaceAddr }}·{{ options.spaceType }}·{{ options.designStyle }} -->
-        {{ options.circleDesc }}
-      </div>
       <view v-if="props.options.tagName !== ''" class="my-5.5 flex flex-wrap gap-3.5">
         <template v-if="props.options.tagName !== ''">
           <template v-for="it of props.options.tagName?.split(',')" :key="it">

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

@@ -293,7 +293,7 @@ onShareAppMessage(shareAppMessage)
     </view>
     <div v-if="data.circleType === '2'" class="mb-4">
       <SectionHeading custom-class="mx-3.5 my-7" title="效果图"></SectionHeading>
-      <template v-for="(it, i) in data?.bannerUrls.slice(1, data?.bannerUrls?.length)" :key="i">
+      <template v-for="(it, i) in data?.bannerUrls" :key="i">
         <wd-img width="100%" mode="widthFix" :src="it"></wd-img>
       </template>
     </div>

+ 64 - 2
packages/app/src/pages/mine/levels/components/level-card.vue

@@ -1,5 +1,37 @@
 <script setup lang="ts">
-withDefaults(defineProps<{ isCurrent: boolean }>(), { isCurrent: false })
+import { useUserStore } from '@/store'
+import { storeToRefs } from 'pinia'
+
+const props = withDefaults(
+  defineProps<{
+    isCurrent: boolean
+    option?: any[]
+    index?: number
+  }>(),
+  { isCurrent: false },
+)
+const userStore = useUserStore()
+const { userInfo } = storeToRefs(userStore)
+const percentage = computed(() => {
+  const currentLevel = userInfo.value?.level?.level
+  const targetLevel = props.option[props.index + 1]
+  if (targetLevel) {
+    return (userInfo.value?.level?.point / targetLevel.points) * 100
+  }
+  return 0
+})
+// 是否最高的等级
+const isMaxLevel = computed(() => {
+  return userInfo.value?.level?.level === props.option?.[props.option.length - 1]?.memberLevel
+})
+// 是否高于当前等级
+const isHigherThanCurrent = computed(() => {
+  return userInfo.value?.level?.level > props.option[props.index]?.memberLevel
+})
+// 是否低于当前等级
+const isLowerThanCurrent = computed(() => {
+  return userInfo.value?.level?.level < props.option[props.index]?.memberLevel
+})
 </script>
 <template>
   <div class="w-full h-full box-border p-4 flex flex-col">
@@ -14,6 +46,36 @@ withDefaults(defineProps<{ isCurrent: boolean }>(), { isCurrent: false })
       </div>
     </div>
     <div class="flex-1"></div>
-    <wd-progress :percentage="30" hide-text />
+    <!--    {{ userInfo.level.point }}-->
+    <!--    {{ userInfo.level.point }}-->
+    <!--    {{ percentage }}-->
+    <template v-if="isHigherThanCurrent">
+      <div class="text-[#61311b] text-xs font-normal font-['PingFang_SC'] leading-relaxed">
+        <!--        还差{{ props.option[props.index]?.points - userInfo.level.point }}积分升级-->
+        当前高于该等级
+      </div>
+    </template>
+    <template v-else-if="isLowerThanCurrent">
+      <div class="text-[#61311b] text-xs font-normal font-['PingFang_SC'] leading-relaxed">
+        <!--        还差{{ props.option[props.index]?.points - userInfo.level.point }}积分升级-->
+        距{{ option[index].memberLevelName }}会员还需{{
+          option[index].points - userInfo.level.point
+        }}积分
+      </div>
+      <wd-progress :percentage="(userInfo.level.point / option[index].points) * 100" hide-text />
+    </template>
+    <template v-else-if="isMaxLevel">
+      <div class="text-[#61311b] text-xs font-normal font-['PingFang_SC'] leading-relaxed">
+        当前积分{{ userInfo.level.point }}
+      </div>
+    </template>
+    <template v-else>
+      <div class="text-[#61311b] text-xs font-normal font-['PingFang_SC'] leading-relaxed">
+        距{{ option[index + 1].memberLevelName }}会员还需{{
+          option[index + 1].points - userInfo.level.point
+        }}积分
+      </div>
+      <wd-progress :percentage="percentage" hide-text />
+    </template>
   </div>
 </template>

+ 5 - 1
packages/app/src/pages/mine/levels/index.vue

@@ -74,7 +74,11 @@ onMounted(async () => {
                   class="w-full h-full bg-[length:100%_100%]"
                   :style="{ backgroundImage: `url(${it.memberBgImage})` }"
                 >
-                  <LevelCard :is-current="userInfo.level?.level === it.memberLevel"></LevelCard>
+                  <LevelCard
+                    :option="levelConfigs"
+                    :index="i"
+                    :is-current="userInfo.level?.level === it.memberLevel"
+                  ></LevelCard>
                 </div>
               </div>
             </swiper-item>