index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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. <repair v-if="subsectionCurrent==0" @handelRepair="handelRepair" :list="repairList"></repair>
  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. </view>
  39. </template>
  40. <script>
  41. import repair from "@/components/repair/repair"
  42. import feedback from "@/components/feedback/feedback"
  43. export default {
  44. components:{
  45. repair,feedback
  46. },
  47. data() {
  48. return {
  49. banner:'http://139.9.103.171:1888/miniofile/estate/banner.png',
  50. isError:false,
  51. feedbackList:[],
  52. repairList:[],
  53. list:[
  54. {
  55. name:'物业报修'
  56. },
  57. {
  58. name:'用户反馈'
  59. },
  60. ],
  61. subsectionCurrent:0,
  62. gridList:[
  63. {
  64. color:'#a1cece',
  65. title:"小区管理",
  66. badge:0,
  67. name:'shequ'
  68. },
  69. {
  70. color:'#3dc159',
  71. title:"楼栋管理",
  72. badge:0,
  73. name:'loudong1'
  74. },
  75. {
  76. color:'#3dc159',
  77. title:"单元管理",
  78. badge:0,
  79. name:'tesecanyin'
  80. },
  81. {
  82. color:'#77b0cb',
  83. title:"房间管理",
  84. badge:0,
  85. name:'fangjianxinxi-'
  86. },
  87. {
  88. color:'#de9964',
  89. title:"住户管理",
  90. badge:0,
  91. name:'zhuhu'
  92. },
  93. {
  94. color:'#d2837d',
  95. title:"住户审核",
  96. badge:0,
  97. name:'zheng'
  98. },
  99. {
  100. color:'#7156bf',
  101. title:"车辆管理",
  102. badge:0,
  103. name:'cheliang1'
  104. },
  105. ]
  106. }
  107. },
  108. onLoad() {
  109. },
  110. onShow() {
  111. this.fetchUserFeedback()
  112. this.fetchRepairList()
  113. },
  114. computed:{
  115. imgUrl(){
  116. return (id,url)=>{
  117. return this.$cache.cacheImg(id,url,this.isError)
  118. }
  119. }
  120. },
  121. methods: {
  122. /**
  123. * 缓存的图片是否出现错误
  124. */
  125. imgError(){
  126. this.isError=true
  127. },
  128. /**
  129. * 处理工单
  130. */
  131. handelRepair(item){
  132. //已完成,待评价
  133. item.handleStatus=1
  134. item.estimateStatus=0
  135. this.$dialog.showModal('确定把该工单置为已处理状态?').then(res=>{
  136. this.$api.estateRepair.submit(item).then(res=>{
  137. this.$u.toast('操作成功')
  138. this.fetchRepairList()
  139. })
  140. })
  141. },
  142. more(){
  143. if (this.subsectionCurrent==0) {
  144. uni.navigateTo({
  145. url:'../repair/list'
  146. })
  147. }else if (this.subsectionCurrent==1) {
  148. uni.navigateTo({
  149. url:'../feedback/list'
  150. })
  151. }
  152. },
  153. fetchUserFeedback(){
  154. let params={
  155. current:1,
  156. size:5
  157. }
  158. this.$api.userFeedBack.page(params).then(res=>{
  159. this.feedbackList=res.data.records
  160. })
  161. },
  162. fetchRepairList(){
  163. let params={
  164. current:1,
  165. size:20
  166. }
  167. this.$api.estateRepair.page(params).then(res=>{
  168. this.repairList=res.data.records
  169. })
  170. },
  171. subsectionChange(index){
  172. this.subsectionCurrent=index
  173. },
  174. jump(title){
  175. let url=''
  176. if (title=='小区管理') {
  177. url='/pages/residential/residential'
  178. }else if(title=='楼栋管理'){
  179. url='/pages/building/building'
  180. }else if (title=='单元管理') {
  181. url='/pages/unit/unit'
  182. }else if (title=='房间管理') {
  183. url='/pages/room/room'
  184. }else if (title=='住户管理') {
  185. url='/pages/user/user'
  186. }else if (title=='住户审核') {
  187. url='/pages/user-auth/user-auth'
  188. }else if (title=='车辆管理') {
  189. url='/pages/car/car'
  190. }
  191. if (!this.$isEmpty(url)) {
  192. uni.navigateTo({
  193. url:url,
  194. })
  195. }
  196. }
  197. }
  198. }
  199. </script>
  200. <style lang="scss">
  201. .nav-checked{
  202. background-color: #7fc6ac;
  203. color: #FFFFFF;
  204. font-weight: 800;
  205. }
  206. .nav-unchecked{
  207. background-color: #FFFFFF;
  208. color: #7fc6ac;
  209. }
  210. </style>