| | |
| | | this.$message.showLoading() |
| | | const { |
| | | data |
| | | } = await this.$http.request('get', '/api/pub/announcement/page/view?id=' + this.id, { |
| | | } = await this.$http.request('get', '/api/customer/point/goods/list/view?id=' + this.id, { |
| | | |
| | | }) |
| | | this.$message.hideLoading() |
| | |
| | | methods: { |
| | | isIngood(item) { |
| | | for (var tmp of this.cache_goods) { |
| | | if (tmp.id == item.id) { |
| | | if (tmp.goodsId == item.goodsId) { |
| | | return true |
| | | } |
| | | } |
| | |
| | | async updateSelectGood(item) { |
| | | var has = false |
| | | for (var tmp of this.cache_goods) { |
| | | if (tmp.id == item.id) { |
| | | if (tmp.goodsId == item.goodsId) { |
| | | has = true |
| | | break |
| | | } |
| | |
| | | //移除 |
| | | var arr = [] |
| | | for (var tmp of this.cache_goods) { |
| | | if (tmp.id == item.id) {} else { |
| | | if (tmp.goodsId == item.goodsId) {} else { |
| | | arr.push(tmp) |
| | | } |
| | | } |
| | |
| | | } |
| | | arr.push(item) |
| | | } |
| | | await this.$store.dispatch('cache_coupon_select', arr) |
| | | await this.$store.dispatch('cache_goods_select', arr) |
| | | this.$forceUpdate() |
| | | |
| | | }, |
| | |
| | | }, |
| | | getPointGood(item) { |
| | | uni.navigateTo({ |
| | | url: `/sub_pages/customer/coupon/good-detail?id=${item.id}` |
| | | url: `/sub_pages/customer/coupon/good-detail?id=${item.goodsId}` |
| | | }) |
| | | }, |
| | | toGoodAll() { |
| | |
| | | this.dto.couponRecordStr = this.cache_coupon.couponName |
| | | } |
| | | //兑换券 |
| | | this.dto.couponRecordStr = '' |
| | | this.dto.goodsRecordIdListStr = '' |
| | | if (this.cache_goods && this.cache_goods.length > 0) { |
| | | this.dto.couponRecordStr = '' |
| | | this.dto.goodsRecordIdListStr = '' |
| | | var names = [] |
| | | for (var tmp of this.cache_goods) { |
| | | names.push(tmp.name || tmp.title || '') |
| | | } |
| | | this.dto.couponRecordStr = names.join(',') |
| | | this.dto.goodsRecordIdListStr = names.join(',') |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | |
| | | return |
| | | } |
| | | this.dto.addressId = this.address.id |
| | | var goodsRecordIds = [] |
| | | if (this.dto.goodsRecordIdListStr) { |
| | | for (var t of this.cache_goods) { |
| | | t.push(t.goodsId) |
| | | } |
| | | } |
| | | |
| | | let tmp = this |
| | | wx.login({ |
| | |
| | | } = await tmp.$http.request('post', '/api/customer/flower/order/commit', { |
| | | data: { |
| | | ...tmp.dto, |
| | | wxcode: res.code |
| | | wxcode: res.code, |
| | | goodsRecordIdList: goodsRecordIds |
| | | } |
| | | }) |
| | | tmp.$message.hideLoading() |