orderInformation.vue 4.1 KB

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