homeComb.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883
  1. <template>
  2. <view class="page_count">
  3. <view class="bg-img" v-if="imgUrls.length">
  4. <image :class="{ active: index == swiperCur }" v-for="(i, index) in imgUrls" :src="i.img"></image>
  5. </view>
  6. <view class="bag-gradient" :style="[bgGradientStyle]"></view>
  7. <!--搜索-->
  8. <view class="my-main">
  9. <view class="mp-header" id="home" :style="[mpHeaderStyle]">
  10. <view class="sys-head" :style="{ height: statusBarHeight + 'px' }" v-if="!special"></view>
  11. <view class="serch-box">
  12. <view class="serch-wrapper flex" :class="special ? 'on' : ''">
  13. <view class="title skeleton-rect" :style="[titleStyle]" v-if="searchBox == 0">{{ titleConfig }}</view>
  14. <view class="logo skeleton-rect" v-if="searchBox == 1">
  15. <image :src="logoUpImg" mode="heightFix"></image>
  16. </view>
  17. <navigator
  18. v-if="hotWords.length"
  19. :url="'/pages/goods/goods_search/index?searchVal=' + searchVal"
  20. :class="logoConfig ? 'input' : 'uninput'"
  21. hover-class="none"
  22. class="skeleton-rect"
  23. :style="[inputStyle]"
  24. >
  25. <view class="swiperTxt">
  26. <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration" vertical="true" circular="true" @change="textChange">
  27. <block v-for="(item, index) in hotWords" :key="index">
  28. <swiper-item catchtouchmove="catchTouchMove">
  29. <view class="acea-row row-between-wrapper">
  30. <view class="text acea-row row-between-wrapper">
  31. <view class="newsTitle line1">{{ item.val }}</view>
  32. </view>
  33. </view>
  34. </swiper-item>
  35. </block>
  36. </swiper>
  37. </view>
  38. <text class="iconfont icon-ic_search"></text>
  39. </navigator>
  40. <navigator v-else url="/pages/goods/goods_search/index" hover-class="none" class="skeleton-rect input" :style="[inputStyle]">
  41. {{ dataConfig.inputConfig.value }}
  42. <text class="iconfont icon-ic_search"></text>
  43. </navigator>
  44. </view>
  45. </view>
  46. </view>
  47. <view :style="'height:' + (statusBarHeight + 43) + 'px'" v-if="!special && searchShow"></view>
  48. <view v-if="!dataConfig.classConfig.tabVal" class="navTabBox tabNav">
  49. <view class="longTab" :style="{ width: `${mainWidth}px` }">
  50. <scroll-view scroll-x="true" scroll-with-animation :scroll-left="tabLeft" show-scrollbar="true">
  51. <view
  52. class="longItem"
  53. v-for="(item, index) in tabListConfig"
  54. :key="index"
  55. :class="{ click: index == tabClick }"
  56. :id="'id' + index"
  57. :data-index="index"
  58. @click="changeTab(item, index)"
  59. >
  60. {{ item.text.val }}
  61. </view>
  62. </scroll-view>
  63. </view>
  64. <view class="category" @click="showCategory">
  65. <text class="iconfont icon-a-ic_Imageandtextsorting" :style="'color:' + (isScrolled ? txtColor : '#fff')"></text>
  66. </view>
  67. </view>
  68. <view v-if="isCategory" class="category_count">
  69. <view class="sys-head tui-skeleton" :style="{ height: statusBarHeight + 'px' }" v-if="!special"></view>
  70. <view class="fs-28">精选类目</view>
  71. <view class="cate_count grid-column-4 grid-gap-16rpx mt-32">
  72. <view
  73. class="category_item"
  74. :style="[index === tabClick ? classColor : '']"
  75. @click="changeTab(item, index)"
  76. v-for="(item, index) in tabListConfig"
  77. :key="index"
  78. :id="'ids' + index"
  79. >
  80. {{ item.text.val }}
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="swiperBg" :style="{ paddingBottom: isMenu ? '20rpx' : '20rpx' }">
  86. <view class="swiper page_swiper" v-if="imgUrls.length">
  87. <swiper
  88. :autoplay="true"
  89. :circular="circular"
  90. :interval="intervals"
  91. :duration="duration"
  92. :current="swiperCur"
  93. :previous-margin="swiperMargin"
  94. :next-margin="swiperMargin"
  95. @change="swiperChange"
  96. >
  97. <block v-for="(item, index) in imgUrls" :key="index">
  98. <swiper-item :class="{ active: index == swiperCur, scalex: isScale }">
  99. <view @click="goDetail(item)" class="slide-navigator acea-row row-between-wrapper">
  100. <image :src="item.img" :style="[imageStyle]" mode="aspectFill" class="slide-image"></image>
  101. </view>
  102. </swiper-item>
  103. </block>
  104. </swiper>
  105. <!--重置小圆点的样式 -->
  106. <view
  107. class="dots acea-row"
  108. :class="{
  109. 'row-center': dataConfig.docPosition.tabVal == 1,
  110. 'row-right': dataConfig.docPosition.tabVal == 2
  111. }"
  112. >
  113. <view v-if="dataConfig.docConfig.tabVal == 2" class="dot3">
  114. <view class="dot" :style="[progressWidth, dotBgColor]">
  115. <view class="active" :style="[progressValue, dotColor]"></view>
  116. </view>
  117. </view>
  118. <view
  119. v-else
  120. class="acea-row"
  121. :class="{
  122. dot1: dataConfig.docConfig.tabVal == 0,
  123. dot2: dataConfig.docConfig.tabVal == 1,
  124. dot4: dataConfig.docConfig.tabVal == 3
  125. }"
  126. >
  127. <view
  128. v-for="(item, index) in imgUrls"
  129. :key="index"
  130. class="dot"
  131. :class="{ active: index == swiperCur }"
  132. :style="[dotBgColor, index == swiperCur ? dotColor : '']"
  133. ></view>
  134. </view>
  135. </view>
  136. </view>
  137. </view>
  138. <view v-if="isCategory" class="mask" @click="isCategory = false"></view>
  139. </view>
  140. </template>
  141. <script>
  142. import { getCategoryList } from '@/api/store.js';
  143. import { getCategoryVersion } from '@/api/api.js';
  144. let statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  145. export default {
  146. name: 'homeComb',
  147. props: {
  148. dataConfig: {
  149. type: Object,
  150. default: () => {}
  151. },
  152. isFixed: {
  153. type: Boolean,
  154. default: false
  155. },
  156. isScrolled: {
  157. type: Boolean,
  158. default: false
  159. },
  160. isScale: {
  161. type: Boolean,
  162. default: false
  163. },
  164. isMenu: {
  165. type: Boolean,
  166. default: false
  167. },
  168. special: {
  169. type: Number,
  170. default: 0
  171. },
  172. belongIndex: {
  173. type: Number,
  174. default: 0
  175. }
  176. },
  177. data() {
  178. return {
  179. statusBarHeight: statusBarHeight,
  180. autoplay: true,
  181. interval: this.dataConfig.numConfig.val * 1000 || 2500,
  182. duration: 500,
  183. logoConfig: this.dataConfig.logoConfig.url,
  184. tabClick: 0, //导航栏被点击
  185. isLeft: 0, //导航栏下划线位置
  186. isWidth: 0, //每个导航栏占位
  187. mainWidth: 0,
  188. tabLeft: 0,
  189. tabTitle: [],
  190. isTop: 0,
  191. navHeight: 38,
  192. indicatorDots: false,
  193. circular: true,
  194. intervals: 3000,
  195. imgUrls: [], //图片轮播数据
  196. swiperCur: 0,
  197. searchVal: '',
  198. bgColor: this.dataConfig.swiperConfig.list.length ? this.dataConfig.swiperConfig.list[0].img : '',
  199. isCategory: false,
  200. txtColor: '',
  201. hotWordShow: false,
  202. bgColorLeft: '',
  203. bgColorRight: '',
  204. searchShow: false,
  205. titleConfig: this.dataConfig.titleConfig.value,
  206. searchBox: this.dataConfig.searchBox.tabVal,
  207. fixConfig: this.dataConfig.searchFix.tabVal
  208. };
  209. },
  210. computed: {
  211. classColor() {
  212. let color = this.dataConfig.classColor;
  213. return {
  214. background: `linear-gradient(90deg, ${color.color[0].item} 50%, ${color.color[1].item} 100%)`,
  215. color: '#fff'
  216. };
  217. },
  218. bgGradientStyle() {
  219. return {
  220. 'background-image': `linear-gradient(to bottom, rgba(245,245,245,0) 0%, rgba(245,245,245,0) 50%, ${
  221. this.dataConfig.gradientColor ? this.dataConfig.gradientColor.color[0].item : '#f5f5f5'
  222. } 100%)`
  223. };
  224. },
  225. swiperMargin() {
  226. return this.dataConfig.styleConfig.tabVal ? '50rpx' : '10rpx';
  227. },
  228. mpHeaderStyle() {
  229. let style = {};
  230. if (this.isScrolled && this.dataConfig.searchConfig.tabVal) {
  231. style.background = `linear-gradient(90deg, #FFFFFF 50%, #FFFFFF 100%)`;
  232. style.position = `fixed`;
  233. this.searchShow = true;
  234. } else {
  235. this.searchShow = false;
  236. }
  237. return style;
  238. },
  239. inputStyle() {
  240. let style = {};
  241. if (this.isScrolled && this.dataConfig.searchConfig.tabVal) {
  242. style.background = `#F5F5F5`;
  243. style.color = `#BBBBBB`;
  244. }
  245. return style;
  246. },
  247. titleStyle() {
  248. let style = {};
  249. if (this.isScrolled && this.dataConfig.searchConfig.tabVal) {
  250. style.color = `#333`;
  251. }
  252. return style;
  253. },
  254. progressWidth() {
  255. return {
  256. width: `${this.dataConfig.swiperConfig.list.length * 20}rpx`
  257. };
  258. },
  259. progressValue() {
  260. return {
  261. width: `${((this.swiperCur + 1) / this.dataConfig.swiperConfig.list.length) * 100}%`
  262. };
  263. },
  264. dotBgColor() {
  265. return {
  266. background: this.dataConfig.dotBgColor.color[0].item
  267. };
  268. },
  269. dotColor() {
  270. return {
  271. background: this.dataConfig.dotColor.color[0].item
  272. };
  273. },
  274. imageStyle() {
  275. let borderRadius = `${this.dataConfig.filletImg.val * 2}rpx`;
  276. if (this.dataConfig.filletImg.type) {
  277. borderRadius = `${this.dataConfig.filletImg.valList[0].val * 2}rpx ${this.dataConfig.filletImg.valList[1].val * 2}rpx ${this.dataConfig.filletImg.valList[3].val * 2}rpx ${
  278. this.dataConfig.filletImg.valList[2].val * 2
  279. }rpx`;
  280. }
  281. return {
  282. 'border-radius': borderRadius
  283. };
  284. },
  285. tabListConfig() {
  286. let tabList = this.dataConfig.tabListConfig.list;
  287. tabList.unshift({
  288. classPage: {
  289. id: 0
  290. },
  291. dataType: {
  292. tabVal: 0
  293. },
  294. microPage: {
  295. id: 0
  296. },
  297. text: {
  298. val: '首页'
  299. }
  300. });
  301. return tabList;
  302. },
  303. hotWords() {
  304. return this.dataConfig.hotWords.list.filter((item) => {
  305. return item.val;
  306. });
  307. },
  308. logoUpImg() {
  309. let img = '';
  310. if (this.isScrolled && this.dataConfig.searchConfig.tabVal && this.dataConfig.logoUpConfig && this.dataConfig.logoUpConfig.url) {
  311. img = this.dataConfig.logoUpConfig.url;
  312. } else {
  313. img = this.dataConfig.logoConfig.url;
  314. }
  315. return img;
  316. }
  317. },
  318. created() {
  319. var that = this;
  320. // 获取设备宽度
  321. uni.getSystemInfo({
  322. success(e) {
  323. that.mainWidth = e.windowWidth;
  324. that.isWidth = (e.windowWidth - 65) / 8;
  325. }
  326. });
  327. that.imgUrls = that.dataConfig.swiperConfig.list;
  328. },
  329. mounted() {
  330. let that = this;
  331. that.hotWords.forEach((item) => {
  332. if (item.val) {
  333. this.hotWordShow = true;
  334. }
  335. });
  336. uni.setStorageSync('hotList', that.hotWords);
  337. },
  338. methods: {
  339. goDetail(url) {
  340. let urls = url.info[1].value;
  341. this.$util.JumpPath(urls);
  342. },
  343. //替换安全域名
  344. setDomain: function (url) {
  345. url = url ? url.toString() : '';
  346. //本地调试打开,生产请注销
  347. if (url.indexOf('https://') > -1) return url;
  348. else return url.replace('http://', 'https://');
  349. },
  350. swiperChange(e) {
  351. let { current, source } = e.detail;
  352. if (source === 'autoplay' || source === 'touch') {
  353. this.swiperCur = e.detail.current;
  354. this.bgColor = this.imgUrls[e.detail.current]['img'];
  355. }
  356. },
  357. textChange(e) {
  358. let { current, source } = e.detail;
  359. if (source === 'autoplay' || source === 'touch') {
  360. this.searchVal = this.hotWords[e.detail.current]['val'];
  361. }
  362. },
  363. /**显示全部分类*/
  364. showCategory() {
  365. this.isCategory = true;
  366. },
  367. /*跳转为页面*/
  368. changeTab(item, index) {
  369. if (this.tabClick == index) return;
  370. this.tabClick = index; //设置导航点击了哪一个
  371. this.isLeft = index * this.isWidth + 16; //设置下划线位置
  372. this.isCategory = false;
  373. let data = {
  374. type: item.dataType.tabVal, // 0 微页面 1 商品分类
  375. microPage: item.microPage.id,
  376. classPage: item.classPage.id
  377. };
  378. this.$emit('bindSortId', data);
  379. }
  380. }
  381. };
  382. </script>
  383. <style lang="scss" scoped>
  384. .scrollColor {
  385. transition: background-color 0.5s ease;
  386. background-color: #fff;
  387. color: #333 !important;
  388. .longItem {
  389. // color: #333 !important;
  390. &.click {
  391. &::after {
  392. background: #333 !important;
  393. }
  394. }
  395. }
  396. }
  397. .page_count {
  398. position: relative;
  399. overflow: hidden;
  400. .bag-gradient {
  401. position: absolute;
  402. left: 0;
  403. top: 0;
  404. width: 100%;
  405. height: 100%;
  406. overflow: hidden;
  407. z-index: 0;
  408. }
  409. .bg-img {
  410. position: absolute;
  411. width: 100%;
  412. height: 100%;
  413. top: 0;
  414. z-index: 0;
  415. filter: blur(0);
  416. overflow: hidden;
  417. image.active {
  418. opacity: 1;
  419. transform: scale(1.5);
  420. }
  421. image {
  422. position: absolute;
  423. left: 0;
  424. top: 0;
  425. width: 100%;
  426. height: 100%;
  427. filter: blur(30rpx);
  428. transform: scale(1.5);
  429. opacity: 0;
  430. transition: opacity 0.5s ease;
  431. }
  432. }
  433. }
  434. .my-main {
  435. transition: background-color 0.5s ease;
  436. }
  437. .swiperTxt {
  438. width: 300rpx;
  439. height: 100%;
  440. line-height: 58rpx;
  441. overflow: hidden;
  442. }
  443. .swiperTxt .text {
  444. width: 480rpx;
  445. }
  446. .swiperTxt .text .label {
  447. font-size: 20rpx;
  448. color: #ff4c48;
  449. width: 64rpx;
  450. height: 30rpx;
  451. border-radius: 40rpx;
  452. text-align: center;
  453. line-height: 28rpx;
  454. border: 2rpx solid #ff4947;
  455. }
  456. .swiperTxt .text .newsTitle {
  457. width: 300rpx;
  458. font-size: 24rpx;
  459. // color: #fff;
  460. }
  461. .swiperTxt swiper {
  462. height: 100%;
  463. }
  464. .mp-header {
  465. z-index: 99;
  466. // position: fixed;
  467. position: relative;
  468. left: 0;
  469. top: 0;
  470. width: 100%;
  471. &.on {
  472. position: relative;
  473. }
  474. .serch-box {
  475. height: 43px;
  476. }
  477. .logo {
  478. height: 60rpx;
  479. margin-right: 20rpx;
  480. image {
  481. width: 100%;
  482. height: 100%;
  483. }
  484. }
  485. .serch-wrapper {
  486. align-items: center;
  487. /* #ifdef MP */
  488. padding: 0 220rpx 0 30rpx;
  489. /* #endif */
  490. /* #ifndef MP */
  491. padding: 0 30rpx;
  492. /* #endif */
  493. height: 100%;
  494. &.on {
  495. padding: 0 30rpx;
  496. }
  497. .title,
  498. .map {
  499. font-size: 28rpx;
  500. color: #fff;
  501. margin-right: 24rpx;
  502. }
  503. .map {
  504. .iconfont {
  505. font-size: 26rpx;
  506. }
  507. .icon-ic_location4 {
  508. margin-right: 12rpx;
  509. }
  510. }
  511. &.on {
  512. padding: 0 30rpx;
  513. }
  514. .input,
  515. .uninput {
  516. flex: 1;
  517. min-width: 0;
  518. position: relative;
  519. display: flex;
  520. align-items: center;
  521. height: 60rpx;
  522. padding: 0 32rpx;
  523. border-radius: 30rpx;
  524. background: rgba(255, 255, 255, 0.4);
  525. font-size: 28rpx;
  526. color: #ffffff;
  527. .iconfont {
  528. position: absolute;
  529. right: 25rpx;
  530. top: 13rpx;
  531. }
  532. }
  533. }
  534. }
  535. .tabNav {
  536. padding-top: 10rpx;
  537. }
  538. .navTabBox {
  539. color: #ffffff;
  540. padding: 0 57rpx 0 30rpx;
  541. // z-index: 99;
  542. position: relative;
  543. // position: fixed;
  544. left: 0;
  545. width: 100%;
  546. // padding-top: 5px;
  547. &.on {
  548. position: relative;
  549. }
  550. scroll-view {
  551. /* #ifdef MP */
  552. width: 640rpx;
  553. /* #endif */
  554. /* #ifndef MP */
  555. width: 666rpx;
  556. /* #endif */
  557. height: 82rpx;
  558. white-space: nowrap;
  559. }
  560. .click {
  561. color: white;
  562. }
  563. .longTab {
  564. // height: 34px;
  565. .longItem {
  566. display: inline-block;
  567. text-align: center;
  568. font-size: 28rpx;
  569. color: #ffffff;
  570. max-width: 160rpx;
  571. margin-right: 30rpx;
  572. position: relative;
  573. font-weight: 400;
  574. line-height: 82rpx;
  575. &:last-child {
  576. margin-right: 0;
  577. }
  578. &.click {
  579. font-weight: 600;
  580. font-size: 30rpx;
  581. color: #ffffff;
  582. &::after {
  583. // content: '';
  584. // transition: .5s;
  585. // width: 19rpx;
  586. // height: 3rpx;
  587. // background: #FFFFFF;
  588. // position: absolute;
  589. // bottom: 19rpx;
  590. // left: 50%;
  591. // transform: translateX(-50%);
  592. }
  593. }
  594. }
  595. }
  596. .category {
  597. position: absolute;
  598. right: 0;
  599. top: 50%;
  600. width: 57rpx;
  601. height: 45rpx;
  602. padding-left: 11rpx;
  603. line-height: 45rpx;
  604. z-index: 10;
  605. transform: translateY(-50%);
  606. .iconfont {
  607. font-size: 35rpx;
  608. }
  609. &::before {
  610. content: '';
  611. position: absolute;
  612. top: 50%;
  613. left: 0;
  614. width: 2rpx;
  615. height: 28rpx;
  616. background: linear-gradient(135deg, #ffffff 0%, rgba(216, 216, 216, 0) 100%);
  617. transform: translateY(-50%);
  618. }
  619. }
  620. &.isFixed {
  621. z-index: 10;
  622. position: fixed;
  623. left: 0;
  624. width: 100%;
  625. }
  626. }
  627. .category_count {
  628. width: 100%;
  629. background: #fff;
  630. padding: 32rpx;
  631. position: fixed;
  632. top: 0;
  633. left: 0;
  634. z-index: 100;
  635. border-radius: 0 0 24rpx 24rpx;
  636. .cate_count {
  637. .category_item {
  638. padding: 0 20rpx;
  639. height: 72rpx;
  640. text-align: center;
  641. line-height: 72rpx;
  642. word-wrap: break-word;
  643. overflow: hidden;
  644. text-overflow: ellipsis;
  645. white-space: nowrap;
  646. background-color: #f5f5f5;
  647. border-radius: 8rpx;
  648. font-size: 24rpx;
  649. }
  650. }
  651. }
  652. .mask {
  653. position: fixed;
  654. top: 0;
  655. left: 0;
  656. width: 100%;
  657. height: 100%;
  658. background: rgba(0, 0, 0, 0.7);
  659. z-index: 22;
  660. }
  661. .scrolled {
  662. z-index: 99;
  663. position: fixed;
  664. left: 0;
  665. top: 0;
  666. width: 100%;
  667. background-color: #fff;
  668. .longItem,
  669. .click,
  670. .category text {
  671. color: #000 !important;
  672. }
  673. .underline {
  674. background: #000 !important;
  675. }
  676. .input,
  677. .uninput {
  678. background: rgba(0, 0, 0, 0.22) !important;
  679. }
  680. .click {
  681. &::after {
  682. background-color: #fff !important;
  683. }
  684. }
  685. }
  686. .swiperBg {
  687. z-index: 1;
  688. .page_swiper {
  689. position: relative;
  690. width: 100%;
  691. height: auto;
  692. margin: 0 auto;
  693. border-radius: 15rpx;
  694. overflow-x: hidden;
  695. z-index: 20;
  696. padding: 5rpx 10rpx 0;
  697. uni-swiper {
  698. height: 320rpx;
  699. }
  700. swiper-item {
  701. border-radius: 15rpx;
  702. }
  703. .swiper-item,
  704. image,
  705. .acea-row.row-between-wrapper {
  706. width: 100%;
  707. height: 100%;
  708. margin: 0 auto;
  709. border-radius: 15rpx;
  710. }
  711. swiper {
  712. width: 100%;
  713. display: block;
  714. }
  715. image {
  716. transform: scale(0.93);
  717. transition: all 0.6s ease;
  718. }
  719. swiper-item.active,
  720. swiper-item.scalex {
  721. image {
  722. transform: scale(1);
  723. }
  724. }
  725. /*用来包裹所有的小圆点 */
  726. .dots {
  727. // width: 156rpx;
  728. // height: 36rpx;
  729. display: flex;
  730. flex-direction: row;
  731. position: absolute;
  732. right: 20rpx;
  733. left: 20rpx;
  734. bottom: 23rpx;
  735. }
  736. /*未选中时的小圆点样式 */
  737. .dot1 {
  738. .dot {
  739. width: 12rpx;
  740. height: 12rpx;
  741. border-radius: 6rpx;
  742. margin-right: 16rpx;
  743. background-color: rgba(0, 0, 0, 0.1);
  744. &:last-child {
  745. margin-right: 0;
  746. }
  747. /*选中以后的小圆点样式 */
  748. &.active {
  749. background: #e93323;
  750. }
  751. }
  752. }
  753. .dot2 {
  754. .dot {
  755. width: 10rpx;
  756. height: 10rpx;
  757. border-radius: 5rpx;
  758. margin-right: 8rpx;
  759. background-color: rgba(0, 0, 0, 0.1);
  760. &:last-child {
  761. margin-right: 0;
  762. }
  763. /*选中以后的小圆点样式 */
  764. &.active {
  765. width: 18rpx;
  766. background: #e93323;
  767. }
  768. }
  769. }
  770. .dot4 {
  771. .dot {
  772. width: 20rpx;
  773. height: 6rpx;
  774. border-radius: 3rpx;
  775. margin-right: 10rpx;
  776. background-color: #dddddd;
  777. &:last-child {
  778. margin-right: 0;
  779. }
  780. /*选中以后的小圆点样式 */
  781. &.active {
  782. background: #e93323;
  783. }
  784. }
  785. }
  786. .dot3 {
  787. .dot {
  788. height: 6rpx;
  789. border-radius: 3rpx;
  790. margin-right: 10rpx;
  791. background-color: rgba(0, 0, 0, 0.1);
  792. &:last-child {
  793. margin-right: 0;
  794. }
  795. /*选中以后的小圆点样式 */
  796. .active {
  797. height: 6rpx;
  798. border-radius: 3rpx;
  799. background: #e93323;
  800. }
  801. }
  802. }
  803. }
  804. }
  805. /deep/.dot0 .uni-swiper-dots-horizontal {
  806. left: 10%;
  807. }
  808. /deep/.dot1 .uni-swiper-dots-horizontal {
  809. left: 50%;
  810. }
  811. /deep/.dot2 .uni-swiper-dots-horizontal {
  812. left: 90%;
  813. }
  814. </style>