微信小程序 form form-type 失效
发布于 6 年前 作者 jielai 15429 次浏览 来自 问答

在模拟器怎么点都能触发form-type提交,但在真机上却触发不了,这怎么破?

wxml:

<form bindsubmit=“formSubmit”>

<view class="weui-cell weui-cell_input ">

<view class=“weui-cell__hd”>

<view class=“weui-label”><span class=‘required-color’>*</span>名字</view>

</view>

<view class=“weui-cell__bd panel-case”>

<picker class=“weui-input” bindchange=“bindCase” value="{{caseIndex}}" range-key=“reason_name” range="{{caseArray}}">

<view class=“picker”>{{caseArray[caseIndex].reason_name}}</view>

</picker>

</view>

<image class=“ld_centerRight” src=’…/…/assets/images/icon_turnopen.png’ mode=‘widthFix’></image>

</view>

<view class=“weui-cell weui-cell_input " wx:if=”{{checkEdit}}">

<view class=“weui-cell__hd”>

<view class=“weui-label”>

<span class=‘required-color’>*</span>标的额

</view>

</view>

<view class=“weui-cell__bd”>

<input type=‘digit’ class=“weui-input” name=‘subject_price’ placeholder=“请输入金额” bindinput=‘arbitrationFees’ bindblur=’’/>

</view>

</view>

<view class=“admincle-wrapper”>

<view class=“title”><span class=‘required-color’>*</span>请求</view>

</view>

<view class=“admincle-wrapper”>

<view class="weui-cell weui-cell_input ">

<view class=“weui-cell__bd”>

<textarea class=“weui-textarea” name=‘arbitration_request’ bindinput=‘arbitrationRequest’ placeholder=’{{arbitration_request}}’ maxlength=“200”></textarea>

</view>

</view>

</view>

<view class=“admincle-wrapper”>

<view class=“title”><span class=‘required-color’>*</span>理由</view>

</view>

<view class=“admincle-wrapper”>

<view class="weui-cell weui-cell_input ">

<view class=“weui-cell__bd”>

<textarea class=“weui-textarea” name=‘factual_reason’ bindinput=‘factualReason’ placeholder=’{{factual_reason}}’ maxlength=“200”></textarea>

</view>

</view>

</view>

<view class=“caontainer”>

<import src="…/…/wxParse/wxParse.wxml" />

<view class=“admincle-wrapper”>

<view class=“title”>清单</view>

<view class=“section section_gap”>

<checkbox-group bindchange=“checkboxChange”>

<label class=“checkbox” wx:for="{{items}}">

<checkbox value="{{item.name}}" checked="{{item.checked}}" disabled="{{item.disabled}}"/>{{item.value}}

</label>

</checkbox-group>

</view>

</view>

<view class=“admincle-wrapper”>

<view class=“title”><span class=‘required-color’>*</span>身份证明</view>

</view>

<view class=“weui-uploader margin-top-0” wx:if="{{params[0].checked}}">

<view class=“weui-uploader__bd margin-right-0”>

<view class=“weui-uploader__files”>

<block wx:for="{{personal_list}}" wx:key="*this">

<view class=“weui-uploader__file panel-img”>

<em bindtap=“delIMG” id="{{item.id}}" data-imgArryName=‘personal_list’></em>

<input type=‘text’ bindinput=“modify” data-imgArryName=‘personal_list’ id="{{item.id}}" value=’{{item.file_name}}’></input>

</view>

</block>

</view>

<view class=“weui-uploader__input-box”>

<view class=“weui-uploader__input” bindtap=“chooseImage” data-imgArryName=‘personal_list’></view>

</view>

</view>

</view>

<view class=‘tips’ wx:if="{{params[0].checked}}"></view>

<view class=“admincle-wrapper”>

<view class=“title”><span class=‘required-color’>*</span></view>

</view>

<view class=“weui-uploader margin-top-0” wx:if="{{params[1].checked}}">

<view class=“weui-uploader__bd margin-right-0”>

<view class=“weui-uploader__files”>

<block wx:for="{{Loan_list}}" wx:key="*this">

<view class=“weui-uploader__file panel-img”>

<em bindtap=“delIMG” id="{{item.id}}" data-imgArryName=‘Loan_list’></em>

<input type=‘text’ bindinput=“modify” data-imgArryName=‘Loan_list’ id="{{item.id}}" value=’{{item.file_name}}’></input>

</view>

</block>

</view>

<view class=“weui-uploader__input-box”>

<view class=“weui-uploader__input” bindtap=“chooseImage” data-imgArryName=‘Loan_list’></view>

</view>

</view>

</view>

<view class=‘tips’ wx:if="{{params[1].checked}}"></view>

<view class=“admincle-wrapper” wx:if="{{params[2].checked}}">

<view class=“title”></view>

</view>

<view class=“weui-uploader margin-top-0” wx:if="{{params[2].checked}}">

<view class=“weui-uploader__bd margin-right-0”>

<view class=“weui-uploader__files”>

<block wx:for="{{mortgage_list}}" wx:key="*this">

<view class=“weui-uploader__file panel-img”>

<em bindtap=“delIMG” id="{{item.id}}" data-imgArryName=‘mortgage_list’></em>

<input type=‘text’ bindinput=“modify” data-imgArryName=‘mortgage_list’ id="{{item.id}}" value=’{{item.file_name}}’></input>

</view>

</block>

</view>

<view class=“weui-uploader__input-box”>

<view class=“weui-uploader__input” bindtap=“chooseImage” data-imgArryName=‘mortgage_list’></view>

</view>

</view>

</view>

<view class=‘tips’ wx:if="{{params[2].checked}}"></view>

