fix: 移除点击模板时不必要的loading状态
- 移除点击模板时立即显示的"选择图片中..."loading提示 - 保留选择图片后上传时的loading状态 - 优化用户体验,避免不必要的loading显示
This commit is contained in:
parent
d1dc9b3b48
commit
0e9e3c9247
|
|
@ -1,4 +1,4 @@
|
||||||
import { View, Text, ScrollView } from '@tarojs/components'
|
import { View, ScrollView } from '@tarojs/components'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import Taro, { navigateTo } from '@tarojs/taro'
|
import Taro, { navigateTo } from '@tarojs/taro'
|
||||||
import { useAppDispatch, useAppSelector } from '../../hooks/redux'
|
import { useAppDispatch, useAppSelector } from '../../hooks/redux'
|
||||||
|
|
@ -63,12 +63,6 @@ export default function Home() {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
|
|
||||||
// 显示loading提示
|
|
||||||
Taro.showLoading({
|
|
||||||
title: '选择图片中...',
|
|
||||||
mask: true
|
|
||||||
})
|
|
||||||
|
|
||||||
// 选择并上传图片
|
// 选择并上传图片
|
||||||
const url = await sdk.chooseAndUploadImage({
|
const url = await sdk.chooseAndUploadImage({
|
||||||
onImageSelected: () => {
|
onImageSelected: () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue