瀏覽代碼

update code

kevin.T 1 周之前
父節點
當前提交
aff85c0d73
共有 2 個文件被更改,包括 20 次插入16 次删除
  1. 1 16
      packages/app/src/pages/material/index.vue
  2. 19 0
      packages/app/src/store/global.ts

+ 1 - 16
packages/app/src/pages/material/index.vue

@@ -94,9 +94,6 @@ const pieces = ref([
   //   path: '/pages/material/recommend/index',
   // },
 ])
-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 = ''
@@ -185,19 +182,7 @@ onMounted(async () => {
         <SectionHeading :title="brandLevelName" custom-class="mx-3.5"></SectionHeading>
       </template> -->
       <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>
+        <wd-swiper :list="bannersLogo.map((m) => m.bannerImgUrl)" autoplay></wd-swiper>
       </div>
       <div class="text-black/85 mx-14px">
         <div class="flex items-center justify-between py-3.5">

+ 19 - 0
packages/app/src/store/global.ts

@@ -0,0 +1,19 @@
+import { defineStore } from 'pinia'
+import { ref } from 'vue'
+
+export const useGlobalStore = defineStore(
+  'global',
+  () => {
+    const publishState = ref<boolean>(false)
+    const setPublishState = (state: boolean) => {
+      publishState.value = state
+    }
+    return {
+      publishState,
+      setPublishState,
+    }
+  },
+  {
+    persist: true,
+  },
+)