merge-order.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <template>
  2. <view class="order_info">
  3. <view class="order_con">
  4. <view class="log_info flexS" v-if="orderList[0]">
  5. <image class="avatar" :src="orderList[0].user.avatar" v-if="orderList[0].user"></image>
  6. <text class="iconfont icongeren2" v-else></text>
  7. <view class="user" v-if="orderList[0].user">
  8. <text>客户:</text>
  9. <text>{{ orderList[0].user.nickname | getName(orderList[0].user.phone ? 10 : 16) }}</text>
  10. <text style="margin-left: 10rpx;">{{ orderList[0].user.phone }}</text>
  11. </view>
  12. </view>
  13. <view class="order_box" v-for="(item,idx) in orderList" :key="idx">
  14. <view class="shop_name">
  15. <text>订单号:{{item.order_no}}</text>
  16. </view>
  17. <view class="goods_box">
  18. <view class="goods_con" v-for="temp in item.goods" :key="temp.id">
  19. <view class="goods_info flexS">
  20. <image :src="temp.img" class="goods_img"></image>
  21. <view class="goods_intr">
  22. <text class="goods_name">{{ temp.name }}</text>
  23. <view class="one_year" style="width: 120rpx;">3条装</view>
  24. <view class="price_box" style="margin-top:20rpx;">
  25. <view class="goods_price flexS" v-if="temp.sku[0].price == temp.vip_price">
  26. <view class="flexS">
  27. <view class="vip_ident">VIP</view>
  28. <text class="big_price">
  29. <text>¥</text>
  30. <text>{{ temp.vip_price }}</text>
  31. </text>
  32. </view>
  33. <view class="draw_off">
  34. <text>(</text>
  35. <text class="old_price">
  36. <text class="symbol">¥</text>
  37. <text>{{ temp.price }}</text>
  38. </text>
  39. <text>)</text>
  40. </view>
  41. </view>
  42. <view class="goods_price flexS" v-else>
  43. <text class="big_price">
  44. <text class="symbol">¥</text>
  45. <text>{{ temp.price }}</text>
  46. </text>
  47. <view class="save_box">
  48. VIP可省{{ Number(temp.price) - Number(temp.vip_price) || 0 }}</view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="goods_size" v-for="sku in item.sku" :key="sku.id">
  54. <view class="flexB">
  55. <view>
  56. <text class="gray">款式:</text>
  57. <text>{{ sku.type }}</text>
  58. </view>
  59. <text>{{ sku.price * sku.num }}元</text>
  60. </view>
  61. <view class="flexB">
  62. <view>
  63. <text class="gray">尺码:</text>
  64. </view>
  65. <text>X {{ sku.num }}套</text>
  66. </view>
  67. </view>
  68. <view class="goods_total flexE">
  69. <text style="color:#999;">共{{ subNum(temp) }}套,</text>
  70. <text style="color:#999;">小计:</text>
  71. <view class="price_box">
  72. <view class="goods_price flexS">
  73. <text class="big_price">
  74. <text class="symbol">¥</text>
  75. <text>{{ subtotal(temp) }}</text>
  76. </text>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="flexT" style="margin-top:15rpx;">
  83. <view style="flex-shrink: 0;">订单备注:</view>
  84. <text class="gray" @click="copy(item.remark)"
  85. selectable="true">{{ item.remark ? item.remark : '无' }}
  86. </text>
  87. </view>
  88. </view>
  89. </view>
  90. <view class="send_box flexCC">
  91. <view class="flexC" @click="sendGoods">立即发货</view>
  92. </view>
  93. </view>
  94. </template>
  95. <script>
  96. import {
  97. getNoSendOrder
  98. } from '../../../apis/shop.js';
  99. export default {
  100. data() {
  101. return {
  102. order_no: '',
  103. orderList: [] //订单列表
  104. };
  105. },
  106. onLoad(options) {
  107. if (options.order_no) {
  108. this.order_no = options.order_no;
  109. this.getOrder(this.order_no);
  110. }
  111. },
  112. methods: {
  113. /*复制订单号*/
  114. copy(data) {
  115. uni.setClipboardData({
  116. data,
  117. success: res => {
  118. uni.showToast({
  119. title: '复制成功'
  120. });
  121. },
  122. fail() {
  123. uni.showToast({
  124. title: '复制失败',
  125. icon: 'none',
  126. });
  127. }
  128. })
  129. },
  130. //立即发货
  131. sendGoods() {
  132. let list = this.orderList;
  133. let arr = [];
  134. list.map(i => {
  135. arr.push(i.order_no)
  136. })
  137. let order_no = arr.join(',')
  138. let user_id = this.orderList[0].user_id
  139. uni.navigateTo({
  140. url: '../delivery-method/delivery-method?order_no=' +
  141. order_no + '&user_id=' + user_id
  142. });
  143. },
  144. //小计数量
  145. subNum(data) {
  146. let subNum = 0;
  147. data.sku.map(i => {
  148. subNum += i.num;
  149. });
  150. return subNum;
  151. },
  152. //小计金额
  153. subtotal(data) {
  154. let subtotal = 0;
  155. data.sku.map(j => {
  156. subtotal += j.num * j.price;
  157. });
  158. return subtotal;
  159. },
  160. /*获取订单详情*/
  161. getOrder(order_no) {
  162. uni.showLoading({
  163. title: '加载中...'
  164. });
  165. getNoSendOrder({
  166. order_no
  167. })
  168. .then(res => {
  169. if (res.code == 200) {
  170. this.orderList = res.data;
  171. } else {
  172. uni.showModal({
  173. content: res.data || '获取订单详情失败',
  174. showCancel: false
  175. });
  176. }
  177. uni.hideLoading();
  178. })
  179. .catch(err => {
  180. uni.hideLoading();
  181. });
  182. },
  183. }
  184. };
  185. </script>
  186. <style lang="scss" scoped>
  187. .order_info {
  188. position: relative;
  189. width: 100%;
  190. min-height: 100%;
  191. background: #f9f8f9;
  192. .order_con {
  193. width: 100%;
  194. position: relative;
  195. padding-top: 30rpx;
  196. padding-bottom: 140rpx;
  197. >view {
  198. width: 690rpx;
  199. margin: 0 auto;
  200. background: #fff;
  201. border-radius: 24rpx;
  202. padding: 20rpx 30rpx;
  203. }
  204. .log_info {
  205. box-shadow: 0px 4rpx 8rpx #eeeeee;
  206. border-radius: 24rpx;
  207. width: 692rpx;
  208. height: 112rpx;
  209. background: #fff;
  210. box-sizing: border-box;
  211. .log_box {
  212. border-top: 1rpx solid #eee;
  213. padding-top: 20rpx;
  214. }
  215. .avatar {
  216. width: 50rpx;
  217. height: 50rpx;
  218. border-radius: 50rpx;
  219. margin-right: 15rpx;
  220. flex-shrink: 0;
  221. }
  222. .iconfont {
  223. margin-right: 20rpx;
  224. color: $base-color;
  225. font-size: 45rpx;
  226. font-weight: bold;
  227. }
  228. .badge {
  229. width: 36rpx;
  230. height: 40rpx;
  231. margin-right: 15rpx;
  232. }
  233. .user {
  234. text {
  235. font-size: 32rpx;
  236. font-weight: bold;
  237. }
  238. }
  239. }
  240. .order_box {
  241. width: 690rpx;
  242. margin: 30rpx auto;
  243. padding: 30rpx;
  244. box-sizing: border-box;
  245. .shop_name {
  246. padding: 0 30rpx 20rpx 0;
  247. border-bottom: 2rpx solid #eeeeee;
  248. text {
  249. font-size: 28rpx;
  250. }
  251. .iconfont {
  252. font-size: 35rpx;
  253. color: #999;
  254. margin-right: 10rpx;
  255. vertical-align: -2rpx;
  256. }
  257. }
  258. .goods_box {
  259. .goods_con {
  260. padding-top: 20rpx;
  261. .goods_info {
  262. .goods_img {
  263. width: 200rpx;
  264. height: 160rpx;
  265. margin-right: 26rpx;
  266. border-radius: 8rpx;
  267. flex-shrink: 0;
  268. }
  269. .goods_intr {
  270. .goods_name {
  271. font-size: 30rpx;
  272. font-weight: bold;
  273. }
  274. }
  275. }
  276. }
  277. .goods_size {
  278. margin-top: 30rpx;
  279. >view {
  280. margin-top: 15rpx;
  281. }
  282. }
  283. .goods_total {
  284. margin-top: 15rpx;
  285. }
  286. }
  287. .order_remark {
  288. .remark_title {
  289. font-size: 32rpx;
  290. font-weight: bold;
  291. padding: 15rpx 0;
  292. }
  293. .remark_box {
  294. width: 100%;
  295. background: #f8f8f8;
  296. min-height: 88rpx;
  297. padding: 20rpx 30rpx;
  298. border-radius: 16rpx;
  299. .edit_remark {
  300. width: 108rpx;
  301. height: 48rpx;
  302. background: #ffffff;
  303. border: 2rpx solid #fb231f;
  304. border-radius: 26rpx;
  305. background: #fff;
  306. margin-top: 15rpx;
  307. color: $base-color;
  308. }
  309. .finish {
  310. color: #fff;
  311. background: $base-line-bg;
  312. margin-left: 15rpx;
  313. }
  314. textarea {
  315. width: 100%;
  316. }
  317. }
  318. }
  319. }
  320. }
  321. .send_box {
  322. position: fixed;
  323. bottom: 0;
  324. left: 0;
  325. width: 100%;
  326. height: 100rpx;
  327. background: #fff;
  328. view {
  329. width: 690rpx;
  330. height: 88rpx;
  331. background: $base-color;
  332. border-radius: 44rpx;
  333. font-size: 32rpx;
  334. color: #fff;
  335. }
  336. }
  337. }
  338. .price_box {
  339. .goods_price {
  340. .vip_ident {
  341. width: 56rpx;
  342. height: 40rpx;
  343. background: linear-gradient(226deg, #66647a 0%, #404146 100%);
  344. border-radius: 4rpx;
  345. font-size: 28rpx;
  346. color: #fcf7c0;
  347. display: flex;
  348. justify-content: center;
  349. align-items: center;
  350. margin-right: 10rpx;
  351. }
  352. .old_price {
  353. text-decoration: line-through;
  354. font-size: 28rpx;
  355. font-weight: 500;
  356. }
  357. .draw_off {
  358. text {
  359. color: #999;
  360. }
  361. }
  362. .symbol {
  363. font-size: 28rpx;
  364. }
  365. .price {
  366. font-weight: 600;
  367. font-size: 36rpx;
  368. text {
  369. color: $base-color;
  370. }
  371. }
  372. .vip {
  373. font-size: 28rpx;
  374. font-weight: bold;
  375. color: #333;
  376. }
  377. .vip_active {
  378. font-size: 36rpx;
  379. font-weight: bold;
  380. text {
  381. color: $base-color;
  382. }
  383. }
  384. .vip_img {
  385. width: 88rpx;
  386. height: 36rpx;
  387. vertical-align: -6rpx;
  388. margin-right: 10rpx;
  389. }
  390. }
  391. }
  392. .share_show {
  393. width: 100%;
  394. height: 100vh;
  395. position: fixed;
  396. top: 0;
  397. left: 0;
  398. background-color: rgba(0, 0, 0, 0.7);
  399. z-index: 9999;
  400. .share_con {
  401. width: 80%;
  402. margin: 0 auto;
  403. height: 100%;
  404. z-index: 999999;
  405. .canvas {
  406. width: 540rpx;
  407. height: 960rpx;
  408. position: relative;
  409. #canvas {
  410. width: 540rpx;
  411. height: 960rpx;
  412. position: absolute;
  413. top: 0;
  414. left: 0;
  415. }
  416. .poster_img {
  417. -webkit-touch-callout: default;
  418. width: 100%;
  419. height: 100%;
  420. display: block;
  421. }
  422. img[src=''],
  423. img:not([src]) {
  424. opacity: 0;
  425. }
  426. // image {
  427. // width: 100%;
  428. // height: 100%;
  429. // border-radius: 24rpx;
  430. // }
  431. }
  432. .save_img {
  433. color: #fff;
  434. width: 100%;
  435. text-align: center;
  436. font-size: 40rpx;
  437. margin: 20rpx 0;
  438. }
  439. .iconfont {
  440. position: absolute;
  441. top: 4vh;
  442. right: 25rpx;
  443. color: #dedede;
  444. font-size: 60rpx;
  445. z-index: 999;
  446. }
  447. }
  448. .sub_btn {
  449. margin-top: 76rpx;
  450. }
  451. }
  452. .qrimg {
  453. opacity: 0;
  454. }
  455. </style>