orderDetail.vue 34 KB

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