From 9f90ef8cd77e40c6962c0f25dbfd5195259f8e55 Mon Sep 17 00:00:00 2001 From: liaoxinyu Date: Tue, 30 Jul 2024 18:27:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=B3=A8=E5=86=8C=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E5=8F=B7=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 11 ++++- pages/index/index.vue | 71 ++++++++++++++++++++++++++++----- pages/wxlogin/registerphone.vue | 65 ++++++++++++++++++++++++++++++ 3 files changed, 135 insertions(+), 12 deletions(-) create mode 100644 pages/wxlogin/registerphone.vue diff --git a/pages.json b/pages.json index 0520fcd..a40e107 100644 --- a/pages.json +++ b/pages.json @@ -12,7 +12,8 @@ "style": { "navigationBarTitleText": "电子发票", "navigationBarBackgroundColor": "#000", - "navigationBarTextStyle": "white" + "navigationBarTextStyle": "white", + "onReachBottomDistance": 10//上拉刷新距离 } }, { @@ -42,6 +43,14 @@ "navigationBarTitleText" : "", "enablePullDownRefresh" : false } + }, + { + "path" : "pages/wxlogin/registerphone", + "style" : + { + "navigationBarTitleText" : "手机注册", + "enablePullDownRefresh" : false + } } ], "globalStyle": { diff --git a/pages/index/index.vue b/pages/index/index.vue index 3dd4845..c43a7ba 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -14,30 +14,30 @@ - + 业务流水号3674 已开票,点击获取 开票项目 - 垃圾费 + {{item.name}} 开票总金额 - ¥7.2 + ¥{{item.money}} 抬头类型 - 单位 + {{item.Headuptype}} 抬头名称 - 张三 + {{item.title}} 申请时间 - 2024-07-22 18:45:31 + {{item.time}} 已开票 @@ -73,7 +73,9 @@ 已作废 + + @@ -87,8 +89,25 @@ export default { data() { return { - datetimerange: [], - list:[], + datetimerange: [],//时间 + // 首页数据 + list:[ + {name:'垃圾费',money:'7.2',Headuptype:'单位',title:'张三',time:'2024-07-22 18:45:31'}, + {name:'垃圾费',money:'7.2',Headuptype:'单位',title:'张三',time:'2024-07-22 18:45:31'}, + {name:'垃圾费',money:'7.2',Headuptype:'单位',title:'张三',time:'2024-07-22 18:45:31'}, + {name:'垃圾费',money:'7.2',Headuptype:'单位',title:'张三',time:'2024-07-22 18:45:31'}, + {name:'垃圾费',money:'7.2',Headuptype:'单位',title:'张三',time:'2024-07-22 18:45:31'}, + {name:'垃圾费',money:'7.2',Headuptype:'单位',title:'张三',time:'2024-07-22 18:45:31'} + ], + page: 1,//页码 + limit: 4,//每页显示几条 + status: 'more',//状态 + //显示的状态 + contentText: { + contentdown: '查看更多', + contentrefresh: '加载中', + contentnomore: '没有更多' + }, appId:'', redirectUri:'', state:'', @@ -103,6 +122,15 @@ console.log('范围选:', this.datetimerange); } }, + //上拉加载 + onReachBottom() { + console.log('触底了'); + if (this.status == 'noMore') { + return; + } + this.page++; + this.getUniversityList(); + }, onLoad(options) { const url = window.location.href; @@ -118,6 +146,7 @@ this.cont() } this.getWxCode() + this.getUniversityList(); }, mounted() { if(!uni.getStorageSync('AccessToken')){ @@ -148,6 +177,11 @@ uni.setStorageSync('openid', res.data.openid); this.$refs.popup.close(); this.removepath() + if(res.data.phone){ + uni.navigateTo({ + url:"/pages/wxlogin/registerphone" + }) + } }else{ uni.showToast({title: res.msg,icon: 'none'}); this.login(); @@ -164,6 +198,24 @@ } }) }, + // 首页获取数据 + getUniversityList(){ + // API.getWxCode({}, res => { + // if (res.code == 1) { + // if (this.page === 1) { + // this.universityList = res.data; + // } else { + // this.universityList = this.universityList.concat(res.data); + // } + // // 判断是否还有更多数据 + // if (res.data.length < this.limit) { + // this.status = 'noMore'; // 没有更多数据 + // } else { + // this.status = 'more'; // 还有更多数据 + // } + // } + // }) + }, // 正则匹配请求地址中的参数函数 getUrlCode(name) { return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) ||[, ''])[1].replace(/\+/g, '%20')) || null @@ -180,9 +232,6 @@ const newUrl = url.replace(/[\?&]code=[^&]*&?/, '?').replace(/[\?&]state=[^&]*&?/, '#/'); // 使用 replaceState 更新 URL,而不刷新页面 window.history.replaceState({}, document.title, newUrl); - }, - close(){ - }, toInvoicing(){ uni.navigateTo({ diff --git a/pages/wxlogin/registerphone.vue b/pages/wxlogin/registerphone.vue new file mode 100644 index 0000000..799fe6e --- /dev/null +++ b/pages/wxlogin/registerphone.vue @@ -0,0 +1,65 @@ + + + + +