orderInformation.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. // console.log(val.status)
  81. this.initData(val)
  82. },
  83. deep:true//对象内部的属性监听,也叫深度监听
  84. }
  85. },
  86. methods:{
  87. initData(res) {
  88. this.orderData = res;
  89. this.payTotalFee =this.toFiexdFn(res.payTotalFee); //订单总额
  90. this.payableAmount =this.toFiexdFn(res.payableAmount); //应付总额
  91. this.balancePayFee = this.toFiexdFn(res.balancePayFee);
  92. this.discountFee = this.toFiexdFn(res.discountFee);
  93. this.freight = this.toFiexdFn(res.freight);
  94. this.expensesOfTaxation = this.toFiexdFn(res.expensesOfTaxation);
  95. console.log(this.expensesOfTaxation)
  96. Object.keys(this.typeTextObject).forEach(key => {
  97. if(key == res.status){
  98. this.typeText = this.typeTextObject[key]
  99. }
  100. })
  101. },
  102. clipboard(data) {
  103. thorui.getClipboardData(data, (res) => {
  104. // #ifdef H5
  105. if (res) {
  106. this.$util.msg("复制成功",3000);
  107. } else {
  108. this.$util.msg("复制失败",3000);
  109. }
  110. // #endif
  111. })
  112. },
  113. toFiexdFn(n){
  114. let num
  115. if(n==null){
  116. num='0.00'
  117. }else{
  118. num = n.toFixed(2)
  119. }
  120. return num
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="scss">
  126. .information-template{
  127. width: 100%;
  128. height: auto;
  129. background: #FFFFFF;
  130. float: left;
  131. margin-top: 24rpx;
  132. .information-content{
  133. width: 702rpx;
  134. padding: 20rpx 24rpx;
  135. .information-view{
  136. height: 50rpx;
  137. line-height: 50rpx;
  138. font-size: $font-size-28;
  139. color: $text-color;
  140. margin: 4rpx 0;
  141. display: flex;
  142. view{
  143. flex: 1;
  144. color: $text-color;
  145. text-align: left;
  146. }
  147. .view-num.ord{
  148. color: $color-system;
  149. text-align: left;
  150. flex:3;
  151. font-weight: bold;
  152. }
  153. .view-num.time{
  154. color: #999999;
  155. }
  156. .bold{
  157. font-weight: bold;
  158. }
  159. .red{
  160. color: #FF2A2A;
  161. }
  162. .view-type{
  163. float: right;
  164. text-align: right;
  165. color: #FF2A2A;
  166. }
  167. .clipboard{
  168. width: 84rpx;
  169. height: 36rpx;
  170. background: linear-gradient(34deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  171. text-align: center;
  172. font-size: $font-size-24;
  173. color: #FFFFFF;
  174. border-radius: 6rpx;
  175. line-height: 36rpx;
  176. display: inline-block;
  177. margin-left: 42rpx;
  178. }
  179. }
  180. }
  181. }
  182. </style>