Bläddra i källkod

📖 code review:店铺装修逻辑

YunaiV 1 år sedan
förälder
incheckning
2b68109dd0

+ 1 - 1
pages/index/index.vue

@@ -1,3 +1,4 @@
+<!-- 首页,支持店铺装修 -->
 <template>
 	<view v-if="template">
 		<s-layout title="首页" navbar="custom" tabbar="/pages/index/index" :bgStyle="template.page"
@@ -20,7 +21,6 @@
 	} from '@dcloudio/uni-app';
 	import sheep from '@/sheep';
 	import $share from '@/sheep/platform/share';
-  import index2Api from '@/sheep/api/index2';
 	// 隐藏原生tabBar
 	uni.hideTabBar();
 

+ 2 - 0
pages/index/page.vue

@@ -1,3 +1,4 @@
+<!-- 自定义页面:支持装修 -->
 <template>
   <s-layout
     :title="page.name"
@@ -38,6 +39,7 @@
     }
     // #endif
 
+    // TODO @疯狂:貌似这里还没接上哈
     const { error, data } = await sheep.$api.app.page(id);
     if (error === 0) {
       page.name = data.name;

+ 1 - 0
pages/index/user.vue

@@ -1,3 +1,4 @@
+<!-- 个人中心:支持装修 -->
 <template>
   <s-layout
     title="我的"

+ 1 - 0
sheep/components/s-block/s-block.vue

@@ -1,3 +1,4 @@
+<!-- 装修组件容器 -->
 <template>
   <view :style="[elStyles, elBackground]"><slot /></view>
 </template>

+ 1 - 1
sheep/components/s-notice-block/s-notice-block.vue

@@ -11,7 +11,7 @@
       :speed="50"
       :color="data.textColor"
       @tap="sheep.$router.go(data.contents[0].url)"
-    ></su-notice-bar>
+    />
   </view>
 </template>
 

+ 5 - 2
sheep/store/app.js

@@ -61,18 +61,21 @@ const app = defineStore({
         $router.error('NetworkError');
       }
 
+      // 加载装修配置
       await adaptTemplate(this.template, templateId)
       const res = await appApi.init(templateId);
       if (res.error === 0) {
         this.info = res.data.app;
         this.platform = res.data.platform;
 
+        // TODO 芋艿:未接入
         // this.template = res.data.template;
-        this.has_wechat_trade_managed = res.data.has_wechat_trade_managed;
+        // this.has_wechat_trade_managed = res.data.has_wechat_trade_managed;
         // if (!res.data.template) {
         //   $router.error('TemplateError');
         // }
-        this.chat = res.data.chat;
+        // TODO 芋艿:未接入
+        // this.chat = res.data.chat;
 
         // 加载主题
         const sysStore = sys();

+ 1 - 1
sheep/ui/su-status-bar/su-status-bar.vue

@@ -1,10 +1,10 @@
+<!-- 自定义状态栏 -->
 <template>
   <view :style="{ height: statusBarHeight }" class="uni-status-bar"><slot /></view>
 </template>
 
 <script setup>
   import sheep from '@/sheep';
-  import { computed } from 'vue';
 
   const statusBarHeight = sheep.$platform.device.statusBarHeight + 'px';
 </script>