From b8e61cf7a0c2a1048319052f1eeb87df3c23d875 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 16 Jun 2023 22:43:16 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=8B=BC=E5=9B=A2=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E3=80=91=201.=20=E6=8E=A5=E5=85=A5=E6=8B=BC?= =?UTF-8?q?=E5=9B=A2=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/promotion/combination.js | 12 +- pages/activity/goods_combination/index.vue | 163 ++++++++++-------- .../goods_combination_status/index.vue | 123 ++++++------- 3 files changed, 150 insertions(+), 148 deletions(-) diff --git a/api/promotion/combination.js b/api/promotion/combination.js index 92b1b761..1426d9f1 100644 --- a/api/promotion/combination.js +++ b/api/promotion/combination.js @@ -1,5 +1,12 @@ import request from "@/utils/request.js"; +// 获得拼团活动分页 +export function getCombinationActivityPage(data) { + return request.get("app-api/promotion/combination-activity/page", data, { + noAuth: true // TODO 芋艿:后续要做调整 + }); +} + // 获得拼团活动明细 export function getCombinationActivity(id) { return request.get("app-api/promotion/combination-activity/get-detail", { @@ -10,9 +17,10 @@ export function getCombinationActivity(id) { } // 获得最近 n 条拼团记录(团长发起的) -export function getHeadCombinationRecordList(status) { +export function getHeadCombinationRecordList(status, count) { return request.get("app-api/promotion/combination-record/get-head-list", { - status + status, + count }, { noAuth: true // TODO 芋艿:后续要做调整 }); diff --git a/pages/activity/goods_combination/index.vue b/pages/activity/goods_combination/index.vue index 8de1ddcb..d1be99e4 100644 --- a/pages/activity/goods_combination/index.vue +++ b/pages/activity/goods_combination/index.vue @@ -6,7 +6,7 @@ - + @@ -20,7 +20,8 @@ - + + @@ -38,36 +39,35 @@ + - + - {{item.title}} - ¥{{item.otPrice}} + {{ item.name }} + ¥{{ fen2yuan(item.marketPrice) }} - {{item.price}} + {{ fen2yuan(item.combinationPrice) }} - {{item.people}}人团 + {{ item.userSize }}人团 去拼团 - - {{loadTitle}} + {{loadTitle}} - @@ -219,11 +238,11 @@ } } .activity_pic { - + .picture { display: inline-table; } - + .avatar { width: 38rpx; height: 38rpx; diff --git a/pages/activity/goods_combination_status/index.vue b/pages/activity/goods_combination_status/index.vue index 536fd770..7d53e547 100644 --- a/pages/activity/goods_combination_status/index.vue +++ b/pages/activity/goods_combination_status/index.vue @@ -99,11 +99,11 @@
- -
+ +
-
-
+
+
@@ -150,10 +150,7 @@ import { imageBase64 } from "@/api/public"; import { toLogin } from '@/libs/login.js'; import { mapGetters } from 'vuex'; - import { - postCombinationRemove, - getCombinationMore - } from '@/api/activity'; + import { postCombinationRemove } from '@/api/activity'; import * as ProductSpuApi from '@/api/product/spu.js'; import * as CombinationApi from '@/api/promotion/combination.js'; import * as Util from '@/utils/util.js'; @@ -209,10 +206,6 @@ // ========== 拼团推荐相关变量 ========== storeCombinationHost: [], // 拼团推荐 - limit: 10, - page: 1, - loading: false, // 是否加载中 - loadend: false, // 是否到底 // ========== 分销相关的变量 ========== qrcodeSize: 600, // 二维码的大小 @@ -257,10 +250,6 @@ // 加载拼团信息 this.getCombinationPink(); }, - // TODO 芋艿:还没搞好 - mounted: function() { - this.combinationMore(); - }, //#ifdef MP /** * 用户点击右上角分享 @@ -295,6 +284,9 @@ // 获得商品详情 this.getGoodsDetails(); }) + + // 加载更多拼团记录 + this.combinationMore(); }).catch(err => { this.$util.Tips({ title: err @@ -317,6 +309,23 @@ lookAll: function() { this.iShidden = !this.iShidden; }, + // 拼团取消 TODO 芋艿 + getCombinationRemove: function() { + var that = this; + postCombinationRemove({ + id: that.pinkId + }).then(res => { + that.$util.Tips({ + title: res.msg + }, { + tab: 3 + }); + }).catch(res => { + that.$util.Tips({ + title: res + }); + }); + }, // ========== 商品详情相关 ========== /** @@ -500,72 +509,31 @@ * 拼团详情 */ goDetail: function(id) { - this.pinkId = id; uni.navigateTo({ url: '/pages/activity/goods_combination_details/index?id=' + id }); }, - // TODO 芋艿: - - - // 分享关闭 - listenerActionClose: function() { - this.posters = false; - this.canvasStatus = false; - }, - // 更多拼团 - combinationMore: function() { - var that = this; - if (that.loadend) return; - if (that.loading) return; - var data = { - page: that.page, - limit: that.limit, - comId: that.pinkId - }; - this.loading = true - getCombinationMore(data) - .then(res => { - var storeCombinationHost = that.storeCombinationHost; - var limit = that.limit; - that.page++; - that.loadend = limit > res.data.length; - that.storeCombinationHost = storeCombinationHost.concat(res.data.list); - that.page = that.data.page; - that.loading = false; - }) - .catch(res => { - that.loading = false - that.$util.Tips({ - title: res - }); - }); - }, - - // 拼团列表 - goList: function() { - uni.navigateTo({ - url: '/pages/activity/goods_combination/index' - }); - }, - - // 拼团取消 - getCombinationRemove: function() { - var that = this; - postCombinationRemove({ - id: that.pinkId - }).then(res => { - that.$util.Tips({ - title: res.msg - }, { - tab: 3 - }); + // ========== 拼团推荐 ========== + /** + * 前往拼团列表 + */ + goList: function() { + uni.navigateTo({ + url: '/pages/activity/goods_combination/index' + }); + }, + /** + * 更多拼团 + */ + combinationMore: function() { + CombinationApi.getHeadCombinationRecordList(1, 9).then(res => { + this.storeCombinationHost = res.data; }).catch(res => { - that.$util.Tips({ + this.$util.Tips({ title: res }); - }); + }) }, // ========== 分销相关的方法 ========== @@ -688,6 +656,13 @@ }); //#endif }, + /** + * 分享关闭 + */ + listenerActionClose: function() { + this.posters = false; + this.canvasStatus = false; + }, fen2yuan(price) { return Util.fen2yuan(price)