Commit b6b9ea76 authored by Xuguangxing's avatar Xuguangxing

fix: 处理sentry上的报错

parent 6f12574d
...@@ -27,12 +27,12 @@ ...@@ -27,12 +27,12 @@
</div> </div>
</div> </div>
<div <div
v-for="n in placeholderNum" v-for="(val, idx) in placeholderNum"
:key="`placeholder-${n}`" :key="`placeholder-${idx}`"
class="placeholder" class="placeholder"
:class="{ leader: avators.length == 0 }" :class="{ leader: avators.length == 0 }"
> >
<template v-if="avators.length == 0 && n == 1"> <template v-if="avators.length == 0 && idx == 0">
<div class="is-leader"> <div class="is-leader">
<cr-image class="crown" width="" height="" src="@/assets/images/leaderIcon.png" /> <cr-image class="crown" width="" height="" src="@/assets/images/leaderIcon.png" />
</div> </div>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</div> </div>
<div class="border" /> <div class="border" />
</template> </template>
<div class="content" :class="{ avator: avators.length == 0 && n == 1 }">?</div> <div class="content" :class="{ avator: avators.length == 0 && idx == 0 }">?</div>
</div> </div>
<div v-if="groupHC >= 10" class="more" @click="showMoreAvator"> <div v-if="groupHC >= 10" class="more" @click="showMoreAvator">
<div class="content" /> <div class="content" />
...@@ -116,12 +116,18 @@ export default { ...@@ -116,12 +116,18 @@ export default {
computed: { computed: {
placeholderNum() { placeholderNum() {
// 问号头像展位数量 // 问号头像展位数量
let num = 0;
if (this.groupHC >= 10) { if (this.groupHC >= 10) {
// 用9去减是因为有个展示更多的按钮 // 用9去减是因为有个展示更多的按钮
return 9 - this.avators.length < 0 ? 0 : 9 - this.avators.length; num = 9 - this.avators.length < 0 ? 0 : 9 - this.avators.length;
} else { } else {
return this.groupHC - this.avators.length < 0 ? 0 : this.groupHC - this.avators.length; num = this.groupHC - this.avators.length < 0 ? 0 : this.groupHC - this.avators.length;
} }
const arr = [];
for (let i = 0; i < num; i++) {
arr.push({});
}
return arr;
} }
}, },
created() { created() {
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
</template> </template>
</div> </div>
<div <div
v-for="num in maxCount - avatorList.length" v-for="(val, idx) in placeholderArr"
:key="`placeholder${num}`" :key="`placeholder${idx}`"
class="item placeholder" class="item placeholder"
style="width: 94px;height: 94px;margin: 0 21px;font-size: 34px;" style="width: 94px;height: 94px;margin: 0 21px;font-size: 34px;"
/> />
...@@ -59,8 +59,8 @@ ...@@ -59,8 +59,8 @@
</div> </div>
</div> </div>
<div <div
v-for="num in maxCount - avatorList.length" v-for="(val, idx) in placeholderArr"
:key="`placeholder${num}`" :key="`placeholder${idx}`"
class="item placeholder" class="item placeholder"
style="width: 94px;height: 94px;margin: 0 21px;font-size: 34px;" style="width: 94px;height: 94px;margin: 0 21px;font-size: 34px;"
/> />
...@@ -143,6 +143,16 @@ export default { ...@@ -143,6 +143,16 @@ export default {
skuName: '' // 兼容safari做的特殊处理,每个文字都加一个span标签 skuName: '' // 兼容safari做的特殊处理,每个文字都加一个span标签
}; };
}, },
computed: {
placeholderArr() {
const arr = [];
const num = this.maxCount - this.avatorList.length;
for (let i = 0; i < num; i++) {
arr.push({});
}
return arr;
}
},
methods: { methods: {
// 参团人数小于7时,头像全部显示;大于时展示6个头像... // 参团人数小于7时,头像全部显示;大于时展示6个头像...
handleAvator(sharePicData) { handleAvator(sharePicData) {
...@@ -190,6 +200,7 @@ export default { ...@@ -190,6 +200,7 @@ export default {
// this.qrcodeUrl = qrcodeUrl; // this.qrcodeUrl = qrcodeUrl;
// }, // },
async createAndUploadPic(sharePicData) { async createAndUploadPic(sharePicData) {
console.log(JSON.stringify(sharePicData), '分享海报所需数据');
this.$store.dispatch('change_loading_pic', true); this.$store.dispatch('change_loading_pic', true);
this.sharePicData = sharePicData; this.sharePicData = sharePicData;
......
...@@ -181,7 +181,7 @@ export default { ...@@ -181,7 +181,7 @@ export default {
methods: { methods: {
setShareData() { setShareData() {
const avatorList = []; const avatorList = [];
if (this.detailInfo.groupBuyInfo.groupBuyValidUserInfoList) { if (this.detailInfo?.groupBuyInfo?.groupBuyValidUserInfoList) {
this.detailInfo.groupBuyInfo.groupBuyValidUserInfoList.map(v => { this.detailInfo.groupBuyInfo.groupBuyValidUserInfoList.map(v => {
avatorList.push(v.avatar); avatorList.push(v.avatar);
}); });
...@@ -244,6 +244,7 @@ export default { ...@@ -244,6 +244,7 @@ export default {
'https://' 'https://'
); );
const detailImages = await goods.getDetailPic(this.detailInfo.contentDetailUrl); const detailImages = await goods.getDetailPic(this.detailInfo.contentDetailUrl);
console.log(detailImages);
// const imgReg = new RegExp('(?<=src=").[^"]*', 'g'); // const imgReg = new RegExp('(?<=src=").[^"]*', 'g');
// this.detailImgList = (detailImages || '').match(imgReg); // this.detailImgList = (detailImages || '').match(imgReg);
let imgReg = /<img.*?(?:>|\/>)/gi; let imgReg = /<img.*?(?:>|\/>)/gi;
......
...@@ -80,7 +80,6 @@ import localStorage from '@/service/localStorage.service'; ...@@ -80,7 +80,6 @@ import localStorage from '@/service/localStorage.service';
import historyRecordMixins from '@/mixins/historyRecord.mixins'; import historyRecordMixins from '@/mixins/historyRecord.mixins';
import FeeInfo from './components/feeInfo.vue'; import FeeInfo from './components/feeInfo.vue';
import { HAS_DISCOUNT } from '@/constants/order'; import { HAS_DISCOUNT } from '@/constants/order';
import cookies from '@/service/cookieStorage.service';
import { isApp, isWxMp } from '@/service/validation.service'; import { isApp, isWxMp } from '@/service/validation.service';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import { saTrackEvent } from '@/service/sa.service'; import { saTrackEvent } from '@/service/sa.service';
...@@ -233,7 +232,6 @@ export default { ...@@ -233,7 +232,6 @@ export default {
console.log(params); console.log(params);
const [data] = await order.orderSubmit(params); const [data] = await order.orderSubmit(params);
if (data && data.orderNo) { if (data && data.orderNo) {
cookies.set('skuID', params.skuList[0].skuNo);
if (isWxMp) { if (isWxMp) {
this.nativeBridge.openNewUrl({ this.nativeBridge.openNewUrl({
newUrl: `/pages/pay/index?orderNo=${data.orderNo}` newUrl: `/pages/pay/index?orderNo=${data.orderNo}`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment