|
|
<!-- 首页,支持店铺装修 -->
|
|
|
<template>
|
|
|
<view :style="{'padding-top': statusHeight + 'px'}" class="content">
|
|
|
|
|
|
<!-- <s-layout title="首页" navbar="custom" tabbar="/pages/index/index" :bgStyle="template.page"
|
|
|
:navbarStyle="template.style?.navbar" onShareAppMessage>
|
|
|
</s-layout> -->
|
|
|
<!-- <map style="height: calc(100% - 45px)" :latitude="latitude" :longitude="longitude" :markers="covers"
|
|
|
class="maps_center"></map> -->
|
|
|
<s-tabbar path="/pages/home/index" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import {
|
|
|
computed
|
|
|
} from 'vue';
|
|
|
import {
|
|
|
onLoad,
|
|
|
onPageScroll,
|
|
|
// onPullDownRefresh
|
|
|
} from '@dcloudio/uni-app';
|
|
|
import sheep from '@/sheep';
|
|
|
import $share from '@/sheep/platform/share';
|
|
|
import {
|
|
|
ref
|
|
|
} from 'vue'
|
|
|
const latitude = ref(31.49099)
|
|
|
const longitude = ref(120.31237)
|
|
|
const covers = ref([{
|
|
|
id: 15131351,
|
|
|
label: '当前位置',
|
|
|
latitude: 31.49099,
|
|
|
longitude: 120.31237,
|
|
|
}])
|
|
|
const info = uni.getSystemInfoSync()
|
|
|
const statusHeight = info.statusBarHeight
|
|
|
const subnvue = uni.getSubNVueById('maps') // 获取nvue
|
|
|
console.log(subnvue,'subnvue');
|
|
|
subnvue.show() // 显示nvue
|
|
|
// 隐藏原生tabBarsad
|
|
|
uni.hideTabBar();
|
|
|
|
|
|
const template = computed(() => sheep.$store('app').template?.home);
|
|
|
// 在此处拦截改变一下首页轮播图 此处先写死后期复活 放到启动函数里
|
|
|
// (async function() {
|
|
|
// console.log('原代码首页定制化数据',template)
|
|
|
// let {
|
|
|
// data
|
|
|
// } = await index2Api.decorate();
|
|
|
// console.log('首页导航配置化过高无法兼容',JSON.parse(data[1].value))
|
|
|
// 改变首页底部数据 但是没有通过数组id获取商品数据接口
|
|
|
// let {
|
|
|
// data: datas
|
|
|
// } = await index2Api.spids();
|
|
|
// template.value.data[9].data.goodsIds = datas.list.map(item => item.id);
|
|
|
// template.value.data[0].data.list = JSON.parse(data[0].value).map(item => {
|
|
|
// return {
|
|
|
// src: item.picUrl,
|
|
|
// url: item.url,
|
|
|
// title: item.name,
|
|
|
// type: "image"
|
|
|
// }
|
|
|
// })
|
|
|
// }())
|
|
|
|
|
|
|
|
|
onLoad((options) => {
|
|
|
// #ifdef MP
|
|
|
// 小程序识别二维码
|
|
|
if (options.scene) {
|
|
|
const sceneParams = decodeURIComponent(options.scene).split('=');
|
|
|
options[sceneParams[0]] = sceneParams[1];
|
|
|
}
|
|
|
// #endif
|
|
|
|
|
|
// 预览模板
|
|
|
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));
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 下拉刷新
|
|
|
// onPullDownRefresh(() => {
|
|
|
// sheep.$store('app').init();
|
|
|
// setTimeout(function() {
|
|
|
// uni.stopPullDownRefresh();
|
|
|
// }, 800);
|
|
|
// });
|
|
|
|
|
|
onPageScroll(() => {});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.content {
|
|
|
box-sizing: border-box;
|
|
|
height: 100vh;
|
|
|
}
|
|
|
|
|
|
.maps_center {
|
|
|
width: 100%;
|
|
|
}
|
|
|
</style> |