1***@qq.com
1***@qq.com
  • 发布:2024-06-13 17:36
  • 更新:2024-11-20 09:56
  • 阅读:204

【报Bug】uniapp pay-button getgoodsinfo报错 errMsg: "getGoodsInfo should be object, but got undefined"

分类:uni-app

产品分类: uniapp/小程序/字节跳动

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: windows10

HBuilderX类型: 正式

HBuilderX版本号: 4.15

第三方开发者工具版本号: V4.2.4

基础库版本号: 3.25.0.1

项目创建方式: HBuilderX

示例代码:
<pay-button class="submit_box" :mode="2" goods-id="7379849725253517350" :goods-type="1"  
                        :biz-line="2" @getgoodsinfo="getgoodsinfo" @pay="handlePay" @error="errorObj"  
                        @placeorder="userLogin" />            
    getgoodsinfo(e) {  
                console.log(e, "eeeeee")  
                return new Promise(resolve => {  
                    resolve({  
                        minLimits: 1,  
                        relationType: 1,  
                        validation: {  
                            phoneNumber: {  
                                required: true // 手机号是否必填   
                            },  
                            reservationType: 2,  
                            reservationCount: 2,  
                        },  
                        // 在 bind:getgoodsinfo 返回的 promise 的 resolve 函数中新增 marketingVersion 字段   
                        marketingVersion: 2,  
                    })  
                    console.log(e, "商品222")  
                })  

            }

操作步骤:

点击pay-button组件就会报错

预期结果:

正常跳到提单页

实际结果:

无法跳转 errMsg: "getGoodsInfo should be object, but got undefined"

bug描述:

点击立即抢购按钮 不能正确跳转到提单页,但是商品信息报错,errMsg: "getGoodsInfo should be object, but got undefined"
errNo: 21512,课程id是用的免审课程 7379849725253517350

2024-06-13 17:36 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com (作者)

https://ask.dcloud.net.cn/question/189088 这个里面提供的方法

1***@qq.com

1***@qq.com (作者)

<pay-button class="submit_box" :mode="2" goods-id="7379849725253517350" :goods-type="1" biz-line="2" bind:getgoodsinfo="getgoodsinfo" @pay="handlePay" @error="errorObj" @placeorder="userLogin" />
1***@qq.com

1***@qq.com (作者)

created() {
this.$scpoe.getgoodsinfo = this.getgoodsinfo
}, async getgoodsinfo(e) {
console.log(e, "eeeeee")
return new Promise(resolve => {
resolve({
minLimits: 1,
relationType: 1,
validation: {
phoneNumber: {
required: true // 手机号是否必填
},
reservationType: 2,
reservationCount: 2,
},
// 在 bind:getgoodsinfo 返回的 promise 的 resolve 函数中新增 marketingVersion 字段
marketingVersion: 2,
})
console.log(e, "商品222")
})

        },报错  ​ [Vue warn]: Error in created hook: "TypeError: Cannot set properties of undefined (setting 'getgoodsinfo')"    created() {  
    this.$scpoe.getgoodsinfo = this.getgoodsinfo      
    },     errMsg: "getGoodsInfo should be object, but got undefined"     

4***@qq.com

4***@qq.com - 12

老哥请问解决了吗?

4***@qq.com

4***@qq.com - 12

请问现在这个问题的正确解决方法是什么啊

1***@qq.com

1***@qq.com

你好这个问题解决了吗,找了好多方法都不好使

要回复问题请先登录注册