| | |
| | | getDetail(); |
| | | }, |
| | | error: function() { |
| | | mui.alert('开始装粮提交失败,请重新操作!', '提示', ["确定"], function() {}, "div"); |
| | | mui.alert('开始装粮提交失败,请重新操作!', '提示', ["确定"], function() {}, |
| | | "div"); |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | } |
| | | //拍照上传 |
| | | function choosePic(typeNum) { |
| | | var picker = new mui.PopPicker(); |
| | | picker.setData([{ |
| | | value: "cameraImg", |
| | | text: "拍照上传" |
| | | }, { |
| | | value: "galleryImg", |
| | | text: "从相册选择" |
| | | }]) |
| | | picker.show(function(SelectedItem) { |
| | | console.log(JSON.stringify(SelectedItem[0].value)); |
| | | console.log() |
| | | if (SelectedItem[0].value == 'cameraImg') { |
| | | console.log("拍照") |
| | | cameraImg(typeNum); |
| | | } else { |
| | | console.log("相册") |
| | | galleryImg(typeNum); |
| | | } |
| | | }) |
| | | // //获取定位信息 |
| | | // if (latitude == null || longitude == null) { |
| | | // return; |
| | |
| | | }]) |
| | | picker.show(function(SelectedItem) { |
| | | console.log(JSON.stringify(SelectedItem)); |
| | | if (SelectedItem == 'cameraImg') { |
| | | if (SelectedItem[0].value == 'cameraImg') { |
| | | cameraImg(typeNum); |
| | | } else { |
| | | galleryImg(typeNum); |
| | |
| | | mui.alert('系统繁忙,请重试!', '提示', ["确定"], function() {}, "div"); |
| | | } |
| | | }) |
| | | // var picker = new mui.PopPicker(); |
| | | // picker.setData([{ |
| | | // value: "cameraImg", |
| | | // text: "拍照上传" |
| | | // }, { |
| | | // value: "galleryImg", |
| | | // text: "从相册选择" |
| | | // }]) |
| | | // picker.show(function(SelectedItem) { |
| | | // console.log(JSON.stringify(SelectedItem)); |
| | | // if (SelectedItem == 'cameraImg') { |
| | | // cameraImg(typeNum); |
| | | // } else { |
| | | // galleryImg(typeNum); |
| | | // } |
| | | // }) |
| | | |
| | | }; |
| | | |
| | | //使用相机拍照 |
| | | //相机拍照 |
| | | function cameraImg(typeNum) { |
| | | var cmr = plus.camera.getCamera(); |
| | | cmr.captureImage(function(p) { |