longjieli 9 months ago
parent
commit
0200a3ba7b
15 changed files with 352 additions and 91 deletions
  1. +5
    -1
      api/api.js
  2. +4
    -4
      api/http.js
  3. +11
    -2
      components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue
  4. +141
    -3
      components/base/navbar.vue
  5. +1
    -1
      config.js
  6. +7
    -2
      manifest.json
  7. +13
    -6
      pages.json
  8. +4
    -4
      pages/center/center.vue
  9. +46
    -18
      pages/finish/finish.vue
  10. +1
    -4
      pages/login/login.vue
  11. +6
    -4
      pages/login/wxUserInfo.vue
  12. +97
    -34
      pages/repair/repair.vue
  13. +15
    -6
      pages/repairList/repairList.vue
  14. BIN
      static/login/logo.png
  15. +1
    -2
      store/store.js

+ 5
- 1
api/api.js View File

@ -8,7 +8,11 @@ const config = {
// },
getConfig : {url : '/api/getConfig', method : 'GET', limit : 500},
// 登录接口
loginLogin: { url: '/cheer/login/login', method: 'GET', },
loginLogin: { url: '/api/login/login', method: 'GET' , limit : 500 },
//修改个人信息接口
updateInfo: { url: '/api/info/updateInfo', method: 'POST' , limit : 500 },
//获取用户信息接口
getInfo: { url: '/api/info/getInfo', method: 'GET' , limit : 500 },
//增加报修单
addSchoolOrder : {url : '/school-api/addSchoolOrder', method : 'GET', limit : 500},
//驳回


+ 4
- 4
api/http.js View File

@ -25,8 +25,8 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
}
if(res.statusCode == 401){
localStorage.removeItem('token')
localStorage.removeItem('userInfo')
uni.removeStorageSync('token');
uni.removeStorageSync('userInfo');
console.error('登录过期');
uni.navigateTo({
url: '/pages/login/login'
@ -35,8 +35,8 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
//后端接口token出现问题
if(res.data && res.data.code == 500 && res.data.message == '操作失败,token非法无效!'){
localStorage.removeItem('token')
localStorage.removeItem('userInfo')
uni.removeStorageSync('token');
uni.removeStorageSync('userInfo');
console.error('登录过期');
uni.navigateTo({
url: '/pages/login/login'


+ 11
- 2
components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue View File

@ -14,7 +14,7 @@
<view class="content">
<view style="display: flex;">
<uv-checkbox size="30rpx" :name="1"></uv-checkbox>
同意<text>xx报修隐私政策</text>
同意<text @tap="handleOpenPrivacyContract">xx报修隐私政策</text>
</view>
<view class="">
以及<text>用户协议</text>
@ -79,7 +79,16 @@
event: 'agree'
})
this.$refs.popup.close()
}
},
handleOpenPrivacyContract() {
//
wx.openPrivacyContract({
success: () => {}, //
fail: () => {}, //
complete: () => {}
})
}
}
}
</script>


+ 141
- 3
components/base/navbar.vue View File

@ -1,6 +1,37 @@
<template>
<view class="navbar">
<uv-navbar :title="title" @leftClick="leftClick" placeholder></uv-navbar>
<view class="title">
<view class="left">
<uv-icon name="arrow-left"
v-if="leftClick"
@click="leftClick()"
color="#333" size="46rpx"></uv-icon>
</view>
<view>{{ title }}</view>
<view class="icon">
<uv-icon name="search"
v-if="isSearch"
color="#333" size="58rpx"></uv-icon>
<uv-icon name="plus-circle" color="#333"
v-if="isPlus"
@click="plusCircleShow = true"
size="46rpx" style="margin-left: 30rpx;"></uv-icon>
<view v-if="moreClick" style="margin-left: 30rpx;">
<uv-icon name="more-dot-fill" color="#333"
v-if="!moreText"
@click="moreClick()"
size="46rpx"></uv-icon>
<view v-else @click="moreClick"
style="font-weight: 400;font-size: 30rpx;">
{{ moreText }}
</view>
</view>
</view>
</view>
</view>
</template>
@ -10,17 +41,124 @@
props : {
title : {
type : String,
default : '参数'
default : ''
},
leftClick : {
type : Function,
require : true
},
moreClick : {
type : Function,
},
isSearch : {
type : Boolean,
default : false,
},
isPlus : {
type : Boolean,
default : false,
},
moreText : {
}
},
created() {
},
beforeDestroy() {
},
data() {
return {
};
},
methods : {
}
}
</script>
<style lang="scss" scoped>
.navbar{
width: 100%;
height: 100rpx;
.cover{
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
z-index: 9999999;
}
.plusCircle{
position: fixed;
top: calc(100rpx + var(--status-bar-height));
right: 10rpx;
background-color: rgb(76, 76, 76);
z-index: 99999999;
border-radius: 10rpx;
animation: fade-in .5s;
&::after{
content: '';
display: block;
position: absolute;
top: -34rpx;
right: 35rpx;
border-left: 20rpx solid transparent;
border-right: 20rpx solid transparent;
border-top: 20rpx solid transparent;
border-bottom: 20rpx solid rgb(76, 76, 76);
}
&>view{
display: flex;
color: #fff;
width: 300rpx;
height: 120rpx;
align-items: center;
border-bottom: 1px solid #ffffff22;
font-size: 30rpx;
.icon{
padding-left: 30rpx;
padding-right: 20rpx;
image{
width: 40rpx;
height: 40rpx;
}
}
}
}
}
.title{
position: fixed;
top: 0;
left: 0;
padding-top: var(--status-bar-height);
width: 100%;
height: 100rpx;
background-color: #f7f7f7;
display: flex;
justify-content: center;
font-size: 32rpx;
align-items: center;
z-index: 99999;
.left{
position: absolute;
left: 40rpx;
display: flex;
justify-content: flex-start;
}
.icon{
position: absolute;
right: 40rpx;
display: flex;
justify-content: flex-end;
}
}
@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
</style>

