收藏
回答

WAServiceMainContext.js:2 Error: MiniProgramError?

      (0, _api.submitOrderSubmit)(params).then(function (res) {

        console.log('res.code 的值为:', res.code);

        if (res.code === 1{

          _this7.isHandlePy = false;

          _this7.setOrderData(res.data);

          _this7.setRemark('');

          uni.redirectTo({

            url: '/pages/pay/index?orderId=' + res.data.id });

        } else{

          uni.showToast({

            title: res.msg || '操作失败',

            duration: 3000,

            icon: 'none' });

        }

后端返回code为1的时候就不会报错正常跳转,但是后端返回code为0的时候,就不会执行这个回调函数,console.log那一句就没有执行然后报错WAServiceMainContext.js:2 Error: MiniProgramError

{"code":0,"msg":"超出配送范围","data":"error"}

    at Object.errorReport (WAServiceMainContext.js:2)

    at Function.thirdErrorReport (WAServiceMainContext.js:2)

    at Object.thirdErrorReport (WAServiceMainContext.js:2)

    at o (WASubContext.js?t=wechat&s=1738724017717&v=2.24.2:2)

    at Object.a [as cb] (WASubContext.js?t=wechat&s=1738724017717&v=2.24.2:2)

    at WASubContext.js?t=wechat&s=1738724017717&v=2.24.2:2

    at Array.forEach (<anonymous>)

    at N.emit (WASubContext.js?t=wechat&s=1738724017717&v=2.24.2:2)

    at t (WASubContext.js?t=wechat&s=1738724017717&v=2.24.2:2)

    at WASubContext.js?t=wechat&s=1738724017717&v=2.24.2:2(env: Windows,mp,1.06.2407120; lib: 2.24.2) 报错我的后端返回值

回答关注问题邀请回答
收藏
登录 后发表内容