orderInformation.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. 4:'交易完成',
  54. 5:'订单完成',
  55. 6:'已关闭',
  56. 7:'交易全退',
  57. 77:'交易全退',
  58. 11:'待付款待发货',
  59. 12:'待付款部分发货',
  60. 13:'待付款已发货',
  61. 21:'部分付款待发货',
  62. 22:'部分付款部分发货',
  63. 23:'部分付款已发货',
  64. 31:'已付款待发货',
  65. 32:'已付款部分发货',
  66. 33:'已付款已发货',
  67. 111:'待付款待发货',
  68. }
  69. }
  70. },
  71. created(){
  72. this.initData(this.information)
  73. },
  74. computed: {
  75. },
  76. watch:{
  77. information:{
  78. handler:function(val){
  79. // console.log(val.status)
  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. console.log(this.expensesOfTaxation)
  95. Object.keys(this.typeTextObject).forEach(key => {
  96. if(key == res.status){
  97. this.typeText = this.typeTextObject[key]
  98. }
  99. })
  100. },
  101. clipboard(data) {
  102. thorui.getClipboardData(data, (res) => {
  103. // #ifdef H5
  104. if (res) {
  105. this.$util.msg("复制成功",3000);
  106. } else {
  107. this.$util.msg("复制失败",3000);
  108. }
  109. // #endif
  110. })
  111. },
  112. toFiexdFn(n){
  113. let num
  114. if(n==null){
  115. num='0.00'
  116. }else{
  117. num = n.toFixed(2)
  118. }
  119. return num
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss">
  125. .information-template{
  126. width: 100%;
  127. height: auto;
  128. background: #FFFFFF;
  129. float: left;
  130. margin-top: 24rpx;
  131. .information-content{
  132. width: 702rpx;
  133. padding: 20rpx 24rpx;
  134. .information-view{
  135. height: 50rpx;
  136. line-height: 50rpx;
  137. font-size: $font-size-28;
  138. color: $text-color;
  139. margin: 4rpx 0;
  140. display: flex;
  141. view{
  142. flex: 1;
  143. color: $text-color;
  144. text-align: left;
  145. }
  146. .view-num.ord{
  147. color: $color-system;
  148. text-align: left;
  149. flex:3;
  150. font-weight: bold;
  151. }
  152. .view-num.time{
  153. color: #999999;
  154. }
  155. .bold{
  156. font-weight: bold;
  157. }
  158. .red{
  159. color: #FF2A2A;
  160. }
  161. .view-type{
  162. float: right;
  163. text-align: right;
  164. color: #FF2A2A;
  165. }
  166. .clipboard{
  167. width: 84rpx;
  168. height: 36rpx;
  169. background: linear-gradient(34deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  170. text-align: center;
  171. font-size: $font-size-24;
  172. color: #FFFFFF;
  173. border-radius: 6rpx;
  174. line-height: 36rpx;
  175. display: inline-block;
  176. margin-left: 42rpx;
  177. }
  178. }
  179. }
  180. }
  181. </style>