鸿宇研学生前端代码
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.

313 lines
6.5 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <template>
  2. <view class="page__view">
  3. <!-- <view class="bg">
  4. <image class="img" src="@/static/image/bg.png" mode="widthFix"></image>
  5. </view> -->
  6. <bgSwiperView></bgSwiperView>
  7. <view class="main">
  8. <!-- 搜索栏 -->
  9. <view :class="['flex', 'search', searchStyle.class]">
  10. <uv-search
  11. v-model="keyword"
  12. placeholder="输入关键词搜索"
  13. :color="searchStyle.color"
  14. bgColor="transparent"
  15. :showAction="searchStyle.showAction"
  16. @custom="search"
  17. @search="search"
  18. @focus="isFocusSearch = true"
  19. @blur="isFocusSearch = false"
  20. >
  21. <template #prefix>
  22. <image class="search-icon" :src="searchStyle.icon" mode="widthFix"></image>
  23. </template>
  24. </uv-search>
  25. <view class="border">
  26. <view class="border-left"></view>
  27. </view>
  28. </view>
  29. <view class="section">
  30. <categoryView></categoryView>
  31. </view>
  32. <view class="section">
  33. <recommendView></recommendView>
  34. </view>
  35. <view class="section">
  36. <swiperView></swiperView>
  37. </view>
  38. <view class="section">
  39. <pictureLiveView></pictureLiveView>
  40. </view>
  41. <view class="section reason">
  42. <image class="img" src="@/static/image/temp-19.png" mode="widthFix"></image>
  43. </view>
  44. <view class="section">
  45. <productView :list="list"></productView>
  46. </view>
  47. </view>
  48. <!-- todo: 联系客服 -->
  49. <tabber select="home" />
  50. </view>
  51. </template>
  52. <script>
  53. import mixinsList from '@/mixins/list.js'
  54. import tabber from '@/components/base/tabbar.vue'
  55. import bgSwiperView from '@/components/home/bgSwiperView.vue'
  56. import categoryView from '@/components/home/categoryView.vue'
  57. import recommendView from '@/components/home/recommendView.vue'
  58. import swiperView from '@/components/home/swiperView.vue'
  59. import pictureLiveView from '@/components/home/pictureLiveView.vue'
  60. import productView from '@/components/home/productView.vue'
  61. export default {
  62. mixins: [mixinsList],
  63. components: {
  64. tabber,
  65. bgSwiperView,
  66. categoryView,
  67. recommendView,
  68. swiperView,
  69. pictureLiveView,
  70. productView,
  71. },
  72. data() {
  73. return {
  74. keyword: '',
  75. isFocusSearch: false,
  76. // todo
  77. mixinsListApi: '',
  78. }
  79. },
  80. onLoad() {
  81. this.fetchBanner()
  82. },
  83. computed: {
  84. searchStyle() {
  85. let focusStyle = {
  86. class: 'focus',
  87. color: '#181818',
  88. icon: '/static/image/icon-search-dark.png',
  89. showAction: true,
  90. }
  91. let blurStyle = {
  92. class: 'blur',
  93. color: '#FFFFFF',
  94. icon: '/static/image/icon-search-light.png',
  95. showAction: false,
  96. }
  97. return this.isFocusSearch ? focusStyle : blurStyle
  98. },
  99. },
  100. methods: {
  101. // todo: delete
  102. getData() {
  103. this.list = [
  104. {
  105. id: '001',
  106. image: '/static/image/temp-20.png',
  107. title: '新疆天山行7/9日丨醉美伊犁&吐鲁番双套餐',
  108. tagList: ['国内游','7-9天','12岁+'],
  109. priceDiscount: 688.99,
  110. priceOrigin: 1200,
  111. applyNum: 4168,
  112. },
  113. {
  114. id: '002',
  115. image: '/static/image/temp-20.png',
  116. title: '坝上双草原6日|乌兰布统+锡林郭勒+长城',
  117. tagList: ['国内游','7-9天','12岁+'],
  118. priceDiscount: 688.99,
  119. priceOrigin: 1200,
  120. applyNum: 4168,
  121. },
  122. {
  123. id: '003',
  124. image: '/static/image/temp-20.png',
  125. title: '牛湖线探秘 | 清远牛湖线徒步,探秘天坑与大草原',
  126. tagList: ['国内游','7-9天','12岁+'],
  127. priceDiscount: 688.99,
  128. priceOrigin: 1200,
  129. applyNum: 4168,
  130. },
  131. {
  132. id: '004',
  133. image: '/static/image/temp-20.png',
  134. title: '低海拔藏区草原,汉藏文化大穿越',
  135. tagList: ['国内游','7-9天','12岁+'],
  136. priceDiscount: 688.99,
  137. priceOrigin: 1200,
  138. applyNum: 4168,
  139. },
  140. {
  141. id: '005',
  142. image: '/static/image/temp-20.png',
  143. title: '新丝路到敦煌7日 | 甘青轻松穿越,沙漠+草原',
  144. tagList: ['国内游','7-9天','12岁+'],
  145. priceDiscount: 688.99,
  146. priceOrigin: 1200,
  147. applyNum: 4168,
  148. },
  149. {
  150. id: '006',
  151. image: '/static/image/temp-20.png',
  152. title: '呼伦贝尔6/8日|经典or环线双套餐可选',
  153. tagList: ['国内游','7-9天','12岁+'],
  154. priceDiscount: 688.99,
  155. priceOrigin: 1200,
  156. applyNum: 4168,
  157. },
  158. ]
  159. this.total = this.list.length
  160. },
  161. search() {
  162. console.log('search', this.keyword)
  163. uni.navigateTo({
  164. url: '/pages_order/product/search?search=' + this.keyword
  165. })
  166. // this.keyword = ''
  167. },
  168. async fetchBanner() {
  169. try {
  170. await this.$fetch('queryBannerList')
  171. } catch (err) {
  172. }
  173. },
  174. },
  175. }
  176. </script>
  177. <style scoped lang="scss">
  178. .bg {
  179. width: 100%;
  180. height: auto;
  181. border-bottom-left-radius: 40rpx;
  182. border-bottom-right-radius: 40rpx;
  183. font-size: 0;
  184. overflow: hidden;
  185. .img {
  186. width: 100%;
  187. height: auto;
  188. }
  189. }
  190. .main {
  191. position: absolute;
  192. top: 0;
  193. left: 0;
  194. width: 100%;
  195. padding: 100rpx 32rpx calc(120rpx + env(safe-area-inset-bottom) + 100rpx) 32rpx;
  196. box-sizing: border-box;
  197. }
  198. .search {
  199. $w: 474rpx;
  200. $h: 64rpx;
  201. $radius: 32rpx;
  202. $borderWidth: 4rpx;
  203. width: $w;
  204. height: $h;
  205. position: relative;
  206. border-radius: $radius;
  207. &-icon {
  208. margin: 0 13rpx 0 26rpx;
  209. width: 30rpx;
  210. height: auto;
  211. }
  212. /deep/ .uv-search__content {
  213. padding: 12rpx 0;
  214. border: 4rpx solid transparent;
  215. }
  216. &.blur {
  217. background: #FFFFFF66;
  218. &:before,
  219. &:after {
  220. width: calc(#{$w} - #{$radius});
  221. height: $borderWidth;
  222. position: absolute;
  223. left: $radius;
  224. content: ' ';
  225. background: linear-gradient(to right, #FFFFFF, #FFFFFF00);
  226. }
  227. &:before {
  228. top: 0;
  229. }
  230. &:after {
  231. bottom: 0;
  232. }
  233. .border {
  234. width: $radius;
  235. overflow: hidden;
  236. position: absolute;
  237. top: 0;
  238. left: 0;
  239. &-left {
  240. width: calc(#{$radius} * 2 - #{$borderWidth} * 2);
  241. height: calc(#{$h} - #{$borderWidth} * 2);
  242. border: $borderWidth solid #FFFFFF;
  243. border-radius: $radius;
  244. }
  245. }
  246. }
  247. &.focus {
  248. /deep/ .uv-search__content {
  249. background: #FFFFFF !important;
  250. border-color: #CFEFFF !important;
  251. }
  252. /deep/ .uv-search__action {
  253. padding: 19rpx 24rpx;
  254. font-size: 26rpx;
  255. font-weight: 500;
  256. line-height: 1;
  257. color: #FFFFFF;
  258. background: #00A9FF;
  259. border-radius: 32rpx;
  260. }
  261. }
  262. }
  263. .section {
  264. & + & {
  265. margin-top: 32rpx;
  266. }
  267. }
  268. .reason {
  269. width: 100%;
  270. font-size: 0;
  271. border-radius: 32rpx;
  272. overflow: hidden;
  273. .img {
  274. width: 100%;
  275. height: auto;
  276. }
  277. }
  278. </style>