Commit b6b9ea76 authored by Xuguangxing's avatar Xuguangxing

fix: 处理sentry上的报错

parent 6f12574d
......@@ -27,12 +27,12 @@
</div>
</div>
<div
v-for="n in placeholderNum"
:key="`placeholder-${n}`"
v-for="(val, idx) in placeholderNum"
:key="`placeholder-${idx}`"
class="placeholder"
: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">
<cr-image class="crown" width="" height="" src="@/assets/images/leaderIcon.png" />
</div>
......@@ -46,7 +46,7 @@
</div>
<div class="border" />
</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 v-if="groupHC >= 10" class="more" @click="showMoreAvator">
<div class="content" />
......@@ -116,12 +116,18 @@ export default {
computed: {
placeholderNum() {
// 问号头像展位数量
let num = 0;
if (this.groupHC >= 10) {
// 用9去减是因为有个展示更多的按钮
return 9 - this.avators.length < 0 ? 0 : 9 - this.avators.length;
num = 9 - this.avators.length < 0 ? 0 : 9 - this.avators.length;
} 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() {
......
......@@ -31,8 +31,8 @@
</template>
</div>
<div
v-for="num in maxCount - avatorList.length"
:key="`placeholder${num}`"
v-for="(val, idx) in placeholderArr"
:key="`placeholder${idx}`"
class="item placeholder"
style="width: 94px;height: 94px;margin: 0 21px;font-size: 34px;"
/>
......@@ -59,8 +59,8 @@
</div>
</div>
<div
v-for="num in maxCount - avatorList.length"
:key="`placeholder${num}`"
v-for="(val, idx) in placeholderArr"
:key="`placeholder${idx}`"
class="item placeholder"
style="width: 94px;height: 94px;margin: 0 21px;font-size: 34px;"
/>
......@@ -143,6 +143,16 @@ export default {
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: {
// 参团人数小于7时,头像全部显示;大于时展示6个头像...
handleAvator(sharePicData) {
......@@ -190,6 +200,7 @@ export default {
// this.qrcodeUrl = qrcodeUrl;
// },
async createAndUploadPic(sharePicData) {
console.log(JSON.stringify(sharePicData), '分享海报所需数据');
this.$store.dispatch('change_loading_pic', true);
this.sharePicData = sharePicData;
......
......@@ -181,7 +181,7 @@ export default {
methods: {
setShareData() {
const avatorList = [];
if (this.detailInfo.groupBuyInfo.groupBuyValidUserInfoList) {
if (this.detailInfo?.groupBuyInfo?.groupBuyValidUserInfoList) {
this.detailInfo.groupBuyInfo.groupBuyValidUserInfoList.map(v => {
avatorList.push(v.avatar);
});
......@@ -244,6 +244,7 @@ export default {
'https://'
);
const detailImages = await goods.getDetailPic(this.detailInfo.contentDetailUrl);
console.log(detailImages);
// const imgReg = new RegExp('(?<=src=").[^"]*', 'g');
// this.detailImgList = (detailImages || '').match(imgReg);
let imgReg = /<img.*?(?:>|\/>)/gi;
......
......@@ -80,7 +80,6 @@ import localStorage from '@/service/localStorage.service';
import historyRecordMixins from '@/mixins/historyRecord.mixins';
import FeeInfo from './components/feeInfo.vue';
import { HAS_DISCOUNT } from '@/constants/order';
import cookies from '@/service/cookieStorage.service';
import { isApp, isWxMp } from '@/service/validation.service';
import { mapState } from 'vuex';
import { saTrackEvent } from '@/service/sa.service';
......@@ -233,7 +232,6 @@ export default {
console.log(params);
const [data] = await order.orderSubmit(params);
if (data && data.orderNo) {
cookies.set('skuID', params.skuList[0].skuNo);
if (isWxMp) {
this.nativeBridge.openNewUrl({
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