orderDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. <template>
  2. <view class="orderDetail">
  3. <!-- 标题栏 -->
  4. <view class="nav">
  5. <view class="orderStatus" v-if="status == 2 && is_virtual == 0">待发货</view>
  6. <view class="orderStatus" v-if="status == 3 && is_virtual == 0 && express_type == 1">待收货</view>
  7. <view class="orderStatus" v-if="status == 3 && is_virtual == 1">待核销</view>
  8. <view class="orderStatus" v-if="status == 3 && is_virtual == 0 && express_type == 2">待核销</view>
  9. <view class="orderStatus" v-if="status == 4 && is_virtual == 0 && express_type == 1 ">已完成</view>
  10. <view class="orderStatus" v-if="status == 4 && is_virtual == 1">已核销</view>
  11. <view class="orderStatus" v-if="status == 4 && is_virtual == 0 && express_type == 2 ">已核销</view>
  12. <view class="nav-write" v-if="status == 4 && is_virtual == 1">
  13. <text>核销时间:</text>
  14. <text>{{goodsDet.complete_time}}</text>
  15. </view>
  16. <view class="nav-write" v-if="status == 4 && is_virtual == 0 && express_type == 2">
  17. <text>核销时间:</text>
  18. <text>{{goodsDet.complete_time}}</text>
  19. </view>
  20. </view>
  21. <view class="midBox">
  22. <!-- 物流信息 -->
  23. <view class="logistics" v-if="goodsDet.express_type == 1">
  24. <view class="logisticsTitle">物流信息</view>
  25. <view class="logisticsMsg"><text>快递公司</text><text
  26. style="margin-left: 26rpx;">{{goodsDet.express_company}}</text></view>
  27. <view class="logisticsMsg"><text>快递单号</text><text
  28. style="margin-left: 26rpx;">{{goodsDet.express_no}}</text>
  29. </view>
  30. <view class="copy" @click="copyOrder(goodsDet.express_no)">复制</view>
  31. </view>
  32. <!-- 配送信息 -->
  33. <view class="delivery">
  34. <view class="deliveryTitle">
  35. <text>配送信息</text>
  36. </view>
  37. <view class="deliveryMsg">
  38. <image class="bgimg" src="http://t9.9026.com/imgs/ordermap.png"></image>
  39. <!-- 联系信息 -->
  40. <view class="deliveryicon">
  41. <image src="/static/icon/phone.png"></image>
  42. <text>联系信息</text>
  43. </view>
  44. <view class="deliverytext">
  45. <text>{{goodsDet.receiver}}</text>
  46. <text style="margin-left: 24rpx;">{{goodsDet.phone}}</text>
  47. </view>
  48. <!-- 发货方式 -->
  49. <view class="deliveryicon">
  50. <image src="/static/icon/delivery.png"></image>
  51. <text>发货方式</text>
  52. </view>
  53. <view class="deliverytext">
  54. <text v-if="goodsDet.express_type ==1">快递发货</text>
  55. <text v-if="goodsDet.express_type ==2">到店自提/线下核销</text>
  56. </view>
  57. <!-- 收货地址 -->
  58. <view class="deliveryicon" v-if="goodsDet.express_type ==1">
  59. <image src="/static/icon/position.png"></image>
  60. <text>收货地址</text>
  61. </view>
  62. <view class="deliverytext" v-if="goodsDet.express_type ==1">
  63. <text>{{goodsDet.area_text}} {{goodsDet.address}} </text>
  64. </view>
  65. <!-- 门店地址 -->
  66. <view class="deliveryicon" v-if="goodsDet.express_type ==2">
  67. <image src="/static/icon/position.png"></image>
  68. <text>{{hotelDet.name}}</text>
  69. </view>
  70. <view class="deliverytext" v-if="goodsDet.express_type ==2" style="position:relative;">
  71. <text>{{hotelDet.address}}</text>
  72. <image src="/static/icon/navigation.png" @click="goLocaltion(hotelDet.name,hotelDet.address)"
  73. style="width: 50rpx;height: 48rpx; position: absolute; top: 0rpx;right: 30rpx;"></image>
  74. </view>
  75. <!-- 门店联系方式 -->
  76. <view class="deliveryicon" v-if="goodsDet.express_type ==2">
  77. <image src="/static/icon/phone.png"></image>
  78. <text>门店联系方式</text>
  79. </view>
  80. <view class="deliverytext" v-if="goodsDet.express_type ==2">
  81. <text>{{hotelDet.phone}}</text>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- 订单信息 -->
  86. <view class="myorder">
  87. <view class="orderTitle">订单信息</view>
  88. <view class="orderMsg"><text>订单编号</text><text style="margin-left: 26rpx;">{{goodsDet.order_no}}</text>
  89. </view>
  90. <view class="orderMsg"><text>下单时间</text><text style="margin-left: 26rpx;">{{goodsDet.created_at}}</text>
  91. </view>
  92. <view class="copyorder" @click="copyOrder(goodsDet.order_no)">复制</view>
  93. </view>
  94. <view class="myorder" style="margin-top: 68rpx;" v-if="status == 4 && is_virtual == 1">
  95. <view class="orderTitle">核销信息</view>
  96. <view class="orderMsg"><text>核销员</text><text style="margin-left: 54rpx;">{{goodsDet.staff.user.nickname}}</text>
  97. </view>
  98. <view class="orderMsg"><text>核销时间</text><text style="margin-left: 26rpx;">{{goodsDet.complete_time}}</text>
  99. </view>
  100. </view>
  101. <view class="myorder" style="margin-top: 68rpx;" v-if="status == 4 && is_virtual == 0 && express_type == 2 ">
  102. <view class="orderTitle">核销信息</view>
  103. <view class="orderMsg"><text>核销员</text><text style="margin-left: 54rpx;">{{goodsDet.staff.user.nickname}}</text>
  104. </view>
  105. <view class="orderMsg"><text>核销时间</text><text style="margin-left: 26rpx;">{{goodsDet.complete_time}}</text>
  106. </view>
  107. </view>
  108. </view>
  109. <!-- 产品信息 -->
  110. <view class="shopMsg">
  111. <view class="title">
  112. <text>产品信息</text>
  113. </view>
  114. <view class="shopCard">
  115. <image v-if="goodsDet.product_type == 3 " :src="goodsDet.img_urls"></image>
  116. <image v-if="goodsDet.product_type != 3 " style="border-radius: 12rpx;" :src="productImg[0]"></image>
  117. <view style="margin-left: 24rpx;">
  118. <text class="name">{{goodsDet.product_name}}</text>
  119. <!-- <text class="tag" v-if="source_type == 3">{{goodsDet.integral}}积分</text> -->
  120. <text class="tag" v-if="source_type == 3">{{JSON.parse(goodsDet.attrs)[0].attr_group_name == '包装'?JSON.parse(goodsDet.attrs)[0].attr_name+'装' : '' }} {{goodsDet.integral}}积分</text>
  121. </view>
  122. </view>
  123. <view class="shopNumber">
  124. <text>件数</text>
  125. <text>1件</text>
  126. </view>
  127. <view class="shopNumber" v-if="source_type == 3">
  128. <text>积分</text>
  129. <text>{{integral}}积分</text>
  130. </view>
  131. <view style="width: 694rpx;height: 4rpx;border: 2rpx solid #F2F2F2;margin-top: 38rpx;"></view>
  132. <view class="shopNumber" v-if="source_type == 3">
  133. <text>合计</text>
  134. <text>{{integral}}积分</text>
  135. </view>
  136. </view>
  137. </view>
  138. </template>
  139. <script>
  140. export default {
  141. data() {
  142. return {
  143. //产品图片
  144. productImg: '',
  145. //积分
  146. integral: '',
  147. //订单产品来源
  148. source_type: '',
  149. //订单号
  150. order_no: '',
  151. //门店详情
  152. hotelDet: '',
  153. //订单详情
  154. goodsDet: '',
  155. //订单id
  156. order_id: '',
  157. //订单状态
  158. status: '',
  159. //实物:0虚拟奖品:1
  160. is_virtual: '',
  161. express_type: '',
  162. }
  163. },
  164. onLoad(o) {
  165. if (o.id) {
  166. //订单id
  167. this.order_id = o.id
  168. this.orderDeatil()
  169. }
  170. if (o.order_no) {
  171. this.order_no = o.order_no
  172. this.getConfirmOrderDetail()
  173. }
  174. },
  175. methods: {
  176. //导航
  177. goLocaltion(name, address) {
  178. uni.openLocation({
  179. type: "gcj02",
  180. latitude: parseFloat(this.hotelDet.latitude), // 纬度,浮点数,范围为90 ~ -90
  181. longitude: parseFloat(this.hotelDet.longitude), // 经度,浮点数,范围为180 ~ -180。
  182. scale: 6, // 地图缩放级别,整形值,范围从1~28。默认为最大
  183. name: name, // 位置名
  184. address: address, // 地址详情说明
  185. })
  186. },
  187. //门店详情
  188. hotelDetail(id) {
  189. this.$api.hotel.getHotelDetail({
  190. hotel_id: id
  191. }).then(res => {
  192. this.hotelDet = res.data
  193. })
  194. },
  195. getConfirmOrderDetail() {
  196. this.$api.orders.confirmOrderDetail({
  197. order_no: this.order_no
  198. }).then(res => {
  199. this.is_virtual = res.data.is_virtual
  200. this.status = res.data.status
  201. this.express_type = res.data.express_type
  202. this.goodsDet = res.data
  203. this.productImg = JSON.parse(res.data.img_urls)
  204. this.source_type = res.data.source_type
  205. this.integral = res.data.integral
  206. if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
  207. this.hotelDetail(this.goodsDet.hotel_id)
  208. }
  209. })
  210. },
  211. //订单详情
  212. orderDeatil() {
  213. this.$api.orders.getOrderDetail({
  214. order_id: this.order_id
  215. }).then(res => {
  216. this.is_virtual = res.data.is_virtual
  217. this.status = res.data.status
  218. this.express_type = res.data.express_type
  219. this.goodsDet = res.data
  220. this.productImg = JSON.parse(res.data.img_urls)
  221. this.source_type = res.data.source_type
  222. this.integral = res.data.integral
  223. if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
  224. this.hotelDetail(this.goodsDet.hotel_id)
  225. }
  226. })
  227. },
  228. // 复制订单号
  229. copyOrder(num) {
  230. uni.setClipboardData({
  231. data: `${num}`,
  232. success: function() {
  233. uni.showToast({
  234. icon: 'none',
  235. title: '复制成功'
  236. })
  237. }
  238. });
  239. }
  240. },
  241. computed: {
  242. }
  243. }
  244. </script>
  245. <style lang="scss" scoped>
  246. $pageColor:#F9F9F9;
  247. $bgColor:#FFFFFF;
  248. // flex布局居中对齐
  249. @mixin flexlayout {
  250. display: flex;
  251. align-items: center;
  252. justify-content: center;
  253. }
  254. .orderDetail {
  255. height: 100%;
  256. background: $pageColor;
  257. }
  258. .nav {
  259. width: 750rpx;
  260. // height: 108rpx;
  261. background: $bgColor;
  262. border-radius: 0px 0px 16rpx 16rpx;
  263. padding: 32rpx 0 0 28rpx;
  264. box-sizing: border-box;
  265. .orderStatus {
  266. font-size: 40rpx;
  267. font-family: PingFang-SC-Bold, PingFang-SC;
  268. font-weight: bold;
  269. color: #FF6200;
  270. }
  271. }
  272. //核销时间
  273. .nav-write {
  274. background-color: #FFFFFF;
  275. color: #333333;
  276. font-size: 40rpx;
  277. margin-top: 32rpx;
  278. padding-bottom: 36rpx;
  279. }
  280. .midBox {
  281. margin-top: 24rpx;
  282. width: 750rpx;
  283. background: $bgColor;
  284. border-radius: 16rpx;
  285. position: relative;
  286. padding: 40rpx 28rpx;
  287. box-sizing: border-box;
  288. .logistics {
  289. position: relative;
  290. .logisticsTitle {
  291. margin-bottom: 25rpx;
  292. font-size: 30rpx;
  293. font-family: PingFang-SC-Bold, PingFang-SC;
  294. font-weight: bold;
  295. color: #080F18;
  296. }
  297. .logisticsMsg {
  298. margin-bottom: 25rpx;
  299. text {
  300. font-size: 28rpx;
  301. font-family: PingFang-SC-Medium, PingFang-SC;
  302. font-weight: 500;
  303. color: #666666;
  304. }
  305. }
  306. .copy {
  307. position: absolute;
  308. right: 30rpx;
  309. top: 68rpx;
  310. font-size: 28rpx;
  311. font-family: PingFang-SC-Medium, PingFang-SC;
  312. font-weight: 500;
  313. color: #FF6200;
  314. }
  315. }
  316. .myorder {
  317. position: relative;
  318. .orderTitle {
  319. margin-bottom: 25rpx;
  320. font-size: 30rpx;
  321. font-family: PingFang-SC-Bold, PingFang-SC;
  322. font-weight: bold;
  323. color: #080F18;
  324. }
  325. .orderMsg {
  326. margin-bottom: 25rpx;
  327. text {
  328. font-size: 28rpx;
  329. font-family: PingFang-SC-Medium, PingFang-SC;
  330. font-weight: 500;
  331. color: #666666;
  332. }
  333. }
  334. .copyorder {
  335. position: absolute;
  336. right: 30rpx;
  337. bottom: 72rpx;
  338. font-size: 28rpx;
  339. font-family: PingFang-SC-Medium, PingFang-SC;
  340. font-weight: 500;
  341. color: #FF6200;
  342. }
  343. }
  344. .delivery {
  345. margin-bottom: 20rpx;
  346. .deliveryTitle {
  347. margin-bottom: 24rpx;
  348. text {
  349. font-size: 32rpx;
  350. font-family: PingFang-SC-Bold, PingFang-SC;
  351. font-weight: bold;
  352. color: #080F18;
  353. }
  354. }
  355. .deliveryMsg {
  356. width: 694rpx;
  357. display: flex;
  358. flex-direction: column;
  359. justify-content: center;
  360. padding-top: 24rpx;
  361. position: relative;
  362. .bgimg {
  363. width: 100%;
  364. height: 100%;
  365. position: absolute;
  366. top: 0rpx;
  367. }
  368. .deliveryicon {
  369. margin-bottom: 15rpx;
  370. display: flex;
  371. align-items: center;
  372. z-index: 999;
  373. image {
  374. width: 26rpx;
  375. height: 26rpx;
  376. margin-right: 5rpx;
  377. }
  378. text {
  379. font-size: 28rpx;
  380. font-family: PingFang-SC-Medium, PingFang-SC;
  381. font-weight: 500;
  382. color: #333333;
  383. }
  384. }
  385. .deliverytext {
  386. margin-bottom: 20rpx;
  387. z-index: 999;
  388. text {
  389. font-size: 28rpx;
  390. font-family: PingFangSC-Medium, PingFang SC;
  391. font-weight: 500;
  392. color: #080F18;
  393. }
  394. }
  395. }
  396. }
  397. }
  398. .shopMsg {
  399. margin-top: 24rpx;
  400. width: 750rpx;
  401. height: 534rpx;
  402. background: $bgColor;
  403. border-radius: 12rpx 12rpx 0px 0px;
  404. padding: 32rpx 30rpx;
  405. box-sizing: border-box;
  406. .title {
  407. margin-bottom: 24rpx;
  408. text {
  409. font-size: 32rpx;
  410. font-family: PingFang-SC-Bold, PingFang-SC;
  411. font-weight: bold;
  412. color: #080F18;
  413. }
  414. }
  415. .shopCard {
  416. margin-top: 28rpx;
  417. width: 694rpx;
  418. height: 164rpx;
  419. background: #F4F5F6;
  420. border-radius: 10rpx;
  421. display: flex;
  422. align-items: center;
  423. image {
  424. width: 132rpx;
  425. height: 132rpx;
  426. margin-left: 16rpx;
  427. display: inline-block;
  428. border-radius: 10rpx;
  429. }
  430. .name {
  431. font-size: 28rpx;
  432. font-family: PingFangSC-Medium, PingFang SC;
  433. font-weight: 500;
  434. color: #080F18;
  435. display: block;
  436. }
  437. .tag {
  438. font-size: 24rpx;
  439. font-family: PingFang-SC-Medium, PingFang-SC;
  440. font-weight: 500;
  441. color: #666666;
  442. }
  443. }
  444. .shopNumber {
  445. display: flex;
  446. justify-content: space-between;
  447. align-items: center;
  448. margin-top: 25rpx;
  449. text {
  450. font-size: 26rpx;
  451. font-family: PingFang-SC-Medium, PingFang-SC;
  452. font-weight: 500;
  453. color: #000000;
  454. }
  455. }
  456. }
  457. </style>