Browse Source

修复bug

master
longjieli 4 months ago
parent
commit
a3e39eadaa
5 changed files with 51 additions and 28 deletions
  1. +3
    -3
      config.js
  2. +5
    -6
      pages/center/center.vue
  3. +2
    -2
      pages/order/order.vue
  4. +39
    -16
      pages/repair/repair.vue
  5. +2
    -1
      store/store.js

+ 3
- 3
config.js View File

@ -7,14 +7,14 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI)
// 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置
const config = {
dev : {
// baseUrl : 'http://h5.xzaiyp.top/school-api',
baseUrl : 'https://school-admin.xzaiyp.top/school-api',
baseUrl : 'http://h5.xzaiyp.top/school-api',
// baseUrl : 'https://school-admin.xzaiyp.top/school-api',
},
prod : {
baseUrl : 'https://school-admin.xzaiyp.top/school-api',


+ 5
- 6
pages/center/center.vue View File

@ -5,9 +5,8 @@
<view class="topBox">
<view class="users">
<view class="u-top" v-if="userInfo.id">
<image class="img"
:src="userInfo.headImage || '/static/center/logo.png'"
mode="widthFix"></image>
<image class="img" :src="userInfo.headImage || '/static/center/logo.png'" mode="widthFix">
</image>
<view class="tit">
{{ userInfo.name || '文韵飞扬' }}
</view>
@ -27,8 +26,8 @@
<uni-list>
<uni-list-item v-if="userInfo.isDai == '0'" :show-extra-icon="true" :extra-icon="extraIcon1"
showArrow title="我的报修" clickable @click="clickList" />
<uni-list-item v-if="userInfo.isDai == '1'" :show-extra-icon="true" :extra-icon="extraIcon2" showArrow title="我的维修单" clickable
@click="toOrder" />
<uni-list-item v-if="userInfo.isDai == '1'" :show-extra-icon="true" :extra-icon="extraIcon2"
showArrow title="我的维修单" clickable @click="toOrder" />
<uni-list-item :show-extra-icon="true" :extra-icon="extraIcon3" showArrow title="退出登录" clickable
@click="logout" />
</uni-list>
@ -200,7 +199,7 @@
box-sizing: border-box;
border-radius: 20rpx;
}
.lists {
width: calc(100% - 40rpx);
box-sizing: border-box;


+ 2
- 2
pages/order/order.vue View File

@ -31,9 +31,9 @@
<uv-tags :text="item.project" plain size="mini" type="primary"></uv-tags>
</view>
<view class="btns">
<view v-if="userInfo.isDai == '1' && !item.cleckState" @click="toReject(item.id)" class="btn">驳回
<view v-if="userInfo.isDai == '1' && !item.cleckState || item.cleckState == '0'" @click="toReject(item.id)" class="btn">驳回
</view>
<view v-if="userInfo.isDai == '1' && !item.cleckState" @click="toFinish(item.id)" class="btn">结单
<view v-if="userInfo.isDai == '1' && !item.cleckState || item.cleckState == '0'" @click="toFinish(item.id)" class="btn">结单
</view>
</view>
</view>


+ 39
- 16
pages/repair/repair.vue View File

@ -9,9 +9,10 @@
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-form-item>
<uv-form-item label="维修项目" prop="project" borderBottom @click="projectPickerOpen">
<uv-input v-model="form.project" placeholder="请填写维修物品的名称" readonly :fontSize="30" border="none"></uv-input>
<uv-input v-model="form.project" placeholder="请填写维修物品的名称" readonly :fontSize="30"
border="none"></uv-input>
<template v-slot:right>
<uv-icon name="arrow-right"></uv-icon>
</template>
@ -59,8 +60,8 @@
@confirm="roomConfirm"></uv-picker> -->
<!-- 维修项目选择 -->
<uv-picker ref="projectPicker" :columns="projectList" :itemHeight="100" :round="20" keyName="name" title="选择维修项目"
@confirm="projectConfirm"></uv-picker>
<uv-picker ref="projectPicker" :columns="projectList" :itemHeight="100" :round="20" keyName="name"
title="选择维修项目" @confirm="projectConfirm"></uv-picker>
<!-- 图片操作菜单 -->
<uv-action-sheet ref="actionSheet" :actions="list" :round="20" safeAreaInsetBottom @select="selectImageSheet">
@ -155,10 +156,14 @@
currentIndex: undefined, //
floorList: [], //
// roomNumberList: [], //
projectList : [], //
projectList: [], //
}
},
onShow() {
//
if (!this.userInfo.id) {
this.logout()
}
if (wx.onNeedPrivacyAuthorization) {
wx.onNeedPrivacyAuthorization(resolve => {
this.resolvePrivacyAuthorization = resolve
@ -166,7 +171,7 @@
})
}
if (this.floorList.length < 1) this.getActorGoList()
if(this.projectList.length < 1) this.getProjectList()
if (this.projectList.length < 1) this.getProjectList()
},
onReady() {
this.$refs.form.setRules(this.rules);
@ -224,8 +229,11 @@
//
floorPickerOpen() {
if(this.floorList.length == 0){
return uni.showToast({ icon: 'none' , title: '暂无楼栋供用户选择' })
if (this.floorList.length == 0) {
return uni.showToast({
icon: 'none',
title: '暂无楼栋供用户选择'
})
}
this.$refs.floorPicker.open();
},
@ -245,16 +253,19 @@
// }
// this.$refs.roomPicker.open();
// },
//
projectConfirm(project) {
this.form.project = project.value[0].name
},
//
projectPickerOpen() {
if(this.projectList.length == 0){
return uni.showToast({ icon: 'none' , title: '暂无项目供用户选择' })
if (this.projectList.length == 0) {
return uni.showToast({
icon: 'none',
title: '暂无项目供用户选择'
})
}
this.$refs.projectPicker.open();
},
@ -264,8 +275,11 @@
this.$refs.form.validate().then(res => {
let images = this.form.image.join()
if (this.userInfo && this.userInfo.isDai == '1') {
this.cleanfrom() //
return uni.showToast({ icon: 'none' , title: '维修员不能主动提交报修' })
this.cleanfrom() //
return uni.showToast({
icon: 'none',
title: '维修员不能主动提交报修'
})
}
this.$api('addSchoolOrder', {
...this.form,
@ -327,9 +341,18 @@
this.$api('getRepairList', res => {
this.getRepairList = []
this.projectList.push(res.result)
console.log(this.projectList);
})
}
},
//退
logout() {
uni.reLaunch({
url: '/pages/login/studentLogin'
})
uni.removeStorageSync('token');
uni.removeStorageSync('userInfo');
this.$store.commit('setUserInfo', {})
},
},
computed: {
...mapState(['userInfo']),


+ 2
- 1
store/store.js View File

@ -48,11 +48,12 @@ const store = new Vuex.Store({
uni.setStorageSync('token', res.result.token);
uni.setStorageSync('userInfo', JSON.stringify(res.result.userInfo));
state.userInfo = res.result.userInfo
//用户未设置用户名和头像,跳转上传头像或设置昵称页面
if (!state.userInfo.nickName || !state.userInfo.headImage) {
uni.navigateTo({
url: '/pages/login/wxUserInfo'
})
} else {
} else { //跳转报修页面
uni.switchTab({
url: '/pages/repair/repair'
})


Loading…
Cancel
Save