index.vue 9.4 KB

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