orderInformation.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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 : '' | NumFormat }}
  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 : '' | NumFormat }}
  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. NumFormat(value) {
  73. //处理金额
  74. return Number(value).toFixed(2)
  75. },
  76. TextFormat(status) {
  77. //处理金额
  78. let HtmlText,
  79. typeTextObject = {
  80. 0: '待确认',
  81. 4: '交易完成',
  82. 5: '订单完成',
  83. 6: '已关闭',
  84. 7: '交易全退',
  85. 77: '交易全退',
  86. 11: '待付款待发货',
  87. 12: '待付款部分发货',
  88. 13: '待付款已发货',
  89. 21: '部分付款待发货',
  90. 22: '部分付款部分发货',
  91. 23: '部分付款已发货',
  92. 31: '已付款待发货',
  93. 32: '已付款部分发货',
  94. 33: '已付款已发货',
  95. 111: '待付款待发货'
  96. }
  97. Object.keys(typeTextObject).forEach(key => {
  98. if (key == status) {
  99. HtmlText = typeTextObject[key]
  100. }
  101. })
  102. return HtmlText
  103. }
  104. },
  105. computed: {},
  106. watch: {
  107. information: {
  108. handler: function(val) {
  109. this.initData(val)
  110. },
  111. deep: true //对象内部的属性监听,也叫深度监听
  112. }
  113. },
  114. methods: {
  115. initData(res) {
  116. this.orderData = res
  117. },
  118. clipboard(data) {
  119. thorui.getClipboardData(data, res => {
  120. if (res) {
  121. this.$util.msg('复制成功', 2000, true, 'success')
  122. } else {
  123. this.$util.msg('复制失败', 2000, true, 'none')
  124. }
  125. })
  126. }
  127. }
  128. }
  129. </script>
  130. <style lang="scss">
  131. .information-template {
  132. width: 100%;
  133. height: auto;
  134. background: #ffffff;
  135. float: left;
  136. margin-top: 24rpx;
  137. .information-content {
  138. width: 702rpx;
  139. padding: 15rpx 24rpx 20rpx 24rpx;
  140. .information-view {
  141. height: 50rpx;
  142. line-height: 50rpx;
  143. font-size: $font-size-24;
  144. margin: 4rpx 0;
  145. // display: flex;
  146. width: 58%;
  147. display: inline-block;
  148. &.same {
  149. width: 100%;
  150. text-align: right;
  151. }
  152. &.bame {
  153. width: 42%;
  154. text-align: right;
  155. }
  156. &.title {
  157. width: 100%;
  158. }
  159. view {
  160. // flex: 1;
  161. color: $text-color;
  162. color: #999999;
  163. .label {
  164. color: #666666;
  165. }
  166. }
  167. .view-num.title {
  168. height: 68rpx;
  169. line-height: 68rpx;
  170. position: relative;
  171. .bage-icon {
  172. width: 50rpx;
  173. height: 50rpx;
  174. display: block;
  175. position: absolute;
  176. right: 0;
  177. top: 9rpx;
  178. }
  179. .bage-text {
  180. display: inline-block;
  181. font-size: $font-size-28;
  182. line-height: 68rpx;
  183. text-align: left;
  184. color: $color-system;
  185. // margin-left: 10rpx;
  186. }
  187. }
  188. .view-num.ord {
  189. color: $color-system;
  190. text-align: left;
  191. flex: 3;
  192. font-weight: bold;
  193. }
  194. .view-num.time {
  195. color: #999999;
  196. flex: 6;
  197. }
  198. // .bold{
  199. // font-weight: bold;
  200. // }
  201. .red {
  202. color: #ff457b;
  203. }
  204. .view-type {
  205. float: right;
  206. text-align: right;
  207. color: #ff457b;
  208. flex: 4;
  209. }
  210. .clipboard {
  211. width: 64rpx;
  212. height: 32rpx;
  213. background: #fff8fd;
  214. text-align: center;
  215. font-size: $font-size-22;
  216. color: $color-system;
  217. border-radius: 8rpx;
  218. line-height: 32rpx;
  219. display: inline-block;
  220. margin-left: 15rpx;
  221. }
  222. }
  223. }
  224. }
  225. .openinfo {
  226. .btnInfo {
  227. width: 140rpx;
  228. height: 40rpx;
  229. border: 2rpx solid #e1e1e1;
  230. border-radius: 6rpx;
  231. padding: 5rpx;
  232. text-align: center;
  233. color: #b2b2b2;
  234. margin: 20rpx auto;
  235. font-size: $font-size-24;
  236. .iconfont {
  237. position: relative;
  238. top: 5rpx;
  239. right: -3rpx;
  240. }
  241. }
  242. }
  243. </style>