index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <template>
  2. <view class="container">
  3. <view class="searchbackground">
  4. <view class="backgroundimg">
  5. <image src="../../static/image/background01.png" mode=""></image>
  6. </view>
  7. </view>
  8. <view class="content flex">
  9. <view class="input-box flex" @click="clickSearch">
  10. <view class=" input-content flex">
  11. <view class="iconfont iconsearch"></view>
  12. <view class="input"><input type="text" disabled placeholder="请输入搜索内容" /></view>
  13. </view>
  14. </view>
  15. <swiper class="carousel" autoplay="true" :interval="5000" :duration="400">
  16. <swiper-item @click="carouselList" class="carousel-item" v-for="(item,index) in carouselList"
  17. :key="index">
  18. <image :src="item.pic"></image>
  19. </swiper-item <!-- 自定义swiper指示器 -->
  20. <view class="swiper-dots">
  21. </view>
  22. </swiper>
  23. <view class="customs">
  24. <image src="../../static/image/baodan.png" mode=""></image>
  25. </view>
  26. <view class="customs-content">
  27. <view class="backgroundimg1">
  28. <image src="../../static/image/background02.png" mode=""></image>
  29. </view>
  30. <view class="box">
  31. <view class="customs-img">
  32. <image src="../../static/img/reduce.png" mode=""></image>
  33. </view>
  34. <view class="customstext">
  35. <view class="customstext1">
  36. <view class="customstext-title">
  37. 竹胎酵素健康饮
  38. </view>
  39. <view class="customstext-product">
  40. 健康生态饮品纯植物无香精
  41. </view>
  42. </view>
  43. <view class="customsprice">
  44. <view class="customsprice-left">
  45. 健康价:¥
  46. </view>
  47. <view class="customsprice-between">
  48. 199
  49. </view>
  50. <view class="customsprice-right">
  51. 立即复购
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="customs">
  58. <image src="../../static/image/jifen.png" mode=""></image>
  59. </view>
  60. <view class="jifen-content">
  61. <view class="jifen-box">
  62. <view class="img">
  63. <image src="../../static/image/jifen1.png" mode=""></image>
  64. </view>
  65. <view class="jifen-list">
  66. <view class="box-title">
  67. <view class="top">
  68. 竹胎酵素健康饮
  69. </view>
  70. <view class="button">
  71. 健康生态饮品纯植物
  72. </view>
  73. </view>
  74. <view class="box-price">
  75. <view class="pricebox">
  76. <image src="../../static/image/search.png" mode=""></image>
  77. </view>
  78. <view class="price-left">
  79. 2690
  80. </view>
  81. <view class="price-right">
  82. ¥360
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. <view class="fiexd">
  90. <image src="../../static/image/background03.png" mode=""></image>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. // import seckill from '../../components/seckill/seckill.vue';
  96. // import { loadIndexs } from '@/api/index.js';
  97. // import { getUserInfo } from '@/api/user.js';
  98. // import { setCoupons } from '@/api/functionalUnit.js';
  99. // import { getBargainList } from '@/api/product.js';
  100. // import { interceptor } from '@/utils/loginUtils';
  101. import {
  102. mapState
  103. } from 'vuex';
  104. export default {
  105. components: {
  106. },
  107. watch: {
  108. //自适应swiper高度
  109. checkid(newValue, oldValue) {
  110. let obj = this;
  111. if (newValue == 0) {
  112. let bHeight = Math.ceil(obj.bastList.length / 2);
  113. obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
  114. }
  115. if (newValue == 1) {
  116. let bHeight = Math.ceil(obj.goodsList.length / 2);
  117. obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
  118. }
  119. if (newValue == 2) {
  120. let bHeight = Math.ceil(obj.bastBanner.length / 2);
  121. obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
  122. }
  123. },
  124. // 初次加载页面高度时修改页面高度
  125. bastList(newValue, oldValue) {
  126. let obj = this;
  127. let bHeight = Math.ceil(newValue.length / 2);
  128. obj.$nextTick(function() {
  129. uni.createSelectorQuery()
  130. .select('#list-box')
  131. .fields({
  132. size: true
  133. },
  134. function(data) {
  135. obj.pageProportion = data.width / 750;
  136. obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
  137. }
  138. )
  139. .exec();
  140. });
  141. }
  142. },
  143. data() {
  144. return {
  145. carouselList: [{
  146. pic: '../../static/image/background02.png'
  147. },
  148. {
  149. pic: '../../static/image/baodan.png'
  150. }
  151. ], //轮播列表
  152. page: 1,
  153. limit: 5,
  154. };
  155. },
  156. methods: {
  157. carouselList(item) {
  158. }
  159. }
  160. }
  161. </script>
  162. <style lang="scss" scoped>
  163. page {
  164. margin: 0;
  165. padding: 0;
  166. height: 100%;
  167. background-color: #D4FDF9;
  168. }
  169. .container {
  170. min-height: 100%;
  171. height: auto;
  172. }
  173. .searchbackground {
  174. position: relative;
  175. .backgroundimg {
  176. position: absolute;
  177. width: 750rpx;
  178. image {
  179. width: 100%;
  180. }
  181. }
  182. }
  183. .fiexd {
  184. position: fiexd;
  185. bottom: 0;
  186. width: 750rpx;
  187. height: 750rpx;
  188. image {
  189. width: 100%;
  190. height: 100%;
  191. }
  192. }
  193. .content {
  194. flex-direction: column;
  195. justify-content: center;
  196. height: 100%;
  197. .input-box {
  198. position: absolute;
  199. left: 0;
  200. top: 0;
  201. margin: 66rpx 25rpx;
  202. justify-content: center;
  203. background: #FFFFFF;
  204. box-shadow: 0rpx 1rpx 21rpx 0rpx rgba(255, 255, 255, 0.12);
  205. border-radius: 35rpx;
  206. width: 700rpx;
  207. height: 70rpx;
  208. .input {
  209. font-size: 28rpx;
  210. font-family: PingFang SC;
  211. font-weight: 500;
  212. color: #C4C4C4;
  213. line-height: 38rpx;
  214. }
  215. }
  216. .carousel {
  217. margin-top: 165rpx;
  218. width: 700rpx;
  219. height: 370rpx;
  220. .carousel-item {
  221. image {
  222. width: 100%;
  223. height: 100%;
  224. }
  225. }
  226. }
  227. .customs {
  228. margin-top: 20rpx;
  229. width: 700rpx;
  230. height: 180rpx;
  231. image {
  232. width: 100%;
  233. height: 100%;
  234. }
  235. }
  236. .customs-content {
  237. position: relative;
  238. padding-top: 14rpx;
  239. .backgroundimg1 {
  240. width: 700rpx;
  241. height: 300rpx;
  242. image {
  243. height: 100%;
  244. width: 100%;
  245. }
  246. }
  247. .box {
  248. position: absolute;
  249. margin-top: -250rpx;
  250. padding: 0 38rpx;
  251. display: flex;
  252. justify-content: space-between;
  253. align-items: center;
  254. .customs-img {
  255. width: 200rpx;
  256. height: 200rpx;
  257. image {
  258. width: 100%;
  259. height: 100%;
  260. }
  261. }
  262. .customstext {
  263. margin-left: 14rpx;
  264. height: 200rpx;
  265. display: flex;
  266. flex-direction: column;
  267. justify-content: space-around;
  268. .customstext1 {
  269. .customstext-title {
  270. font-size: 34rpx;
  271. font-family: PingFang SC;
  272. font-weight: bold;
  273. color: #3F7C1F;
  274. line-height: 20rpx;
  275. }
  276. .customstext-product {
  277. margin-top: 25rpx;
  278. font-size: 26rpx;
  279. font-family: PingFang SC;
  280. font-weight: bold;
  281. color: #ABD56F;
  282. line-height: 20rpx;
  283. }
  284. }
  285. .customsprice {
  286. display: flex;
  287. align-items: center;
  288. justify-content: space-between;
  289. .customsprice-left {
  290. font-size: 28rpx;
  291. font-family: PingFang SC;
  292. font-weight: 500;
  293. color: #FF0000;
  294. line-height: 20rpx;
  295. }
  296. .customsprice-between {
  297. font-size: 42rpx;
  298. font-family: PingFang SC;
  299. font-weight: 500;
  300. color: #FF0000;
  301. line-height: 20rpx;
  302. }
  303. .customsprice-right {
  304. margin-left: 80rpx;
  305. display: flex;
  306. justify-content: center;
  307. align-items: center;
  308. width: 137rpx;
  309. height: 52rpx;
  310. background: #3F7C1F;
  311. border-radius: 26rpx;
  312. font-size: 26rpx;
  313. font-family: PingFang SC;
  314. font-weight: 400;
  315. color: #FFFFFF;
  316. }
  317. }
  318. }
  319. }
  320. }
  321. .jifen-content {
  322. width: 700rpx;
  323. display: flex;
  324. flex-wrap: wrap;
  325. justify-content: space-around;
  326. .jifen-box {
  327. margin: 20rpx 0;
  328. display: flex;
  329. flex-direction: column;
  330. align-items: center;
  331. width: 336rpx;
  332. height: 512rpx;
  333. background: #E6FCFA;
  334. box-shadow: 0px 7px 10px 1px #8BAFAB;
  335. .img {
  336. margin-top: 20rpx;
  337. height: 312rpx;
  338. width: 312rpx;
  339. image {
  340. height: 100%;
  341. width: 100%;
  342. }
  343. }
  344. .jifen-list {
  345. margin-left: -80rpx;
  346. .box-title {
  347. .top {
  348. padding: 20rpx 0 10rpx 0;
  349. font-size: 30rpx;
  350. font-family: PingFang SC;
  351. font-weight: bold;
  352. color: #3F7C1F;
  353. line-height: 35rpx;
  354. }
  355. .button {
  356. padding-bottom: 20rpx;
  357. font-size: 26rpx;
  358. font-family: PingFang SC;
  359. font-weight: 500;
  360. color: #3F7C1F;
  361. line-height: 35rpx;
  362. opacity: 0.8;
  363. }
  364. }
  365. .box-price {
  366. display: flex;
  367. align-items: center;
  368. .pricebox {
  369. height: 25rpx;
  370. width: 25rpx;
  371. image {
  372. height: 100%;
  373. width: 100%;
  374. }
  375. }
  376. .price-left {
  377. font-size: 36rpx;
  378. font-family: PingFang SC;
  379. font-weight: bold;
  380. color: #FF0000;
  381. line-height: 35rpx;
  382. }
  383. .price-right {
  384. font-size: 26rpx;
  385. font-family: PingFang SC;
  386. font-weight: 500;
  387. text-decoration: line-through;
  388. color: #999999;
  389. line-height: 35rpx;
  390. }
  391. }
  392. }
  393. }
  394. }
  395. }
  396. </style>