From d638a2378e11c944b8f20376fc36ff9a58bb689e Mon Sep 17 00:00:00 2001 From: jia <1451658316@qq.com> Date: Mon, 23 Oct 2023 09:42:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E5=8F=8A=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/qiqb-share/qiqb-share.vue | 159 +----- components/qiqb-share/qiqb-share1.vue | 444 --------------- pages/index/index.vue | 756 +++++++++++++++++--------- 3 files changed, 511 insertions(+), 848 deletions(-) delete mode 100644 components/qiqb-share/qiqb-share1.vue diff --git a/components/qiqb-share/qiqb-share.vue b/components/qiqb-share/qiqb-share.vue index 853df22..99a775d 100644 --- a/components/qiqb-share/qiqb-share.vue +++ b/components/qiqb-share/qiqb-share.vue @@ -218,165 +218,18 @@ - // init() { // 通过opt传参数 - - // let self = this - // let ctx = uni.createCanvasContext('ctx') - - - - // setTimeout(()=>{ - // self.drawBg(ctx, 330, this.cliceHeight, 8, '#fff') - // self.drawTxtOne(ctx, '农业咨询小程序', 220, 35, 100, - // '#222', 12, false) - // // 绘制圆角头像 图片地址 距离左边 距离上边 宽度 高度 圆角 - // self.drawImg(ctx, - // 'https://lihai001.oss-cn-chengdu.aliyuncs.com/storage/202310/20231013091310.png', - // 170, 10, 40, 40, 20) - // self.drawImg(ctx, - // 'https://lihai001.oss-cn-chengdu.aliyuncs.com/storage/202310/20231013091059.png', - // 10, 50, 40, 40, 20) - - // self.drawImg(ctx, - // 'https://lihai001.oss-cn-chengdu.aliyuncs.com/storage/202310/20231013091310.png', - // 10, 118, 40, 40, 20) - - // // 绘制二维码 图片地址 距离左边 距离上边 宽度 高度 圆角 - // self.drawImg(ctx, - // 'https://lihai001.oss-cn-chengdu.aliyuncs.com/storage/202310/ai_qr_20231013091327.jpg', - // 174, this.cliceHeight-125, 100, 100, 0) - - // // 绘制单行文字 图片地址 距离左边 距离上边 宽度 颜色 字号 加粗 - // self.drawTxtOne(ctx, self.pext1, 60, 70, 100, - // '#222', 12, false) - - // // 绘制两行文字 图片地址 距离左边 距离上边 宽度 行高 颜色 字号 - // self.drawTxtFour(ctx, - // self.pext2, - // 60, 120, - // 190, 20, '#222', 12) - - // // 绘制单行文字 图片地址 距离左边 距离上边 宽度 颜色 字号 加粗 - // self.drawTxtOne(ctx, '下载二维码', 15, this.cliceHeight-85, 100, - // '#666', 11, false) - - // // 结束绘制 - // ctx.draw() - // self.show = true - // },1000) - - - - // // 绘制背景 宽度 高度 圆角 颜色 - - - - - - // // 需要用到的图片提前循环下载好,本地除外 - // // uni.downloadFile({ - // // url: 'http://banbai.oss-cn-beijing.aliyuncs.com/20230524/96e80fb572e35d4acebdce67dbd41f30.jpg', - // // success: function(e) { - // // let img = e.tempFilePath // 封面图 - // // uni.downloadFile({ - // // url: 'http://banbai.oss-cn-beijing.aliyuncs.com/20230524/96e80fb572e35d4acebdce67dbd41f30.jpg', - // // success: function(e) { - // // let photo = e.tempFilePath // 头像 - // // uni.downloadFile({ - // // url: 'http://banbai.oss-cn-beijing.aliyuncs.com/20230606/f0738e1ff432c08b369ca5e4b906a34a.png', - // // success: function(e) { - // // uni.hideLoading() - // // let qrcode = e.tempFilePath // 二维码 - // // self.drawTxtOne(ctx, '农业咨询小程序', 220, 35, 100, - // // '#222', 12, false) - // // // 绘制圆角头像 图片地址 距离左边 距离上边 宽度 高度 圆角 - // // self.drawImg(ctx, - // // 'https://lihai001.oss-cn-chengdu.aliyuncs.com/storage/202310/20231013091310.png', - // // 170, 10, 40, 40, 20) - // // self.drawImg(ctx, - // // 'https://lihai001.oss-cn-chengdu.aliyuncs.com/storage/202310/20231013091059.png', - // // 10, 50, 40, 40, 20) - - // // self.drawImg(ctx, - // // 'https://lihai001.oss-cn-chengdu.aliyuncs.com/storage/202310/20231013091310.png', - // // 10, 118, 40, 40, 20) - - // // // 绘制封面图 图片地址 距离左边 距离上边 宽度 高度 圆角 - // // // self.drawImg(ctx, img, 10, 120, 210, 260, 8) - - // // // 绘制二维码 图片地址 距离左边 距离上边 宽度 高度 圆角 - // // self.drawImg(ctx, - // // 'https://lihai001.oss-cn-chengdu.aliyuncs.com/storage/202310/ai_qr_20231013091327.jpg', - // // 174, 195, 100, 100, 0) - - // // // 绘制单行文字 图片地址 距离左边 距离上边 宽度 颜色 字号 加粗 - // // self.drawTxtOne(ctx, self.pext1, 60, 70, 100, - // // '#222', 12, false) - // // // self.drawTxtTwo(ctx, self.pext1, 60, 64, 80, - // // // '#222', 13) - // // // self.drawTxtTwo(ctx, self.pext1, 60,64, - // // // 190, 20, '#222', 12) - // // // 绘制单行文字 图片地址 距离左边 距离上边 宽度 颜色 字号 加粗 - // // // self.drawTxtOne(ctx, '邀请您一起购好物', 60, 80, 100, - // // // '#666', 9, false) - - // // // 绘制两行文字 图片地址 距离左边 距离上边 宽度 行高 颜色 字号 - // // self.drawTxtFour(ctx, - // // self.pext2, - // // 60, 120, - // // 190, 20, '#222', 12) - - // // // 绘制单行文字 图片地址 距离左边 距离上边 宽度 颜色 字号 加粗 - // // self.drawTxtOne(ctx, '下载二维码', 15, 250, 100, - // // '#666', 11, false) - - // // // 绘制单行文字 图片地址 距离左边 距离上边 宽度 颜色 字号 加粗 - // // // self.drawTxtOne(ctx, '今日特价:¥', 15, 350, 100, - // // // '#ED3327', 11, false) - - // // // 绘制单行文字 图片地址 距离左边 距离上边 宽度 颜色 字号 加粗 - // // // self.drawTxtOne(ctx, '86.00', 82, 350, 100, - // // // '#ED3327', 11, true) - - // // // 绘制删除文字 图片地址 距离左边 距离上边 行高 颜色 字号 加粗 - // // // self.drawTxtDel(ctx, '原价:20', 15, 370, 4, - // // // '#818181', 10, false) - - // // // 结束绘制 - // // ctx.draw() - // // self.show = true - // // } - // // }) - // // } - // // }) - // // } - // // }) - - - - // }, - down() { uni.showLoading({ title: '保存中' }) - uni.canvasToTempFilePath({ - canvasId: 'ctx', - quality: 1, + uni.saveImageToPhotosAlbum({ + filePath: this.tempImage, success: (res) => { + console.log('保存') uni.hideLoading() - console.log(res) - this.$emit('down', res) - this.show = false - // 保存到相册 自定义实现 - uni.saveImageToPhotosAlbum({ - filePath: res.tempFilePath, - success: (res) => { - console.log('保存') - uni.showModal({ - title: '保存成功' - }) - } + this.close() + uni.showModal({ + title: '保存成功' }) } }) diff --git a/components/qiqb-share/qiqb-share1.vue b/components/qiqb-share/qiqb-share1.vue deleted file mode 100644 index 0dc3ca9..0000000 --- a/components/qiqb-share/qiqb-share1.vue +++ /dev/null @@ -1,444 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 9560c61..1c03e2a 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -36,9 +36,9 @@ + - @@ -49,28 +49,34 @@ - - - - - 正在快速生成答案 + + + {{c_content}} + + + + + + 正在快速生成答案 + - + + - + - + + :style="{'margin-left':item.playStatus==false?'377rpx' :'427rpx','margin-right': '20rpx'}"> @@ -78,13 +84,40 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -112,7 +145,7 @@ - + {{btnStatus==0? "按住说话":btnStatus==1? "说话中...": btnStatus==2? "松开手指发送录音": "上划取消"}}