OrderDetail.vue 16 KB

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