orderInformation.vue 4.8 KB

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