+ 1
- 1
config.js View File

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


+ 7
- 2
manifest.json View File

@ -54,7 +54,7 @@
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxe7ae8cbe1673834c",
"appid" : "wx3c24e397e3b132ea",
"setting" : {
"urlCheck" : false
},
@ -72,5 +72,10 @@
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
"vueVersion" : "2",
"h5" : {
"router" : {
"base" : ""
}
}
}

+ 13
- 6
pages.json View File

@ -1,20 +1,21 @@
{
"pages": [{
"path": "pages/login/login",
"path": "pages/repair/repair",
"style": {
"navigationBarTitleText": "登录",
"navigationStyle": "custom"
"navigationBarTitleText": "申请报修"
}
}, {
"path": "pages/repair/repair",
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "报修"
"navigationBarTitleText": "登录",
"navigationStyle": "custom"
}
},
{
"path": "pages/repairList/repairList",
"style": {
"navigationBarTitleText": "记录"
"navigationBarTitleText": "我的报修",
"enablePullDownRefresh": false
}
},
{
@ -34,6 +35,12 @@
"style": {
"navigationBarTitleText": "个人中心"
}
},
{
"path": "pages/login/wxUserInfo",
"style": {
"navigationBarTitleText": "获取用户信息"
}
}
],
"globalStyle": {


+ 4
- 4
pages/center/center.vue View File

@ -55,9 +55,9 @@
}
},
onShow() {
// if (uni.getStorageSync('token')) {
// this.$store.commit('getUserInfo')
// }
if (uni.getStorageSync('token')) {
this.$store.commit('getUserInfo')
}
},
methods: {
clickList() {
@ -94,7 +94,7 @@
top: 0;
z-index: -1;
border-radius: 0 0 30% 50%;
background: #00aaff;
/* background: #00aaff; */
}
.txt {


+ 46
- 18
pages/finish/finish.vue View File

@ -3,22 +3,22 @@
<view class="finish">
<!-- <navbar title="结单" :leftClick="leftClick"></navbar> -->
<uv-form labelPosition="top" :model="form" :rules="rules" ref="form" labelWidth="140">
<uv-form-item label="处理结果" prop="form.successTitle">
<uv-form labelPosition="top" :model="form" errorType="toast" :rules="rules" ref="form" labelWidth="140">
<uv-form-item label="处理结果" prop="successTitle">
<uv-input @focus="processingPickerOpen" placeholder="请选择处理结果" v-model="form.successTitle"
:fontSize="30"></uv-input>
</uv-form-item>
<uv-form-item label="收费金额" prop="form.successPrice">
<uv-form-item label="收费金额" prop="successPrice">
<uv-input placeholder="请输入收费金额" type="number" v-model="form.successPrice" :fontSize="30"></uv-input>
</uv-form-item>
<uv-form-item label="处理说明" prop="form.sucessText">
<uv-form-item label="处理说明" prop="sucessText">
<uv-textarea v-model="form.sucessText" :maxlength="200" :height="120" count
placeholder="请输入处理说明"></uv-textarea>
</uv-form-item>
<uv-form-item label="照片" prop="form.successImage">
<uv-form-item label="照片" prop="successImage">
<view class="image-list">
<view @click="openImageMenu(index)" v-for="(item,index) in form.successImage" :key="index"
class="image-item">
@ -61,17 +61,40 @@
successImage: []
},
rules: {
successTitle: {
type: 'string',
required: true,
message: '请选择处理结果',
trigger: ['blur', 'change']
},
successPrice: {
type: 'string',
required: true,
message: '请填写收费金额',
trigger: ['blur', 'change']
},
sucessText: {
type: 'string',
required: true,
message: '请输入处理说明',
trigger: ['blur', 'change']
},
successImage: {
type: 'array',
required: true,
message: '请上传图片',
trigger: ['blur', 'change']
},
},
processingList: [
[{
id: 0,
label: '已处理'
label: '处理完成'
},
{
id: 1,
label: '未处理'
}
// {
// id: 1,
// label: ''
// }
]
],
maxUpload: 4,
@ -95,7 +118,7 @@
//
leftClick() {
uni.switchTab({
url: '/pages/repairList/repairList'
url: '/pages/center/center'
})
},
@ -154,12 +177,17 @@
//
submit() {
this.form.successImage = this.form.successImage.join(',')
this.$api('editSchoolOrderSuccess', this.form, res => {
if (res.code == 200) {
console.log(res);
}
})
this.$refs.form.validate().then(res => {
this.$api('editSchoolOrderSuccess', { ...this.form , successImage : this.form.successImage.join(',') }, res => {
if (res.code == 200) {
uni.showToast({
icon: 'none',
title: '结单完成'
})
this.leftClick()
}
})
}).catch(errors => {})
}
}
}


