diff --git a/src/subpackage/mall/components/appraise_item.vue b/src/subpackage/mall/components/appraise_item.vue
new file mode 100644
index 0000000..aefc6e0
--- /dev/null
+++ b/src/subpackage/mall/components/appraise_item.vue
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+ {{ name || '-' }}
+
+
+ {{ getLevelTxt }}
+
+
+
+ {{ time || '-' }}
+
+ {{ appraise || '' }}
+
+
+
+
+
+
+
+
+
diff --git a/src/subpackage/mall/components/bottom_modal.vue b/src/subpackage/mall/components/bottom_modal.vue
index 0bf5c64..fc7b550 100644
--- a/src/subpackage/mall/components/bottom_modal.vue
+++ b/src/subpackage/mall/components/bottom_modal.vue
@@ -1,10 +1,10 @@
- false" v-show="show">
-
+ false" v-show="show" @click="$emit('click:mask')">
+ false">
{{ title }}
- 关闭
+ 关闭
diff --git a/src/subpackage/mall/components/goods_item.vue b/src/subpackage/mall/components/goods_item.vue
index c1c74ae..c9c0e18 100644
--- a/src/subpackage/mall/components/goods_item.vue
+++ b/src/subpackage/mall/components/goods_item.vue
@@ -24,7 +24,11 @@
import { routeTo } from '@/utils/util';
export default {
props: {
- id: {
+ productId: {
+ type: Number,
+ default: 0
+ },
+ brandId: {
type: Number,
default: 0
},
@@ -51,8 +55,8 @@ export default {
},
methods: {
itemClick(){
- let { id } = this;
- routeTo(`/subpackage/mall/pages/goods_info/goods_info?product_id=${id}`,'nT')
+ let { productId, brandId } = this;
+ routeTo(`/subpackage/mall/pages/goods_info?id=${productId}&brand_id=${brandId}`,'nT')
}
}
}
diff --git a/src/subpackage/mall/components/specification_modal.vue b/src/subpackage/mall/components/specification_modal.vue
index 767504b..549bc2e 100644
--- a/src/subpackage/mall/components/specification_modal.vue
+++ b/src/subpackage/mall/components/specification_modal.vue
@@ -36,7 +36,7 @@
购买数量
- 加入购物车
+ {{ buttonTxt }}
@@ -54,6 +54,12 @@ export default {
lineButton,
numberOperate
},
+ props: {
+ buttonTxt: {
+ type: String,
+ default: '确定'
+ }
+ },
computed: {
goodsSpecArr(){
let { initData } = this;
@@ -109,6 +115,10 @@ export default {
* @param {Number} specArr[].id 规格id
* @param {String} specArr[].name 规格名称
* @param {Array} specArr[].value 规格值
+ * @param {Boolean} onlyGet 是否只获取选择数据
+ * @param {Function} success 回调函数
+}
+}
*/
},
@@ -131,12 +141,21 @@ export default {
},
methods: {
// 加入购物车
- addCartBtn: debounce(async function() {
+ buttonClick: debounce(async function() {
let { goodsNum, initData, goodsSpecSelInfo, specSelectedArr, isCompleteSpecSelected } = this;
if(!isCompleteSpecSelected)return showNone('请选择规格!');
if(goodsNum == 0)return showNone('请选择购买数量!');
if(goodsSpecSelInfo === null)return showNone('库存加载失败,稍后重试!');
if(goodsSpecSelInfo?.nums < goodsNum)return showNone('库存不足!');
+ if(initData?.onlyGet){
+ let _selectInfo = {
+ nums: goodsNum,
+ spec_arr: specSelectedArr.map(item => item.val)
+ }
+ initData?.success?.(_selectInfo);
+ this.$emit('click:confirm')
+ return
+ }
await this.goodsCartAdd({
brand_id: initData?.brand_id || '',
id: initData?.id || '',
@@ -205,7 +224,7 @@ export default {
if(_data.code === 0){
console.log('subpackage mall components specification goodsCartAdd res --->', _data);
showNone('加入购物车成功~');
- return _data?.data;
+ return _data?.data ?? true;
}else{
return Promise.reject(_data);
}
diff --git a/src/subpackage/mall/js/api.js b/src/subpackage/mall/js/api.js
index 5de9aca..6ed1d8d 100644
--- a/src/subpackage/mall/js/api.js
+++ b/src/subpackage/mall/js/api.js
@@ -5,6 +5,9 @@ export const MALL_API = {
goodsCartAdd:`${ORIGIN}/shop2/goodsCartAdd`, //购物车 - 添加商品
goodsSpecSel:`${ORIGIN}/shop2/goodsSpecSel`, //商品规格选择【返回库存&价格】
goodsInfo:`${ORIGIN}/shop2/goodsInfo`, //商品详情
+ homeGoodsBuy:`${ORIGIN}/shop2/homeGoodsBuy`, //商品详情 - 立即购买
+ goodsCartList:`${ORIGIN}/shop2/goodsCartList`, //购物车 - 商品列表
+ goodsComment:`${ORIGIN}/shop2/goodsComment`, //商品评价列表
}
export default { ORIGIN, MALL_API };
\ No newline at end of file
diff --git a/src/subpackage/mall/pages/goods_info.vue b/src/subpackage/mall/pages/goods_info.vue
index 8c4bd58..faed8cb 100644
--- a/src/subpackage/mall/pages/goods_info.vue
+++ b/src/subpackage/mall/pages/goods_info.vue
@@ -3,7 +3,7 @@