1、修复一个群友Solver提出的关于体验性改善的问题
2、详情页增加加载动画效果 3、去除一些console.log
This commit is contained in:
parent
a685888a5b
commit
65f37e00b6
@ -29,6 +29,7 @@ Page({
|
||||
// 页面显示
|
||||
this.getCartList();
|
||||
this.getCartNum();
|
||||
wx.removeStorageSync('categoryId');
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
wx.showNavigationBarLoading()
|
||||
|
||||
@ -88,7 +88,12 @@ Page({
|
||||
},
|
||||
onShow: function() {
|
||||
this.getChannelShowInfo();
|
||||
let id = this.data.nowId;
|
||||
let nowId = wx.getStorageSync('categoryId');
|
||||
if(id == 0 && nowId === 0){
|
||||
return false
|
||||
}
|
||||
else if (nowId == 0 && nowId === '') {
|
||||
this.setData({
|
||||
list: [],
|
||||
allPage: 1,
|
||||
@ -96,19 +101,28 @@ Page({
|
||||
size: 8,
|
||||
loading: 1
|
||||
})
|
||||
if (nowId == 0 || nowId == undefined) {
|
||||
this.getCurrentList(0);
|
||||
this.setData({
|
||||
nowId: 0,
|
||||
currentCategory: {}
|
||||
})
|
||||
} else {
|
||||
wx.setStorageSync('categoryId', 0)
|
||||
} else if(id != nowId) {
|
||||
this.setData({
|
||||
list: [],
|
||||
allPage: 1,
|
||||
allCount: 0,
|
||||
size: 8,
|
||||
loading: 1
|
||||
})
|
||||
this.getCurrentList(nowId);
|
||||
this.getCurrentCategory(nowId);
|
||||
this.setData({
|
||||
nowId: nowId
|
||||
})
|
||||
wx.setStorageSync('categoryId', nowId)
|
||||
}
|
||||
|
||||
this.getCatalog();
|
||||
},
|
||||
switchCate: function(e) {
|
||||
@ -129,11 +143,12 @@ Page({
|
||||
this.setData({
|
||||
currentCategory: {}
|
||||
})
|
||||
wx.removeStorageSync('categoryId');
|
||||
} else {
|
||||
wx.setStorageSync('categoryId', id)
|
||||
this.getCurrentList(id);
|
||||
this.getCurrentCategory(id);
|
||||
}
|
||||
wx.setStorageSync('categoryId', id)
|
||||
this.setData({
|
||||
nowId: id
|
||||
})
|
||||
|
||||
@ -115,9 +115,6 @@ Page({
|
||||
},
|
||||
getGoodsInfo: function() {
|
||||
let that = this;
|
||||
wx.showLoading({
|
||||
title: '加载中...',
|
||||
});
|
||||
util.request(api.GoodsDetail, {
|
||||
id: that.data.id
|
||||
}).then(function(res) {
|
||||
@ -147,10 +144,10 @@ Page({
|
||||
productList: res.data.productList,
|
||||
checkedSpecPrice: res.data.info.retail_price,
|
||||
galleryImages: galleryImages,
|
||||
loading:1
|
||||
});
|
||||
wx.setStorageSync('goodsImage', res.data.info.https_pic_url);
|
||||
}
|
||||
wx.hideLoading();
|
||||
});
|
||||
},
|
||||
clickSkuValue: function(event) {
|
||||
@ -328,6 +325,8 @@ Page({
|
||||
},
|
||||
onShow: function() {
|
||||
let userInfo = wx.getStorageSync('userInfo');
|
||||
let info = wx.getSystemInfoSync();
|
||||
let sysHeight = info.windowHeight - 100;
|
||||
let userId = userInfo.id;
|
||||
if (userId > 0) {
|
||||
this.setData({
|
||||
@ -335,9 +334,9 @@ Page({
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
priceChecked: false
|
||||
priceChecked: false,
|
||||
sysHeight: sysHeight
|
||||
})
|
||||
|
||||
this.getGoodsInfo();
|
||||
this.getCartCount();
|
||||
},
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<wxs module="filters" src="../../utils/fixed.wxs"></wxs>
|
||||
<view class="container">
|
||||
<view class="container" wx:if="{{loading == 1}}">
|
||||
<view class='banner-wrap'>
|
||||
<view class='current-item' wx:if="{{gallery.length > 0}}">
|
||||
<view class='in-item'>
|
||||
@ -168,3 +168,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="loading" style="height:{{sysHeight}}px" wx:else>
|
||||
<image class="img" src="http://lucky-icon.meiweiyuxian.com/hio/loading2.gif"></image>
|
||||
<view class="text">海风吹啊吹</view>
|
||||
</view>
|
||||
@ -14,6 +14,29 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.loading {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.loading .img {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
}
|
||||
|
||||
.loading .text {
|
||||
margin-top: 20rpx;
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* banner start */
|
||||
|
||||
.banner-wrap {
|
||||
|
||||
@ -87,11 +87,11 @@ Page({
|
||||
});
|
||||
};
|
||||
let info = wx.getSystemInfoSync();
|
||||
let system = info.system;
|
||||
let sysHeight = info.windowHeight - 100;
|
||||
this.setData({
|
||||
sysHeight: sysHeight
|
||||
})
|
||||
});
|
||||
wx.removeStorageSync('categoryId');
|
||||
},
|
||||
getCartNum: function() {
|
||||
util.request(api.CartGoodsCount).then(function(res) {
|
||||
|
||||
@ -99,5 +99,5 @@
|
||||
</view>
|
||||
<view class="loading" style="height:{{sysHeight}}px" wx:else>
|
||||
<image class="img" src="http://lucky-icon.meiweiyuxian.com/hio/loading2.gif"></image>
|
||||
<view class="text">努力加载中</view>
|
||||
<view class="text">海风吹啊吹</view>
|
||||
</view>
|
||||
@ -141,7 +141,7 @@ Page({
|
||||
actualPrice: actualPrice,
|
||||
offlinePay:0
|
||||
}, 'POST').then(res => {
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
if (res.errno === 0) {
|
||||
wx.removeStorageSync('orderId');
|
||||
wx.setStorageSync('addressId', 0);
|
||||
@ -162,7 +162,6 @@ Page({
|
||||
},
|
||||
offlineOrder: function (e) {
|
||||
let formId = e.detail.formId;
|
||||
console.log(e)
|
||||
let offlinePay = e.currentTarget.dataset.off;
|
||||
if (this.data.addressId <= 0) {
|
||||
util.showErrorToast('请选择收货地址');
|
||||
@ -180,7 +179,6 @@ Page({
|
||||
actualPrice: actualPrice,
|
||||
offlinePay:offlinePay
|
||||
}, 'POST').then(res => {
|
||||
console.log(res);
|
||||
if (res.errno === 0) {
|
||||
wx.removeStorageSync('orderId');
|
||||
wx.setStorageSync('addressId', 0);
|
||||
|
||||
@ -60,7 +60,6 @@ Page({
|
||||
id: id
|
||||
}).then(function(res) {
|
||||
if (res.errno === 0) {
|
||||
// console.log(res.data);
|
||||
that.setData({
|
||||
goods: res.data,
|
||||
});
|
||||
|
||||
@ -76,6 +76,7 @@ Page({
|
||||
userInfo: userInfo,
|
||||
});
|
||||
this.getOrderInfo();
|
||||
wx.removeStorageSync('categoryId');
|
||||
},
|
||||
|
||||
onPullDownRefresh: function() {
|
||||
|
||||
@ -38,7 +38,6 @@ Page({
|
||||
that.getOrderList();
|
||||
that.getOrderInfo();
|
||||
}).catch(res => {
|
||||
console.log(res);
|
||||
util.showErrorToast(res.errmsg);
|
||||
});
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user