📖 code review:店铺装修逻辑

pull/31/head
YunaiV 2023-12-20 23:01:16 +08:00
parent 51c552fb72
commit 2b68109dd0
7 changed files with 12 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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