cs_liebiao.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="body">
  3. <u-navbar :autoBack="true" title="村史馆" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#121212"></u-navbar>
  4. <view class="fy_nav_bj">
  5. <image style="width: 100%; height: 100%" src="https://huli-app.wenlvti.net/app_static/minnanhun/image/cs_lb.png"></image>
  6. </view>
  7. <view class="banxin">
  8. <u-picker :show="show" @close="show = false" :closeOnClickOverlay="true" :columns="columns" @cancel="show = false" @confirm="yf_isok"></u-picker>
  9. <view class="" style="margin-top: 40rpx">
  10. <!-- 选择城市 -->
  11. <view class="" style="display: flex">
  12. <view @click="show = true" class="fy_cs">
  13. <uni-icons type="location" size="20"></uni-icons>
  14. <text style="width: 60rpx; margin: 0 10rpx 0 10rpx">{{ columnsItem }}</text>
  15. <uni-icons type="bottom" size="20"></uni-icons>
  16. </view>
  17. <!-- 选择城市end -->
  18. <view class="">
  19. <u-tabs
  20. keyName="title"
  21. :list="tabList"
  22. :lineWidth="0"
  23. :activeStyle="{
  24. border: '1px solid #dac1a1',
  25. color: '#dac1a1'
  26. }"
  27. ></u-tabs>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 村史馆列表 -->
  33. <view class="banxin lb_box" style="">
  34. <view class="a1" v-for="item in 10" :key="item">
  35. <view class="a2">
  36. <image src="https://huli-app.wenlvti.net/app_static/minnanhun/image/cs_item_lb.png" class="a3"></image>
  37. </view>
  38. <view class="a4">湖里社区</view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. let that;
  45. export default {
  46. data() {
  47. return {
  48. show: false,
  49. main_body_id: '' /* 主体id */,
  50. columns: [['厦门', '泉州', '福州']],
  51. columnsItem: '厦门' /* 选中的城市 */,
  52. tabList: []
  53. };
  54. },
  55. onLoad() {
  56. that = this;
  57. this.main_body_id = this.$db.get('main_body_id');
  58. this.getCategoryLists();
  59. },
  60. methods: {
  61. // 选择城市
  62. yf_isok(e) {
  63. console.log(e);
  64. this.columnsItem = e.value;
  65. this.show = false;
  66. },
  67. getCategoryLists() {
  68. this.$api.getCategoryLists(
  69. {
  70. main_body_id: this.main_body_id
  71. },
  72. function (res) {
  73. console.log(res);
  74. that.tabList = res.data.region_list;
  75. console.log(that.tabList);
  76. }
  77. );
  78. }
  79. }
  80. };
  81. </script>
  82. <style>
  83. .lb_box {
  84. display: flex;
  85. flex-flow: wrap;
  86. justify-content: space-between;
  87. margin-top: 20rpx;
  88. }
  89. .a1 {
  90. margin-bottom: 20rpx;
  91. }
  92. .a2 {
  93. background-image: url('https://huli-app.wenlvti.net/app_static/minnanhun/image/cs_bjx.png');
  94. background-size: 100% 100%;
  95. width: 200rpx; /* 六边形容器的宽度 */
  96. height: 210rpx; /* 六边形容器的高度 */
  97. position: relative;
  98. clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
  99. border: 3px solid #f6cf91;
  100. }
  101. .a3 {
  102. width: 100%; /* 图片宽度设置为容器宽度 */
  103. height: 100%; /* 图片高度设置为容器高度 */
  104. object-fit: cover;
  105. }
  106. .a4 {
  107. text-align: center;
  108. margin-top: 10rpx;
  109. }
  110. .banxin {
  111. margin: 0 32rpx 0 32rpx;
  112. }
  113. .fy_nav_bj {
  114. width: 100%;
  115. height: 220rpx;
  116. color: #ffffff;
  117. margin-bottom: 25rpx;
  118. }
  119. .fy_cs {
  120. display: flex;
  121. align-items: center;
  122. width: 255rpx;
  123. height: 50rpx;
  124. margin-top: 20rpx;
  125. }
  126. </style>