Browse Source

完成注册手机号页面

master
liaoxinyu 1 year ago
parent
commit
9f90ef8cd7
  1. 11
      pages.json
  2. 71
      pages/index/index.vue
  3. 65
      pages/wxlogin/registerphone.vue

11
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": {

71
pages/index/index.vue

@ -14,30 +14,30 @@
<scroll-view scroll-y="true" class="scroll-Y">
<!-- :style="{'marginBottom':index < 2 ? '20rpx' : '0rpx'}" -->
<view class="index_list" v-for="(n, index) in 2" style="margin-bottom: 20rpx;" @click="toviewinvoice(n)">
<view class="index_list" v-for="(item, index) in list" style="margin-bottom: 20rpx;" @click="toviewinvoice(n)">
<view class="d-flex jcontent-between">
<view class="index_list_size">业务流水号3674</view>
<view class="index_list_color">已开票点击获取</view>
</view>
<view class="d-flex jcontent-between">
<view>开票项目</view>
<view>垃圾费</view>
<view>{{item.name}}</view>
</view>
<view class="d-flex jcontent-between">
<view>开票总金额</view>
<view class="Price_color">7.2</view>
<view class="Price_color">{{item.money}}</view>
</view>
<view class="d-flex jcontent-between">
<view>抬头类型</view>
<view>单位</view>
<view>{{item.Headuptype}}</view>
</view>
<view class="d-flex jcontent-between">
<view>抬头名称</view>
<view>张三</view>
<view>{{item.title}}</view>
</view>
<view class="d-flex jcontent-between">
<view>申请时间</view>
<view>2024-07-22 18:45:31</view>
<view>{{item.time}}</view>
</view>
<view class="index_list_box">
<view class="index_list_box1">已开票</view>
@ -73,7 +73,9 @@
<view class="index_list_box1">已作废</view>
</view>
</view>
<uni-load-more :status="status" :content-text="contentText" />
</scroll-view>
<uni-popup ref="popup" type="bottom" background-color="#fff" border-radius="10px 10px 0 0" @close="close">
<view style="height: 150px;text-align: center;">
<view style="margin: 40rpx 80rpx;"><button type="primary" @click="login">登录</button></view>
@ -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({

65
pages/wxlogin/registerphone.vue

@ -0,0 +1,65 @@
<template>
<view class="box">
<view><uni-easyinput prefixIcon="phone-filled" v-model="mobile" @blur="onInput" placeholder="请输入手机号"></uni-easyinput></view>
<view style="margin-top: 10px;"><uni-easyinput prefixIcon="contact-filled" v-model="pucode" placeholder="请输入用户编号"></uni-easyinput></view>
<view class="input">
<uni-easyinput v-model="snsCode" placeholder="请输入内容" @input="input" style="width: 100px;margin-right: 10px;"></uni-easyinput>
<button class="mini-btn" type="primary" size="mini">获取验证码</button>
</view>
<view><button type="primary" style="width: 180px;margin-top: 20px;" @click="register">注册</button></view>
</view>
</template>
<script>
import API from '@/common/js/api.js'
export default {
data() {
return {
mobile:'',
pucode:'',
snsCode:'439764',
styles:{
width:'100px'
}
}
},
methods: {
//
onInput(event) {
// 使
const phonePattern = /^1[3-9]\d{9}$/;
if (!phonePattern.test(event.detail.value) && event.detail.value) {
uni.showToast({
title: '您输入的手机号格式有误',
icon: 'none'
});
this.mobile = ''; //
}else{
this.mobile = event.detail.value
}
},
register(){
const url = '/wechat/savePuCode'
let data = {
mobile:this.mobile,
pucode:this.pucode,
snsCode:this.snsCode
}
API.request(url,data, res => {
console.log('1111');
})
}
}
}
</script>
<style lang="scss" scoped>
.box{
padding: 40px;
}
.input{
display: flex;
align-items: center;
margin-top: 10px;
}
</style>
Loading…
Cancel
Save