orderDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  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. </view>
  121. </view>
  122. <view class="shopNumber">
  123. <text>件数</text>
  124. <text>1件</text>
  125. </view>
  126. <view class="shopNumber" v-if="source_type == 3">
  127. <text>积分</text>
  128. <text>{{integral}}积分</text>
  129. </view>
  130. <view style="width: 694rpx;height: 4rpx;border: 2rpx solid #F2F2F2;margin-top: 38rpx;"></view>
  131. <view class="shopNumber" v-if="source_type == 3">
  132. <text>合计</text>
  133. <text>{{integral}}积分</text>
  134. </view>
  135. </view>
  136. </view>
  137. </template>
  138. <script>
  139. export default {
  140. data() {
  141. return {
  142. //产品图片
  143. productImg: '',
  144. //积分
  145. integral: '',
  146. //订单产品来源
  147. source_type: '',
  148. //订单号
  149. order_no: '',
  150. //门店详情
  151. hotelDet: '',
  152. //订单详情
  153. goodsDet: '',
  154. //订单id
  155. order_id: '',
  156. //订单状态
  157. status: '',
  158. //实物:0虚拟奖品:1
  159. is_virtual: '',
  160. express_type: '',
  161. }
  162. },
  163. onLoad(o) {
  164. if (o.id) {
  165. //订单id
  166. this.order_id = o.id
  167. this.orderDeatil()
  168. }
  169. if (o.order_no) {
  170. this.order_no = o.order_no
  171. this.getConfirmOrderDetail()
  172. }
  173. },
  174. methods: {
  175. //导航
  176. goLocaltion(name, address) {
  177. uni.openLocation({
  178. type: "gcj02",
  179. latitude: parseFloat(this.hotelDet.latitude), // 纬度,浮点数,范围为90 ~ -90
  180. longitude: parseFloat(this.hotelDet.longitude), // 经度,浮点数,范围为180 ~ -180。
  181. scale: 6, // 地图缩放级别,整形值,范围从1~28。默认为最大
  182. name: name, // 位置名
  183. address: address, // 地址详情说明
  184. })
  185. },
  186. //门店详情
  187. hotelDetail(id) {
  188. this.$api.hotel.getHotelDetail({
  189. hotel_id: id
  190. }).then(res => {
  191. this.hotelDet = res.data
  192. })
  193. },
  194. getConfirmOrderDetail() {
  195. this.$api.orders.confirmOrderDetail({
  196. order_no: this.order_no
  197. }).then(res => {
  198. this.is_virtual = res.data.is_virtual
  199. this.status = res.data.status
  200. this.express_type = res.data.express_type
  201. this.goodsDet = res.data
  202. this.productImg = JSON.parse(res.data.img_urls)
  203. this.source_type = res.data.source_type
  204. this.integral = res.data.integral
  205. if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
  206. this.hotelDetail(this.goodsDet.hotel_id)
  207. }
  208. })
  209. },
  210. //订单详情
  211. orderDeatil() {
  212. this.$api.orders.getOrderDetail({
  213. order_id: this.order_id
  214. }).then(res => {
  215. this.is_virtual = res.data.is_virtual
  216. this.status = res.data.status
  217. this.express_type = res.data.express_type
  218. this.goodsDet = res.data
  219. this.productImg = JSON.parse(res.data.img_urls)
  220. this.source_type = res.data.source_type
  221. this.integral = res.data.integral
  222. if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
  223. this.hotelDetail(this.goodsDet.hotel_id)
  224. }
  225. })
  226. },
  227. // 复制订单号
  228. copyOrder(num) {
  229. uni.setClipboardData({
  230. data: `${num}`,
  231. success: function() {
  232. uni.showToast({
  233. icon: 'none',
  234. title: '复制成功'
  235. })
  236. }
  237. });
  238. }
  239. },
  240. computed: {
  241. }
  242. }
  243. </script>
  244. <style lang="scss" scoped>
  245. $pageColor:#F9F9F9;
  246. $bgColor:#FFFFFF;
  247. // flex布局居中对齐
  248. @mixin flexlayout {
  249. display: flex;
  250. align-items: center;
  251. justify-content: center;
  252. }
  253. .orderDetail {
  254. height: 100%;
  255. background: $pageColor;
  256. }
  257. .nav {
  258. width: 750rpx;
  259. // height: 108rpx;
  260. background: $bgColor;
  261. border-radius: 0px 0px 16rpx 16rpx;
  262. padding: 32rpx 0 0 28rpx;
  263. box-sizing: border-box;
  264. .orderStatus {
  265. font-size: 40rpx;
  266. font-family: PingFang-SC-Bold, PingFang-SC;
  267. font-weight: bold;
  268. color: #FF6200;
  269. }
  270. }
  271. //核销时间
  272. .nav-write {
  273. background-color: #FFFFFF;
  274. color: #333333;
  275. font-size: 40rpx;
  276. margin-top: 32rpx;
  277. padding-bottom: 36rpx;
  278. }
  279. .midBox {
  280. margin-top: 24rpx;
  281. width: 750rpx;
  282. background: $bgColor;
  283. border-radius: 16rpx;
  284. position: relative;
  285. padding: 40rpx 28rpx;
  286. box-sizing: border-box;
  287. .logistics {
  288. position: relative;
  289. .logisticsTitle {
  290. margin-bottom: 25rpx;
  291. font-size: 30rpx;
  292. font-family: PingFang-SC-Bold, PingFang-SC;
  293. font-weight: bold;
  294. color: #080F18;
  295. }
  296. .logisticsMsg {
  297. margin-bottom: 25rpx;
  298. text {
  299. font-size: 28rpx;
  300. font-family: PingFang-SC-Medium, PingFang-SC;
  301. font-weight: 500;
  302. color: #666666;
  303. }
  304. }
  305. .copy {
  306. position: absolute;
  307. right: 30rpx;
  308. top: 68rpx;
  309. font-size: 28rpx;
  310. font-family: PingFang-SC-Medium, PingFang-SC;
  311. font-weight: 500;
  312. color: #FF6200;
  313. }
  314. }
  315. .myorder {
  316. position: relative;
  317. .orderTitle {
  318. margin-bottom: 25rpx;
  319. font-size: 30rpx;
  320. font-family: PingFang-SC-Bold, PingFang-SC;
  321. font-weight: bold;
  322. color: #080F18;
  323. }
  324. .orderMsg {
  325. margin-bottom: 25rpx;
  326. text {
  327. font-size: 28rpx;
  328. font-family: PingFang-SC-Medium, PingFang-SC;
  329. font-weight: 500;
  330. color: #666666;
  331. }
  332. }
  333. .copyorder {
  334. position: absolute;
  335. right: 30rpx;
  336. bottom: 72rpx;
  337. font-size: 28rpx;
  338. font-family: PingFang-SC-Medium, PingFang-SC;
  339. font-weight: 500;
  340. color: #FF6200;
  341. }
  342. }
  343. .delivery {
  344. margin-bottom: 20rpx;
  345. .deliveryTitle {
  346. margin-bottom: 24rpx;
  347. text {
  348. font-size: 32rpx;
  349. font-family: PingFang-SC-Bold, PingFang-SC;
  350. font-weight: bold;
  351. color: #080F18;
  352. }
  353. }
  354. .deliveryMsg {
  355. width: 694rpx;
  356. display: flex;
  357. flex-direction: column;
  358. justify-content: center;
  359. padding-top: 24rpx;
  360. position: relative;
  361. .bgimg {
  362. width: 100%;
  363. height: 100%;
  364. position: absolute;
  365. top: 0rpx;
  366. }
  367. .deliveryicon {
  368. margin-bottom: 15rpx;
  369. display: flex;
  370. align-items: center;
  371. z-index: 999;
  372. image {
  373. width: 26rpx;
  374. height: 26rpx;
  375. margin-right: 5rpx;
  376. }
  377. text {
  378. font-size: 28rpx;
  379. font-family: PingFang-SC-Medium, PingFang-SC;
  380. font-weight: 500;
  381. color: #333333;
  382. }
  383. }
  384. .deliverytext {
  385. margin-bottom: 20rpx;
  386. z-index: 999;
  387. text {
  388. font-size: 28rpx;
  389. font-family: PingFangSC-Medium, PingFang SC;
  390. font-weight: 500;
  391. color: #080F18;
  392. }
  393. }
  394. }
  395. }
  396. }
  397. .shopMsg {
  398. margin-top: 24rpx;
  399. width: 750rpx;
  400. height: 534rpx;
  401. background: $bgColor;
  402. border-radius: 12rpx 12rpx 0px 0px;
  403. padding: 32rpx 30rpx;
  404. box-sizing: border-box;
  405. .title {
  406. margin-bottom: 24rpx;
  407. text {
  408. font-size: 32rpx;
  409. font-family: PingFang-SC-Bold, PingFang-SC;
  410. font-weight: bold;
  411. color: #080F18;
  412. }
  413. }
  414. .shopCard {
  415. margin-top: 28rpx;
  416. width: 694rpx;
  417. height: 164rpx;
  418. background: #F4F5F6;
  419. border-radius: 10rpx;
  420. display: flex;
  421. align-items: center;
  422. image {
  423. width: 132rpx;
  424. height: 132rpx;
  425. margin-left: 16rpx;
  426. display: inline-block;
  427. border-radius: 10rpx;
  428. }
  429. .name {
  430. font-size: 28rpx;
  431. font-family: PingFangSC-Medium, PingFang SC;
  432. font-weight: 500;
  433. color: #080F18;
  434. display: block;
  435. }
  436. .tag {
  437. font-size: 24rpx;
  438. font-family: PingFang-SC-Medium, PingFang-SC;
  439. font-weight: 500;
  440. color: #666666;
  441. }
  442. }
  443. .shopNumber {
  444. display: flex;
  445. justify-content: space-between;
  446. align-items: center;
  447. margin-top: 25rpx;
  448. text {
  449. font-size: 26rpx;
  450. font-family: PingFang-SC-Medium, PingFang-SC;
  451. font-weight: 500;
  452. color: #000000;
  453. }
  454. }
  455. }
  456. </style>