diff --git a/components/m-buy/goods.vue b/components/m-buy/goods.vue index 446433f..3c04fae 100644 --- a/components/m-buy/goods.vue +++ b/components/m-buy/goods.vue @@ -160,10 +160,10 @@ export default { buyMask: { type: Boolean, default: false, - }, - isGroup: { - type: Boolean, - default: false, + }, + isGroup: { + type: Boolean, + default: false, }, goodsDetail: { default: "", @@ -323,6 +323,10 @@ export default { formatSku(list) { // 格式化数据 let arr = [{}]; + + if(!Array.isArray(list)){ + return false + } list.forEach((item, index) => { item.specValues.forEach((spec, specIndex) => { let name = spec.specName; diff --git a/pages/product/shopPage.vue b/pages/product/shopPage.vue index 22e9c99..07f050c 100644 --- a/pages/product/shopPage.vue +++ b/pages/product/shopPage.vue @@ -64,7 +64,7 @@ -
{{ item.content.goodsName }}
+
{{ item.content.goodsName }}
¥{{ item.content.price | unitPrice }}
@@ -126,7 +126,7 @@ export default { }, watch: { current(val) { - val == 0 ? this.getGoodsData() : this.getCategoryData(); + val == 0 ? ()=>{ this.goodsList = []; this.getGoodsData()} : this.getCategoryData(); }, }, @@ -421,8 +421,7 @@ export default { color: #333; padding: 0 20rpx; margin-top: 20rpx; - line-height: 1.4em; - max-height: 2.8em; //height是line-height的整数倍,防止文字显示不全 + height: 80rpx; overflow: hidden; } .price { diff --git a/pages/promotion/point/pointList.vue b/pages/promotion/point/pointList.vue index bfa1ad9..59187b1 100644 --- a/pages/promotion/point/pointList.vue +++ b/pages/promotion/point/pointList.vue @@ -25,7 +25,7 @@ {{ item.goodsName }} {{ item.points }}积分 - ¥{{ item.price | unitPrice }} + ¥{{ item.originalPrice | unitPrice }} diff --git a/pages/tabbar/cart/cartList.vue b/pages/tabbar/cart/cartList.vue index e9eb0f3..525684a 100644 --- a/pages/tabbar/cart/cartList.vue +++ b/pages/tabbar/cart/cartList.vue @@ -333,7 +333,7 @@ export default { */ navigateToStore(val) { uni.navigateTo({ - url: "../product/shopPage?id=" + val.storeId, + url: "/pages/product/shopPage?id=" + val.storeId, }); }, @@ -396,6 +396,8 @@ export default { * 验证是否选中商品 */ whetherChecked() { + this.$options.filters.forceLogin() + let canBuy = false; this.cartDetail.cartList.forEach((item) => { if (item.checked) { diff --git a/utils/filters.js b/utils/filters.js index 46f0a9c..312ae57 100644 --- a/utils/filters.js +++ b/utils/filters.js @@ -105,6 +105,33 @@ export function isLogin(val) { } } +/** + * 验证是否登录如果没登录则去登录 + * @param {*} val + * @returns + */ + +export function forceLogin() { + let userInfo = storage.getUserInfo(); + if (!userInfo.id) { + // #ifdef MP-WEIXIN + + uni.navigateTo({ + url: "/pages/passport/wechatMPLogin", + }); + + // #endif + + // #ifndef MP-WEIXIN + + uni.navigateTo({ + url: "/pages/passport/login", + }); + + // #endif + } +} + /** * 获取当前加载的页面对象 * @param val @@ -168,7 +195,7 @@ export function orderStatusList(val) { PAID: "已付款", DELIVERED: "已发货", CANCELLED: "已取消", - COMPLETED:"已完成", + COMPLETED: "已完成", COMPLETE: "已完成", TAKE: "待核验", };