index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. <template>
  2. <view class="">
  3. <view class="bg-white">
  4. <image @error="imgError" style="width: 100%;height: 340rpx;" :src="imgUrl('banner',banner)" ></image>
  5. </view>
  6. <view style="padding:40rpx 40rpx 10px" class=" flex bg-white">
  7. <u-icon name="xiaoqu" custom-prefix="custom-icon" size="36" color="#7dc7ae"></u-icon>
  8. <view style="font-size: 30rpx;" class="flex justify-center align-center text-bold padding-left-10">
  9. <text>社区管理</text>
  10. </view>
  11. </view>
  12. <view style="padding: 30rpx 10rpx 0rpx;" class="cu-list grid col-4 no-border" >
  13. <view class="cu-item " @click="jump(item.title)" v-for="(item,index) in gridList" :key="index">
  14. <view class="grid-icon" >
  15. <u-icon :name="item.name" custom-prefix="custom-icon" size="80" :color="item.color"></u-icon>
  16. </view>
  17. <text style="color: #333333;font-size: 26rpx;padding-top: 6rpx;padding-bottom: 20rpx;" >{{item.title}}</text>
  18. <view class="cu-tag bg-red badge" v-if="item.badge>0">{{item.badge}}</view>
  19. </view>
  20. </view>
  21. <view style="padding: 20rpx 0 20rpx 40rpx;" class=" flex bg-white">
  22. <u-icon size="40" name="daibanshixiang1" custom-prefix="custom-icon" color="#7dc7ae"></u-icon>
  23. <view style="font-size: 30rpx;" class="flex justify-center align-center text-bold padding-left-10">
  24. <text>物业服务</text>
  25. </view>
  26. </view>
  27. <view class="bg-white " style="padding: 0rpx 0 20rpx 0">
  28. <u-tabs bar-height="8" bar-width="80" active-color="#7dc7ae" :list="list" :is-scroll="false" :current="subsectionCurrent" @change="subsectionChange"></u-tabs>
  29. </view>
  30. <!-- 住户认证 -->
  31. <card v-if="subsectionCurrent==0" @handleRepair="handleRepair" :list="repairList"></card>
  32. <feedback v-else :list="feedbackList"></feedback>
  33. <view class="flex justify-center " style="padding:30rpx 0 ">
  34. <view @click="more" class="cu-btn radius sm" style="border: 1rpx solid #7fc6ac;color: #7fc6ac;padding: 10rpx 40rpx;">
  35. 查看更多
  36. </view>
  37. </view>
  38. <!-- 详情 -->
  39. <u-popup v-model="popupShow" mode="center" width="650" :closeable="true" border-radius="10">
  40. <view style="padding: 60rpx 40rpx 10rpx;">
  41. <u-form label-width="150" :model="form" label-position="top">
  42. <u-form-item label="照片上传" >
  43. <view class="cu-form-group">
  44. <view class="grid col-4 grid-square flex-sub">
  45. <view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
  46. <image :src="imgList[index]" mode="aspectFill"></image>
  47. <view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
  48. <text class='cuIcon-close'></text>
  49. </view>
  50. </view>
  51. <view class="solids" @tap="ChooseImage" v-if="imgList.length<4">
  52. <text class='cuIcon-cameraadd'></text>
  53. </view>
  54. </view>
  55. </view>
  56. </u-form-item>
  57. <u-form-item label="处理情况" required=true><u-input v-model="detail"/></u-form-item>
  58. </u-form>
  59. <view @click="submit()" class="flex cu-btn bg-blue" style="margin: 60rpx 0 10rpx;padding: 40rpx;">
  60. 确定
  61. </view>
  62. </view>
  63. </u-popup>
  64. </view>
  65. </template>
  66. <script>
  67. import card from "@/components/repair/repair"
  68. import feedback from "@/components/feedback/feedback"
  69. var _this = this;
  70. export default {
  71. components:{
  72. card,feedback
  73. },
  74. data() {
  75. return {
  76. //照片上传及处理情况
  77. imgList: [],
  78. imgMaxNum: 4,
  79. detail:'',
  80. detailTemp:{},
  81. //弹出
  82. popupShow:false,
  83. banner:'http://139.9.103.171:1888/miniofile/estate/banner.png',
  84. isError:false,
  85. feedbackList:[],
  86. repairList:[],
  87. list:[
  88. {
  89. name:'物业报修'
  90. },
  91. {
  92. name:'用户反馈'
  93. },
  94. ],
  95. subsectionCurrent:0,
  96. gridList:[
  97. {
  98. color:'#a1cece',
  99. title:"小区管理",
  100. badge:0,
  101. name:'shequ'
  102. },
  103. {
  104. color:'#3dc159',
  105. title:"楼栋管理",
  106. badge:0,
  107. name:'loudong1'
  108. },
  109. {
  110. color:'#3dc159',
  111. title:"单元管理",
  112. badge:0,
  113. name:'tesecanyin'
  114. },
  115. {
  116. color:'#77b0cb',
  117. title:"房间管理",
  118. badge:0,
  119. name:'fangjianxinxi-'
  120. },
  121. {
  122. color:'#de9964',
  123. title:"住户管理",
  124. badge:0,
  125. name:'zhuhu'
  126. },
  127. {
  128. color:'#d2837d',
  129. title:"住户审核",
  130. badge:0,
  131. name:'zheng'
  132. },
  133. {
  134. color:'#7156bf',
  135. title:"车辆管理",
  136. badge:0,
  137. name:'cheliang1'
  138. },
  139. ]
  140. }
  141. },
  142. onLoad() {
  143. },
  144. onShow() {
  145. this.fetchUserFeedback()
  146. this.fetchRepairList()
  147. },
  148. computed:{
  149. imgUrl(){
  150. return (id,url)=>{
  151. return this.$cache.cacheImg(id,url,this.isError)
  152. }
  153. }
  154. },
  155. methods: {
  156. /**
  157. * 缓存的图片是否出现错误
  158. */
  159. imgError(){
  160. this.isError=true
  161. },
  162. /**
  163. * 处理工单
  164. */
  165. // handleRepair(item){
  166. // //已完成,待评价
  167. // console.log("item",item)
  168. // item.handleStatus=1
  169. // item.estimateStatus=0
  170. // this.$dialog.showModal('确定把该工单置为已处理状态?').then(res=>{
  171. // this.$api.estateRepair.submit(item).then(res=>{
  172. // this.$u.toast('操作成功')
  173. // this.fetchRepairList()
  174. // })
  175. // })
  176. // },
  177. /**
  178. * @param {Object} item
  179. * 点击处理工单
  180. */
  181. handleRepair(item){
  182. console.log("进入时item:", item)
  183. this.detailTemp = item,
  184. this.popupShow=true,
  185. this.imgList = [],
  186. this.detail = ''
  187. },
  188. /**
  189. * 确认提交工单情况s
  190. */
  191. submit(){
  192. this.detailTemp.picArr = this.imgList.join(",")
  193. console.log("临时item",this.detailTemp)
  194. // this.detailTemp.
  195. this.$showModel('确定把该工单置为已处理状态?').then(res=>{
  196. if(this.detail == ''){
  197. this.$u.toast('请填写处理情况')
  198. return
  199. }else{
  200. this.detailTemp.handleStatus=1,
  201. this.detailTemp.estimateStatus=0
  202. this.$api.estateRepair.submit(this.detailTemp).then(res=>{
  203. this.$u.toast('操作成功')
  204. this.mescroll.resetUpScroll()
  205. this.popupShow=false
  206. })
  207. }
  208. })
  209. },
  210. /**
  211. * @param {Object} index
  212. * 拍照或者从图库选择照片上传照片
  213. */
  214. ChooseImage() {
  215. _this = this;
  216. uni.chooseImage({
  217. count: 4, //默认9
  218. sizeType: ['original'], //可以指定是原图还是压缩图,默认二者都有
  219. sourceType: ['camera','album'], //从相机、相册选择
  220. success: (res) => {
  221. var tempFilePaths = res.tempFilePaths;
  222. if (_this.imgList.length+tempFilePaths.length > _this.imgMaxNum) {
  223. uni.showToast({
  224. title: '超过上传图片的最大数量',
  225. icon: 'none'
  226. })
  227. } else {
  228. if (_this.imgList.length != 0) {
  229. _this.imgList = _this.imgList.concat(res.tempFilePaths);
  230. } else {
  231. _this.imgList = res.tempFilePaths;
  232. }
  233. for (var i = 0; i < tempFilePaths.length; i++) {
  234. uni.uploadFile({
  235. url: "https://www.example.com/upload",
  236. filePath: tempFilePaths[i],
  237. name: "file", // 一定要与后台@RequestParam("file") MultipartFile变量名一致
  238. success(res) {
  239. console.log(res);
  240. }
  241. });
  242. }
  243. }
  244. }
  245. });
  246. },
  247. ViewImage(e) {
  248. uni.previewImage({
  249. urls: this.imgList,
  250. current: e.currentTarget.dataset.url
  251. });
  252. },
  253. DelImg(e) {
  254. this.imgList.splice(e.currentTarget.dataset.index, 1)
  255. },
  256. more(){
  257. if (this.subsectionCurrent==0) {
  258. uni.navigateTo({
  259. url:'../repair/list'
  260. })
  261. }else if (this.subsectionCurrent==1) {
  262. uni.navigateTo({
  263. url:'../feedback/list'
  264. })
  265. }
  266. },
  267. fetchUserFeedback(){
  268. let params={
  269. current:1,
  270. size:5
  271. }
  272. this.$api.userFeedBack.page(params).then(res=>{
  273. this.feedbackList=res.data.records
  274. })
  275. },
  276. fetchRepairList(){
  277. let params={
  278. current:1,
  279. size:20
  280. }
  281. this.$api.estateRepair.page(params).then(res=>{
  282. this.repairList=res.data.records
  283. })
  284. },
  285. subsectionChange(index){
  286. this.subsectionCurrent=index
  287. },
  288. jump(title){
  289. let url=''
  290. if (title=='小区管理') {
  291. url='/pages/residential/residential'
  292. }else if(title=='楼栋管理'){
  293. url='/pages/building/building'
  294. }else if (title=='单元管理') {
  295. url='/pages/unit/unit'
  296. }else if (title=='房间管理') {
  297. url='/pages/room/room'
  298. }else if (title=='住户管理') {
  299. url='/pages/user/user'
  300. }else if (title=='住户审核') {
  301. url='/pages/user-auth/user-auth'
  302. }else if (title=='车辆管理') {
  303. url='/pages/car/car'
  304. }
  305. if (!this.$isEmpty(url)) {
  306. uni.navigateTo({
  307. url:url,
  308. })
  309. }
  310. }
  311. }
  312. }
  313. </script>
  314. <style lang="scss">
  315. .nav-checked{
  316. background-color: #7fc6ac;
  317. color: #FFFFFF;
  318. font-weight: 800;
  319. }
  320. .nav-unchecked{
  321. background-color: #FFFFFF;
  322. color: #7fc6ac;
  323. }
  324. </style>