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

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