修改样式,修改不能输入负数的问题

This commit is contained in:
2025-09-19 14:37:33 +08:00
parent aea85af0f9
commit 345a362c74
17 changed files with 212 additions and 56 deletions

View File

@@ -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)
})
}
})
}
}
})

View File

@@ -1,4 +1,6 @@
{
"component": true,
"usingComponents": {}
"usingComponents": {
"van-button": "@vant/weapp/button/index"
}
}

View File

@@ -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>