this.$confirm 的.then 中执行 this 失败

  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
微信商城小程序WeiMall实现一个移动端小商城,项目持续更新...使用技术:Weui.wxss 、 ES6微信商城小程序WeiMall增删改查import ServiceBase from 'ServiceBase'class Service extends ServiceBase { constructor() { super() this.$$prefix = '' this.$$path = { wechatSignUp: '/index/wechatSignUp', wechatSignIn: '/index/wechatSignIn', decryptData: '/index/decryptData', signIn: '/index/signIn', signOut: '/index/signOut', data:'/index/data', detail: '/index/detail', add: '/index/add', del: '/index/del', update: '/index/update' } }wechatSignUp(params) { return this.postRequest(this.$$path.wechatSignUp, params) }wechatSignIn(params) { return this.postRequest(this.$$path.wechatSignIn, params) }wechatDecryptData(params) { return this.postRequest(this.$$path.decryptData, params) } signIn(params) { return this.postRequest(this.$$path.signIn, params) }signOut() { return this.postRequest(this.$$path.signOut) }//获取表格分页数据 getData(params) { return this.getRequest(this.$$path.data, params) }//获取单条数据 getDetail(params) { return this.getRequest(this.$$path.detail, params) }//新增数据 addData(params){ return this.postRequest(this.$$path.add, params) }//删除数据 delData(params) { return this.getRequest(this.$$path.del, params) }//更新数据 updateData(params) { return this.getRequest(this.$$path.update, params) }}export default Service //调用数据 App.HttpService.getData({ table:'banner', page:1 }).then(data=>{ if(data.code==0){ data.data.forEach(n => n.path = App.renderImage(n.img)); this.setData({ images: data.data }); }else{ this.showModal(data.message); } });//新增数据 App.HttpService.addData(params).then(data => { if (data.code == 0) { this.showToast(data.message) } });//更新数据 App.HttpService.updateData(params).then(data => { if (data.code == 0) { this.showToast(data.message); } });//删除数据 App.WxService.showModal({ title: '友情提示', content: '确定要删除这个地址吗?', }) .then(data => { if (data.confirm == 1) { App.HttpService.delData({ table: 'address', id: id }).then(() => App.WxService.navigate

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值