repair.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. <template>
  2. <view class="content">
  3. <view class="top hflex acenter jbetween">
  4. <view class="top_item" :class="active1 == 1 ? 'active1':''" @click="changeType(1)">我是船老板</view>
  5. <view class="top_item" :class="active1 == 2 ? 'active1':''" @click="changeType(2)">我是维修工</view>
  6. </view>
  7. <view class="order">
  8. <view class="tabs hflex acenter jbetween">
  9. <block v-for="(item,index) in tabs" :key="index">
  10. <view class="tabs_item" :class="active == index + 1? 'active': ''" @click="changeTabs(index + 1)">{{item.text}}</view>
  11. </block>
  12. </view>
  13. <view class="box_list" v-if="active1 == 1 && pageList.length > 0">
  14. <block v-for="(item,index) in pageList" :key="index">
  15. <view class="box_item">
  16. <view class="box_top hflex acenter jbetween" @click="toDetail(item.order_no)">
  17. <view class="order_no">订单号:{{item.order_no}}</view>
  18. <view class="type" v-if="item.status == 1">未报价</view>
  19. <view class="type1" v-if="item.status == 2">已报价</view>
  20. <view class="type1" v-if="item.status == 3">已匹配</view>
  21. </view>
  22. <view class="box">
  23. <view class="text_style1" >
  24. <span class="urgent1" v-if="item.quick == '2'">快修</span>
  25. <span class="urgent" v-else>普修</span>
  26. {{item.describe}}
  27. </view>
  28. <view class="box_cell text_style2">维修时间:{{item.start_time}}~{{item.end_time}}</view>
  29. <view class="box_cell text_style2">维修地点:{{item.address}}</view>
  30. </view>
  31. <view class="bottom1 hflex jend">
  32. <view class="btn1" v-if="item.status !== 3" @click="deleteId(item.id)">删除</view>
  33. <view class="btn1" v-if="item.status !== 3" @click="toEdit(item)">编辑</view>
  34. <view class="btn1" @click="toDetail(item.id,active1)">查看详情</view>
  35. </view>
  36. </view>
  37. </block>
  38. <!-- <my-order @toDetail="toDetail" :active1="active" :list="pageList" order_type="5" @toEdit="toEdit"></my-order> -->
  39. </view>
  40. <block v-if="active1 == 1 && pageList.length == 0">
  41. <view class="vflex acenter jcenter" style="height: 80vh;">
  42. <image src="@/static/images/no_list.png" mode="widthFix" style="width: 350rpx;"></image>
  43. <view class="text">暂时没有数据^^</view>
  44. </view>
  45. </block>
  46. <view class="box_list" v-if="active1 == 2 && pageList.length > 0">
  47. <block v-for="(item,index) in pageList" :key="index">
  48. <view class="box_item">
  49. <view class="box_top hflex acenter jbetween" @click="toDetail(item.repair.order_no)">
  50. <view class="order_no">订单号:{{item.repair.order_no}}</view>
  51. <view class="type" v-if="active == 1">未报价</view>
  52. <view class="type1" v-if="active == 2">已报价</view>
  53. <view class="type1" v-if="active == 3">已匹配</view>
  54. </view>
  55. <view class="box">
  56. <view class="text_style1" >
  57. <span class="urgent1" v-if="item.repair.quick == '2'">快修</span>
  58. <span class="urgent" v-else>普修</span>
  59. {{item.repair.describe}}
  60. </view>
  61. <view class="box_cell text_style2">维修时间:{{item.repair.start_time}}~{{item.repair.end_time}}</view>
  62. <view class="box_cell text_style2">维修地点:{{item.repair.address}}</view>
  63. </view>
  64. <view class="bottom1 hflex jend">
  65. <view class="btn1" @click="toDetail2(item.id,active1)">查看详情</view>
  66. </view>
  67. </view>
  68. </block>
  69. <!-- <my-order @toDetail="toDetail" :active1="active" :list="pageList" order_type="5" @toEdit="toEdit"></my-order> -->
  70. </view>
  71. <block v-if="active1 == 2 && pageList.length == 0">
  72. <view class="vflex acenter jcenter" style="height: 80vh;">
  73. <image src="@/static/images/no_list.png" mode="widthFix" style="width: 350rpx;"></image>
  74. <view class="text">暂时没有数据^^</view>
  75. </view>
  76. </block>
  77. <view class="add vflex acenter jcenter" v-show="active1 == 1" @click="toPublish">
  78. <u-icon name="plus" color='#fff' size="16"></u-icon>
  79. <view class="add_text">发布维修单</view>
  80. </view>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. import $api from '@/static/js/api.js'
  86. var that = ''
  87. export default {
  88. data() {
  89. return {
  90. tabs: [
  91. {
  92. id: 1,
  93. text: '未报价'
  94. },
  95. {
  96. id: 2,
  97. text: '已报价'
  98. },
  99. {
  100. id: 3,
  101. text: '已匹配'
  102. }
  103. ],
  104. active: 1,
  105. active1: 1,
  106. pageList: [
  107. ],
  108. page: 1,
  109. total: 1
  110. }
  111. },
  112. onLoad() {
  113. that = this
  114. },
  115. onShow() {
  116. that.getList()
  117. },
  118. methods: {
  119. getList() {
  120. $api.req({
  121. url: '/data/api.auth.Center/repair',
  122. method: 'POST',
  123. data: {
  124. type: that.active1,
  125. status: that.active,
  126. page: that.page
  127. }
  128. }, function(res) {
  129. if(res.code == 1) {
  130. if(that.page > 1) {
  131. that.pageList = that.pageList.concat(res.data.data)
  132. } else {
  133. that.pageList = res.data.data
  134. }
  135. that.total = res.data.total
  136. }
  137. })
  138. },
  139. // 切换tabs
  140. changeTabs(id) {
  141. that.active = id
  142. that.page = 1
  143. that.pageList = []
  144. that.getList()
  145. },
  146. // 切换身份
  147. changeType(id) {
  148. that.active1 = id
  149. that.active = 1
  150. that.page = 1
  151. that.pageList = []
  152. that.getList()
  153. },
  154. toDetail(e,type) {
  155. console.log(e);
  156. $api.jump('/page_shop/pages/order/repairDetail?id=' + e + '&type=' + that.active1)
  157. },
  158. toDetail2(e,type) {
  159. $api.jump('/page_shop/pages/order/repairDetail2?id=' + e + '&type=' + that.active1)
  160. },
  161. toPublish() {
  162. $api.jump('/page_index/pages/repair/repairOrder')
  163. },
  164. toEdit(e) {
  165. $api.jump('/page_index/pages/repair/repairOrder?data=' + JSON.stringify(e))
  166. },
  167. deleteId(id) {
  168. $api.req({
  169. url: '/data/api.auth.Center/repairdel',
  170. method: 'POST',
  171. data: {
  172. id: id
  173. }
  174. }, function(res) {
  175. if(res.code == 1) {
  176. $api.info(res.info)
  177. that.getList()
  178. }
  179. })
  180. },
  181. onReachBottom() {
  182. if (Number(that.page) * 15 >= Number(that.total)) {
  183. $api.info("没有更多了")
  184. } else {
  185. that.page++
  186. that.getList()
  187. }
  188. }
  189. },
  190. }
  191. </script>
  192. <style lang="scss" scoped>
  193. .content {
  194. background: #f4f4f4;
  195. .top {
  196. width: 650rpx;
  197. height: 80rpx;
  198. margin: 20rpx auto;
  199. background-color: #fff;
  200. border-radius: 40rpx;
  201. .top_item {
  202. width: 50%;
  203. height: 68rpx;
  204. text-align: center;
  205. font-size: 30rpx;
  206. color: #222;
  207. line-height: 68rpx;
  208. }
  209. .active1 {
  210. width: 320rpx;
  211. height: 68rpx;
  212. border-radius: 34rpx;
  213. background-color: #506dff;
  214. color: #fff;
  215. }
  216. }
  217. .order {
  218. width: 100%;
  219. background-color: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0) 100%);
  220. border-radius: 40rpx 40rpx 0 0;
  221. padding: 0 0 40rpx;
  222. }
  223. .tabs {
  224. width: 100%;
  225. // background-color: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0) 100%);
  226. box-sizing: border-box;
  227. padding: 20rpx 56rpx;
  228. .tabs_item {
  229. font-size: 32rpx;
  230. color: #242424;
  231. }
  232. .active {
  233. color: #222;
  234. position: relative;
  235. }
  236. .active::after {
  237. content: "";
  238. position: absolute;
  239. width: 48rpx;
  240. height: 8rpx;
  241. background-color: #506dff;
  242. border-radius: 4rpx;
  243. bottom: -14rpx;
  244. left: 24rpx;
  245. }
  246. }
  247. .box_list {
  248. padding: 0 30rpx;
  249. .box_item {
  250. margin: 20rpx 0 0;
  251. width: 100%;
  252. box-sizing: border-box;
  253. padding: 26rpx 20rpx;
  254. margin-top: 20rpx;
  255. border-radius: 20rpx;
  256. background-color: #fff;
  257. }
  258. .box_top {
  259. padding-bottom: 24rpx;
  260. width: 100%;
  261. .order_no {
  262. font-size: 24rpx;
  263. color: #444;
  264. }
  265. .type {
  266. width: 96rpx;
  267. height: 40rpx;
  268. background-color: #fff4e8;
  269. border-radius: 4rpx;
  270. font-size: 22rpx;
  271. color: #fba94e;
  272. text-align: center;
  273. line-height: 40rpx;
  274. }
  275. .type1 {
  276. width: 96rpx;
  277. height: 40rpx;
  278. background-color: #e7ebf7;
  279. border-radius: 4rpx;
  280. font-size: 22rpx;
  281. color: #506dff;
  282. text-align: center;
  283. line-height: 40rpx;
  284. }
  285. }
  286. .box {
  287. width: 100%;
  288. padding-top: 14rpx;
  289. border-top: 1rpx solid #f4f4f4;
  290. .text_style1 {
  291. font-size: 28rpx;
  292. color: #222;
  293. line-height: 40rpx;
  294. display: inline-block;
  295. text-overflow: ellipsis;
  296. overflow: hidden;
  297. display: -webkit-box;
  298. -webkit-box-orient: vertical;
  299. box-orient: vertical;
  300. line-clamp: 2;
  301. -webkit-line-clamp: 2;
  302. }
  303. .urgent1 {
  304. width: 72rpx;
  305. height: 32rpx;
  306. background-color: #ff762C;
  307. border-radius: 4rpx;
  308. color: #fff;
  309. font-size: 24rpx;
  310. text-align: center;
  311. line-height: 32rpx;
  312. display: inline-block;
  313. margin-right: 8rpx;
  314. }
  315. .urgent {
  316. width: 72rpx;
  317. height: 32rpx;
  318. background-color: #5571ff;
  319. border-radius: 4rpx;
  320. color: #fff;
  321. font-size: 24rpx;
  322. text-align: center;
  323. line-height: 32rpx;
  324. display: inline-block;
  325. margin-right: 8rpx;
  326. }
  327. .box_norm {
  328. width: auto;
  329. background-color: #f4f4f4;
  330. border-radius: 8rpx;
  331. box-sizing: border-box;
  332. padding: 6rpx 20rpx;
  333. margin: 16rpx 0 24rpx;
  334. }
  335. .box_cell {
  336. margin: 16rpx 0 24rpx;
  337. }
  338. .text_style2 {
  339. font-size: 24rpx;
  340. color: #888;
  341. padding-right: 20rpx;
  342. }
  343. .text {
  344. width: 100%;
  345. padding-bottom: 20rpx;
  346. font-size: 26rpx;
  347. color: #888;
  348. line-height: 36rpx;
  349. }
  350. }
  351. .bottom1 {
  352. width: 100%;
  353. padding-top: 20rpx;
  354. border-top: 1rpx solid #f4f4f4;
  355. }
  356. .btn1 {
  357. width: 152rpx;
  358. height: 52rpx;
  359. // background-color: #eaf4ff;
  360. border-radius: 28rpx;
  361. border: 1rpx solid #e5e5e5;
  362. font-size: 26rpx;
  363. color: #2f2f2f;
  364. text-align: center;
  365. line-height: 52rpx;
  366. margin-left: 24rpx;
  367. }
  368. }
  369. .add {
  370. width: 96rpx;
  371. height: 96rpx;
  372. border-radius: 50%;
  373. background: linear-gradient(180deg, #88A6FF 0%, #506DFF 100%);
  374. position: fixed;
  375. right: 30rpx;
  376. bottom: 166rpx;
  377. .add_text {
  378. font-size: 14rpx;
  379. font-weight: 400;
  380. color: #FFFFFF;
  381. line-height: 18rpx;
  382. }
  383. }
  384. }
  385. </style>