diff --git a/api/goods/index.js b/api/goods/index.js
index ffe6ee8..904f6a0 100644
--- a/api/goods/index.js
+++ b/api/goods/index.js
@@ -92,5 +92,5 @@ export const editGoodsSeckillPrice = param => {
}
// 是否有货
export const getGoodsStock = param => {
- return request.get('goods/getGoodsStock', param)
+ return request.post('goods/getGoodsStock', param)
}
\ No newline at end of file
diff --git a/components/goods-sku-popup/index.vue b/components/goods-sku-popup/index.vue
index 9c28eb4..bd422d6 100644
--- a/components/goods-sku-popup/index.vue
+++ b/components/goods-sku-popup/index.vue
@@ -1,1381 +1,1455 @@
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
diff --git a/pages/cart/index.vue b/pages/cart/index.vue
index 56dd0d4..587290b 100644
--- a/pages/cart/index.vue
+++ b/pages/cart/index.vue
@@ -90,7 +90,7 @@
¥{{ item.line_price_min>0?Number(item.line_price_min):0.00 }}
-
+
@@ -139,7 +139,7 @@
¥{{ item.line_price_min>0?Number(item.line_price_min):0.00 }}
-
+
diff --git a/pages/goods/components/SkuPopup.vue b/pages/goods/components/SkuPopup.vue
index 9d9b438..0ccd367 100644
--- a/pages/goods/components/SkuPopup.vue
+++ b/pages/goods/components/SkuPopup.vue
@@ -16,6 +16,7 @@
} from '@/utils/color'
import * as CartApi from '@/api/cart'
import GoodsSkuPopup from '@/components/goods-sku-popup'
+ import * as GoodsApi from '@/api/goods'
export default {
components: {
@@ -37,7 +38,15 @@
goods: {
type: Object,
default: {}
- }
+ },
+ addressResult: {
+ type: Object,
+ default: {
+ province: '江苏省',
+ city: '南京市',
+ district: '玄武区'
+ }
+ },
},
data() {
return {
@@ -47,6 +56,7 @@
maxBuyNum: null,
selectSku: '',
shopNum: 1,
+ stockValue: '有货',
}
},
computed: {
@@ -184,9 +194,17 @@
},
selectedOld(e) {
this.selectSku = e
+ this.$emit('getSku', {
+ selectSku: this.selectSku,
+ shopNum: this.shopNum
+ })
},
numChange(e) {
this.shopNum = e
+ this.$emit('getSku', {
+ selectSku: this.selectSku,
+ shopNum: this.shopNum
+ })
},
// sku组件 开始-----------------------------------------------------------
openSkuPopup() {
@@ -194,17 +212,48 @@
},
closeSkuPopup() {
- this.$emit('getSku', {
- selectSku: this.selectSku,
- shopNum: this.shopNum
- })
// console.log("监听 - 关闭sku组件")
},
-
+ async getGoodsStockInfor(selectShop, type) {
+ let that = this;
+ let params = {
+ list: [{
+ goods_id: that.goods.goods_id,
+ num: that.selectNum
+ }],
+ province: that.addressResult ? that.addressResult.province : '江苏省',
+ city: that.addressResult ? that.addressResult.city : '南京市',
+ district: that.addressResult ? that.addressResult.district : '玄武区'
+ }
+ let {
+ status,
+ message,
+ data
+ } = await GoodsApi.getGoodsStock(params);
+ if (status == 200) {
+ that.stockValue = data[0].state
+ if (that.stockValue == '无货') {
+ uni.showToast({
+ icon: "none",
+ title: "该商品暂时无货"
+ })
+ } else {
+ if (type == 1) {
+ that.addCartInfor(selectShop)
+ } else {
+ that.buyNowInfor(selectShop)
+ }
+ }
+ }
+ },
// 加入购物车按钮
addCart(selectShop) {
- this.selectInfor = selectShop
const app = this
+ app.getGoodsStockInfor(selectShop, 1)
+ },
+ addCartInfor(selectShop) {
+ const app = this
+ app.selectInfor = selectShop
const {
goods_id,
goods_sku_id,
@@ -224,9 +273,13 @@
app.$emit('addCart', cartTotal)
})
},
-
// 立即购买
buyNow(selectShop) {
+ const app = this
+ app.getGoodsStockInfor(selectShop, 2)
+ },
+ buyNowInfor(selectShop) {
+ const app = this
this.selectInfor = selectShop
if (uni.getStorageSync("userInfo").user_type == 40) {
// 隐藏当前弹窗
@@ -244,7 +297,7 @@
})
// 隐藏当前弹窗
this.onChangeValue(false)
- }
+ },
}
}
diff --git a/pages/goods/components/setPrice.vue b/pages/goods/components/setPrice.vue
index dbc7382..e9221b5 100644
--- a/pages/goods/components/setPrice.vue
+++ b/pages/goods/components/setPrice.vue
@@ -11,20 +11,20 @@
placeholder="秒杀价格可低于成本价" />
- 秒杀区间:
-
-
- {{startTime?startTime:'起始时间'}}
-
- -
-
- {{endTime?endTime:'终止时间'}}
-
+ 开始时间:
+
+ {{startTime?startTime:'起始时间'}}
-
+
+ 秒杀时长:
+ /小时
+
+
秒杀限购:
-
+
@@ -44,8 +44,8 @@
-
+
-
-
\ No newline at end of file
+ }
+
+ .line {
+ width: 100%;
+ height: 0rpx;
+ opacity: 1;
+ border: 2rpx solid #F1F1F1;
+ }
+
+ .payType {
+ width: 694rpx;
+ height: 270rpx;
+ background: #FFFFFF;
+ border-radius: 10rpx 10rpx 10rpx 10rpx;
+ opacity: 1;
+ margin: 12rpx 0 0rpx 26rpx;
+ padding: 24rpx 26rpx 0;
+
+ .line {
+ margin-bottom: 24rpx;
+ }
+
+ .itemType {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 28rpx;
+
+ .payName {
+ display: flex;
+ align-items: center;
+ height: 42rpx;
+ font-size: 24rpx;
+ font-family: PingFang SC, PingFang SC;
+ font-weight: 400;
+ color: #000000;
+ line-height: 42rpx;
+
+ .payIcon {
+ width: 42rpx;
+ height: 42rpx;
+ margin-right: 16rpx;
+ }
+ }
+
+ .chose {
+ width: 34rpx;
+ height: 24rpx;
+ margin-right: 26rpx;
+ }
+ }
+ }
+
+ .footer {
+ width: 100%;
+ height: 120rpx;
+ position: fixed;
+ background-color: #FFF;
+ bottom: 0;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ z-index: 22;
+
+ .meetPrice {
+ margin-left: 26rpx;
+ font-size: 24rpx;
+ font-family: PingFang SC, PingFang SC;
+ font-weight: 400;
+ color: #000000;
+
+ .type {
+ font-size: 24rpx;
+ font-family: PingFang SC, PingFang SC;
+ font-weight: 400;
+ color: #F42B17;
+ margin-left: 12rpx;
+ }
+
+ .price {
+ font-size: 40rpx;
+ font-family: PingFang SC, PingFang SC;
+ font-weight: 600;
+ color: #F42B17;
+ }
+ }
+
+ .btn {
+ width: 214rpx;
+ height: 74rpx;
+ background: linear-gradient(180deg, #FD5D06 0%, #F3211A 100%);
+ border-radius: 100rpx 100rpx 100rpx 100rpx;
+ opacity: 1;
+ text-align: center;
+ font-size: 28rpx;
+ font-family: PingFang SC, PingFang SC;
+ font-weight: 500;
+ color: #FFFFFF;
+ line-height: 74rpx;
+ margin-right: 20rpx;
+ }
+
+
+ }
+