invoiceTent.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template name="invoice">
  2. <view class="invoice-template">
  3. <!-- 发票信息 -->
  4. <view class="invoice-content">
  5. <view class="invoice-title">发票信息</view>
  6. <view class="invoice-empty" v-if="isEmpty">
  7. <text>不开发票</text></text>
  8. </view>
  9. <view class="invoice-text" v-else>
  10. <view class="invoice-top" @click="showInvoice">
  11. <view class="name">{{orderInvoice.invoiceTitle ? orderInvoice.invoiceTitle : ''}}</view>
  12. <text class="iconfont icon-web_xiangxiazhankai" :class="{'icon-web_xiangxiazhankai-active':isOpen}"></text>
  13. </view>
  14. <view :class="{'invoice-warp--hide':!isOpen}" class="invoice-warp">
  15. <view class="invoice-warp__wrapper invoice-animation"
  16. :style="{'transform':isOpen?'translateY(0)':'translateY(-50%)','-webkit-transform':isOpen?'translateY(0)':'translateY(-50%)'}">
  17. <view class="table">
  18. <text class="label-name">单位名称:</text>
  19. <text>{{orderInvoice.invoiceTitle ? orderInvoice.invoiceTitle : ''}}</text>
  20. </view>
  21. <view class="table long">
  22. <text class="label-name">纳锐人识别号:</text>
  23. <text>{{orderInvoice.corporationTaxNum ? orderInvoice.corporationTaxNum :''}}</text>
  24. </view>
  25. <view class="table">
  26. <text class="label-name">注册地址:</text>
  27. <text>{{orderInvoice.registeredAddress ? orderInvoice.registeredAddress : ''}}</text>
  28. </view>
  29. <view class="table">
  30. <text class="label-name">注册电话:</text>
  31. <text>{{orderInvoice.registeredPhone ? orderInvoice.registeredPhone : ''}}</text>
  32. </view>
  33. <view class="table">
  34. <text class="label-name">开户银行:</text>
  35. <text>{{orderInvoice.openBank ? orderInvoice.openBank : ''}}</text>
  36. </view>
  37. <view class="table">
  38. <text class="label-name">银行账号:</text>
  39. <text>{{bankAccountNo ? bankAccountNo : ''}}</text>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. export default{
  49. name:"invoice",
  50. props:{
  51. orderInvoice:{
  52. type:Object
  53. }
  54. },
  55. data() {
  56. return{
  57. isEmpty:false,
  58. title:'发票信息',
  59. isOpen:false,
  60. bankAccountNo:''
  61. }
  62. },
  63. created(){
  64. this.initData(this.orderInvoice)
  65. },
  66. computed: {
  67. },
  68. methods:{
  69. initData(res) {
  70. if(res == null || res.type == '0'){
  71. this.isEmpty = true
  72. }else{
  73. this.isEmpty = false
  74. this.bankAccountNo = this.$reg.bankRegex(res.bankAccountNo)
  75. }
  76. },
  77. onMessage(pros){
  78. },
  79. showInvoice(){
  80. this.isOpen = !this.isOpen
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. .invoice-template{
  87. width: 100%;
  88. height: auto;
  89. background: #FFFFFF;
  90. float: left;
  91. margin-top: 24rpx;
  92. .invoice-content{
  93. width: 702rpx;
  94. padding: 20rpx 24rpx;
  95. }
  96. .invoice-title{
  97. font-size: $font-size-28;
  98. color: $text-color;
  99. text-align: left;
  100. line-height: 40rpx;
  101. font-weight: bold;
  102. margin-bottom: 30rpx;
  103. }
  104. .invoice-empty{
  105. font-size: $font-size-28;
  106. color: $text-color;
  107. text-align: left;
  108. line-height: 40rpx;
  109. .txt{
  110. font-size: $font-size-24;
  111. color: #999999;
  112. }
  113. }
  114. .invoice-animation {
  115. /* transition: transform 0.3s ease;*/
  116. transition-property: transform;
  117. transition-duration: 0.3s;
  118. transition-timing-function: ease;
  119. }
  120. .invoice-text{
  121. width: 100%;
  122. height: auto;
  123. .invoice-top{
  124. width: 100%;
  125. height: 40rpx;
  126. line-height: 40rpx;
  127. font-size: $font-size-28;
  128. color: $text-color;
  129. text-align: left;
  130. .name{
  131. width: 400rpx;
  132. float: left;
  133. -o-text-overflow: ellipsis;
  134. text-overflow: ellipsis;
  135. display: -webkit-box;
  136. word-break: break-all;
  137. -webkit-box-orient: vertical;
  138. -webkit-line-clamp: 1;
  139. overflow: hidden;
  140. }
  141. .icon-web_xiangxiazhankai{
  142. transform: rotate(0deg);
  143. transform-origin: center center;
  144. float: right;
  145. font-size: $font-size-32;
  146. color: #000000;
  147. /* transition: transform 0.3s ease;*/
  148. transition-property: transform;
  149. transition-duration: 0.3s;
  150. transition-timing-function: ease;
  151. }
  152. .icon-web_xiangxiazhankai-active{
  153. transform: rotate(180deg);
  154. }
  155. }
  156. .invoice-warp{
  157. width: 100%;
  158. padding: 24rpx 0 0 0;
  159. overflow: hidden;
  160. .table{
  161. padding-left: 130rpx;
  162. height: auto;
  163. line-height: 64rpx;
  164. font-size: $font-size-26;
  165. color: $text-color;
  166. text-align: left;
  167. position: relative;
  168. .label-name{
  169. display: inline-block;
  170. line-height: 64rpx;
  171. position: absolute;
  172. left: 0;
  173. top: 0;
  174. }
  175. &.long{
  176. padding-left: 180rpx;
  177. }
  178. }
  179. }
  180. .invoice-warp__wrapper{
  181. /* #ifndef APP-NVUE */
  182. display: flex;
  183. /* #endif */
  184. flex-direction: column;
  185. padding-top: 20rpx;
  186. }
  187. .invoice-warp--hide {
  188. padding: 0 0;
  189. height: 0px;
  190. line-height: 0px;
  191. }
  192. }
  193. }
  194. </style>