2023-12-20 15:01:16 +00:00
|
|
|
|
<!-- 自定义页面:支持装修 -->
|
2022-11-22 07:45:36 +00:00
|
|
|
|
<template>
|
|
|
|
|
<s-layout
|
|
|
|
|
:title="page.name"
|
|
|
|
|
navbar="custom"
|
|
|
|
|
:bgStyle="page.style?.background"
|
|
|
|
|
:navbarStyle="page.style?.navbar"
|
|
|
|
|
onShareAppMessage
|
2023-02-07 07:51:37 +00:00
|
|
|
|
showLeftButton
|
2022-11-22 07:45:36 +00:00
|
|
|
|
>
|
|
|
|
|
<s-block v-for="(item, index) in page.list" :key="index" :styles="item.style">
|
|
|
|
|
<s-block-item :type="item.type" :data="item.data" :styles="item.style" />
|
|
|
|
|
</s-block>
|
|
|
|
|
</s-layout>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { computed, reactive } from 'vue';
|
|
|
|
|
import sheep from '@/sheep';
|
|
|
|
|
import { onLoad, onPageScroll } from '@dcloudio/uni-app';
|
|
|
|
|
|
|
|
|
|
const page = reactive({
|
|
|
|
|
name: '',
|
|
|
|
|
list: [],
|
|
|
|
|
style: {},
|
|
|
|
|
});
|
|
|
|
|
onLoad(async (options) => {
|
|
|
|
|
let id;
|
|
|
|
|
|
|
|
|
|
if (options.id) {
|
|
|
|
|
id = options.id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// #ifdef MP
|
|
|
|
|
// 小程序预览自定义页面
|
|
|
|
|
if (options.scene) {
|
|
|
|
|
const sceneParams = decodeURIComponent(options.scene).split('=');
|
|
|
|
|
id = sceneParams[1];
|
|
|
|
|
}
|
|
|
|
|
// #endif
|
|
|
|
|
|
2023-12-20 15:01:16 +00:00
|
|
|
|
// TODO @疯狂:貌似这里还没接上哈
|
2022-11-22 07:45:36 +00:00
|
|
|
|
const { error, data } = await sheep.$api.app.page(id);
|
|
|
|
|
if (error === 0) {
|
|
|
|
|
page.name = data.name;
|
|
|
|
|
page.list = data.diypage?.page?.data;
|
|
|
|
|
page.style = data.diypage?.page?.style;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
onPageScroll(() => {});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style></style>
|