feat: banner跳转ai店铺判断

This commit is contained in:
2026-06-08 17:34:23 +08:00
parent 7752c4efa5
commit 5551b08d5a
7 changed files with 186 additions and 17 deletions
+12 -4
View File
@@ -50,7 +50,7 @@
</view>
</view> -->
<!-- 暂时废弃 -->
<view class="activeList flex-row wrap ju-between" v-if="activeList?.length">
<!-- <view class="activeList flex-row wrap ju-between" v-if="activeList?.length">
<view
class="activeItem"
:style="{
@@ -71,10 +71,10 @@
>
<image :src="sheep.$url.cdn(v.bannerImage)" mode="scaleToFill" />
</view>
</view>
</view> -->
</view>
<view class="goodsIndex">
<goods :list="tagList" v-if="tagList?.length" />
<goods :list="tagList" :defaultTabName="defaultTabName" v-if="tagList?.length" />
</view>
</view>
</view>
@@ -83,11 +83,13 @@
<script setup>
import { ref, computed } from 'vue';
import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app';
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
import goods from '@/components/goods/goods.vue';
import sheep from '@/sheep';
import $share from '@/sheep/platform/share';
import * as api from '@/sheep/api/index/index';
const HOME_DEFAULT_TAB_STORAGE_KEY = 'home.goods.defaultTabName';
const defaultTabName = ref('');
let template = ref({
page: {
backgroundColor: '#F2F4F7',
@@ -235,6 +237,12 @@
sheep.$router.go(decodeURIComponent(options.page));
}
});
onShow(() => {
const next = uni.getStorageSync(HOME_DEFAULT_TAB_STORAGE_KEY);
defaultTabName.value = next ? String(next) : '';
if (next) uni.removeStorageSync(HOME_DEFAULT_TAB_STORAGE_KEY);
});
//跳转浏览器
const openExternal = (url) => {
if (!url) return;