【首页】

1. 拼团活动组件
pull/1/MERGE
YunaiV 2023-06-18 00:36:22 +08:00
parent 70fe080f57
commit 987e90f80a
5 changed files with 63 additions and 71 deletions

View File

@ -1,26 +1,18 @@
import request from "@/utils/request.js";
/**
*
*
* 所有活动接口 包括拼团砍价秒杀
*
*
*/
/**
* 拼团列表
*
*
*/
export function getCombinationList(data) {
return request.get('combination/list', data,{noAuth:true});
}
/**
* 拼团详情
*
*/
export function getCombinationDetail(id) {
return request.get('combination/detail/'+id);
}
/**
* 拼团 开团
*/
@ -35,13 +27,6 @@ export function postCombinationRemove(data) {
return request.post("combination/remove",data);
}
/**
* 拼团 更多拼团
*/
export function getCombinationMore(data) {
return request.get("combination/more",data,{noAuth:true});
}
/**
* 砍价列表
*/
@ -50,7 +35,7 @@ export function getBargainList(data) {
}
/**
*
*
* 砍价列表(已参与)
* @param object data
*/
@ -60,7 +45,7 @@ export function getBargainUserList(data){
/**
*
*
* 取消砍价
* @param int bargainId
*/
@ -105,7 +90,7 @@ export function postBargainHelpPrice(data) {
}
/**
* 砍价 砍价帮
* 砍价 砍价帮
*/
export function postBargainHelpList(params,data) {
return request.get("bargain/help/list?limit="+params.limit+"&page="+params.page, data,{});
@ -113,7 +98,7 @@ export function postBargainHelpList(params,data) {
/**
* 秒杀产品时间区间
*
*
*/
export function getSeckillIndexTime(){
return request.get('seckill/index',{},{noAuth:true});
@ -139,7 +124,7 @@ export function getSeckillDetail(id){
/**
* 砍价海报
* @param object data
*
*
*/
export function getBargainPoster(data){
return request.post('bargain/poster',data)
@ -148,7 +133,7 @@ export function getBargainPoster(data){
/**
* 拼团海报
* @param object data
*
*
*/
export function getCombinationPoster(data){
return request.post('combination/poster',data)
@ -217,4 +202,4 @@ export function bargainHeaderApi(){
*/
export function combinationHeaderApi(){
return request.get('combination/header');
}
}

View File

@ -1,5 +1,14 @@
import request from "@/utils/request.js";
// 获得拼团活动列表
export function getCombinationActivityList(count) {
return request.get("app-api/promotion/combination-activity/list", {
count
}, {
noAuth: true // TODO 芋艿:后续要做调整
});
}
// 获得拼团活动分页
export function getCombinationActivityPage(data) {
return request.get("app-api/promotion/combination-activity/page", data, {
@ -17,8 +26,9 @@ export function getCombinationActivity(id) {
}
// 获得最近 n 条拼团记录(团长发起的)
export function getHeadCombinationRecordList(status, count) {
export function getHeadCombinationRecordList(activityId, status, count) {
return request.get("app-api/promotion/combination-record/get-head-list", {
activityId,
status,
count
}, {

View File

@ -473,10 +473,10 @@
this.status = 0;
}
//
CombinationApi.getHeadCombinationRecordList(1).then(res => {
CombinationApi.getHeadCombinationRecordList(this.id, 1).then(res => {
this.runningRecords = res.data;
})
CombinationApi.getHeadCombinationRecordList(2).then(res => {
CombinationApi.getHeadCombinationRecordList(this.id, 2).then(res => {
this.successRecords = res.data;
})

View File

@ -527,7 +527,7 @@
* 更多拼团
*/
combinationMore: function() {
CombinationApi.getHeadCombinationRecordList(1, 9).then(res => {
CombinationApi.getHeadCombinationRecordList(undefined, 1, 9).then(res => {
this.storeCombinationHost = res.data;
}).catch(res => {
this.$util.Tips({

View File

@ -1,5 +1,5 @@
<template>
<view :class="{borderShow:isBorader}">
<view :class="{borderShow: false}">
<view class="combination" v-if="combinationList.length">
<view class="title acea-row row-between">
<view class="spike-bd">
@ -11,11 +11,13 @@
<i>···</i>
</span>
</view>
<text class="pic_count">{{assistUserCount}}人参与</text>
<text class="pic_count">{{ assistUserCount }}人参与</text>
</view>
</view>
<navigator url="/pages/activity/goods_combination/index" hover-class="none"
class="more acea-row row-center-wrapper">GO<text class="iconfont icon-xiangyou"></text></navigator>
class="more acea-row row-center-wrapper">
GO<text class="iconfont icon-xiangyou"></text>
</navigator>
</view>
<view class="conter acea-row">
<scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;"
@ -23,68 +25,63 @@
<view class="itemCon" v-for="(item, index) in combinationList" :key="index" @click="goDetail(item)">
<view class="item">
<view class="pictrue">
<image :src="item.image"></image>
<image :src="item.picUrl" />
</view>
<view class="text lines1">
<view class="name line1">{{item.title}}</view>
<view class="money">¥<text class="num">{{item.price}}</text></view>
<view class="y_money">¥{{item.otPrice}}</view>
<view class="name line1">{{ item.name }}</view>
<view class="money">¥<text class="num">{{ fen2yuan(item.combinationPrice) }}</text></view>
<view class="y_money">¥{{ fen2yuan(item.marketPrice) }}</view>
</view>
</view>
</view>
<!-- <navigator :url="`/pages/activity/goods_combination_details/index?id=${item.id}`" hover-class="none" class="item" v-for="(item, index) in combinationList" :key="index">
<view class="pictrue">
<image :src="item.image"></image>
</view>
<view class="text lines1">
<text class="money">¥<text class="num">{{item.price}}</text></text>
<text class="y_money">¥{{item.otPrice}}</text>
</view>
</navigator> -->
</scroll-view>
</view>
</view>
</view>
</template>
<script>
let app = getApp();
import {
getCombinationIndexApi
} from '@/api/activity.js';
export default {
let app = getApp();
import * as CombinationApi from '@/api/promotion/combination.js';
import * as Util from '@/utils/util.js';
export default {
name: 'b_combination',
data() {
return {
combinationList: [],
isBorader: false,
assistUserList: [],
assistUserCount: 0
combinationList: [], //
assistUserList: [], //
assistUserCount: 0 //
};
},
created() {
this.getCombinationList();
//
CombinationApi.getCombinationActivityList(6).then((res) => {
this.combinationList = res.data;
}).catch((res) => {
return this.$util.Tips({
title: res
});
})
//
CombinationApi.getCombinationSummary().then((res) => {
this.assistUserList = res.data.avatars;
this.assistUserCount = res.data.userCount;
}).catch((res) => {
return this.$util.Tips({
title: res
});
})
},
mounted() {},
methods: {
//
getCombinationList: function() {
let that = this;
getCombinationIndexApi().then(function(res) {
that.combinationList = res.data.productList;
that.assistUserList = res.data.avatarList;
that.assistUserCount = res.data.totalPeople;
}).catch((res) => {
return that.$util.Tips({
title: res
});
})
},
goDetail(item) {
uni.navigateTo({
url: `/pages/activity/goods_combination_details/index?id=${item.id}`
})
}
},
fen2yuan(price) {
return Util.fen2yuan(price)
}
}
}
</script>