orderDetail.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. <template>
  2. <view :class="[AppTheme]" class="content" v-if="orderList">
  3. <view class="detail-c">
  4. <view class="mb20">
  5. <text class="mr10">订单状态 :{{ orderList.status==0?'已取消':orderList.status==1?'待付款':orderList.status==2?'待发货':orderList.status==3?'待收货':orderList.status==4?'退货中':
  6. orderList.status==9?'未成团':orderList.status==6?'已关闭':orderList.status==10?'退款中':orderList.status==7?'退货完成':orderList.status==5?'交易完成':orderList.status==8?'满七天订单':''}}</text>
  7. <text>{{ orderList.name }}</text>
  8. </view>
  9. <view class="mb20">
  10. <text class="mr10">实付总额 :</text>
  11. <text>{{ orderList.payprice }}</text>
  12. </view>
  13. <view class="mb20">
  14. <text class="mr10">订单编号 :</text>
  15. <text>{{ orderList.oid || 0 }}</text>
  16. </view>
  17. <view class="mb20">
  18. <text class="mr10">创建时间 :</text>
  19. <text> {{ $u.timeFormat(orderList.ctime,fmt = 'yyyy.mm.dd hh:MM:ss') || 0 }}</text>
  20. </view>
  21. <view class="mb20">
  22. <text class="mr10">收件人 :</text>
  23. <text>{{ orderList.vipname || 0 }}</text>
  24. </view>
  25. <view class="mb20">
  26. <text class="mr10">联系方式 :</text>
  27. <text>{{ orderList.vipmobile || 0 }}</text>
  28. </view>
  29. <view class="mb20">
  30. <text class="mr10">收货地址 :</text>
  31. <text>{{ orderList.vipaddress || 0 }}</text>
  32. </view>
  33. <view class="mb20">
  34. <text class="mr10">邮费 :</text>
  35. <text>{{ orderList.yf || 0 }}</text>
  36. </view>
  37. <view class="mb20">
  38. <text class="mr10">代金券 :</text>
  39. <text>{{ orderList.djqmoney || 0 }}</text>
  40. </view>
  41. <view class="mb20">
  42. <text class="mr10">备注 :{{ orderList.msg || '' }}</text>
  43. <text></text>
  44. </view>
  45. <view class="mb20" v-for="(item,index) in log" :key="index"><text class="mr10">订单进度: {{ $u.timeFormat(item.ctime,fmt = 'yyyy/mm/dd hh:MM:ss') || 0 }} {{ item.msg }}</text></view>
  46. </view>
  47. <view class="order-item">
  48. <view class="i-top b-b">
  49. <text class="time">订单编号:{{ orderList.oid }}</text>
  50. </view>
  51. <scroll-view v-if="orderList.items&&orderList.items.length > 1" class="goods-box" scroll-x>
  52. <view v-for="(goodsItem, goodsIndex) in orderList.items" :key="goodsIndex" class="goods-item">
  53. <image class="goods-img" :src=" goodsItem.pic" mode="aspectFill"></image>
  54. </view>
  55. </scroll-view>
  56. <view v-if="orderList.items.length === 1" class="goods-box-single" v-for="(goodsItem, goodsIndex) in orderList.items" :key="goodsIndex">
  57. <image class="goods-img" :src=" goodsItem.pic" mode="aspectFill"></image>
  58. <view class="right">
  59. <text class="title clamp">{{ goodsItem.name }}</text>
  60. <text class="attr-box">x {{ goodsItem.num }}</text>
  61. <text class="price text-neutral">{{ goodsItem.price }}</text>
  62. </view>
  63. </view>
  64. <view class="price-box">
  65. <text class="num">{{ orderList.totalnum }}</text>
  66. 件商品
  67. 运费<text class="num price text-neutral">{{ orderList.yf }}</text>
  68. 实付款
  69. <text class="price text-neutral">{{ Number(orderList.payprice) }}</text>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. import order from '@/api/order/index.js';
  76. export default {
  77. data() {
  78. return {
  79. primary:this.$theme.primary,
  80. info: {},
  81. settingFile:getApp().globalData.siteinfo,
  82. tabCurrentIndex: 0,
  83. orderList: {},
  84. log:[],
  85. };
  86. },
  87. onLoad(options) {
  88. this.getOrderDetail(options.sid, options.id);
  89. },
  90. methods: {
  91. getOrderDetail(sid, id) {
  92. order
  93. .orderDetail({
  94. sid: sid,
  95. orderid: id
  96. })
  97. .then(res => {
  98. if (res.status == 200) {
  99. this.orderList = res.data.cache;
  100. this.log = res.data.log;
  101. }
  102. });
  103. }
  104. }
  105. };
  106. </script>
  107. <style lang="scss">
  108. page,
  109. .content {
  110. background: $page-color-base;
  111. height: 100%;
  112. }
  113. .swiper-box {
  114. height: calc(100% - 40px);
  115. }
  116. .list-scroll-content {
  117. height: 100%;
  118. }
  119. .uni-swiper-item {
  120. height: auto;
  121. }
  122. .f-tui{
  123. width: 100%;
  124. min-height: 270rpx;
  125. background: #fff;
  126. margin-top: 16rpx;
  127. padding-left: 30rpx;
  128. padding-bottom: 30rpx;
  129. }
  130. .tui-btn{
  131. position: relative;
  132. left: 520rpx;
  133. width: 151rpx;
  134. height: 60rpx;
  135. display: flex;
  136. justify-content: center;
  137. align-items: center;
  138. border-radius: 7rpx;
  139. border: 1px solid $tab-color-2;
  140. margin-top: 20rpx;
  141. background: $tab-color;
  142. box-shadow: 1px 2px 5px $tab-color-2;
  143. color: #fff;
  144. }
  145. .detail-c {
  146. margin: 0 auto;
  147. background-color: #ffffff;
  148. padding: 27rpx;
  149. font-size: 28rpx;
  150. color: #999;
  151. .mb20 {
  152. line-height: 40rpx;
  153. margin-bottom: 20rpx;
  154. .mr10 {
  155. margin-right: 20rpx;
  156. }
  157. .ml10 {
  158. margin-left: 20rpx;
  159. }
  160. }
  161. .flex {
  162. display: flex;
  163. justify-content: space-between;
  164. }
  165. }
  166. .i-top {
  167. display: flex;
  168. align-items: center;
  169. height: 80upx;
  170. padding-right: 30upx;
  171. font-size: $font-base;
  172. color: $font-color-dark;
  173. position: relative;
  174. .time {
  175. flex: 1;
  176. flex-grow: 1;
  177. }
  178. .state {
  179. color: $base-color;
  180. }
  181. .del-btn {
  182. padding: 10upx 0 10upx 36upx;
  183. font-size: $font-lg;
  184. color: $font-color-light;
  185. position: relative;
  186. &:after {
  187. content: '';
  188. width: 0;
  189. height: 30upx;
  190. border-left: 1px solid $border-color-dark;
  191. position: absolute;
  192. left: 20upx;
  193. top: 50%;
  194. transform: translateY(-50%);
  195. }
  196. }
  197. }
  198. .order-item {
  199. display: flex;
  200. flex-direction: column;
  201. padding-left: 30upx;
  202. background: #fff;
  203. margin-top: 16upx;
  204. /* 多条商品 */
  205. .goods-box {
  206. height: 160upx;
  207. padding: 20upx 0;
  208. white-space: nowrap;
  209. .goods-item {
  210. width: 120upx;
  211. height: 120upx;
  212. display: inline-block;
  213. margin-right: 24upx;
  214. }
  215. .goods-img {
  216. display: block;
  217. width: 100%;
  218. height: 100%;
  219. }
  220. }
  221. /* 单条商品 */
  222. .goods-box-single {
  223. display: flex;
  224. padding: 20upx 0;
  225. .goods-img {
  226. display: block;
  227. width: 120upx;
  228. height: 120upx;
  229. }
  230. .right {
  231. flex: 1;
  232. display: flex;
  233. flex-direction: column;
  234. padding: 0 30upx 0 24upx;
  235. overflow: hidden;
  236. .title {
  237. font-size: $font-base + 2upx;
  238. color: $font-color-dark;
  239. line-height: 40rpx;
  240. height: 40rpx;
  241. }
  242. .attr-box {
  243. font-size: $font-sm + 2upx;
  244. color: $font-color-light;
  245. padding: 10upx 12upx;
  246. }
  247. .price {
  248. font-size: $font-base + 2upx;
  249. &:before {
  250. content: '¥';
  251. font-size: $font-sm;
  252. margin: 0 2upx 0 8upx;
  253. }
  254. }
  255. }
  256. }
  257. .price-box {
  258. display: flex;
  259. justify-content: flex-end;
  260. align-items: baseline;
  261. padding: 20upx 30upx;
  262. font-size: $font-sm + 2upx;
  263. color: $font-color-light;
  264. .num {
  265. margin: 0 8upx;
  266. }
  267. .price {
  268. font-size: $font-lg;
  269. &:before {
  270. content: '¥';
  271. font-size: $font-sm;
  272. margin: 0 2upx 0 8upx;
  273. }
  274. }
  275. }
  276. .action-box {
  277. display: flex;
  278. justify-content: flex-end;
  279. align-items: center;
  280. height: 100upx;
  281. position: relative;
  282. padding-right: 30upx;
  283. }
  284. .action-btn {
  285. width: 160upx;
  286. height: 60upx;
  287. margin: 0;
  288. margin-left: 24upx;
  289. padding: 0;
  290. text-align: center;
  291. line-height: 60upx;
  292. font-size: $font-sm + 2upx;
  293. color: $font-color-dark;
  294. background: #fff;
  295. border-radius: 100px;
  296. &:after {
  297. border-radius: 100px;
  298. }
  299. &.recom {
  300. background: #fff9f9;
  301. color: $base-color;
  302. &:after {
  303. border-color: #f7bcc8;
  304. }
  305. }
  306. }
  307. }
  308. /* load-more */
  309. .uni-load-more {
  310. display: flex;
  311. flex-direction: row;
  312. height: 80upx;
  313. align-items: center;
  314. justify-content: center;
  315. }
  316. .uni-load-more__text {
  317. font-size: 28upx;
  318. color: #999;
  319. }
  320. .uni-load-more__img {
  321. height: 24px;
  322. width: 24px;
  323. margin-right: 10px;
  324. }
  325. .uni-load-more__img > view {
  326. position: absolute;
  327. }
  328. .uni-load-more__img > view view {
  329. width: 6px;
  330. height: 2px;
  331. border-top-left-radius: 1px;
  332. border-bottom-left-radius: 1px;
  333. background: #999;
  334. position: absolute;
  335. opacity: 0.2;
  336. transform-origin: 50%;
  337. animation: load 1.56s ease infinite;
  338. }
  339. .uni-load-more__img > view view:nth-child(1) {
  340. transform: rotate(90deg);
  341. top: 2px;
  342. left: 9px;
  343. }
  344. .uni-load-more__img > view view:nth-child(2) {
  345. transform: rotate(180deg);
  346. top: 11px;
  347. right: 0;
  348. }
  349. .uni-load-more__img > view view:nth-child(3) {
  350. transform: rotate(270deg);
  351. bottom: 2px;
  352. left: 9px;
  353. }
  354. .uni-load-more__img > view view:nth-child(4) {
  355. top: 11px;
  356. left: 0;
  357. }
  358. .load1,
  359. .load2,
  360. .load3 {
  361. height: 24px;
  362. width: 24px;
  363. }
  364. .load2 {
  365. transform: rotate(30deg);
  366. }
  367. .load3 {
  368. transform: rotate(60deg);
  369. }
  370. .load1 view:nth-child(1) {
  371. animation-delay: 0s;
  372. }
  373. .load2 view:nth-child(1) {
  374. animation-delay: 0.13s;
  375. }
  376. .load3 view:nth-child(1) {
  377. animation-delay: 0.26s;
  378. }
  379. .load1 view:nth-child(2) {
  380. animation-delay: 0.39s;
  381. }
  382. .load2 view:nth-child(2) {
  383. animation-delay: 0.52s;
  384. }
  385. .load3 view:nth-child(2) {
  386. animation-delay: 0.65s;
  387. }
  388. .load1 view:nth-child(3) {
  389. animation-delay: 0.78s;
  390. }
  391. .load2 view:nth-child(3) {
  392. animation-delay: 0.91s;
  393. }
  394. .load3 view:nth-child(3) {
  395. animation-delay: 1.04s;
  396. }
  397. .load1 view:nth-child(4) {
  398. animation-delay: 1.17s;
  399. }
  400. .load2 view:nth-child(4) {
  401. animation-delay: 1.3s;
  402. }
  403. .load3 view:nth-child(4) {
  404. animation-delay: 1.43s;
  405. }
  406. @-webkit-keyframes load {
  407. 0% {
  408. opacity: 1;
  409. }
  410. 100% {
  411. opacity: 0.2;
  412. }
  413. }
  414. </style>