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

315 lines
6.4 KiB

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