瑶都万能墙
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

231 lines
5.4 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="page pageList">
  3. <navbar title="景点" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="top-bg"></view>
  5. <view style="padding: 10rpx 30rpx;">
  6. <uv-search bgColor="#fff" @search="getData" :showAction="false" searchIconSize="30rpx"
  7. placeholder="请输入搜索关键字..." v-model="queryParams.title"></uv-search>
  8. </view>
  9. <view class="">
  10. <screenRen @clickItem="clickItem" />
  11. </view>
  12. <view class="waterfall" v-for="(item,index) in list"
  13. @click="$utils.navigateTo('/pages_order/scenicSpot/scenicSpotDetail?id=' + item.id)">
  14. <view class="images">
  15. <image :src="item.titleImage" mode="aspectFill"></image>
  16. <view class="scenicspot">
  17. 景点
  18. </view>
  19. </view>
  20. <view class="font">
  21. {{item.name}}
  22. </view>
  23. </view>
  24. <!-- <uv-waterfall ref="waterfall" v-model="list"
  25. :add-time="10"
  26. :left-gap="leftGap"
  27. :right-gap="rightGap"
  28. :column-gap="columnGap"
  29. @changeList="changeList"> -->
  30. <!-- 第一列数据 -->
  31. <!-- <template v-slot:list1> -->
  32. <!-- 为了磨平部分平台的BUG必须套一层view -->
  33. <!-- <view>
  34. <view v-for="(item, index) in list1" :key="item.id" class="waterfall-item"
  35. @click="$utils.navigateTo('/pages_order/scenicSpot/scenicSpotDetail?id=' + item.id)">
  36. <view class="waterfall-item__image" :style="[imageStyle(item)]">
  37. <image :src="item.titleImage" mode="widthFix" :style="{width:item.width+'px'}"></image>
  38. </view>
  39. <view class="waterfall-item__ft">
  40. <view class="waterfall-item__ft__title">
  41. <text class="value">{{item.name}}</text>
  42. </view>
  43. <view class="waterfall-item__ft__desc uv-line-2">
  44. <text class="value">{{item.address}}</text>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template> -->
  50. <!-- 第二列数据 -->
  51. <!-- <template v-slot:list2> -->
  52. <!-- 为了磨平部分平台的BUG必须套一层view -->
  53. <!-- <view>
  54. <view v-for="(item, index) in list2" :key="item.id" class="waterfall-item"
  55. @click="$utils.navigateTo('/pages_order/scenicSpot/scenicSpotDetail?id=' + item.id)">
  56. <view class="waterfall-item__image" :style="[imageStyle(item)]">
  57. <image :src="item.titleImage" mode="widthFix" :style="{width:item.width+'px'}"></image>
  58. </view>
  59. <view class="waterfall-item__ft">
  60. <view class="waterfall-item__ft__title">
  61. <text class="value">{{item.name}}</text>
  62. </view>
  63. <view class="waterfall-item__ft__desc uv-line-2">
  64. <text class="value">{{item.address}}</text>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. </uv-waterfall> -->
  71. <!-- <view class="list">
  72. <scenicSpotItem
  73. :key="index"
  74. v-for="(item, index) in list"
  75. :item="item"
  76. @click="$utils.navigateTo('/pages_order/scenicSpot/scenicSpotDetail?id=' + item.id)"
  77. />
  78. </view> -->
  79. </view>
  80. </template>
  81. <script>
  82. import mixinsList from '@/mixins/list.js'
  83. import screenRen from '../components/screen/screenRen.vue'
  84. import scenicSpotItem from '../components/list/scenicSpot/scenicSpotItem.vue'
  85. import { guid } from '@/uni_modules/uv-ui-tools/libs/function/index.js'
  86. export default {
  87. mixins: [mixinsList],
  88. components: {
  89. scenicSpotItem,
  90. screenRen,
  91. },
  92. data() {
  93. return {
  94. mixinsListApi: 'getScenicPage',
  95. list: [], // 瀑布流全部数据
  96. list1: [], // 瀑布流第一列数据
  97. list2: [], // 瀑布流第二列数据
  98. leftGap: 10,
  99. rightGap: 10,
  100. columnGap: 10
  101. }
  102. },
  103. computed: {
  104. imageStyle(item) {
  105. return item => {
  106. const v = uni.upx2px(750) - this.leftGap - this.rightGap - this.columnGap;
  107. const w = v / 2;
  108. const rate = w / item.w;
  109. const h = rate * item.h;
  110. return {
  111. width: w + 'px',
  112. height: h + 'px'
  113. }
  114. }
  115. }
  116. },
  117. methods: {
  118. clickItem(result) {
  119. this.queryParams = {
  120. pageNo: 1,
  121. pageSize: 10,
  122. }
  123. result.forEach(n => {
  124. this.queryParams[n.name] = n.value
  125. })
  126. this.getData()
  127. },
  128. // 这点非常重要:e.name在这里返回是list1或list2,要手动将数据追加到相应列
  129. changeList(e) {
  130. this[e.name].push(e.value);
  131. },
  132. }
  133. }
  134. </script>
  135. <style scoped lang="scss">
  136. .page {
  137. background-color: white;
  138. .list {
  139. padding: 0 20rpx;
  140. }
  141. }
  142. .top-bg{
  143. position: absolute;
  144. height: 400rpx;
  145. // background: linear-gradient(blue, pink);
  146. }
  147. .waterfall{
  148. margin: 50rpx 0rpx;
  149. image{
  150. width: 100%;
  151. height: 100%;
  152. }
  153. .images{
  154. position: relative;
  155. height: 350rpx;
  156. margin: 5rpx 30rpx;
  157. border-radius: 30rpx;
  158. overflow: hidden;
  159. .scenicspot{
  160. position: absolute;
  161. top: 0;
  162. left: 0;
  163. height: 50rpx;
  164. width: 100rpx;
  165. background-color: $uni-color;
  166. color: white;
  167. display: flex;
  168. justify-content: center;
  169. align-items: center;
  170. border-bottom-right-radius: 30rpx;
  171. }
  172. }
  173. .font{
  174. margin: 10rpx 35rpx;
  175. opacity: 0.8;
  176. letter-spacing: 3rpx;
  177. }
  178. }
  179. $show-lines: 1;
  180. @import '@/uni_modules/uv-ui-tools/libs/css/variable.scss';
  181. .waterfall-item {
  182. overflow: hidden;
  183. margin-top: 20rpx;
  184. border-radius: 12rpx;
  185. box-shadow: 0 0 6rpx 6rpx #00000009;
  186. }
  187. .waterfall-item__ft {
  188. padding: 20rpx;
  189. background: #fff;
  190. &__title {
  191. margin-bottom: 10rpx;
  192. line-height: 48rpx;
  193. font-weight: 700;
  194. .value {
  195. font-size: 32rpx;
  196. color: #303133;
  197. }
  198. }
  199. &__desc .value {
  200. font-size: 28rpx;
  201. color: #606266;
  202. }
  203. &__btn {
  204. padding: 20rpx 0;
  205. }
  206. }
  207. </style>