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

225 lines
4.4 KiB

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