123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <template>
- <view v-if="template">
- <s-layout :title="shopName" navbar="normal" :bgStyle="template.page"
- :navbarStyle="template.style?.navbar" onShareAppMessage >
- <s-block v-for="(item, index) in template.components" :key="index" :styles="item.property.style">
-
- <s-block-item :type="item.id" :data="item.property" :styles="item.property.style" />
- </s-block>
- </s-layout>
- </view>
- </template>
- <script setup>
- import {
- computed,
- ref
- } from 'vue';
- import {
- onLoad,
- onPageScroll,
- onPullDownRefresh
- } from '@dcloudio/uni-app';
- import sheep from '@/sheep';
- import $share from '@/sheep/platform/share';
- import PageApi from '@/sheep/api/promotion/page';
-
- uni.hideTabBar();
- const template = ref({})
- const shopName = ref('')
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- onLoad(async(options) => {
- shopName.value = options.shopName
-
-
- if (options.scene) {
- const sceneParams = decodeURIComponent(options.scene).split('=');
- options[sceneParams[0]] = sceneParams[1];
- }
-
-
- if (options.templateId) {
- sheep.$store('app').init(options.templateId);
- }
-
- if (options.spm) {
- $share.decryptSpm(options.spm);
- }
-
- if (options.page) {
- sheep.$router.go(decodeURIComponent(options.page));
- }
-
- const { code,data } = await PageApi.getPage({shopId:options.shopId,merchantId:options.merchantId});
- console.log(data)
- template.value = data.property
- });
- onPageScroll(() => {});
- </script>
- <style></style>
|