艺易修小程序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.

233 lines
4.7 KiB

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