收藏
回答

有客户反映说表单没法提交

有客户反映在绑定手机时,提交不了,下面是代码,帮忙看一下
<form class="gzhForm box-size" bindsubmit="formBindsubmit">
    <view class="gzh_form box-size">
        <view class="form_input box-size">
            <image class="ico-uc" src="images/phone.png"></image>
            <input bindinput="inputPhone" name="phone" type="number" placeholder="请输入会员手机" />
        </view>
 
        <view class="form_input box-size">
            <image class="ico-yzm" src="images/yzm.png"></image>
            <input class="yzm-input" type="number" name="yzm" placeholder="请输入验证码" />
            <button class="yzm-btn" bindtap="reSendPhoneNum" disabled="{{isdisable}}">{{verifyInfo}}</button>
        </view>
    </view>
    <view class="but_submit box-size">
        <button class="submit" formType="submit">下一步</button>
    </view>
</form>

// 提交

    formBindsubmit: function (e) {
        var that = this;
        var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/;
        var NUMBER = /^[0-9]*$/i;
        var phone = e.detail.value.phone;
        var yzm = e.detail.value.yzm;
        if (phone.length == 0) {
            that.setData({
                tip: '请输入会员手机号',
                modShow: !that.data.modShow
            })
        } else if (!myreg.test(phone) || phone.length !== 11) {
            that.setData({
                tip: '手机号有误',
                modShow: !that.data.modShow
            })
        } else if (yzm.length == 0) {
            that.setData({
                tip: '请输入验证码',
                modShow: !that.data.modShow
            })
        } else if (!NUMBER.test(yzm) || yzm.length !== 4) {
            that.setData({
                tip: '验证码有误',
                modShow: !that.data.modShow
            })
        } else {
                        wx.request({
                            url: that.data.url + '/api/syr/memberSyr!memBindByXcx.do?ajax=yes',
                            data: {
                                "mobile": e.detail.value.phone,
                                "phoneCode": e.detail.value.yzm,
                                "unionid": that.data.storage.unionid,
                                "openid": that.data.storage.openid,
                                "nickname": that.data.storage.nickname,
                                "face": that.data.storage.face,
                                "sex": that.data.storage.sex
                            },
                            method: 'POST',
                            header: { 'content-type': 'application/x-www-form-urlencoded' },
                            success: function (res) {
                                if (res.data.result == 1) {
                                    wx.showToast({
                                        title: "绑定成功"
                                    });
                                    setTimeout(() => {
                                        wx.redirectTo({
                                            url: '../chongzhi/chongzhi',
                                        });
                                    }, 1000)
                                } else {
                                    that.setData({
                                        tip: res.data.message,
                                        modShow: !that.data.modShow
                                    })
                                }
                            }
                        })

                }
            });
             
        }
    },



回答关注问题邀请回答
收藏

1 个回答

  • 春风和煦
    春风和煦
    2018-04-20

    楼主我也经常听到用户反馈这种问题  ,  楼主最后怎么解决了吗

    2018-04-20
    有用
    回复
登录 后发表内容