新增ai关闭功能

This commit is contained in:
jia 2023-11-01 15:03:32 +08:00
parent 7e224f3d37
commit 4dcfe6e82b
14 changed files with 4857 additions and 741 deletions

View File

@ -2,6 +2,11 @@
export default { export default {
onLaunch: function(info) { onLaunch: function(info) {
console.log('App Launch'); console.log('App Launch');
uni.sendHostEvent('log',info, (ret) => {
//
console.log('消息成功app' + JSON.stringify(info));
});
if (info.referrerInfo?.extraData?.uniMP) { if (info.referrerInfo?.extraData?.uniMP) {
uni.setStorageSync('uniMP', info.referrerInfo?.extraData?.uniMP); uni.setStorageSync('uniMP', info.referrerInfo?.extraData?.uniMP);
uni.setStorageSync('APP_token', info.referrerInfo?.extraData?.token); uni.setStorageSync('APP_token', info.referrerInfo?.extraData?.token);
@ -24,4 +29,5 @@
<style> <style>
/*每个页面公共css */ /*每个页面公共css */
</style> </style>

View File

@ -18,6 +18,11 @@ export function ttWss(data) {
return requesta.post(`index/tts`, data); return requesta.post(`index/tts`, data);
} }
//图片识别
export function ttocr(data) {
return request.post(`xun_fei/ocr`, data);
}

View File

@ -0,0 +1,92 @@
<template>
<view class="contentgb">
<view class="return_top">
<view class="z-bootm-img1" @click="returnbom()">
<image src="@/static/icon/fb1.png" mode="aspectFit"></image>
</view>
<view class="z-bootm-l"></view>
<view class="z-bootm-img2" @click="returnbom()">
<image src="@/static/icon/fb2.png" mode="aspectFit"></image>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
returnbom() {
uni.sendHostEvent('closeApp', (ret) => {
//
console.log('关闭应用' + JSON.stringify(ret));
});
}
}
}
</script>
<style lang="scss" scoped>
.contentgb {
width: 166rpx;
height: 56rpx;
.return_top {
width: 166rpx;
height: 56rpx;
background: rgba(255, 255, 255, 0.6);
border-radius: 44rpx 44rpx;
position: relative;
.z-bootm-img1 {
width: 41rpx;
height: 13rpx;
position: absolute;
top: 20rpx;
left: 25rpx;
image {
width: 100%;
height: 100%;
}
}
.z-bootm-l {
width: 1px;
height: 32rpx;
background: rgba(0, 0, 0, 0.2);
margin: auto 0;
position: absolute;
top: 10rpx;
left: 85rpx;
}
.z-bootm-img2 {
width: 38rpx;
height: 34rpx;
margin-top: -15rpx;
margin-left: -15rpx;
position: absolute;
right: 25rpx;
top: 25rpx;
image {
width: 100%;
height: 100%;
}
}
}
}
</style>

View File

@ -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() { down() {
uni.showLoading({ uni.showLoading({
title: '保存中' title: '保存中'
}) })
uni.canvasToTempFilePath({ uni.saveImageToPhotosAlbum({
canvasId: 'ctx', filePath: this.tempImage,
quality: 1,
success: (res) => { success: (res) => {
console.log('保存')
uni.hideLoading() uni.hideLoading()
console.log(res) this.close()
uni.showModal({
this.show = false title: '保存成功'
//
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: (res) => {
console.log('保存')
uni.showModal({
title: '保存成功'
})
}
}) })
} }
}) })

View File

@ -25,7 +25,6 @@ switch (env) {
module.exports = { module.exports = {
// 请求域名 格式: https://您的域名 // 请求域名 格式: https://您的域名
HTTP_REQUEST_URL: httpApi, HTTP_REQUEST_URL: httpApi,
HTTP_REQUEST_URL_ONE: httpApione, HTTP_REQUEST_URL_ONE: httpApione,
HEADER: { HEADER: {

View File

@ -39,7 +39,7 @@ function baseRequest(url, method, data, {
data: data || {}, data: data || {},
success: (res) => { success: (res) => {
// #ifdef APP-PLUS // #ifdef APP-PLUS
// console.log('app', Url + '/api/' + url, res.data);
// #endif // #endif
if (noVerify) if (noVerify)

View File

@ -40,7 +40,7 @@ function baseRequest(url, method, data, {
success: (res) => { success: (res) => {
// #ifdef APP-PLUS // #ifdef APP-PLUS
// console.log('app', Url + '/api/' + url, res.data); console.log('app', Url + '/api/' + url, res.data);
// #endif // #endif
if (noVerify) if (noVerify)

View File

@ -1,6 +1,6 @@
{ {
"name" : "农业咨询", "name" : "农业咨询",
"appid" : "__UNI__3A527D1", "appid" : "__UNI__9620511",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : "100", "versionCode" : "100",
@ -27,20 +27,24 @@
/* android */ /* android */
"android" : { "android" : {
"permissions" : [ "permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>", "<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
], ],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ] "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
@ -55,6 +59,22 @@
"speech" : {}, "speech" : {},
"share" : {} "share" : {}
} }
},
"nativePlugins" : {
"YL-SpeechRecognition" : {
"__plugin_info__" : {
"name" : "YL-SpeechRecognition-语音合成,语音听写,基于科大讯飞,双端 - [试用版,仅用于自定义调试基座]",
"description" : "语音合成语音听写基于科大讯飞双端QQ453503875微信同",
"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" : {}
}
}
} }
}, },
/* */ /* */

View File

@ -1,28 +1,29 @@
{ {
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages "pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "农业咨询", "navigationBarTitleText": "农业咨询",
"navigationStyle": "custom", "navigationStyle": "custom",
"bounce": "none" "bounce": "none"
// "softinputMode": "adjustResize"
} // "softinputMode": "adjustResize"
} }
], }
"globalStyle": { ],
"navigationBarTextStyle": "black", "globalStyle": {
"navigationBarTitleText": "人工智能", "navigationBarTextStyle": "black",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarTitleText": "人工智能",
"backgroundColor": "#F8F8F8" "navigationBarBackgroundColor": "#F8F8F8",
}, "backgroundColor": "#F8F8F8"
"uniIdRouter": {}, },
"condition": { // "uniIdRouter": {},
"current": 0, //(list ) "condition": { //
"list": [{ "current": 0, //(list )
"name": "", // "list": [{
"path": "", // "name": "", //
"query": "" //onLoad "path": "", //
}] "query": "" //onLoad
} }]
}
} }

File diff suppressed because it is too large Load Diff

2239
pages/index/index1.vue Normal file

File diff suppressed because it is too large Load Diff

2048
pages/index/indexa.vue Normal file

File diff suppressed because it is too large Load Diff

BIN
static/icon/fb1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

BIN
static/icon/fb2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB