diff --git a/mallplusui-uniapp-app/manifest.json b/mallplusui-uniapp-app/manifest.json index 2457c17..e81909a 100644 --- a/mallplusui-uniapp-app/manifest.json +++ b/mallplusui-uniapp-app/manifest.json @@ -2,8 +2,8 @@ "name" : "汇融云链", "appid" : "__UNI__FB2C9C4", "description" : "", - "versionName" : "1.0.0.9", - "versionCode" : 1009, + "versionName" : "1.0.1.0", + "versionCode" : 1010, "transformPx" : false, "app-plus" : { "usingComponents" : true, diff --git a/mallplusui-uniapp-app/pages.json b/mallplusui-uniapp-app/pages.json index aa29f05..83665a6 100644 --- a/mallplusui-uniapp-app/pages.json +++ b/mallplusui-uniapp-app/pages.json @@ -46,13 +46,13 @@ "navigationBarTitleText": "消息列表" } - }, + }, { "path": "pages/index/messageDetail", "style": { // "enablePullDownRefresh": true, "navigationBarTitleText": "消息详情" - + } }, { "path": "pages/search/search", @@ -210,7 +210,8 @@ "bounce": "none" } } - }, { + }, + { "path": "pages/order/createOrder", "style": { "navigationBarTitleText": "创建订单" @@ -705,11 +706,13 @@ "path": "user/collect", "style": { "navigationBarTitleText": "我的收藏", + "enablePullDownRefresh": true, + "onReachBottomDistance": 126, //距离底部多远时触发 单位px "app-plus": { "bounce": "none" } } - }, { + } ,{ "path": "user/deposit", "style": { "navigationBarTitleText": "余额冲", diff --git a/mallplusui-uniapp-app/pages/index/user.vue b/mallplusui-uniapp-app/pages/index/user.vue index 2b5801b..c4f5388 100644 --- a/mallplusui-uniapp-app/pages/index/user.vue +++ b/mallplusui-uniapp-app/pages/index/user.vue @@ -8,9 +8,18 @@ - - {{ userDetailInfo.nickname || userDetailInfo.username }} + + + {{ userDetailInfo.nickname }} + + + {{ userDetailInfo.phone }} + + 卖家中心 @@ -19,7 +28,13 @@ @@ -58,7 +57,8 @@ data() { return { tabCurrentIndex: 0, - pageNum:1, + pageNum: 1, + loadingType: 'more', //加载更多状态 navList: [{ type: 1, text: '收藏商品', @@ -105,10 +105,10 @@ onPullDownRefresh() { console.log("onPullDownRefresh") - this.pageNum = this.pageNum + 1; + this.pageNum = 1; // this.getNewProductList('refresh'); - this.loadData(); + this.loadData('refresh'); setTimeout(function() { uni.stopPullDownRefresh(); }, 2000); @@ -123,31 +123,9 @@ }); }, //获取订单列表 - async loadData(source) { + async loadData(type = 'add', loading) { // console.log('=======================') - //这里是将订单挂载到tab列表下 - let index = this.tabCurrentIndex; - let navItem = this.navList[index]; - let type = navItem.type; - - if (source === 'tabChange' && navItem.loaded === true) { - //tab切换只有第一次需要加载数据 - return; - } - if (navItem.loadingType === 'loading') { - //防止重复加载 - return; - } - - navItem.loadingType = 'loading'; - - // if (!this.hasLogin) { - // url = '/pages/public/login'; - // uni.navigateTo({ - // url - // }); - // } else { //没有更多直接返回 if (type === 'add') { if (this.loadingType === 'nomore') { @@ -157,33 +135,116 @@ } else { this.loadingType = 'more'; } + //这里是将订单挂载到tab列表下 + let index = this.tabCurrentIndex; + let navItem = this.navList[index]; + console.log(navItem); + let status = navItem.type; + let params = { pageNum: this.pageNum, }; + let data = await Api.apiCall('get', Api.goods.listCollect, params); + console.log("data>>>>", data); - let orderList = data.records.filter(item => { + let orderList = data.records.filter(item => { //添加不同状态下订单的表现形式 if (item.type == 1) { if (item.meno3 == null) { item.meno3 = 0; } item.meno3 = '销量:' + item.meno3; + return item; } - - item = Object.assign(item, this.orderStateExp(item.type)); - item.addTime = this.dateFormat(item.addTime); - return item.type === type; }); - orderList.forEach(item => { - navItem.orderList.push(item); - }); - //loaded新字段用于表示数据加载完毕,如果为空可以显示空白页 - this.$set(navItem, 'loaded', true); + if (type === 'refresh') { + navItem.orderList = []; + } + console.log("orderList.length======:" + orderList.length) + navItem.orderList = navItem.orderList.concat(orderList); + console.log("data.total======:" + data.total) + console.log("length======:" + navItem.orderList.length) + //判断是否还有下一页,有是more 没有是nomore(测试数据判断大于20就没有了) + this.loadingType = navItem.orderList.length >= data.total ? 'nomore' : 'more'; + console.log("type======:" + type) + console.log("loadingType======:" + this.loadingType) + if (type === 'refresh') { + if (loading == 1) { + uni.hideLoading(); + } else { + uni.stopPullDownRefresh(); + } + } + + + // //这里是将订单挂载到tab列表下 + // let index = this.tabCurrentIndex; + // let navItem = this.navList[index]; + // let type = navItem.type; - //判断是否还有数据, 有改为 more, 没有改为noMore - navItem.loadingType = 'more'; + // if (source === 'tabChange' && navItem.loaded === true) { + // //tab切换只有第一次需要加载数据 + // return; // } + // if (navItem.loadingType === 'loading') { + // //防止重复加载 + // return; + // } + + // navItem.loadingType = 'loading'; + // //没有更多直接返回 + // if (type === 'add') { + // if (this.loadingType === 'nomore') { + // return; + // } + // this.loadingType = 'loading'; + // } else { + // this.loadingType = 'more'; + // } + // let params = { + // pageNum: this.pageNum, + // }; + + // console.log("params", params) + // let data = await Api.apiCall('get', Api.goods.listCollect, params); + + // let orderList = data.records.filter(item => { + // //添加不同状态下订单的表现形式 + // if (item.type == 1) { + // if (item.meno3 == null) { + // item.meno3 = 0; + // } + // item.meno3 = '销量:' + item.meno3; + // } + + // item = Object.assign(item, this.orderStateExp(item.type)); + // item.addTime = this.dateFormat(item.addTime); + // return item.type === type; + // }); + // if (type === 'refresh') { + // navItem.orderList = []; + // } + // navItem.orderList = navItem.orderList.concat(orderList); + // // orderList.forEach(item => { + // // navItem.orderList.push(item); + // // }); + // //loaded新字段用于表示数据加载完毕,如果为空可以显示空白页 + // this.$set(navItem, 'loaded', true); + + // //判断是否还有数据, 有改为 more, 没有改为noMore + // // navItem.loadingType = 'more'; + // navItem.loadingType = navItem.orderList.length >= data.total ? 'nomore' : 'more'; + // console.log("type======:" + type) + // console.log("loadingType======:" + navItem.loadingType) + // if (type === 'refresh') { + // if (loading == 1) { + // uni.hideLoading(); + // } else { + // uni.stopPullDownRefresh(); + // } + // } + }, //swiper 切换