Commit 75121f0a authored by Xuguangxing's avatar Xuguangxing

feat: 生成pic组件

parent ff0abda8
......@@ -86,14 +86,11 @@ export default {
},
methods: {
async createAndUploadPic() {
console.log(999);
const _this = this;
const [qrcodeUrl] = await groupBuyApi.getQrcodeUrl(this.sharePicData);
console.log(888);
this.qrcodeUrl = qrcodeUrl;
const [res] = await qiNiuApi.getQiniuToken();
const token = res.token;
console.log(777);
this.$nextTick(() => {
html2canvas(this.$refs.sharePic, {
width: 1080,
......
......@@ -19,7 +19,12 @@
</p>
<div class="actions">
<cr-button shape="circle" type="default" @click="goPage(1)">我的拼团</cr-button>
<cr-button shape="circle" class="actions__back" :plain="true" type="primary" @click="share"
<cr-button
shape="circle"
class="actions__back"
:plain="true"
type="primary"
@click="setShareData"
>邀请好友</cr-button
>
</div>
......@@ -104,12 +109,11 @@ export default {
this.payStatus = success ? '订单支付成功' : '订单支付失败';
this.payStatusName = success ? '支付成功' : '支付失败';
this.getCouponList();
this.setShareData();
},
mounted() {
EventBus.$on('shareClickItem', ({ ev }) => {
if (ev === 'pic') {
this.createPic();
// 处理图片url
}
});
},
......@@ -119,21 +123,15 @@ export default {
methods: {
outputPicUrl(res) {
console.log(res);
this.$store.dispatch('goods_share_open', { res });
},
async setShareData() {
const [res] = await groupBuyApi.getGroupShareInfo({
orderNo: this.orderNo
});
this.sharePicData = res;
},
createPic() {
console.log(typeof this.$refs.sharePic.createAndUploadPic);
this.$refs.sharePic.createAndUploadPic();
},
share() {
// 分享
this.$store.dispatch('goods_share_open');
},
// goPay() {
// this.$track?.registeredEvents('h5_RechargeResultPageClick', {
// commodity_id: this.skuID,
......
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