OrderDetail.vue 14 KB

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