|
@@ -13,9 +13,26 @@
|
|
|
</view> -->
|
|
</view> -->
|
|
|
<!-- <canvas :style="{ width: canvasW + 'px', height: canvasH + 'px',}" canvas-id="myCanvas" id="myCanvas"></canvas> -->
|
|
<!-- <canvas :style="{ width: canvasW + 'px', height: canvasH + 'px',}" canvas-id="myCanvas" id="myCanvas"></canvas> -->
|
|
|
<canvas :style="{ width: '600rpx', height: '1066rpx',}" canvas-id="myCanvas" id="myCanvas" class="hb"></canvas>
|
|
<canvas :style="{ width: '600rpx', height: '1066rpx',}" canvas-id="myCanvas" id="myCanvas" class="hb"></canvas>
|
|
|
- <view class="" v-if="fina">
|
|
|
|
|
|
|
+ <!-- <view class="" v-if="fina">
|
|
|
<button text="保存图片" @click="saveShareQrcode">保存图片</button>
|
|
<button text="保存图片" @click="saveShareQrcode">保存图片</button>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view class="" v-if="fina">
|
|
|
|
|
+ <button text="保存图片" @click="saveShareQrcode">分享链接</button>
|
|
|
|
|
+ </view> -->
|
|
|
|
|
+ <view class="btm-btn" v-if="fina">
|
|
|
|
|
+ <view class="btn" @click="comfirm">
|
|
|
|
|
+ <image src="../../static/icon/fzlj.png" mode=""></image>
|
|
|
|
|
+ <view class="">
|
|
|
|
|
+ 复制邀请链接
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="btn" @click="saveShareQrcode">
|
|
|
|
|
+ <image src="../../static/icon/fxhb.png" mode=""></image>
|
|
|
|
|
+ <view class="">
|
|
|
|
|
+ 保存分享海报
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -82,6 +99,53 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ uniCopy(content) {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 小程序端 和 app端的复制逻辑
|
|
|
|
|
+ */
|
|
|
|
|
+ //#ifndef H5
|
|
|
|
|
+ uni.setClipboardData({
|
|
|
|
|
+ data: content,
|
|
|
|
|
+ success: function() {
|
|
|
|
|
+ console.log('success');
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ //#endif
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * H5端的复制逻辑
|
|
|
|
|
+ */
|
|
|
|
|
+ // #ifdef H5
|
|
|
|
|
+ if (!document.queryCommandSupported('copy')) {
|
|
|
|
|
+ //为了兼容有些浏览器 queryCommandSupported 的判断
|
|
|
|
|
+ // 不支持
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ let textarea = document.createElement('textarea');
|
|
|
|
|
+ textarea.value = content;
|
|
|
|
|
+ textarea.readOnly = 'readOnly';
|
|
|
|
|
+ document.body.appendChild(textarea);
|
|
|
|
|
+ textarea.select(); // 选择对象
|
|
|
|
|
+ textarea.setSelectionRange(0, content.length); //核心
|
|
|
|
|
+ let result = document.execCommand('copy'); // 执行浏览器复制命令
|
|
|
|
|
+ textarea.remove();
|
|
|
|
|
+ return result;
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ },
|
|
|
|
|
+ comfirm() {
|
|
|
|
|
+ const result = this.uniCopy(this.val);
|
|
|
|
|
+ if (result === false) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '不支持'
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '复制成功',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
qrR(res) {
|
|
qrR(res) {
|
|
|
this.erweimasrc = res
|
|
this.erweimasrc = res
|
|
|
console.log(res, 'erweima');
|
|
console.log(res, 'erweima');
|
|
@@ -295,4 +359,28 @@
|
|
|
margin: 0 auto;
|
|
margin: 0 auto;
|
|
|
margin-top: 30upx;
|
|
margin-top: 30upx;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .btm-btn {
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ width: 750rpx;
|
|
|
|
|
+ height: 200rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ border-radius: 20rpx 20rpx 0 0;
|
|
|
|
|
+ .btn {
|
|
|
|
|
+ width: 50%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ font-size: 26rpx;
|
|
|
|
|
+
|
|
|
|
|
+ image {
|
|
|
|
|
+ width: 66rpx;
|
|
|
|
|
+ height: 66rpx;
|
|
|
|
|
+ margin-bottom: 20rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|