金诚优选前端代码
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.

308 lines
7.9 KiB

  1. <template>
  2. <view>
  3. <lf-nav title="在线商城" :showIcon="true" @changeHeight="e => nav_height = e"></lf-nav>
  4. <view class="head">
  5. <u-search placeholder="搜你想要的" :show-action="false" :disabled="true" @click="searchClick"></u-search>
  6. </view>
  7. <view class="filter-box">
  8. <!-- tabs -->
  9. <view class="filter-item" @click="switchTab(0)">
  10. <text style="white-space: nowrap">综合排序</text>
  11. </view>
  12. <view class="filter-item">
  13. <text style="white-space: nowrap">黄金珠宝</text>
  14. </view>
  15. <view class="filter-item" @click="switchTab(2)">
  16. <text style="white-space: nowrap">筛选</text>
  17. </view>
  18. <!-- 普通列表文字选择 -->
  19. <view class="filter-modal" v-if="show_filter && tab_current == 0" @click="show_filter = false">
  20. <view class="filter-content">
  21. <view>综合排序</view>
  22. <view>销量最高</view>
  23. <view>价格最香</view>
  24. <view>好评最多</view>
  25. </view>
  26. </view>
  27. <!-- 多条件搜索 -->
  28. <view class="filter-modal" v-else-if="show_filter && tab_current == 2" @click="show_filter = false">
  29. <view class="filter-many" @click.stop>
  30. <view class="filter-main">
  31. <view>
  32. <view class="filter-title lf-row-between">
  33. <view>价格区间</view>
  34. <view class="lf-flex">
  35. <input class="filter-input" placeholder="最低价" />
  36. <view class="filter-division">-</view>
  37. <input class="filter-input" placeholder="最高价"/>
  38. </view>
  39. </view>
  40. <view class="filter-title" style="margin-top: 80rpx;">
  41. <text>品牌</text>
  42. <text class="lf-font-24 lf-color-777">(可多选)</text>
  43. </view>
  44. <view class="lf-flex-wrap">
  45. <view class="filter-capsule" v-for="(item) in 10" :key="item">周大福</view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="filter-foot">
  50. <button class="filter-btn" >重置条件</button>
  51. <button class="filter-btn solid-btn" >确定</button>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <view style="height: 104rpx;"></view>
  57. <scroll-view :style="{height: autoHeight}" :scroll-y="true">
  58. <view class="scroll-content">
  59. <lf-waterfall :list="list"></lf-waterfall>
  60. </view>
  61. </scroll-view>
  62. </view>
  63. </template>
  64. <script>
  65. import lfWaterfall from '@/components/lf-waterfall-shopdetails/lf-waterfall.vue';
  66. export default {
  67. components: {
  68. lfWaterfall
  69. },
  70. data(){
  71. return {
  72. show_filter: true,
  73. tab_current: null,
  74. scrollH: 0,
  75. nav_height: 0,
  76. list: [
  77. {
  78. id: 10,
  79. original_price: "4111.00",
  80. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  81. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  82. price: "2412.00",
  83. product_id: 1008,
  84. sale: 0,
  85. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  86. },
  87. {
  88. id: 10,
  89. original_price: "4111.00",
  90. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  91. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  92. price: "2412.00",
  93. product_id: 1008,
  94. sale: 0,
  95. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  96. },
  97. {
  98. id: 10,
  99. original_price: "4111.00",
  100. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  101. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  102. price: "2412.00",
  103. product_id: 1008,
  104. sale: 0,
  105. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  106. },
  107. {
  108. id: 10,
  109. original_price: "4111.00",
  110. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  111. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  112. price: "2412.00",
  113. product_id: 1008,
  114. sale: 0,
  115. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  116. }
  117. ]
  118. }
  119. },
  120. computed: {
  121. autoHeight(){
  122. return `calc(${this.scrollH}px - ${this.nav_height}px - 124rpx - 104rpx)`;
  123. }
  124. },
  125. onLoad(){
  126. let info = uni.getSystemInfoSync();
  127. this.scrollH = info.screenHeight;
  128. },
  129. methods: {
  130. searchClick(){
  131. this.$url('/pages/shop/search');
  132. },
  133. switchTab(current){
  134. if(this.tab_current != current){
  135. this.show_filter = true;
  136. }else{
  137. this.show_filter = !this.show_filter;
  138. }
  139. this.tab_current = current;
  140. }
  141. }
  142. }
  143. </script>
  144. <style lang="scss" scoped="scoped">
  145. .head{
  146. padding: 30rpx 32rpx;
  147. }
  148. .filter-box{
  149. width: 750rpx;
  150. height: 102rpx;
  151. border-bottom: 1rpx solid #e5e5e5;
  152. position: fixed;
  153. background-color: #FFFFFF;
  154. z-index: 9;
  155. display: flex;
  156. // justify-content: space-between;
  157. justify-content: space-around;
  158. align-items: center;
  159. padding: 0 32rpx;
  160. box-sizing: border-box;
  161. .filter-item{
  162. width: 114rpx;
  163. height: 62rpx;
  164. display: flex;
  165. flex-wrap: nowrap;
  166. justify-content: center;
  167. align-items: center;
  168. font-size: 28rpx;
  169. color: #222222;
  170. .tab-active{
  171. display: inline-block;
  172. transform: rotate(180deg);
  173. color: #15716E !important;
  174. }
  175. }
  176. .filter-modal{
  177. position: absolute;
  178. z-index: 7;
  179. background-color: rgba(0,0,0,0.5);
  180. top: 103rpx;
  181. right: 0;
  182. bottom: 0;
  183. left: 0;
  184. width: 100vw;
  185. height: calc(100vh - 103rpx);
  186. .filter-content{
  187. position: absolute;
  188. width: 100%;
  189. height: max-content;
  190. max-height: 806rpx;
  191. background-color: #FFFFFF;
  192. left: 0;
  193. z-index: 14;
  194. overflow-y: scroll;
  195. padding: 0 0 32rpx 32rpx;
  196. display: flex;
  197. flex-direction: column;
  198. justify-content: space-evenly;
  199. view{
  200. height: 60rpx;
  201. // border-bottom: 1rpx solid #e5e5e5;
  202. padding: 20rpx 0;
  203. line-height: 60rpx;
  204. }
  205. }
  206. .filter-many{
  207. position: absolute;
  208. width: 100%;
  209. height: 630rpx;
  210. background-color: #FFFFFF;
  211. left: 0;
  212. z-index: 14;
  213. .filter-main{
  214. height: 500rpx;
  215. overflow-y: scroll;
  216. box-sizing: border-box;
  217. padding: 32rpx;
  218. .filter-title{
  219. font-size: 28rpx;
  220. color: #222222;
  221. font-weight: bold;
  222. margin-bottom: 20rpx;
  223. .filter-input{
  224. width: 160rpx;
  225. height: 50rpx;
  226. background-color: #FFFFFF;
  227. border: 1rpx solid #e5e5e5;
  228. text-align: center;
  229. font-size: 24rpx;
  230. font-weight: initial;
  231. border-radius: 40rpx;
  232. }
  233. .filter-division{
  234. padding: 0 20rpx;
  235. font-weight: initial;
  236. }
  237. }
  238. .filter-capsule{
  239. width: 163rpx;
  240. height: 62rpx;
  241. border-radius: 31rpx;
  242. border: 1rpx solid #999999;
  243. font-size: 20rpx;
  244. color: #999999;
  245. text-align: center;
  246. line-height: 62rpx;
  247. margin-right: 12rpx;
  248. &:nth-child(4n){
  249. margin-right: 0rpx;
  250. }
  251. &:nth-child(n+5){
  252. margin-top: 12rpx;
  253. }
  254. }
  255. .filter-active{
  256. border-color: #15716E;
  257. color: #15716E;
  258. }
  259. .input-search{
  260. width: 686rpx;
  261. height: 62rpx;
  262. background-color: #FFFFFF;
  263. border-radius: 10rpx;
  264. border: 1rpx solid #DDDDDD;
  265. box-sizing: border-box;
  266. padding: 0 15rpx;
  267. font-size: 28rpx;
  268. margin-bottom: 50rpx;
  269. }
  270. }
  271. .filter-main>view:nth-child(n+3){
  272. margin-top: 40rpx;
  273. }
  274. .filter-foot{
  275. height: 130rpx;
  276. border-top: 1rpx solid #e5e5e5;
  277. padding: 32rpx;
  278. display: flex;
  279. justify-content: space-between;
  280. align-items: center;
  281. .filter-btn{
  282. width: 332rpx;
  283. height: 90rpx;
  284. border-radius: 10rpx;
  285. border: 1rpx solid #555555;
  286. background-color: #FFFFFF;
  287. line-height: 88rpx;
  288. font-size: 32rpx;
  289. color: #555555;
  290. margin: 0;
  291. }
  292. .solid-btn{
  293. background-color: #15716E;
  294. color: #FFFFFF;
  295. border: none;
  296. }
  297. }
  298. }
  299. }
  300. }
  301. .scroll-content{
  302. padding: 30rpx 32rpx;
  303. }
  304. </style>