orderDetail.vue 9.9 KB

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