diff --git a/components/Authorize.vue b/components/Authorize.vue index 261596f..0010c04 100644 --- a/components/Authorize.vue +++ b/components/Authorize.vue @@ -6,7 +6,7 @@ --> - {{isPay?'付款提醒':'授权提醒'}} + {{isPay?'支付提醒':'授权提醒'}} {{title}} @@ -31,7 +31,7 @@ - + @@ -91,10 +91,10 @@ type: Boolean, default: false }, - isPay:{ - type: Boolean, - default: false - }, + isPay: { + type: Boolean, + default: false + }, }, components: { // #ifdef MP @@ -107,13 +107,13 @@ info: '请登录,将为您提供更好的服务!', //#ifdef H5 isWeixin: this.$wechat.isWeixin(), - // isWeixin: false, // 关闭微信公众号授权登录 + // isWeixin: false, // 关闭微信公众号授权登录 //#endif //#ifdef MP title: '授权提醒', info: '请授权头像等信息,以便为您提供更好的服务!', //#endif - payInfo: '', + payInfo: '', canUseGetUserProfile: false, code: null, top: 0, @@ -152,9 +152,9 @@ this.editModal = false }, // #endif - setPayInfo(e){ - this.payInfo = e; - }, + setPayInfo(e) { + this.payInfo = e; + }, setAuthStatus() { //#ifdef MP Routine.authorize().then(res => { @@ -194,12 +194,12 @@ }, toWecahtAuth() { toLogin(true); - this.$emit('authColse', false); + this.$emit('authColse', false); }, getUserProfile() { // console.log(11); toLogin(true); - this.$emit('authColse', false); + this.$emit('authColse', false); uni.navigateTo({ url: '/pages/users/login/login_copy' }) @@ -327,7 +327,7 @@ } .Popup .bottom .item { - flex: 1; + flex: 1; width: 250rpx; height: 80rpx; background-color: #eeeeee; diff --git a/pages/index/index.vue b/pages/index/index.vue index d94974f..fee067b 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -93,7 +93,8 @@ - + {{ hotTitle }} @@ -372,7 +373,9 @@ import { HTTP_REQUEST_URL } from '@/config/app'; - import {showTab} from "@/utils/showTab.js"; + import { + showTab + } from "@/utils/showTab.js"; export default { computed: configMap({ hide_mer_status: 0, @@ -461,8 +464,13 @@ limit: 6 }, is_switch: true, - hostProduct: [[],[],[],[]], - hostIndex: 0, + hostProduct: [ + [], + [], + [], + [] + ], + hostIndex: 0, hotPage: 1, hotLimit: 20, hotScroll: true, @@ -559,7 +567,7 @@ }); }) that.pageLoad(options); - this.$store.dispatch('INIT_CONFIG'); + this.$store.dispatch('INIT_CONFIG'); }, created(options) { let routes = getCurrentPages(); // 获取当前打开过的页面路由数组 @@ -583,15 +591,15 @@ that.isScrolled = res[0].top <= -60 }) }) - if (this.isLogin) { - this.getUserInfo(); - } + if (this.isLogin) { + this.getUserInfo(); + } }, onHide() { uni.setStorageSync('isIntegral', false) }, onReady() { - + }, watch: { globalDatas(nVal, oVal) { @@ -680,7 +688,7 @@ success: res => { this.errorNetwork = res.networkType === 'none'; if (!this.errorNetwork) { - this.pageLoad(this._options); + this.pageLoad(this._options); } else { // uni.stopPullDownRefresh(); that.overflow = false; @@ -946,9 +954,9 @@ getUserInfo: function() { let that = this; getUserInfo().then(res => { - showTab(res.data); + showTab(res.data); that.userInfo = res.data; - this.$store.commit('SET_USERINFO', res.data); + this.$store.commit('SET_USERINFO', res.data); }); }, // 记录会员访问 @@ -1012,9 +1020,9 @@ changeRecommedTab(e) { this.hotPage = 1; this.hotScroll = true; - this.hostIndex = e-1; - let hostList = this.hostProduct; - hostList[e-1] = []; + this.hostIndex = e - 1; + let hostList = this.hostProduct; + hostList[e - 1] = []; this.$set(this, 'hostProduct', hostList); this.loadGoods(e); }, @@ -1033,7 +1041,7 @@ /** * 获取我的推荐 */ - get_host_product: function(e=0) { + get_host_product: function(e = 0) { let that = this; let num = that.hotLimit; if (!that.hotScroll) return; @@ -1043,22 +1051,24 @@ getProductHot(that.hotPage, that.hotLimit, 1, 1).then(res => { let list = res.data.list; let productList = that.hostProduct; - if(!productList[e]) productList[e] = []; - productList[e] = [...productList[e], ...res.data.list]; - let hotScroll = list.length <= num && list.length != 0; + if (!productList[e]) productList[e] = []; + productList[e] = [...productList[e], ...res.data.list]; + let hotScroll = list.length <= res.data.limit && list.length != 0; that.hotScroll = hotScroll; that.hotLoading[e] = false; that.hotTitle = !hotScroll ? '已全部加载' : '加载更多'; - + that.$set(that, 'hostProduct', productList); - if(this.hostIndex==e) this.$forceUpdate(); - that.$set(that, 'hotPage', that.hotPage + 1); + if (this.hostIndex == e) this.$forceUpdate(); + + that.$set(that, 'hotPage', res.data.page + 1); + that.$set(that, 'hotLimit', res.data.limit); }); }, /** * 获取里海云仓, 云市场, 名优特产 */ - get_host_home: function(query = {}, e=1) { + get_host_home: function(query = {}, e = 1) { let that = this; let num = that.hotLimit; if (!that.hotScroll) return; @@ -1067,22 +1077,23 @@ that.hotTitle = '加载中'; query.page = that.hotPage; query.limit = that.hotLimit; - query.sale_type = 1; - query.rand = 1; + query.sale_type = 1; + query.rand = 1; getProductslist({ ...query }).then(res => { let list = res.data.list; let productList = that.hostProduct; - if(!productList[e]) productList[e] = []; + if (!productList[e]) productList[e] = []; productList[e] = [...productList[e], ...list]; - let hotScroll = list.length <= num && list.length != 0; + let hotScroll = list.length <= res.data.limit && list.length != 0; that.hotScroll = hotScroll; that.hotLoading[e] = false; that.hotTitle = !hotScroll ? '已全部加载' : '加载更多'; that.$set(that, 'hostProduct', productList); - if(this.hostIndex==e) this.$forceUpdate(); - that.$set(that, 'hotPage', that.hotPage + 1); + if (this.hostIndex == e) this.$forceUpdate(); + that.$set(that, 'hotPage', res.data.page + 1); + that.$set(that, 'hotLimit', res.data.limit); }); }, diff --git a/pages/payment/get_payment.vue b/pages/payment/get_payment.vue index 746402a..f0bfbb8 100644 --- a/pages/payment/get_payment.vue +++ b/pages/payment/get_payment.vue @@ -56,7 +56,8 @@ - +