invoiceTent.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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>
  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.invoiceTitle == null){
  71. this.isEmpty = true
  72. }else{
  73. this.isEmpty = false
  74. this.bankAccountNo = this.$reg.bankRegex(res.bankAccountNo)
  75. }
  76. },
  77. onMessage(pros){
  78. console.log(pros)
  79. },
  80. showInvoice(){
  81. this.isOpen = !this.isOpen
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss">
  87. .invoice-template{
  88. width: 100%;
  89. height: auto;
  90. background: #FFFFFF;
  91. float: left;
  92. margin-top: 24rpx;
  93. .invoice-content{
  94. width: 702rpx;
  95. padding: 20rpx 24rpx;
  96. }
  97. .invoice-title{
  98. font-size: $font-size-28;
  99. color: $text-color;
  100. text-align: left;
  101. line-height: 40rpx;
  102. font-weight: bold;
  103. margin-bottom: 30rpx;
  104. }
  105. .invoice-empty{
  106. font-size: $font-size-28;
  107. color: $text-color;
  108. text-align: left;
  109. line-height: 40rpx;
  110. .txt{
  111. font-size: $font-size-24;
  112. color: #999999;
  113. }
  114. }
  115. .invoice-animation {
  116. /* transition: transform 0.3s ease;*/
  117. transition-property: transform;
  118. transition-duration: 0.3s;
  119. transition-timing-function: ease;
  120. }
  121. .invoice-text{
  122. width: 100%;
  123. height: auto;
  124. .invoice-top{
  125. width: 100%;
  126. height: 40rpx;
  127. line-height: 40rpx;
  128. font-size: $font-size-28;
  129. color: $text-color;
  130. text-align: left;
  131. .name{
  132. width: 400rpx;
  133. float: left;
  134. -o-text-overflow: ellipsis;
  135. text-overflow: ellipsis;
  136. display: -webkit-box;
  137. word-break: break-all;
  138. -webkit-box-orient: vertical;
  139. -webkit-line-clamp: 1;
  140. overflow: hidden;
  141. }
  142. .icon-web_xiangxiazhankai{
  143. transform: rotate(0deg);
  144. transform-origin: center center;
  145. float: right;
  146. font-size: $font-size-32;
  147. color: #000000;
  148. /* transition: transform 0.3s ease;*/
  149. transition-property: transform;
  150. transition-duration: 0.3s;
  151. transition-timing-function: ease;
  152. }
  153. .icon-web_xiangxiazhankai-active{
  154. transform: rotate(180deg);
  155. }
  156. }
  157. .invoice-warp{
  158. width: 100%;
  159. padding: 24rpx 0 0 0;
  160. overflow: hidden;
  161. .table{
  162. padding-left: 130rpx;
  163. height: auto;
  164. line-height: 64rpx;
  165. font-size: $font-size-26;
  166. color: $text-color;
  167. text-align: left;
  168. position: relative;
  169. .label-name{
  170. display: inline-block;
  171. line-height: 64rpx;
  172. position: absolute;
  173. left: 0;
  174. top: 0;
  175. }
  176. &.long{
  177. padding-left: 180rpx;
  178. }
  179. }
  180. }
  181. .invoice-warp__wrapper{
  182. /* #ifndef APP-NVUE */
  183. display: flex;
  184. /* #endif */
  185. flex-direction: column;
  186. padding-top: 20rpx;
  187. }
  188. .invoice-warp--hide {
  189. padding: 0 0;
  190. height: 0px;
  191. line-height: 0px;
  192. }
  193. }
  194. }
  195. </style>