+ 1
- 4
pages/login/login.vue View File

@ -59,10 +59,7 @@
methods: {
wxLogin(){
// this.$store.commit('login')
uni.switchTab({
url: '/pages/repair/repair'
})
this.$store.commit('login')
},
//


+ 6
- 4
pages/login/wxUserInfo.vue View File

@ -13,10 +13,10 @@
头像
</view>
<view class="">
<image :src="userInfo.headImage" v-if="userInfo.headImage" style="width: 60rpx;height: 60rpx;"
<image :src="userInfo.headImage" v-if="userInfo.headImage" style="width: 70rpx;height: 70rpx;border-radius: 50%;"
mode=""></image>
<image src="/static/login/6.png" v-else style="width: 50rpx;height: 50rpx;" mode=""></image>
<image src="@/static/login/6.png" v-else style="width: 70rpx;height: 70rpx;border-radius: 50%;" mode="widthFix"></image>
</view>
</view>
</button>
@ -74,9 +74,11 @@
return
}
self.$api('infoUpdateInfo', self.userInfo, res => {
self.$api('updateInfo', self.userInfo, res => {
if (res.code == 200) {
uni.navigateBack(-1)
uni.switchTab({
url: '/pages/repair/repair'
})
}
})
})


+ 97
- 34
pages/repair/repair.vue View File

