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

302 lines
6.1 KiB

3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks 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.$utils.navigateTo(`/pages_order/growing/activity/applyEmail`)
  82. // uni.navigateTo({
  83. // url: `/pages_order/order/orderConfirm/index`
  84. // })
  85. // return
  86. // uni.navigateTo({
  87. // url: `/pages_order/order/orderDetail/index`
  88. // })
  89. // let id = '1948353988875821058'
  90. // uni.navigateTo({
  91. // url: `/pages_order/thesis/createPdf?id=${id}`
  92. // })
  93. // return
  94. },
  95. computed: {
  96. searchStyle() {
  97. let focusStyle = {
  98. class: 'focus',
  99. color: '#181818',
  100. icon: '/static/image/icon-search-dark.png',
  101. showAction: true,
  102. }
  103. let blurStyle = {
  104. class: 'blur',
  105. color: '#FFFFFF',
  106. icon: '/static/image/icon-search-light.png',
  107. showAction: false,
  108. }
  109. return this.isFocusSearch ? focusStyle : blurStyle
  110. },
  111. },
  112. methods: {
  113. search() {
  114. console.log('search', this.keyword)
  115. uni.navigateTo({
  116. url: '/pages_order/product/search?search=' + this.keyword
  117. })
  118. // this.keyword = ''
  119. },
  120. // todo: delete
  121. getData() {
  122. this.list = [
  123. {
  124. id: '001',
  125. image: '/static/image/temp-20.png',
  126. name: '新疆天山行7/9日丨醉美伊犁&吐鲁番双套餐',
  127. desc: '国内游·7-9天·12岁+',
  128. currentPrice: 688.99,
  129. originalPrice: 1200,
  130. registered: 4168,
  131. },
  132. {
  133. id: '002',
  134. image: '/static/image/temp-21.png',
  135. name: '新疆天山行7/9日丨醉美伊犁&吐鲁番双套餐',
  136. desc: '国内游·7-9天·12岁+',
  137. currentPrice: 688.99,
  138. originalPrice: 1200,
  139. registered: 4168,
  140. },
  141. {
  142. id: '003',
  143. image: '/static/image/temp-22.png',
  144. name: '新疆天山行7/9日丨醉美伊犁&吐鲁番双套餐',
  145. desc: '国内游·7-9天·12岁+',
  146. currentPrice: 688.99,
  147. originalPrice: 1200,
  148. registered: 4168,
  149. },
  150. {
  151. id: '004',
  152. image: '/static/image/temp-23.png',
  153. name: '新疆天山行7/9日丨醉美伊犁&吐鲁番双套餐',
  154. desc: '国内游·7-9天·12岁+',
  155. currentPrice: 688.99,
  156. originalPrice: 1200,
  157. registered: 4168,
  158. },
  159. ]
  160. this.total = this.list.length
  161. },
  162. },
  163. }
  164. </script>
  165. <style scoped lang="scss">
  166. .bg {
  167. width: 100%;
  168. height: auto;
  169. border-bottom-left-radius: 40rpx;
  170. border-bottom-right-radius: 40rpx;
  171. font-size: 0;
  172. overflow: hidden;
  173. .img {
  174. width: 100%;
  175. height: auto;
  176. }
  177. }
  178. .main {
  179. position: absolute;
  180. top: 0;
  181. left: 0;
  182. width: 100%;
  183. padding: 100rpx 32rpx calc(120rpx + env(safe-area-inset-bottom) + 100rpx) 32rpx;
  184. box-sizing: border-box;
  185. }
  186. .search {
  187. $w: 474rpx;
  188. $h: 64rpx;
  189. $radius: 32rpx;
  190. $borderWidth: 4rpx;
  191. width: $w;
  192. height: $h;
  193. position: relative;
  194. border-radius: $radius;
  195. &-icon {
  196. margin: 0 13rpx 0 26rpx;
  197. width: 30rpx;
  198. height: auto;
  199. }
  200. /deep/ .uv-search__content {
  201. padding: 12rpx 0;
  202. border: 4rpx solid transparent;
  203. }
  204. &.blur {
  205. background: #FFFFFF66;
  206. &:before,
  207. &:after {
  208. width: calc(#{$w} - #{$radius});
  209. height: $borderWidth;
  210. position: absolute;
  211. left: $radius;
  212. content: ' ';
  213. background: linear-gradient(to right, #FFFFFF, #FFFFFF00);
  214. }
  215. &:before {
  216. top: 0;
  217. }
  218. &:after {
  219. bottom: 0;
  220. }
  221. .border {
  222. width: $radius;
  223. overflow: hidden;
  224. position: absolute;
  225. top: 0;
  226. left: 0;
  227. &-left {
  228. width: calc(#{$radius} * 2 - #{$borderWidth} * 2);
  229. height: calc(#{$h} - #{$borderWidth} * 2);
  230. border: $borderWidth solid #FFFFFF;
  231. border-radius: $radius;
  232. }
  233. }
  234. }
  235. &.focus {
  236. /deep/ .uv-search__content {
  237. background: #FFFFFF !important;
  238. border-color: #CFEFFF !important;
  239. }
  240. /deep/ .uv-search__action {
  241. padding: 19rpx 24rpx;
  242. font-size: 26rpx;
  243. font-weight: 500;
  244. line-height: 1;
  245. color: #FFFFFF;
  246. background: #00A9FF;
  247. border-radius: 32rpx;
  248. }
  249. }
  250. }
  251. .section {
  252. & + & {
  253. margin-top: 32rpx;
  254. }
  255. }
  256. .reason {
  257. width: 100%;
  258. font-size: 0;
  259. border-radius: 32rpx;
  260. overflow: hidden;
  261. .img {
  262. width: 100%;
  263. height: auto;
  264. }
  265. }
  266. </style>