orderInformation.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template name="information">
  2. <view class="information-template">
  3. <!-- 订单信息 -->
  4. <view class="information-content">
  5. <view class="information-view num">
  6. <view class="view-num ord">订单编号:{{orderData.orderNo =='undefined' ? '' : orderData.orderNo}}</view>
  7. <view class="view-type bold">{{typeText}}</view>
  8. </view>
  9. <view class="information-view">
  10. <view class="view-num bold">
  11. 订单标识:{{orderData.orderMark =='undefined' ? '' : orderData.orderMark}}
  12. <text class="clipboard" @click="clipboard(orderData.orderMark)">复制</text>
  13. </view>
  14. </view>
  15. <view class="information-view">
  16. <view class="view-num">订单总额:¥{{payTotalFee =='undefined' ? '' : payTotalFee}}</view>
  17. <view class="view-man">余额抵扣:¥{{balancePayFee =='undefined' ? '' : balancePayFee}}</view>
  18. </view>
  19. <view class="information-view">
  20. <view class="view-num">运费:¥{{freight =='undefined' ? '0.00' : freight}}</view>
  21. <view class="view-man">经理折扣:¥{{discountFee =='undefined' ? '' : discountFee}}</view>
  22. </view>
  23. <view class="information-view">
  24. <view class="view-num">税费:¥{{expensesOfTaxation == null ? '0.00' : expensesOfTaxation}}</view>
  25. <view class="view-man bold">应付总额:<text class="red">¥{{payableAmount =='undefined' ? '0.00' : payableAmount}}</text></view>
  26. </view>
  27. <view class="information-view">
  28. <view class="view-num time">下单时间:{{orderData.orderTime =='undefined' ? '' : orderData.orderTime}}</view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. const thorui = require("@/components/clipboard/clipboard.thorui.js")
  35. export default{
  36. name:"information",
  37. props:{
  38. information:{
  39. type:Object
  40. }
  41. },
  42. data() {
  43. return{
  44. orderData:'',
  45. payTotalFee:'',
  46. balancePayFee:'',
  47. discountFee:'',
  48. freight:'',
  49. payableAmount:'',
  50. typeText:'',
  51. expensesOfTaxation:'',
  52. typeTextObject:{
  53. 0:'待确认',
  54. 4:'交易完成',
  55. 5:'订单完成',
  56. 6:'已关闭',
  57. 7:'交易全退',
  58. 77:'交易全退',
  59. 11:'待付款待发货',
  60. 12:'待付款部分发货',
  61. 13:'待付款已发货',
  62. 21:'部分付款待发货',
  63. 22:'部分付款部分发货',
  64. 23:'部分付款已发货',
  65. 31:'已付款待发货',
  66. 32:'已付款部分发货',
  67. 33:'已付款已发货',
  68. 111:'待付款待发货',
  69. }
  70. }
  71. },
  72. created(){
  73. this.initData(this.information)
  74. },
  75. computed: {
  76. },
  77. watch:{
  78. information:{
  79. handler:function(val){
  80. this.initData(val)
  81. },
  82. deep:true//对象内部的属性监听,也叫深度监听
  83. }
  84. },
  85. methods:{
  86. initData(res) {
  87. this.orderData = res;
  88. this.payTotalFee =this.toFiexdFn(res.payTotalFee); //订单总额
  89. this.payableAmount =this.toFiexdFn(res.payableAmount); //应付总额
  90. this.balancePayFee = this.toFiexdFn(res.balancePayFee);
  91. this.discountFee = this.toFiexdFn(res.discountFee);
  92. this.freight = this.toFiexdFn(res.freight);
  93. this.expensesOfTaxation = this.toFiexdFn(res.expensesOfTaxation);
  94. Object.keys(this.typeTextObject).forEach(key => {
  95. if(key == res.status){
  96. this.typeText = this.typeTextObject[key]
  97. }
  98. })
  99. },
  100. clipboard(data) {
  101. thorui.getClipboardData(data, (res) => {
  102. // #ifdef H5
  103. if (res) {
  104. this.$util.msg("复制成功",3000);
  105. } else {
  106. this.$util.msg("复制失败",3000);
  107. }
  108. // #endif
  109. })
  110. },
  111. toFiexdFn(n){
  112. let num
  113. if(n==null){
  114. num='0.00'
  115. }else{
  116. num = n.toFixed(2)
  117. }
  118. return num
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss">
  124. .information-template{
  125. width: 100%;
  126. height: auto;
  127. background: #FFFFFF;
  128. float: left;
  129. margin-top: 24rpx;
  130. .information-content{
  131. width: 702rpx;
  132. padding: 20rpx 24rpx;
  133. .information-view{
  134. height: 50rpx;
  135. line-height: 50rpx;
  136. font-size: $font-size-28;
  137. color: $text-color;
  138. margin: 4rpx 0;
  139. display: flex;
  140. view{
  141. flex: 1;
  142. color: $text-color;
  143. text-align: left;
  144. }
  145. .view-num.ord{
  146. color: $color-system;
  147. text-align: left;
  148. flex:3;
  149. font-weight: bold;
  150. }
  151. .view-num.time{
  152. color: #999999;
  153. }
  154. .bold{
  155. font-weight: bold;
  156. }
  157. .red{
  158. color: #FF2A2A;
  159. }
  160. .view-type{
  161. float: right;
  162. text-align: right;
  163. color: #FF2A2A;
  164. }
  165. .clipboard{
  166. width: 84rpx;
  167. height: 36rpx;
  168. background: linear-gradient(34deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  169. text-align: center;
  170. font-size: $font-size-24;
  171. color: #FFFFFF;
  172. border-radius: 6rpx;
  173. line-height: 36rpx;
  174. display: inline-block;
  175. margin-left: 42rpx;
  176. }
  177. }
  178. }
  179. }
  180. </style>