From 1802cc0fa65deb86add2c81a925407cf3f6f9721 Mon Sep 17 00:00:00 2001 From: Andste Date: Sat, 13 Dec 2025 19:26:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E7=AD=BE?= =?UTF-8?q?=E5=88=B0=E5=92=8C=E4=BC=97=E7=AD=B9=E6=B4=BB=E5=8A=A8=E8=A2=AB?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/src/api/crowdfunding.js | 65 +++ buyer/src/views/-index/-search-bar.vue | 2 +- buyer/src/views/checkout/index.vue | 9 +- buyer/src/views/crowdfunding.vue | 308 +++++++++++++ buyer/src/views/goods/-goods-info.vue | 115 ++++- buyer/src/views/goods/-goods-prom-bar.vue | 22 +- buyer/src/views/goods/_id.vue | 35 +- manager-admin/src/api/crowdfunding.js | 90 ++++ manager-admin/src/lang/en.js | 4 + manager-admin/src/lang/zh.js | 4 + manager-admin/src/router/index.js | 11 +- .../promotions/crowdfunding-manage/form.vue | 414 ++++++++++++++++++ .../promotions/crowdfunding-manage/index.vue | 239 ++++++++++ 13 files changed, 1297 insertions(+), 21 deletions(-) create mode 100644 buyer/src/api/crowdfunding.js create mode 100644 buyer/src/views/crowdfunding.vue create mode 100644 manager-admin/src/api/crowdfunding.js create mode 100644 manager-admin/src/views/promotions/crowdfunding-manage/form.vue create mode 100644 manager-admin/src/views/promotions/crowdfunding-manage/index.vue diff --git a/buyer/src/api/crowdfunding.js b/buyer/src/api/crowdfunding.js new file mode 100644 index 0000000..3781802 --- /dev/null +++ b/buyer/src/api/crowdfunding.js @@ -0,0 +1,65 @@ +/** + * 众筹活动相关API + */ + +import request from '@/utils/request' + +/** + * 分页列表 + * @param params + */ +export function getList(params) { + return request({ + url: '/buyer/promotions/crowdfunding', + method: 'get', + params + }) +} + +/** + * 查询详情 + * @param id + */ +export function getDetail(id) { + return request({ + url: `/buyer/promotions/crowdfunding/${id}`, + method: 'get' + }) +} + +/** + * 立即购买 + * @param crowdfunding_id + * @param num + */ +export function buy(crowdfunding_id, num) { + return request({ + url: `/buyer/crowdfunding/buy`, + method: 'get', + params: { crowdfunding_id, num }, + needToken: true + }) +} + +/** + * 获取购物车 + */ +export function getCart() { + return request({ + url: `/buyer/crowdfunding/cart`, + method: 'get', + needToken: true + }) +} + +/** + * 提交订单 + */ +export function createTrade() { + return request({ + url: `/buyer/crowdfunding/trade`, + method: 'post', + needToken: true, + params: { client: 'PC' } + }) +} diff --git a/buyer/src/views/-index/-search-bar.vue b/buyer/src/views/-index/-search-bar.vue index 6729128..76f4ae3 100644 --- a/buyer/src/views/-index/-search-bar.vue +++ b/buyer/src/views/-index/-search-bar.vue @@ -71,7 +71,7 @@ export default { top: -160px; height: 60px; width: 100%; - z-index: 99; + z-index: 10000; transition: top 0.3s ease-out; background-color: #fff; &.show { diff --git a/buyer/src/views/checkout/index.vue b/buyer/src/views/checkout/index.vue index f9b7705..7a6539d 100644 --- a/buyer/src/views/checkout/index.vue +++ b/buyer/src/views/checkout/index.vue @@ -105,6 +105,7 @@ import Vue from 'vue' import * as CheckoutComponents from './components' import * as API_Trade from '@/api/trade' +import * as API_Crowdfunding from '@/api/crowdfunding' import { Input } from 'element-ui' import { mapGetters } from 'vuex' @@ -131,6 +132,8 @@ export default { selectedAddress: '', // 跳转过来的是立即购买还是购物车结算 way: this.$route.query.way || 'CART', + crowdfundingShowFlag: this.$route.query.crowdfundingShowFlag || false, + crowdfundingId: this.$route.query.crowdfundingId || null, // 是否为虚拟订单 isVirtualOrder: false, // 订单是否包含供应商货品 @@ -230,8 +233,9 @@ export default { order_way: this.addressType // 0- 个人下单 1-企业采购 } + const fun = this.crowdfundingShowFlag ? API_Crowdfunding.createTrade() : API_Trade.createTrade('PC', this.way) /** 先调用创建订单接口,再跳转到收银台 */ - API_Trade.createTrade(params).then(response => { + fun.then(response => { this.$store.dispatch('cart/getCartDataAction') this.$router.push({ path: '/checkout/cashier?trade_sn=' + response.trade_sn }) }).catch(error => { @@ -265,7 +269,8 @@ export default { }, /** 获取购物清单 */ GET_Inventories() { - API_Trade.getCarts('checked', this.way).then(response => { + const fun = this.crowdfundingShowFlag ? API_Crowdfunding.getCart() : API_Trade.getCarts('checked', this.way) + fun.then(response => { this.inventoryList = response.cart_list this.isVirtualOrder = response.cart_list.some(sku => { return sku.sku_list.some(goods => goods.goods_type === 'VIRTUAL') || sku.group_list.some(group => group.sku_list.some(goods => goods.goods_type === 'VIRTUAL')) diff --git a/buyer/src/views/crowdfunding.vue b/buyer/src/views/crowdfunding.vue new file mode 100644 index 0000000..39d3221 --- /dev/null +++ b/buyer/src/views/crowdfunding.vue @@ -0,0 +1,308 @@ + + + + + diff --git a/buyer/src/views/goods/-goods-info.vue b/buyer/src/views/goods/-goods-info.vue index d90c54d..1b73377 100644 --- a/buyer/src/views/goods/-goods-info.vue +++ b/buyer/src/views/goods/-goods-info.vue @@ -9,6 +9,31 @@
+
+ + + +
+
+
+ 已筹{{ crowdfundingDetail.already_price }}元, + 已筹商品数量{{ crowdfundingDetail.already_goods_count }} +
+
+
+ +
+
+
+ {{ crowdfundingDetail.already_people_count }}人支持 +
+
+
+
- +
@@ -97,7 +123,7 @@ @@ -144,7 +170,7 @@ 点此查看最新商品详情