diff --git a/app.js b/app.js index 0ed5e50..4d26e1f 100644 --- a/app.js +++ b/app.js @@ -8,7 +8,6 @@ App({ onLaunch() { const { api } = getConfigByEnv(); this.globalData = { ...this.globalData, api, } - }, globalData: { primaryColor: '#52c41a' diff --git a/components/pagination/index.wxml b/components/pagination/index.wxml index 4d599db..fef9bca 100644 --- a/components/pagination/index.wxml +++ b/components/pagination/index.wxml @@ -9,7 +9,7 @@ - 第{{item+1}}页 + 第{{item+1}}页 diff --git a/pages/publicTransfer/index.js b/pages/publicTransfer/index.js index 650d537..89fb273 100644 --- a/pages/publicTransfer/index.js +++ b/pages/publicTransfer/index.js @@ -39,6 +39,7 @@ Page({ }) }, async upload(res) { + const result = await uploadPublicFile(res.tempFiles[0]?.tempFilePath) if (result.statusCode !== 200) { alertInfo("上传失败") @@ -55,6 +56,12 @@ Page({ mediaType: ['image'], // 可以选择文件的类型,这里只允许上传文件 sourceType: ['album', 'camera'], success: (res) => { + const file = res.tempFiles[0]; + if (file.size / 1024 / 1024 > 1) { + alertInfo("文件不能大于1M") + return; + } + // console.log('res', res) loadingFunc(async () => { await this.upload(res) })