| | |
| | | } |
| | | app.MG.ugc.newTopicMessage(query).then((res) => { |
| | | wx.showToast({ |
| | | icon: "error", |
| | | title: "请上传资源文件", |
| | | icon: "success", |
| | | title: "上传成功", |
| | | }); |
| | | this.closeDialog() |
| | | }) |
| | |
| | | padding: 10rpx !important; |
| | | } |
| | | |
| | | .t-input__content, |
| | | .t-textarea { |
| | | .info-center .t-input__content, |
| | | info-center .t-textarea { |
| | | border: 2rpx solid #D9D9D9 !important; |
| | | border-radius: 15rpx; |
| | | padding: 10rpx !important; |
| | |
| | | orderNum: this.data.orderGoods |
| | | } |
| | | app.MG.store.confirmOrder(query).then(res => { |
| | | Toast({ |
| | | context: this, |
| | | selector: '#t-toast', |
| | | message: '领取成功', |
| | | theme: 'success', |
| | | direction: 'column', |
| | | wx.showToast({ |
| | | title: '领取成功', |
| | | icon: 'success', |
| | | complete: res => { |
| | | setTimeout(() => { |
| | | wx.navigateBack() |
| | | }, 1000); |
| | | } |
| | | }); |
| | | wx.navigateBack() |
| | | |
| | | }) |
| | | } |
| | | }) |
| | |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | res.datas.forEach((item) => { |
| | | item.price = item.price ? item.price.toFixed(2) : item.price; |
| | | item.isbuy = item.purchasedSaleMethodIdList.indexOf(item.defaultSaleMethodId) > -1 |
| | | }); |
| | | this.setData({ |
| | | courseList: res.datas |
| | |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | res.datas.forEach((item) => { |
| | | item.price = item.price ? item.price.toFixed(2) : item.price; |
| | | item.isbuy = item.purchasedSaleMethodIdList.indexOf(item.defaultSaleMethodId) > -1 |
| | | }); |
| | | this.setData({ |
| | | textbookList: res.datas |
| | |
| | | info |
| | | } = e.currentTarget.dataset; |
| | | if (wx.getStorageSync(app.config.tokenKey)) { |
| | | let query = { |
| | | start: 0, |
| | | size: 999, |
| | | filterList: [], |
| | | searchList: [] |
| | | } |
| | | try { |
| | | if ( |
| | | this.data.shoppingCartGetId.includes( |
| | | info.defaultSaleMethodId |
| | | ) |
| | | ) { |
| | | wx.showToast({ |
| | | title: "该商品已在购物车,请勿重复添加", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | } else { |
| | | let query = { |
| | | requests: [{ |
| | | saleMethodId: info.defaultSaleMethodId, |
| | | storeEventId: null, |
| | | agentCode: '电子书' |
| | | }] |
| | | } |
| | | const addRes = await app.MG.store.addShoppingCart(query) |
| | | if (addRes) { |
| | | if (info.isbuy) { |
| | | wx.showToast({ |
| | | title: "该商品已购买", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | } else { |
| | | let query = { |
| | | start: 0, |
| | | size: 999, |
| | | filterList: [], |
| | | searchList: [] |
| | | } |
| | | try { |
| | | if ( |
| | | this.data.shoppingCartGetId.includes( |
| | | info.defaultSaleMethodId |
| | | ) |
| | | ) { |
| | | wx.showToast({ |
| | | title: "添加成功", |
| | | icon: 'success', |
| | | title: "该商品已在购物车,请勿重复添加", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | } else { |
| | | let query = { |
| | | requests: [{ |
| | | saleMethodId: info.defaultSaleMethodId, |
| | | storeEventId: null, |
| | | agentCode: '电子书' |
| | | }] |
| | | } |
| | | const addRes = await app.MG.store.addShoppingCart(query) |
| | | if (addRes) { |
| | | wx.showToast({ |
| | | title: "添加成功", |
| | | icon: 'success', |
| | | duration: 1000 |
| | | }) |
| | | } |
| | | this.getShoppingCartList() |
| | | } |
| | | this.getShoppingCartList() |
| | | |
| | | } catch (error) { |
| | | console.error('出错了:', error) |
| | | } |
| | | } catch (error) { |
| | | console.error('出错了:', error) |
| | | } |
| | | } |
| | | |
| | | }, |
| | | onMoreGuide(e) { |
| | | let type = e.currentTarget.dataset.info |