From 3a2202a2e8f2d9cf2ced1056a25edd4941031d7e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com>
Date: Fri, 24 Dec 2021 09:12:21 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E5=B7=B2?=
=?UTF-8?q?=E5=8F=91=E7=8E=B0=E7=9A=84bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/m-buy/goods.vue | 12 ++++++++----
pages/product/shopPage.vue | 7 +++----
pages/promotion/point/pointList.vue | 2 +-
pages/tabbar/cart/cartList.vue | 4 +++-
utils/filters.js | 29 ++++++++++++++++++++++++++++-
5 files changed, 43 insertions(+), 11 deletions(-)
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: "待核验",
};