feat: 给艳姐增加外部链接
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
<v-tabs
|
<v-tabs
|
||||||
v-model="fittingRoom.tab"
|
v-model="fittingRoom.tab"
|
||||||
:lineScale="0.2"
|
:lineScale="0.2"
|
||||||
:tabs="fittingRoom.tabs"
|
:tabs="tabs"
|
||||||
activeColor="#fff"
|
activeColor="#fff"
|
||||||
bgColor="#000000"
|
bgColor="#000000"
|
||||||
color="#fff"
|
color="#fff"
|
||||||
@@ -41,6 +41,16 @@
|
|||||||
|
|
||||||
const fittingRoom = sheep.$store('fittingRoom');
|
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) {
|
function changeTab(index) {
|
||||||
console.log('当前选中的项:' + index);
|
console.log('当前选中的项:' + index);
|
||||||
fittingRoom.changeTab(index);
|
fittingRoom.changeTab(index);
|
||||||
|
|||||||
@@ -55,6 +55,9 @@
|
|||||||
import STabs from './components/STabs.vue';
|
import STabs from './components/STabs.vue';
|
||||||
import SGridClothes from './components/s-grid-clothes.vue';
|
import SGridClothes from './components/s-grid-clothes.vue';
|
||||||
import Clothespic from './components/Clothespic.vue'; // 隐藏原生tabBar
|
import Clothespic from './components/Clothespic.vue'; // 隐藏原生tabBar
|
||||||
|
import ReportApi from '@/sheep/api/report';
|
||||||
|
|
||||||
|
const { getToken } = ReportApi;
|
||||||
|
|
||||||
const fittingRoomStore = sheep.$store('fittingRoom');
|
const fittingRoomStore = sheep.$store('fittingRoom');
|
||||||
let timer = null;
|
let timer = null;
|
||||||
@@ -102,7 +105,14 @@
|
|||||||
|
|
||||||
// const template = computed(() => sheep.$store('app').template?.home);
|
// 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');
|
uni.setStorageSync('token', options?.token ?? 'a2ae4e11fb8f4393aafcce7de467d2e2');
|
||||||
console.log('🚀 ~ URL上的token ~ options?.token: ', options?.token);
|
console.log('🚀 ~ URL上的token ~ options?.token: ', options?.token);
|
||||||
fittingRoomStore.getCategory();
|
fittingRoomStore.getCategory();
|
||||||
|
|||||||
+12
-3
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="index">
|
<view class="index" v-if="token">
|
||||||
<image
|
<image
|
||||||
v-for="i in 30"
|
v-for="i in 30"
|
||||||
:key="i"
|
:key="i"
|
||||||
@@ -17,12 +17,21 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import ReportApi from '@/sheep/api/report';
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
|
|
||||||
|
const { getToken } = ReportApi;
|
||||||
|
|
||||||
const token = ref('');
|
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;
|
token.value = e.token;
|
||||||
uni.setStorageSync('token', e.token);
|
uni.setStorageSync('token', e.token);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin: 100rpx auto 0;
|
margin: 50rpx auto 0;
|
||||||
width: 580rpx;
|
width: 580rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
background: #000;
|
background: #000;
|
||||||
|
|||||||
@@ -183,7 +183,7 @@
|
|||||||
.operating {
|
.operating {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
margin-top: 150rpx;
|
margin-top: 80rpx;
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
margin-bottom: 200rpx;
|
margin-bottom: 200rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const ReportApi = {
|
|||||||
// data: data,
|
// data: data,
|
||||||
// });
|
// });
|
||||||
|
|
||||||
return Promise.resolve({data: {}})
|
return Promise.resolve({ data: {} });
|
||||||
},
|
},
|
||||||
praiseTextApi: (data) => {
|
praiseTextApi: (data) => {
|
||||||
return request({
|
return request({
|
||||||
@@ -112,6 +112,16 @@ const ReportApi = {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
getToken: () =>
|
||||||
|
request({
|
||||||
|
url: '/member/auth/login',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
mobile: '18399996666',
|
||||||
|
password: '123456',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
// https://puton.huimeimeta.com/app-api/cloth/getFaceList
|
// https://puton.huimeimeta.com/app-api/cloth/getFaceList
|
||||||
};
|
};
|
||||||
export default ReportApi;
|
export default ReportApi;
|
||||||
|
|||||||
@@ -3,17 +3,18 @@ import app from './app';
|
|||||||
import FittingRoomApi from '../api/fittingRoom';
|
import FittingRoomApi from '../api/fittingRoom';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
|
|
||||||
const _tabsMap = [undefined, 'topCloth', 'bottomCloth', 'dress', 'suit', 'hair'];
|
const _tabsMap = [undefined, 'topCloth', 'bottomCloth', 'dress', 'suit', 'hair', 'hair'];
|
||||||
|
|
||||||
export const pattern = [
|
export const pattern = [
|
||||||
{ value: 'body', label: '腰部以上' },
|
{ value: 'body', label: '胸' },
|
||||||
{ value: 'waist', label: '腰' },
|
{ value: 'waist', label: '腰' },
|
||||||
{ value: 'thigh', label: '跨' },
|
{ value: 'thigh', label: '跨' },
|
||||||
{ value: 'thigh1', label: '大腿上部1/3' },
|
{ value: 'thigh1', label: '大腿' },
|
||||||
{ value: 'thigh2', label: '大腿中部' },
|
// { value: 'thigh1', label: '大腿上部1/3' },
|
||||||
|
// { value: 'thigh2', label: '大腿中部' },
|
||||||
{ value: 'knee', label: '膝盖' },
|
{ value: 'knee', label: '膝盖' },
|
||||||
{ value: 'leg', label: '小腿' },
|
{ value: 'leg', label: '小腿' },
|
||||||
{ value: 'leg1', label: '小腿上部1/3' },
|
// { value: 'leg1', label: '小腿上部1/3' },
|
||||||
{ value: 'foot', label: '脚踝' },
|
{ value: 'foot', label: '脚踝' },
|
||||||
{ value: 'mopping', label: '拖地' },
|
{ value: 'mopping', label: '拖地' },
|
||||||
];
|
];
|
||||||
@@ -26,7 +27,7 @@ const fittingRoom = defineStore({
|
|||||||
modelList: [], // 模特列表
|
modelList: [], // 模特列表
|
||||||
currentModel: {},
|
currentModel: {},
|
||||||
type: false, // true: 我的衣橱, false: 衣服库
|
type: false, // true: 我的衣橱, false: 衣服库
|
||||||
tab: 0, // 对应下面tabs的序号
|
tab: 6, // 对应下面tabs的序号
|
||||||
tabs: ['全部', '上衣', '下装', '连衣裙', '外套', '套装', '发型'],
|
tabs: ['全部', '上衣', '下装', '连衣裙', '外套', '套装', '发型'],
|
||||||
tabsMap: _tabsMap,
|
tabsMap: _tabsMap,
|
||||||
disableTabs: [6], // 不允许上传图的tab索引
|
disableTabs: [6], // 不允许上传图的tab索引
|
||||||
@@ -80,7 +81,6 @@ const fittingRoom = defineStore({
|
|||||||
});
|
});
|
||||||
this.testResults = result;
|
this.testResults = result;
|
||||||
return result;
|
return result;
|
||||||
console.log('🚀 ~ getTestResults 🐶76 ~ httpResponse: ', httpResponse.data?.list);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取衣服类型数据查询
|
// 获取衣服类型数据查询
|
||||||
@@ -120,6 +120,8 @@ const fittingRoom = defineStore({
|
|||||||
sheep.$helper.toast('请选择衣服');
|
sheep.$helper.toast('请选择衣服');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fittingRoomStore = sheep.$store('fittingRoom');
|
||||||
// 那改成 clothUrl 和 kuziUrl 吧,当 kuziUrl 有值时,再传个 suit: true
|
// 那改成 clothUrl 和 kuziUrl 吧,当 kuziUrl 有值时,再传个 suit: true
|
||||||
const httpResponse =
|
const httpResponse =
|
||||||
this.tab === 6
|
this.tab === 6
|
||||||
@@ -138,6 +140,7 @@ const fittingRoom = defineStore({
|
|||||||
? this.currentClothes[1]?.fileUrl
|
? this.currentClothes[1]?.fileUrl
|
||||||
: undefined,
|
: undefined,
|
||||||
suit: this.currentClothes?.[1]?.fileUrl ? true : undefined,
|
suit: this.currentClothes?.[1]?.fileUrl ? true : undefined,
|
||||||
|
cloth_len: fittingRoomStore.selectPattern,
|
||||||
});
|
});
|
||||||
if (httpResponse.code !== 0) {
|
if (httpResponse.code !== 0) {
|
||||||
sheep.$helper.toast(httpResponse.msg);
|
sheep.$helper.toast(httpResponse.msg);
|
||||||
|
|||||||
Reference in New Issue
Block a user