<view class=“admincle-wrapper” wx:if="{{params[3].checked}}">

<view class=“title”>证明</view>

</view>

<view class=“weui-uploader margin-top-0” wx:if="{{params[3].checked}}">

<view class=“weui-uploader__bd margin-right-0”>

<view class=“weui-uploader__files”>

<block wx:for="{{performance_list}}" wx:key="*this">

<view class=“weui-uploader__file panel-img”>

<em bindtap=“delIMG” id="{{item.id}}" data-imgArryName=‘performance_list’></em>

<input type=‘text’ bindinput=“modify” data-imgArryName=‘performance_list’ id="{{item.id}}" value=’{{item.file_name}}’></input>

</view>

</block>

</view>

<view class=“weui-uploader__input-box”>

<view class=“weui-uploader__input” bindtap=“chooseImage” data-imgArryName=‘performance_list’></view>

</view>

</view>

</view>

<view class=‘tips’ wx:if="{{params[3].checked}}">抵凭证</view>

<view class=“admincle-wrapper” wx:if="{{params[4].checked}}">

<view class=“title”>证明</view>

</view>

<view class=“weui-uploader margin-top-0” wx:if="{{params[4].checked}}">

<view class=“weui-uploader__bd margin-right-0”>

<view class=“weui-uploader__files”>

<block wx:for="{{default_list}}" wx:key="*this">

<view class=“weui-uploader__file panel-img”>

<em bindtap=“delIMG” id="{{item.id}}" data-imgArryName=‘default_list’></em>

<input type=‘text’ bindinput=“modify” data-imgArryName=‘default_list’ id="{{item.id}}" value=’{{item.file_name}}’></input>

</view>

</block>

</view>

<view class=“weui-uploader__input-box”>

<view class=“weui-uploader__input” bindtap=“chooseImage” data-imgArryName=‘default_list’></view>

</view>

</view>

</view>

<view class=‘tips’ wx:if="{{params[4].checked}}">证据</view>

<view class=“admincle-wrapper” wx:if="{{params[5].checked}}">

<view class=“title”>其他</view>

</view>

<view class=“weui-uploader margin-top-0” wx:if="{{params[5].checked}}">

<view class=“weui-uploader__bd margin-right-0”>

<view class=“weui-uploader__files”>

<block wx:for="{{other_list}}" wx:key="*this">

<view class=“weui-uploader__file panel-img”>

<em bindtap=“delIMG” id="{{item.id}}" data-imgArryName=‘other_list’></em>

<input type=‘text’ bindinput=“modify” data-imgArryName=‘other_list’ id="{{item.id}}" value=’{{item.file_name}}’></input>

</view>

</block>

</view>

<view class=“weui-uploader__input-box”>

<view class=“weui-uploader__input” bindtap=“chooseImage” data-imgArryName=‘other_list’></view>

</view>

</view>

</view>

<view class=‘tips’ wx:if="{{params[5].checked}}">其他证明</view>

<view class=“admincle-wrapper” wx:if="{{checkEdit}}">

<view class=“title”>费用</view>

</view>

<view class=“admincle-wrapper” wx:if="{{checkEdit}}">

<view class="weui-cell weui-cell_input ">

<view class=“weui-cell__hd”>

<view class=“weui-label”>费用</view>

</view>

<view class=“weui-cell__bd”>

<input type=‘digit’ class=“weui-input” value=’{{arbitration_fees}}’ disabled=‘disabled’ />

</view>

</view>

</view>

<button class=“submit” form-type=‘submit’ formType=“submit” hover-class=‘red’>提交</button>

</view>

</form>

js:

//提交

formSubmit: function (e) {

console.log(‘这是提交’);

var params = {};

params.session_id = App.Session.getSessionId();

params.case_id = this.options.case_id;

params.reason_id = this.data.caseVal;

params.arbitration_request = e.detail.value.arbitration_request;

params.factual_reason = e.detail.value.factual_reason;

params.personal_list = JSON.stringify(this.data.personal_list);

params.Loan_list = JSON.stringify(this.data.Loan_list);

params.mortgage_list = JSON.stringify(this.data.mortgage_list);

params.performance_list = JSON.stringify(this.data.performance_list);

params.default_list = JSON.stringify(this.data.default_list);

params.other_list = JSON.stringify(this.data.other_list);

console.log(params);

console.log(e);

if (parseInt(this.options.checkEdit) == 0 || (parseInt(this.options.checkEdit) == 1 && parseInt(this.options.apply_type) == 1)) {

params.subject_price = e.detail.value.subject_price;

}

if ((parseInt(this.options.checkEdit) == 0 && params.subject_price == ‘’) || (parseInt(this.options.checkEdit) == 1 && parseInt(this.options.apply_type) == 2 && params.subject_price == ‘’) || params.reason_id == ‘’ || params.arbitration_request == ‘’ || params.reason == ‘’ || params.personal_list == ‘[]’ || params.Loan_list == ‘[]’){

wx.showToast({

title: ‘请填完整必填项!’,

icon: ‘none’,

duration: 2000

})

}else{

App.HttpService.saveData(params, ‘/wechat_api/ordinary_arbitration/fill_case_information’).then(data => {

console.log(data);

if (data.code == 0) {

if (parseInt(this.options.checkEdit) == 0) {

wx.redirectTo({

url: “…/…/pages/putongzhongcaijigou/payment_information?service_charge=” + this.data.arbitration_fees + “&jigou_id=” + this.options.jigou_id + “&case_id=” + data.data.case_id

})

} else {

wx.navigateBack({

delta: 1

})

}

} else {

this.showModal(data.msg);

}

});

}

},

1 回复

你好,请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

回到顶部