orderInformation.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template name="information">
  2. <view class="information-template">
  3. <!-- 订单信息 -->
  4. <view class="information-content">
  5. <view class="information-view title">
  6. <view class="view-num">
  7. <view class="bage-text">
  8. 订单编号:<label class="label">{{ orderData.orderNo ? orderData.orderNo : '' }}</label>
  9. <text class="clipboard" @click="clipboard(orderData.orderNo)">复制</text>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="information-view title">
  14. <view class="view-num">
  15. <text>订单总额:</text>
  16. <label class="label">
  17. ¥{{ orderData.payTotalFee ? orderData.payTotalFee : '' | formatPrice }}
  18. </label>
  19. </view>
  20. </view>
  21. <view class="information-view title">
  22. <view class="view-num">
  23. <text>优惠券:</text>
  24. <label class="label">
  25. ¥{{ orderData.couponAmount ? orderData.couponAmount : '' | formatPrice }}
  26. </label>
  27. </view>
  28. </view>
  29. <view class="information-view">
  30. <view class="view-num time">
  31. <text>下单时间:</text>
  32. <label class="label">{{ orderData.orderTime ? orderData.orderTime : '' }}</label>
  33. </view>
  34. </view>
  35. <view class="information-view bame">
  36. <view class="view-num"> <text> 运费:</text> <label class="label">包邮</label> </view>
  37. </view>
  38. <view class="information-view">
  39. <view class="view-num time" v-if="orderData.receiptAmount > 0">
  40. <text>支付时间:</text>
  41. <label class="label">{{ orderData.receiptDate ? orderData.receiptDate : '' }}</label>
  42. </view>
  43. </view>
  44. <view class="information-view bame">
  45. <view class="view-man">
  46. <text>已退货/已取消:</text>
  47. <label class="label">{{ orderData.returnedNum }}/{{ orderData.actualCancelNum }}</label>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import thorui from '@/components/clipboard/clipboard.thorui.js'
  55. export default {
  56. name: 'information',
  57. props: {
  58. information: {
  59. type: Object
  60. }
  61. },
  62. data() {
  63. return {
  64. orderData: '',
  65. freePostFlag: ''
  66. }
  67. },
  68. created() {
  69. this.initData(this.information)
  70. },
  71. filters: {
  72. TextFormat(status) {
  73. //处理金额
  74. let HtmlText,
  75. typeTextObject = {
  76. 0: '待确认',
  77. 4: '交易完成',
  78. 5: '订单完成',
  79. 6: '已关闭',
  80. 7: '交易全退',
  81. 77: '交易全退',
  82. 11: '待付款待发货',
  83. 12: '待付款部分发货',
  84. 13: '待付款已发货',
  85. 21: '部分付款待发货',
  86. 22: '部分付款部分发货',
  87. 23: '部分付款已发货',
  88. 31: '已付款待发货',
  89. 32: '已付款部分发货',
  90. 33: '已付款已发货',
  91. 111: '待付款待发货'
  92. }
  93. Object.keys(typeTextObject).forEach(key => {
  94. if (key == status) {
  95. HtmlText = typeTextObject[key]
  96. }
  97. })
  98. return HtmlText
  99. }
  100. },
  101. computed: {},
  102. watch: {
  103. information: {
  104. handler: function(val) {
  105. this.initData(val)
  106. },
  107. deep: true //对象内部的属性监听,也叫深度监听
  108. }
  109. },
  110. methods: {
  111. initData(res) {
  112. this.orderData = res
  113. },
  114. clipboard(data) {
  115. thorui.getClipboardData(data, res => {
  116. if (res) {
  117. this.$util.msg('复制成功', 2000, true, 'success')
  118. } else {
  119. this.$util.msg('复制失败', 2000, true, 'none')
  120. }
  121. })
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="scss">
  127. .information-template {
  128. width: 100%;
  129. height: auto;
  130. background: #ffffff;
  131. float: left;
  132. margin-top: 24rpx;
  133. .information-content {
  134. width: 702rpx;
  135. padding: 15rpx 24rpx 20rpx 24rpx;
  136. .information-view {
  137. height: 50rpx;
  138. line-height: 50rpx;
  139. font-size: $font-size-24;
  140. margin: 4rpx 0;
  141. // display: flex;
  142. width: 58%;
  143. display: inline-block;
  144. &.same {
  145. width: 100%;
  146. text-align: right;
  147. }
  148. &.bame {
  149. width: 42%;
  150. text-align: right;
  151. }
  152. &.title {
  153. width: 100%;
  154. }
  155. view {
  156. // flex: 1;
  157. color: $text-color;
  158. color: #999999;
  159. .label {
  160. color: #666666;
  161. }
  162. }
  163. .view-num.title {
  164. height: 68rpx;
  165. line-height: 68rpx;
  166. position: relative;
  167. .bage-icon {
  168. width: 50rpx;
  169. height: 50rpx;
  170. display: block;
  171. position: absolute;
  172. right: 0;
  173. top: 9rpx;
  174. }
  175. .bage-text {
  176. display: inline-block;
  177. font-size: $font-size-28;
  178. line-height: 68rpx;
  179. text-align: left;
  180. color: $color-system;
  181. // margin-left: 10rpx;
  182. }
  183. }
  184. .view-num.ord {
  185. color: $color-system;
  186. text-align: left;
  187. flex: 3;
  188. font-weight: bold;
  189. }
  190. .view-num.time {
  191. color: #999999;
  192. flex: 6;
  193. }
  194. // .bold{
  195. // font-weight: bold;
  196. // }
  197. .red {
  198. color: #ff457b;
  199. }
  200. .view-type {
  201. float: right;
  202. text-align: right;
  203. color: #ff457b;
  204. flex: 4;
  205. }
  206. .clipboard {
  207. width: 64rpx;
  208. height: 32rpx;
  209. background: #fff8fd;
  210. text-align: center;
  211. font-size: $font-size-22;
  212. color: $color-system;
  213. border-radius: 8rpx;
  214. line-height: 32rpx;
  215. display: inline-block;
  216. margin-left: 15rpx;
  217. }
  218. }
  219. }
  220. }
  221. .openinfo {
  222. .btnInfo {
  223. width: 140rpx;
  224. height: 40rpx;
  225. border: 2rpx solid #e1e1e1;
  226. border-radius: 6rpx;
  227. padding: 5rpx;
  228. text-align: center;
  229. color: #b2b2b2;
  230. margin: 20rpx auto;
  231. font-size: $font-size-24;
  232. .iconfont {
  233. position: relative;
  234. top: 5rpx;
  235. right: -3rpx;
  236. }
  237. }
  238. }
  239. </style>