index.vue 12 KB

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