notice-bar.nvue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view>
  3. <text class="example-info">通告栏组件多用于系统通知,广告通知等场景,可自定义图标,颜色,展现方式等。</text>
  4. <uni-section title="基本用法" type="line"></uni-section>
  5. <view class="example-body">
  6. <uni-notice-bar :single="true" text="[单行] uni-app 1.6发布,开发一次、7端覆盖!" />
  7. <uni-notice-bar text="[多行] uni-app 1.6版正式发布,开发一次,同时发布iOS、Android、H5、微信小程序、支付宝小程序、百度小程序、头条小程序等7大平台。" />
  8. </view>
  9. <uni-section title="加图标" type="line"></uni-section>
  10. <view class="example-body">
  11. <uni-notice-bar :single="true" :show-icon="true" text="uni-app行业峰会频频亮相,开发者反响热烈!" />
  12. <uni-notice-bar :show-icon="true" text="8月12日DCloud受邀参加iWEB峰会后,9月19日DCloud CEO 王安在千人小程序峰会——见实大会,做了主题为《App和小程序,鱼与熊掌如何兼得?》的分享。" />
  13. </view>
  14. <uni-section title="文字滚动" type="line"></uni-section>
  15. <view class="example-body">
  16. <uni-notice-bar :scrollable="true" :single="true" text="uni-app行业峰会频频亮相,开发者反响热烈!" />
  17. <uni-notice-bar :show-icon="true" :scrollable="true" :single="true" text="uni-app 1.6版正式发布,开发一次,同时发布iOS、Android、H5、微信小程序、支付宝小程序、百度小程序、头条小程序等7大平台。" />
  18. <uni-notice-bar :scrollable="true" text="8月12日DCloud受邀参加iWEB峰会后,9月19日DCloud CEO 王安在千人小程序峰会——见实大会,做了主题为《App和小程序,鱼与熊掌如何兼得?》的分享。" />
  19. </view>
  20. <uni-section title="查看更多" type="line"></uni-section>
  21. <view class="example-body">
  22. <uni-notice-bar :show-get-more="true" :single="true" text="年末大礼:uni-app1.4 新增百度、支付宝小程序。插件市场重磅上线!" @getmore="getMore" />
  23. <uni-notice-bar :show-get-more="true" :show-icon="true" :single="true" more-text="查看更多" text="年末大礼:uni-app1.4 新增百度、支付宝小程序。插件市场重磅上线!" @getmore="getMore" />
  24. </view>
  25. <uni-section title="修改颜色" type="line"></uni-section>
  26. <view class="example-body">
  27. <uni-notice-bar :single="true" more-text="查看更多" color="red" background-color="#eee" text="uni-app 1.6版正式发布,开发一次,同时发布iOS、Android、H5、微信小程序、支付宝小程序、百度小程序、头条小程序等7大平台。" />
  28. <uni-notice-bar :single="true" :show-get-more="true" more-text="查看更多" more-color="blue" color="red" background-color="#eee" text="uni-app 1.6版正式发布,开发一次,同时发布iOS、Android、H5、微信小程序、支付宝小程序、百度小程序、头条小程序等7大平台。" @getmore="getMore" />
  29. <uni-notice-bar :show-icon="true" color="blue" text="uni-app 1.6版正式发布,开发一次,同时发布iOS、Android、H5、微信小程序、支付宝小程序、百度小程序、头条小程序等7大平台。" />
  30. </view>
  31. <uni-section title="关闭按钮" type="line"></uni-section>
  32. <view class="example-body">
  33. <uni-notice-bar :show-close="true" :single="true" text="HBuilderX 1.0正式发布!uni-app实现里程碑突破!" />
  34. <uni-notice-bar :show-close="true" :show-icon="true" more-text="查看更多" text="HBuilderX 1.0正式发布!uni-app实现里程碑突破!" />
  35. <uni-notice-bar :show-close="true" :show-icon="true" text="uni-app 1.6发布,开发一次、7端覆盖!" />
  36. <uni-notice-bar :show-close="true" :show-icon="true" :single="true" text="uni-app 1.6版正式发布,开发一次,同时发布到iOS、Android、H5、微信小程序、支付宝小程序、百度小程序、头条小程序等7大平台。" />
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. components: {},
  43. data() {
  44. return {}
  45. },
  46. created() {},
  47. methods: {
  48. getMore() {
  49. uni.showToast({
  50. title: '点击查看更多',
  51. icon: 'none'
  52. })
  53. }
  54. }
  55. }
  56. </script>
  57. <style>
  58. @charset "UTF-8";
  59. /* 头条小程序组件内不能引入字体 */
  60. /* #ifdef MP-TOUTIAO */
  61. @font-face {
  62. font-family: uniicons;
  63. font-weight: normal;
  64. font-style: normal;
  65. src: url("~@/static/uni.ttf") format("truetype");
  66. }
  67. /* #endif */
  68. /* #ifndef APP-NVUE */
  69. page {
  70. display: flex;
  71. flex-direction: column;
  72. box-sizing: border-box;
  73. background-color: #efeff4;
  74. min-height: 100%;
  75. height: auto;
  76. }
  77. view {
  78. font-size: 14px;
  79. line-height: inherit;
  80. }
  81. .example {
  82. padding: 0 15px 15px;
  83. }
  84. .example-info {
  85. padding: 15px;
  86. color: #3b4144;
  87. background: #ffffff;
  88. }
  89. .example-body {
  90. /* #ifndef APP-NVUE */
  91. display: flex;
  92. /* #endif */
  93. flex-direction: row;
  94. flex-wrap: wrap;
  95. justify-content: center;
  96. padding: 0;
  97. font-size: 14px;
  98. background-color: #ffffff;
  99. }
  100. /* #endif */
  101. .example {
  102. padding: 0 15px;
  103. }
  104. .example-info {
  105. /* #ifndef APP-NVUE */
  106. display: block;
  107. /* #endif */
  108. padding: 15px;
  109. color: #3b4144;
  110. background-color: #ffffff;
  111. font-size: 14px;
  112. line-height: 20px;
  113. }
  114. .example-info-text {
  115. font-size: 14px;
  116. line-height: 20px;
  117. color: #3b4144;
  118. }
  119. .example-body {
  120. flex-direction: column;
  121. padding: 15px;
  122. background-color: #ffffff;
  123. }
  124. .word-btn-white {
  125. font-size: 18px;
  126. color: #FFFFFF;
  127. }
  128. .word-btn {
  129. /* #ifndef APP-NVUE */
  130. display: flex;
  131. /* #endif */
  132. flex-direction: row;
  133. align-items: center;
  134. justify-content: center;
  135. border-radius: 6px;
  136. height: 48px;
  137. margin: 15px;
  138. background-color: #007AFF;
  139. }
  140. .word-btn--hover {
  141. background-color: #4ca2ff;
  142. }
  143. .example-body {
  144. padding: 5rpx 0;
  145. padding-top: 20rpx;
  146. flex-direction: column;
  147. /* #ifndef APP-NVUE */
  148. display: block;
  149. /* #endif */
  150. }
  151. </style>