fix: bug修改
This commit is contained in:
@@ -88,7 +88,7 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
// import { saveUserInfo } from './api';
|
// import { saveUserInfo } from './api';
|
||||||
import {saveUserInfo} from '@/sheep/api/user'
|
import { saveUserInfo } from '@/sheep/api/user';
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import ReportApi from '@/sheep/api/report';
|
import ReportApi from '@/sheep/api/report';
|
||||||
|
|
||||||
@@ -106,17 +106,33 @@
|
|||||||
|
|
||||||
const token = ref('');
|
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();
|
const res = await getToken();
|
||||||
window.location.href =
|
queryObj.open = queryObj.open || 1;
|
||||||
window.location.href.replace(/\?.*$/g, '') + '?token=' + res.data.accessToken;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
token.value = e.token;
|
token.value = options.token;
|
||||||
uni.setStorageSync('token', e.token);
|
uni.setStorageSync('token', options.token);
|
||||||
});
|
});
|
||||||
|
|
||||||
const onTap = (key, value) => {
|
const onTap = (key, value) => {
|
||||||
|
|||||||
@@ -16,11 +16,13 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
|
import {watch} from 'vue'
|
||||||
|
|
||||||
const fittingRoomStore = sheep.$store('fittingRoom');
|
const fittingRoomStore = sheep.$store('fittingRoom');
|
||||||
function tryItOn() {
|
function tryItOn() {
|
||||||
fittingRoomStore.tryOn();
|
fittingRoomStore.tryOn();
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.clothes-box {
|
.clothes-box {
|
||||||
|
|||||||
@@ -106,10 +106,23 @@
|
|||||||
// const template = computed(() => sheep.$store('app').template?.home);
|
// const template = computed(() => sheep.$store('app').template?.home);
|
||||||
|
|
||||||
onLoad(async (options) => {
|
onLoad(async (options) => {
|
||||||
if(!options?.token) {
|
const queryObj = Object.assign({}, options);
|
||||||
const href = window.location.href
|
|
||||||
|
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();
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-4
@@ -25,11 +25,25 @@
|
|||||||
const token = ref('');
|
const token = ref('');
|
||||||
|
|
||||||
onLoad(async (e) => {
|
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();
|
const res = await getToken();
|
||||||
window.location.href =
|
queryObj.open = queryObj.open || 1;
|
||||||
window.location.href.replace(/\?.*$/g, '') + '?token=' + res.data.accessToken;
|
queryObj.token = res.data.accessToken;
|
||||||
return;
|
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;
|
token.value = e.token;
|
||||||
|
|||||||
@@ -143,7 +143,8 @@ 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,
|
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) {
|
if (httpResponse.code !== 0) {
|
||||||
sheep.$helper.toast(httpResponse.msg);
|
sheep.$helper.toast(httpResponse.msg);
|
||||||
@@ -196,9 +197,10 @@ const fittingRoom = defineStore({
|
|||||||
},
|
},
|
||||||
// 点击衣服
|
// 点击衣服
|
||||||
changeClothes(data) {
|
changeClothes(data) {
|
||||||
|
console.log('changeClothes: 2222222222222222222222222222222',);
|
||||||
const shangyi = '95'; // 上衣
|
const shangyi = '95'; // 上衣
|
||||||
const xiazhuang = '96'; // 上衣
|
const xiazhuang = '96'; // 上衣
|
||||||
console.log('🚀 ~ changeClothes ~ data: ', data.clothType);
|
console.log('ppppppppppppppppp ~ changeClothes ~ data: xxxxx', data.clothType);
|
||||||
if (this.currentClothes?.length === 0) {
|
if (this.currentClothes?.length === 0) {
|
||||||
this.currentClothes = [data];
|
this.currentClothes = [data];
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user