修改样式,修改不能输入负数的问题
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
// pages/writeReading/components/photo/index.js
|
||||
import { uploadOcrFile } from "../../../../service/public"
|
||||
import request from "../../../../utils/request"
|
||||
import { alertError, alertInfo, alertSuccess, loadingFunc } from "../../../../utils/index"
|
||||
const { OK } = request;
|
||||
Component({
|
||||
|
||||
/**
|
||||
@@ -19,6 +23,28 @@ Component({
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
chooseImage() {
|
||||
const that = this;
|
||||
wx.chooseMedia({
|
||||
count: 1,
|
||||
mediaType: ['image'],
|
||||
sourceType: ['album', 'camera'],
|
||||
success: async function(res) {
|
||||
// console.log(res.tempFiles[0].tempFilePath)
|
||||
// console.log(res.tempFiles[0].size)
|
||||
loadingFunc(async () => {
|
||||
const { code, message, data } = await uploadOcrFile(res.tempFiles[0].tempFilePath)
|
||||
if (code !== OK) {
|
||||
alertError(message)
|
||||
return
|
||||
}
|
||||
setTimeout(() => {
|
||||
that.triggerEvent("finish", { number: data?.integer, success: data?.integer != null && data?.integer !== "" })
|
||||
}, 100)
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
@@ -1,4 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
"usingComponents": {
|
||||
"van-button": "@vant/weapp/button/index"
|
||||
}
|
||||
}
|
@@ -1,4 +1,8 @@
|
||||
<!--pages/writeReading/components/photo/index.wxml-->
|
||||
<view class="wrapper">
|
||||
拍照
|
||||
<van-button
|
||||
type="info"
|
||||
size="small"
|
||||
bind:tap="chooseImage"
|
||||
> 拍照 </van-button>
|
||||
</view>
|
Reference in New Issue
Block a user