艺易修小程序24.08.21
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

265 lines
5.6 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
10 months ago
10 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
  1. <template>
  2. <view :class="{ bg : repairList.length > 0 }" class="repairList reserveSpace">
  3. <view class="tab">
  4. <uv-tabs :list="list" lineWidth="60" lineHeight="10" @click="selectTag"></uv-tabs>
  5. </view>
  6. <view v-if="repairList.length > 0" class="repairList-main">
  7. <view v-for="item in repairList" :key="item.id" class="repairItem">
  8. <view class="repairMain">
  9. <!-- <view class="userName">用户名</view> -->
  10. <view class="build">
  11. <view>
  12. <text style="margin-right: 10rpx;">{{ item.building }}</text>
  13. <text> {{ item.room }}</text>
  14. </view>
  15. <text style="font-size: 26rpx;">{{ item.createTime }}</text>
  16. </view>
  17. <view class="desc">
  18. <uv-read-more :shadowStyle="shadowStyle" show-height="80rpx" fontSize="30rpx" :toggle="true">
  19. <view>
  20. {{ item.context }}
  21. <view class="phone">学生电话:{{ item.phone }}</view>
  22. </view>
  23. </uv-read-more>
  24. </view>
  25. <view class="repairImages">
  26. <view v-for="(image,index) in item.image" :key="index" class="image-item">
  27. <image @click="viewImageAsList(index,item.image)" :src="image" mode="widthFix"></image>
  28. </view>
  29. </view>
  30. <view style="display: inline-block;margin: 15x 0rpx;padding-left: 10rpx;" class="repair-projuct">
  31. <uv-tags :text="item.project" plain size="mini" type="primary"></uv-tags>
  32. </view>
  33. <view class="btns">
  34. <view @click="toRoam(item.id)" class="btn roam">流转记录
  35. </view>
  36. <view v-if="userInfo.isDai == '1' && !item.cleckState || item.cleckState == '0'" @click="toReject(item.id)" class="btn">驳回
  37. </view>
  38. <view v-if="userInfo.isDai == '1' && !item.cleckState || item.cleckState == '0'" @click="toFinish(item.id)" class="btn">结单
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <uv-empty v-else mode="data" :width="500" :textSize="30" text="暂无维修单" icon="/static/empty/empty.png"></uv-empty>
  45. </view>
  46. </template>
  47. <script>
  48. import {
  49. mapState,
  50. } from 'vuex'
  51. import roamVue from '../roam/roam.vue'
  52. export default {
  53. data() {
  54. return {
  55. list: [{
  56. name: '待完成',
  57. }, {
  58. name: '已完成',
  59. }],
  60. current: 0,
  61. currentIndex: 0,
  62. repairList: [], //报修列表
  63. queryParams: {
  64. pageNo: 1,
  65. pageSize: 3,
  66. state: 0
  67. },
  68. total: 0,
  69. backPressOptions : {
  70. from: 'backbutton'
  71. }
  72. }
  73. },
  74. onShow() {
  75. this.getRepairList()
  76. },
  77. //滚动到屏幕底部
  78. onReachBottom() {
  79. if (this.queryParams.pageSize <= this.total) {
  80. this.queryParams.pageSize += 3
  81. this.getRepairList()
  82. }
  83. },
  84. onBackPress(e) {
  85. uni.switchTab({
  86. url: "/pages/center/center"
  87. })
  88. // 此处一定要return为true,否则页面不会返回到指定路径
  89. this.backPressOptions = e
  90. return true;
  91. },
  92. methods: {
  93. //跳转驳回
  94. toReject(id) {
  95. uni.navigateTo({
  96. url: `/pages/reject/reject?orderId=${id}`
  97. })
  98. },
  99. //跳转结单页面
  100. toFinish(id) {
  101. uni.navigateTo({
  102. url: `/pages/finish/finish?orderId=${id}`
  103. })
  104. },
  105. //查看图片
  106. viewImageAsList(index, imgArr) {
  107. this.currentIndex = index
  108. this.$utils.previewImage({
  109. current: this.currentIndex,
  110. urls: imgArr
  111. })
  112. },
  113. //选择了顶部的标签
  114. selectTag(tag) {
  115. this.queryParams.state = tag.index
  116. this.getRepairList()
  117. },
  118. //获取报修列表
  119. getRepairList() {
  120. this.$api('getSchoolOrderList', this.queryParams, res => {
  121. if (res.code == 200) {
  122. res.result.records.forEach(item => {
  123. item.image ? item.image = item.image.split(',') : item.image = []
  124. })
  125. this.repairList = res.result.records
  126. this.total = res.result.total
  127. }
  128. })
  129. },
  130. //跳转订单流转页面
  131. toRoam(id){
  132. uni.navigateTo({
  133. url: `/pages/roam/roam?orderId=${id}`
  134. })
  135. }
  136. },
  137. computed: {
  138. shadowStyle() {
  139. return {
  140. // #ifndef APP-NVUE
  141. backgroundImage: "linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, #fff 80%)",
  142. // #endif
  143. // #ifdef APP-NVUE
  144. // nvue上不支持设置复杂的backgroundImage属性
  145. backgroundImage: "linear-gradient(to top, #fff, rgba(255, 255, 255, 0.5))",
  146. // #endif
  147. paddingTop: "50px",
  148. marginTop: "-50px",
  149. }
  150. },
  151. ...mapState(['userInfo']),
  152. }
  153. }
  154. </script>
  155. <style scoped>
  156. .repairList {}
  157. .bg {
  158. background: #f8f8f8;
  159. }
  160. .tab {
  161. display: flex;
  162. align-items: center;
  163. height: 80rpx;
  164. background: white;
  165. margin-bottom: 20rpx;
  166. }
  167. .repairList-main {
  168. min-height: 100vh;
  169. }
  170. .repairItem {
  171. display: flex;
  172. background: white;
  173. width: 96%;
  174. margin: 0rpx auto;
  175. border-radius: 20rpx;
  176. margin-bottom: 20rpx;
  177. }
  178. .repairMain {
  179. width: 100%;
  180. box-sizing: border-box;
  181. padding-left: 20rpx;
  182. }
  183. /*
  184. .userName {
  185. font-size: 32rpx;
  186. margin: 10rpx 0rpx;
  187. } */
  188. .build {
  189. display: flex;
  190. justify-content: space-between;
  191. font-size: 28rpx;
  192. margin: 20rpx 0rpx;
  193. }
  194. .desc {
  195. overflow-y: scroll;
  196. margin-bottom: 20rpx;
  197. }
  198. .repairImages {
  199. display: flex;
  200. flex-wrap: wrap;
  201. margin: 10rpx 0rpx;
  202. }
  203. .image-item {
  204. width: 24%;
  205. margin-left: 1%;
  206. height: 170rpx;
  207. overflow: hidden;
  208. display: flex;
  209. align-items: center;
  210. justify-content: center;
  211. padding: 20rpx;
  212. background: #f5f5f5;
  213. border-radius: 20rpx;
  214. }
  215. .image-item image {
  216. width: 100%;
  217. }
  218. .btns {
  219. margin: 20rpx 0rpx;
  220. display: flex;
  221. justify-content: flex-end;
  222. }
  223. .btn {
  224. width: 200rpx;
  225. height: 50rpx;
  226. display: flex;
  227. align-items: center;
  228. justify-content: center;
  229. border-radius: 50rpx;
  230. margin-left: 15rpx;
  231. font-size: 30rpx;
  232. color: white;
  233. background: #f9ae3d;
  234. }
  235. .btn:nth-child(2) {
  236. background: #3c9cff;
  237. }
  238. .roam {
  239. background: #ccc;
  240. }
  241. </style>