feat: 给艳姐增加外部链接

This commit is contained in:
kenny
2025-11-05 11:11:58 +08:00
parent d18c097f54
commit fb2e1794ca
7 changed files with 57 additions and 15 deletions
+11 -1
View File
@@ -22,7 +22,7 @@
<v-tabs
v-model="fittingRoom.tab"
:lineScale="0.2"
:tabs="fittingRoom.tabs"
:tabs="tabs"
activeColor="#fff"
bgColor="#000000"
color="#fff"
@@ -41,6 +41,16 @@
const fittingRoom = sheep.$store('fittingRoom');
const isOpened = window.location.href.includes('open=1')
console.log('isOpened: ', isOpened);
const tabs = isOpened ? fittingRoom.tabs.slice(-1):fittingRoom.tabs
console.log('fittingRoom.tab: ', fittingRoom.tab);
console.log('fittingRoom.tabs: ', fittingRoom.tabs);
function changeTab(index) {
console.log('当前选中的项:' + index);
fittingRoom.changeTab(index);
+11 -1
View File
@@ -55,6 +55,9 @@
import STabs from './components/STabs.vue';
import SGridClothes from './components/s-grid-clothes.vue';
import Clothespic from './components/Clothespic.vue'; // 隐藏原生tabBar
import ReportApi from '@/sheep/api/report';
const { getToken } = ReportApi;
const fittingRoomStore = sheep.$store('fittingRoom');
let timer = null;
@@ -102,7 +105,14 @@
// const template = computed(() => sheep.$store('app').template?.home);
onLoad((options) => {
onLoad(async (options) => {
if(!options?.token) {
const href = window.location.href
const res = await getToken();
window.location.href = `${href}?token=${res.data.accessToken}&open=1`
return
}
uni.setStorageSync('token', options?.token ?? 'a2ae4e11fb8f4393aafcce7de467d2e2');
console.log('🚀 ~ URL上的token ~ options?.token: ', options?.token);
fittingRoomStore.getCategory();
+12 -3
View File
@@ -1,5 +1,5 @@
<template>
<view class="index">
<view class="index" v-if="token">
<image
v-for="i in 30"
:key="i"
@@ -17,12 +17,21 @@
<script setup>
import sheep from '@/sheep';
import { ref } from 'vue';
import ReportApi from '@/sheep/api/report';
import { onLoad } from '@dcloudio/uni-app';
const { getToken } = ReportApi;
const token = ref('');
onLoad((e) => {
onLoad(async (e) => {
if (!e.token) {
const res = await getToken();
window.location.href =
window.location.href.replace(/\?.*$/g, '') + '?token=' + res.data.accessToken;
return;
}
token.value = e.token;
uni.setStorageSync('token', e.token);
});
+1 -1
View File
@@ -54,7 +54,7 @@
.btn {
box-sizing: border-box;
margin: 100rpx auto 0;
margin: 50rpx auto 0;
width: 580rpx;
height: 80rpx;
background: #000;
+1 -1
View File
@@ -183,7 +183,7 @@
.operating {
display: flex;
justify-content: space-around;
margin-top: 150rpx;
margin-top: 80rpx;
padding: 0 20rpx;
margin-bottom: 200rpx;
}