index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. <template>
  2. <view>
  3. <public-module></public-module>
  4. <service-widget @btnClick="btn_click"></service-widget>
  5. <view class="header dis a-c j-s" :style="transitionStyle">
  6. <view class="city dis a-c ">
  7. <image src="../../static/image/index/img/cityicon.png" mode=""></image>
  8. <text>{{city}}</text>
  9. <image src="../../static/image/index/img/jiantou.png" mode="" style="width: 12px;height: 12px;"></image>
  10. </view>
  11. <view class="search" :style="{opacity:featureHideHandling?1:0}">
  12. <u-search :show-action="true" action-text="搜索" bg-color="#fff" maxlength="10" placeholder="请输入关键词"
  13. :clearabled="false" :action-style="{position: 'absolute',right:'10px'}" search-icon="0">
  14. </u-search>
  15. <image class="search-Scan" src="../../static/image/index/img/Scan.png" mode="" @click="scan">
  16. </image>
  17. </view>
  18. </view>
  19. <!-- 占位块 -->
  20. <view class="place"></view>
  21. <view class="swiperelement" :style="transitionStyle">
  22. <view class="swiper">
  23. <u-swiper :list="swiperlist" height="258" duration="400" interval="4000" mode="rect" border-radius="12"
  24. @change="swiperChange"></u-swiper>
  25. </view>
  26. </view>
  27. <view class="pagebody">
  28. <index-nav :resdata="categoryList" :row="featureHideHandling?2:1" @authModal="authModal"></index-nav>
  29. <template v-if="featureHideHandling">
  30. <u-tabs :list="itemCategorylist" :is-scroll="false" :current="current" @change="change"
  31. style="background: transparent;" active-color="#000"></u-tabs>
  32. <view class="mt-1 dis j-s a-c">
  33. <view class="activity dis f-c " @click="activity('/pages/index/checkIn')">
  34. <text>签到有礼</text>
  35. <text>福利多多</text>
  36. <image src="../../static/image/index/pick-img/1.png" mode="" style="width: 32px;height: 32px;">
  37. </image>
  38. </view>
  39. <view class="activity dis f-c " @click="activity('/pages/index/task')">
  40. <text>精彩任务</text>
  41. <text>奖励多多</text>
  42. <image src="../../static/image/index/pick-img/2.png" mode="" style="width: 36px;height: 32px;">
  43. </image>
  44. </view>
  45. <view class="activity dis f-c " @click="activity('/pages/index/flashSale')">
  46. <text>限时秒杀</text>
  47. <text>9.9元起</text>
  48. <image src="../../static/image/index/pick-img/3.png" mode="" style="width: 32px;height: 32px;">
  49. </image>
  50. </view>
  51. </view>
  52. <view class="mt-3 dis j-s ">
  53. <view class="flashSale dis f-c">
  54. <image class="bg1" src="../../static/image/index/pick-img/bg1.png" mode=""></image>
  55. <view class="title dis j-s">
  56. <image src="../../static/image/index/pick-img/4.png" mode="widthFix"
  57. style="width: 73px;height: 25px;"></image>
  58. <view class="dis a-c">
  59. <image src="../../static/image/index/pick-img/loding.png" mode=""
  60. style="width: 12px;height: 12px;"></image>
  61. <text>换一批</text>
  62. </view>
  63. </view>
  64. <view class="dis j-s a-c mt-2">
  65. <image src="../../static/image/index/pick-img/5.png" mode=""
  66. style="width: 56px;height: 56px;">
  67. </image>
  68. <image src="../../static/image/index/pick-img/8.png" mode=""
  69. style="width: 80px;height: 56px;">
  70. </image>
  71. </view>
  72. <view class="dis j-s a-c mt-2">
  73. <image src="../../static/image/index/pick-img/6.png" mode=""
  74. style="width: 56px;height: 56px;">
  75. </image>
  76. <image src="../../static/image/index/pick-img/9.png" mode=""
  77. style="width: 80px;height: 56px;">
  78. </image>
  79. </view>
  80. <view class="dis j-s a-c mt-2">
  81. <image src="../../static/image/index/pick-img/7.png" mode=""
  82. style="width: 56px;height: 56px;">
  83. </image>
  84. <image src="../../static/image/index/pick-img/8.png" mode=""
  85. style="width: 80px;height: 56px;">
  86. </image>
  87. </view>
  88. </view>
  89. <view class="hotSaleList dis f-c">
  90. <image class="bg1" src="../../static/image/index/pick-img/bg2.png" mode=""></image>
  91. <view class="title dis j-s">
  92. <text style="font-size: 17px;color: #333;font-weight: bold;">热销榜</text>
  93. <view class="dis a-c">
  94. <image src="../../static/image/index/pick-img/loding.png" mode=""
  95. style="width: 12px;height: 12px;"></image>
  96. <text>换一批</text>
  97. </view>
  98. </view>
  99. <view class="mt-2 dis a-c j-s content" style="position: relative;">
  100. <image src="../../static/image/index/pick-img/10.png" mode=""
  101. style="width: 53px;height: 53px;margin-right: 8px;">
  102. </image>
  103. <view class="dis f-c " style="width: 55%;">
  104. <text style="font-size: 12px;color: #333;line-height: 1.2;">车仆后视镜弹水剂 新升级...</text>
  105. <text style="color: #FF476C;font-size: 12px;">¥ <text
  106. style="font-size: 15px;font-weight: bold;line-height: 1.2;">79</text> </text>
  107. </view>
  108. </view>
  109. <view class="mt-2 dis a-c j-s " style="position: relative;">
  110. <image src="../../static/image/index/pick-img/11.png" mode=""
  111. style="width: 53px;height: 53px;margin-right: 8px;">
  112. </image>
  113. <view class="dis f-c " style="width: 55%;">
  114. <text style="font-size: 12px;color: #333;line-height: 1.2;">朗龙汽车香水车载香薰摆...</text>
  115. <text style="color: #FF476C;font-size: 12px;">¥ <text
  116. style="font-size: 15px;font-weight: bold; line-height: 1.2;">65.9</text> </text>
  117. </view>
  118. </view>
  119. <view class=" dis a-c j-s mt-2" style="position: relative;">
  120. <image src="../../static/image/index/pick-img/12.png" mode=""
  121. style="width: 53px;height: 53px;margin-right: 8px;">
  122. </image>
  123. <view class="dis f-c a-start " style="width: 55%;">
  124. <text style="font-size: 12px;color: #333;line-height: 1.2;">新车除甲醛除异味车内除...</text>
  125. <text style="color: #FF476C;font-size: 12px;">¥ <text
  126. style="font-size: 15px;font-weight: bold;line-height: 1.2;">29.5</text> </text>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </template>
  132. </view>
  133. <auth-Modal :authShow="authShow" @btnClick="authShow=false" @maskClick="authShow=false"></auth-Modal>
  134. </view>
  135. </template>
  136. <script>
  137. import authModal from '@/components/modules/user/authModal.vue'; //实名认证弹窗
  138. import swiperImage from "@/components/modules/index/swiper-image.vue"
  139. import indexNav from "@/components/modules/index/index-nav.vue"
  140. import bankBin from "@/common/bankcardinfo.js"
  141. import store from '@/store';
  142. import {
  143. pathToBase64,
  144. base64ToPath
  145. } from '@/common/image-tools-base64.js';
  146. import {
  147. mapState
  148. } from "vuex"
  149. import base from '@/config/baseUrl';
  150. export default {
  151. components: {
  152. swiperImage,
  153. indexNav,
  154. authModal,
  155. },
  156. data() {
  157. return {
  158. itemCategorylist: [{
  159. name: '推荐'
  160. }, {
  161. name: '美食'
  162. }, {
  163. name: '玩乐',
  164. }, {
  165. name: '出游',
  166. }, {
  167. name: '亲子',
  168. },
  169. {
  170. name: '运动',
  171. }
  172. ],
  173. current: 0,
  174. authShow: false,
  175. locationshow: false,
  176. avatar: "",
  177. xuelishow: false,
  178. border: false,
  179. form: {
  180. name: "", //姓名
  181. identity: "", //身份证号
  182. birthday: "", //出生日期
  183. addressnow: "", //居住地址
  184. education: "", //学历
  185. bankname: "", //开户行
  186. accountno: "", //银行卡号
  187. },
  188. labelPosition: 'left',
  189. errorType: ['message'],
  190. rules: {
  191. name: [{
  192. required: true,
  193. message: '请输入姓名',
  194. trigger: 'blur',
  195. }, ]
  196. },
  197. contentSlot: true,
  198. showTitle: false,
  199. asyncClose: false,
  200. isShow: false,
  201. banben: {},
  202. bgColor: "#4B75EB",
  203. //轮播
  204. categoryList: [{
  205. cat_id: 0,
  206. img: '/static/image/index/category-img/1.png',
  207. title: '车险',
  208. src: '/pages/carInsure/entry',
  209. width: '92rpx',
  210. height: '69rpx',
  211. },
  212. {
  213. cat_id: 1,
  214. img: '/static/image/index/category-img/2.png',
  215. title: '车损测算',
  216. width: '92rpx',
  217. height: '69rpx',
  218. // src: '/pages/carInsure2/entry'
  219. },
  220. {
  221. cat_id: 2,
  222. img: '/static/image/index/category-img/3.png',
  223. title: '道路救援',
  224. // src: '/pages/roadRescue/index',
  225. width: '92rpx',
  226. height: '69rpx',
  227. },
  228. {
  229. cat_id: 3,
  230. img: '/static/image/index/category-img/4.png',
  231. title: '司法鉴定',
  232. width: '92rpx',
  233. height: '69rpx',
  234. src: '',
  235. },
  236. {
  237. cat_id: 4,
  238. img: '/static/image/index/category-img/5.png',
  239. title: '掌柜商城',
  240. width: '92rpx',
  241. height: '69rpx',
  242. // src: '/pages/shoppingMall/index'
  243. },
  244. {
  245. cat_id: 5,
  246. img: '/static/image/index/category-img/6.png',
  247. title: '洗车',
  248. width: '68rpx',
  249. height: '68rpx',
  250. // src: '/pages/carWash/carWash'
  251. },
  252. {
  253. cat_id: 6,
  254. img: '/static/image/index/category-img/7.png',
  255. title: '车检代办',
  256. width: '68rpx',
  257. height: '68rpx',
  258. // src: '/pages/caragent/index'
  259. },
  260. {
  261. cat_id: 7,
  262. img: '/static/image/index/category-img/8.png',
  263. title: '审车',
  264. width: '68rpx',
  265. height: '68rpx',
  266. src: ''
  267. },
  268. {
  269. cat_id: 8,
  270. img: '/static/image/index/category-img/9.png',
  271. title: '代驾',
  272. width: '68rpx',
  273. height: '68rpx',
  274. src: ''
  275. },
  276. {
  277. cat_id: 9,
  278. img: '/static/image/index/category-img/10.png',
  279. title: '一键挪车',
  280. width: '68rpx',
  281. height: '68rpx',
  282. // src: '/pages/ticket/ticket'
  283. }
  284. ],
  285. //推荐商品 3个
  286. pickList: [{
  287. goods_id: 0,
  288. img: '../../static/image/index/pick-img/1.png',
  289. price: '25.8元',
  290. slogan: [{
  291. name: "明星产品",
  292. back: "rgba(255,153,0,0.1)",
  293. color: "#FF9900"
  294. },
  295. {
  296. name: "刚需保障",
  297. back: "rgba(255,46,0,0.1)",
  298. color: "#FF2E00"
  299. },
  300. {
  301. name: "专家推荐",
  302. back: "rgba(0,82,255,0.1)",
  303. color: "#0052FF"
  304. }
  305. ],
  306. sum: "1235",
  307. title: "平安个人意外险"
  308. },
  309. {
  310. goods_id: 1,
  311. img: '../../static/image/index/pick-img/2.png',
  312. price: '88元',
  313. sum: "588",
  314. slogan: [{
  315. name: "专家推荐",
  316. back: "rgba(0,82,255,0.1)",
  317. color: "#0052FF"
  318. }],
  319. title: "儿童综合医疗保险"
  320. },
  321. {
  322. goods_id: 0,
  323. img: '../../static/image/index/pick-img/1.png',
  324. price: '25.8元',
  325. slogan: [{
  326. name: "明星产品",
  327. back: "rgba(255,153,0,0.1)",
  328. color: "#FF9900"
  329. },
  330. {
  331. name: "刚需保障",
  332. back: "rgba(255,46,0,0.1)",
  333. color: "#FF2E00"
  334. },
  335. {
  336. name: "专家推荐",
  337. back: "rgba(0,82,255,0.1)",
  338. color: "#0052FF"
  339. }
  340. ],
  341. sum: "1235",
  342. title: "平安行.国内自助游旅行意..."
  343. },
  344. {
  345. goods_id: 1,
  346. img: '../../static/image/index/pick-img/2.png',
  347. price: '88元',
  348. sum: "588",
  349. slogan: [{
  350. name: "专家推荐",
  351. back: "rgba(0,82,255,0.1)",
  352. color: "#0052FF"
  353. }],
  354. title: "平安行.境内节假日出行意..."
  355. },
  356. ],
  357. swiperlist: [{
  358. image: '/static/image/index/ad-img/ad1.png',
  359. backgroundColor: '#3385F5'
  360. },
  361. {
  362. image: '/static/image/index/ad-img/ad2.png',
  363. backgroundColor: '#F5B333'
  364. },
  365. {
  366. image: '/static/image/index/ad-img/ad3.png',
  367. backgroundColor: '#FF6591'
  368. }
  369. ],
  370. headerPosition: "fixed",
  371. getApplicationStatus: "",
  372. socketOpen: false,
  373. latitude: "",
  374. longitude: "",
  375. province: "",
  376. city: "",
  377. district: "",
  378. street: "",
  379. streetNum: "",
  380. poiName: "",
  381. cityCode: "",
  382. messageInterval: null,
  383. transitionStyle: {
  384. backgroundColor: '#3385F5',
  385. }
  386. };
  387. },
  388. async onLoad() {},
  389. computed: {
  390. ...mapState(['userInfo', 'featureHideHandling'])
  391. },
  392. onPageScroll(e) {
  393. //兼容iOS端下拉时顶部漂移
  394. if (e.scrollTop >= 0) {
  395. this.headerPosition = "fixed";
  396. } else {
  397. this.headerPosition = "absolute";
  398. }
  399. },
  400. onShow() {
  401. this.loginUser();
  402. if (this.userInfo.sysUser.headSculpture) {
  403. this.avatar = this.$base.baseUrl + this.userInfo.sysUser.headSculpture;
  404. } else {
  405. this.avatar = "/static/image/my/avatar1.png"
  406. }
  407. const arr = uni.getStorageSync('historyInfo');
  408. if (arr) {
  409. uni.removeStorageSync('historyInfo');
  410. }
  411. this.initializeCategoryList();
  412. // #ifdef APP-PLUS
  413. // this.getCurrentLocation();
  414. // this.soketInit();
  415. // #endif
  416. },
  417. async onPullDownRefresh() {
  418. await this.loginUser();
  419. uni.stopPullDownRefresh();
  420. },
  421. methods: {
  422. initializeCategoryList() {
  423. this.categoryList.map(val => {
  424. if (!val.src) {
  425. val["featureHideHandling"] = this.featureHideHandling;
  426. } else {
  427. val["featureHideHandling"] = true;
  428. }
  429. return val;
  430. })
  431. },
  432. activity(url) {
  433. uni.navigateTo({
  434. url: url,
  435. })
  436. },
  437. change(index) {
  438. this.current = index;
  439. },
  440. swiperChange(index) {
  441. let color = this.swiperlist.find((val, ele) => ele == index);
  442. this.transitionStyle.backgroundColor = color.backgroundColor;
  443. },
  444. async loginUser() {
  445. let userInfoRes = await this.$http.get('/user/loginUser')
  446. store.commit('setUserModules', {
  447. title: 'userInfo',
  448. data: {
  449. sysUser: {
  450. ...userInfoRes.data
  451. }
  452. }
  453. })
  454. },
  455. authModal(res) {
  456. this.authShow = res;
  457. },
  458. btn_click() {
  459. uni.navigateTo({
  460. url: '/pages/chat/chat'
  461. })
  462. },
  463. //初始化websoket连接
  464. // soketInit() {
  465. // uni.connectSocket({
  466. // url: base.socketUrl + '/' + this.userInfo.sysUser.id,
  467. // method: 'GET',
  468. // });
  469. // uni.onSocketOpen((res) => {
  470. // console.log(res, '已打开');
  471. // this.socketOpen = true;
  472. // this.sendMessage();
  473. // });
  474. // },
  475. //发送信息
  476. // sendMessage() {
  477. // if (this.longitude) {
  478. // const dataToSend = {
  479. // userId: this.userInfo.sysUser.id,
  480. // longitude: this.longitude,
  481. // latitude: this.latitude,
  482. // province: this.province,
  483. // city: this.city,
  484. // district: this.district,
  485. // street: this.street,
  486. // streetNum: this.streetNum,
  487. // poiName: this.poiName,
  488. // cityCode: this.cityCode
  489. // };
  490. // console.log("首次消息", dataToSend);
  491. // if (this.socketOpen) {
  492. // uni.sendSocketMessage({
  493. // data: JSON.stringify(dataToSend)
  494. // })
  495. // if (this.messageInterval) {
  496. // clearInterval(this.messageInterval);
  497. // }
  498. // this.messageInterval = setInterval(async () => {
  499. // await this.getCurrentLocation();
  500. // await this.updatesendMessage();
  501. // }, 120000); // 120000毫秒 = 2分钟
  502. // }
  503. // }
  504. // },
  505. getCurrentLocation() {
  506. //获取当前的地理位置
  507. let vthis = this;
  508. uni.getStorage({
  509. key: 'location',
  510. success: function(res) {
  511. vthis.latitude = res.data.latitude;
  512. vthis.longitude = res.data.longitude;
  513. vthis.province = res.data.province;
  514. vthis.city = res.data.city;
  515. vthis.district = res.data.district;
  516. vthis.street = res.data.street;
  517. vthis.streetNum = res.data.streetNum;
  518. vthis.poiName = res.data.poiName;
  519. vthis.cityCode = res.data.cityCode;
  520. }
  521. });
  522. },
  523. updatesendMessage() {
  524. const dataToSend = {
  525. userId: this.userInfo.sysUser.id,
  526. longitude: this.longitude,
  527. latitude: this.latitude,
  528. province: this.province,
  529. city: this.city,
  530. district: this.district,
  531. street: this.street,
  532. streetNum: this.streetNum,
  533. poiName: this.poiName,
  534. cityCode: this.cityCode
  535. };
  536. console.log("持续消息", dataToSend);
  537. if (this.socketOpen) {
  538. uni.sendSocketMessage({
  539. data: JSON.stringify(dataToSend)
  540. })
  541. }
  542. },
  543. back() {
  544. uni.navigateTo({
  545. url: '/pages/carInsure/entry',
  546. })
  547. },
  548. nameClick() {
  549. this.navigate({
  550. url: "/pages/realname/realname"
  551. }, "navigateTo", true)
  552. },
  553. async chooseImage() {
  554. var _this = this;
  555. uni.chooseImage({
  556. count: 1,
  557. sizeType: "compressed",
  558. success(res) {
  559. pathToBase64(res.tempFilePaths[0])
  560. .then(async base64 => {
  561. var paramImg = {
  562. "image": base64, //图片base64
  563. "imgType": "1" //1身份证 2行驶证
  564. }
  565. let res2 = await _this.$http.post('/api/huanong/imgAI', paramImg);
  566. var data = res2.data.customerInfo;
  567. data.identifyValidDate = data.identifyValidDate.substr(0, 4) + '-' +
  568. data.identifyValidDate.substr(4, 2) + "-" + data.identifyValidDate
  569. .substr(6, 2)
  570. _this.form.name = data.name;
  571. _this.form.identifyNumber = data.identifyNumber;
  572. _this.form.identifyValidDate = data.identifyValidDate;
  573. })
  574. }
  575. });
  576. },
  577. //扫一扫
  578. scan() {
  579. uni.scanCode({
  580. success: async (res) => {
  581. let uuid = this.getParameterByName("uuid", res.result)
  582. let resCode = await this.$http.get('/scanQrCode?uuid=' + uuid);
  583. }
  584. });
  585. },
  586. //搜索跳转
  587. toSearch() {
  588. // uni.showToast({title: "建议跳转到新页面做搜索功能"});
  589. },
  590. //推荐商品跳转
  591. toPick(e) {
  592. // uni.showToast({title: '推荐商品'+e.goods_id});
  593. },
  594. //商品跳转
  595. toGoods(e) {
  596. // uni.showToast({title: '商品'+e.goods_id});
  597. },
  598. getParameterByName(name, url) {
  599. if (!url) url = window.location.href;
  600. name = name.replace(/[\[\]]/g, '\\$&');
  601. var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
  602. results = regex.exec(url);
  603. if (!results) return null;
  604. if (!results[2]) return '';
  605. return decodeURIComponent(results[2].replace(/\+/g, ' '));
  606. }
  607. }
  608. };
  609. </script>
  610. <style lang="scss" scoped>
  611. @import '@/style/mixin.scss';
  612. /deep/ {
  613. .u-tab-bar {
  614. background: linear-gradient(90deg, rgba(245, 128, 71, 0.8) 20%, rgba(242, 49, 78, 1) 100%) !important;
  615. border-radius: 4px 4px 4px 4px;
  616. }
  617. .u-content {
  618. padding-left: 40px;
  619. }
  620. .u-indicator-item-rect-active {
  621. background-color: #fff;
  622. }
  623. .u-indicator-item-rect {
  624. border-radius: 2px;
  625. height: 3px;
  626. }
  627. }
  628. page {
  629. background-color: #EEF1F7;
  630. }
  631. .status {
  632. width: 100%;
  633. height: 0;
  634. /* #ifdef APP-PLUS */
  635. height: var(--status-bar-height);
  636. /* #endif */
  637. position: fixed;
  638. top: 0;
  639. z-index: 999;
  640. }
  641. .header {
  642. width: 100%;
  643. display: flex;
  644. position: fixed;
  645. left: 0;
  646. right: 0;
  647. z-index: 996;
  648. padding: 60px 16px 16px;
  649. transition: background-color 0.5s;
  650. .city {
  651. color: #fff;
  652. font-size: 15px;
  653. image {
  654. width: 22px;
  655. height: 22px;
  656. }
  657. text {
  658. color: #fff;
  659. font-size: 13px;
  660. margin: 0 5px;
  661. }
  662. .icon {
  663. font-size: 10px;
  664. margin-left: 5px;
  665. }
  666. }
  667. .search {
  668. position: relative;
  669. width: 70%;
  670. .search-Scan {
  671. width: 20px;
  672. height: 20px;
  673. position: absolute;
  674. left: 10px;
  675. top: 0;
  676. bottom: 0;
  677. margin: auto;
  678. padding-right: 5px;
  679. ::after {
  680. content: "";
  681. width: 0px;
  682. height: 13px;
  683. border: 1px solid #DDDDDD;
  684. position: absolute;
  685. right: 0;
  686. top: 0;
  687. bottom: 0;
  688. margin: auto;
  689. }
  690. }
  691. }
  692. }
  693. .swiperelement {
  694. height: 70px;
  695. border-radius: 0px 0px 20px 0px;
  696. padding: 10px 12px 0;
  697. position: relative;
  698. transition: background-color 0.5s;
  699. /* 渐变效果 */
  700. ::after {
  701. content: "";
  702. display: table;
  703. clear: both;
  704. }
  705. .swiper {
  706. height: 258rpx;
  707. box-shadow: 0px 2px 5px 0px rgba(95, 107, 132, 0.2);
  708. position: absolute;
  709. left: 12px;
  710. right: 12px;
  711. top: 10px;
  712. border-radius: 6px;
  713. border-bottom: 1px solid #E2E6EC;
  714. }
  715. }
  716. .pagebody {
  717. padding: 83px 12px 12px;
  718. height: calc(100vh - 180px);
  719. background-color: #F8F8FA;
  720. .activity {
  721. width: 31.5%;
  722. background: #FFFFFF;
  723. box-shadow: 0px 1px 3px 0px rgba(95, 107, 132, 0.05);
  724. padding: 8px;
  725. border-radius: 6px;
  726. position: relative;
  727. text:nth-child(1) {
  728. font-size: 14px;
  729. color: #333333;
  730. font-weight: bold;
  731. }
  732. text:nth-child(2) {
  733. font-size: 12px;
  734. color: #999;
  735. }
  736. image {
  737. position: absolute;
  738. right: 0;
  739. bottom: 0;
  740. }
  741. }
  742. .flashSale {
  743. width: 48.5%;
  744. background: #FFFFFF;
  745. box-shadow: 0px 2px 5px 0px rgba(95, 107, 132, 0.05);
  746. border-radius: 6px;
  747. position: relative;
  748. padding: 8px;
  749. .bg1 {
  750. position: absolute;
  751. top: 0;
  752. left: 0;
  753. width: 100%;
  754. height: 67px;
  755. }
  756. .title {
  757. position: relative;
  758. text {
  759. font-size: 22rpx;
  760. color: #999;
  761. margin-left: 3px;
  762. }
  763. }
  764. }
  765. .hotSaleList {
  766. width: 48.5%;
  767. background: #FFFFFF;
  768. box-shadow: 0px 2px 5px 0px rgba(95, 107, 132, 0.05);
  769. border-radius: 6px;
  770. position: relative;
  771. padding: 8px;
  772. .bg1 {
  773. position: absolute;
  774. top: 0;
  775. left: 0;
  776. width: 100%;
  777. height: 67px;
  778. }
  779. .title {
  780. position: relative;
  781. text {
  782. font-size: 22rpx;
  783. color: #999;
  784. margin-left: 3px;
  785. }
  786. }
  787. }
  788. }
  789. /* 占位 */
  790. .place {
  791. height: 108px;
  792. }
  793. .goods-list {
  794. background-color: #f4f4f4;
  795. }
  796. .goods-list .title {
  797. width: 100%;
  798. display: flex;
  799. justify-content: center;
  800. align-items: center;
  801. height: 60upx;
  802. color: #979797;
  803. font-size: 24upx;
  804. }
  805. .goods-list .loading-text {
  806. width: 100%;
  807. display: flex;
  808. justify-content: center;
  809. align-items: center;
  810. height: 60upx;
  811. color: #979797;
  812. font-size: 24upx;
  813. }
  814. .goods-list .product-list {
  815. padding: 0 2.5% 2.5vw 2.5%;
  816. display: flex;
  817. justify-content: space-between;
  818. flex-wrap: wrap;
  819. }
  820. .goods-list .product-list .product {
  821. width: 48.75%;
  822. border-radius: 20upx;
  823. background-color: #fff;
  824. margin: 0 0 15upx 0;
  825. }
  826. .goods-list .product-list .product image {
  827. width: 100%;
  828. border-radius: 20upx 20upx 0 0;
  829. }
  830. .goods-list .product-list .product .name {
  831. width: 92%;
  832. padding: 10upx 4%;
  833. display: -webkit-box;
  834. -webkit-box-orient: vertical;
  835. -webkit-line-clamp: 1;
  836. text-align: justify;
  837. overflow: hidden;
  838. font-size: 30upx;
  839. }
  840. .goods-list .product-list .product .info {
  841. display: flex;
  842. justify-content: space-between;
  843. align-items: flex-end;
  844. width: 92%;
  845. padding: 10upx 4% 10upx 4%;
  846. }
  847. .goods-list .product-list .product .info .price {
  848. color: #e65339;
  849. font-size: 30upx;
  850. font-weight: 600;
  851. }
  852. .goods-list .product-list .product .info .slogan {
  853. color: #807c87;
  854. font-size: 24upx;
  855. }
  856. </style>