invoiceTent.vue 4.9 KB

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