123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- import {
- get,
- post
- } from "../../../utils/http"
- Page({
-
- data: {
- GroupOrderList: '',
- userGroupId: '',
- store_id: '',
- original_price: '',
- goods_id: '',
- source: '',
- grouping_id: '',
- groupID: '',
- },
-
- onLoad(options) {
- console.log(options);
- this.setData({
- store_id: wx.getStorageSync('store_id'),
- goods_id: options.goods_id,
- original_price: options.original_price,
- source: options.source,
- grouping_id: options.grouping_id,
- groupID: options.groupID
- })
-
- this.getGroupOrderDetail()
- },
-
- onReady() {
- },
-
- onShow() {
- },
-
- onHide() {
- },
-
- onUnload() {
- },
-
- onPullDownRefresh() {
- },
-
- onReachBottom() {
- },
-
- onShareAppMessage(res) {
- if (res.from == 'button') {
- console.log(res.target, res)
- }
- return {
- title: this.data.GroupOrderList.share_text,
- path: `/subPackagesB/pages/groupDetail/groupDetail?isShare=true&&id=${this.data.groupID}&&grouping_id=${this.data.grouping_id}`,
- imageUrl: this.data.GroupOrderList.share_image
- }
- },
-
- getGroupOrderDetail() {
- get('v2/api/grouping/log_info', {
- id: this.data.grouping_id
- }, (res) => {
- if (res.code == 200) {
- console.log(res);
- this.setData({
- GroupOrderList: res.data,
- userGroupId: res.data.id
- })
- }
- })
- },
-
- cancelGroup() {
- let that = this
- post('v2/api/grouping/cancel', {
- id: that.data.grouping_id
- }, (res) => {
- wx.showToast({
- title: '取消成功',
- success: setTimeout(function () {
- wx.redirectTo({
- url: `/subPackagesB/pages/GroupConfirm/GroupConfirm?store_id=${that.data.store_id}&&productId=${that.data.goods_id}&&source=${that.data.source}&&groupPrice=${that.data.original_price}&&isGrouping=false`,
- })
- },2000)
- })
- })
- }
- })
|