|
|
@@ -378,24 +378,11 @@
|
|
|
</view>
|
|
|
</view> -->
|
|
|
</view>
|
|
|
- <!-- <u-modal v-model="show" :mask-close-able="true" title="病虫害识别" :show-cancel-button="true" confirm-text="拍病害"
|
|
|
- cancel-text="拍虫害" cancel-color="#4BB85F" content="拍照识别病虫害" @confirm="confirm" @cancel="cancel"></u-modal>
|
|
|
- <kps-image-cutter @ok="onok" @cancel="oncancle" :url="url" :fixed="false" :blob="true" :maxWidth="500"
|
|
|
- :maxHeight="380" :height="380"></kps-image-cutter> -->
|
|
|
- <view class="loading" v-if="loadTF" @touchmove.stop.prevent="moveHandle">
|
|
|
- <u-loading mode="flower" size="100" :show="true"></u-loading>
|
|
|
- </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import kpsImageCutter from '@/components/ksp-image-cutter/ksp-image-cutter.vue';
|
|
|
-import jsencrypt from '@/components/jsencrypt/jsencrypt.vue';
|
|
|
-// Vue.use(QueryPermission)
|
|
|
export default {
|
|
|
- components: {
|
|
|
- kpsImageCutter,
|
|
|
- },
|
|
|
data() {
|
|
|
return {
|
|
|
weatherinfo: {
|
|
|
@@ -567,109 +554,109 @@ export default {
|
|
|
url: `${url}${type ? `?typeId=${type}` : ''}`,
|
|
|
});
|
|
|
},
|
|
|
- onok(ev) {
|
|
|
- this.path = this.url;
|
|
|
- console.log(ev);
|
|
|
- this.loadTF = true;
|
|
|
- uni.showLoading({
|
|
|
- mask: true,
|
|
|
- success: function () {
|
|
|
- console.log(999);
|
|
|
- },
|
|
|
- });
|
|
|
- var publiukey = `-----BEGIN PUBLIC KEY-----
|
|
|
- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6m92fXUrccS4SoLg4W4jPRNua
|
|
|
- 4BcRk4ldLcqPuQpD2Mds2+hw+Gi+0MUnshF/r/DTcCJgkt7rtoY9EB6/XJ6MFw14
|
|
|
- whhESFie/lZUWRsk8M89Rkr8m5rwmBl+uLAd5LopyshFqKTBXeT2ytHP1JCQLPBO
|
|
|
- 34Fy4/yEz4qEzkzBuwIDAQAB
|
|
|
- -----END PUBLIC KEY-----`;
|
|
|
- var time = +new Date();
|
|
|
- var str2 = 'YuNfEi' + time + 'YuNfEi';
|
|
|
- var pubblicData = jsencrypt.setEncrypt(publiukey, str2);
|
|
|
- if (this.flag == 2) {
|
|
|
- console.log('111');
|
|
|
- // pest.pests.insect_discern 虫害
|
|
|
- uni.uploadFile({
|
|
|
- // url: 'http://114.115.147.140:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
|
|
|
- url: 'https://wx.hnyfwlw.com/api/api_gateway?method=pest.pests.insect_discern', //仅为示例,非真实的接口地址
|
|
|
- filePath: ev.path,
|
|
|
- name: 'img_file',
|
|
|
- formData: {
|
|
|
- user: 'test',
|
|
|
- sign: pubblicData,
|
|
|
- },
|
|
|
- success: (uploadFileRes) => {
|
|
|
- this.loadTF = false;
|
|
|
- console.log(JSON.parse(uploadFileRes.data));
|
|
|
- uni.navigateTo({
|
|
|
- url:
|
|
|
- '../disandpests/index?datas=' +
|
|
|
- uploadFileRes.data +
|
|
|
- '&path=' +
|
|
|
- ev.path,
|
|
|
- });
|
|
|
- },
|
|
|
- fail(res) {
|
|
|
- console.log(res);
|
|
|
- },
|
|
|
- });
|
|
|
- } else if (this.flag == 1) {
|
|
|
- //pest.pests.insect_discern病害识别
|
|
|
- // uni.showLoading({
|
|
|
- // title: '加载中'
|
|
|
- // });
|
|
|
- uni.uploadFile({
|
|
|
- // url: 'http://114.115.147.140:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
|
|
|
- url: 'https://wx.hnyfwlw.com/api/api_gateway?method=pest.pests.plant_discern', //仅为示例,非真实的接口地址
|
|
|
- filePath: ev.path,
|
|
|
- name: 'img_file',
|
|
|
- formData: {
|
|
|
- user: 'test',
|
|
|
- sign: pubblicData,
|
|
|
- },
|
|
|
- success: (uploadFileRes) => {
|
|
|
- this.loadTF = false;
|
|
|
- console.log(JSON.parse(uploadFileRes.data));
|
|
|
- uni.navigateTo({
|
|
|
- url:
|
|
|
- '../disandpests/index?datas=' +
|
|
|
- uploadFileRes.data +
|
|
|
- '&path=' +
|
|
|
- ev.path,
|
|
|
- });
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
- this.url = '';
|
|
|
- },
|
|
|
- oncancle() {
|
|
|
- // url设置为空,隐藏控件
|
|
|
- this.url = '';
|
|
|
- },
|
|
|
- confirm() {
|
|
|
- this.flag = 1;
|
|
|
- uni.chooseImage({
|
|
|
- count: 1, //默认9
|
|
|
- // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
- sourceType: ['camera', 'album'], //从相册选择
|
|
|
- success: (res) => {
|
|
|
- this.url = res.tempFilePaths[0];
|
|
|
- },
|
|
|
- });
|
|
|
- console.log(1);
|
|
|
- },
|
|
|
- cancel() {
|
|
|
- this.flag = 2;
|
|
|
- uni.chooseImage({
|
|
|
- count: 1, //默认9
|
|
|
- // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
- sourceType: ['camera', 'album'], //从相册选择
|
|
|
- success: (res) => {
|
|
|
- console.log(1);
|
|
|
- this.url = res.tempFilePaths[0];
|
|
|
- },
|
|
|
- });
|
|
|
- },
|
|
|
+ // onok(ev) {
|
|
|
+ // this.path = this.url;
|
|
|
+ // console.log(ev);
|
|
|
+ // this.loadTF = true;
|
|
|
+ // uni.showLoading({
|
|
|
+ // mask: true,
|
|
|
+ // success: function () {
|
|
|
+ // console.log(999);
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // var publiukey = `-----BEGIN PUBLIC KEY-----
|
|
|
+ // MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6m92fXUrccS4SoLg4W4jPRNua
|
|
|
+ // 4BcRk4ldLcqPuQpD2Mds2+hw+Gi+0MUnshF/r/DTcCJgkt7rtoY9EB6/XJ6MFw14
|
|
|
+ // whhESFie/lZUWRsk8M89Rkr8m5rwmBl+uLAd5LopyshFqKTBXeT2ytHP1JCQLPBO
|
|
|
+ // 34Fy4/yEz4qEzkzBuwIDAQAB
|
|
|
+ // -----END PUBLIC KEY-----`;
|
|
|
+ // var time = +new Date();
|
|
|
+ // var str2 = 'YuNfEi' + time + 'YuNfEi';
|
|
|
+ // var pubblicData = jsencrypt.setEncrypt(publiukey, str2);
|
|
|
+ // if (this.flag == 2) {
|
|
|
+ // console.log('111');
|
|
|
+ // // pest.pests.insect_discern 虫害
|
|
|
+ // uni.uploadFile({
|
|
|
+ // // url: 'http://114.115.147.140:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
|
|
|
+ // url: 'https://wx.hnyfwlw.com/api/api_gateway?method=pest.pests.insect_discern', //仅为示例,非真实的接口地址
|
|
|
+ // filePath: ev.path,
|
|
|
+ // name: 'img_file',
|
|
|
+ // formData: {
|
|
|
+ // user: 'test',
|
|
|
+ // sign: pubblicData,
|
|
|
+ // },
|
|
|
+ // success: (uploadFileRes) => {
|
|
|
+ // this.loadTF = false;
|
|
|
+ // console.log(JSON.parse(uploadFileRes.data));
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url:
|
|
|
+ // '../disandpests/index?datas=' +
|
|
|
+ // uploadFileRes.data +
|
|
|
+ // '&path=' +
|
|
|
+ // ev.path,
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // fail(res) {
|
|
|
+ // console.log(res);
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // } else if (this.flag == 1) {
|
|
|
+ // //pest.pests.insect_discern病害识别
|
|
|
+ // // uni.showLoading({
|
|
|
+ // // title: '加载中'
|
|
|
+ // // });
|
|
|
+ // uni.uploadFile({
|
|
|
+ // // url: 'http://114.115.147.140:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
|
|
|
+ // url: 'https://wx.hnyfwlw.com/api/api_gateway?method=pest.pests.plant_discern', //仅为示例,非真实的接口地址
|
|
|
+ // filePath: ev.path,
|
|
|
+ // name: 'img_file',
|
|
|
+ // formData: {
|
|
|
+ // user: 'test',
|
|
|
+ // sign: pubblicData,
|
|
|
+ // },
|
|
|
+ // success: (uploadFileRes) => {
|
|
|
+ // this.loadTF = false;
|
|
|
+ // console.log(JSON.parse(uploadFileRes.data));
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url:
|
|
|
+ // '../disandpests/index?datas=' +
|
|
|
+ // uploadFileRes.data +
|
|
|
+ // '&path=' +
|
|
|
+ // ev.path,
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // this.url = '';
|
|
|
+ // },
|
|
|
+ // oncancle() {
|
|
|
+ // // url设置为空,隐藏控件
|
|
|
+ // this.url = '';
|
|
|
+ // },
|
|
|
+ // confirm() {
|
|
|
+ // this.flag = 1;
|
|
|
+ // uni.chooseImage({
|
|
|
+ // count: 1, //默认9
|
|
|
+ // // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
+ // sourceType: ['camera', 'album'], //从相册选择
|
|
|
+ // success: (res) => {
|
|
|
+ // this.url = res.tempFilePaths[0];
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // console.log(1);
|
|
|
+ // },
|
|
|
+ // cancel() {
|
|
|
+ // this.flag = 2;
|
|
|
+ // uni.chooseImage({
|
|
|
+ // count: 1, //默认9
|
|
|
+ // // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
+ // sourceType: ['camera', 'album'], //从相册选择
|
|
|
+ // success: (res) => {
|
|
|
+ // console.log(1);
|
|
|
+ // this.url = res.tempFilePaths[0];
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // },
|
|
|
worm() {
|
|
|
uni.navigateTo({
|
|
|
url: '../expertDiagnosis/wormcase?name=虫情百科',
|