耀实惠小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1022 lines
25 KiB

  1. <template>
  2. <view class="home">
  3. <u-sticky>
  4. <view class="theme-bg">
  5. <status-bar></status-bar>
  6. <view class="home-address flex align-center p-l-28 p-r-28" :style="[addressStyle]" @click="toReceiving">
  7. <view class="m-r-14"><u-icon size="40" name="map-fill" color="#fff"></u-icon></view>
  8. <view class="home-address-name text-ellipsis">{{location.type === 'shop' ? `站点:${location.name}` : location.shippingAddress}}</view>
  9. <view class="home-address-switch flex align-center text-white font-28">
  10. <text class="p-l-10 p-r-10">|</text>
  11. <text>切换</text>
  12. <u-icon size="40" name="arrow-right" color="#fff"></u-icon>
  13. </view>
  14. </view>
  15. <view class="home-search"><u-search disabled placeholder="请输入要搜索的商品" height="70" :show-action="false" @click="handleSearch" /></view>
  16. </view>
  17. </u-sticky>
  18. <view class="home-banner position-relative p-l-28 p-r-28">
  19. <u-swiper height="270" :list="bannerList" @click="bannerClick"></u-swiper>
  20. <view class="home-banner-bg position-absolute top-0 theme-bg"></view>
  21. </view>
  22. <!-- 排排 -->
  23. <view class="home-notice flex align-center m-t-20 " v-for="(item_no,index) in noticeList" @click="todetail(index)">
  24. <view class="home-notice-image"><image :src="IMG_URL + 'notice.png'" mode="widthFix"></image></view>
  25. <u-notice-bar
  26. @click="todetail"
  27. class="flex-1"
  28. :volume-icon="false"
  29. type="primary"
  30. color="#01AEEA"
  31. bg-color="#e0ffff"
  32. mode="horizontal"
  33. :list="item_no"
  34. />
  35. </view>
  36. <view class="home-grid m-t-60 flex align-center flex-wrap">
  37. <view class="home-grid-item flex flex-column align-center justify-between m-b-30" v-for="(item,index) in gridList" :key="item.id" @click="toPage(item.url,item.id,item)">
  38. <view class="home-grid-img flex align-center justify-center">
  39. <image style="max-width: 80rpx; max-height: 80rpx;" :src="item.image" mode="widthFix"></image>
  40. </view>
  41. <text class="font-30 text-black" style="font-weight: 500;" v-show="item.alt">{{ item.alt }}</text>
  42. <text class="font-30 text-black" style="font-weight: 500;">{{ item.title }}</text>
  43. <text class="font-30 text-black" style="font-weight: 500;">{{ item.concert }}</text>
  44. <u-badge :offset="[-20,10]" type="error" :count="item.icon"></u-badge>
  45. </view>
  46. </view>
  47. <view class="home-goods m-t-10">
  48. <view class="home-goods-header m-b-20" v-if="imgAbout"><image :src="imgAbout" mode="widthFix"></image></view>
  49. <view v-for="(item,index) in goodsList" :key="index">
  50. <goods-item :goods="item" thereTo='home'></goods-item>
  51. </view>
  52. </view>
  53. <!-- @click="showTabber" -->
  54. <view class="bg" v-if="show && Object.keys(userInfo).length > 0" catchtouchmove="return">
  55. <!-- 开通会员 -->
  56. <view class="merber_pass" v-if="showBtn && userInfo.level == 0">
  57. <view class="img_merber_pass" :style="'background-image: url('+IMG_URL+'menberPass.png);'">
  58. <text class="btn_click_pass" @click="toPageMenber">立即开通</text>
  59. </view>
  60. <u-icon name="close" color="#fff" size="50rpx" @click="closeBtn"></u-icon>
  61. </view>
  62. <!-- 礼包 -->
  63. <view v-for="(item,index) in packet_list" :key="item.id">
  64. <view class="gift_box" v-if="select_index == index && !showBtn" >
  65. <view class="gift" :style="'background-image: url('+IMG_URL+'gift.png);'">
  66. <text class="one" v-if="item.type == 0">新人大礼包限X日内领取</text>
  67. <text class="two" v-if="item.type == 0">优惠券X张</text>
  68. <text class="top_one" v-if="item.type !== 0">恭喜您获得</text>
  69. <text class="three" v-if="item.type == 0">(满100减50</text>
  70. <!-- item.type == 0 || item.type == 0 || -->
  71. <text :class="item.type ==2?'four1':'four'" v-if="item.type == 2">兑换金{{item.intger}}</text>
  72. <text :class="item.type ==3?'four1':'five'" v-if="item.type == 3">消费金{{item.consumption}}</text>
  73. <view class="six flex flex-column" v-if="item.type !== 0">
  74. <text>活动时间</text>
  75. <text class="font-32" >{{item.startTime.substr(0,10)}}</text>
  76. <text class="font-32">{{item.endTime.substr(0,10)}}</text>
  77. </view>
  78. <text class="getRedPacketBtn" @click="getRedPacketIndex(item)">{{item.type ==0? '领取新人大礼包': '领取'}}</text>
  79. </view>
  80. <u-icon name="close" color="#fff" size="50rpx" @click="close" class="m-t-40"></u-icon>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import { IMG_URL } from '@/env.js'
  88. import QQMapWX from '@/plugin/map/qqmap-wx-jssdk.min.js'
  89. import { MAP_KEY } from '@/config/settings.js'
  90. export default {
  91. data() {
  92. return {
  93. IMG_URL,
  94. // config,
  95. imgAbout: '',
  96. bannerList: [],
  97. noticeList: [],
  98. gridList: [],
  99. goodsList: [],
  100. show: true,
  101. showBtn: true,
  102. select_index: 0,
  103. packet_list: [],
  104. isLock: true,
  105. // userInfo: {},
  106. qqmapsdk: '',
  107. //分页
  108. pageNo: 1,
  109. pageSize: 10,
  110. total: null,
  111. isLock: true,
  112. userLocation: true,
  113. noticeListOld: [],
  114. isFrist: 0, // 为0 第一次进入 1 第一次登录是进入 2 切换
  115. };
  116. },
  117. onPullDownRefresh() {
  118. this.orderList = [];
  119. this.pageNo = 1;
  120. this.total = null;
  121. this.isLock = true;
  122. this.getGoodsList()
  123. },
  124. onReachBottom() {
  125. if(this.isLock){
  126. this.isLock = false;
  127. console.log(this.total !== null,this.pageNo * this.pageSize >= this.total, this.total)
  128. if(this.total !== null && this.pageNo * this.pageSize >= this.total){
  129. this.$Toast('没有更多数据了哦!');
  130. setTimeout(()=>{
  131. this.isLock = true;
  132. },3000)
  133. return
  134. }
  135. this.pageNo+=1;
  136. this.getGoodsList();
  137. }
  138. },
  139. onLoad() {
  140. this.qqmapsdk = new QQMapWX({
  141. key: MAP_KEY // 必填
  142. })
  143. // this.getAddress()
  144. uni.showLoading()
  145. // 调用 getUserInfo 原因 第一进来获取不到用户的缓存 所以只能调用接口 来确定是否要展示 立即开通会员
  146. Promise.all([ this.getBanner(), this.getNotice(), this.getHomeButton(), this.getGoodsList()])
  147. .then(() => {
  148. uni.hideLoading()
  149. })
  150. .catch(err => {
  151. uni.hideLoading()
  152. this.$Toast(err)
  153. })
  154. this.imageOne();
  155. // 关闭uploadAddress
  156. uni.$off('uploadAddress');
  157. // 禁止获取站点 ,影响用户体验
  158. // uni.$once('uploadAddress', () => {
  159. // uni.showLoading()
  160. // this.getAddressList()
  161. // })
  162. },
  163. onShow() {
  164. this.userToken && this.getUserInfo()
  165. },
  166. computed: {
  167. location () {
  168. return this.$store.state.location
  169. },
  170. userInfo () {
  171. return this.$store.state.userInfo
  172. },
  173. userToken () {
  174. return this.$store.state.userToken
  175. },
  176. isLogin () {
  177. return this.$store.state.userToken
  178. },
  179. addressStyle () {
  180. // #ifdef H5
  181. let menuButtonInfo = {}
  182. // #endif
  183. // #ifdef MP-WEIXIN
  184. let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  185. // #endif
  186. let systemInfo = uni.getSystemInfoSync()
  187. let { height, left, top } = menuButtonInfo
  188. let marginTop = top - systemInfo.statusBarHeight
  189. return {
  190. height: `${height}px`,
  191. marginTop: `${marginTop}px`,
  192. width: `${left}px`,
  193. }
  194. }
  195. },
  196. methods: {
  197. // 开通会员关闭按钮
  198. closeBtn(){
  199. this.showBtn = false;
  200. if(this.packet_list.length == 0){
  201. this.show = false;
  202. wx.showTabBar();
  203. }
  204. },
  205. close(){
  206. this.show = false;
  207. wx.showTabBar();
  208. },
  209. // 有token才获取地址 在调取用户信息的时候调取保证有token
  210. getAddressInfo () {
  211. uni.getSetting({
  212. success: settingInfo => {
  213. console.log(settingInfo)
  214. if (!settingInfo.authSetting.hasOwnProperty('scope.userLocation')) return
  215. if (!settingInfo.authSetting['scope.userLocation'] && !this.userLocation) {
  216. uni.showModal({
  217. title: '获取位置失败',
  218. content: '请允许使用您的位置,否则无法获取附件站点',
  219. confirmText: '去设置',
  220. success: res => {
  221. if (res.confirm) {
  222. uni.openSetting({
  223. success: openSttingInfo => {
  224. if (openSttingInfo.authSetting['scope.userLocation']) {
  225. this.getAddress()
  226. this.userLocation = true
  227. } else {
  228. this.userLocation = false
  229. }
  230. }
  231. })
  232. } else {
  233. // this.isLogin && this.getAddressList()
  234. }
  235. },
  236. fail: () => {
  237. // this.isLogin && this.getAddressList()
  238. }
  239. })
  240. } else {
  241. this.userLocation = true
  242. }
  243. }
  244. })
  245. },
  246. // 点击公告 跳入详情页
  247. todetail(index){
  248. console.log(index)
  249. this.$tools.navigateTo({
  250. url: `/pagesC/noticeDetail/noticeDetail?id=${this.noticeListOld[index].id}`
  251. })
  252. },
  253. // 相关图片
  254. imageOne() {
  255. this.$api('imageOne',{url: 'pages/home/home'}).then(res => {
  256. let {code, result, message} = res;
  257. if(code == 200) {
  258. this.imgAbout = result.image;
  259. }else {
  260. this.$Toast(message);
  261. }
  262. }).catch(err => {
  263. this.$Toast(err.message);
  264. })
  265. },
  266. // 获取用户信息 是否展示 立即开通会员
  267. getUserInfo () {
  268. return new Promise((resolve, reject) => {
  269. this.$api('getUserInfo').then(res => {
  270. let { code, result, message} = res;
  271. if(code == 200){
  272. let userInfo = {...result.account, ...result.userInfo }
  273. this.userInfo = userInfo
  274. // 更新用户信息缓存
  275. this.$storage.setStorage("__user_info", userInfo)
  276. // this.getAddressInfo();
  277. !this.$store.state.location.name && this.getAddress()
  278. this.isFrist++
  279. console.log(this.isFrist)
  280. if(this.isFrist == 1){
  281. this.toPassMerber();
  282. this.getRedPacket();
  283. }
  284. resolve()
  285. }else {
  286. reject(message)
  287. }
  288. }).catch(err => {
  289. reject(err.message)
  290. })
  291. })
  292. },
  293. // 获取地址
  294. getAddress() {
  295. uni.authorize({
  296. scope: 'scope.userLocation',
  297. success: () => {
  298. uni.getLocation({
  299. type: 'wgs84',
  300. success: res => {
  301. this.qqmapsdk.reverseGeocoder({
  302. location: {
  303. latitude: res.latitude,
  304. longitude: res.longitude
  305. },
  306. success: (location) => {
  307. this.userLocation = true
  308. let {result} = location
  309. let userInfo = { ...this.$store.state.userInfo, address: result.formatted_addresses.recommend, longitude: res.longitude, latitude: res.latitude, }
  310. this.$store.commit('set_userInfo', userInfo)
  311. this.getStationmasterList(res.longitude, res.latitude);
  312. },
  313. })
  314. },
  315. fail: () => {
  316. this.userLocation = false
  317. }
  318. });
  319. },
  320. fail: () => {
  321. uni.showModal({
  322. title: '位置授权失败',
  323. content: '请允许使用您的位置,否则无法获取附件站点',
  324. confirmText: '去设置',
  325. success: res => {
  326. if (res.confirm) {
  327. uni.openSetting({
  328. success: openSttingInfo => {
  329. if (openSttingInfo.authSetting['scope.userLocation']) {
  330. this.getAddress()
  331. this.userLocation = true
  332. } else {
  333. this.userLocation = false
  334. }
  335. }
  336. })
  337. } else {
  338. this.userLocation = false
  339. // this.isLogin && this.getAddressList()
  340. }
  341. },
  342. fail: () => {
  343. this.userLocation = false
  344. // this.isLogin && this.getAddressList()
  345. }
  346. })
  347. }
  348. })
  349. },
  350. // 立即开通
  351. toPageMenber () {
  352. this.$tools.navigateTo({
  353. url: '/pagesC/member/index',
  354. })
  355. },
  356. getStationmasterList(longitude,latitude){
  357. const params = {
  358. longitude,
  359. latitude
  360. }
  361. this.$api('getStationmasterList',params).then( res => {
  362. let { code, result, message } = res;
  363. if( code == 200) {
  364. if(!result.length) {
  365. // this.isLogin && this.getAddressList();
  366. } else {
  367. let item = result[0]
  368. let params = {
  369. name: item.shopName,
  370. id: item.id,
  371. shippingAddress: item.address,
  372. addressDetail: '',
  373. phone: item.phone,
  374. type: 'shop'
  375. }
  376. this.$store.commit('set_location', params)
  377. }
  378. } else {
  379. // if (code === 9001) return this.getAddressList();
  380. // this.$Toast(message)
  381. }
  382. }).catch(err => {
  383. this.$Toast(err.message)
  384. })
  385. },
  386. // 获取用户的收获地址
  387. getAddressList(){
  388. this.$api('getAddressList',{pageNo:1,pageSize: 1}).then(res => {
  389. let { code, result, message} = res;
  390. uni.hideLoading()
  391. if(code == 200) {
  392. if(result.records && result.records.length == 0 ){
  393. uni.showModal({
  394. title: '附近无站点',
  395. content: '您还未设置收货地点,否则无法进行购买',
  396. showCancel: false,
  397. confirmText: '去填写',
  398. success: (res) => {
  399. if (res.confirm) {
  400. // 去填写收获地址
  401. this.$tools.redirectTo({
  402. url: '/pages/my/address/addressEdit?type=setting&title=新增地址'
  403. })
  404. }
  405. }
  406. })
  407. } else {
  408. if (this.isLogin) {
  409. console.log(this.userInfo.level,'123456')
  410. if(this.userInfo.level == 0){
  411. this.show = true
  412. }
  413. this.getRedPacket()
  414. }
  415. let params = {
  416. ...result.records[0],
  417. type: 'user'
  418. }
  419. this.$store.commit('set_location', params)
  420. }
  421. }else{
  422. this.$Toast(message)
  423. }
  424. }).catch(err => {
  425. this.$Toast(err.message)
  426. })
  427. },
  428. // 关闭会员
  429. toPassMerber() {
  430. // 关闭会员 调用红包
  431. // 0 没开通会员 展示立即开通会员 不管有没有都关闭tabber
  432. wx.hideTabBar();
  433. if(this.userInfo.level == 0){
  434. this.showBtn = true;
  435. }else{
  436. // 开通过来 取消展示 立即开通会员
  437. this.showBtn = false;
  438. }
  439. if(!this.show || !this.showBtn){
  440. wx.showTabBar()
  441. }
  442. },
  443. // 轮播图点击
  444. bannerClick (idx) {
  445. let item = this.bannerList[idx]
  446. if (item.type === 1) {
  447. this.$tools.navigateTo({
  448. url: `/pagesC/goodsInfo/goodsInfo?id=${item.url}&type=home`
  449. })
  450. }else if(item.type == 0) {
  451. // 跳页面
  452. this.$tools.navigateTo({
  453. url: `${item.url}?type=home`
  454. })
  455. }
  456. },
  457. // 获取礼包信息
  458. getRedPacket() {
  459. const that = this
  460. this.$api('getGift').then(res => {
  461. let { code, result, message} = res ;
  462. if(code == 200) {
  463. result = result ==null? []: result;
  464. that.packet_list = result
  465. console.log(that.packet_list )
  466. // 没有送的礼包 并且确定是已经开通会员的 关闭遮罩层 打开tabber
  467. if (!result.length) {
  468. if(that.userInfo.level !== 0 ) {
  469. that.show= false;
  470. wx.showTabBar();
  471. } else if(that.showBtn == false ){ // 关闭了开通会员 并且也没有 礼包
  472. that.show= false;
  473. wx.showTabBar();
  474. }
  475. } else {
  476. that.show= true;
  477. uni.hideTabBar()
  478. }
  479. }else {
  480. that.$Toast(message);
  481. that.show= false;
  482. wx.showTabBar();
  483. }
  484. }).catch(err => {
  485. that.show= false;
  486. wx.showTabBar();
  487. that.$Toast(err.message);
  488. })
  489. },
  490. getRedPacketIndex(data){
  491. if(this.isLock){
  492. this.isLock = false;
  493. if(this.packet_list.length-1 == this.select_index) {
  494. this.$api('getGiftSave',{id: data.id}).then(res => {
  495. let { code, result, message} = res;
  496. if(code == 200) {
  497. this.$Toast(result)
  498. this.select_index++;
  499. }else{
  500. this.$Toast(message);
  501. }
  502. this.show = false;
  503. this.isLock = true
  504. wx.showTabBar();
  505. }).catch(err => {
  506. this.$Toast(err.message)
  507. this.show = false;
  508. this.isLock = true
  509. wx.showTabBar();
  510. })
  511. }else {
  512. this.$api('getGiftSave',{id: data.id}).then(res => {
  513. let { code, result, message} = res;
  514. if(code == 200) {
  515. this.$Toast(result)
  516. this.select_index++;
  517. }else{
  518. this.$Toast(message);
  519. }
  520. this.isLock = true
  521. }).catch(err => {
  522. this.isLock = true
  523. this.$Toast(err.message)
  524. })
  525. }
  526. }else{
  527. return
  528. }
  529. },
  530. // 获取配置按钮
  531. getHomeButton () {
  532. return new Promise((resolve, reject) => {
  533. this.$api('getHomeButton')
  534. .then(res => {
  535. let { code, result, message } = res
  536. if (code === 200) {
  537. this.gridList = result
  538. this.$store.commit('set_gridData', result)
  539. resolve()
  540. } else {
  541. reject(message)
  542. }
  543. })
  544. .catch(err => {
  545. reject(err.message)
  546. })
  547. })
  548. },
  549. // 获取滚动公告
  550. getNotice () {
  551. return new Promise((resolve, reject) => {
  552. this.$api('getNotice')
  553. .then(res => {
  554. let { code, result, message } = res
  555. if (code === 200) {
  556. this.noticeListOld = result;
  557. result.map(item => this.noticeList.push([item.title]))
  558. // this.noticeList = result.map(item => item.title)
  559. resolve()
  560. } else {
  561. reject(message)
  562. }
  563. })
  564. .catch(err => {
  565. reject(err.message)
  566. })
  567. })
  568. },
  569. // 获取轮播图
  570. getBanner () {
  571. return new Promise((resolve, reject) => {
  572. this.$api('getBanner', { type: 0 })
  573. .then(res => {
  574. let { code, result, message } = res
  575. if (code === 200) {
  576. this.bannerList = result
  577. resolve()
  578. } else {
  579. reject(message)
  580. }
  581. })
  582. .catch(err => {
  583. reject(err.message)
  584. })
  585. })
  586. },
  587. // 获取商品信息
  588. getGoodsList() {
  589. const params = {
  590. isHot: 1,
  591. type: 1,
  592. pageNo :this.pageNo,
  593. pageSize: this.pageSize
  594. }
  595. return new Promise((resolve, reject) => {
  596. if(this.pageNo>1){
  597. uni.showLoading({})
  598. }
  599. this.$api('getGoodsList',params).then(res => {
  600. let { code, result, message } = res;
  601. if(code == 200) {
  602. if(this.total== null) {
  603. this.total = result.total
  604. }
  605. result.records.forEach(item => {
  606. // const picArray= item.pic.split(',')
  607. // item.pic= picArray[0]
  608. if(item.pic!==null){
  609. const picArray=item.pic.split(',')
  610. item.pic= picArray[0]
  611. }else{
  612. item.pic= []
  613. }
  614. })
  615. if(this.pageNo>1){
  616. uni.hideLoading();
  617. }
  618. this.goodsList = this.goodsList.concat(result.records)
  619. this.isLock = true;
  620. resolve()
  621. }else {
  622. if(this.pageNo>1){
  623. uni.hideLoading();
  624. }
  625. reject(message)
  626. this.isLock = true;
  627. }
  628. }).catch(err => {
  629. if(this.pageNo>1){
  630. uni.hideLoading();
  631. }
  632. reject(err.message)
  633. this.isLock = true;
  634. })
  635. })
  636. },
  637. handleSearch () {
  638. this.$tools.navigateTo({
  639. url: '/pagesC/search/search'
  640. })
  641. },
  642. toReceiving () {
  643. if (!this.userLocation) {
  644. uni.showModal({
  645. title: '获取位置失败',
  646. content: '请允许使用您的位置,否则无法获取附件站点',
  647. confirmText: '去设置',
  648. success: res => {
  649. if (res.confirm) {
  650. uni.openSetting({
  651. success: openSttingInfo => {
  652. if (openSttingInfo.authSetting['scope.userLocation']) {
  653. this.getAddress()
  654. this.userLocation = true
  655. } else {
  656. this.userLocation = false
  657. }
  658. }
  659. })
  660. }
  661. }
  662. })
  663. } else {
  664. if (this.isLogin) {
  665. this.$tools.navigateTo({
  666. url: '/pagesC/receiving/receiving'
  667. })
  668. } else {
  669. this.$util.loginModal('您还未登录,请去登录!')
  670. }
  671. }
  672. },
  673. toPage(url,id,item) {
  674. const that = this
  675. if(url == '/pagesB/homeGridList/todayAllReturn/index' && this.userInfo.level !== 4){
  676. const text = this.userInfo.level== 0? '欢迎您开通!':'你是否去升级会员';
  677. const url_text= this.userInfo.level== 0? "/pagesC/member/index": "/pagesC/member/upgrades_renewals/index"
  678. uni.showModal({
  679. title: '提示',
  680. content: `钻石卡会员尊享,`+ text ,
  681. confirmText: '好的',
  682. success: function (res) {
  683. if (res.confirm) {
  684. that.$tools.navigateTo({
  685. url: url_text
  686. });
  687. }
  688. }
  689. })
  690. return
  691. }
  692. if(url == '/pagesB/homeGridList/scienceIsTie-in/index' && this.userInfo.level !== 4){
  693. const text = this.userInfo.level== 0? '欢迎您开通!':'你是否去升级会员';
  694. const url_text= this.userInfo.level== 0? "/pagesC/member/index": "/pagesC/member/upgrades_renewals/index"
  695. uni.showModal({
  696. title: '提示',
  697. content: `钻石卡会员尊享,`+ text ,
  698. confirmText: '好的',
  699. success: function (res) {
  700. if (res.confirm) {
  701. that.$tools.navigateTo({
  702. url: url_text
  703. });
  704. }
  705. }
  706. })
  707. return
  708. }
  709. // 开通会员做处理
  710. if(url == '/pagesC/member/index'){
  711. if(this.userInfo.level>0){
  712. this.$tools.navigateTo({
  713. url: '/pagesC/member/upgrades_renewals/index'
  714. });
  715. }else{
  716. this.$tools.navigateTo({
  717. url: '/pagesC/member/index'
  718. });
  719. }
  720. }else{
  721. // 传递标题
  722. uni.navigateTo({
  723. url: url+'?id='+id + `&title=${item.title}&concert=${item.concert}&pageImage=${item.pageImage}`
  724. })
  725. }
  726. },
  727. }
  728. };
  729. </script>
  730. <style lang="scss" scoped>
  731. .home-notice{
  732. width: 680rpx;
  733. overflow: hidden;
  734. position: relative;
  735. &-image{
  736. position: absolute;
  737. width: 60rpx;
  738. height: 60rpx;
  739. }
  740. ::v-deep .u-notice-box{
  741. margin-left: 60rpx;
  742. width: 400rpx;
  743. }
  744. ::v-deep .u-notice-bar{
  745. padding: 0 24rpx !important;
  746. width: 89%;
  747. }
  748. ::v-deep .u-notice-text{
  749. margin-left: 30rpx;
  750. font-size: 36rpx !important;
  751. }
  752. }
  753. .overhide{
  754. overflow: hidden;
  755. }
  756. .home {
  757. flex: 1;
  758. position: relative;
  759. .bg{
  760. position: fixed;
  761. top: 0;
  762. left: 0;
  763. width: 100%;
  764. height: 100%;
  765. // overflow: hidden;
  766. z-index: 100;
  767. background-color: rgba(0, 0, 0, 0.5) ;
  768. display: flex;
  769. justify-content: center;
  770. align-items: center;
  771. .merber_pass{
  772. // position: absolute;
  773. // top: 0;
  774. // bottom: 0;
  775. // left: 0;
  776. // right: 0;
  777. display: flex;
  778. flex-direction: column;
  779. justify-content: center;
  780. align-items: center;
  781. // z-index: 22;
  782. .img_merber_pass{
  783. width: 623rpx;
  784. height: 617rpx;
  785. background-size: 623rpx 617rpx;
  786. position: relative;
  787. display: flex;
  788. justify-content: center;
  789. .btn_click_pass{
  790. position: absolute;
  791. z-index: 23;
  792. width: 278rpx;
  793. height: 68rpx;
  794. line-height: 68rpx;
  795. text-align: center;
  796. font-size: 30rpx;
  797. border-radius:30rpx;
  798. bottom: 58rpx;
  799. }
  800. }
  801. }
  802. .gift_box{
  803. position: fixed;
  804. top: 50%;
  805. left: 50%;
  806. transform: translate(-50%, -50%);
  807. transition: all 2s;
  808. display: flex;
  809. flex-direction: column;
  810. align-items: center;
  811. .gift{
  812. width: 529rpx;
  813. height: 672rpx;
  814. background-size: 529rpx 672rpx;
  815. display: flex;
  816. flex-direction: column;
  817. justify-content: flex-start;
  818. align-items: center;
  819. position: relative;
  820. color: #D70E08;
  821. font-weight: bold;
  822. font-size: 36rpx;
  823. .one{
  824. font-size: 27rpx;
  825. margin-top: 56rpx;
  826. }
  827. .top_one{
  828. margin-top: 75rpx;
  829. }
  830. .two{
  831. margin-top: 30rpx;
  832. }
  833. .three{
  834. margin-top: 10rpx;
  835. }
  836. .four{
  837. margin-top: 87rpx;
  838. }
  839. .four1{
  840. margin-top: 85rpx;
  841. }
  842. .five{
  843. margin-top: 10rpx;
  844. }
  845. .six{
  846. margin: 0 auto;
  847. margin-top: 60rpx;
  848. width: 72%;
  849. text-align: center;
  850. }
  851. .getRedPacketBtn{
  852. position: absolute;
  853. width: 420px;
  854. height: 81rpx;
  855. border-radius: 36rpx;
  856. display: flex;
  857. justify-content: center;
  858. align-items: center;
  859. z-index: 23;
  860. font-size: 31rpx;
  861. color: #D70E08;
  862. bottom: 86rpx;
  863. }
  864. }
  865. }
  866. }
  867. padding-bottom: 40rpx;
  868. /* #ifdef H5 */
  869. padding-bottom: 140rpx;
  870. /* #endif */
  871. &-address {
  872. &-name {
  873. width: 60%;
  874. color: #fff;
  875. font-size: 28rpx;
  876. }
  877. &-switch {
  878. line-height: 1;
  879. }
  880. }
  881. &-search {
  882. padding: 28rpx;
  883. }
  884. &-banner {
  885. &-bg {
  886. width: 100%;
  887. left: -5%;
  888. height: 180rpx;
  889. border-bottom-left-radius: 100%;
  890. border-bottom-right-radius: 100%;
  891. z-index: -1;
  892. }
  893. }
  894. &-notice {
  895. margin: 0 20rpx;
  896. background-color: #e0ffff;
  897. padding: 10rpx 20rpx;
  898. border-radius: 40rpx;
  899. &-image {
  900. width: 60rpx;
  901. }
  902. }
  903. &-grid {
  904. padding: 0 30rpx;
  905. &-item {
  906. width: 33%;
  907. height: 160rpx;
  908. position: relative;
  909. }
  910. &-img {
  911. width: 100rpx;
  912. height: 100rpx;
  913. max-width: 100rpx;
  914. max-height: 100rpx;
  915. }
  916. }
  917. &-goods {
  918. padding: 0 20rpx;
  919. &-header {
  920. width: 560rpx;
  921. margin: 0 auto;
  922. }
  923. &-items {
  924. padding: 30rpx 16rpx 20rpx;
  925. background: #ffffff;
  926. border-radius: 34rpx;
  927. box-shadow: 0px 6rpx 12rpx 0px rgba(0, 0, 0, 0.16);
  928. &-image {
  929. width: 100%;
  930. height: 300rpx;
  931. }
  932. &-play {
  933. left: 50%;
  934. bottom: 50%;
  935. transform: translate(-50%, 50%);
  936. }
  937. &-title {
  938. line-height: 50rpx;
  939. }
  940. &-add {
  941. margin-right: 20rpx;
  942. width: 50rpx;
  943. height: 50rpx;
  944. border-radius: 50%;
  945. background-color: $u-type-primary;
  946. }
  947. &-tag {
  948. // width: 150rpx;
  949. // height: 110rpx;
  950. // transform: translateX(20rpx);
  951. // transform: translate(50%, 50%);
  952. transform: rotate(45deg);
  953. top: 0;
  954. right: 0;
  955. &-content {
  956. transform: translate(25%, -30%);
  957. width: 200rpx;
  958. height: 50rpx;
  959. background-color: #db0618;
  960. box-shadow: 0px 6rpx 12rpx 0px rgba(0, 0, 0, 0.1);
  961. }
  962. }
  963. }
  964. }
  965. &-segmented-control {
  966. width: 200rpx;
  967. height: 50rpx;
  968. background: #fff;
  969. border-radius: 40rpx;
  970. right: 20rpx;
  971. bottom: 20rpx;
  972. &-item {
  973. position: relative;
  974. z-index: 1;
  975. color: #000;
  976. font-size: 24rpx;
  977. transition: all 0.2s linear;
  978. &--active {
  979. color: #fff;
  980. }
  981. }
  982. &-bar {
  983. width: 50%;
  984. height: 100%;
  985. border-radius: 40rpx;
  986. position: absolute;
  987. background-color: $u-type-primary;
  988. z-index: 0;
  989. transition: all 0.2s linear;
  990. }
  991. }
  992. }
  993. </style>