diff --git a/src/pages.json b/src/pages.json
index 123a016..6800ebc 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -1011,6 +1011,12 @@
"style" : {
"navigationBarTitleText": "商品详情"
}
+ },
+ {
+ "path": "pages/classify",
+ "style" : {
+ "navigationBarTitleText": "商品分类"
+ }
}
]
}
diff --git a/src/subpackage/mall/components/index_classify_bar.vue b/src/subpackage/mall/components/index_classify_bar.vue
index 2e2396a..1590882 100644
--- a/src/subpackage/mall/components/index_classify_bar.vue
+++ b/src/subpackage/mall/components/index_classify_bar.vue
@@ -12,7 +12,7 @@
-
+
分类
diff --git a/src/subpackage/mall/components/index_search_bar.vue b/src/subpackage/mall/components/index_search_bar.vue
index ecf7947..bbdb18f 100644
--- a/src/subpackage/mall/components/index_search_bar.vue
+++ b/src/subpackage/mall/components/index_search_bar.vue
@@ -7,7 +7,7 @@
- 88
+ {{ cartNUmShow }}
@@ -18,6 +18,17 @@ export default {
shoppingCart: {
type: Boolean,
default: false
+ },
+ cartNum: {
+ type: Number,
+ default: 0
+ }
+ },
+ computed: {
+ cartNUmShow(){
+ let { cartNum } = this;
+ if(!isNaN(cartNum))return cartNum > 99 ? 99 : cartNum;
+ return 0;
}
}
}
diff --git a/src/subpackage/mall/components/specification_modal.vue b/src/subpackage/mall/components/specification_modal.vue
index 549bc2e..ec86f91 100644
--- a/src/subpackage/mall/components/specification_modal.vue
+++ b/src/subpackage/mall/components/specification_modal.vue
@@ -117,6 +117,7 @@ export default {
* @param {Array} specArr[].value 规格值
* @param {Boolean} onlyGet 是否只获取选择数据
* @param {Function} success 回调函数
+ * @param {Function} addCartComplete 回调函数
}
}
*/
@@ -166,6 +167,7 @@ export default {
setTimeout(_=>{
this.hide();
this.resetData();
+ initData?.addCartComplete?.();
}, 1000);
}, 300, true),
diff --git a/src/subpackage/mall/js/api.js b/src/subpackage/mall/js/api.js
index 6ed1d8d..2007d32 100644
--- a/src/subpackage/mall/js/api.js
+++ b/src/subpackage/mall/js/api.js
@@ -8,6 +8,8 @@ export const MALL_API = {
homeGoodsBuy:`${ORIGIN}/shop2/homeGoodsBuy`, //商品详情 - 立即购买
goodsCartList:`${ORIGIN}/shop2/goodsCartList`, //购物车 - 商品列表
goodsComment:`${ORIGIN}/shop2/goodsComment`, //商品评价列表
+ goodsList:`${ORIGIN}/shop2/goodsList`, //商品列表
+ goodsCateList:`${ORIGIN}/shop2/goodsCateList`, // 商品分类列表
}
export default { ORIGIN, MALL_API };
\ No newline at end of file
diff --git a/src/subpackage/mall/js/handle.js b/src/subpackage/mall/js/handle.js
new file mode 100644
index 0000000..1c6013a
--- /dev/null
+++ b/src/subpackage/mall/js/handle.js
@@ -0,0 +1,25 @@
+import { MALL_API } from "./api";
+import server from "./server";
+
+// 购物车商品列表
+export function goodsCartList(brand_id){
+ return server.post({
+ url: MALL_API.goodsCartList,
+ data: { brand_id },
+ isDefaultGet: false,
+ })
+ .then(res => {
+ let _data = res?.data || {};
+ if(_data.code === 0){
+ let _ls = _data?.data ?? [];
+ //product_invalid 商品状态 0-正常 1-已失效
+ return ({
+ totalList: _ls,
+ validList: _ls.filter(item => item.product_invalid === 0),
+ invalidList: _ls.filter(item => item.product_invalid === 0),
+ });
+ }else{
+ return Promise.reject(_data);
+ }
+ })
+}
\ No newline at end of file
diff --git a/src/subpackage/mall/pages/classify.vue b/src/subpackage/mall/pages/classify.vue
new file mode 100644
index 0000000..21b8ec3
--- /dev/null
+++ b/src/subpackage/mall/pages/classify.vue
@@ -0,0 +1,441 @@
+
+
+
+
+
+
+
+
+ ❤️猜你喜欢
+
+ {{ e.product_cate_name || '-' }}
+
+
+
+
+
+
+
+ {{ e.name }}
+
+
+
+
+
+
+
+
+
+
+ {{e.product_name || ''}}
+ {{e.product_text || ''}}
+
+
+
+
+ ¥
+ {{e.product_price || 0}}
+
+ {{''}}
+ ¥{{e.product_price_show || 0}}
+
+
+
+
+
+
+ 我是有底线的~
+
+
+
+
+
+
+
+
+
+
diff --git a/src/subpackage/mall/pages/goods_info.vue b/src/subpackage/mall/pages/goods_info.vue
index faed8cb..f03ace6 100644
--- a/src/subpackage/mall/pages/goods_info.vue
+++ b/src/subpackage/mall/pages/goods_info.vue
@@ -138,6 +138,7 @@ import specificationModal from "../components/specification_modal.vue";
import appraiseItem from "../components/appraise_item.vue";
import { MALL_API } from "../js/api";
import server from "../js/server";
+import { goodsCartList } from "../js/handle";
export default {
components: {
serviceModal,
@@ -351,7 +352,6 @@ export default {
hideLoad();
let _data = res?.data || {};
if(_data.code === 0){
- console.log('subpackage mall pages goods_info getGoodsInfo res --->', _data);
return this.goodsInfo = _data?.data ?? {};
}else{
return Promise.reject(_data);
@@ -359,10 +359,7 @@ export default {
})
.catch(err => {
hideLoad();
- showModal({
- title: '提示',
- content: err.message || '加载失败!'
- })
+ showModal({ content: err.message || '加载失败!' });
console.warn('subpackage mall pages goods_info getGoodsInfo err --->', err);
})
},
@@ -394,29 +391,14 @@ export default {
})
},
// 购物车商品列表
- goodsCartList({ brand_id }){
- return server.post({
- url: MALL_API.goodsCartList,
- data: { brand_id },
- isDefaultGet: false,
- })
- .then(res => {
- let _data = res?.data || {};
- if(_data.code === 0){
- console.log('subpackage mall pages goods_info goodsCartList res --->', _data);
- let _ls = _data?.data ?? [];
- //product_invalid 商品状态 0-正常 1-已失效
- let validLs = _ls.filter(item => item.product_invalid === 0);
- let _length = validLs?.length ?? 0;
- this.goodsCartNum = _length > 100 ? 99 : _length;
- return _ls;
- }else{
- return Promise.reject(_data);
- }
- })
- .catch(err => {
+ async goodsCartList({ brand_id }){
+ try{
+ let { validList } = await goodsCartList(brand_id);
+ let _length = validList?.length ?? 0;
+ this.goodsCartNum = _length > 100 ? 99 : _length;
+ }catch(err){
console.warn('subpackage mall pages goods_info goodsCartList err --->', err);
- })
+ }
},
/**
* 获取商品评价列表
diff --git a/src/subpackage/mall/pages/index.vue b/src/subpackage/mall/pages/index.vue
index 3446f71..443b3f8 100644
--- a/src/subpackage/mall/pages/index.vue
+++ b/src/subpackage/mall/pages/index.vue
@@ -48,6 +48,7 @@
@@ -118,6 +119,10 @@ export default {
this.getHomeData({ brand_id: _bid });
},
methods: {
+ toClassify(){
+ let { brand_id } = this;
+ routeTo(`/subpackage/mall/pages/classify?brand_id=${brand_id}`,'nT');
+ },
getGridLsFor(key){
let { showdata } = this;
return showdata?.[key]?.grid_setting ?? [];
@@ -149,11 +154,6 @@ export default {
// 如果商品是多个规格属性的,则出现弹窗给用户选择规格加入购物车,如果是单规格的则直接加入购物车
// 根据product_spec_multi字段做判断 等于1则是多规格
if(e.product_spec_multi == 1){
- // e.product_spec.push({
- // id: 3,
- // name: 'test',
- // value: ['test1', 'test2', 'test3']
- // })
this.$refs.spacificationModal.alert({
id: e?.id ?? '',
brand_id: brand_id,
@@ -166,8 +166,6 @@ export default {
}
this.$refs?.spacificationModal?.goodsCartAdd({ brand_id, id: e?.id, });
-
-
},
// 是否展示模块
isShow(val) {
diff --git a/src/subpackage/mall/static/images/arrow_094.png b/src/subpackage/mall/static/images/arrow_094.png
new file mode 100644
index 0000000..afa3794
Binary files /dev/null and b/src/subpackage/mall/static/images/arrow_094.png differ
diff --git a/src/subpackage/mall/static/images/arrow_9ad_down.png b/src/subpackage/mall/static/images/arrow_9ad_down.png
new file mode 100644
index 0000000..174c72e
Binary files /dev/null and b/src/subpackage/mall/static/images/arrow_9ad_down.png differ