fix: bug修改

This commit is contained in:
kenny
2025-11-14 10:31:07 +08:00
parent bc74352cd5
commit b7928cdda0
5 changed files with 67 additions and 20 deletions
+23 -7
View File
@@ -88,7 +88,7 @@
import { ref } from 'vue';
import dayjs from 'dayjs';
// import { saveUserInfo } from './api';
import {saveUserInfo} from '@/sheep/api/user'
import { saveUserInfo } from '@/sheep/api/user';
import { onLoad } from '@dcloudio/uni-app';
import ReportApi from '@/sheep/api/report';
@@ -106,17 +106,33 @@
const token = ref('');
onLoad(async (e) => {
onLoad(async (options) => {
const queryObj = Object.assign({}, options);
if (!e.token) {
if (options.token) {
// queryObj.open = queryObj.open || 0;
if (!queryObj.open) {
queryObj.open = 0;
const queryStr = Object.entries(queryObj)
.map(([k, v]) => `${k}=${v}`)
.join('&');
window.location.href = `${window.location.href.replace(/\?.*$/g, '')}?${queryStr}`;
return;
}
} else {
const res = await getToken();
window.location.href =
window.location.href.replace(/\?.*$/g, '') + '?token=' + res.data.accessToken;
queryObj.open = queryObj.open || 1;
queryObj.token = res.data.accessToken;
const queryStr = Object.entries(queryObj)
.map(([k, v]) => `${k}=${v}`)
.join('&');
window.location.href = `${window.location.href.replace(/\?.*$/g, '')}?${queryStr}`;
return;
}
token.value = e.token;
uni.setStorageSync('token', e.token);
token.value = options.token;
uni.setStorageSync('token', options.token);
});
const onTap = (key, value) => {
@@ -16,11 +16,13 @@
</template>
<script setup>
import sheep from '@/sheep';
import {watch} from 'vue'
const fittingRoomStore = sheep.$store('fittingRoom');
function tryItOn() {
fittingRoomStore.tryOn();
}
</script>
<style lang="scss" scoped>
.clothes-box {
+16 -3
View File
@@ -106,10 +106,23 @@
// const template = computed(() => sheep.$store('app').template?.home);
onLoad(async (options) => {
if(!options?.token) {
const href = window.location.href
const queryObj = Object.assign({}, options);
if (options.token) {
// queryObj.open = queryObj.open || 0;
if(!queryObj.open) {
queryObj.open = 0;
const queryStr= Object.entries(queryObj).map(([k,v]) => `${k}=${v}`).join('&')
window.location.href = `${window.location.href.replace(/\?.*$/g, '')}?${queryStr}`
return
}
} else {
const res = await getToken();
window.location.href = `${href}?token=${res.data.accessToken}&open=1`
queryObj.open = queryObj.open || 1;
queryObj.token = res.data.accessToken;
const queryStr= Object.entries(queryObj).map(([k,v]) => `${k}=${v}`).join('&')
window.location.href = `${window.location.href.replace(/\?.*$/g, '')}?${queryStr}`
return
}
+18 -4
View File
@@ -25,11 +25,25 @@
const token = ref('');
onLoad(async (e) => {
if (!e.token) {
const options = e
const queryObj = Object.assign({}, options);
if (options.token) {
// queryObj.open = queryObj.open || 0;
if(!queryObj.open) {
queryObj.open = 0;
const queryStr= Object.entries(queryObj).map(([k,v]) => `${k}=${v}`).join('&')
window.location.href = `${window.location.href.replace(/\?.*$/g, '')}?${queryStr}`
return
}
} else {
const res = await getToken();
window.location.href =
window.location.href.replace(/\?.*$/g, '') + '?token=' + res.data.accessToken;
return;
queryObj.open = queryObj.open || 1;
queryObj.token = res.data.accessToken;
const queryStr= Object.entries(queryObj).map(([k,v]) => `${k}=${v}`).join('&')
window.location.href = `${window.location.href.replace(/\?.*$/g, '')}?${queryStr}`
return
}
token.value = e.token;
+4 -2
View File
@@ -143,7 +143,8 @@ const fittingRoom = defineStore({
? this.currentClothes[1]?.fileUrl
: undefined,
suit: this.currentClothes?.[1]?.fileUrl ? true : undefined,
cloth_len: fittingRoomStore.selectPattern,
cloth_len: pattern.find((i) => i.value === this.currentClothes[0]?.len)?.label,
len: pattern.find((i) => i.value === this.currentClothes[0]?.len)?.label,
});
if (httpResponse.code !== 0) {
sheep.$helper.toast(httpResponse.msg);
@@ -196,9 +197,10 @@ const fittingRoom = defineStore({
},
// 点击衣服
changeClothes(data) {
console.log('changeClothes: 2222222222222222222222222222222',);
const shangyi = '95'; // 上衣
const xiazhuang = '96'; // 上衣
console.log('🚀 ~ changeClothes ~ data: ', data.clothType);
console.log('ppppppppppppppppp ~ changeClothes ~ data: xxxxx', data.clothType);
if (this.currentClothes?.length === 0) {
this.currentClothes = [data];
return;