orderDetail.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161
  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="tab == 0">采购订单</view>
  7. <view class="type type2" v-if="tab == 1">生产订单</view>
  8. <view class="type type3" v-if="tab == 2">外协订单</view>
  9. <view class="type type4" v-if="tab == 3">海运订单</view>
  10. </view>
  11. <view class="title">{{pageData.merchant.company}}</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.merchant.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.real_name}}
  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.mobile}}
  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.items" :key="index">
  41. <view class="list_item" v-if="tab == 0">
  42. <view class="item_title cell">{{item.name}}</view>
  43. <view class="hflex acenter cell">
  44. <view class="text_style2 padR-20">规格:{{item.spec}}</view>
  45. <view class="text_style2">数量:{{item.number}}</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.status == 2" @click="see(index)">已接单,立即查看</view>
  53. <view class="item_btn btn1" v-if="item.status == 1" @click="start(item.id)">立即接单</view>
  54. <view class="item_btn btn2" v-if="item.status == 3">不用报价,已匹配接单人</view>
  55. </view>
  56. </view>
  57. <view class="list_item" v-if="tab == 1 || tab == 2">
  58. <view class="item_title">{{item.name}}</view>
  59. <view class="hflex acenter cell">
  60. <view class="text_style2 padR-20" v-if="item.spec">规格型号:{{item.spec}}</view>
  61. <view class="text_style2" v-if="item.number">生产数量:{{item.number}}</view>
  62. </view>
  63. <view class="vflex">
  64. <block v-for="(item2,index2) in item.enclosure" :key="index2">
  65. <view class="hflex acenter jbetween" style="margin-top: 20rpx;">
  66. <view class="hflex acenter" v-if="item2.filename">
  67. <image :src="item2.icon" class="item_img"></image>
  68. <view class="text_style1">{{item2.filename}}</view>
  69. </view>
  70. <view class="hflex acenter jcenter item_btn1" v-if="item2.fileurl">
  71. <u-icon name="download" color="#506DFF" size="10"></u-icon>
  72. <view @click.stop="download(index,index2)">下载附件</view>
  73. </view>
  74. </view>
  75. </block>
  76. </view>
  77. </view>
  78. <view class="list_item" v-if="tab == 3">
  79. <view class="item_title cell">{{item.name}}</view>
  80. <view class="hflex acenter cell">
  81. <view class="text_style2 padR-20">数量/吨位:{{item.weight}}</view>
  82. </view>
  83. </view>
  84. </block>
  85. </view>
  86. <view class="" v-if="tab == 1 || tab == 2">
  87. <view class="hflex acenter fwrap text_style2 cell">生产技术标准:{{pageData.standard_tech}}</view>
  88. <view class="hflex acenter fwrap text_style2 cell">生产验收标准:{{pageData.standard_check}}</view>
  89. </view>
  90. <view v-if="pageData.images">
  91. <view v-if="pageData.images.length > 0">
  92. <view class="title">图片/视频</view>
  93. <view>
  94. <block v-for="(item,index) in pageData.images" :key="index">
  95. <image v-if="item.type == 'image'" :src="item.src" class="img" mode="aspectFill"></image>
  96. <video class="img" v-else :src="item.src"></video>
  97. </block>
  98. </view>
  99. </view>
  100. </view>
  101. <view v-if="tab == 3">
  102. <view class="hflex acenter padT-16">
  103. <view class="text_style2">包装形式:</view>
  104. <view class="text_style2 black">{{pageData.form}}</view>
  105. </view>
  106. <view class="hflex acenter padT-16">
  107. <view class="text_style2">装货码头:</view>
  108. <view class="text_style2 black">{{pageData.wharf_to}}</view>
  109. </view>
  110. <view class="hflex acenter padT-16">
  111. <view class="text_style2">到港码头:</view>
  112. <view class="text_style2 black">{{pageData.wharf_for}}</view>
  113. </view>
  114. </view>
  115. </view>
  116. <view class="box" style="margin-bottom: 186rpx;" v-if="tab != 3">
  117. <view class="hflex acenter padT-16">
  118. <view class="text_style2">交货地址:</view>
  119. <view class="text_style2 black">{{pageData.post_address}}</view>
  120. </view>
  121. <view class="hflex acenter padT-16">
  122. <view class="text_style2">交货日期:</view>
  123. <view class="text_style2 black">{{pageData.post_time}}</view>
  124. </view>
  125. <view class="hflex acenter padT-16">
  126. <view class="text_style2">发布日期:</view>
  127. <view class="text_style2 black">{{pageData.create_time}}</view>
  128. </view>
  129. </view>
  130. <view style="margin-bottom: 186rpx;" v-else></view>
  131. <view class="bottom hflex acenter jbetween">
  132. <view class="hflex acenter">
  133. <view class="vflex acenter" style="margin-right: 42rpx;" @click="collect">
  134. <u-icon name="star" color="#444444" size="20" v-if="!pageData.is_fav"></u-icon>
  135. <u-icon name="star-fill" color="#506DFF" size="20" v-else></u-icon>
  136. <view class="text_style1">收藏</view>
  137. </view>
  138. <view class="vflex acenter" @click="share('Poster1')">
  139. <image src="https://ship-expert.zhousi.hdlkeji.com/common/share.png" mode="" class="bottom_img"></image>
  140. <view class="text_style1">分享</view>
  141. </view>
  142. </view>
  143. <view v-if="tab == 0">
  144. <view class="bottom_btn" v-if="pageData.type == 2" @click="chat">私信聊聊</view>
  145. </view>
  146. <view class="hflex acenter" v-if="tab != 0">
  147. <view class="bottom_btn1" @click="chat" v-if="pageData.type == 2">私信聊聊</view>
  148. <view class="bottom_btn2" @click="start(pageData.id)" v-if="pageData.status == 1">开始接单</view>
  149. <view class="bottom_btn2 bottom_btn2_alear" @click="see(index)" v-if="pageData.status == 2">已接单,立即查看</view>
  150. <view class="bottom_btn2" v-if="pageData.status == 3">已匹配</view>
  151. </view>
  152. </view>
  153. <u-popup :show="quotation_show" mode="center" :round="10" :closeable="true" :safeAreaInsetBottom="false" @close="close">
  154. <view class="popup">
  155. <view class="popup_title">填写报价信息</view>
  156. <view class="input_bg hflex acenter">
  157. <view class="price">¥</view>
  158. <u-input v-model="offer" placeholder="填写你的报价" border="none"></u-input>
  159. </view>
  160. <view class="hflex acenter">
  161. <image src="https://ship-expert.zhousi.hdlkeji.com/common/icon_tips.png" style="width: 24rpx;height: 24rpx;padding-right: 6rpx"></image>
  162. <view class="popup_info">报价可先不填,可等评估后再填写</view>
  163. </view>
  164. <view class="input_bg hflex acenter" v-if="tab == 2 || tab == 3">
  165. <view class="price">报价说明</view>
  166. <u-input v-model="description" placeholder="例如:税前/税后" border="none"></u-input>
  167. </view>
  168. <view class="input_bg hflex acenter" v-else>
  169. <view class="price">货期</view>
  170. <u-input v-model="lead_time" placeholder="例如: 1个月" border="none"></u-input>
  171. </view>
  172. <view class="input_bg" v-if="tab == 0 || tab == 1">
  173. <view class="price">产品介绍以及报价说明</view>
  174. <u--textarea v-model="description" placeholder="例如:税前/税后" border="none"></u--textarea>
  175. </view>
  176. <view class="hflex acenter jbetween" v-if="tab == 0">
  177. <view class="price">是否现货</view>
  178. <u-switch v-model="is_stock" activeColor="#506dff" @change="change"></u-switch>
  179. </view>
  180. <view class="hflex acenter" style="padding-bottom: 20rpx;">
  181. <view class="price">上传图片及资质证明图片</view>
  182. <image src="https://ship-expert.zhousi.hdlkeji.com/common/icon_tips.png" style="width: 24rpx;height: 24rpx;padding-right: 6rpx"></image>
  183. <view class="popup_info">最多上传9张图片</view>
  184. </view>
  185. <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="9"></u-upload>
  186. <view class="popup_btn" @click="receiving">立即接单</view>
  187. <view class="price">友情提醒:</view>
  188. <view class="popup_info">请认真核算报价,报价后不可修改和删除,报价时间约需x天内报价,逾期影响信用等级。</view>
  189. </view>
  190. </u-popup>
  191. <u-popup :show="detail_show" mode="center" :round="10" :closeable="true" :safeAreaInsetBottom="false" @close="close">
  192. <view class="popup">
  193. <view class="popup_title">报价信息</view>
  194. <view class="popup_name">报价说明</view>
  195. <view class="input_bg" v-if="tab == 0">{{pageData.items[index].user_order.desc}}</view>
  196. <view class="input_bg" v-else>{{pageData.user_order.desc}}</view>
  197. <view class="popup_name">当前报价</view>
  198. <block v-if="tab==0">
  199. <block v-for="(item,index) in pageData.items[index].user_order.amounts" :key="index">
  200. <view class="hflex acenter input_bg">
  201. <view class="popup_text">第{{index+1}}次报价</view>
  202. <view class="red">{{item.amount}}</view>
  203. </view>
  204. </block>
  205. </block>
  206. <block v-else>
  207. <block v-for="(item,index) in pageData.user_order.amounts" :key="index">
  208. <view class="hflex acenter input_bg">
  209. <view class="popup_text">第{{index+1}}次报价</view>
  210. <view class="red">{{item.amount}}</view>
  211. </view>
  212. </block>
  213. </block>
  214. <view class="popup_name">图片及资质证明图片</view>
  215. <block v-if="pageData.tab == 1">
  216. <block v-for="(item,index1) in pageData.items[index].user_order.images" :key="index1">
  217. <image :src="item" mode="aspectFill" style="width: 188rpx;height: 188rpx;margin: 0 14rpx 20rpx 0;border-radius: 16rpx;"></image>
  218. </block>
  219. </block>
  220. <block v-else>
  221. <block v-for="(item,index1) in pageData.user_order.images" :key="index1">
  222. <image :src="item" mode="aspectFill" style="width: 188rpx;height: 188rpx;margin: 0 14rpx 20rpx 0;border-radius: 16rpx;"></image>
  223. </block>
  224. </block>
  225. <view class="popup_btn" @click="toDetail(index)">查看详情</view>
  226. </view>
  227. </u-popup>
  228. <view class="share_content" :class="share_show?'':'share_content1'">
  229. <!-- <view style="width: 100%;height: 168rpx;"></view> -->
  230. <view class="share_box vflex">
  231. <text class="share_name Poster1" style="margin: 40rpx 0 28rpx;" :data-enode="pageData.merchant.company">{{pageData.merchant.company}}</text>
  232. <view class="share_boxbg Poster1">
  233. <view class="Poster1 share_cell" data-enode="商品明细">商品明细</view>
  234. <block v-if="tab !== 4">
  235. <!-- <block v-for="(item,index) in pageData.items" :key="index"> -->
  236. <view class="item_title Poster1" :data-enode="pageData.items[0].name">{{pageData.items[0].name}}</view>
  237. <view class="hflex acenter">
  238. <view class="text_style2 padR-20 Poster1" :data-enode="'规格:'+pageData.items[0].spec">规格:{{pageData.items[0].spec}}</view>
  239. <view class="text_style2 Poster1" :data-enode="'数量:'+pageData.items[0].number">数量:{{pageData.items[0].number}}</view>
  240. </view>
  241. <!-- </block> -->
  242. </block>
  243. <block v-if="tab == 4">
  244. <!-- <block v-for="(item,index) in pageData.items" :key="index"> -->
  245. <view class="item_title Poster1" :data-enode="pageData.items[0].name">{{pageData.items[0].name}}</view>
  246. <view class="hflex acenter cell">
  247. <view class="text_style2 padR-20 Poster1" :data-enode="'数量/吨位:'+pageData.items[0].weight">数量/吨位:{{pageData.items[0].weight}}</view>
  248. </view>
  249. <!-- </block> -->
  250. </block>
  251. </view>
  252. <view class="share_label Poster1" :data-enode="'交货日期' + pageData.post_time" v-if="tab !== 3">交货日期:{{pageData.post_time}}</view>
  253. <view class="Poster1 share_label" :data-enode="'包装形式' + pageData.form" v-else>包装形式:{{pageData.form}}</view>
  254. <view class="hflex acenter share_text jcenter Poster1" style=" margin: 0 190rpx 12rpx;" data-enode="扫码查看订单详情">扫码查看订单详情</view>
  255. <view style="width: 100%;" class="vflex acenter jcenter">
  256. <image class="Poster1" style="width: 25rpx;height: 20rpx;" :data-enode="style.img1" data-etype="image" :src="style.img1"></image>
  257. <image class="Poster1" style="width: 100%;height: 2rpx;margin: 30rpx 0;" :data-enode="style.img2" data-etype="image" :src="style.img2"></image>
  258. </view>
  259. <view class="hflex acenter jbetween">
  260. <view class="vflex">
  261. <view class="share_name Poster1" style="margin: 54rpx 0 20rpx;" data-enode="船百知">船百知</view>
  262. <view class="share_text Poster1" style="margin: 0 0 36rpx;" data-enode="船百知伴你一起杨帆启航,驶向成功彼岸">船百知伴你一起杨帆启航,驶向成功彼岸</view>
  263. </view>
  264. <image class="Poster1" data-etype="image" :data-enode="style.code" :src="style.code" style="width: 136rpx;height: 136rpx;" shape="10"></image>
  265. <!-- <image class="Poster1" data-etype="image" :data-enode="share_img" :src="share_img" style="width: 136rpx;height: 136rpx;"></image> -->
  266. </view>
  267. </view>
  268. <evils-el-poster width="325" height="467" @on-error="onError" :list="list" backgroundColor="rgb(255, 255, 255)" @on-success="onSuccess" ref="Eposter"></evils-el-poster>
  269. <view class="share_bottom">
  270. <view class="hflex acenter jcenter">
  271. <button class="vflex acenter jcenter bottom_item" open-type="share">
  272. <image src="https://ship-expert.zhousi.hdlkeji.com/common/wx.png" class="item_icon"></image>
  273. <view class="item_text">微信好友</view>
  274. </button>
  275. <!-- <button class="vflex acenter jcenter bottom_item" open-type="share">
  276. <image src="https://ship-expert.zhousi.hdlkeji.com/common/moments.png" class="item_icon"></image>
  277. <view class="item_text">朋友圈</view>
  278. </button> -->
  279. <view class="vflex acenter jcenter bottom_item" @click="saveImg">
  280. <image src="https://ship-expert.zhousi.hdlkeji.com/common/download.png" class="item_icon"></image>
  281. <view class="item_text">保存图片</view>
  282. </view>
  283. </view>
  284. <view class="share_cancel" @click="close">取消</view>
  285. </view>
  286. </view>
  287. <u-popup :show="down_show" mode="center" @close="close">
  288. <view class="popu">
  289. <view class="popu_top hflex acenter jbetween">
  290. <view></view>
  291. <view class="popu_title">下载文件</view>
  292. <image src="https://ship-expert.zhousi.hdlkeji.com/common/close.png" style="width: 32rpx;height: 32rpx;" @click="close"></image>
  293. </view>
  294. <view class="file_bg hflex acenter">
  295. <image :src="pageData.items[index1].enclosure[index2].icon" class="file_icon"></image>
  296. <view class="file_name text_hide" style="max-width: 400rpx;">{{pageData.items[index1].enclosure[index2].filename}}</view>
  297. </view>
  298. <view class="btn_group hflex acenter jbetween">
  299. <view class="left_btn hflex acenter jcenter" @click="copy(pageData.items[index1].enclosure[index2].fileurl)">复制链接</view>
  300. <view class="right_btn hflex acenter jcenter" @click="privince(pageData.items[index1].enclosure[index2].fileurl)">预览文件</view>
  301. </view>
  302. <!-- <view class="hflex acenter jcenter text_blue" @click="privince(pageData.items[index1].enclosure[index2].fileurl)">预览文件></view> -->
  303. </view>
  304. </u-popup>
  305. </view>
  306. </template>
  307. <script>
  308. import $api from '@/static/js/api.js'
  309. var that = ''
  310. export default {
  311. data() {
  312. return {
  313. id: '',
  314. pageData: {
  315. },
  316. quotation_show: false,
  317. detail_show: false,
  318. offer: '',
  319. lead_time: '',
  320. description: '',
  321. is_stock: false,
  322. fileList1: [],
  323. index: -1,
  324. share_show: false,
  325. tab: '',
  326. id2: '',
  327. list: [],
  328. style: {
  329. img1: 'https://ship-expert.zhousi.hdlkeji.com/common/down2.png',
  330. img2: 'https://ship-expert.zhousi.hdlkeji.com/common/line.png',
  331. code: 'https://ship-expert.zhousi.hdlkeji.com/common/code.jpg'
  332. },
  333. tempImage:'',
  334. down_show:false,
  335. index1: 0,
  336. index2: 0,
  337. share_img: '',
  338. }
  339. },
  340. onLoad(options) {
  341. that = this
  342. that.id = options.id
  343. that.tab = options.tab
  344. that.getData()
  345. that.getShareimg()
  346. },
  347. onShareAppMessage(res) {
  348. console.log(res);
  349. if (res.from === 'button') {// 来自页面内分享按钮
  350. console.log(res.target)
  351. }
  352. return {
  353. title: '船百知', //分享的名称
  354. }
  355. },
  356. onShareTimeline(res) {
  357. console.log(res);
  358. return {
  359. title: '船百知',
  360. type: 0,
  361. summary: "",
  362. }
  363. },
  364. methods: {
  365. getData() {
  366. console.log(that.tab);
  367. var url = ''
  368. switch(that.tab) {
  369. case '0' :
  370. url = '/data/api.auth.Purchase/show';
  371. break;
  372. case '1' :
  373. url = '/data/api.auth.Purchase/production_show';
  374. break;
  375. case '2' :
  376. url = '/data/api.auth.Purchase/coor_show';
  377. break;
  378. case '3' :
  379. url = '/data/api.auth.Purchase/ocean_show';
  380. break;
  381. }
  382. $api.req({
  383. url: url,
  384. data: {
  385. id: that.id
  386. }
  387. }, function(res) {
  388. if(res.code == 1) {
  389. that.pageData = res.data
  390. }
  391. })
  392. },
  393. getShareimg() {
  394. $api.req({
  395. url: '/data/api.auth.Center/getrule',
  396. method: 'POST',
  397. }, function(res) {
  398. if(res.code == 1) {
  399. that.share_img = res.data.download_url_code
  400. }
  401. })
  402. },
  403. // 收藏
  404. collect() {
  405. if(that.pageData.is_fav) {
  406. that.pageData.is_fav = false
  407. } else {
  408. that.pageData.is_fav = true
  409. }
  410. $api.req({
  411. url: '/data/api.auth.Purchase/favourite',
  412. method: 'POST',
  413. data: {
  414. id: that.id,
  415. tab: Number(that.tab) + 1,
  416. action: that.pageData.is_fav?1:0
  417. }
  418. }, function(res) {
  419. if(res.code == 1) {
  420. $api.info(res.info)
  421. }
  422. })
  423. },
  424. chat() {
  425. var my = uni.getStorageSync("myUsername");
  426. var nameList = {
  427. myName: my,
  428. your: that.pageData.huanxinID,
  429. };
  430. uni.navigateTo({
  431. url: "/pages/chatroom/chatroom?username=" + JSON.stringify(nameList),
  432. });
  433. /* var tab = Number(that.tab) + 1
  434. $api.jump('/page_index/pages/purchase/chat?id=' + that.id + '&tab=' + tab) */
  435. },
  436. // 打开填写报价信息
  437. start(id) {
  438. that.id2 = id
  439. that.quotation_show = true
  440. },
  441. // 打开报价信息
  442. see(index) {
  443. that.index = index
  444. that.detail_show = true
  445. },
  446. download(index1,index2) {
  447. that.index1 = index1
  448. that.index2 = index2
  449. that.down_show = true
  450. },
  451. copy(value) {
  452. uni.setClipboardData({
  453. data: value,
  454. success: function () {
  455. $api.info('复制成功')
  456. }
  457. });
  458. },
  459. down(url) {
  460. wx.downloadFile({
  461. url: url, //仅为示例,并非真实的资源
  462. success (res) {
  463. // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
  464. if (res.statusCode === 200) {
  465. const filePath = res.tempFilePath
  466. uni.saveFile({
  467. tempFilePath: filePath,
  468. success: function(res) {
  469. console.log(res);
  470. that.close()
  471. // $api.info("下载成功")
  472. uni.setClipboardData({
  473. data: res.savedFilePath,
  474. success: function () {
  475. $api.info('下载成功,路径已复制到剪贴板中')
  476. }
  477. });
  478. // that.privince(res.savedFilePath)
  479. }
  480. })
  481. }
  482. }
  483. })
  484. },
  485. privince(url) {
  486. that.close()
  487. wx.downloadFile({
  488. // 示例 url,并非真实存在
  489. url: url,
  490. showMenu: true,
  491. success: function (res) {
  492. const filePath = res.tempFilePath
  493. wx.openDocument({
  494. filePath: filePath,
  495. success: function (res) {
  496. console.log('打开文档成功')
  497. }
  498. })
  499. }
  500. })
  501. },
  502. // 关闭弹窗
  503. close() {
  504. that.quotation_show = false
  505. that.detail_show = false
  506. that.share_show = false
  507. that.down_show = false
  508. },
  509. // 是否现货
  510. change(e) {
  511. console.log(e);
  512. that.is_stock = e
  513. },
  514. toDetail(index) {
  515. var tab = Number(that.tab) + 1
  516. $api.jump('/page_shop/pages/order/offer?id=' + that.id + '&tab=' + tab + '&index=' + index)
  517. that.close()
  518. },
  519. // 删除图片
  520. deletePic(event) {
  521. this[`fileList${event.name}`].splice(event.index, 1)
  522. },
  523. // 新增图片
  524. async afterRead(event) {
  525. uni.showLoading({
  526. title: '上传中',
  527. mask: true
  528. })
  529. let lists = [].concat(event.file)
  530. let fileListLen = this[`fileList${event.name}`].length
  531. lists.map((item) => {
  532. this[`fileList${event.name}`].push({
  533. ...item,
  534. // status: 'uploading',
  535. // message: '上传中'
  536. })
  537. })
  538. for (let i = 0; i < lists.length; i++) {
  539. const result = await this.uploadFilePromise(lists[i].url)
  540. let item = this[`fileList${event.name}`][fileListLen]
  541. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  542. // status: 'success',
  543. // message: '',
  544. type: result.type,
  545. url: result.url
  546. }))
  547. fileListLen++
  548. if(lists.length - 1 == i) {
  549. uni.hideLoading()
  550. }
  551. }
  552. },
  553. uploadFilePromise(url) {
  554. return new Promise((resolve, reject) => {
  555. let a = uni.uploadFile({
  556. url: $api.config.baseUrl + '/data/api.auth.Center/upload',
  557. filePath: url,
  558. name: 'file',
  559. header: {
  560. 'content-type': 'application/x-www-form-urlencoded',
  561. 'api-token': uni.getStorageSync('token').token?uni.getStorageSync('token').token:'',
  562. 'api-name': 'wxapp'
  563. },
  564. // formData: {
  565. // user: 'test'
  566. // },
  567. success: (res) => {
  568. setTimeout(() => {
  569. var data = JSON.parse(res.data)
  570. console.log('data:',data);
  571. var type = data.data.key.split('.')
  572. if(type[1] == 'mp4') {
  573. that.$set(data.data,'type','video')
  574. } else {
  575. that.$set(data.data,'type','image')
  576. }
  577. resolve(data.data)
  578. }, 1000)
  579. }
  580. });
  581. })
  582. },
  583. receiving() {
  584. var imgsList = []
  585. for(var i=0;i<that.fileList1.length;i++) {
  586. imgsList.push(that.fileList1[i].url)
  587. }
  588. var url = ""
  589. var data = ""
  590. if(that.description == "") {
  591. $api.info('请填写报价说明')
  592. return
  593. }
  594. if(imgsList == "") {
  595. $api.info('请上传图片资质')
  596. return
  597. }
  598. switch(that.tab) {
  599. case '0':
  600. url = '/data/api.auth.Purchase/purchase_create';
  601. data = {
  602. id: that.id2,
  603. amount: that.offer,
  604. date: that.lead_time,
  605. desc: that.description,
  606. is_have: that.is_stock?1:0,
  607. images: imgsList,
  608. };
  609. break;
  610. case '1':
  611. url = '/data/api.auth.Purchase/production_create';
  612. data = {
  613. id: that.id2,
  614. amount: that.offer,
  615. date: that.lead_time,
  616. desc: that.description,
  617. images: imgsList,
  618. };
  619. break;
  620. case '2':
  621. url = '/data/api.auth.Purchase/coor_create';
  622. data = {
  623. id: that.id2,
  624. amount: that.offer,
  625. desc: that.description,
  626. images: imgsList,
  627. };
  628. break;
  629. case '3':
  630. url = '/data/api.auth.Purchase/ocean_create';
  631. data = {
  632. id: that.id2,
  633. amount: that.offer,
  634. desc: that.description,
  635. images: imgsList,
  636. };
  637. break;
  638. }
  639. $api.req({
  640. url: url,
  641. method: 'POST',
  642. data: data
  643. }, function(res) {
  644. if(res.code == 1) {
  645. $api.info(res.info)
  646. that.close()
  647. that.getData()
  648. }
  649. })
  650. },
  651. share(elClass) {
  652. let view = uni.createSelectorQuery().in(this).select(".Poster1");
  653. view.fields({
  654. size: true,
  655. rect: true,
  656. scrollOffset: true
  657. }, data => {
  658. }).exec();
  659. that.share_show = true
  660. that.$refs.Eposter.createForElRect(elClass,false)
  661. },
  662. onSuccess(e) {
  663. console.log(e);
  664. that.tempImage = e
  665. },
  666. onError(err) {
  667. console.log('发生错误');
  668. console.log(err);
  669. },
  670. saveImg() {
  671. console.log(that.tempImage);
  672. uni.authorize({
  673. scope: 'scope.writePhotosAlbum',
  674. success() {
  675. uni.saveImageToPhotosAlbum({
  676. filePath: that.tempImage,
  677. success: function () {
  678. console.log('save success');
  679. $api.info('保存成功')
  680. that.close()
  681. }
  682. });
  683. }
  684. })
  685. },
  686. },
  687. }
  688. </script>
  689. <style lang="scss" scoped>
  690. .content::v-deep {
  691. background: url('https://ship-expert.zhousi.hdlkeji.com/common/background.png') #f4f4f4 no-repeat;
  692. background-size: 100%;
  693. .box {
  694. margin: 20rpx auto 0;
  695. width: 690rpx;
  696. background: #FFFFFF;
  697. border-radius: 20rpx;
  698. padding: 20rpx;
  699. .top {
  700. padding-bottom: 24rpx;
  701. border-bottom: 1rpx solid #F4F4F4;
  702. .order_no {
  703. font-size: 24rpx;
  704. font-weight: 400;
  705. color: #222222;
  706. }
  707. .type {
  708. width: 100rpx;
  709. height: 36rpx;
  710. background: #506DFF;
  711. border-radius: 4rpx;
  712. font-size: 20rpx;
  713. font-weight: 400;
  714. color: #FFFFFF;
  715. text-align: center;
  716. line-height: 36rpx;
  717. }
  718. .type1 {
  719. background: #506DFF;
  720. }
  721. .type2 {
  722. background: #FEA227;
  723. }
  724. .type3 {
  725. background: #54D2C5;
  726. }
  727. .type4 {
  728. background: #60CE8A;
  729. }
  730. }
  731. .title {
  732. margin: 20rpx 0 24rpx;
  733. font-size: 30rpx;
  734. font-weight: 500;
  735. color: #222222;
  736. }
  737. .img {
  738. width: 208rpx;
  739. height: 208rpx;
  740. border-radius: 16rpx;
  741. margin: 0 14rpx 20rpx 0;
  742. }
  743. .img:nth-child(3n) {
  744. margin: 0 0 20rpx;
  745. }
  746. .padT-16{
  747. padding-top: 16rpx;
  748. }
  749. .padR-20 {
  750. padding-right: 20rpx;
  751. }
  752. .cell {
  753. padding: 10rpx 0;
  754. }
  755. .list {
  756. width: 100%;
  757. .list_item {
  758. width: 100%;
  759. box-sizing: border-box;
  760. padding: 20rpx;
  761. background: #F4F4F4;
  762. border-radius: 8px;
  763. margin-top: 20rpx;
  764. .item_title {
  765. font-size: 28rpx;
  766. font-weight: 400;
  767. color: #222222;
  768. }
  769. .item_btn {
  770. width: 570rpx;
  771. margin: 0 auto;
  772. height: 76rpx;
  773. text-align: center;
  774. line-height: 76rpx;
  775. font-size: 32rpx;
  776. font-weight: 400;
  777. color: #506DFF;
  778. }
  779. .item_btn1 {
  780. width: 120rpx;
  781. height: 44rpx;
  782. border-radius: 22rpx;
  783. border: 1px solid #506DFF;
  784. padding: 0 8rpx;
  785. box-sizing: border-box;
  786. font-size: 16rpx;
  787. font-weight: 400;
  788. color: #506DFF;
  789. }
  790. .btn1 {
  791. background: #EAF4FF;
  792. border-radius: 12rpx;
  793. border: 1px solid #536FFE;
  794. }
  795. .btn2 {
  796. background: #C5C5C5;
  797. border-radius: 6px;
  798. color: #FFFFFF;
  799. }
  800. .item_img {
  801. width: 36rpx;
  802. height: 44rpx;
  803. margin-right: 8rpx;
  804. }
  805. }
  806. }
  807. }
  808. .text_style1 {
  809. font-size: 20rpx;
  810. font-weight: 400;
  811. color: #444444;
  812. }
  813. .text_style2 {
  814. font-size: 24rpx;
  815. font-weight: 400;
  816. color: #666666;
  817. line-height: 34rpx;
  818. }
  819. .black {
  820. color: #222222;
  821. }
  822. .bottom {
  823. width: 100%;
  824. z-index: 9;
  825. position: fixed;
  826. bottom: 0;
  827. height: 166rpx;
  828. background: #FFFFFF;
  829. box-sizing: border-box;
  830. padding: 8rpx 30rpx 74rpx;
  831. .bottom_btn {
  832. width: 530rpx;
  833. height: 84rpx;
  834. background: #506DFF;
  835. border-radius: 42rpx;
  836. font-size: 36rpx;
  837. font-weight: 500;
  838. color: #FFFFFF;
  839. text-align: center;
  840. line-height: 84rpx;
  841. }
  842. .bottom_btn1 {
  843. width: 204rpx;
  844. height: 84rpx;
  845. border-radius: 21px;
  846. border: 1px solid #506DFF;
  847. font-size: 36rpx;
  848. font-weight: 500;
  849. color: #506DFF;
  850. text-align: center;
  851. line-height: 84rpx;
  852. }
  853. .bottom_btn2 {
  854. // width: 300rpx;
  855. height: 84rpx;
  856. border-radius: 21px;
  857. background: #506DFF;
  858. color: #FFFFFF;
  859. font-size: 36rpx;
  860. font-weight: 500;
  861. text-align: center;
  862. line-height: 84rpx;
  863. padding: 0 54rpx;
  864. margin:0 20rpx;
  865. }
  866. .bottom_btn2_alear {
  867. background: rgba(80,109,255,0.5);
  868. padding: 0 10rpx;
  869. margin-left: 10rpx;
  870. }
  871. .bottom_img {
  872. width: 40rpx;
  873. height: 40rpx;
  874. }
  875. }
  876. .popup {
  877. width: 670rpx;
  878. background: #FFFFFF;
  879. border-radius: 10px;
  880. box-sizing: border-box;
  881. padding: 36rpx 30rpx 24rpx;
  882. .popup_title {
  883. width: 100%;
  884. text-align: center;
  885. font-size: 32rpx;
  886. font-weight: 500;
  887. color: #222222;
  888. margin-bottom: 24rpx;
  889. }
  890. .popup_name {
  891. font-size: 26rpx;
  892. font-weight: 400;
  893. color: #222222;
  894. padding: 28rpx 0 20rpx;
  895. }
  896. .popup_text {
  897. font-size: 22rpx;
  898. font-weight: 500;
  899. color: #777777;
  900. padding-right: 60rpx;
  901. }
  902. .input_bg {
  903. background: #F4F4F4;
  904. border-radius: 8px;
  905. box-sizing: border-box;
  906. padding: 16rpx 20rpx;
  907. margin: 20rpx 0;
  908. .price {
  909. font-size: 32rpx;
  910. font-weight: 500;
  911. color: #222222;
  912. padding-right: 20rpx;
  913. }
  914. .u-textarea {
  915. background-color: #F4F4F4 !important;
  916. }
  917. .red {
  918. font-size: 28rpx;
  919. font-weight: bold;
  920. color: #FF3636;
  921. }
  922. }
  923. .popup_info {
  924. font-size: 20rpx;
  925. font-weight: 400;
  926. color: #C0C0C0;
  927. line-height: 28rpx;
  928. }
  929. .popup_btn {
  930. width: 610rpx;
  931. height: 80rpx;
  932. background: #506DFF;
  933. border-radius: 40rpx;
  934. font-size: 32rpx;
  935. font-weight: 500;
  936. color: #FFFFFF;
  937. text-align: center;
  938. line-height: 80rpx;
  939. margin: 20rpx 0;
  940. }
  941. }
  942. .share_content {
  943. position: fixed;
  944. top: 0;
  945. left: 0;
  946. z-index: 99;
  947. width: 100vw;
  948. height: 100vh;
  949. background: rgba(0,0,0,0.5);
  950. backdrop-filter: blur(5px);
  951. padding: 0 0 0;
  952. .share_box {
  953. margin: 100rpx auto 0;
  954. width: 650rpx;
  955. background: #FFFFFF;
  956. border-radius: 20rpx;
  957. box-sizing: border-box;
  958. padding: 48rpx 35rpx 0;
  959. .share_name {
  960. width: 100%;
  961. font-size: 32rpx;
  962. font-weight: 500;
  963. color: #222222;
  964. line-height: 44rpx;
  965. }
  966. .share_boxbg {
  967. background: #F4F4F4;
  968. border-radius: 8px;
  969. box-sizing: border-box;
  970. padding: 0 20rpx;
  971. .share_cell {
  972. padding: 20rpx 0;
  973. border-bottom: 1rpx solid #EFEFEF;
  974. }
  975. .item_title {
  976. font-size: 28rpx;
  977. font-weight: 400;
  978. color: #222222;
  979. line-height: 40rpx;
  980. padding: 20rpx 0 16rpx;
  981. }
  982. .text_style2 {
  983. font-size: 24rpx;
  984. font-weight: 400;
  985. color: #888888;
  986. line-height: 34rpx;
  987. }
  988. .padR-20 {
  989. padding-right: 20rpx;
  990. }
  991. }
  992. .share_label {
  993. font-size: 26rpx;
  994. font-weight: 400;
  995. color: #444444;
  996. line-height: 36rpx;
  997. margin: 20rpx 0 54rpx;
  998. }
  999. .share_text {
  1000. font-size: 20rpx;
  1001. font-weight: 400;
  1002. color: #BEBEBE;
  1003. line-height: 28rpx;
  1004. margin: 20rpx 136rpx 18rpx;
  1005. }
  1006. .box_bottom {
  1007. width: 100%;
  1008. padding: 34rpx 0 16rpx;
  1009. border-top: 1rpx dashed #C3C3C3;
  1010. .bottom_left1 {
  1011. font-size: 32rpx;
  1012. font-weight: 500;
  1013. color: #222222;
  1014. line-height: 44rpx;
  1015. padding-bottom: 20rpx;
  1016. }
  1017. .bottom_left2 {
  1018. font-size: 22rpx;
  1019. font-weight: 400;
  1020. color: #999999;
  1021. line-height: 32rpx;
  1022. }
  1023. .bottom_right {
  1024. width: 136rpx;
  1025. height: 136rpx;
  1026. }
  1027. }
  1028. }
  1029. /* .canvas {
  1030. position: absolute;
  1031. top: 128rpx;
  1032. left: 50rpx;
  1033. width: 650rpx;
  1034. min-height: 494rpx;
  1035. background: #FFFFFF;
  1036. border-radius: 20rpx;
  1037. } */
  1038. .share_bottom {
  1039. position: fixed;
  1040. bottom: 0;
  1041. width: 100%;
  1042. height: 388rpx;
  1043. background: #F5F7FF;
  1044. border-radius: 40rpx 40rpx 0px 0px;
  1045. .bottom_item {
  1046. width: 33%;
  1047. margin: 50rpx 0 90rpx;
  1048. border: none !important;
  1049. background-color: #F5F7FF !important;
  1050. .item_icon {
  1051. width: 76rpx;
  1052. height: 76rpx;
  1053. }
  1054. .item_text {
  1055. font-size: 26rpx;
  1056. font-weight: 400;
  1057. color: #333333;
  1058. line-height: 36rpx;
  1059. margin-top: 12rpx;
  1060. }
  1061. }
  1062. button::after {
  1063. border: none !important;
  1064. }
  1065. .share_cancel {
  1066. width: 100%;
  1067. text-align: center;
  1068. font-size: 32rpx;
  1069. font-weight: 400;
  1070. color: #333333;
  1071. line-height: 44rpx;
  1072. }
  1073. }
  1074. }
  1075. .share_content1 {
  1076. z-index: -99 !important;
  1077. }
  1078. .popu {
  1079. width: 630rpx;
  1080. background: #FFFFFF;
  1081. border-radius: 24rpx;
  1082. margin: 0 auto;
  1083. box-sizing: border-box;
  1084. padding: 0 40rpx;
  1085. .popu_top {
  1086. padding: 32rpx 0 40rpx;
  1087. .popu_title {
  1088. font-size: 36rpx;
  1089. font-weight: 500;
  1090. color: #333333;
  1091. line-height: 50rpx;
  1092. }
  1093. }
  1094. .file_bg {
  1095. width: 550rpx;
  1096. height: 100rpx;
  1097. background: #F4F4F4;
  1098. border-radius: 16rpx;
  1099. margin: 0 0 42rpx;
  1100. }
  1101. .file_icon {
  1102. width: 48rpx;
  1103. height: 60rpx;
  1104. }
  1105. .file_name {
  1106. padding-left: 14rpx;
  1107. font-size: 28rpx;
  1108. font-weight: 400;
  1109. color: #333333;
  1110. line-height: 40rpx;
  1111. }
  1112. .btn_group {
  1113. width: 100%;
  1114. padding: 30rpx 0;
  1115. .left_btn {
  1116. width: 260rpx;
  1117. height: 76rpx;
  1118. background: #ECEFFE;
  1119. border-radius: 40rpx;
  1120. font-size: 30rpx;
  1121. font-weight: 500;
  1122. color: #506DFF;
  1123. line-height: 42rpx;
  1124. }
  1125. .right_btn {
  1126. width: 260rpx;
  1127. height: 76rpx;
  1128. background: #506DFF;
  1129. border-radius: 40rpx;
  1130. font-size: 30rpx;
  1131. font-weight: 500;
  1132. color: #FFFFFF;
  1133. line-height: 42rpx;
  1134. }
  1135. }
  1136. .text_blue {
  1137. font-size: 30rpx;
  1138. font-weight: 400;
  1139. color: #506DFF;
  1140. line-height: 42rpx;
  1141. padding: 28rpx 0 46rpx;
  1142. }
  1143. }
  1144. }
  1145. </style>