repairs.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <template>
  2. <view>
  3. <!-- <view class="menus" > -->
  4. <allArea @getChild="childMess"></allArea>
  5. <!-- </view> -->
  6. <view class="feed" style="">
  7. <view class="cut">
  8. <text @click="choose" :class="curPage==0?'cur':''" :data-idx="0">未读</text>
  9. <text @click="choose" :class="curPage==1?'cur':''" :data-idx="1">已读</text>
  10. </view>
  11. <view class="box">
  12. <view class="list" v-for="(item,index) in repairsList" :key='index'>
  13. <view class="content">
  14. <view style="font-size:28rpx;" class="title">
  15. <view class="title-left">
  16. <text> {{item.trouble_part}}</text>
  17. <text style="margin-left:15rpx;">({{item.bike_no}})</text>
  18. </view>
  19. <view class="title-right" v-if="curPage==0" @click="markRead(item.id)" >标为已读</view>
  20. </view>
  21. <view class="body">
  22. <view class="body-left">
  23. <image style="height:50rpx;width:112rpx" src="http://resource.weilaibike.com/yunwei/rep4.png" v-if="item.trouble_part=='刹车'"></image>
  24. <image style="height:96rpx;width:96rpx" src="http://resource.weilaibike.com/yunwei/rep6.png" v-if="item.trouble_part=='车胎'"></image>
  25. <image style="height:58rpx;width:116rpx" src="http://resource.weilaibike.com/yunwei/rep5.png" v-if="item.trouble_part=='链条'"></image>
  26. <image style="height:66rpx;width:116rpx" src="http://resource.weilaibike.com/yunwei/rep1.png" v-if="item.trouble_part=='车座'"></image>
  27. <image style="height:80rpx;width:60rpx" src="http://resource.weilaibike.com/yunwei/rep2.png" v-if="item.trouble_part=='二维码'"></image>
  28. <image style="height:72rpx;width:64rpx" src="http://resource.weilaibike.com/yunwei/rep3.png" v-if="item.trouble_part=='其他'"></image>
  29. </view>
  30. <view class="body-right">
  31. <view class="describe">问题描述:{{item.trouble_description}}</view>
  32. </view>
  33. </view>
  34. <view class="time flexB">
  35. <text>创建时间:{{item.created_at}}</text>
  36. <text>手机号:{{item.users.mobile}}</text>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="noData" v-if="repairsList.length == 0">
  41. <image src="http://resource.weilaibike.com/none.png" ></image>
  42. <view>暂无相关数据~</view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. var app = getApp()
  50. import allArea from '../../component/allArea/allArea.vue'
  51. export default {
  52. data() {
  53. return {
  54. screenHeight: '', //屏幕可视高度
  55. value1: 0, //第一个显示什么
  56. option1: [],
  57. curPage: 0, //tab切换 【1 已读 0未读】
  58. repairsList: [], //用户反馈列表
  59. page: 1,
  60. areaID: uni.getStorageSync('curId'), //区域id
  61. list: uni.getStorageSync('allArea'), //骑行区域选择列表
  62. value1: 0, //骑行区与第一个显示什么
  63. }
  64. },
  65. created() {
  66. },
  67. onLoad() {
  68. if(uni.getStorageSync('curVal')){
  69. this.lookRepairs()
  70. }
  71. else {
  72. this.areaID=this.list[0].areaID;
  73. console.log(this.areaID,'12345678')
  74. this.lookRepairs()
  75. }
  76. },
  77. methods: {
  78. childMess:function(e){
  79. console.log(e,'这是子组件穿过来的值')
  80. this.areaID=e.areaID
  81. this.lookRepairs()
  82. },
  83. //获取保修列表
  84. lookRepairs:function(){
  85. uni.showLoading({
  86. title: '加载中...',
  87. })
  88. let cur = this.curPage;
  89. let areaID = this.areaID;
  90. app.request('user/userRepaired?status=' + cur + '&area_id=' + areaID, '', 'GET').then(res => {
  91. uni.hideLoading();
  92. if (res.statusCode == 200) {
  93. console.log(res, '报修列表')
  94. let list = res.data.data;
  95. if (list.length == 0) {
  96. this.repairsList=[]
  97. } else {
  98. this.repairsList= res.data.data
  99. // bgColor: '#efefef'
  100. }
  101. }
  102. })
  103. },
  104. choose:function(e) { //已读未读切换
  105. let idx = e.currentTarget.dataset.idx;
  106. this.curPage=idx,
  107. this.lookRepairs();
  108. // this.goTop();
  109. },
  110. //标记为已读
  111. markRead:function(e) { //标记为已读
  112. let id = e.currentTarget.dataset.id
  113. app.request('user/userRepaired/status?id=' + id, '', 'GET').then(res => {
  114. if (res.statusCode == 200) {
  115. this.lookRepairs();
  116. }
  117. })
  118. },
  119. // back: function() {
  120. // uni.navigateBack({
  121. // delta: 1
  122. // })
  123. // }
  124. },
  125. components: {
  126. allArea
  127. }
  128. }
  129. </script>
  130. <style>
  131. @import url("/static/css/base.css");
  132. /* pages/feedback/feedback.wxss */
  133. .iconfont {
  134. display: inline-block;
  135. height: 100%;
  136. font-size: 34rpx;
  137. width: 50rpx;
  138. text-align: center;
  139. padding: 14rpx 0;
  140. }
  141. .title {
  142. height: 50rpx;
  143. /* background-color: #007AFF; */
  144. }
  145. .title-right {
  146. float: right;
  147. color: red;
  148. }
  149. .title-left,
  150. .title-right {
  151. display: inline-block;
  152. }
  153. .body-left {
  154. display: inline-block;
  155. width: 20%;
  156. text-align: center;
  157. }
  158. .body-right {
  159. display: inline-block;
  160. width: 70%;
  161. padding-left: 30rpx;
  162. font-size: 26rpx;
  163. }
  164. .body .right .describe {
  165. line-height: 1.8;
  166. }
  167. .body,
  168. .title,
  169. .time {
  170. padding: 15rpx 20rpx;
  171. }
  172. .time {
  173. color: #999;
  174. /* padding: 0 20rpx; */
  175. font-size: 26rpx;
  176. border-top: 1rpx solid #efefef;
  177. }
  178. .status_bar {
  179. height: var(--status-bar-height);
  180. width: 100%;
  181. background-color: #FFFFFF;
  182. }
  183. .menus-bg {
  184. width: 100%;
  185. }
  186. .menus {
  187. width: 100%;
  188. position: fixed;
  189. z-index: 100;
  190. left: 0;
  191. top: 0;
  192. display: flex;
  193. justify-content: flex-start;
  194. align-items: center;
  195. z-index: 99999;
  196. }
  197. .menu {
  198. width: 100%;
  199. position: fixed;
  200. left: 70rpx;
  201. top: 0rpx;
  202. z-index: 888;
  203. align-items: center;
  204. height: 129rpx !important;
  205. padding-top: 18rpx;
  206. z-index: 99999;
  207. }
  208. .menu1 .van-dropdown-menu {
  209. width: 100%;
  210. position: fixed;
  211. left: 70rpx;
  212. top: 0rpx;
  213. z-index: 888;
  214. align-items: center;
  215. height: 100rpx !important;
  216. padding-top: 75rpx;
  217. z-index: 99999;
  218. }
  219. .van-dropdown-menu__item {
  220. flex: 0.25 !important;
  221. z-index: 99999;
  222. }
  223. .menus text {
  224. margin-left: 20rpx;
  225. font-size: 35rpx;
  226. }
  227. .feed {
  228. height: 100%;
  229. position: relative;
  230. background: #ff000022;
  231. margin-top: 100rpx;
  232. }
  233. .feed,
  234. .cut {
  235. width: 100%;
  236. display: flex;
  237. justify-content: center;
  238. margin-bottom: 30rpx;
  239. position: absolute;
  240. background: #fff;
  241. padding: 30rpx 0;
  242. z-index: 999;
  243. }
  244. .quest>view {
  245. margin-top: 10rpx;
  246. }
  247. .quest .user {
  248. margin-top: 15rpx;
  249. }
  250. .box {
  251. height: 80%;
  252. margin: 130rpx 0 40rpx 0;
  253. width: 100%;
  254. }
  255. .time {
  256. padding: 20rpx 20rpx;
  257. padding: 20rpx 0;
  258. border-top: 1rpx solid #efefef;
  259. width: 92%;
  260. margin: 0 auto;
  261. }
  262. .list {
  263. /* background: #fff; */
  264. margin-top: 70rpx;
  265. width: 92%;
  266. margin: 15rpx auto 0;
  267. border: 1px solid #d8d8d8;
  268. border-radius: 20rpx;
  269. box-shadow: 0 0 6rpx 0 rgba(216, 216, 216, 1);
  270. }
  271. .list .info {
  272. display: flex;
  273. padding: 15rpx 0;
  274. }
  275. .list .quest {
  276. width: 70%;
  277. }
  278. .list text {
  279. font-size: 26rpx;
  280. }
  281. .list .read {
  282. margin-top: 15rpx;
  283. }
  284. .list .read view {
  285. color: #FE5C28;
  286. font-size: 26rpx;
  287. }
  288. .list image {
  289. width: 80rpx;
  290. height: 80rpx;
  291. border-radius: 50%;
  292. vertical-align: middle;
  293. margin: 5rpx 15rpx 0 20rpx;
  294. }
  295. </style>