OrderDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <!-- OrderDetailBody.vue -->
  2. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  3. <member-base :show="false"><view class="div">
  4. <view class="div common-header-wrap">
  5. <view :style="'height:'+navHeight+'px'"></view>
  6. <view class="common-header-holder"></view>
  7. <view class="common-header-fixed">
  8. <title-header />
  9. <uni-nav-bar title="订单详情" class="common-header" left-icon="back" @clickLeft="goBack()">
  10. </uni-nav-bar>
  11. </view>
  12. </view>
  13. <view
  14. class="div order-body"
  15. v-if="order_info"
  16. >
  17. <view class="div order_state">
  18. <text class="i iconfont" v-if="order_info.order_state == '40'">&#xe61b;</text>
  19. <text class="i iconfont" v-else>&#xe61a;</text>
  20. <text class="span">{{order_info.state_desc}}</text>
  21. <view class="div pickup-code" v-if="order_info.order_state == '35'">(取货码{{order_info.chain_order_pickup_code}})</view>
  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 class="div order_store" v-if="order_info.extend_store" @click="goNavigate('/pages/home/storedetail/Storedetail',{ 'id': order_info.extend_store.store_id })">
  33. <text class="i store iconfont">&#xe62d;</text><text class="span">{{order_info.extend_store.store_name}}</text><text class="i more iconfont">&#xe650;</text>
  34. </view>
  35. <view
  36. class="div containers"
  37. v-for="item in order_info.goods_list"
  38. v-bind:key="item.goods_id"
  39. @click="goNavigate('/pages/home/goodsdetail/Goodsdetail',{goods_id:item.goods_id})"
  40. >
  41. <image mode="aspectFit"
  42. class="img photo"
  43. v-bind:src="item.image_url"
  44. />
  45. <view class="div right-wrapper">
  46. <label class="title">{{ item.goods_name }}</label>
  47. <label class="property">{{ item.goods_spec }}</label>
  48. <view class="div desc-wrapper">
  49. <view class="div">
  50. <label class="price"
  51. >¥ {{ item.goods_price }}</label
  52. >
  53. <label class="count">x{{ item.goods_num }}</label>
  54. </view>
  55. <view class="div btn-list">
  56. <view v-if="order_info.if_complain" class="div common-btn ds-button-small default" @click.stop="complaint(order_info.order_id,item.rec_id)">投诉</view>
  57. <view v-if="item.refund=='1'" class="div common-btn ds-button-small default" @click.stop="showRefund(item.rec_id)">售后</view>
  58. <view v-if="item.extend_refund && !(item.extend_refund.refund_state==3 || item.extend_refund.refund_state==4)" class="div common-btn ds-button-small default" @click.stop="goRefund(item.extend_refund)">售后</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <view
  64. v-if="order_info.zengpin_list"
  65. class="div containers"
  66. v-for="item in order_info.zengpin_list"
  67. v-bind:key="item.goods_id"
  68. >
  69. <image mode="aspectFit"
  70. class="img photo"
  71. v-bind:src="item.image_url"
  72. />
  73. <view class="div right-wrapper">
  74. <label class="title"><text class="span tag-icon">赠品</text>{{ item.goods_name }}</label>
  75. <label class="property">{{ item.goods_spec }}</label>
  76. <view class="div desc-wrapper">
  77. <view class="div">
  78. <label class="price"
  79. >¥ {{ item.goods_price }}</label
  80. >
  81. <label class="count">x{{ item.goods_num }}</label>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="div detail">
  87. <view class="div number">
  88. <label
  89. >订单编号:{{ order_info.order_sn }}
  90. </label>
  91. <view class="p">
  92. 下单时间:{{order_info.add_time}}
  93. </view>
  94. </view>
  95. <view class="div number">
  96. <view class="p" v-if="order_info.promotion && order_info.promotion.length">
  97. {{order_info.promotion}}
  98. </view>
  99. <view class="p" v-if="order_info.voucher_code">
  100. 使用了面额为 {{order_info.voucher_price}} 元的店铺代金券
  101. </view>
  102. <view class="p" v-if="order_info.extend_order_common.mallvoucher_price">
  103. 使用了面额为 {{order_info.extend_order_common.mallvoucher_price}} 元的平台代金券
  104. </view>
  105. </view>
  106. <view class="div pay" v-if="order_info.payment_name">
  107. <view class="p">支付方式:{{ order_info.payment_name }}</view>
  108. </view>
  109. </view>
  110. <view
  111. class="div desc section-header section-footer"
  112. >
  113. <view class="div container">
  114. <label class="title">商品总额</label>
  115. <label class="subtitle">¥{{ order_info.goods_amount }}</label>
  116. </view>
  117. <view class="div container">
  118. <label class="title">运费</label>
  119. <label class="subtitle">¥{{ order_info.shipping_fee }}</label>
  120. </view>
  121. <label class="amount"
  122. >实付款 : <text class="span"> ¥{{ order_info.order_amount }}</text>
  123. </label>
  124. </view>
  125. </view>
  126. <uni-popup background-color="#fff" ref="popupRefund" type="right" >
  127. <view :style="'width:'+screenWidth+'px'" class="common-popup-wrapper">
  128. <view class="div common-header-wrap">
  129. <view :style="'height:'+navHeight+'px'"></view>
  130. <view class="common-header-holder"></view>
  131. <view class="common-header-fixed">
  132. <title-header />
  133. <uni-nav-bar title="售后" class="common-header" left-icon="back" @clickLeft="hidePopup('popupRefund')">
  134. </uni-nav-bar>
  135. </view>
  136. </view>
  137. <view class="div common-popup-content ">
  138. <scroll-view class='main-content' style="position: absolute;top:0;right:0;left:0;bottom:0" scroll-y="true">
  139. <view class="div" @click='refund(1)'><flex-line class="menu-item" :is-link="true" :show-border="true"><text class="span line-name">退款</text></flex-line></view>
  140. <view class="div" @click='refund(2)'><flex-line class="menu-item" :is-link="true" :show-border="true"><text class="span line-name">退货</text></flex-line></view>
  141. </scroll-view>
  142. </view>
  143. </view>
  144. </uni-popup>
  145. </view></member-base>
  146. </template>
  147. <script>
  148. import {getFontSize} from '@/util/common'
  149. import TitleHeader from '../../TitleHeader'
  150. import { urlencode } from '@/util/common'
  151. import MemberBase from '../MemberBase'
  152. import { getOrderInfo } from '../../../api/memberOrder'
  153. import flexLine from '../../flexLine'
  154. export default {
  155. name:'MemberOrderDetail',
  156. computed:{
  157. fontSize(){
  158. return getFontSize()
  159. },
  160. },
  161. data(){
  162. return {
  163. navHeight: 0,
  164. screenWidth:0,
  165. order_info: {},
  166. rec_id: 0,
  167. }
  168. },
  169. components:{
  170. TitleHeader,
  171. MemberBase,
  172. flexLine
  173. },
  174. onLoad: function (option) {
  175. if (option.order_id) {
  176. getOrderInfo(option.order_id).then(res => {
  177. this.order_info = res.result.order_info
  178. }).catch(function (error) {
  179. uni.showToast({icon:'none',title: error.message})
  180. })
  181. }
  182. },
  183. mounted(){
  184. // #ifdef MP-WEIXIN
  185. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  186. // #endif
  187. this.screenWidth=uni.getSystemInfoSync().screenWidth
  188. },
  189. methods:{
  190. goNavigate(path,query=false){
  191. uni.navigateTo({url:path+(query?('?'+urlencode(query)):'')})
  192. },
  193. showPopup(id){
  194. this.$refs[id].open()
  195. },
  196. hidePopup(id){
  197. this.$refs[id].close()
  198. },
  199. goBack(){uni.navigateBack({delta:1})},
  200. goRefund(refund){
  201. if(refund.return_type==1){
  202. uni.navigateTo({ url: '/pages/member/refund/RefundView'+'?'+urlencode( { refund_id: refund.refund_id } )})
  203. }else{
  204. uni.navigateTo({ url: '/pages/member/return/ReturnView'+'?'+urlencode( { refund_id: refund.refund_id } )})
  205. }
  206. },
  207. showRefund (rec_id) {
  208. this.rec_id = rec_id
  209. this.showPopup('popupRefund')
  210. },
  211. refund (type) {
  212. uni.navigateTo({ url: '/pages/member/return/ReturnForm'+'?'+urlencode( { type: type, order_id: this.order_info.order_id, order_goods_id: this.rec_id } )})
  213. },
  214. complaint (order_id, goods_id) {
  215. uni.navigateTo({ url: '/pages/member/complaint/ComplaintForm'+'?'+urlencode( { order_id: order_id, goods_id: goods_id } )})
  216. }
  217. }
  218. }
  219. </script>
  220. <style lang="scss" scoped>
  221. .common-header-wrap .common-header{box-shadow: unset}
  222. .common-popup-content .main-content{padding:0 $pageSpace;box-sizing: border-box}
  223. .order-body {
  224. overflow: auto;
  225. height: 100%;
  226. position: absolute;
  227. width: 100%;
  228. .desc{
  229. .container {
  230. display: flex;
  231. flex-direction: row;
  232. justify-content: flex-start;
  233. align-items: center;
  234. background-color: #fff;
  235. }
  236. .title {
  237. width:5rem;
  238. font-size:$subFontSize;
  239. color: #333;
  240. margin-left:0.6rem;
  241. }
  242. .subtitle {
  243. flex: 1;
  244. margin-left:1rem;
  245. margin-right:0.6rem;
  246. color: $primaryColor;
  247. font-size:$subFontSize;
  248. text-align: right;
  249. }
  250. }
  251. }
  252. .order_state {
  253. background:$primaryColor;
  254. height:3.5rem;
  255. display: flex;
  256. justify-content: flex-start;
  257. align-items: center;
  258. .i {
  259. color:#fff;
  260. font-size:1.2rem;
  261. padding: 0 0.5rem;
  262. }
  263. .span {
  264. font-size:$h2;
  265. color: #fff;
  266. }
  267. }
  268. .containers {
  269. display: flex;
  270. flex-direction: row;
  271. justify-content: flex-start;
  272. align-items: stretch;
  273. background-color: #fff;
  274. border-bottom: 1px solid #e8eaed;
  275. }
  276. .photo {
  277. width:4rem;
  278. height:4rem;
  279. margin:0.75rem 0.5rem 0.75rem 0.75rem;
  280. border: 1px solid #e8eaed;
  281. flex-basis:4rem;
  282. flex-shrink: 0;
  283. }
  284. .right-wrapper {
  285. display: flex;
  286. flex-direction: column;
  287. justify-content: flex-start;
  288. align-items: stretch;
  289. padding: 0 0.75rem 0 0;
  290. width: 100%;
  291. overflow: hidden;
  292. }
  293. .title {
  294. margin-top:0.75rem;
  295. color: #333;
  296. font-size:$subFontSize;
  297. overflow: hidden;
  298. text-overflow: ellipsis;
  299. white-space: nowrap;
  300. }
  301. .property {
  302. font-size:$fontSize;
  303. color: #7c7f88;
  304. padding-top:0.5rem;
  305. }
  306. .count {
  307. margin-top:0.2rem;
  308. color: #7c7f88;
  309. font-size:$fontSize;
  310. margin-right:0.5rem;
  311. }
  312. .desc-wrapper {
  313. height:1rem;
  314. display: flex;
  315. flex-direction: row;
  316. justify-content: space-between;
  317. align-items: center;
  318. padding-top:1rem;
  319. }
  320. .price {
  321. color: $primaryColor;
  322. font-size:$h2;
  323. margin-left: 0;
  324. }
  325. .btn-list{
  326. display: flex;
  327. }
  328. .ds-button-small.default{
  329. margin: 0 .1rem;
  330. }
  331. .count {
  332. color: #7c7f88;
  333. font-size:$h2;
  334. margin-left:0.5rem;
  335. }
  336. .address {
  337. height:4.4rem;
  338. background-color: #fff;
  339. margin-bottom:0.5rem;
  340. .div {
  341. padding: 0.5rem 0.5rem 0;
  342. }
  343. .img {
  344. height:0.8rem;
  345. }
  346. .span {
  347. color: #333;
  348. font-size:$h2;
  349. &.mobile {
  350. padding-left:1rem;
  351. }
  352. }
  353. .p {
  354. margin:0.25rem 0.9rem 0.5rem 0.5rem;
  355. font-size:$subFontSize;
  356. color: #7c7f88;
  357. overflow: hidden;
  358. text-overflow: ellipsis;
  359. display: -webkit-box;
  360. -webkit-box-orient: vertical;
  361. -webkit-line-clamp: 2;
  362. }
  363. }
  364. .contact {
  365. display: flex;
  366. justify-content: flex-end;
  367. align-items: center;
  368. height:2.3rem;
  369. background-color: #fff;
  370. margin-top:0.4rem;
  371. border-bottom: 1px solid #e8eaed;
  372. padding: 0 0.65rem;
  373. .span {
  374. font-size:$fontSize;
  375. color: #333;
  376. padding-right:0.3rem;
  377. }
  378. .img {
  379. width:0.6rem;
  380. height: 0.65rem;
  381. }
  382. }
  383. .detail {
  384. display: flex;
  385. flex-direction: column;
  386. font-size:$subFontSize;
  387. color: #7c7f88;
  388. background-color: #fff;
  389. margin:0.4rem 0;
  390. box-sizing: border-box;
  391. .number {
  392. padding:0.7rem 0.8rem;
  393. border-bottom: 1px solid #e8eaed;
  394. .p {
  395. padding-top:0.3rem;
  396. font-size:$subFontSize;
  397. }
  398. .button {
  399. color: #7c7f88;
  400. height:1rem;
  401. background-color: #fff;
  402. border: 1px solid #7c7f88;
  403. width:2.7rem;
  404. height:1rem;
  405. border-radius:0.1rem;
  406. font-size:$subFontSize;
  407. display:flex;align-items:center;justify-content:center;
  408. }
  409. }
  410. .pay {
  411. border-bottom: 1px solid #e8eaed;
  412. padding:0.7rem 0.8rem;
  413. }
  414. .givetime {
  415. padding:0.7rem 0.8rem;
  416. font-size:$subFontSize;
  417. }
  418. input {
  419. background-color: #fff;
  420. border: 1px solid #7c7f88;
  421. }
  422. }
  423. .desc {
  424. background-color: #fff;
  425. display: flex;
  426. flex-direction: column;
  427. justify-content: flex-start;
  428. align-items: stretch;
  429. padding-top:0.6rem;
  430. box-sizing: border-box;
  431. margin-bottom:4rem;
  432. .desc-item {
  433. flex: 1;
  434. margin-top:0.5rem;
  435. }
  436. .amount {
  437. display: flex;
  438. justify-content: flex-end;
  439. font-size:$subFontSize;
  440. color: #333;
  441. padding-right:0.75rem;
  442. border-top: 1px solid #e8eaed;
  443. margin-top:0.6rem;
  444. height:2.2rem;
  445. line-height:2.2rem;
  446. .span {
  447. font-size:$h2;
  448. color: $primaryColor;
  449. }
  450. }
  451. }
  452. .ship {
  453. margin-bottom: 0;
  454. }
  455. .order_store{background:#fff;height:1rem;line-height:1rem;padding:0.5rem 0.8rem;border-bottom:1px solid #f5f5f5}
  456. .order_store .span{color:#333;font-size:$subFontSize;font-weight:600;float:left;margin:0 0.4rem;}
  457. .order_store .i.store{float:left}
  458. .order_store .i.more{float:left;font-size:$subFontSize;}
  459. .pickup-code{font-size:$fontSize;color:#fff}
  460. </style>