nav-transparent.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="page">
  3. <view class="img-view" v-if="!showSwiper">
  4. <image :src="imgUrls[0]"></image>
  5. </view>
  6. <swiper v-if="showSwiper" indicator-dots="true">
  7. <swiper-item v-for="(img,key) in imgUrls" :key="key">
  8. <image :src="img" />
  9. </swiper-item>
  10. </swiper>
  11. <view class="uni-padding-wrap uni-common-mt">
  12. <view class="uni-title">
  13. <view>在App端默认为标题栏透明,当用户向下滚动时,标题栏逐渐由透明转变为不透明;当用户再次向上滚动时,标题栏又从不透明变为透明状态。</view>
  14. <view>在微信小程序端,导航栏始终为不透明样式。</view>
  15. <!-- <view>在支付宝小程序里请使用真机调试查看效果。</view> -->
  16. </view>
  17. <view class="uni-title uni-common-mt">图片类型</view>
  18. </view>
  19. <view class="uni-list">
  20. <radio-group @change="radioChange">
  21. <label class="uni-list-cell uni-list-cell-pd" v-for="(item,index) in items" :key="index">
  22. <view>{{item.name}}</view>
  23. <view>
  24. <radio :value="item.value" :checked="item.checked" />
  25. </view>
  26. </label>
  27. </radio-group>
  28. </view>
  29. <view style="height: 1000rpx;"></view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. showSwiper: false,
  37. imgUrls: [
  38. "../../../static/shuijiao.jpg",
  39. "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b4b60b10-5168-11eb-bd01-97bc1429a9ff.jpg",
  40. "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b1dcfa70-5168-11eb-bd01-97bc1429a9ff.jpg"
  41. ],
  42. items: [{
  43. value: "img",
  44. name: '静态图',
  45. checked: true
  46. },
  47. {
  48. value: "swiper",
  49. name: '轮播图',
  50. checked: false
  51. }
  52. ]
  53. }
  54. },
  55. methods: {
  56. radioChange(e) {
  57. this.showSwiper = e.detail.value === "swiper";
  58. }
  59. }
  60. }
  61. </script>
  62. <style>
  63. image,
  64. swiper,
  65. .img-view {
  66. width: 750rpx;
  67. width: 100%;
  68. height: 500rpx;
  69. }
  70. .page-section-title{
  71. margin-top: 50rpx;
  72. }
  73. </style>