index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. <template>
  2. <view class="center">
  3. <view class="top">
  4. <image class="top-bg" src="../../static/img/top-bg.png" mode=""></image>
  5. <view class="top-main flex">
  6. <view class="search-box flex" @click="clickSearch()">
  7. <image class="search" src="../../static/img/search.png" mode=""></image>
  8. <view class="search-font">输入关键词搜索</view>
  9. </view>
  10. </view>
  11. </view>
  12. <swiper class="carousel" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  13. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item" @click="bannerNavToUrl(item)"><image :src="item.pic" /></swiper-item>
  14. </swiper>
  15. <view class="navbar flex">
  16. <view class="navbar-item" @click="nav('/pages/product/classify')">
  17. <image class="nitem-image" src="../../static/img/autotrophy.png" mode=""></image>
  18. <view class="nitem-font">趣豆自营</view>
  19. </view>
  20. <view class="navbar-item" @click="nav('/pages/product/classify')">
  21. <image class="nitem-image" src="../../static/img/integral.png" mode=""></image>
  22. <view class="nitem-font">积分商城</view>
  23. </view>
  24. <view class="navbar-item" @click="nav('/pages/product/classify')">
  25. <image class="nitem-image" src="../../static/img/replacement.png" mode=""></image>
  26. <view class="nitem-font">置换商城</view>
  27. </view>
  28. <view class="navbar-item" @click="nav('/pages/product/classify')">
  29. <image class="nitem-image" src="../../static/img/Hang.png" mode=""></image>
  30. <view class="nitem-font">挂售商城</view>
  31. </view>
  32. <view class="navbar-item" @click="nav('/pages/hall/hall')">
  33. <image class="nitem-image" src="../../static/img/offline.png" mode=""></image>
  34. <view class="nitem-font">线下会馆</view>
  35. </view>
  36. </view>
  37. <view class="product"><image class="product-image" src="../../static/img/index-product.png" mode=""></image></view>
  38. <view class="shingle">
  39. <view class="shingle-top flex">
  40. <view class="shingle-title">艺术品挂牌交易区</view>
  41. <view class="shingle-btn" @click="nav('/pages/hall/hall')">
  42. 查看更多趣豆会馆
  43. <text>></text>
  44. </view>
  45. </view>
  46. <view class="shingle-main" @click="nav('/pages/hall/halllist')">
  47. <view class="shingle-bg"><image src="../../static/img/sim-bg.png" mode=""></image></view>
  48. <view class="shinglem-title flex">
  49. <image class="address" src="../../static/img/address.png" mode=""></image>
  50. <view class="shingle-font">浙江馆</view>
  51. </view>
  52. <view class="shingle-mmain flex">
  53. <view class="smmain-item">
  54. <view class="smitem-top">开放中</view>
  55. <view class="smitem-bottom">状态</view>
  56. </view>
  57. <view class="shu"></view>
  58. <view class="smmain-item">
  59. <view class="smitem-top">纯平</view>
  60. <view class="smitem-bottom">馆长</view>
  61. </view>
  62. <view class="shu"></view>
  63. <view class="smmain-item">
  64. <view class="people flex">
  65. <view class="peopleitem" v-for="item in 1"><image src="../../static/img/busy.png" mode=""></image></view>
  66. <view class="peopleitem" v-for="item in 4"><image src="../../static/img/leisure.png" mode=""></image></view>
  67. </view>
  68. <view class="smitem-bottom">流畅</view>
  69. </view>
  70. </view>
  71. <image class="right-bottom" src="../../static/img/right-bottom.png" mode=""></image>
  72. </view>
  73. </view>
  74. <view class="good-title" v-if="dataList.length > 0"><image src="../../static/img/goodtitle.png" mode=""></image></view>
  75. <view class="main" v-if="dataList.length > 0">
  76. <view class="list-box-h">
  77. <view v-for="(item, index) in dataList" :key="index" class="guess-item" @click="navToDetailPage(item)">
  78. <image :src="item.image"></image>
  79. <view class="guess-box">
  80. <view class="title clamp2">{{ item.store_name }}</view>
  81. <view class="price-box flex">
  82. <view class="yuanprice">{{ item.ot_price }}</view>
  83. <image src="../../static/img/jiantou.png" mode=""></image>
  84. <view class="jiang">直降{{ (item.ot_price - item.price).toFixed(2) }}元</view>
  85. </view>
  86. <view class="price" v-if="item.integral != 0">¥{{ item.price }} + {{ item.integral }}消费补贴券</view>
  87. <view class="price" v-else>¥{{ item.price }}</view>
  88. <view class="btn">立即购买</view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. <u-tabbar activeColor="#375AFE" v-model="current" :list="tabbar" :mid-button="true"></u-tabbar>
  94. </view>
  95. </template>
  96. <script>
  97. import { loadIndexs } from '@/api/index.js';
  98. import { tabbar } from '@/utils/tabbar.js';
  99. export default {
  100. data() {
  101. return {
  102. titleNViewBackground: '',
  103. swiperCurrent: 0,
  104. swiperLength: 0,
  105. dataList: '',
  106. carouselList:[],//轮播图列表
  107. tabbar: tabbar,
  108. current: 0
  109. };
  110. },
  111. onLoad() {
  112. this.loadData();
  113. },
  114. methods: {
  115. loadData() {
  116. loadIndexs({})
  117. .then(({ data }) => {
  118. let goods = data.info;
  119. this.dataList = goods.bastList; //精品推荐
  120. this.carouselList = data.banner;
  121. })
  122. .catch(e => {});
  123. },
  124. nav(url) {
  125. uni.navigateTo({
  126. url,
  127. fail() {
  128. uni.switchTab({
  129. url
  130. });
  131. }
  132. });
  133. },
  134. //轮播图切换修改背景色
  135. swiperChange(e) {
  136. const index = e.detail.current;
  137. this.swiperCurrent = index;
  138. this.titleNViewBackground = this.carouselList[index].background;
  139. },
  140. // 點擊搜索框
  141. clickSearch() {
  142. uni.navigateTo({
  143. url: '/pages/product/search'
  144. });
  145. },
  146. //详情页
  147. navToDetailPage(item) {
  148. let id = item.id;
  149. uni.navigateTo({
  150. url: '/pages/product/product?id=' + id
  151. });
  152. }
  153. }
  154. };
  155. </script>
  156. <style lang="scss">
  157. page,
  158. .center {
  159. min-height: 100%;
  160. height: auto;
  161. background-color: #ffffff;
  162. }
  163. .top {
  164. position: relative;
  165. width: 100%;
  166. height: 400rpx;
  167. .top-bg {
  168. position: absolute;
  169. top: 0;
  170. left: 0;
  171. right: 0;
  172. width: 100%;
  173. height: 100%;
  174. }
  175. .top-main {
  176. position: relative;
  177. z-index: 2;
  178. padding: 30rpx;
  179. .search-box {
  180. justify-content: center;
  181. width: 698rpx;
  182. height: 60rpx;
  183. background: rgba(255, 240, 245, 0.4);
  184. box-shadow: 0px 10rpx 20rpx 0px rgba(4, 114, 69, 0.22);
  185. border-radius: 30rpx;
  186. .search {
  187. width: 34rpx;
  188. height: 34rpx;
  189. }
  190. .search-font {
  191. margin-left: 14rpx;
  192. font-size: 28rpx;
  193. font-family: PingFang SC;
  194. font-weight: 500;
  195. color: #ffffff;
  196. }
  197. }
  198. }
  199. }
  200. .navbar {
  201. margin-top: 42rpx;
  202. justify-content: space-around;
  203. .navbar-item {
  204. width: 20%;
  205. display: flex;
  206. flex-direction: column;
  207. align-items: center;
  208. .nitem-image {
  209. width: 90rpx;
  210. height: 90rpx;
  211. }
  212. .nitem-font {
  213. margin-top: 16rpx;
  214. font-size: 24rpx;
  215. font-family: PingFang SC;
  216. font-weight: 500;
  217. color: #0c1732;
  218. }
  219. }
  220. }
  221. .product {
  222. width: 750rpx;
  223. height: 350rpx;
  224. margin-top: 50rpx;
  225. .product-image {
  226. width: 750rpx;
  227. height: 350rpx;
  228. }
  229. }
  230. .shingle {
  231. width: 690rpx;
  232. background: #efefef;
  233. border-radius: 10rpx;
  234. margin: 60rpx auto;
  235. padding: 28rpx 20rpx 40rpx;
  236. .shingle-top {
  237. padding-left: 2rpx;
  238. .shingle-title {
  239. font-size: 36rpx;
  240. font-family: PingFang SC;
  241. font-weight: bold;
  242. color: #375afe;
  243. }
  244. .shingle-btn {
  245. width: 248rpx;
  246. height: 50rpx;
  247. border: 2rpx solid #375afe;
  248. border-radius: 10rpx;
  249. padding: 0 16rpx;
  250. text-align: left;
  251. font-size: 24rpx;
  252. font-family: PingFang SC;
  253. font-weight: 500;
  254. color: #375afe;
  255. line-height: 50rpx;
  256. text {
  257. display: inline-block;
  258. padding-left: 10rpx;
  259. }
  260. }
  261. }
  262. .shingle-main {
  263. margin: 20rpx auto;
  264. width: 650rpx;
  265. height: 206rpx;
  266. position: relative;
  267. .shingle-bg {
  268. position: absolute;
  269. top: 0;
  270. left: 0;
  271. right: 0;
  272. width: 650rpx;
  273. height: 206rpx;
  274. image {
  275. width: 650rpx;
  276. height: 206rpx;
  277. }
  278. }
  279. .shinglem-title {
  280. position: relative;
  281. z-index: 2;
  282. justify-content: center;
  283. height: 70rpx;
  284. .address {
  285. width: 28rpx;
  286. height: 30rpx;
  287. }
  288. .shingle-font {
  289. font-size: 36rpx;
  290. font-family: PingFang SC;
  291. font-weight: bold;
  292. color: #ffffff;
  293. line-height: 70rpx;
  294. margin-left: 14rpx;
  295. }
  296. }
  297. .shingle-mmain {
  298. position: relative;
  299. z-index: 2;
  300. margin-top: 30rpx;
  301. .smmain-item {
  302. width: 33%;
  303. display: flex;
  304. flex-direction: column;
  305. align-items: center;
  306. .smitem-top {
  307. font-size: 30rpx;
  308. font-family: PingFang SC;
  309. font-weight: bold;
  310. color: #ffffff;
  311. }
  312. .smitem-bottom {
  313. margin-top: 10rpx;
  314. font-size: 30rpx;
  315. font-family: PingFang SC;
  316. font-weight: 500;
  317. color: #ffffff;
  318. }
  319. .people {
  320. justify-content: center;
  321. .peopleitem {
  322. width: 24rpx;
  323. height: 34rpx;
  324. image {
  325. width: 100%;
  326. height: 100%;
  327. }
  328. }
  329. }
  330. }
  331. .shu {
  332. width: 2rpx;
  333. height: 70rpx;
  334. background: #ffffff;
  335. }
  336. }
  337. .right-bottom {
  338. position: absolute;
  339. z-index: 2;
  340. right: 0;
  341. bottom: 0;
  342. width: 94rpx;
  343. height: 92rpx;
  344. }
  345. }
  346. }
  347. .good-title {
  348. width: 376rpx;
  349. height: 34rpx;
  350. margin: 44rpx auto 0;
  351. image {
  352. width: 100%;
  353. height: 100%;
  354. }
  355. }
  356. .guess-item {
  357. display: flex;
  358. width: 710rpx;
  359. height: 300rpx;
  360. background: #ffffff;
  361. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  362. border-radius: 10rpx;
  363. padding: 15rpx;
  364. padding-bottom: 150rpx;
  365. margin: 20rpx auto 0;
  366. position: relative;
  367. image {
  368. width: 200rpx;
  369. height: 200rpx;
  370. border-radius: 10rpx;
  371. }
  372. .guess-box {
  373. padding: 12rpx 0 0 24rpx;
  374. width: 436rpx;
  375. .title {
  376. font-size: 36rpx;
  377. padding-left: 4rpx;
  378. font-family: PingFang SC;
  379. font-weight: 500;
  380. color: #333333;
  381. width: 368rpx;
  382. line-height: 36rpx;
  383. .tuanF {
  384. display: inline-block;
  385. margin-right: 4rpx;
  386. position: relative;
  387. top: -6rpx;
  388. .tuan {
  389. display: flex;
  390. align-items: center;
  391. padding: 10rpx;
  392. height: 36rpx;
  393. background: #ffebe9;
  394. border-radius: 18rpx;
  395. .tuan-image {
  396. width: 18rpx;
  397. height: 18rpx;
  398. }
  399. .tuan-font {
  400. display: inline;
  401. font-size: 20rpx;
  402. font-family: PingFang SC;
  403. font-weight: 500;
  404. color: #ff1135;
  405. margin-left: 2rpx;
  406. }
  407. }
  408. }
  409. }
  410. .ping-box {
  411. margin-top: 15rpx;
  412. justify-content: flex-start;
  413. .ping {
  414. margin-left: 10rpx;
  415. height: 39rpx;
  416. background: #fdf7eb;
  417. border-radius: 5rpx;
  418. font-size: 22rpx;
  419. font-family: PingFang SC;
  420. font-weight: 500;
  421. color: #ff911f;
  422. display: flex;
  423. align-items: center;
  424. padding: 0 10rpx;
  425. }
  426. }
  427. .price-box {
  428. margin-top: 50rpx;
  429. justify-content: flex-start;
  430. .yuanprice {
  431. font-size: 26rpx;
  432. font-family: PingFang SC;
  433. font-weight: 500;
  434. text-decoration: line-through;
  435. color: #999999;
  436. padding-right: 6rpx;
  437. }
  438. image {
  439. width: 14rpx;
  440. height: 16rpx;
  441. }
  442. .jiang {
  443. padding-left: 2rpx;
  444. font-size: 24rpx;
  445. font-family: PingFang SC;
  446. font-weight: bold;
  447. color: #b59467;
  448. }
  449. }
  450. .price {
  451. font-size: 36rpx;
  452. font-family: PingFang SC;
  453. font-weight: bold;
  454. color: #ff1135;
  455. }
  456. .btn {
  457. width: 137rpx;
  458. height: 56rpx;
  459. background: linear-gradient(0deg, rgba(60, 237, 237, 0.99), #04b8ff, #375afe);
  460. border-radius: 28rpx;
  461. font-size: 28rpx;
  462. font-family: PingFang SC;
  463. font-weight: 500;
  464. color: #ffffff;
  465. line-height: 56rpx;
  466. text-align: center;
  467. position: absolute;
  468. bottom: 10rpx;
  469. right: 25rpx;
  470. }
  471. }
  472. }
  473. </style>