需要多扫几次真机调试或者真机预览的二维码,一般第一次没问题,第二次就会一直请求,一直stalled,直到超时。
<template>
<view class="content">
<block v-for="(item, index) in 30" :key="index">
<input :name="'inpu'+item" type="text" placeholder="请输入文本" />
</block>
<view class="block30"></view>
<view class="btn-area">
<button class="submit-btn" type="primary" @click="formSubmit">下一步</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
onLoad() {
},
methods: {
formSubmit: function(e) {
uni.showLoading({
title: '加载中',
mask: true
});
uni.request({
//项目的真正接口,通过字符串拼接方式实现
url: '',
header: {
'content-type': 'application/json;charset=UTF-8',
Authorization: '',
},
data: {},
method: 'POST',
success: function(res) {
uni.hideLoading();
uni.showModal({
content: 'dsfdsfsdfg'
})
},
fail() {
uni.hideLoading();
}
})
}
}
}
</script>
<style>
</style>
<template>
<view class="content">
<block v-for="(item, index) in 30" :key="index">
<input :name="'inpu'+item" type="text" placeholder="请输入文本" />
</block>
<view class="block30"></view>
<view class="btn-area">
<button class="submit-btn" type="primary" @click="formSubmit">下一步</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
onLoad() {
},
methods: {
formSubmit: function(e) {
uni.showLoading({
title: '加载中',
mask: true
});
uni.request({
url: '接口地址',
header: {
'content-type': 'application/json;charset=UTF-8',
Authorization: '',
},
data: {},
method: 'POST',
success: function(res) {
uni.hideLoading();
uni.showModal({
content: 'dsfdsfsdfg'
})
},
fail() {
uni.hideLoading();
}
})
}
}
}
</script>
<style>
</style>
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。