index.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. <template>
  2. <view class="center">
  3. <view class="topcontent padding-b-30">
  4. <view class="top">
  5. <view class="vheigh"></view>
  6. <view class="top-main flex">
  7. <view class="search-box flex" @click="clickSearch()">
  8. <image class="search" src="../../static/img/search.png" mode=""></image>
  9. <view class="search-font">输入关键词搜索</view>
  10. </view>
  11. </view>
  12. </view>
  13. <swiper class="carousel" autoplay="true" duration="400" interval="5000">
  14. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"
  15. @click="bannerNavToUrl(item)">
  16. <image :src="item.pic" />
  17. </swiper-item>
  18. </swiper>
  19. <view class="stre flex">
  20. <view class="ic-text flex">
  21. <image class="ic-tubiao" src="../../static/icon/shou-ic.png" mode=""></image>
  22. <view class="ic-wen">自用购物优惠</view>
  23. </view>
  24. <view class="ic-text flex">
  25. <image class="ic-tubiao" src="../../static/icon/shou-ic.png" mode=""></image>
  26. <view class="ic-wen">分享好友赚钱</view>
  27. </view>
  28. <view class="ic-text flex">
  29. <image class="ic-tubiao" src="../../static/icon/shou-ic.png" mode=""></image>
  30. <view class="ic-wen">超值正品优惠</view>
  31. </view>
  32. </view>
  33. <view class="zhishi flex">
  34. <navigator url="/pages/index/category">
  35. <view class="zhishi-item">
  36. <image class="zhishi-ic" src="../../static/img/img-f.png" mode=""></image>
  37. <view class="zhishi-te">全部分类</view>
  38. </view>
  39. </navigator>
  40. <navigator url="/pages/user/shareQrCode">
  41. <view class="zhishi-item">
  42. <image class="zhishi-ic" src="../../static/img/img-d.png" mode=""></image>
  43. <view class="zhishi-te">邀请好友</view>
  44. </view>
  45. </navigator>
  46. <navigator url="/pages/index/artDetail?id=6">
  47. <view class="zhishi-item">
  48. <image class="zhishi-ic" src="../../static/img/img-a.png" mode=""></image>
  49. <view class="zhishi-te">关于我们</view>
  50. </view>
  51. </navigator>
  52. <view class="zhishi-item" @click="openKf">
  53. <image class="zhishi-ic" src="../../static/img/img-b.png" mode=""></image>
  54. <view class="zhishi-te">联系客服</view>
  55. </view>
  56. </view>
  57. </view>
  58. <uni-popup ref="popupkf" type="center">
  59. <view class="popup-box">
  60. <view class="img">
  61. <image src="../../static/img/img009.png" mode=""></image>
  62. </view>
  63. <view class="mian">
  64. <view class="delivery">
  65. <view class="title">已经为您定制专属客服</view>
  66. <image src="../../static/img/img010.png" mode=""></image>
  67. </view>
  68. <view class="nocancel">客服VX:{{ kefu }}</view>
  69. <view class="comfirm-box">
  70. <view class="cancel" @click="cancel">取消</view>
  71. <view class="comfirm" @click="comfirm(kefu)">复制微信</view>
  72. </view>
  73. </view>
  74. </view>
  75. </uni-popup>
  76. <u-tabbar activeColor="#333333" inactive-color='#999999' v-model="current" :list="tabbar"></u-tabbar>
  77. </view>
  78. </template>
  79. <script>
  80. import {
  81. tabbar1
  82. } from '@/utils/tabbar.js'; //底部导航栏
  83. import {
  84. article
  85. } from '@/api/user.js';
  86. import {
  87. getCategoryList,
  88. getProducts
  89. } from '@/api/product.js';
  90. import {
  91. loadIndexs,
  92. store_list
  93. } from '@/api/index.js';
  94. import {
  95. auction_gu
  96. } from '@/api/hall.js';
  97. import {
  98. mapState,
  99. mapMutations
  100. } from 'vuex';
  101. export default {
  102. data() {
  103. return {
  104. current: 0,
  105. tabbar: tabbar1,
  106. carouselList: [], //轮播图列表
  107. kefu: '',
  108. };
  109. },
  110. onShow() {
  111. },
  112. methods: {
  113. ...mapMutations(['setLat', 'setLon', 'setChoose']),
  114. // 底部轮播图切换
  115. changeBottom(res) {
  116. this.actionArtInd = res.detail.current;
  117. console.log(res);
  118. },
  119. // 打开客服
  120. openKf() {
  121. this.$refs.popupkf.open();
  122. },
  123. // 关闭客服
  124. cancel() {
  125. this.$refs.popupkf.close();
  126. },
  127. toBack() {
  128. uni.navigateTo({
  129. url: '/pages/navigation/index'
  130. })
  131. },
  132. nav(url) {
  133. console.log(url, '123456');
  134. uni.navigateTo({
  135. url,
  136. fail() {
  137. uni.switchTab({
  138. url
  139. });
  140. }
  141. });
  142. },
  143. // 點擊搜索框
  144. clickSearch() {
  145. uni.navigateTo({
  146. url: '/pages/product/search'
  147. });
  148. },
  149. navTo(item) {
  150. uni.navigateTo({
  151. url: '/pages/hall/halllist?id=' + item.id + '&name=' + item.name + '&peoplename=' + item
  152. .nickname
  153. });
  154. },
  155. //详情页
  156. navToDetailPage(item) {
  157. let id = item.id;
  158. uni.navigateTo({
  159. url: '/pages/product/product?id=' + id
  160. });
  161. }
  162. }
  163. };
  164. </script>
  165. <style lang="scss">
  166. .center {
  167. padding-bottom: 30rpx;
  168. }
  169. .topcontent {
  170. background-color: #FFFFFF;
  171. }
  172. .vheigh {
  173. height: var(--status-bar-height);
  174. background-color: $base-color;
  175. }
  176. .top {
  177. position: relative;
  178. width: 100%;
  179. height: 120rpx;
  180. .top-main {
  181. position: relative;
  182. z-index: 2;
  183. padding: 30rpx;
  184. .search-box {
  185. justify-content: center;
  186. width: 698rpx;
  187. height: 60rpx;
  188. background: rgba(255, 240, 245, 0.4);
  189. border-radius: 30rpx;
  190. background-color: #EEEEEE;
  191. .search {
  192. width: 34rpx;
  193. height: 34rpx;
  194. }
  195. .search-font {
  196. margin-left: 14rpx;
  197. font-size: 28rpx;
  198. font-family: PingFang SC;
  199. font-weight: 500;
  200. color: #CBCBCB;
  201. }
  202. }
  203. }
  204. }
  205. .carousel {
  206. width: 750rpx;
  207. height: 360rpx;
  208. /* #ifndef APP-PLUS */
  209. // margin: -230rpx auto 0;
  210. // margin: -160rpx auto 0;
  211. /* #endif */
  212. /* #ifdef APP-PLUS */
  213. // margin: -100rpx auto 0;
  214. /* #endif */
  215. image {
  216. width: 100%;
  217. height: 100%;
  218. }
  219. }
  220. .stre {
  221. padding: 0 30rpx;
  222. margin-top:20rpx ;
  223. .ic-text {
  224. .ic-tubiao {
  225. width: 27rpx;
  226. height: 27rpx;
  227. }
  228. .ic-wen {
  229. font-size: 21rpx;
  230. color: #333333;
  231. }
  232. }
  233. }
  234. .zhishi {
  235. padding: 30rpx;
  236. .zhishi-item {
  237. .zhishi-ic {
  238. width: 90rpx;
  239. height: 90rpx;
  240. }
  241. .zhishi-te {
  242. font-size: 24rpx;
  243. color: #666666;
  244. }
  245. }
  246. }
  247. .tongz {
  248. height: 70rpx;
  249. margin: 0 30rpx 30rpx 30rpx;
  250. border-radius: 20rpx;
  251. overflow: hidden;
  252. align-items: center;
  253. position: relative;
  254. background-color: #F8F8FA;
  255. .tongz-left {
  256. .notice {
  257. flex-grow: 1;
  258. }
  259. .image-left {
  260. width: 28rpx;
  261. height: 28rpx;
  262. }
  263. .tongz-font {
  264. margin-left: 22rpx;
  265. font-size: 28rpx;
  266. font-family: Source Han Sans CN;
  267. font-weight: 400;
  268. color: #0f253a;
  269. }
  270. }
  271. .tongz-right {
  272. position: relative;
  273. z-index: 11;
  274. width: 12rpx;
  275. height: 26rpx;
  276. image {
  277. width: 100%;
  278. height: 100%;
  279. }
  280. }
  281. }
  282. .popup-box {
  283. width: 522rpx;
  284. height: 605rpx;
  285. background-color: #ffffff;
  286. border-radius: 20rpx;
  287. position: relative;
  288. .img {
  289. position: relative;
  290. top: -56rpx;
  291. left: 0;
  292. width: 522rpx;
  293. height: 132rpx;
  294. display: flex;
  295. justify-content: center;
  296. image {
  297. border-radius: 20rpx 20rpx 0 0;
  298. width: 450rpx;
  299. height: 132rpx;
  300. }
  301. }
  302. .mian {
  303. margin-top: -44rpx;
  304. display: flex;
  305. flex-direction: column;
  306. align-items: center;
  307. // padding: 32rpx 32rpx;
  308. background-color: #ffffff;
  309. border-radius: 0 0 20rpx 20rpx;
  310. text-align: center;
  311. .delivery {
  312. font-size: 40rpx;
  313. color: #333333;
  314. display: flex;
  315. align-items: center;
  316. flex-direction: column;
  317. .title {}
  318. image {
  319. margin-top: 48rpx;
  320. width: 172rpx;
  321. height: 160rpx;
  322. }
  323. }
  324. .nocancel {
  325. font-size: 32rpx;
  326. color: #333333;
  327. margin-top: 14rpx;
  328. }
  329. .comfirm-box {
  330. margin-top: 52rpx;
  331. display: flex;
  332. // margin-bottom: 32rpx;
  333. // justify-content: space-around;
  334. .cancel {
  335. display: flex;
  336. align-items: center;
  337. justify-content: center;
  338. width: 197rpx;
  339. height: 74rpx;
  340. border: 1px solid #dcc786;
  341. border-radius: 38rpx;
  342. font-size: 32rpx;
  343. color: #605128;
  344. }
  345. .comfirm {
  346. margin-left: 32rpx;
  347. display: flex;
  348. align-items: center;
  349. justify-content: center;
  350. width: 197rpx;
  351. height: 74rpx;
  352. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  353. border-radius: 38px;
  354. font-size: 32rpx;
  355. color: #605128;
  356. }
  357. }
  358. }
  359. }
  360. .product-list {
  361. padding: 0 30rpx;
  362. line-height: 0;
  363. align-items: stretch;
  364. .list-left {
  365. .imgleft {
  366. width: 306rpx;
  367. height: 319rpx;
  368. }
  369. }
  370. .list-right {
  371. flex-direction: column;
  372. .imgleft {
  373. width: 366rpx;
  374. height: 152rpx;
  375. }
  376. }
  377. }
  378. .bottom-box {
  379. padding: 30rpx 0;
  380. background-color: #FFFFFF;
  381. .bottom-title {
  382. text-align: center;
  383. .image {
  384. width: 609rpx;
  385. height: 31rpx;
  386. }
  387. }
  388. .product-art-list {
  389. height: 432rpx;
  390. .product-art-item {
  391. .image-box {
  392. text-align: center;
  393. .image {
  394. width: 432rpx;
  395. height: 432rpx;
  396. }
  397. }
  398. }
  399. }
  400. .product-detail {
  401. margin: 30rpx;
  402. height: 4em;
  403. overflow: hidden;
  404. text-indent: 2em;
  405. text-overflow: ellipsis;
  406. display: -webkit-box;
  407. -webkit-line-clamp: 4;
  408. -webkit-box-orient: vertical;
  409. }
  410. }
  411. </style>