|
|
@@ -26,6 +26,17 @@
|
|
|
<button class="theme-bg-color text-white round cu-btn" style="width: 200upx;height: 70upx;" @click="pyqShare">生成海报</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view style="width: 10upx;height: 10upx;" class="qrimg-i" v-if="qrCode">
|
|
|
+ <tki-qrcode
|
|
|
+ cid="qrcode"
|
|
|
+ ref="qrcode"
|
|
|
+ :val="val"
|
|
|
+ :size="size"
|
|
|
+ :onval="onval"
|
|
|
+ :loadMake="loadMake"
|
|
|
+ :usingComponents="true"
|
|
|
+ @result="qrR" />
|
|
|
+ </view>
|
|
|
<view class="container margin-sm" v-if="!$u.test.isEmpty(boostList)">
|
|
|
<block v-for="(item, index) in boostList" :key="index">
|
|
|
<view class="flex align-center justify-between padding-lr-sm">
|
|
|
@@ -57,13 +68,36 @@
|
|
|
<view style="height: 80rpx;" v-if="status">
|
|
|
<u-divider bgColor="#f1f1f1;" height="80">到底了</u-divider>
|
|
|
</view>
|
|
|
+ <works-poster ref="myCard" :works="works"></works-poster>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import worksPoster from "@/components/works-poster/works-poster.vue";
|
|
|
+ import { pathToBase64, base64ToPath } from '@/common/utils/index.js'
|
|
|
export default {
|
|
|
+ components: {worksPoster},
|
|
|
data() {
|
|
|
return {
|
|
|
+ val: '', // 要生成的二维码值
|
|
|
+ size: 200, // 二维码大小
|
|
|
+ //unit: 'upx', // 单位
|
|
|
+ //icon: '', // 二维码图标
|
|
|
+ //iconsize: 40, // 二维码图标大小
|
|
|
+ //lv: 3, // 二维码容错级别 , 一般不用设置,默认就行
|
|
|
+ onval: false, // val值变化时自动重新生成二维码
|
|
|
+ loadMake: true, // 组件加载完成后自动生成二维码
|
|
|
+ src: '' ,// 二维码生成后的图片地址或base64
|
|
|
+ qrCode: false,
|
|
|
+ works: {
|
|
|
+ image: 'https://yyzs.nanyue6688.com/obsfile/9bd6e4bb9e464794a23d7073de826662-图层 1.png',
|
|
|
+ title: '',
|
|
|
+ hotValue: '',
|
|
|
+ rank: '',
|
|
|
+ avatar: '',
|
|
|
+ name: '',
|
|
|
+ qrcode: 'https://yyzs.nanyue6688.com/obsfile/c531395a576b4b1aa7377cdbf62cb088-default.png',
|
|
|
+ },
|
|
|
productId: '',
|
|
|
detail: {},
|
|
|
boostList: [],
|
|
|
@@ -94,7 +128,7 @@
|
|
|
})
|
|
|
},
|
|
|
getProductInfo() {
|
|
|
- this.$u.api.production.detail({id: this.productId}).then(res => {
|
|
|
+ this.$u.api.musicBoost.detail({id: this.productId}).then(res => {
|
|
|
this.detail = res;
|
|
|
this.getActivity(res.activityId);
|
|
|
})
|
|
|
@@ -124,9 +158,32 @@
|
|
|
this.type = "发送给朋友";
|
|
|
},
|
|
|
pyqShare() {
|
|
|
- this.wxShareShow = true;
|
|
|
- this.type = "分享到朋友圈"
|
|
|
- }
|
|
|
+ this.qrCode = true;
|
|
|
+ uni.showLoading({
|
|
|
+ title: '制作海报中...',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ if (this.detail.urlsType == 1) {
|
|
|
+ this.works.image = this.detail.cover;
|
|
|
+ } else {
|
|
|
+ this.works.image = this.detail.urls;
|
|
|
+ }
|
|
|
+ this.works.title = this.detail.title;
|
|
|
+ this.works.hotValue = +this.detail.hotValue;
|
|
|
+ this.works.rank = this.detail.rank;
|
|
|
+ this.works.name = this.detail.personName;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.ctx.draw(true,()=>{
|
|
|
+ uni.hideLoading()
|
|
|
+ this.$refs.myCard.showCanvas();
|
|
|
+ })
|
|
|
+ },800)
|
|
|
+ },
|
|
|
+ qrR(res) {
|
|
|
+ base64ToPath(res).then(res => {
|
|
|
+ this.works.qrcode = res;
|
|
|
+ });
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|