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

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