Browse Source

merge code!!!

kevin.T 3 months ago
parent
commit
f58b88d596

+ 1 - 1
packages/app/src/composables/share.ts

@@ -24,8 +24,8 @@ export const useShare = () => {
             uni.showToast({ title: '无法分享普通会员等级作者的圈子内容', icon: 'none' }).then()
             throw new Error('禁止分享')
           }
-          await shareCircle(target.dataset.options.id)
         }
+        await shareCircle(target.dataset.options.id)
         res.path = `/pages-sub/home/moment/index?id=${target.dataset.options.id}&isShared=true&circleType=${target.dataset.options.circleType}`
         res.imageUrl = target.dataset.options.bannerUrls[0]
         res.title = `${target.dataset.options.stylistName}: ${target.dataset.options.circleType == '2' ? '设计案例-' + target.dataset.options.caseName : target.dataset.options.circleDesc}`

+ 6 - 2
packages/app/src/core/libs/models.ts

@@ -29,8 +29,8 @@ export interface MaterialDealer {
   materialsName: string
   materialsType: number
   brandLevel: number
-  manageType: []
-  manageBrand: []
+  manageType: any[]
+  manageBrand: any[]
   brandType: number
   storeAddress: string
   storeName: string
@@ -1394,4 +1394,8 @@ export enum BannerMode {
    * 设计游学
    */
   StudyTour = 5,
+  /**
+   * 合作商家
+   * */
+  Cooperation = 6,
 }

+ 1 - 1
packages/app/src/core/libs/net-images.ts

@@ -11,7 +11,7 @@ export enum NetImages {
   TopSpotlight = 'https://image.zhuchaohui.com/zhucaohui/3a561f2dcbfd84474e44ff8f031c6ac749a874cb27c8a2f94f26a42a4633302b.png',
   Stars = 'https://image.zhuchaohui.com/zhucaohui/dc15a86a2034ddc17e2825b56319902af1635c20e065919750ebbe51ee95f635.png',
   HonorsHeader = 'https://image.zhuchaohui.com/zhucaohui/3945d2a7643317aca126c4b766139c4560c6ce2c051b7e03ee0ac664abe966c3.png',
-  CyclingRankingsHeaderBg = 'https://image.zhuchaohui.com/zhucaohui/2351014a57a0df427516c4993876ade7e3695ce33b1f227c52c8381aa631ba02.png',
+  CyclingRankingsHeaderBg = 'https://image.zhuchaohui.com/zhucaohui/b5e59106d3e20a974ceb2820ebe3735a66ff75d2f83411e00fd2a4850cb1ad41.png',
   HonorsLogo = 'https://image.zhuchaohui.com/zhucaohui/109805f7e6a8866e6484eea793de572e97cde85c5d65a2f514cf66aacc41609d.svg',
   WechatChannelsGuide = 'https://image.zhuchaohui.com/zhucaohui/4127d21eb75ab479b89f566f0d9479664d595091098acedf0ec29d696a60d034.png',
   VideoTutorial = 'https://image.zhuchaohui.com/zhucaohui/41c03bb6b16badf1ce018b20fbfe0022464a70f28574c97d88f383b6f1fd0ac4.mp4',

+ 6 - 1
packages/app/src/core/libs/requests.ts

@@ -345,7 +345,7 @@ export const updateSetIndexConfig = (data: { id: number; status: number }) =>
  */
 export const getMaterials = (query = {}) =>
   httpGet<{
-    list: MaterialDealer[]
+    [key: string]: MaterialDealer[]
   }>('/app-api/member/materials/page', query)
 export const getAppMaterials = () =>
   httpGet<MaterialDealerRes[]>('/app-api/member/materials/appMaterialsList')
@@ -620,6 +620,11 @@ export const getPhotoList = (query: { bizId: string; bizType: '1' | '2'; pageSiz
 export const getBanners = (query: { mode: BannerMode }) =>
   httpGet<Banner[]>('/app-api/member/banner/get-by-mode', query)
 /**
+ * 获取Banner Logo
+ * */
+export const getBannerLogo = (query: { modeType: BannerMode }) =>
+  httpGet<Banner[]>('/app-api/member/banner/list', query)
+/**
  * 获取消息列表
  */
 export const getMessages = (query) =>

+ 13 - 10
packages/app/src/layouts/tabbar.vue

@@ -17,9 +17,11 @@ import { currRoute } from '../utils'
 import { defaultThemeVars } from '../core/themes/default'
 import { useRouter } from '../core/utils/router'
 import HonorDialog from '@/pages/home/components/honor-dialog/honor-dialog.vue'
+import { useGlobalStore } from '@/store'
 
+const { setPublishState } = useGlobalStore()
 const router = useRouter()
-const publishState = ref(false)
+const publishState = computed(() => useGlobalStore().publishState)
 const messageCount = ref(false)
 const items = [
   {
@@ -57,13 +59,12 @@ const items = [
 ]
 const handleTabbarItemClick = (path: string) => {
   if (path === '/pages-sub/publish/index') {
-    publishState.value = true
+    setPublishState(true)
     uni.$emit('clickTabbar', publishState.value)
     return
   }
   getMessageNotice()
   router.push(path, true)
-  // uni.switchTab({ url: path })
 }
 const getMessageNotice = async () => {
   let value = await readCount()
@@ -80,21 +81,23 @@ const getMessageNotice = async () => {
   }
 }
 const handlePublishState = () => {
-  publishState.value = false
+  setPublishState(false)
   uni.$emit('clickTabbar', publishState.value)
 }
 onShow(async () => {
   await getMessageNotice()
 })
 const toPublishMoment = () => {
-  router.push('/pages-sub/publish/moment/index?circleType=1')
-  publishState.value = false
-  uni.$emit('clickTabbar', publishState.value)
+  router.push('/pages-sub/publish/moment/index?circleType=1').then(() => {
+    setPublishState(false)
+    uni.$emit('clickTabbar', publishState.value)
+  })
 }
 const toPublishCase = () => {
-  router.push('/pages-sub/publish/moment/index?circleType=2')
-  publishState.value = false
-  uni.$emit('clickTabbar', publishState.value)
+  router.push('/pages-sub/publish/moment/index?circleType=2').then(() => {
+    setPublishState(false)
+    uni.$emit('clickTabbar', publishState.value)
+  })
 }
 </script>
 

+ 81 - 17
packages/app/src/pages-sub/home/offline-activity/cycling-rankings/index.vue

@@ -12,14 +12,24 @@ import { storeToRefs } from 'pinia'
 import { ComponentExposed } from 'vue-component-type-helpers'
 
 const PageHelperEvoRef = ref<ComponentExposed<typeof PageHelperEvo>>()
+const checked = ref<string>('期榜')
 const handleComfirm = () => {
   nextTick(() => {
     PageHelperEvoRef.value?.reload()
   })
 }
+const handleChecked = ({ value }) => {
+  checked.value = value
+  if (value === '总榜') {
+    current.value = ''
+  } else {
+    current.value = current.value ? current.value : (ridingOptions.value[0]?.id ?? '')
+  }
+  handleComfirm()
+}
 const userStore = useUserStore()
 const { userInfo } = storeToRefs(userStore)
-const current = ref('')
+const current = ref<number | string>('')
 // const { data, run } = useRequest(() => ({}), { initialData: [] })
 const { data: ridingOptions, run: setRidingOptions } = useRequest(() => getRidingOptions(), {
   initialData: [],
@@ -27,6 +37,7 @@ const { data: ridingOptions, run: setRidingOptions } = useRequest(() => getRidin
 const query = computed(() => (current.value ? { activityId: current.value } : {}))
 onLoad(async () => {
   await setRidingOptions()
+  current.value = ridingOptions.value[0]?.id ?? ''
 })
 onShareAppMessage(() => ({
   title: '骑行排行榜',
@@ -38,29 +49,52 @@ onShareTimeline(() => ({
 <template>
   <div class="flex-grow flex flex-col bg-[length:100%]">
     <NavbarEvo transparent dark title="骑行榜"></NavbarEvo>
-    <div class="aspect-[1.19/1] relative">
+    <div class="aspect-[1.14/1] relative">
       <wd-img
         width="100%"
         custom-class="vertical-bottom"
         mode="widthFix"
         :src="NetImages.CyclingRankingsHeaderBg"
       ></wd-img>
-      <div class="absolute bottom-50 left-7.25">
-        <wd-picker
-          @confirm="handleComfirm"
-          v-model="current"
-          :columns="[
-            { label: '全部', value: '' },
-            ...ridingOptions.map((it) => ({ label: it.name, value: it.id })),
-          ]"
-          use-default-slot
-        >
-          <div class="text-[white] text-sm font-normal font-['PingFang_SC'] leading-relaxed">
-            <!--          {{ dayjs(year).format('YYYY') }}-->
-            {{ ridingOptions.find((it) => it.id === current)?.name ?? '全部' }}
-            <wd-icon name="arrow-down" size="12" class="text-[#ffffff]"></wd-icon>
+      <div class="absolute bottom-50 flex justify-between px-30px w-[calc(100%-60px)] items-center">
+        <div class="relative w-80px">
+          <wd-switch
+            v-model="checked"
+            @change="handleChecked"
+            custom-class="w-80px! absolute top-0px left-0 z-11 rounded-full"
+            active-value="总榜"
+            active-color="rgba(0,0,0,0)"
+            inactive-color="rgba(0,0,0,0)"
+            inactive-value="期榜"
+          />
+          <div
+            class="absolute top-0 left-0 w-80px border-[1px] border-solid border-[#FFFFFF] h-32px z-10 rounded-full overflow-hidden flex items-center justify-between"
+          >
+            <div class="w-40px text-center lh-32px font-size-[14px] text-[#FFFFFF]">期榜</div>
+            <div class="w-40px text-center lh-32px font-size-[14px] text-[#FFFFFF]">总榜</div>
           </div>
-        </wd-picker>
+        </div>
+        <div v-show="checked === '期榜'">
+          <wd-picker
+            @confirm="handleComfirm"
+            v-model="current"
+            :columns="[...ridingOptions.map((it) => ({ label: it.name, value: it.id }))]"
+            use-default-slot
+          >
+            <div class="flex items-center">
+              <div
+                class="w-200px text-right text-[white] text-sm font-normal font-['PingFang_SC'] leading-relaxed ws-nowrap overflow-hidden text-ellipsis"
+              >
+                <!--          {{ dayjs(year).format('YYYY') }}-->
+                {{ ridingOptions.find((it) => it.id === current)?.name ?? '全部' }}
+              </div>
+              <wd-icon name="arrow-down" size="12" custom-class="text-[#ffffff]"></wd-icon>
+            </div>
+          </wd-picker>
+        </div>
+        <div class="text-right lh-32px font-size-[14px] text-[#FFFFFF]" v-show="checked === '总榜'">
+          筑巢荟骑行俱乐部累计总榜单
+        </div>
       </div>
     </div>
     <PageHelperEvo
@@ -227,3 +261,33 @@ onShareTimeline(() => ({
     </PageHelperEvo>
   </div>
 </template>
+
+<style lang="scss" scoped>
+::v-deep .wd-switch {
+  &__circle {
+    width: 40px !important;
+    border-radius: 26px !important;
+    height: 30px !important;
+    &::after {
+      content: '期榜' !important;
+      color: rgba($color: #000000, $alpha: 0.85);
+      text-align: center;
+      line-height: 26px;
+      height: 26px !important;
+      display: block;
+    }
+  }
+  &.is-checked {
+    .wd-switch__circle {
+      left: 40px !important;
+      &::after {
+        content: '总榜' !important;
+        color: rgba($color: #000000, $alpha: 0.85);
+        text-align: center;
+        height: 26px !important;
+        display: block;
+      }
+    }
+  }
+}
+</style>

+ 13 - 8
packages/app/src/pages-sub/mine/honors/detail/index.vue

@@ -26,7 +26,7 @@ const { userInfo } = storeToRefs(userStore)
 const badgePath = ref<any[]>([
   { badgeType: '游学徽章', path: '/pages-sub/home/study-tour/index' },
   { badgeType: '课程徽章', path: '/pages-sub/home/offline-activity/index' },
-  { badgeType: '传播徽章', path: '/pages-sub/mine/homepage/index' },
+  { badgeType: '传播徽章', path: `/pages-sub/mine/homepage/index?id=${id.value}` },
   { badgeType: '积分徽章', path: '/pages-sub/home/mall/index' },
   { badgeType: '打卡徽章', path: '/pages/mine/index' },
   { badgeType: '活动徽章', path: '/pages-sub/home/offline-activity/index' },
@@ -46,16 +46,14 @@ const createPoster = () => {
   return new Promise((resolve, reject) => {
     ;(async () => {
       uni.showLoading({ title: '生成中' })
-      const [bgPath, badgePath, avatarPath, icon1, icon2, icon3, icon4] = await Promise.all(
+      const [bgPath, badgePath, avatarPath, icon1, icon2] = await Promise.all(
         [
           NetImages.TopSpotlight,
           data.value.quantity ? data.value.activedImage : data.value.image,
           designer.value.headImgUrl || userInfo.value?.avatar || NetImages.DefaultAvatar,
           NetImages.Logo,
           designer.value?.qrcodeUrl,
-          'https://image.zhuchaohui.com/zhucaohui/9f89604f285c33200b7e6fda9acc82e130f34c2f5687cfeb78f3541e1fabcc28.png',
-          'https://image.zhuchaohui.com/zhucaohui/2467be55426018856150bd94bbd21865df3d73ce982bc1c82b7585cf26c822f0.png',
-        ].map((it) => uni.getImageInfo({ src: it }).then(({ path }) => path)),
+        ].map((it) => it && uni.getImageInfo({ src: it }).then(({ path }) => path)),
       )
       const ctx = uni.createCanvasContext('firstCanvas')
       ctx.fillStyle = '#141823'
@@ -90,7 +88,7 @@ const createPoster = () => {
                 resolve(res.tempFilePath)
               },
               fail: (err) => {
-                // uni.hideLoading()
+                uni.hideLoading()
                 reject(err)
               },
             })
@@ -134,8 +132,9 @@ const subTitle = computed(() =>
 const setBadgesPath = (type: string) => {
   if (type === '游学徽章' || type === '典藏勋章') {
     if (banners.value?.length > 0) {
+      // url: `/pages-sub/home/study-tour/list?designStudyAbroadYear=${banners.value[0].designStudyAbroadYear}&designDesc=${banners.value[0].designDesc}`,
       uni.redirectTo({
-        url: `/pages-sub/home/study-tour/list?designStudyAbroadYear=${banners.value[0].designStudyAbroadYear}&designDesc=${banners.value[0].designDesc}`,
+        url: '/pages-sub/home/study-tour/index',
       })
     } else {
       uni.showToast({
@@ -187,6 +186,12 @@ onLoad(async (query: { type: 'badge' | 'certificate'; data: string; id: number }
       badgeDescription: badge.badgeDescription,
       createTime: badge.createTime,
     }
+    badgePath.value = badgePath.value.map((m) => {
+      if (m.badgeType === '传播徽章') {
+        m.path = `/pages-sub/mine/homepage/index?id=${id.value}`
+      }
+      return { ...m }
+    })
     console.log('=======================', data)
     await setBanners()
     if (data.value.quantity > 0) {
@@ -244,7 +249,7 @@ onLoad(async (query: { type: 'badge' | 'certificate'; data: string; id: number }
           class="text-center text-white text-sm font-normal font-['PingFang_SC'] uppercase"
           v-else
         >
-          暂获得该徽章
+          暂获得该徽章
         </div>
         <div class="w-4 h-0.25 bg-white"></div>
       </div>

+ 19 - 19
packages/app/src/pages-sub/mine/invite/index.vue

@@ -8,7 +8,6 @@
 }
 </route>
 <script setup lang="ts">
-import SectionHeading from '@/components/section-heading.vue'
 import { getDesignerInfo, updateDesignerInfo } from '../../../core/libs/requests'
 import { useUserStore } from '../../../store'
 import { storeToRefs } from 'pinia'
@@ -27,7 +26,7 @@ const form = ref<{
   userId?: number
   videoNumber?: string
 }>()
-const windowInfo  = ref<{}>
+const windowInfo = ref<{}>
 const { data, run: setData } = useRequest(() => getDesignerInfo(userInfo.value.userId))
 const { loading, run: submiting } = useRequest(() => updateDesignerInfo(form.value))
 const posterUrl = ref()
@@ -36,19 +35,20 @@ const createPoster = () => {
   return new Promise((resolve, reject) => {
     ;(async () => {
       uni.showLoading({ title: '生成中' })
-      const [path, bgPath, qrcode, logoPath, avatarPath, icon1, icon2, icon3, icon4] = await Promise.all(
-        [
-          data.value.sharePageUrl,
-          NetImages.InviteBg,
-		  data.value.qrcodeUrl,
-          NetImages.Logo,
-          data.value.headImgUrl || userInfo.value?.avatar || NetImages.DefaultAvatar,
-          'https://image.zhuchaohui.com/zhucaohui/315c5ca680bc6b47a5344dbff701cf1e6802d8a240754e25ef3d4308bc1deef6.png',
-          'https://image.zhuchaohui.com/zhucaohui/ee83d30d553feb1482920e49c28824d73bb33838d996ec2f6c646ae6deab0330.png',
-          'https://image.zhuchaohui.com/zhucaohui/9f89604f285c33200b7e6fda9acc82e130f34c2f5687cfeb78f3541e1fabcc28.png',
-          'https://image.zhuchaohui.com/zhucaohui/2467be55426018856150bd94bbd21865df3d73ce982bc1c82b7585cf26c822f0.png',
-        ].map((it) => uni.getImageInfo({ src: it }).then(({ path }) => path)),
-      )
+      const [path, bgPath, qrcode, logoPath, avatarPath, icon1, icon2, icon3, icon4] =
+        await Promise.all(
+          [
+            data.value.sharePageUrl,
+            NetImages.InviteBg,
+            data.value.qrcodeUrl,
+            NetImages.Logo,
+            data.value.headImgUrl || userInfo.value?.avatar || NetImages.DefaultAvatar,
+            'https://image.zhuchaohui.com/zhucaohui/315c5ca680bc6b47a5344dbff701cf1e6802d8a240754e25ef3d4308bc1deef6.png',
+            'https://image.zhuchaohui.com/zhucaohui/ee83d30d553feb1482920e49c28824d73bb33838d996ec2f6c646ae6deab0330.png',
+            'https://image.zhuchaohui.com/zhucaohui/9f89604f285c33200b7e6fda9acc82e130f34c2f5687cfeb78f3541e1fabcc28.png',
+            'https://image.zhuchaohui.com/zhucaohui/2467be55426018856150bd94bbd21865df3d73ce982bc1c82b7585cf26c822f0.png',
+          ].map((it) => uni.getImageInfo({ src: it }).then(({ path }) => path)),
+        )
       const ctx = uni.createCanvasContext('firstCanvas')
       const getPx = (width, designPx) => {
         return (width / 319) * designPx
@@ -62,7 +62,7 @@ const createPoster = () => {
           ctx.drawImage(path, 0, 0, w, w / 1.56)
           canvas.CircleImage(avatarPath, 17, 21, 14)
           canvas.Image(logoPath, 17, 230, 24, 24)
-		  canvas.Image(qrcode, 200, 350, 100, 100)
+          canvas.Image(qrcode, 200, 350, 100, 100)
           canvas.FillText(userInfo.value?.nickname, '#ffffff', 14, 53, 40)
           canvas.FillText('筑巢荟—助力设计师成长平台', '#ffffff', 18, 53, 248)
           canvas.FillText('国内外设计游学', '#ffffff', 12, 62, 303)
@@ -80,8 +80,8 @@ const createPoster = () => {
               canvasId: 'firstCanvas',
               width: 300,
               height: 460,
-			  fileType: "jpg",
-			  quality: 1,
+              fileType: 'jpg',
+              quality: 1,
               success: (res) => {
                 // console.log('生成海报', res)
                 uni.hideLoading()
@@ -149,7 +149,7 @@ onMounted(async () => {
         <div class="absolute bottom-5.5 left-5.5 flex justify-between" v-if="canvasHidden">
           <!-- <cover-view> -->
           <wd-button custom-class="bg-white/10!" @click="save">保存到相册</wd-button>
-		  <!-- <div style="margin-left: 100rpx;">
+          <!-- <div style="margin-left: 100rpx;">
 			  <wd-img :width="50" :height="50" :src="data.qrcodeUrl"></wd-img>
 		  </div> -->
           <!-- </cover-view> -->

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

@@ -189,7 +189,7 @@ onLoad(async (query: { circleType: '1' | '2' }) => {
         *
       </span>
       <SectionHeading
-        title="实景图:"
+        title="案例图片:"
         subtitle="首图建议尺寸1125x1104,最多可上传30张"
         size="base"
         custom-class="my-5"

+ 13 - 5
packages/app/src/pages/material/detail/index.vue

@@ -161,7 +161,10 @@ onShareTimeline(() => ({
                 }}
                 |
                 {{
-                  materialOperationTypes.filter(({ value }) => data.manageType.includes(Number.parseInt(value))).map(i => i.label).join(' / ')
+                  materialOperationTypes
+                    .filter(({ value }) => data.manageType.includes(Number.parseInt(value)))
+                    .map((i) => i.label)
+                    .join(' / ')
                 }}
               </div>
               <div>
@@ -172,8 +175,11 @@ onShareTimeline(() => ({
                   class="text-black/40 text-xs font-normal font-['PingFang_SC'] uppercase leading-[10px]"
                 >
                   <!-- imola / chedit -->
-                   {{
-                    materialsManageBrands.filter(({ value }) => data.manageBrand.includes(Number.parseInt(value))).map(i => i.label).join(' / ')
+                  {{
+                    materialsManageBrands
+                      .filter(({ value }) => data.manageBrand.includes(Number.parseInt(value)))
+                      .map((i) => i.label)
+                      .join(' / ')
                   }}
                 </span>
               </div>
@@ -260,11 +266,13 @@ onShareTimeline(() => ({
           </div>
         </div>
       </Card>
-      <template v-if="materialHomePageData.productDOList?.length">
+      <template
+        v-if="materialHomePageData.productDOList && materialHomePageData.productDOList?.length"
+      >
         <SectionHeading title="产品展示"></SectionHeading>
       </template>
       <template
-        v-if="materialHomePageData.productDOList?.length"
+        v-if="materialHomePageData.productDOList && materialHomePageData.productDOList?.length"
         v-for="(it, index) in materialHomePageData.productDOList"
         :key="index"
       >

+ 235 - 89
packages/app/src/pages/material/index.vue

@@ -4,18 +4,33 @@
 
 <script setup lang="ts">
 import Card from '@/components/card.vue'
-import SectionHeading from '@/components/section-heading.vue'
 import { abc } from '../../core/libs/pngs'
-import { getAppMaterials, getBanners, getByDictType, getMaterials } from '../../core/libs/requests'
+import {
+  getAppMaterials,
+  getBanners,
+  getByDictType,
+  getMaterials,
+  getBannerLogo,
+} from '../../core/libs/requests'
 import { close, phone } from '../../core/libs/svgs'
 import { BannerMode, DictType, MaterialDealer, MaterialsList } from '../../core/libs/models'
 import routerIcon from '@designer-hub/assets/src/assets/svgs/router'
 import Banner from '@/pages/home/components/banner.vue'
-// import materialDealers from '@designer-hub/assets/src/libs/assets/materialDealers'
 import { useRouter } from '../../core/utils/router'
-import PageHelperEvo from '@/components/page-helper-evo.vue'
 import { handleCall, openLocation } from '../../core/utils/common'
+import { NetImages } from '@/core/libs/net-images'
 
+const searchParams = ref({
+  manageBrandSet: [],
+  manageTypeSet: [],
+})
+const query = computed(() => {
+  return {
+    manageBrandSet: searchParams.value.manageBrandSet.join(','),
+    manageTypeSet: searchParams.value.manageTypeSet.join(','),
+  }
+})
+const translateType = ref<string>('')
 const router = useRouter()
 const { data: materialDealerData, run: setMaterialDealerData } = useRequest(
   () => getAppMaterials(),
@@ -29,10 +44,22 @@ const { data: materialBrandTypes, run: setMaterialBrandTypes } = useRequest(
   () => getByDictType(DictType.memberMaterialsBrandType),
   { initialData: [] },
 )
+// 经营品牌 materialsManageBrand
+const { data: materialsManageBrand, run: setMaterialsManageBrand } = useRequest(
+  () => getByDictType(DictType.materialsManageBrand),
+  { initialData: [] },
+)
+const { data: materials, run: setMaterials } = useRequest(() => getMaterials(query.value), {
+  initialData: {},
+})
 const { data: banners, run: setBanners } = useRequest(
   () => getBanners({ mode: BannerMode.Material }),
   { initialData: [] },
 )
+const { data: bannersLogo, run: setBannersLogo } = useRequest(
+  () => getBannerLogo({ modeType: BannerMode.Cooperation }),
+  { initialData: [] },
+)
 const dealerPanelState = ref(false)
 const currentDeraler = ref<MaterialDealer>()
 const pieces = ref([
@@ -70,6 +97,13 @@ const pieces = ref([
 const current = ref<number>(0)
 const swiperList = computed(() => banners.value.map((it) => it.bannerImgUrl))
 const materialsByBrandLevel = ref<{ list: MaterialDealer[] }[]>([])
+const handleTranslateType = (value: string) => {
+  if (translateType.value === value) {
+    translateType.value = ''
+  } else {
+    translateType.value = value
+  }
+}
 const handleMenuItemClick = ({ path }: any) => {
   router.push(path)
 }
@@ -78,45 +112,36 @@ const toDetail = (id: number) => {
     url: `/pages/material/detail/index?id=${id}`,
   })
 }
-function handleClick(e) {
-  console.log(e)
+const resetSearch = () => {
+  searchParams.value = {
+    manageBrandSet: [],
+    manageTypeSet: [],
+  }
+  translateType.value = ''
+  setMaterials()
 }
-function onChange(e) {
-  console.log(e)
+const submitSearch = () => {
+  setMaterials()
 }
 onMounted(async () => {
   await setMaterialDealerData()
   console.log(materialDealerData.value)
 
-  await Promise.all([setMaterialBrandTypes(), setMaterialOperationTypes(), setBanners()])
-  // const reqs = data.value.map((it) =>
-  //   getMaterials({ brandLevel: it.value }).then(({ data }) => data),
-  // )
-  // materialsByBrandLevel.value = await Promise.all(reqs)
-  // console.log(materialsByBrandLevel.value)
-  // const res = await getAppMaterials()
-  // console.log(res)
+  await Promise.all([
+    setMaterialBrandTypes(),
+    setMaterialsManageBrand(),
+    setMaterialOperationTypes(),
+    setBanners(),
+    setBannersLogo(),
+    setMaterials(),
+  ])
+
+  console.log('setBannersLogo', bannersLogo.value)
 })
 </script>
 <template>
   <view class="">
     <view class="bg-black w-full pos-relative aspect-[1.26/1]">
-      <!-- <wd-img
-        width="100%"
-        height="100%"
-        src="https://image.zhuchaohui.com/zhucaohui/f866f4f72392e8f4627d8f5d6628739ad7f0907d3703139e7cdbcb999b803dfe.jpg"
-      /> -->
-      <!-- <wd-swiper
-        custom-class="rounded-2xl overflow-hidden aspect-[1.26/1]"
-        width="100%"
-        height="100%"
-        :list="swiperList"
-        autoplay
-        v-model:current="current"
-        :indicator="{ type: 'dots-bar' } as any"
-        @click="handleClick"
-        @change="onChange"
-      ></wd-swiper> -->
       <Banner
         :mode="BannerMode.Material"
         aspect="1.26/1"
@@ -159,68 +184,183 @@ onMounted(async () => {
       <!-- <template v-for="({ brandLevelName, materialsList }, i) in materialDealerData" :key="i">
         <SectionHeading :title="brandLevelName" custom-class="mx-3.5"></SectionHeading>
       </template> -->
-      <SectionHeading :title="'积分商家'" custom-class="mx-3.5"></SectionHeading>
-      <PageHelperEvo :request="getMaterials" :query="{}">
-        <template #default="{ source }">
-          <div class="my-6 px-3.5 grid grid-cols-2 gap-x-2.5 gap-y-4">
-            <template v-for="(it, i) in source.list" :key="i">
-              <div class="" @click="toDetail(it.id)">
-                <Card class="h-full">
-                  <div class="flex flex-col items-center">
-                    <wd-img
-                      width="78"
-                      height="78"
-                      custom-class="border border-[#f2f2f2] border-solid rounded-full overflow-hidden"
-                      :src="it.logoUrl"
-                    ></wd-img>
-                    <div
-                      class="my-4 text-black/90 text-base font-normal font-['PingFang_SC'] leading-[10.18px]"
-                    >
-                      {{ it.materialsName }}
-                    </div>
-                    <div
-                      class="mb-4 text-black/60 text-sm font-normal font-['PingFang_SC'] leading-[10.18px]"
-                    >
-                      <!-- 进口品牌 -->
-                      {{
-                        (it.brandType,
-                        materialBrandTypes.find(({ value }) => value === String(it.brandType))
-                          ?.label)
-                      }}
-                      |
-                      {{
-                        materialOperationTypes.filter(({ value }) => it.manageType.includes(Number.parseInt(value))).map(i => i.label)?.[0]
-                      }}
-                    </div>
-                    <div @click.stop>
-                      <wd-button
-                        size="small"
-                        custom-class="my-4"
-                        @click.stop="() => ((dealerPanelState = true), (currentDeraler = it))"
-                      >
-                        联系商家
-                      </wd-button>
-                    </div>
-                    <div
-                      class="text-black/30 text-xs font-normal font-['PingFang_SC'] leading-[10.18px]"
-                    >
-                      {{ it.virtualArrival || it.cumulativeStoreNum || 0 }}次到店打卡
-                    </div>
-                  </div>
-                </Card>
+      <div class="mx-14px py-3.5 bg-[#fff] rounded-2xl">
+        <div class="text-center text-sm font-bold text-black/85 mb-3.5">合作商家</div>
+        <div class="px-3.5 grid grid-cols-2 gap-x-2.5 gap-y-4">
+          <wd-img
+            width="100%"
+            height="30"
+            src="https://image.zhuchaohui.com/zhucaohui/e9352960e272c774da6aa8618691b3bbdbaa5b906c9c4ef2513db2695435a713.jpg"
+          ></wd-img>
+          <wd-img
+            width="100%"
+            height="30"
+            src="https://image.zhuchaohui.com/zhucaohui/e9352960e272c774da6aa8618691b3bbdbaa5b906c9c4ef2513db2695435a713.jpg"
+          ></wd-img>
+        </div>
+      </div>
+      <div class="text-black/85 mx-14px">
+        <div class="flex items-center justify-between py-3.5">
+          <div class="text-xl">积分商家</div>
+          <div class="text-sm text-black/65 flex items-center px-2.5">
+            <div
+              class="w-100px text-right flex items-center justify-end"
+              @click="handleTranslateType('brandType')"
+            >
+              <div
+                :class="[
+                  translateType === 'brandType' || searchParams.manageBrandSet.length > 0
+                    ? 'color-[#0CBE7D]'
+                    : '',
+                ]"
+              >
+                品牌
               </div>
-            </template>
+              <wd-icon
+                :color="
+                  translateType === 'brandType' || searchParams.manageBrandSet.length > 0
+                    ? '#0CBE7D'
+                    : ''
+                "
+                :name="
+                  translateType === 'brandType' || searchParams.manageBrandSet.length > 0
+                    ? 'caret-down-small'
+                    : 'caret-up-small'
+                "
+                size="14px"
+              ></wd-icon>
+            </div>
+            <div
+              class="w-100px text-right flex items-center justify-end"
+              @click="handleTranslateType('manageType')"
+            >
+              <div
+                :class="[
+                  translateType === 'manageType' || searchParams.manageTypeSet.length > 0
+                    ? 'color-[#0CBE7D]'
+                    : '',
+                ]"
+              >
+                类型
+              </div>
+              <wd-icon
+                :color="
+                  translateType === 'manageType' || searchParams.manageTypeSet.length > 0
+                    ? '#0CBE7D'
+                    : ''
+                "
+                :name="
+                  translateType === 'manageType' || searchParams.manageTypeSet.length > 0
+                    ? 'caret-down-small'
+                    : 'caret-up-small'
+                "
+                size="14px"
+              ></wd-icon>
+            </div>
+          </div>
+        </div>
+        <!-- 查询条件 -->
+        <div
+          class="rounded-xl bg-[#fff] overflow-hidden ease-in-out transition-property-[height] duration-300"
+          :class="translateType ? 'h-auto' : 'h-0'"
+          v-if="translateType"
+        >
+          <template v-if="translateType === 'brandType'">
+            <wd-checkbox-group v-model="searchParams.manageBrandSet" cell shape="button">
+              <wd-checkbox
+                v-for="it in materialsManageBrand"
+                checked-color="#0CBE7D"
+                :key="it.value"
+                :modelValue="it.value"
+              >
+                {{ it.label }}
+              </wd-checkbox>
+            </wd-checkbox-group>
+          </template>
+          <template v-else>
+            <wd-checkbox-group v-model="searchParams.manageTypeSet" cell shape="button">
+              <wd-checkbox
+                v-for="it in materialOperationTypes"
+                checked-color="#0CBE7D"
+                :key="it.value"
+                :modelValue="it.value"
+              >
+                {{ it.label }}
+              </wd-checkbox>
+            </wd-checkbox-group>
+          </template>
+
+          <!-- 确定按钮 -->
+          <div class="flex items-center justify-between pb-20px pt-10px">
+            <wd-button plain type="success" custom-class="h-38px! w-154px!" @click="resetSearch">
+              重置
+            </wd-button>
+            <wd-button type="success" custom-class="h-38px! w-154px!" @click="submitSearch">
+              确认
+            </wd-button>
+          </div>
+        </div>
+      </div>
+      <div class="px-3.5 pb-3.5">
+        <template v-for="([key, it], i) in Object.entries(materials)" :key="i">
+          <div class="flex items-center gap-2 py-4">
+            {{ key.toString() }}
+          </div>
+          <div class="grid grid-cols-2 gap-x-2.5 gap-y-4">
+            <Card class="h-full" v-for="item in it" :key="item.id">
+              <div class="flex flex-col items-center" @click="toDetail(item.id)">
+                <wd-img
+                  width="78"
+                  height="78"
+                  custom-class="border border-[#f2f2f2] border-solid rounded-full overflow-hidden"
+                  :src="item.logoUrl"
+                ></wd-img>
+                <div
+                  class="my-4 text-black/90 text-base font-normal font-['PingFang_SC'] leading-[10.18px]"
+                >
+                  {{ item.materialsName }}
+                </div>
+                <div
+                  class="mb-4 text-black/60 text-sm font-normal font-['PingFang_SC'] leading-[10.18px]"
+                >
+                  <!-- 进口品牌 -->
+                  {{
+                    (item.brandType,
+                    materialBrandTypes.find(({ value }) => value === String(item.brandType))?.label)
+                  }}
+                  |
+                  {{
+                    materialOperationTypes
+                      .filter(({ value }) => item.manageType.includes(Number.parseInt(value)))
+                      .map((i) => i.label)?.[0]
+                  }}
+                </div>
+                <div @click.stop>
+                  <wd-button
+                    size="small"
+                    custom-class="my-4"
+                    @click.stop="() => ((dealerPanelState = true), (currentDeraler = item))"
+                  >
+                    联系商家
+                  </wd-button>
+                </div>
+                <div
+                  class="text-black/30 text-xs font-normal font-['PingFang_SC'] leading-[10.18px]"
+                >
+                  {{ item.virtualArrival || item.cumulativeStoreNum || 0 }}次到店打卡
+                </div>
+              </div>
+            </Card>
           </div>
         </template>
-      </PageHelperEvo>
+        <template v-if="Object.keys(materials).length === 0">
+          <div class="flex-grow flex flex-col justify-center">
+            <wd-status-tip :image="NetImages.NotContent" tip="暂无内容"></wd-status-tip>
+          </div>
+        </template>
+      </div>
     </view>
 
-    <!-- <wd-action-sheet v-model="dealerPanelState">
-      <div class="relative absolute">
-        <div class="absolute top--4">x</div>
-      </div>
-      <view style="padding: 15px 15px 150px 15px">内容</view>
-    </wd-action-sheet> -->
     <wd-overlay :show="dealerPanelState" @click="dealerPanelState = false">
       <view class="wrapper flex flex-col justify-end h-full">
         <div class="w-full flex justify-end mb-4">
@@ -290,4 +430,10 @@ onMounted(async () => {
 :deep(.customIndicatorClass) {
   bottom: 80rpx !important;
 }
+:deep(.wd-checkbox__btn-check) {
+  display: none !important;
+}
+:deep(.wd-checkbox.is-button.is-checked .wd-checkbox__label) {
+  background-color: rgba($color: #0cbe7d, $alpha: 0.06);
+}
 </style>

+ 17 - 30
packages/app/src/pages/mine/index.vue

@@ -7,6 +7,7 @@ import { onMounted, ref } from 'vue'
 import CardMenu from '@/components/card-menu.vue'
 import SectionHeading from '@/components/section-heading.vue'
 import { designer, settled, treaty, vipBg } from '../../core/libs/pngs'
+import { BannerMode } from '@/core/libs/models'
 import { integral, coupon, order, agent, setting, vip, scan, close } from '../../core/libs/svgs'
 import {
   getDesignerInfo,
@@ -16,8 +17,9 @@ import {
   getAppMemberLevelConfigs,
   getCircleTaskStatus,
   getHonorStatistics,
+  getBanners,
 } from '../../core/libs/requests'
-import { useUserStore } from '../../store'
+import { useUserStore, useGlobalStore } from '../../store'
 import { storeToRefs } from 'pinia'
 import { isEmpty, set } from 'radash'
 import TasksCard from './components/tasks-card.vue'
@@ -40,6 +42,15 @@ const { data, run } = useRequest(getMemberUserInfo)
 const { data: taskData, run: getTaskData } = useRequest(() => getTasks({}), {
   initialData: { list: [] },
 })
+const { setPublishState } = useGlobalStore()
+const publishState = computed(() => useGlobalStore().publishState)
+const tabbar$on = () => {
+  setPublishState(true)
+}
+const { data: banners, run: setBanners } = useRequest(
+  () => getBanners({ mode: BannerMode.StudyTour }),
+  { initialData: [] },
+)
 const { data: taskStatusData, run: setTaskStatus } = useRequest(
   async () => ({
     data: await Promise.all<any>([
@@ -48,7 +59,7 @@ const { data: taskStatusData, run: setTaskStatus } = useRequest(
         btnProps: {
           content: data ? '已完成' : '去发布',
           disabled: data,
-          onClick: () => router.push('/pages-sub/publish/moment/index?circleType=1'),
+          onClick: () => tabbar$on(),
         },
       })),
       {
@@ -104,28 +115,6 @@ const menus = ref([
   { title: '专属客服', icon: agent, path: '/pages-sub/mine/agents/index' },
   { title: '个人设置', icon: setting, path: '/pages-sub/mine/setting/index' },
 ])
-const levels = ref({
-  1: {
-    color: '#3b5369',
-    bgImg:
-      'https://image.zhuchaohui.com/zhucaohui/997de03a59d201c7b5dc124561925431abdc849cc7044ad4fb7c758bc12fafb2.png',
-  },
-  2: {
-    color: '#3b5369',
-    bgImg:
-      'https://image.zhuchaohui.com/zhucaohui/77b6712b1cab7e769b630010be01eceec6cdd27f6947777b5a805e3cbf077db4.png',
-  },
-  3: {
-    color: '#3b5369',
-    bgImg:
-      'https://image.zhuchaohui.com/zhucaohui/60811dfd5c5a4fa7502cfc2ff3db188849d4f9363849420ba72e32c03f20eca5.png',
-  },
-  4: {
-    color: '#65341d',
-    bgImg:
-      'https://image.zhuchaohui.com/zhucaohui/236227e8094b50dafb21039c259b6fef9c9960a3347ae4286beddee23871e662.png',
-  },
-})
 const pieces = ref([
   {
     title: '设计师成长计划',
@@ -134,7 +123,7 @@ const pieces = ref([
     class: 'items-start! pb-0 pr-0',
     iconSize: 102,
     gridItemClass: 'col-start-1 row-start-1 row-end-3',
-    path: '/pages-sub/home/about/index',
+    path: '/pages-sub/home/study-tour/list',
   },
   {
     title: '材料商入驻',
@@ -189,10 +178,6 @@ const handleMenuClick = (path) => {
 const handleClickScan = async () => {
   const { result } = await uni.scanCode({})
   console.log(result)
-  // const a = qrCodeString2Object('WIFI:S:KM;T:WPA;P:km666888;H:false;;')
-  // console.log(a)
-  // console.log(toQrCodeString('到店', { a: 1, orderId: 2222 }))
-  // console.log(qrCodeString2Object(toQrCodeString('到店', { a: 1, orderId: 2222 })))
   const { type, options } = qrCodeString2Object(result)
   if (type === QrCodeBusinessType.InStoreClockIn) {
     if (!features.value.checkInAtStoreTask)
@@ -233,11 +218,13 @@ onMounted(async () => {
 onShow(async () => {
   if (isLogined.value) {
     await run()
+    await setBanners()
     setUserInfo({
       ...userInfo.value,
       ...data.value,
     })
     await Promise.all([setDesignerInfo(), getTaskData(), setTaskStatus(), setStatistics()])
+    pieces.value[0].path = `/pages-sub/home/study-tour/list?designStudyAbroadYear=${banners.value[0].designStudyAbroadYear}&designDesc=${banners.value[0].designDesc}`
     console.log(taskStatusData.value)
   }
 })
@@ -255,7 +242,7 @@ onPageScroll(({ scrollTop }: { scrollTop: number }) => {
       :bordered="false"
       v-bind="navBarProps"
     >
-      <template v-if="!isPublish" #left>
+      <template v-if="!publishState" #left>
         <wd-button
           v-if="isLogined"
           type="text"

+ 1 - 0
packages/app/src/store/index.ts

@@ -17,3 +17,4 @@ export default store
 export * from './user'
 export * from './member-levles'
 export * from './dict'
+export * from './global'

+ 0 - 1
packages/app/src/store/user.ts

@@ -7,7 +7,6 @@ export const useUserStore = defineStore(
   'user',
   () => {
     const userInfo = ref<IUserInfo>({ ...initState })
-
     const setUserInfo = (val: IUserInfo) => {
       userInfo.value = val
     }