From 4dcfe6e82be83748f3d1334ad15f084d5cb37907 Mon Sep 17 00:00:00 2001 From: jia <1451658316@qq.com> Date: Wed, 1 Nov 2023 15:03:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eai=E5=85=B3=E9=97=AD=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 6 + api/api.js | 5 + components/content-top/index.vue | 92 ++ components/qiqb-share/qiqb-share.vue | 159 +- config/app.js | 1 - config/request.js | 2 +- config/requesta.js | 2 +- manifest.json | 40 +- pages.json | 53 +- pages/index/index.vue | 951 +++++------ pages/index/index1.vue | 2239 ++++++++++++++++++++++++++ pages/index/indexa.vue | 2048 +++++++++++++++++++++++ static/icon/fb1.png | Bin 0 -> 446 bytes static/icon/fb2.png | Bin 0 -> 1119 bytes 14 files changed, 4857 insertions(+), 741 deletions(-) create mode 100644 components/content-top/index.vue create mode 100644 pages/index/index1.vue create mode 100644 pages/index/indexa.vue create mode 100644 static/icon/fb1.png create mode 100644 static/icon/fb2.png diff --git a/App.vue b/App.vue index b5d8f5c..26a6b9a 100644 --- a/App.vue +++ b/App.vue @@ -2,6 +2,11 @@ export default { onLaunch: function(info) { console.log('App Launch'); + uni.sendHostEvent('log',info, (ret) => { + //发送消息成功回调 + console.log('消息成功app' + JSON.stringify(info)); + + }); if (info.referrerInfo?.extraData?.uniMP) { uni.setStorageSync('uniMP', info.referrerInfo?.extraData?.uniMP); uni.setStorageSync('APP_token', info.referrerInfo?.extraData?.token); @@ -24,4 +29,5 @@ diff --git a/api/api.js b/api/api.js index 345116e..91ca6fd 100644 --- a/api/api.js +++ b/api/api.js @@ -18,6 +18,11 @@ export function ttWss(data) { return requesta.post(`index/tts`, data); } +//图片识别 +export function ttocr(data) { + return request.post(`xun_fei/ocr`, data); +} + diff --git a/components/content-top/index.vue b/components/content-top/index.vue new file mode 100644 index 0000000..02b9206 --- /dev/null +++ b/components/content-top/index.vue @@ -0,0 +1,92 @@ + + + + + \ No newline at end of file diff --git a/components/qiqb-share/qiqb-share.vue b/components/qiqb-share/qiqb-share.vue index d6c23f7..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.show = false - // 保存到相册 自定义实现 - uni.saveImageToPhotosAlbum({ - filePath: res.tempFilePath, - success: (res) => { - console.log('保存') - uni.showModal({ - title: '保存成功' - }) - } + this.close() + uni.showModal({ + title: '保存成功' }) } }) diff --git a/config/app.js b/config/app.js index fcdb9e7..3b8ca8f 100644 --- a/config/app.js +++ b/config/app.js @@ -25,7 +25,6 @@ switch (env) { module.exports = { // 请求域名 格式: https://您的域名 - HTTP_REQUEST_URL: httpApi, HTTP_REQUEST_URL_ONE: httpApione, HEADER: { diff --git a/config/request.js b/config/request.js index 4bac5f7..9c2cada 100644 --- a/config/request.js +++ b/config/request.js @@ -39,7 +39,7 @@ function baseRequest(url, method, data, { data: data || {}, success: (res) => { // #ifdef APP-PLUS - // console.log('app', Url + '/api/' + url, res.data); + // #endif if (noVerify) diff --git a/config/requesta.js b/config/requesta.js index df13df9..50d1a90 100644 --- a/config/requesta.js +++ b/config/requesta.js @@ -40,7 +40,7 @@ function baseRequest(url, method, data, { success: (res) => { // #ifdef APP-PLUS - // console.log('app', Url + '/api/' + url, res.data); + console.log('app', Url + '/api/' + url, res.data); // #endif if (noVerify) diff --git a/manifest.json b/manifest.json index 5d70fb9..8eabe35 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "农业咨询", - "appid" : "__UNI__3A527D1", + "appid" : "__UNI__9620511", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", @@ -27,20 +27,24 @@ /* android打包配置 */ "android" : { "permissions" : [ - "", - "", - "", - "", - "", + "", "", "", + "", "", - "", - "", + "", "", - "", "", - "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", "" ], "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ] @@ -55,6 +59,22 @@ "speech" : {}, "share" : {} } + }, + "nativePlugins" : { + "YL-SpeechRecognition" : { + "__plugin_info__" : { + "name" : "YL-SpeechRecognition-语音合成,语音听写,基于科大讯飞,双端 - [试用版,仅用于自定义调试基座]", + "description" : "语音合成,语音听写,基于科大讯飞,双端(QQ:453503875,微信同)", + "platforms" : "Android,iOS", + "url" : "https://ext.dcloud.net.cn/plugin?id=9512", + "android_package_name" : "", + "ios_bundle_id" : "", + "isCloud" : true, + "bought" : 0, + "pid" : "9512", + "parameters" : {} + } + } } }, /* 快应用特有相关 */ diff --git a/pages.json b/pages.json index 488ed3c..9678b90 100644 --- a/pages.json +++ b/pages.json @@ -1,28 +1,29 @@ { - "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages - { - "path": "pages/index/index", - "style": { - "navigationBarTitleText": "农业咨询", - "navigationStyle": "custom", - "bounce": "none" - // "softinputMode": "adjustResize" - } - } - ], - "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "人工智能", - "navigationBarBackgroundColor": "#F8F8F8", - "backgroundColor": "#F8F8F8" - }, - "uniIdRouter": {}, - "condition": { //模式配置,仅开发期间生效 - "current": 0, //当前激活的模式(list 的索引项) - "list": [{ - "name": "", //模式名称 - "path": "", //启动页面,必选 - "query": "" //启动参数,在页面的onLoad函数里面得到 - }] - } + "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + { + "path": "pages/index/index", + "style": { + "navigationBarTitleText": "农业咨询", + "navigationStyle": "custom", + "bounce": "none" + + // "softinputMode": "adjustResize" + } + } + ], + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "人工智能", + "navigationBarBackgroundColor": "#F8F8F8", + "backgroundColor": "#F8F8F8" + }, + "uniIdRouter": {}, + "condition": { //模式配置,仅开发期间生效 + "current": 0, //当前激活的模式(list 的索引项) + "list": [{ + "name": "", //模式名称 + "path": "", //启动页面,必选 + "query": "" //启动参数,在页面的onLoad函数里面得到 + }] + } } \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index c38a441..c9e693d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -2,12 +2,13 @@ - + - + 农业咨询 + @@ -36,9 +37,9 @@ + - @@ -49,28 +50,36 @@ - - - - - 正在快速生成答案 + + + {{c_content}} + + + + + + 正在快速生成答案 + - + + - + - + + :style="{'margin-left':item.playStatus==false?'377rpx' :'427rpx','margin-right': '20rpx'}"> @@ -78,13 +87,42 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -112,8 +150,7 @@ - + {{btnStatus==0? "按住说话":btnStatus==1? "说话中...": btnStatus==2? "松开手指发送录音": "上划取消"}} + + + 正在快速生成答案 + + + + + + + + + + 正在快速生成答案 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 中断连接 + + + + + + + + + + + + + + + + + + {{btnStatus==0? "按住说话":btnStatus==1? "说话中...": btnStatus==2? "松开手指发送录音": "上划取消"}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{btnStatus==3? '松开手指,取消发送':"正在录音..."}} + + + + + + + + + X + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/index/indexa.vue b/pages/index/indexa.vue new file mode 100644 index 0000000..60566e9 --- /dev/null +++ b/pages/index/indexa.vue @@ -0,0 +1,2048 @@ + + + + + \ No newline at end of file diff --git a/static/icon/fb1.png b/static/icon/fb1.png new file mode 100644 index 0000000000000000000000000000000000000000..786e3f31f35939f0542352f9846ea2b19a60fce6 GIT binary patch literal 446 zcmV;v0YUzWP)Px$cu7P-R7gw3)jvyIQ4j_2--3mO5DU8~u`oo-6oO3(L5PK*Mba6PPCvpz0%-(4 zKq@O2)J{;rU;-9)QLs=DOsZG}B4}ZmLWqpqh3CV4`%l)}J>JYY=g!PMQ_}wF#T;fZ zjQIY8eXL@uU5Zkh0I!pfz5<+Gyu*2`Tv?INFoAyj#CKd308e8bT@8>2-YZ-d#J<2J zdT^5X|3!RNLSWDu%b}UL*!{1_*$IzRbVHzrdgd)$-t|gXzkzB;#yec z5c$6j(;miiF+VWYtisgNrA*#n8k-`h%41iu8yAgK@&lF&X7XivZP}1c&1AU2NWIq` zGqnAPulsE*g{)78KZZ{|#V>rTl oG`qWplHfBOVhx+E0$1~H05~#E!`+b`&j0`b07*qoM6N<$g2)HOl>h($ literal 0 HcmV?d00001 diff --git a/static/icon/fb2.png b/static/icon/fb2.png new file mode 100644 index 0000000000000000000000000000000000000000..a9534065e79c604528fc2cdb79dba242eae84170 GIT binary patch literal 1119 zcmV-l1fctgP)Px(8A(JzR9Hv7m|Lh-RTPFlGo&IdE7G#aO3fY&GKn(s5@l9|X^7^d<%?ZJp$F5n zjKmviA_VpzLWx8{C1QeNX{9JZT82eh5N2gw$h?=ycbHRVleO1gOSg@;bN0CWYmI;0 zRy*oTJKzrBUf?d^R-ij@6>tS`0QeR70oV>~0@ea2>x42$RWbMrz*9iiszyQY6tEJQ z3v8}pTLoBOUo#y7SCkf5o&4#SuRP{l9;6~zlWM_!7L0}Hli;{n~ zRYi#t=Ucy;z+MBUmDsEab2X}L6WE_X#~Q#s3;nGQwr0TI1D;GAZWfqb-KG|0Au#cO zPG#QDRtju2Ff;-3A@D>Aurv(kOinrRqxc5hy)cfzVF-lT~y_En-raI zoq=`XwdRgp>O9}xZqhJQJ7ajoOZ2pfMjelwN5V33)~?aPdnK?u7!;+?bME~>UODkC za41ofL!M&~hb7RDEk)ue8WZOAe||6fMBtv}=K((xq+PicJTqldLr%4wYq?bUsB%+q zFuE0p0!@729cBKi0E_l^cDD}Oir>QO%EzI2T(g@UIfdkJ7SJ(bb96FzIs5VC#>~id l+BV~5FOLM(XtgekcLr(s%Yx}q$(aBE002ovPDHLkV1kui{;B`~ literal 0 HcmV?d00001