OrderDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <!-- OrderDetailBody.vue -->
  2. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  3. <seller-base :show="false">
  4. <view class="div">
  5. <view class="div common-header-wrap">
  6. <view :style="'height:'+navHeight+'px'"></view>
  7. <view class="common-header-holder"></view>
  8. <view class="common-header-fixed">
  9. <title-header />
  10. <uni-nav-bar title="订单详情" class="common-header" left-icon="back" @clickLeft="goBack()">
  11. </uni-nav-bar>
  12. </view>
  13. </view>
  14. <view
  15. class="div order-body"
  16. v-if="order_info"
  17. >
  18. <view class="div order_state">
  19. <text class="i iconfont" v-if="order_info.order_state == '40'">&#xe61b;</text>
  20. <text class="i iconfont" v-else>&#xe61a;</text>
  21. <text class="span">{{order_info.state_desc}}</text>
  22. </view>
  23. <view class="div address">
  24. <view class="div">
  25. <text class="span">{{ order_info.reciver_name }}</text>
  26. <text class="span mobile">{{ order_info.reciver_phone }}</text>
  27. </view>
  28. <view class="p" style="-webkit-box-orient: vertical; -webkit-line-clamp: 2;">
  29. {{ order_info.reciver_addr }}
  30. </view>
  31. </view>
  32. <view
  33. class="div containers"
  34. v-for="item in order_info.goods_list"
  35. v-bind:key="item.goods_id"
  36. >
  37. <image
  38. class="img photo"
  39. v-bind:src="item.image_240_url"
  40. />
  41. <view class="div right-wrapper">
  42. <label class="title">{{ item.goods_name }}</label>
  43. <label class="property">{{ item.goods_spec }}</label>
  44. <view class="div desc-wrapper">
  45. <label class="price"
  46. >¥ {{ item.goods_price }}</label
  47. >
  48. <label class="count">x{{ item.goods_num }}</label>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="div detail">
  53. <view class="div number">
  54. <label
  55. >订单编号:{{ order_info.order_sn }}
  56. </label>
  57. <view class="p">
  58. 下单时间:{{order_info.add_time}}
  59. </view>
  60. </view>
  61. <view class="div number">
  62. <view class="p" v-if="order_info.promotion && order_info.promotion.length">
  63. {{order_info.promotion}}
  64. </view>
  65. <view class="p" v-if="order_info.voucher_code">
  66. 使用了面额为 {{order_info.voucher_price}} 元的代金券
  67. </view>
  68. <view class="p" v-if="order_info.extend_order_common.mallvoucher_price">
  69. 使用了面额为 {{order_info.extend_order_common.mallvoucher_price}} 元的平台代金券
  70. </view>
  71. </view>
  72. <view class="div pay" v-if="order_info.payment_name">
  73. <view class="p">支付方式:{{ order_info.payment_name }}</view>
  74. </view>
  75. </view>
  76. <view
  77. class="div desc section-header section-footer"
  78. >
  79. <view class="div container">
  80. <label class="title">商品总额</label>
  81. <label class="subtitle">¥{{ order_info.goods_amount }}</label>
  82. </view>
  83. <view class="div container">
  84. <label class="title">运费</label>
  85. <label class="subtitle">¥{{ order_info.shipping_fee }}</label>
  86. </view>
  87. <label class="amount"
  88. >实付款 : <text class="span"> ¥{{ order_info.order_amount }}</text>
  89. </label>
  90. </view>
  91. </view>
  92. </view>
  93. </seller-base>
  94. </template>
  95. <script>
  96. import {getFontSize} from '@/util/common'
  97. import TitleHeader from '../../TitleHeader'
  98. import SellerBase from '../SellerBase'
  99. import { getOrderInfo } from '../../../api/sellerOrder'
  100. export default {
  101. name: 'SellerOrderDetail',
  102. computed:{
  103. fontSize(){
  104. return getFontSize()
  105. },
  106. },
  107. data(){
  108. return {
  109. navHeight: 0,
  110. order_info: {}
  111. }
  112. },
  113. components:{TitleHeader,SellerBase,},
  114. onLoad: function (option) {
  115. if (option.order_id) {
  116. getOrderInfo(option.order_id).then(res => {
  117. this.order_info = res.result.order_info
  118. }).catch(function (error) {
  119. uni.showToast({icon:'none',title: error.message})
  120. })
  121. }
  122. },
  123. mounted(){
  124. // #ifdef MP-WEIXIN
  125. this.navHeight = uni.getMenuButtonBoundingClientRect().height
  126. // #endif
  127. },
  128. methods:{
  129. goBack(){uni.navigateBack({delta:1})},
  130. }
  131. }
  132. </script>
  133. <style lang="scss" scoped>
  134. .common-header-wrap .common-header{box-shadow: unset}
  135. .order-body {
  136. overflow: auto;
  137. height: 100%;
  138. position: absolute;
  139. width: 100%;
  140. .desc{
  141. .container {
  142. display: flex;
  143. flex-direction: row;
  144. justify-content: flex-start;
  145. align-items: center;
  146. background-color: #fff;
  147. }
  148. .title {
  149. width: 5rem;
  150. font-size:$subFontSize;
  151. color: #333;
  152. margin-left: 0.6rem;
  153. }
  154. .subtitle {
  155. flex: 1;
  156. margin-left: 1rem;
  157. margin-right: 0.6rem;
  158. color: $primaryColor;
  159. font-size:$subFontSize;
  160. text-align: right;
  161. }
  162. }
  163. }
  164. .order_state {
  165. background:$primaryColor;
  166. height: 3.5rem;
  167. display: flex;
  168. justify-content: flex-start;
  169. align-items: center;
  170. .i {
  171. color:#fff;
  172. font-size:1.2rem;
  173. padding: 0 0.5rem;
  174. }
  175. .span {
  176. font-size:$h2;
  177. color: #fff;
  178. }
  179. }
  180. .containers {
  181. display: flex;
  182. flex-direction: row;
  183. justify-content: flex-start;
  184. align-items: stretch;
  185. background-color: #fff;
  186. border-bottom: 1px solid #e8eaed;
  187. }
  188. .photo {
  189. width: 4rem;
  190. height: 4rem;
  191. margin: 0.75rem 0.5rem 0.75rem 0.75rem;
  192. border: 1px solid #e8eaed;
  193. flex-basis: 4rem;
  194. flex-shrink: 0;
  195. }
  196. .right-wrapper {
  197. display: flex;
  198. flex-direction: column;
  199. justify-content: flex-start;
  200. align-items: stretch;
  201. padding:0 0.75rem 0 0;
  202. width: 100%;
  203. overflow: hidden;
  204. }
  205. .title {
  206. margin-top: 0.75rem;
  207. color: #333;
  208. font-size:$subFontSize;
  209. overflow: hidden;
  210. text-overflow: ellipsis;
  211. white-space: nowrap;
  212. }
  213. .property {
  214. font-size:$fontSize;
  215. color: #7c7f88;
  216. padding-top: 0.5rem;
  217. }
  218. .count {
  219. margin-top: 0.2rem;
  220. color: #7c7f88;
  221. font-size:$fontSize;
  222. margin-right: 0.5rem;
  223. }
  224. .desc-wrapper {
  225. height: 1rem;
  226. display: flex;
  227. flex-direction: row;
  228. justify-content: space-between;
  229. align-items: center;
  230. padding-top: 1.05rem;
  231. }
  232. .price {
  233. color: $primaryColor;
  234. font-size:$mainFontSize;
  235. margin-left:0;
  236. }
  237. .count {
  238. color: #7c7f88;
  239. font-size:$h2;
  240. margin-right: 0.5rem;
  241. }
  242. .address {
  243. height: 4.35rem;
  244. background-color: #fff;
  245. margin-bottom:0.5rem;
  246. .div {
  247. padding:0.5rem 0.5rem 0;
  248. }
  249. .img {
  250. height: 0.8rem;
  251. }
  252. .span {
  253. color: #333;
  254. font-size:$h2;
  255. &.mobile {
  256. padding-left: 1.05rem;
  257. }
  258. }
  259. .p {
  260. margin:0.25rem 0.9rem 0.55rem 0.5rem;
  261. font-size:$subFontSize;
  262. color: #7c7f88;
  263. overflow: hidden;
  264. text-overflow: ellipsis;
  265. display: -webkit-box;
  266. -webkit-box-orient: vertical;
  267. -webkit-line-clamp: 2;
  268. }
  269. }
  270. .contact {
  271. display: flex;
  272. justify-content: flex-end;
  273. align-items: center;
  274. height: 2.3rem;
  275. background-color: #fff;
  276. margin-top: 0.4rem;
  277. border-bottom: 1px solid #e8eaed;
  278. padding: 0 0.65rem;
  279. .span {
  280. font-size:$fontSize;
  281. color: #333;
  282. padding-right: 0.3rem;
  283. }
  284. .img {
  285. width: 0.6rem;
  286. height: 0.65rem;
  287. }
  288. }
  289. .detail {
  290. display: flex;
  291. flex-direction: column;
  292. font-size:$subFontSize;
  293. color: #7c7f88;
  294. background-color: #fff;
  295. margin: 0.4rem 0;
  296. box-sizing: border-box;
  297. .number {
  298. padding: 0.7rem 0.8rem;
  299. border-bottom: 1px solid #e8eaed;
  300. .p {
  301. padding-top: 0.3rem;
  302. font-size:$subFontSize;
  303. }
  304. .button {
  305. color: #7c7f88;
  306. height: 1rem;
  307. background-color: #fff;
  308. border: 1px solid #7c7f88;
  309. width: 2.7rem;
  310. height: 1rem;
  311. border-radius: 0.1rem;
  312. font-size:$subFontSize;display:flex;align-items:center;justify-content:center;
  313. }
  314. }
  315. .pay {
  316. border-bottom: 1px solid #e8eaed;
  317. padding: 0.7rem 0.8rem;
  318. }
  319. .givetime {
  320. padding: 0.7rem 0.8rem;
  321. font-size:$subFontSize;
  322. }
  323. input {
  324. background-color: #fff;
  325. border: 1px solid #7c7f88;
  326. }
  327. }
  328. .desc {
  329. background-color: #fff;
  330. display: flex;
  331. flex-direction: column;
  332. justify-content: flex-start;
  333. align-items: stretch;
  334. padding-top: 0.6rem;
  335. box-sizing: border-box;
  336. margin-bottom: 4rem;
  337. .desc-item {
  338. flex: 1;
  339. margin-top: 0.5rem;
  340. }
  341. .amount {
  342. display: flex;
  343. justify-content: flex-end;
  344. font-size:$subFontSize;
  345. color: #333;
  346. padding-right: 0.75rem;
  347. border-top: 1px solid #e8eaed;
  348. margin-top: 0.6rem;
  349. height: 2.25rem;
  350. line-height: 2.25rem;
  351. .span {
  352. font-size:$h2;
  353. color: $primaryColor;
  354. }
  355. }
  356. }
  357. .ship {
  358. margin-bottom:0;
  359. }
  360. </style>