page-nav.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view class="nav-wrap">
  3. <view class="nav-title">
  4. <u--image :showLoading="true" src="https://cdn.uviewui.com/uview/common/logo.png" width="70px"
  5. height="70px" />
  6. <view class="nav-info">
  7. <view class="nav-info__title" @tap="jumpToWx">
  8. <text class="nav-info__title__text">uView {{version}}</text>
  9. <!-- #ifdef MP-WEIXIN -->
  10. <!-- uni-app不支持text内部的text组件的tap事件,所以放到外部响应tap -->
  11. <text class="nav-info__title__jump">查看1.x演示</text>
  12. <!-- #endif -->
  13. </view>
  14. <text class="nav-slogan">多平台快速开发的UI框架</text>
  15. </view>
  16. </view>
  17. <text class="nav-desc">{{desc}}</text>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. props: {
  23. desc: String,
  24. title: String,
  25. },
  26. data() {
  27. return {
  28. version: uni.$u.config.v
  29. }
  30. },
  31. methods: {
  32. jumpToWx() {
  33. // #ifdef MP-WEIXIN
  34. uni.navigateToMiniProgram({
  35. appId: 'wxc6bdb80f216e918c'
  36. })
  37. // #endif
  38. }
  39. },
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. .nav-wrap {
  44. padding: 15px;
  45. position: relative;
  46. }
  47. .lang {
  48. position: absolute;
  49. top: 15px;
  50. right: 15px;
  51. }
  52. .nav-title {
  53. /* #ifndef APP-NVUE */
  54. display: flex;
  55. /* #endif */
  56. flex-direction: row;
  57. align-items: center;
  58. justify-content: flex-start;
  59. }
  60. .nav-info {
  61. margin-left: 15px;
  62. &__title {
  63. /* #ifndef APP-NVUE */
  64. display: flex;
  65. /* #endif */
  66. flex-direction: row;
  67. align-items: center;
  68. &__text {
  69. /* #ifndef APP-NVUE */
  70. display: flex;
  71. /* #endif */
  72. color: $u-main-color;
  73. font-size: 25px;
  74. font-weight: bold;
  75. text-align: left;
  76. }
  77. &__jump {
  78. font-size: 12px;
  79. color: $u-primary;
  80. font-weight: normal;
  81. margin-left: 20px;
  82. }
  83. }
  84. }
  85. .logo {
  86. width: 70px;
  87. height: 70px;
  88. /* #ifndef APP-NVUE */
  89. height: auto;
  90. /* #endif */
  91. }
  92. .nav-slogan {
  93. color: $u-tips-color;
  94. font-size: 14px;
  95. }
  96. .nav-desc {
  97. margin-top: 10px;
  98. font-size: 14px;
  99. color: $u-content-color;
  100. line-height: 20px;
  101. }
  102. </style>