添加:权重值中心 添加分享二维码
This commit is contained in:
parent
075bb41933
commit
3c89ee040d
|
|
@ -61,10 +61,18 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 海报部分 -->
|
||||
<yz-goodsposter v-model="posterShow" :posterData="poster_Data" :defaultImg="poster" :width="`18.875rem`" v-on:finish="uploadImageM"></yz-goodsposter>
|
||||
<!-- 海报部分 end -->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import yzGoodsposter from "components/ui_components/yz_goodsPoster";
|
||||
export default {
|
||||
components:{
|
||||
yzGoodsposter,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page_title: '',
|
||||
|
|
@ -80,9 +88,17 @@ export default {
|
|||
{ title: '我的权重值', sub_title: '查看权重值', icon: '001.png', path_name: 'weight_value' },
|
||||
{ title: '我的典藏', sub_title: '我的画作', icon: '002.png', path_name: 'collection_room' },
|
||||
{ title: '我的客户', sub_title: '团队客户明细', icon: '003.png', path_name: 'myRelationship' },
|
||||
{ title: '分享二维码', sub_title: '生成分享码', icon: '004.png', path_name: '' },
|
||||
{ title: '分享二维码', sub_title: '生成分享码', icon: '004.png', path_name: 'qrcode' },
|
||||
{ title: '团队业绩', sub_title: '团队累计业绩', icon: '005.png', path_name: 'incomedetails' },
|
||||
],
|
||||
// 海报
|
||||
posterShow: false,
|
||||
poster: "",
|
||||
poster_Data: {
|
||||
poster_data: null,
|
||||
background: {}
|
||||
},
|
||||
|
||||
};
|
||||
},
|
||||
activated() {
|
||||
|
|
@ -130,11 +146,69 @@ export default {
|
|||
// 工具跳转处理
|
||||
toolGoToPage(pathName){
|
||||
if(pathName === 'weight_value') this.goToPage('weight_value',{},{ team_level_id: this.page_params.team_level_id});
|
||||
else if(pathName === 'qrcode') this.getPoster();
|
||||
else this.goToPage(pathName);
|
||||
},
|
||||
// 生成分享二维码海报
|
||||
getPoster(e) {
|
||||
let _this = this;
|
||||
$http.get("member.qrcode.get-poster", {}, {})
|
||||
.then(res => {
|
||||
if (parseInt(res.result) === 1) {
|
||||
_this.isNewPosterPlugin = res.data.new || false;
|
||||
let center_show = !isNaN(parseInt(res.data.center_show)) ? parseInt(res.data.center_show) : 0;
|
||||
if (center_show === 0) {
|
||||
//0 返回的默认图片
|
||||
_this.poster = res.data.image_url;
|
||||
_this.posterShow = true;
|
||||
} else if (center_show === 1) {
|
||||
//前端生成
|
||||
_this.poster_Data.background.src = res.data.background_url || res.data.background;
|
||||
_this.poster_Data.background.type = "background";
|
||||
_this.poster_Data.poster_data = res.data.style_data;
|
||||
_this.poster_id = res.data.id;
|
||||
_this.posterShow = true;
|
||||
} else if (center_show === 2) {
|
||||
//部分关注二维码不支持跨域,走老接口
|
||||
_this.toastPoster = _this.$toast({
|
||||
duration: -1, // 持续展示 toast
|
||||
message: "正在为您生成海报中"
|
||||
});
|
||||
_this.openQrCode_old(e);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
.catch((error) => {});
|
||||
},
|
||||
openQrCode_old(e) {
|
||||
if (!this.poster) {
|
||||
if (!this.timer) {
|
||||
this.getPoster_oldApi(e);
|
||||
this.timer = setInterval(() => {
|
||||
this.getPoster_oldApi(e);
|
||||
}, 3000);
|
||||
}
|
||||
} else {
|
||||
clearInterval(this.timer);
|
||||
this.toastPoster.clear();
|
||||
}
|
||||
},
|
||||
getPoster_oldApi(e) {
|
||||
$http.get("member.poster").then(
|
||||
response => {
|
||||
if (response.result === 1) {
|
||||
this.poster = response.data.image_url;
|
||||
if (this.poster) this.clearPostetInterval();
|
||||
} else {
|
||||
this.$toast(response.msg);
|
||||
this.clearPostetInterval();
|
||||
}
|
||||
},
|
||||
response => {
|
||||
this.clearPostetInterval();
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue