orderDetail.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <view class="hflex acenter jbetween top">
  5. <view class="order_no">订单编号:{{pageData.order_no}}</view>
  6. <view class="type type1" v-if="id == 1">采购订单</view>
  7. <view class="type type2" v-if="id == 2">生产订单</view>
  8. <view class="type type3" v-if="id == 3">外协订单</view>
  9. <view class="type type4" v-if="id == 4">海运订单</view>
  10. </view>
  11. <view class="title">{{pageData.name}}</view>
  12. <view class="hflex acenter jbetween padT-16">
  13. <view class="hflex astart">
  14. <view class="text_style2" style="width: 96rpx;">地址:</view>
  15. <view class="text_style2 black">
  16. {{pageData.address}}
  17. </view>
  18. </view>
  19. <u-icon name="map-fill" color="#506DFF" size="14"></u-icon>
  20. </view>
  21. <view class="hflex astart padT-16">
  22. <view class="text_style2" style="width: 96rpx;">联系人:</view>
  23. <view class="text_style2 black">
  24. {{pageData.linkUser}}
  25. </view>
  26. </view>
  27. <view class="hflex acenter jbetween padT-16">
  28. <view class="hflex astart">
  29. <view class="text_style2" style="width: 96rpx;">手机号:</view>
  30. <view class="text_style2 black">
  31. {{pageData.phone}}
  32. </view>
  33. </view>
  34. <u-icon name="phone-fill" color="#506DFF" size="14"></u-icon>
  35. </view>
  36. </view>
  37. <view class="box">
  38. <view class="title">商品明细</view>
  39. <view class="list">
  40. <block v-for="(item,index) in pageData.goods" :key="index">
  41. <view class="list_item" v-if="id == 1">
  42. <view class="item_title cell">{{item.name}}</view>
  43. <view class="hflex acenter cell">
  44. <view class="text_style2 padR-20">规格:{{item.norm}}</view>
  45. <view class="text_style2">数量:{{item.num}}</view>
  46. </view>
  47. <view class="hflex acenter cell">
  48. <view class="text_style2 padR-20">原购买价:{{item.price}}</view>
  49. </view>
  50. <view class="hflex acenter fwrap text_style2 cell">质量标准:{{item.standard}}</view>
  51. <view class="cell" style="width: 100%;">
  52. <view class="item_btn btn1" v-if="item.type == 1" @click="see(index)">已接单,立即查看</view>
  53. <view class="item_btn btn1" v-if="item.type == 2" @click="start">立即接单</view>
  54. <view class="item_btn btn2" v-if="item.type == 3">不用报价,已匹配接单人</view>
  55. </view>
  56. </view>
  57. <view class="list_item" v-if="id == 2 || id == 3">
  58. <view class="item_title">{{item.name}}</view>
  59. <view class="hflex acenter cell">
  60. <view class="text_style2 padR-20" v-if="item.norm">规格型号:{{item.norm}}/桶</view>
  61. <view class="text_style2" v-if="item.num">生产数量:{{item.norm}}/桶</view>
  62. </view>
  63. <view class="hflex acenter jbetween" style="margin-top: 20rpx;">
  64. <view class="hflex acenter">
  65. <image src="/static/images/comment/icon_pdf.png" class="item_img"></image>
  66. <view class="text_style1">{{item.enclosure_name}}</view>
  67. </view>
  68. <view class="hflex acenter jcenter item_btn1">
  69. <u-icon name="download" color="#506DFF" size="10"></u-icon>
  70. <view>下载附件</view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="list_item" v-if="id == 4">
  75. <view class="item_title cell">{{item.name}}</view>
  76. <view class="hflex acenter cell">
  77. <view class="text_style2 padR-20">数量/吨位:{{item.num}}</view>
  78. </view>
  79. </view>
  80. </block>
  81. </view>
  82. <view class="" v-if="id == 2 || id == 3">
  83. <view class="hflex acenter fwrap text_style2 cell">生产技术标准:{{pageData.technology}}</view>
  84. <view class="hflex acenter fwrap text_style2 cell">生产验收标准:{{pageData.acceptance}}</view>
  85. </view>
  86. <view v-if="pageData.imgs.length > 0">
  87. <view class="title">图片/视频</view>
  88. <view>
  89. <block v-for="(item,index) in pageData.imgs" :key="index">
  90. <image v-if="item.is_img" :src="item.src" class="img" mode="aspectFill"></image>
  91. <image v-else :src="item.src" mode="aspectFill" class="img"></image>
  92. </block>
  93. </view>
  94. </view>
  95. <view v-if="id == 4">
  96. <view class="hflex acenter padT-16">
  97. <view class="text_style2">包装形式:</view>
  98. <view class="text_style2 black">{{pageData.form}}</view>
  99. </view>
  100. <view class="hflex acenter padT-16">
  101. <view class="text_style2">装货码头:</view>
  102. <view class="text_style2 black">{{pageData.loading_dock}}</view>
  103. </view>
  104. <view class="hflex acenter padT-16">
  105. <view class="text_style2">到港码头:</view>
  106. <view class="text_style2 black">{{pageData.arrival_wharf}}</view>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="box" style="margin-bottom: 186rpx;" v-if="id != 4">
  111. <view class="hflex acenter padT-16">
  112. <view class="text_style2">交货地址:</view>
  113. <view class="text_style2 black">{{pageData.delivery_address}}</view>
  114. </view>
  115. <view class="hflex acenter padT-16">
  116. <view class="text_style2">交货日期:</view>
  117. <view class="text_style2 black">{{pageData.delivery_date}}</view>
  118. </view>
  119. <view class="hflex acenter padT-16">
  120. <view class="text_style2">发布日期:</view>
  121. <view class="text_style2 black">{{pageData.rekease_date}}</view>
  122. </view>
  123. </view>
  124. <view style="margin-bottom: 186rpx;" v-else></view>
  125. <view class="bottom hflex acenter jbetween">
  126. <view class="vflex acenter" @click="collect">
  127. <u-icon name="star" color="#444444" size="20" v-if="pageData.is_collect == 0"></u-icon>
  128. <u-icon name="star-fill" color="#506DFF" size="20" v-else></u-icon>
  129. <view class="text_style1">收藏</view>
  130. </view>
  131. <view class="vflex acenter" @click="share">
  132. <image src="/static/images/comment/share.png" mode="" class="bottom_img"></image>
  133. <view class="text_style1">分享</view>
  134. </view>
  135. <view class="bottom_btn" v-if="id == 1">私信聊聊</view>
  136. <view class="hflex acenter" v-else>
  137. <view class="bottom_btn1">私信聊聊</view>
  138. <view class="bottom_btn2" @click="start">开始接单</view>
  139. </view>
  140. </view>
  141. <u-popup :show="quotation_show" mode="center" :round="10" :closeable="true" :safeAreaInsetBottom="false" @close="close">
  142. <view class="popup">
  143. <view class="popup_title">填写报价信息</view>
  144. <view class="input_bg hflex acenter">
  145. <view class="price">¥</view>
  146. <u-input v-model="offer" placeholder="填写你的报价" border="none"></u-input>
  147. </view>
  148. <view class="hflex acenter">
  149. <image src="/static/images/comment/icon_tips.png" style="width: 24rpx;height: 24rpx;padding-right: 6rpx"></image>
  150. <view class="popup_info">报价可先不填,可等评估后再填写</view>
  151. </view>
  152. <view class="input_bg hflex acenter" v-if="id == 4">
  153. <view class="price">报价说明</view>
  154. <u-input v-model="description" placeholder="例如:税前/税后" border="none"></u-input>
  155. </view>
  156. <view class="input_bg hflex acenter" v-else>
  157. <view class="price">货期</view>
  158. <u-input v-model="lead_time" placeholder="例如: 1个月" border="none"></u-input>
  159. </view>
  160. <view class="input_bg" v-if="id != 4">
  161. <view class="price">产品介绍以及报价说明</view>
  162. <u--textarea v-model="description" placeholder="例如:税前/税后" border="none"></u--textarea>
  163. </view>
  164. <view class="hflex acenter jbetween" v-if="id == 1">
  165. <view class="price">是否现货</view>
  166. <u-switch v-model="is_stock" activeColor="#506dff" @change="change"></u-switch>
  167. </view>
  168. <view class="hflex acenter" style="padding-bottom: 20rpx;">
  169. <view class="price">上传图片及资质证明图片</view>
  170. <image src="/static/images/comment/icon_tips.png" style="width: 24rpx;height: 24rpx;padding-right: 6rpx"></image>
  171. <view class="popup_info">最多上传9张图片</view>
  172. </view>
  173. <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="9"></u-upload>
  174. <view class="popup_btn">立即接单</view>
  175. <view class="price">友情提醒:</view>
  176. <view class="popup_info">请认真核算报价,报价后不可修改和删除,报价时间约需x天内报价,逾期影响信用等级。</view>
  177. </view>
  178. </u-popup>
  179. <u-popup :show="detail_show" mode="center" :round="10" :closeable="true" :safeAreaInsetBottom="false" @close="close">
  180. <view class="popup">
  181. <view class="popup_title">报价信息</view>
  182. <view class="popup_name">报价说明</view>
  183. <view class="input_bg">{{pageData.goods[index].description}}</view>
  184. <view class="popup_name">当前报价</view>
  185. <view class="hflex acenter input_bg" v-if="pageData.goods[index].one != ''">
  186. <view class="popup_text">第一次报价</view>
  187. <view class="red">{{pageData.goods[index].one}}</view>
  188. </view>
  189. <view class="hflex acenter input_bg" v-if="pageData.goods[index].two != ''">
  190. <view class="popup_text">第二次报价</view>
  191. <view class="red">{{pageData.goods[index].two}}</view>
  192. </view>
  193. <view class="hflex acenter input_bg" v-if="pageData.goods[index].three != ''">
  194. <view class="popup_text">第三次报价</view>
  195. <view class="red">{{pageData.goods[index].three}}</view>
  196. </view>
  197. <view class="popup_name">图片及资质证明图片</view>
  198. <block v-for="(item,index) in pageData.goods[index].img" :key="index">
  199. <image :src="item" mode="aspectFill" style="width: 188rpx;height: 188rpx;margin: 0 14rpx 20rpx 0;border-radius: 16rpx;"></image>
  200. </block>
  201. <view class="popup_btn">查看详情</view>
  202. </view>
  203. </u-popup>
  204. <share-model :show="share_show" :data="pageData" @cancel="cancel"></share-model>
  205. </view>
  206. </template>
  207. <script>
  208. import $api from '@/static/js/api.js'
  209. var that = ''
  210. export default {
  211. data() {
  212. return {
  213. id: '',
  214. pageData: {
  215. is_collect: 0,
  216. type: 2,
  217. order_no: 'Cbz20220122130923',
  218. name: '福建船舶有限公司',
  219. address: '山东省济南市历下区历元大街188号解放军家属院',
  220. linkUser: '李建国',
  221. phone: '189235767865',
  222. goods: [
  223. {
  224. id: 1,
  225. name: '聚酰胺/非离子表面活性剂Lutensol XP',
  226. norm: '15kg/桶',
  227. num: '10桶',
  228. price: '18999.89',
  229. type: 1,
  230. description: '报价说明报价说明报价说明报价说明报价说…',
  231. one: '2,399.89',
  232. two: '1,459.89',
  233. three: '',
  234. img: '',
  235. enclosure_name: '在发展中扎实推动共同富裕.pdf',
  236. standard: '按照国家三级标准规定,按照国家三级标准规定,按照国家三级标准规定,按照国家三级标准规定,'
  237. },
  238. {
  239. id: 1,
  240. name: '聚酰胺/非离子表面活性剂Lutensol XP',
  241. norm: '15kg/桶',
  242. num: '10桶',
  243. price: '18999.89',
  244. type: 2,
  245. standard: '按照国家三级标准规定,按照国家三级标准规定,按照国家三级标准规定,按照国家三级标准规定,'
  246. },
  247. {
  248. id: 1,
  249. name: '聚酰胺/非离子表面活性剂Lutensol XP',
  250. norm: '15kg/桶',
  251. num: '10桶',
  252. price: '18999.89',
  253. type: 3,
  254. standard: '按照国家三级标准规定,按照国家三级标准规定,按照国家三级标准规定,按照国家三级标准规定,'
  255. }
  256. ],
  257. imgs: [
  258. ],
  259. delivery_address: '山东省济南市历下区XX街道',
  260. delivery_date: '2022-09-12',
  261. rekease_date: '2022-06-12',
  262. form: '散装/货柜/整船/整仓',
  263. loading_dock: '饶平县海山镇222省道三百门码头附近',
  264. arrival_wharf: '云霄县福崎北路与沿海大道交叉口东南60米',
  265. technology: '生产技术标准按照国家三级验收标准规定来说,生产技术标准按照国家三级验收标准规定来说,生产技术标准按照国家…',
  266. acceptance: '生产技术标准按照国家三级验收标准规定来说,生产技术标准按照国家三级验收',
  267. },
  268. quotation_show: false,
  269. detail_show: false,
  270. offer: '',
  271. lead_time: '',
  272. description: '',
  273. is_stock: false,
  274. fileList1: [],
  275. index: 0,
  276. share_show: false,
  277. }
  278. },
  279. onLoad(options) {
  280. that = this
  281. that.id = options.id
  282. },
  283. methods: {
  284. // 收藏
  285. collect() {
  286. if(that.pageData.is_collect == 0) {
  287. that.pageData.is_collect = 1
  288. $api.info('收藏成功')
  289. } else {
  290. that.pageData.is_collect = 0
  291. $api.info('取消收藏')
  292. }
  293. },
  294. // 打开填写报价信息
  295. start() {
  296. that.quotation_show = true
  297. },
  298. // 打开报价信息
  299. see(index) {
  300. that.index = index
  301. that.detail_show = true
  302. },
  303. // 关闭弹窗
  304. close() {
  305. that.quotation_show = false
  306. that.detail_show = false
  307. },
  308. // 是否现货
  309. change(e) {
  310. console.log(e);
  311. that.is_stock = e
  312. },
  313. // 删除图片
  314. deletePic(event) {
  315. this[`fileList${event.name}`].splice(event.index, 1)
  316. },
  317. // 新增图片
  318. async afterRead(event) {
  319. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  320. let lists = [].concat(event.file)
  321. let fileListLen = this[`fileList${event.name}`].length
  322. lists.map((item) => {
  323. this[`fileList${event.name}`].push({
  324. ...item,
  325. status: 'uploading',
  326. message: '上传中'
  327. })
  328. })
  329. for (let i = 0; i < lists.length; i++) {
  330. const result = await this.uploadFilePromise(lists[i].url)
  331. let item = this[`fileList${event.name}`][fileListLen]
  332. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  333. status: 'success',
  334. message: '',
  335. url: result
  336. }))
  337. fileListLen++
  338. }
  339. },
  340. uploadFilePromise(url) {
  341. return new Promise((resolve, reject) => {
  342. let a = uni.uploadFile({
  343. url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
  344. filePath: url,
  345. name: 'file',
  346. formData: {
  347. user: 'test'
  348. },
  349. success: (res) => {
  350. setTimeout(() => {
  351. resolve(res.data.data)
  352. }, 1000)
  353. }
  354. });
  355. })
  356. },
  357. // 分享
  358. share() {
  359. that.share_show = true
  360. },
  361. // 取消
  362. cancel(e) {
  363. that.share_show = e
  364. },
  365. },
  366. }
  367. </script>
  368. <style lang="scss" scoped>
  369. .content::v-deep {
  370. background: url('/static/images/comment/background.png') #f4f4f4 no-repeat;
  371. background-size: 100%;
  372. .box {
  373. margin: 20rpx 30rpx 0;
  374. width: 690rpx;
  375. background: #FFFFFF;
  376. border-radius: 20rpx;
  377. padding: 20rpx;
  378. .top {
  379. padding-bottom: 24rpx;
  380. border-bottom: 1rpx solid #F4F4F4;
  381. .order_no {
  382. font-size: 24rpx;
  383. font-weight: 400;
  384. color: #222222;
  385. }
  386. .type {
  387. width: 100rpx;
  388. height: 36rpx;
  389. background: #506DFF;
  390. border-radius: 4rpx;
  391. font-size: 20rpx;
  392. font-weight: 400;
  393. color: #FFFFFF;
  394. text-align: center;
  395. line-height: 36rpx;
  396. }
  397. .type1 {
  398. background: #506DFF;
  399. }
  400. .type2 {
  401. background: #FEA227;
  402. }
  403. .type3 {
  404. background: #54D2C5;
  405. }
  406. .type4 {
  407. background: #60CE8A;
  408. }
  409. }
  410. .title {
  411. margin: 20rpx 0 24rpx;
  412. font-size: 30rpx;
  413. font-weight: 500;
  414. color: #222222;
  415. }
  416. .img {
  417. width: 208rpx;
  418. height: 208rpx;
  419. border-radius: 16rpx;
  420. margin: 0 14rpx 20rpx 0;
  421. }
  422. .img:nth-child(3n) {
  423. margin: 0 0 20rpx;
  424. }
  425. .padT-16{
  426. padding-top: 16rpx;
  427. }
  428. .padR-20 {
  429. padding-right: 20rpx;
  430. }
  431. .cell {
  432. padding: 10rpx 0;
  433. }
  434. .list {
  435. width: 100%;
  436. .list_item {
  437. width: 100%;
  438. box-sizing: border-box;
  439. padding: 20rpx;
  440. background: #F4F4F4;
  441. border-radius: 8px;
  442. margin-top: 20rpx;
  443. .item_title {
  444. font-size: 28rpx;
  445. font-weight: 400;
  446. color: #222222;
  447. }
  448. .item_btn {
  449. width: 570rpx;
  450. margin: 0 auto;
  451. height: 76rpx;
  452. text-align: center;
  453. line-height: 76rpx;
  454. font-size: 32rpx;
  455. font-weight: 400;
  456. color: #506DFF;
  457. }
  458. .item_btn1 {
  459. width: 120rpx;
  460. height: 44rpx;
  461. border-radius: 22rpx;
  462. border: 1px solid #506DFF;
  463. padding: 0 8rpx;
  464. box-sizing: border-box;
  465. font-size: 16rpx;
  466. font-weight: 400;
  467. color: #506DFF;
  468. }
  469. .btn1 {
  470. background: #EAF4FF;
  471. border-radius: 12rpx;
  472. border: 1px solid #536FFE;
  473. }
  474. .btn2 {
  475. background: #C5C5C5;
  476. border-radius: 6px;
  477. color: #FFFFFF;
  478. }
  479. .item_img {
  480. width: 36rpx;
  481. height: 44rpx;
  482. margin-right: 8rpx;
  483. }
  484. }
  485. }
  486. }
  487. .text_style1 {
  488. font-size: 20rpx;
  489. font-weight: 400;
  490. color: #444444;
  491. }
  492. .text_style2 {
  493. font-size: 24rpx;
  494. font-weight: 400;
  495. color: #666666;
  496. line-height: 34rpx;
  497. }
  498. .black {
  499. color: #222222;
  500. }
  501. .bottom {
  502. width: 100%;
  503. z-index: 9;
  504. position: fixed;
  505. bottom: 0;
  506. height: 166rpx;
  507. background: #FFFFFF;
  508. box-sizing: border-box;
  509. padding: 8rpx 30rpx 74rpx;
  510. .bottom_btn {
  511. width: 530rpx;
  512. height: 84rpx;
  513. background: #506DFF;
  514. border-radius: 42rpx;
  515. font-size: 36rpx;
  516. font-weight: 500;
  517. color: #FFFFFF;
  518. text-align: center;
  519. line-height: 84rpx;
  520. }
  521. .bottom_btn1 {
  522. width: 204rpx;
  523. height: 84rpx;
  524. border-radius: 21px;
  525. border: 1px solid #506DFF;
  526. font-size: 36rpx;
  527. font-weight: 500;
  528. color: #506DFF;
  529. text-align: center;
  530. line-height: 84rpx;
  531. margin-right: 20rpx;
  532. }
  533. .bottom_btn2 {
  534. width: 300rpx;
  535. height: 84rpx;
  536. border-radius: 21px;
  537. background: #506DFF;
  538. color: #FFFFFF;
  539. font-size: 36rpx;
  540. font-weight: 500;
  541. text-align: center;
  542. line-height: 84rpx;
  543. }
  544. .bottom_img {
  545. width: 40rpx;
  546. height: 40rpx;
  547. }
  548. }
  549. .popup {
  550. width: 670rpx;
  551. background: #FFFFFF;
  552. border-radius: 10px;
  553. box-sizing: border-box;
  554. padding: 36rpx 30rpx 24rpx;
  555. .popup_title {
  556. width: 100%;
  557. text-align: center;
  558. font-size: 32rpx;
  559. font-weight: 500;
  560. color: #222222;
  561. margin-bottom: 24rpx;
  562. }
  563. .popup_name {
  564. font-size: 26rpx;
  565. font-weight: 400;
  566. color: #222222;
  567. padding: 28rpx 0 20rpx;
  568. }
  569. .popup_text {
  570. font-size: 22rpx;
  571. font-weight: 500;
  572. color: #777777;
  573. padding-right: 60rpx;
  574. }
  575. .input_bg {
  576. background: #F4F4F4;
  577. border-radius: 8px;
  578. box-sizing: border-box;
  579. padding: 16rpx 20rpx;
  580. margin: 20rpx 0;
  581. .price {
  582. font-size: 32rpx;
  583. font-weight: 500;
  584. color: #222222;
  585. padding-right: 20rpx;
  586. }
  587. .u-textarea {
  588. background-color: #F4F4F4 !important;
  589. }
  590. .red {
  591. font-size: 28rpx;
  592. font-weight: bold;
  593. color: #FF3636;
  594. }
  595. }
  596. .popup_info {
  597. font-size: 20rpx;
  598. font-weight: 400;
  599. color: #C0C0C0;
  600. line-height: 28rpx;
  601. }
  602. .popup_btn {
  603. width: 610rpx;
  604. height: 80rpx;
  605. background: #506DFF;
  606. border-radius: 40rpx;
  607. font-size: 32rpx;
  608. font-weight: 500;
  609. color: #FFFFFF;
  610. text-align: center;
  611. line-height: 80rpx;
  612. margin: 20rpx 0;
  613. }
  614. }
  615. }
  616. </style>