diff --git a/buyer/src/api/crowdfunding.js b/buyer/src/api/crowdfunding.js new file mode 100644 index 0000000000000000000000000000000000000000..3781802e92575398c05fe548c8a8b52d86f59a1b --- /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 6729128a5bf1e47a204bc4fdc9458cdf11ba822e..76f4ae3e83662dc4cf80bb89f14ec86b04ea5b79 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 f9b7705cdd377b8b62eec3bdf7ee9ae868a04049..7a6539de02a2ae06c88f9ed6cb59d00529d0de3a 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 0000000000000000000000000000000000000000..39d3221fff8afbb8bb7d38420c316cf5bfdd1682 --- /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 d90c54d0369ac929f0f7fba493f8bd34d93c26dd..1b733777213033f02def2c5a0152f79610014172 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 @@ 点此查看最新商品详情