@ -1,9 +1,9 @@
<!-- 报修 -->
<template>
<view class="repair bx reserveSpace">
<uv-form :model="form" :rules="rules" :useBeforeRead="true" ref="form" labelPosition="left" labelWidth="140">
<uv-form :model="form" :rules="rules" errorType="toast" ref="form" labelPosition="left" labelWidth="140">
<uv-form-item label="楼栋" prop="form.building" borderBottom>
<uv-form-item label="楼栋" prop="building" borderBottom>
<uv-input @focus="floorPickerOpen" placeholder="请选择楼层" v-model="form.building" border="none"
:fontSize="30"></uv-input>
<template v-slot:right>
@ -11,7 +11,7 @@
</template>
</uv-form-item>
<uv-form-item label="室号" prop="form.room" borderBottom>
<uv-form-item label="室号" prop="room" borderBottom>
<uv-input @focus="roomPickerOpen" placeholder="请选择室号" v-model="form.room" border="none"
:fontSize="30"></uv-input>
<template v-slot:right>
@ -19,25 +19,25 @@
</template>
</uv-form-item>
<uv-form-item label="维修物品" prop="form.project" borderBottom>
<uv-form-item label="维修物品" prop="project" borderBottom>
<uv-input v-model="form.project" placeholder="请填写维修物品的名称" :fontSize="30" border="none"></uv-input>
</uv-form-item>
<uv-form-item label="你的姓名" prop="form.name" borderBottom>
<uv-form-item label="你的姓名" prop="name" borderBottom>
<uv-input v-model="form.name" placeholder="请填写姓名" :fontSize="30" border="none"></uv-input>
</uv-form-item>
<uv-form-item label="你的电话" prop="form.name" borderBottom>
<uv-form-item label="你的电话" prop="phone" borderBottom>
<uv-input v-model="form.phone" placeholder="请填写电话号" border="none" :fontSize="30"></uv-input>
</uv-form-item>
<uv-form-item label="描述说明" prop="form.context" borderBottom>
<uv-form-item label="描述说明" prop="context" borderBottom>
<uv-textarea v-model="form.context" :height="140" :maxlength="200" textStyle="font-size : 30rpx" count
placeholder="请输入描述说明"></uv-textarea>
</uv-form-item>
<uv-form-item label="照片" prop="form.image" labelPosition="top">
<uv-form-item label="照片" prop="image" labelPosition="top">
<view class="image-list">
<view @click="openImageMenu(index)" v-for="(item,index) in form.image" :key="index"
class="image-item">
@ -64,7 +64,7 @@
<!-- 图片操作菜单 -->
<uv-action-sheet ref="actionSheet" :actions="list" :round="20" cancelText="取消" title="图片操作"
@select="selectImageSheet"> </uv-action-sheet>
<!-- 隐私政策 -->
<PrivacyAgreementPoup ref="showPrivacy"></PrivacyAgreementPoup>
</view>
@ -89,12 +89,53 @@
image: []
},
rules: { //
// 'form.name': {
// type: 'string',
// required: true,
// message: '',
// trigger: ['blur', 'change']
// }
building: {
type: 'string',
required: true,
message: '请选择楼栋',
trigger: ['blur', 'change']
},
room: {
type: 'string',
required: true,
message: '请选择室号',
trigger: ['blur', 'change']
},
project: {
type: 'string',
required: true,
message: '请填写维修物品',
trigger: ['blur', 'change']
},
name: {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
},
phone: [{
required: true,
message: '请填写手机号',
trigger: ['blur', 'change']
}, {
validator: (rule, value, callback) => {
return uni.$uv.test.mobile(value);
},
message: '手机号格式错误',
trigger: ['blur']
}],
context: {
type: 'string',
required: true,
message: '请填写描述说明',
trigger: ['blur', 'change']
},
image: {
type: 'array',
required: true,
message: '请上传图片',
trigger: ['blur', 'change']
},
},
maxUpload: 4, //
list: [ //
@ -132,7 +173,7 @@
], //
}
},
onShow(){
onShow() {
if (wx.onNeedPrivacyAuthorization) {
console.log('onNeedPrivacyAuthorization');
wx.onNeedPrivacyAuthorization(resolve => {
@ -141,6 +182,22 @@
this.$refs.showPrivacy.init(resolve)
})
}
setTimeout(() => {
this.$refs.showPrivacy.init({})
},2000)
wx.getPrivacySetting({
success: res => {
console.log(res)
if (res.needAuthorization) {
}
}
})
},
onReady() {
this.$refs.form.setRules(this.rules);
},
methods: {
//
@ -208,21 +265,34 @@
//
submitRepair() {
this.form.image = this.form.image.join()
this.$api('addSchoolOrder', this.form, res => {
if (res.code == 200) {
this.$refs.form.validate().then(res => {
let images = this.form.image.join()
this.$api('addSchoolOrder', {
...this.form,
image: images
}, res => {
uni.showToast({
icon: 'none',
title: '提交成功'
});
this.cleanForm()
this.toRepairList()
}
title: '申请报修成功'
})
if (res.code == 200) {
this.cleanfrom()
this.$refs.form.clearValidate();
this.toRepairList()
}
})
}).catch(errors => {})
},
//
toRepairList() {
uni.navigateTo({
url: '/pages/repairList/repairList'
})
},
//
cleanForm() {
//
cleanfrom() {
this.form = {
building: '', //
room: '', //
@ -230,15 +300,8 @@
phone: '', //
name: '', //
context: '', //
image: [] //
image: []
}
},
//
toRepairList(){
uni.switchTab({
url: '/pages/repairList/repairList'
})
}
}
}


+ 15
- 6
pages/repairList/repairList.vue View File

@ -49,16 +49,24 @@
current: 0,
currentIndex: 0,
repairList: [], //
queryParams : {
pageNo : 1,
pageSize : 10,
queryParams: {
pageNo: 1,
pageSize: 3,
// state : 0
}
},
total : 0
}
},
onShow() {
this.getRepairList()
},
//
onReachBottom() {
if(this.queryParams.pageSize <= this.total){
this.queryParams.pageSize += 3
this.getRepairList()
}
},
methods: {
//
toReject(id) {
@ -85,8 +93,8 @@
//
selectTag(tag) {
console.log(tag);
// this.queryParams.state = tag
this.queryParams.state = tag.index
this.getRepairList()
},
//
@ -97,6 +105,7 @@
item.image ? item.image = item.image.split(',') : item.image = []
})
this.repairList = res.result.records
this.total = res.result.total
}
})
}


BIN
static/login/logo.png View File

Before After
Width: 505  |  Height: 504  |  Size: 154 KiB

+ 1
- 2
store/store.js View File

@ -41,7 +41,6 @@ const store = new Vuex.Store({
login(state) {
uni.login({
success(res) {
console.log(res);
if (res.errMsg != "login:ok") {
return
}
@ -73,7 +72,7 @@ const store = new Vuex.Store({
})
},
getUserInfo(state) {
api('infoGetInfo', res => {
api('getInfo', res => {
if(res.code == 200){
state.userInfo = res.result
}


Loading…
Cancel
Save