Browse Source

对接楼栋列表、室号列表接口

master
longjieli 9 months ago
parent
commit
8da26c31c6
8 changed files with 326 additions and 188 deletions
  1. +4
    -0
      api/api.js
  2. +2
    -1
      config.js
  3. +7
    -2
      pages.json
  4. +135
    -139
      pages/login/login.vue
  5. +146
    -0
      pages/login/login1.vue
  6. +32
    -46
      pages/repair/repair.vue
  7. BIN
      static/login/6.png
  8. BIN
      static/login/bj.jpg

+ 4
- 0
api/api.js View File

@ -21,6 +21,10 @@ const config = {
editSchoolOrderSuccess : {url : '/school-api/editSchoolOrderSuccess', method : 'GET', limit : 500},
//报修列表
getSchoolOrderPage : {url : '/school-api/getSchoolOrderPage', method : 'GET', limit : 500},
//获取楼栋
getActorGoList : {url : '/school-api/getActorGoList', method : 'GET', limit : 500},
//获取室号
getFloorList : {url : '/school-api/getFloorList', method : 'GET', limit : 500},
}


+ 2
- 1
config.js View File

@ -13,7 +13,8 @@ const type = 'dev'
// 环境配置
const config = {
dev : {
baseUrl : 'http://admin.anqi.shop/a-notice-api',
// baseUrl : 'http://admin.anqi.shop/a-notice-api',
baseUrl : 'http://h5.xzaiyp.top/a-notice-api/',
},
prod : {
baseUrl : 'http://xxx.xxx.xxx/xxx',


+ 7
- 2
pages.json View File

@ -4,8 +4,13 @@
"style": {
"navigationBarTitleText": "申请报修"
}
},
{
}, {
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false
}
}, {
"path": "pages/repairList/repairList",
"style": {
"navigationBarTitleText": "我的报修",


+ 135
- 139
pages/login/login.vue View File

@ -1,146 +1,142 @@
<template>
<view class="login">
<view class="logo">
<!-- <image src="/static/image/login/logo.png" mode=""></image> -->
</view>
<view class="title">
欢迎使用xx报修
</view>
<view class="btn mt">
<view class="icon">
<!-- <image src="/static/image/login/wx.png" mode=""></image> -->
</view>
<view class=""
@click="wxLogin">
微信授权登录
</view>
</view>
<!-- <view class="btn b2">
使用短信验证登录
</view> -->
<view class="config">
<uv-checkbox-group
v-model="checkboxValue"
shape="circle">
<view class="content">
<view
style="display: flex;">
<uv-checkbox
size="30rpx"
:name="1"
></uv-checkbox>
阅读并同意我们的<text @click="openConfigDetail('privacyAgreement')">服务协议与隐私条款</text>
</view>
<view class="">
以及<text @click="openConfigDetail('userAgreement')">个人信息保护指引</text>
</view>
</view>
</uv-checkbox-group>
</view>
<configPopup ref="popup"></configPopup>
</view>
<view class="content">
<view class="topBox">
<h3 class="title">{{ index ? "注册" : "登录"}}</h3>
<h3>欢迎使用xx报修</h3>
</view>
<view class="inputBox">
<view class="ipt">
<h4>学号</h4>
<input type="text" value="" placeholder="请输入学生学号" />
</view>
<view class="ipt">
<h4>密码</h4>
<input type="text" value="" placeholder="请输入密码" />
</view>
<button class="loginBtn">{{ index ? '注册' : '登录' }}</button>
<button @click="changeState(1)" class="registerBtn">{{ index ? '已有账号立即登录' : "暂无账号立即注册" }}</button>
<!-- <view class="tipbox">
<view class="txt">
其他账号登录
</view>
<view class="otherUser">
<uni-icons type="qq" size="40" color="rgb(66,157,250)"></uni-icons>
<uni-icons type="weixin" size="40" color="rgb(2,187,17)"></uni-icons>
</view>
</view> -->
</view>
</view>
</template>
<script>
import configPopup from '../../components/config/configPopup.vue';
export default {
name : 'Login',
data() {
return {
checkboxValue : []
}
},
methods: {
wxLogin(){
this.$store.commit('login')
},
//
openConfigDetail(key){
this.$refs.popup.open(key)
}
export default {
data() {
return {
index : 0
}
},
methods: {
//
changeState(index){
this.index = this.index ? 0 : 1
}
}
}
}
</script>
<style scoped lang="scss">
.login{
display: flex;
justify-content: center;
align-items: center;
height: 80vh;
flex-direction: column;
position: relative;
.logo{
height: 80rpx;
width: 80rpx;
padding: 40rpx 30rpx;
background-color: #ddd;
border-radius: 70rpx;
image{
width: 80rpx;
height: 80rpx;
}
margin-bottom: 20rpx;
}
.title{
position: relative;
font-weight: 900;
font-size: 45rpx;
&::after{
content: '';
position: absolute;
left: 0;
top: 100%;
display: block;
height: 8rpx;
width: 210rpx;
background: linear-gradient(to right,#00aaff, #fff);
}
}
.btn{
width: 80%;
height: 100rpx;
background-color: #00aaff;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
margin: 20rpx 0;
border-radius: 20rpx;
.icon{
margin-right: 10rpx;
image{
width: 40rpx;
height: 35rpx;
}
}
}
.b2{
background-color: #3c69f122;
color: #3c69f1;
}
.mt{
margin-top: 200rpx;
}
.config{
position: absolute;
bottom: 0;
font-size: 22rpx;
text-align: center;
line-height: 40rpx;
text{
color: #00aaff;
}
}
}
</style>
<style scoped>
.content {
height: 100vh;
background-color: aquamarine;
background: url("@/static/login/bj.jpg") no-repeat center;
background-size: cover;
}
.topBox {
font-size: 34rpx;
color: #fff;
padding: 80rpx 50rpx;
}
.topBox .title{
font-size: 45rpx;
}
h3 {
margin-bottom: 10rpx;
}
.inputBox {
position: fixed;
bottom: 0;
left: 0;
width: 750rpx;
height: 85vh;
background-color: #fff;
border-top-left-radius: 40rpx;
border-top-right-radius: 40rpx;
padding: 60rpx;
box-sizing: border-box;
}
.ipt {
margin-bottom: 50rpx;
}
.ipt h4 {
margin-bottom: 20rpx;
font-size: 36rpx;
color: #333;
}
.ipt input {
border-bottom: 1px solid #dedede;
padding-bottom: 20rpx;
font-size: 28rpx;
}
.loginBtn {
margin-top: 20rpx;
line-height: 85rpx;
text-align: center;
background: #3c9cff;
border-radius: 40rpx;
color: #fff;
margin-top: 50rpx;
}
.registerBtn {
margin-top: 20rpx;
line-height: 85rpx;
text-align: center;
border-radius: 40rpx;
color: #ccc;
margin-top: 50rpx;
border: none;
}
.tipbox {
position: fixed;
bottom: 120rpx;
left: 50%;
transform: translate(-50%, -120px);
}
.otherUser {
margin-top: 30rpx;
display: flex;
justify-content: center;
}
.txt {
font-size: 28rpx;
color: #969696;
}
.otherUser .uni-icons {
margin-left: 20rpx;
}
</style>

+ 146
- 0
pages/login/login1.vue View File

@ -0,0 +1,146 @@
<template>
<view class="login">
<view class="logo">
<!-- <image src="/static/image/login/logo.png" mode=""></image> -->
</view>
<view class="title">
欢迎使用xx报修
</view>
<view class="btn mt">
<view class="icon">
<!-- <image src="/static/image/login/wx.png" mode=""></image> -->
</view>
<view class=""
@click="wxLogin">
微信授权登录
</view>
</view>
<!-- <view class="btn b2">
使用短信验证登录
</view> -->
<view class="config">
<uv-checkbox-group
v-model="checkboxValue"
shape="circle">
<view class="content">
<view
style="display: flex;">
<uv-checkbox
size="30rpx"
:name="1"
></uv-checkbox>
阅读并同意我们的<text @click="openConfigDetail('privacyAgreement')">服务协议与隐私条款</text>
</view>
<view class="">
以及<text @click="openConfigDetail('userAgreement')">个人信息保护指引</text>
</view>
</view>
</uv-checkbox-group>
</view>
<configPopup ref="popup"></configPopup>
</view>
</template>
<script>
import configPopup from '../../components/config/configPopup.vue';
export default {
name : 'Login',
data() {
return {
checkboxValue : []
}
},
methods: {
wxLogin(){
this.$store.commit('login')
},
//
openConfigDetail(key){
this.$refs.popup.open(key)
}
}
}
</script>
<style scoped lang="scss">
.login{
display: flex;
justify-content: center;
align-items: center;
height: 80vh;
flex-direction: column;
position: relative;
.logo{
height: 80rpx;
width: 80rpx;
padding: 40rpx 30rpx;
background-color: #ddd;
border-radius: 70rpx;
image{
width: 80rpx;
height: 80rpx;
}
margin-bottom: 20rpx;
}
.title{
position: relative;
font-weight: 900;
font-size: 45rpx;
&::after{
content: '';
position: absolute;
left: 0;
top: 100%;
display: block;
height: 8rpx;
width: 210rpx;
background: linear-gradient(to right,#00aaff, #fff);
}
}
.btn{
width: 80%;
height: 100rpx;
background-color: #00aaff;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
margin: 20rpx 0;
border-radius: 20rpx;
.icon{
margin-right: 10rpx;
image{
width: 40rpx;
height: 35rpx;
}
}
}
.b2{
background-color: #3c69f122;
color: #3c69f1;
}
.mt{
margin-top: 200rpx;
}
.config{
position: absolute;
bottom: 0;
font-size: 22rpx;
text-align: center;
line-height: 40rpx;
text{
color: #00aaff;
}
}
}
</style>

+ 32
- 46
pages/repair/repair.vue View File

@ -4,16 +4,14 @@
<uv-form :model="form" :rules="rules" errorType="toast" ref="form" labelPosition="left" labelWidth="140">
<uv-form-item label="楼栋" prop="building" borderBottom @click="floorPickerOpen">
<uv-input placeholder="请选择楼层" v-model="form.building" border="none"
readonly :fontSize="30"></uv-input>
<uv-input placeholder="请选择楼层" v-model="form.building" border="none" readonly :fontSize="30"></uv-input>
<template v-slot:right>
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-form-item>
<uv-form-item label="室号" prop="room" borderBottom @click="roomPickerOpen">
<uv-input placeholder="请选择室号" v-model="form.room" border="none"
readonly :fontSize="30"></uv-input>
<uv-input placeholder="请选择室号" v-model="form.room" border="none" readonly :fontSize="30"></uv-input>
<template v-slot:right>
<uv-icon name="arrow-right"></uv-icon>
</template>
@ -54,11 +52,11 @@
</uv-form>
<!-- 报修地址选择(楼栋) -->
<uv-picker ref="floorPicker" :columns="floorList" :round="20" :itemHeight="100" keyName="label" title="选择楼栋"
<uv-picker ref="floorPicker" :columns="floorList" :round="20" :itemHeight="100" keyName="name" title="选择楼栋"
@confirm="floorConfirm"></uv-picker>
<!-- 报修地址选择(室号) -->
<uv-picker ref="roomPicker" :columns="roomNumberList" :itemHeight="100" :round="20" keyName="label" title="选择室号"
<uv-picker ref="roomPicker" :columns="roomNumberList" :itemHeight="100" :round="20" keyName="name" title="选择室号"
@confirm="roomConfirm"></uv-picker>
<!-- 图片操作菜单 -->
@ -149,40 +147,8 @@
}
],
currentIndex: undefined, //
floorList: [
[{
id: 0,
label: '楼栋1'
},
{
id: 1,
label: '楼栋2'
},
{
id: 1,
label: '楼栋3'
},
{
id: 1,
label: '楼栋4'
},
{
id: 1,
label: '楼栋5'
}
]
], //
roomNumberList: [
[{
id: 0,
label: 'A1001'
},
{
id: 1,
label: 'A1002'
}
]
], //
floorList: [], //
roomNumberList: [], //
}
},
onShow() {
@ -194,6 +160,9 @@
this.$refs.showPrivacy.init(resolve)
})
}
if(this.floorList.length < 1){
this.getActorGoList()
}
},
onReady() {
this.$refs.form.setRules(this.rules);
@ -244,7 +213,8 @@
//
floorConfirm(floor) {
this.form.building = floor.value[0].label
this.form.building = floor.value[0].name
this.getFloorList(floor.value[0].id)
},
//
@ -254,7 +224,7 @@
//
roomConfirm(floor) {
this.form.room = floor.value[0].label
this.form.room = floor.value[0].name
},
//
@ -270,11 +240,11 @@
...this.form,
image: images
}, res => {
uni.showToast({
icon: 'none',
title: '申请报修成功'
})
if (res.code == 200) {
uni.showToast({
icon: 'none',
title: '申请报修成功'
})
this.cleanfrom()
this.$refs.form.clearValidate();
this.toRepairList()
@ -301,6 +271,22 @@
context: '', //
image: []
}
},
//
getActorGoList() {
this.$api('getFloorList', res => {
this.floorList.push(res.result)
})
},
//
getFloorList(id) {
this.$api('getActorGoList',{id},res => {
this.roomNumberList = []
if(res.result.length > 0 && this.form.room) this.form.room = res.result[0].name
this.roomNumberList.push(res.result)
})
}
}
}


BIN
static/login/6.png View File

Before After
Width: 256  |  Height: 256  |  Size: 11 KiB

BIN
static/login/bj.jpg View File

Before After
Width: 650  |  Height: 975  |  Size: 104 KiB

Loading…
Cancel
Save