repair.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167
  1. <template>
  2. <view class="content">
  3. <u-navbar title=" " @leftClick="leftClick" :placeholder="true" :autoBack="true">
  4. <view slot="center" class="hflex nav">
  5. <view class="nav_item" :class="nav_index == 1 ? 'nav_active' : ''" @click="changeNav(nav_index)">维修单</view>
  6. <view class="nav_item" :class="nav_index == 2 ? 'nav_active' : ''" @click="changeNav(nav_index)">维修工</view>
  7. </view>
  8. </u-navbar>
  9. <view v-if="nav_index == 1">
  10. <view class="search">
  11. <u-input v-model="serach_value" type="text" :border="true" placeholder="输入搜索关键词" shape="circle"
  12. prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" @confirm="search">
  13. <template slot="suffix">
  14. <view @click="search">搜索</view>
  15. </template>
  16. </u-input>
  17. </view>
  18. <view class="top" style="margin-top: 120rpx;">
  19. <view class="top_title">快修订单</view>
  20. <view class="vflex dm_box">
  21. <block v-if="domWidth == 0">
  22. <view class="hflex dm_scroll" id="dm1" :style="'--dom-width:' + domWidth + ';' ">
  23. <view class="hflex acenter dm1">
  24. <block v-for="(item,index) in bullet_chat" :key="index">
  25. <view class="hflex acenter dm" @click="orderDetail(item.id)">
  26. <image :src="item.user.headimg" mode="aspectFill" class="dm_img"></image>
  27. <view class="dm_text hflex text_hide">{{item.describe}}</view>
  28. </view>
  29. </block>
  30. </view>
  31. </view>
  32. </block>
  33. <block v-else>
  34. <view class="hflex dm_scroll" id="dm1" :style="'--dom-width:' + domWidth + ';' ">
  35. <view class="hflex acenter dm1">
  36. <block v-for="(item,index) in bullet_chat" :key="index">
  37. <view class="hflex acenter dm" @click="orderDetail(item.id)">
  38. <image :src="item.user.headimg" mode="aspectFill" class="dm_img"></image>
  39. <view class="dm_text hflex text_hide">{{item.describe}}</view>
  40. </view>
  41. </block>
  42. </view>
  43. <view class="hflex acenter ">
  44. <block v-for="(item,index) in bullet_chat" :key="index">
  45. <view class="hflex acenter dm" @click="orderDetail(item.id)">
  46. <image :src="item.user.headimg" mode="aspectFill" class="dm_img"></image>
  47. <view class="dm_text hflex text_hide">{{item.describe}}</view>
  48. </view>
  49. </block>
  50. </view>
  51. </view>
  52. </block>
  53. <block v-if="domWidth == 0">
  54. <view class="hflex dm_scroll" :style="'--dom-width:' + domWidth + ';' ">
  55. <view class="hflex acenter dm1">
  56. <block v-for="(item,index) in bullet_chat" :key="index">
  57. <view class="hflex acenter dm" @click="orderDetail(item.id)">
  58. <image :src="item.user.headimg" mode="aspectFill" class="dm_img"></image>
  59. <view class="dm_text hflex text_hide">{{item.describe}}</view>
  60. </view>
  61. </block>
  62. </view>
  63. </view>
  64. </block>
  65. <block v-else>
  66. <view class="hflex dm_scroll1" :style="'--dom-width:' + domWidth + ';' ">
  67. <view class="hflex acenter dm1">
  68. <block v-for="(item,index) in bullet_chat" :key="index">
  69. <view class="hflex acenter dm" @click="orderDetail(item.id)">
  70. <image :src="item.user.headimg" mode="aspectFill" class="dm_img"></image>
  71. <view class="dm_text hflex text_hide">{{item.describe}}</view>
  72. </view>
  73. </block>
  74. </view>
  75. <view class="hflex acenter ">
  76. <block v-for="(item,index) in bullet_chat" :key="index">
  77. <view class="hflex acenter dm" @click="orderDetail(item.id)">
  78. <image :src="item.user.headimg" mode="aspectFill" class="dm_img"></image>
  79. <view class="dm_text hflex text_hide">{{item.describe}}</view>
  80. </view>
  81. </block>
  82. </view>
  83. </view>
  84. </block>
  85. </view>
  86. </view>
  87. <view class="box">
  88. <view class="hflex acenter jbetween">
  89. <block v-for="(item,index) in tabs" :key="index">
  90. <view class="tabs_item" @click="changeTab(item.index)" :class="tabs_active == item.index?'tabs_active':''">{{item.name}}</view>
  91. </block>
  92. </view>
  93. <view class="list">
  94. <block v-for="(item,index) in pageList" :key="index">
  95. <view class="list_item" @tap.stop="orderDetail(item.id)">
  96. <view class="item_top hflex acenter jbetween">
  97. <view class="hflex acenter" v-if="item.quick == 1">
  98. <image src="https://ship.shipcc.cn/common/repair1.png" class="top_img"></image>
  99. <view class="top_text">普修</view>
  100. </view>
  101. <view class="hflex acenter" v-if="item.quick == 2">
  102. <image src="https://ship.shipcc.cn/common/repair2.png" class="top_img"></image>
  103. <view class="">快修</view>
  104. </view>
  105. <view class="top_btn top_btn1" @click.stop="seeOffer(item.id,index)" v-if="item.offer && item.offer.length > 0">已接单</view>
  106. <view class="top_btn" @click.stop="meetOrder(item.id,index)" v-else>接单</view>
  107. </view>
  108. <view class="item_name cell text_hide">{{item.describe}}</view>
  109. <view class="hflex acenter cell">
  110. <u-icon name="map-fill" color="#888888" size="14"></u-icon>
  111. <view class="text_style1" style="padding-left: 16rpx;">{{item.area}} {{item.address}}</view>
  112. </view>
  113. <view class="hflex acenter cell">
  114. <u-icon name="clock-fill" color="#888888" size="14"></u-icon>
  115. <view class="text_style1" style="padding-left: 16rpx;">维修时间:{{item.start_time}}至{{item.end_time}}</view>
  116. </view>
  117. <view class="img_list cell" v-if="item.imgs.length > 1">
  118. <block v-for="(item2,index2) in item.imgs" :key="index2">
  119. <image :src="item2" mode="aspectFill" class="item_img" @tap.stop="perview(item.imgs)"></image>
  120. </block>
  121. </view>
  122. <view class="img_list cell" v-if="item.imgs.length == 1">
  123. <block v-for="(item2,index2) in item.imgs" :key="index2">
  124. <image :src="item2" mode="aspectFill" class="item_img2" @tap.stop="perview(item.imgs)"></image>
  125. </block>
  126. </view>
  127. <view class="item_bottom hflex acenter jbetween">
  128. <view class="hflex acenter">
  129. <image :src="item.user.headimg" class="bottom_img"></image>
  130. <view class="bottom_text text_hide" style="padding-left: 8rpx;">{{item.user.nickname}}</view>
  131. </view>
  132. <view class="bottom_text">发布于{{item.create_at}}</view>
  133. </view>
  134. </view>
  135. </block>
  136. </view>
  137. </view>
  138. </view>
  139. <view class="" v-if="nav_index == 2">
  140. <view class="search2">
  141. <u-input v-model="serach_value" type="text" :border="true" placeholder="输入搜索关键词" shape="circle"
  142. prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" @confirm="search">
  143. <template slot="suffix">
  144. <view @click="search">搜索</view>
  145. </template>
  146. </u-input>
  147. </view>
  148. <block v-for="(item,index) in pageList2" :key="index">
  149. <view class="box1 hflex" @click="toDetail2(item.id)">
  150. <image :src="item.user.headimg" mode="aspectFill" class="item_avatar"></image>
  151. <view class="vflex" style="padding-left: 20rpx;">
  152. <view class="hflex aend">
  153. <view class="item_name">{{item.name}}</view>
  154. <view class="text_style1"style="padding-left: 8rpx;">{{item.phone}}</view>
  155. </view>
  156. <view class="hflex acenter cell">
  157. <image src="https://ship.shipcc.cn/common/company.png" class="item_icon"></image>
  158. <view class="text_style1" style="padding-left: 16rpx;">{{item.company_name}}</view>
  159. </view>
  160. <view class="hflex astart cell" v-if="item.address">
  161. <u-icon name="map-fill" color="#b8b8b8" size="14"></u-icon>
  162. <view class="text_style1" style="padding-left: 16rpx;">{{item.address}}</view>
  163. </view>
  164. </view>
  165. </view>
  166. </block>
  167. </view>
  168. <view class="add" v-show="!repair_show">
  169. <image src="https://ship.shipcc.cn/common/add.png" @click="openRelease" class="add_img"></image>
  170. </view>
  171. <view class="add2" v-show="repair_show">
  172. <view class="add vflex aend">
  173. <view class="hflex acenter jcenter release_box" @click="receivingOrder">
  174. <image src="https://ship.shipcc.cn/common/repair_icon1.png" class="box_img"></image>
  175. <view class="box_text">维修工发布接单需求</view>
  176. </view>
  177. <view class="hflex acenter jcenter release_box" @click="repairOrder">
  178. <image src="https://ship.shipcc.cn/common/repair_icon2.png" class="box_img"></image>
  179. <view class="box_text">船老板发布维修订单</view>
  180. </view>
  181. <image src="https://ship.shipcc.cn/common/close.png" @click="close" class="add_img"></image>
  182. </view>
  183. </view>
  184. <u-modal :show="show_tips" :closeOnClickOverlay="true" :showConfirmButton="false">
  185. <view class="popup1">
  186. <image src="https://ship.shipcc.cn/common/small-bell.png" class="popup_img"></image>
  187. <view class="popup1_title">温馨提示</view>
  188. <view class="popup1_text">您还不是维修工,不能参与报价,可立即申请成为维修工</view>
  189. <view class="popup1_btn" @click="toApply">立即申请</view>
  190. <view class="popup1_text" style="margin: 36rpx 0 0;" @click="close">暂不</view>
  191. </view>
  192. </u-modal>
  193. <u-popup :show="show_offer" mode="center" :round="10" :closeable="true" :safeAreaInsetBottom="false" @close="close">
  194. <view class="popup">
  195. <view class="popup_title">立即报价</view>
  196. <view class="input_bg hflex acenter">
  197. <view class="price">¥</view>
  198. <u-input v-model="offer" placeholder="填写你的报价" border="none"></u-input>
  199. </view>
  200. <view class="hflex acenter">
  201. <image src="https://ship.shipcc.cn/common/icon_tips.png" style="width: 24rpx;height: 24rpx;padding-right: 6rpx"></image>
  202. <view class="popup_info">报价可先不填,可等评估后再填写</view>
  203. </view>
  204. <view class="hflex acenter" style="padding:30rpx 0 20rpx;">
  205. <view class="price">上传图片及资质证明图</view>
  206. </view>
  207. <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="9"></u-upload>
  208. <view class="popup_btn" @click="submit">提交</view>
  209. </view>
  210. </u-popup>
  211. <u-popup :show="see_offer" mode="center" :round="10" :closeable="true" :safeAreaInsetBottom="false" @close="close">
  212. <view class="popup" v-if="info">
  213. <view class="popup_title">报价信息</view>
  214. <view class="popup_name">当前报价</view>
  215. <view class="">
  216. <block v-for="(item,index) in list.slice(0,3)" :key="index">
  217. <view class="hflex acenter input_bg">
  218. <view class="popup_text">第{{list.length - index}}次报价</view>
  219. <view class="red">{{item.price == 0 ? '未报价' : item.price}}</view>
  220. </view>
  221. </block>
  222. </view>
  223. <!-- <view class="hflex acenter input_bg" v-if="info.list.length >= 2">
  224. <view class="popup_text">第二次报价</view>
  225. <view class="red">{{info.list[1].price}}</view>
  226. </view>
  227. <view class="hflex acenter input_bg" v-if="info.list.length >= 3">
  228. <view class="popup_text">第三次报价</view>
  229. <view class="red">{{info.list[2].price}}</view>
  230. </view> -->
  231. <view class="popup_name">图片及资质证明图片</view>
  232. <view>
  233. <block v-for="(item,index) in info.imgs" :key="index">
  234. <image :src="item" mode="aspectFill" style="width: 188rpx;height: 188rpx;margin: 0 14rpx 20rpx 0;border-radius: 16rpx;"></image>
  235. </block>
  236. </view>
  237. <view class="popup_btn" @click="tooffer()">查看详情</view>
  238. </view>
  239. </u-popup>
  240. </view>
  241. </template>
  242. <script>
  243. import $api from '@/static/js/api.js'
  244. var that = ''
  245. export default {
  246. data() {
  247. return {
  248. nav_index: 1,
  249. domWidth: 0,
  250. bullet_chat: [
  251. ],
  252. tabs: [
  253. {
  254. index: 0,
  255. name: '全部'
  256. },
  257. {
  258. index: 1,
  259. name: '快修'
  260. },
  261. {
  262. index: 2,
  263. name: '普修'
  264. }
  265. ],
  266. tabs_active: 0,
  267. pageList: [],
  268. page: 1,
  269. limit: 15,
  270. total: 1,
  271. temp: '',
  272. repair_show: false,
  273. serach_value: '',
  274. pageList2: [
  275. ],
  276. maintenance: false,
  277. show_tips: false,
  278. show_offer: false,
  279. offer: '',
  280. fileList1: [],
  281. imgs: '',
  282. id: '',
  283. info: {},
  284. see_offer: false,
  285. index: '',
  286. list: []
  287. }
  288. },
  289. onLoad() {
  290. that = this
  291. that.maintenance = uni.getStorageSync('maintenance')
  292. },
  293. onShow() {
  294. /* var token = uni.getStorageSync('token')
  295. if(!token) {
  296. $api.info('请先登录')
  297. setTimeout(() =>{
  298. $api.jump('/pages/login/password_login')
  299. }, 1000)
  300. } */
  301. that.getchatList()
  302. that.getList()
  303. // that.getList2()
  304. },
  305. mounted() {
  306. },
  307. onReachBottom() {
  308. if (that.page * that.limit >= that.total) {
  309. $api.info("没有更多了")
  310. } else {
  311. this.page++
  312. console.log(this.page,that.nav_index);
  313. if(that.nav_index == 1) {
  314. that.getList()
  315. console.log('1111111111');
  316. } else {
  317. that.getList2()
  318. console.log('222222222222');
  319. }
  320. }
  321. },
  322. methods: {
  323. // 返回
  324. leftClick() {
  325. $api.jump(-1)
  326. },
  327. getWidth() {
  328. const query = uni.createSelectorQuery().in(this);
  329. query.select('#dm1').boundingClientRect(data => {
  330. that.domWidth = `-${data.width}px`
  331. that.temp = `${that.domWidth};`
  332. }).exec();
  333. },
  334. getchatList() {
  335. $api.req({
  336. url: '/data/api.auth.ShipEngineMaintenance/quicklist',
  337. method: 'POST'
  338. }, function(res) {
  339. if(res.code == 1) {
  340. that.bullet_chat = res.data
  341. setTimeout(() => {
  342. that.getWidth()
  343. }, 500)
  344. }
  345. })
  346. },
  347. getList() {
  348. $api.req({
  349. url: '/data/api.auth.ShipEngineMaintenance/repairlist',
  350. method: 'POST',
  351. data: {
  352. type: that.tabs_active + 1,
  353. page: that.page,
  354. describe: that.serach_value
  355. }
  356. }, function(res) {
  357. if(res.code == 1) {
  358. if(that.page !== 1) {
  359. that.pageList = that.pageList.concat(res.data.data)
  360. } else {
  361. that.pageList = res.data.data
  362. }
  363. that.total = res.data.total
  364. that.limit = res.data.per_page
  365. }
  366. })
  367. },
  368. getList2() {
  369. $api.req({
  370. url: '/data/api.auth.ShipEngineMaintenance/acceptancelist',
  371. method: "POST",
  372. data: {
  373. keyword: that.serach_value,
  374. page: that.page
  375. }
  376. }, function(res) {
  377. if(res.code == 1) {
  378. if(that.page !== 1) {
  379. that.pageList2 = that.pageList2.concat(res.data.data)
  380. } else {
  381. that.pageList2 = res.data.data
  382. }
  383. that.total = res.data.total
  384. that.limit = res.data.per_page
  385. }
  386. })
  387. },
  388. // 切换导航栏
  389. changeNav(index) {
  390. if (index == 1) {
  391. that.nav_index = 2
  392. that.getList2()
  393. } else {
  394. that.nav_index = 1
  395. that.getList()
  396. }
  397. that.page = 1
  398. },
  399. // 切换tabs
  400. changeTab(index) {
  401. var token = uni.getStorageSync('token')
  402. if(!token) {
  403. $api.info('请先登录')
  404. setTimeout(() =>{
  405. $api.jump('/pages/login/password_login')
  406. }, 1000)
  407. } else {
  408. that.tabs_active = index
  409. that.page = 1
  410. that.getList()
  411. }
  412. },
  413. // 点击加号
  414. openRelease() {
  415. var token = uni.getStorageSync('token')
  416. if(!token) {
  417. $api.info('请先登录')
  418. setTimeout(() =>{
  419. $api.jump('/pages/login/password_login')
  420. }, 1000)
  421. } else {
  422. that.repair_show = true
  423. }
  424. },
  425. // 关闭
  426. close() {
  427. that.repair_show = false
  428. that.show_tips = false
  429. that.show_offer = false
  430. that.see_offer = false
  431. },
  432. perview(list) {
  433. uni.previewImage({
  434. urls: list
  435. })
  436. },
  437. // 发布接单需求
  438. receivingOrder() {
  439. var token = uni.getStorageSync('token')
  440. if(!token) {
  441. $api.info('请先登录')
  442. setTimeout(() =>{
  443. $api.jump('/pages/login/password_login')
  444. }, 1000)
  445. } else {
  446. if(that.maintenance) {
  447. $api.jump('/page_index/pages/repair/receivingOrder')
  448. that.close()
  449. } else {
  450. that.show_tips = true
  451. }
  452. }
  453. },
  454. // 去申请
  455. toApply() {
  456. var token = uni.getStorageSync('token')
  457. if(!token) {
  458. $api.info('请先登录')
  459. setTimeout(() =>{
  460. $api.jump('/pages/login/password_login')
  461. }, 1000)
  462. } else {
  463. that.close()
  464. $api.jump('/page_shop/pages/service/applyMaintenance')
  465. }
  466. },
  467. // 发布维修订单
  468. repairOrder() {
  469. var token = uni.getStorageSync('token')
  470. if(!token) {
  471. $api.info('请先登录')
  472. setTimeout(() =>{
  473. $api.jump('/pages/login/password_login')
  474. }, 1000)
  475. } else {
  476. $api.jump('/page_index/pages/repair/repairOrder')
  477. that.close()
  478. }
  479. },
  480. // 接单
  481. meetOrder(id,index) {
  482. var token = uni.getStorageSync('token')
  483. if(!token) {
  484. $api.info('请先登录')
  485. setTimeout(() =>{
  486. $api.jump('/pages/login/password_login')
  487. }, 1000)
  488. } else {
  489. that.index = index
  490. if(that.maintenance) {
  491. that.show_offer = true
  492. that.id = id
  493. } else {
  494. that.show_tips = true
  495. }
  496. }
  497. // that.show_tips = true
  498. // that.show_offer = true
  499. // that.id = id
  500. },
  501. seeOffer(id,index) {
  502. var token = uni.getStorageSync('token')
  503. if(!token) {
  504. $api.info('请先登录')
  505. setTimeout(() =>{
  506. $api.jump('/pages/login/password_login')
  507. }, 1000)
  508. } else {
  509. that.index = index
  510. if(!that.maintenance) {
  511. that.show_tips = true
  512. return
  513. }
  514. $api.req({
  515. url: '/data/api.auth.ShipEngineMaintenance/offerinfo',
  516. method: 'POST',
  517. data: {
  518. id: id
  519. }
  520. }, function(res) {
  521. if(res.code == 1) {
  522. that.see_offer = true
  523. that.id = id
  524. that.info = res.data
  525. let length = res.data.list.length
  526. let index = 0
  527. that.list = []
  528. for(var i=length-1;i>=0;i--) {
  529. that.list.push(that.info.list[i])
  530. }
  531. }
  532. })
  533. }
  534. },
  535. tooffer() {
  536. var token = uni.getStorageSync('token')
  537. if(!token) {
  538. $api.info('请先登录')
  539. setTimeout(() =>{
  540. $api.jump('/pages/login/password_login')
  541. }, 1000)
  542. } else {
  543. $api.jump('/page_shop/pages/order/offer2?id=' + that.id + '&status=' + that.pageList[that.index].status)
  544. that.close()
  545. }
  546. },
  547. submit() {
  548. $api.req({
  549. url: '/data/api.auth.ShipEngineMaintenance/repairoffer',
  550. method: 'POST',
  551. data: {
  552. id: that.id,
  553. price: that.offer,
  554. imgs: that.imgs
  555. }
  556. }, function(res) {
  557. if(res.code == 1) {
  558. $api.info(res.info)
  559. that.close()
  560. that.offer = ''
  561. that.imgs = ''
  562. that.fileList1 = []
  563. that.page = 1
  564. that.getList()
  565. }
  566. })
  567. },
  568. // 订单详情
  569. orderDetail(id) {
  570. var token = uni.getStorageSync('token')
  571. if(!token) {
  572. $api.info('请先登录')
  573. setTimeout(() =>{
  574. $api.jump('/pages/login/password_login')
  575. }, 1000)
  576. } else {
  577. $api.jump('/page_index/pages/repair/orderDetail?id=' + id)
  578. }
  579. },
  580. // 维修工详情
  581. toDetail2(id) {
  582. var token = uni.getStorageSync('token')
  583. if(!token) {
  584. $api.info('请先登录')
  585. setTimeout(() =>{
  586. $api.jump('/pages/login/password_login')
  587. }, 1000)
  588. } else {
  589. $api.jump('/page_index/pages/repair/repairDetail?id=' + id)
  590. }
  591. },
  592. // 删除图片
  593. deletePic(event) {
  594. this[`fileList${event.name}`].splice(event.index, 1)
  595. },
  596. // 新增图片
  597. async afterRead(event) {
  598. uni.showLoading({
  599. title: '上传中',
  600. mask: true
  601. })
  602. let lists = [].concat(event.file)
  603. let fileListLen = this[`fileList${event.name}`].length
  604. lists.map((item) => {
  605. this[`fileList${event.name}`].push({
  606. ...item,
  607. status: 'uploading',
  608. message: '上传中'
  609. })
  610. })
  611. for (let i = 0; i < lists.length; i++) {
  612. const result = await this.uploadFilePromise(lists[i].url)
  613. let item = this[`fileList${event.name}`][fileListLen]
  614. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  615. status: 'success',
  616. message: '',
  617. url: result.url
  618. }))
  619. fileListLen++
  620. if(lists.length - 1 == i) {
  621. uni.hideLoading()
  622. }
  623. }
  624. if(that[`fileList${event.name}`].length > 0) {
  625. for(var i=0;i<that[`fileList${event.name}`].length;i++) {
  626. if(i == that[`fileList${event.name}`].length -1) {
  627. that.imgs += that[`fileList${event.name}`][i].url
  628. } else {
  629. that.imgs += that[`fileList${event.name}`][i].url + ','
  630. }
  631. }
  632. }
  633. },
  634. // 上传图片
  635. uploadFilePromise(url) {
  636. return new Promise((resolve, reject) => {
  637. let a = uni.uploadFile({
  638. url: $api.config.baseUrl + '/data/api.auth.Center/upload',
  639. filePath: url,
  640. name: 'file',
  641. header: {
  642. 'content-type': 'application/x-www-form-urlencoded',
  643. 'api-token': uni.getStorageSync('token').token?uni.getStorageSync('token').token:'',
  644. 'api-name': 'wxapp'
  645. },
  646. formData: {
  647. user: 'test'
  648. },
  649. success: (res) => {
  650. setTimeout(() => {
  651. var data = JSON.parse(res.data)
  652. resolve(data.data)
  653. }, 1000)
  654. }
  655. });
  656. })
  657. },
  658. search() {
  659. if(that.nav_index == 1) {
  660. that.page = 1
  661. that.pageList = []
  662. that.getList()
  663. } else {
  664. that.page = 1
  665. that.pageList2 = []
  666. that.getList2()
  667. }
  668. },
  669. },
  670. }
  671. </script>
  672. <style lang="scss" scoped>
  673. .content::v-deep {
  674. background: #F4F4F4;
  675. .nav {
  676. width: 350rpx;
  677. height: 60rpx;
  678. background: #F4F4F4;
  679. border-radius: 30rpx;
  680. font-size: 28rpx;
  681. font-weight: 400;
  682. color: #020202;
  683. .nav_item {
  684. width: 50%;
  685. height: 60rpx;
  686. background: #F4F4F4;
  687. border-radius: 15px;
  688. text-align: center;
  689. line-height: 60rpx;
  690. }
  691. .nav_active {
  692. background: #506DFF;
  693. color: #FFFFFF;
  694. }
  695. }
  696. .top {
  697. width: 100%;
  698. background: #FFFFFF;
  699. box-sizing: border-box;
  700. padding: 20rpx 0 0;
  701. .top_title {
  702. width: 100%;
  703. padding-left: 20rpx;
  704. padding-bottom: 20rpx;
  705. border-bottom: 1rpx solid #F4F4F4;
  706. font-size: 26rpx;
  707. font-weight: 400;
  708. color: #222222;
  709. position: relative;
  710. }
  711. .top_title::before {
  712. content: '';
  713. width: 8rpx;
  714. height: 28rpx;
  715. background: #506DFF;
  716. position: absolute;
  717. left: 0;
  718. top: 5rpx;
  719. }
  720. .dm_box {
  721. width: 100%;
  722. height: 162rpx;
  723. overflow: hidden;
  724. position: relative;
  725. .dm {
  726. width: auto;
  727. height: 48rpx;
  728. background: #E7EBFF;
  729. border-radius: 36rpx;
  730. margin: 0 17rpx;
  731. padding: 0 20rpx 0 0;
  732. .dm_img {
  733. width: 44rpx;
  734. height: 44rpx;
  735. border-radius: 50%;
  736. flex: none;
  737. }
  738. .dm_text {
  739. max-width: 350rpx;
  740. margin-left: 12rpx;
  741. font-size: 24rpx;
  742. font-weight: 400;
  743. color: #222222;
  744. white-space: nowrap;
  745. }
  746. }
  747. }
  748. }
  749. .box {
  750. margin-top: 20rpx;
  751. width: 100%;
  752. box-sizing: border-box;
  753. background: linear-gradient(65deg, #FFFFFF 0%, #F4F4F4 100%);
  754. padding: 20rpx 30rpx 88rpx;
  755. .tabs_item {
  756. width: 33%;
  757. font-size: 32rpx;
  758. font-weight: 400;
  759. color: #666666;
  760. text-align: center;
  761. }
  762. .tabs_active {
  763. position: relative;
  764. font-weight: 500;
  765. color: #222222;
  766. }
  767. .tabs_active::after{
  768. content: "";
  769. position: absolute;
  770. width: 64rpx;
  771. height: 12rpx;
  772. background: linear-gradient(270deg, #F9F9F9 0%, #506DFF 100%);
  773. border-radius: 6rpx;
  774. opacity: 0.8;
  775. bottom: 0;
  776. left: 38%;
  777. }
  778. .list {
  779. .list_item {
  780. margin-top: 20rpx;
  781. background: #FFFFFF;
  782. border-radius: 16rpx;
  783. box-sizing: border-box;
  784. padding: 20rpx;
  785. .item_top {
  786. padding: 0 0 12rpx;
  787. border-bottom: 1rpx solid #F4F4F4;
  788. .top_img {
  789. width: 40rpx;
  790. height: 40rpx;
  791. margin-right: 8rpx;
  792. }
  793. .top_text {
  794. font-size: 28rpx;
  795. font-weight: 500;
  796. color: #222222;
  797. }
  798. .top_btn {
  799. text-align: center;
  800. width: 132rpx;
  801. height: 52rpx;
  802. line-height: 52rpx;
  803. background: #506DFF;
  804. box-shadow: 0px 0px 16rpx 0px rgba(80,109,255,0.42);
  805. border-radius: 26rpx;
  806. font-size: 26rpx;
  807. font-weight: 400;
  808. color: #FFFFFF;
  809. }
  810. .top_btn1 {
  811. background: rgba(80, 109, 255, .5);
  812. }
  813. }
  814. .item_name {
  815. font-size: 30rpx;
  816. font-weight: 500;
  817. color: #222222;
  818. }
  819. .cell {
  820. padding: 10rpx 0;
  821. }
  822. .text_style1 {
  823. font-size: 26rpx;
  824. font-weight: 400;
  825. color: #222222;
  826. }
  827. .img_list {
  828. .item_img {
  829. width: 210rpx;
  830. height: 160rpx;
  831. border-radius: 8rpx;
  832. margin: 0 8rpx 20rpx 0;
  833. }
  834. .item_img2 {
  835. width: 100%;
  836. height: 320rpx;
  837. }
  838. .item_img:nth-child(3n) {
  839. margin: 0 0 20rpx;
  840. }
  841. }
  842. .item_bottom {
  843. width: 100%;
  844. padding-top: 26rpx;
  845. border-top: 1rpx solid #F4F4F4;
  846. .bottom_img {
  847. width: 40rpx;
  848. height: 40rpx;
  849. border-radius: 50%;
  850. }
  851. .bottom_text {
  852. max-width: 300rpx;
  853. font-size: 24rpx;
  854. font-weight: 400;
  855. color: #999999;
  856. }
  857. }
  858. }
  859. }
  860. }
  861. .add {
  862. position: fixed;
  863. right: 30rpx;
  864. bottom: 186rpx;
  865. z-index: 99;
  866. .add_img {
  867. width: 96rpx;
  868. height: 96rpx;
  869. }
  870. }
  871. .add2 {
  872. position: fixed;
  873. left: 0;
  874. top: 0;
  875. width: 100%;
  876. height: 100%;
  877. background-color: rgba(0, 0, 0, .3);
  878. z-index: 99;
  879. .add {
  880. position: fixed;
  881. right: 30rpx;
  882. bottom: 186rpx;
  883. .release_box {
  884. width: 320rpx;
  885. height: 72rpx;
  886. opacity: 1;
  887. background: linear-gradient(270deg, #88A6FF 0%, #506DFF 100%);
  888. border-radius: 40rpx;
  889. margin-bottom: 40rpx;
  890. .box_img {
  891. width: 32rpx;
  892. height: 32rpx;
  893. }
  894. .box_text {
  895. font-size: 26rpx;
  896. font-weight: 400;
  897. color: #FFFFFF;
  898. padding-left: 10rpx;
  899. }
  900. }
  901. .add_img {
  902. width: 72rpx;
  903. height: 72rpx;
  904. }
  905. }
  906. }
  907. .search {
  908. position: fixed;
  909. // top: 170rpx;
  910. // background: #fff;
  911. width: 100%;
  912. height: 100rpx;
  913. box-sizing: border-box;
  914. padding: 12rpx 30rpx;
  915. background: #fff;
  916. z-index: 99;
  917. margin: 0 0 20rpx 0;
  918. .u-input {
  919. background-color: #fff;
  920. height: 64rpx;
  921. padding: 0 0 0 18rpx !important;
  922. border: 1rpx solid #506Dff;
  923. margin-bottom: 12rpx;
  924. }
  925. .u-input__content__subfix-icon {
  926. width: 128rpx;
  927. height: 64rpx;
  928. background-color: #506Dff;
  929. border-radius: 32rpx;
  930. color: #fff;
  931. font-size: 28rpx;
  932. text-align: center;
  933. line-height: 64rpx;
  934. }
  935. }
  936. .search2 {
  937. position: sticky;
  938. top: 170rpx;
  939. // background: #fff;
  940. width: 100%;
  941. height: 100rpx;
  942. box-sizing: border-box;
  943. padding: 12rpx 30rpx;
  944. // background: #fff;
  945. z-index: 99;
  946. margin: 20rpx 0;
  947. .u-input {
  948. background-color: #fff;
  949. height: 64rpx;
  950. padding: 0 0 0 18rpx !important;
  951. border: 1rpx solid #506Dff;
  952. margin-bottom: 12rpx;
  953. }
  954. .u-input__content__subfix-icon {
  955. width: 128rpx;
  956. height: 64rpx;
  957. background-color: #506Dff;
  958. border-radius: 32rpx;
  959. color: #fff;
  960. font-size: 28rpx;
  961. text-align: center;
  962. line-height: 64rpx;
  963. }
  964. }
  965. .box1 {
  966. // width: 100%;
  967. background: #FFFFFF;
  968. border-radius: 8px;
  969. box-sizing: border-box;
  970. padding: 24rpx 20rpx;
  971. margin: 20rpx 30rpx;
  972. .item_avatar {
  973. width: 84rpx;
  974. height: 84rpx;
  975. border-radius: 50%;
  976. }
  977. .cell {
  978. margin-top: 20rpx;
  979. }
  980. .item_icon {
  981. width: 28rpx;
  982. height: 28rpx;
  983. }
  984. .text_style1 {
  985. font-size: 24rpx;
  986. font-weight: 400;
  987. color: #555555;
  988. }
  989. .item_name {
  990. font-size: 30rpx;
  991. font-weight: 500;
  992. color: #222222;
  993. }
  994. }
  995. .u-popup__content {
  996. overflow: unset !important;
  997. }
  998. .u-modal__content {
  999. padding: 0 !important;
  1000. }
  1001. .u-modal {
  1002. width: 530rpx !important;
  1003. background: url('https://ship.shipcc.cn/common/eject.png') no-repeat;
  1004. background-size: 100%;
  1005. overflow: unset !important;
  1006. }
  1007. .popup1 {
  1008. width: 530rpx;
  1009. // height: 520rpx;
  1010. border-radius: 40rpx;
  1011. position: relative;
  1012. box-sizing: border-box;
  1013. padding: 0 40rpx 40rpx;
  1014. .popup_img {
  1015. width: 174rpx;
  1016. height: 172rpx;
  1017. position: absolute;
  1018. top: -50rpx;
  1019. left: 178rpx;
  1020. z-index: 99;
  1021. }
  1022. .popup1_title {
  1023. margin-top: 134rpx;
  1024. text-align: center;
  1025. font-size: 48rpx;
  1026. font-weight: 400;
  1027. color: #222222;
  1028. }
  1029. .popup1_text {
  1030. width: 100%;
  1031. text-align: center;
  1032. font-size: 28rpx;
  1033. font-weight: 400;
  1034. color: #666666;
  1035. margin: 44rpx auto 52rpx;
  1036. }
  1037. .popup1_btn {
  1038. margin: 0 auto;
  1039. width: 310rpx;
  1040. height: 84rpx;
  1041. background: linear-gradient(90deg, #506DFF 0%, #88A6FF 100%);
  1042. box-shadow: 0px 4rpx 24rpx 0px rgba(90,119,255,0.36);
  1043. border-radius: 42rpx;
  1044. text-align: center;
  1045. line-height: 84rpx;
  1046. font-size: 32rpx;
  1047. font-weight: 500;
  1048. color: #FFFFFF;
  1049. }
  1050. }
  1051. .popup {
  1052. width: 670rpx;
  1053. background: #FFFFFF;
  1054. border-radius: 10px;
  1055. box-sizing: border-box;
  1056. padding: 36rpx 30rpx 24rpx;
  1057. .popup_title {
  1058. width: 100%;
  1059. text-align: center;
  1060. font-size: 32rpx;
  1061. font-weight: 500;
  1062. color: #222222;
  1063. margin-bottom: 24rpx;
  1064. }
  1065. .popup_name {
  1066. font-size: 26rpx;
  1067. font-weight: 400;
  1068. color: #222222;
  1069. padding: 28rpx 0 20rpx;
  1070. }
  1071. .popup_text {
  1072. font-size: 22rpx;
  1073. font-weight: 500;
  1074. color: #777777;
  1075. padding-right: 60rpx;
  1076. }
  1077. .input_bg {
  1078. background: #F4F4F4;
  1079. border-radius: 8px;
  1080. box-sizing: border-box;
  1081. padding: 16rpx 20rpx;
  1082. margin: 20rpx 0;
  1083. .price {
  1084. font-size: 32rpx;
  1085. font-weight: 500;
  1086. color: #222222;
  1087. padding-right: 20rpx;
  1088. }
  1089. .u-textarea {
  1090. background-color: #F4F4F4 !important;
  1091. }
  1092. .red {
  1093. font-size: 28rpx;
  1094. font-weight: bold;
  1095. color: #FF3636;
  1096. }
  1097. }
  1098. .popup_info {
  1099. font-size: 20rpx;
  1100. font-weight: 400;
  1101. color: #C0C0C0;
  1102. line-height: 28rpx;
  1103. }
  1104. .popup_btn {
  1105. width: 610rpx;
  1106. height: 80rpx;
  1107. background: #506DFF;
  1108. border-radius: 40rpx;
  1109. font-size: 32rpx;
  1110. font-weight: 500;
  1111. color: #FFFFFF;
  1112. text-align: center;
  1113. line-height: 80rpx;
  1114. margin: 20rpx 0;
  1115. }
  1116. }
  1117. }
  1118. .dm_scroll {
  1119. position:absolute;
  1120. top: 24rpx;
  1121. left: 0%;
  1122. animation: rowScrollTest 22s linear infinite;
  1123. }
  1124. .dm_scroll1 {
  1125. position:absolute;
  1126. top: 96rpx;
  1127. left: 0%;
  1128. animation: rowScrollTest 25s linear infinite;
  1129. }
  1130. @keyframes rowScrollTest {
  1131. from {
  1132. // left: 100%;
  1133. transform: translateX(1);
  1134. }
  1135. to {
  1136. // left: 0%;
  1137. transform: translateX(var(--dom-width));
  1138. }
  1139. }
  1140. </style>