修改部分已发现的bug

master
lemon橪 2021-12-24 09:12:21 +08:00
parent 896749d812
commit 3a2202a2e8
5 changed files with 43 additions and 11 deletions

View File

@ -323,6 +323,10 @@ export default {
formatSku(list) { formatSku(list) {
// //
let arr = [{}]; let arr = [{}];
if(!Array.isArray(list)){
return false
}
list.forEach((item, index) => { list.forEach((item, index) => {
item.specValues.forEach((spec, specIndex) => { item.specValues.forEach((spec, specIndex) => {
let name = spec.specName; let name = spec.specName;

View File

@ -64,7 +64,7 @@
<u-image width="100%" height="330rpx" mode="aspectFit" :src="item.content.thumbnail"> <u-image width="100%" height="330rpx" mode="aspectFit" :src="item.content.thumbnail">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
</u-image> </u-image>
<div class="name">{{ item.content.goodsName }}</div> <div class="name wes-2">{{ item.content.goodsName }}</div>
<div class="price"> <div class="price">
<div>{{ item.content.price | unitPrice }}</div> <div>{{ item.content.price | unitPrice }}</div>
</div> </div>
@ -126,7 +126,7 @@ export default {
}, },
watch: { watch: {
current(val) { current(val) {
val == 0 ? this.getGoodsData() : this.getCategoryData(); val == 0 ? ()=>{ this.goodsList = []; this.getGoodsData()} : this.getCategoryData();
}, },
}, },
@ -421,8 +421,7 @@ export default {
color: #333; color: #333;
padding: 0 20rpx; padding: 0 20rpx;
margin-top: 20rpx; margin-top: 20rpx;
line-height: 1.4em; height: 80rpx;
max-height: 2.8em; //heightline-height
overflow: hidden; overflow: hidden;
} }
.price { .price {

View File

@ -25,7 +25,7 @@
<view class="index-item-title">{{ item.goodsName }}</view> <view class="index-item-title">{{ item.goodsName }}</view>
<view class="index-item-price"> <view class="index-item-price">
{{ item.points }}积分 {{ item.points }}积分
<span class="tipsMkt">¥{{ item.price | unitPrice }}</span> <span class="tipsMkt">¥{{ item.originalPrice | unitPrice }}</span>
</view> </view>
</view> </view>
</view> </view>

View File

@ -333,7 +333,7 @@ export default {
*/ */
navigateToStore(val) { navigateToStore(val) {
uni.navigateTo({ uni.navigateTo({
url: "../product/shopPage?id=" + val.storeId, url: "/pages/product/shopPage?id=" + val.storeId,
}); });
}, },
@ -396,6 +396,8 @@ export default {
* 验证是否选中商品 * 验证是否选中商品
*/ */
whetherChecked() { whetherChecked() {
this.$options.filters.forceLogin()
let canBuy = false; let canBuy = false;
this.cartDetail.cartList.forEach((item) => { this.cartDetail.cartList.forEach((item) => {
if (item.checked) { if (item.checked) {

View File

@ -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 * @param val
@ -168,7 +195,7 @@ export function orderStatusList(val) {
PAID: "已付款", PAID: "已付款",
DELIVERED: "已发货", DELIVERED: "已发货",
CANCELLED: "已取消", CANCELLED: "已取消",
COMPLETED:"已完成", COMPLETED: "已完成",
COMPLETE: "已完成", COMPLETE: "已完成",
TAKE: "待核验", TAKE: "待核验",
}; };