orderDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  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 && status == 3 ? true : goodsDet.express_type == 1 && status == 4 ? true : false ">
  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" style="margin-bottom: 24rpx;" 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" style="margin-bottom: 24rpx;" 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">{{goodsDet.attr_text}} {{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 dashed #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: 12, // 地图缩放级别,整形值,范围从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. console.log(this.goodsDet,'----->this.goodsDet');
  204. this.source_type = res.data.source_type
  205. this.integral = res.data.integral
  206. if(res.data.product_type == 3){
  207. this.productImg = res.data.img_urls
  208. }else{
  209. this.productImg = JSON.parse(res.data.img_urls)
  210. }
  211. if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
  212. this.hotelDetail(this.goodsDet.hotel_id)
  213. }
  214. })
  215. },
  216. //订单详情
  217. orderDeatil() {
  218. this.$api.orders.getOrderDetail({
  219. order_id: this.order_id
  220. }).then(res => {
  221. this.is_virtual = res.data.is_virtual
  222. this.status = res.data.status
  223. this.express_type = res.data.express_type
  224. this.goodsDet = res.data
  225. console.log(this.goodsDet,'------>this.goodsDet');
  226. this.source_type = res.data.source_type
  227. this.integral = res.data.integral
  228. if(res.data.product_type == 3){
  229. this.productImg = res.data.img_urls
  230. }else{
  231. this.productImg = JSON.parse(res.data.img_urls)
  232. }
  233. if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
  234. this.hotelDetail(this.goodsDet.hotel_id)
  235. }
  236. })
  237. },
  238. // 复制订单号
  239. copyOrder(num) {
  240. uni.setClipboardData({
  241. data: `${num}`,
  242. success: function() {
  243. uni.showToast({
  244. icon: 'none',
  245. title: '复制成功'
  246. })
  247. }
  248. });
  249. }
  250. },
  251. computed: {
  252. }
  253. }
  254. </script>
  255. <style lang="scss" scoped>
  256. $pageColor:#F9F9F9;
  257. $bgColor:#FFFFFF;
  258. // flex布局居中对齐
  259. @mixin flexlayout {
  260. display: flex;
  261. align-items: center;
  262. justify-content: center;
  263. }
  264. .orderDetail {
  265. height: 100%;
  266. background: $pageColor;
  267. }
  268. .nav {
  269. width: 100%;
  270. // height: 108rpx;
  271. background: $bgColor;
  272. border-radius: 0px 0px 16rpx 16rpx;
  273. padding: 32rpx 0 36rpx 28rpx;
  274. box-sizing: border-box;
  275. .orderStatus {
  276. font-size: 40rpx;
  277. font-family: PingFang-SC-Bold, PingFang-SC;
  278. font-weight: bold;
  279. color: #FF6200;
  280. }
  281. }
  282. //核销时间
  283. .nav-write {
  284. background-color: #FFFFFF;
  285. color: #333333;
  286. font-size: 40rpx;
  287. margin-top: 32rpx;
  288. }
  289. .midBox {
  290. margin-top: 24rpx;
  291. width: 750rpx;
  292. background: $bgColor;
  293. border-radius: 16rpx;
  294. position: relative;
  295. padding: 40rpx 28rpx;
  296. box-sizing: border-box;
  297. .logistics {
  298. position: relative;
  299. .logisticsTitle {
  300. margin-bottom: 25rpx;
  301. font-size: 30rpx;
  302. font-family: PingFang-SC-Bold, PingFang-SC;
  303. font-weight: bold;
  304. color: #080F18;
  305. }
  306. .logisticsMsg {
  307. margin-bottom: 25rpx;
  308. text {
  309. font-size: 28rpx;
  310. font-family: PingFang-SC-Medium, PingFang-SC;
  311. font-weight: 500;
  312. color: #666666;
  313. }
  314. }
  315. .copy {
  316. position: absolute;
  317. right: 30rpx;
  318. top: 68rpx;
  319. font-size: 28rpx;
  320. font-family: PingFang-SC-Medium, PingFang-SC;
  321. font-weight: 500;
  322. color: #FF6200;
  323. }
  324. }
  325. .myorder {
  326. position: relative;
  327. .orderTitle {
  328. margin-bottom: 25rpx;
  329. font-size: 30rpx;
  330. font-family: PingFang-SC-Bold, PingFang-SC;
  331. font-weight: bold;
  332. color: #080F18;
  333. }
  334. .orderMsg {
  335. margin-bottom: 25rpx;
  336. text {
  337. font-size: 28rpx;
  338. font-family: PingFang-SC-Medium, PingFang-SC;
  339. font-weight: 500;
  340. color: #666666;
  341. }
  342. }
  343. .copyorder {
  344. position: absolute;
  345. right: 30rpx;
  346. bottom: 72rpx;
  347. font-size: 28rpx;
  348. font-family: PingFang-SC-Medium, PingFang-SC;
  349. font-weight: 500;
  350. color: #FF6200;
  351. }
  352. }
  353. .delivery {
  354. margin-bottom: 20rpx;
  355. .deliveryTitle {
  356. margin-bottom: 24rpx;
  357. text {
  358. font-size: 32rpx;
  359. font-family: PingFang-SC-Bold, PingFang-SC;
  360. font-weight: bold;
  361. color: #080F18;
  362. }
  363. }
  364. .deliveryMsg {
  365. width: 694rpx;
  366. display: flex;
  367. flex-direction: column;
  368. justify-content: center;
  369. padding-top: 24rpx;
  370. position: relative;
  371. .bgimg {
  372. width: 100%;
  373. height: 100%;
  374. position: absolute;
  375. top: 0rpx;
  376. }
  377. .deliveryicon {
  378. margin-bottom: 15rpx;
  379. display: flex;
  380. align-items: center;
  381. z-index: 999;
  382. image {
  383. width: 26rpx;
  384. height: 26rpx;
  385. margin-right: 5rpx;
  386. }
  387. text {
  388. font-size: 28rpx;
  389. font-family: PingFang-SC-Medium, PingFang-SC;
  390. font-weight: 500;
  391. color: #333333;
  392. }
  393. }
  394. .deliverytext {
  395. margin-bottom: 20rpx;
  396. z-index: 999;
  397. text {
  398. font-size: 28rpx;
  399. font-family: PingFangSC-Medium, PingFang SC;
  400. font-weight: 500;
  401. color: #080F18;
  402. }
  403. }
  404. }
  405. }
  406. }
  407. .shopMsg {
  408. margin-top: 24rpx;
  409. width: 750rpx;
  410. height: 534rpx;
  411. background: $bgColor;
  412. border-radius: 12rpx 12rpx 0px 0px;
  413. padding: 32rpx 30rpx;
  414. box-sizing: border-box;
  415. .title {
  416. margin-bottom: 24rpx;
  417. text {
  418. font-size: 32rpx;
  419. font-family: PingFang-SC-Bold, PingFang-SC;
  420. font-weight: bold;
  421. color: #080F18;
  422. }
  423. }
  424. .shopCard {
  425. margin-top: 28rpx;
  426. width: 694rpx;
  427. height: 164rpx;
  428. background: #F4F5F6;
  429. border-radius: 10rpx;
  430. display: flex;
  431. align-items: center;
  432. image {
  433. width: 132rpx;
  434. height: 132rpx;
  435. margin-left: 16rpx;
  436. display: inline-block;
  437. border-radius: 10rpx;
  438. }
  439. .name {
  440. font-size: 28rpx;
  441. font-family: PingFangSC-Medium, PingFang SC;
  442. font-weight: 500;
  443. color: #080F18;
  444. display: block;
  445. }
  446. .tag {
  447. font-size: 24rpx;
  448. font-family: PingFang-SC-Medium, PingFang-SC;
  449. font-weight: 500;
  450. color: #666666;
  451. }
  452. }
  453. .shopNumber {
  454. display: flex;
  455. justify-content: space-between;
  456. align-items: center;
  457. margin-top: 25rpx;
  458. text {
  459. font-size: 26rpx;
  460. font-family: PingFang-SC-Medium, PingFang-SC;
  461. font-weight: 500;
  462. color: #000000;
  463. }
  464. }
  465. }
  466. </style>