index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
  1. <template>
  2. <view class="content bg-white" style="min-height: 100vh;">
  3. <view class="">
  4. <u-navbar :is-back="false" title=" ">
  5. <view class="slot-wrap">
  6. <view v-if="$isEmpty(plot)" class="padding-left-20" @click="$u.toast('暂无小区信息')">
  7. <u-icon name="map-fill" color="#2f7ff5" size="34"></u-icon>
  8. <text class="padding-left-sm " style="font-size: 34rpx;">暂无小区信息</text>
  9. </view>
  10. <picker v-else @change="typeChange" :value="plotIndex" :range="plotArray">
  11. <view class="padding-left-20 ">
  12. <u-icon name="map-fill" color="#2f7ff5" size="34"></u-icon>
  13. <text class="padding-left-sm " style="font-size: 34rpx;">{{plot}}</text>
  14. </view>
  15. </picker>
  16. </view>
  17. </u-navbar>
  18. <!-- 头图 -->
  19. <swiper class="screen-swiper square-dot " :indicator-dots="true" :circular="true" :autoplay="true"
  20. interval="5000" duration="500">
  21. <swiper-item v-for="(item,index) in adList" :key="index">
  22. <image v-if="item.videoType==0" :src="item.videoUri" mode="aspectFill"></image>
  23. <video v-if="item.videoType==1" :src="item.videoUri" autoplay loop muted :show-play-btn="false"
  24. :controls="false" objectFit="cover"></video>
  25. </swiper-item>
  26. </swiper>
  27. <view class="">
  28. <view class="bg-white" style="height: 10rpx;"></view>
  29. <hotConsult @onTap="jump('../notice/notice')" @detailTap="goNoticeDetail" :swiperTexts="noticeList">
  30. </hotConsult>
  31. </view>
  32. <view style="background-color: #FFFFFF;">
  33. <view style="padding: 30rpx 30rpx 0 30rpx;">
  34. <text class="text-bold text-lg">智慧社区</text>
  35. </view>
  36. <view style="padding: 40rpx 10rpx 0rpx;" class="cu-list grid col-5 no-border">
  37. <view class="cu-item" @click="top(item.index)" v-for="(item,index) in gridList" :key="index">
  38. <block>
  39. <view class="grid-icon">
  40. <image style="width: 56rpx;height: 56rpx;" :src="item.icon" />
  41. </view>
  42. <text style="color: #333333;font-size: 26rpx;">{{item.title}}</text>
  43. </block>
  44. <view class="cu-tag bg-red badge" v-if="item.badge>0">{{item.badge}}</view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <!-- <view class="bg-white">
  50. <image src="/static/common/banner.png" style="width: 100%;" mode="widthFix"></image>
  51. </view> -->
  52. <view v-if="!this.$isEmpty(goodsList)">
  53. <view class="tj-title">
  54. <view class="">
  55. <text class="text-lg text-bold">为您推荐</text>
  56. <text class="sub-title">有料</text>
  57. <text class="sub-title">好物</text>
  58. <text class="sub-title">有优惠</text>
  59. </view>
  60. <view class="sub-title" style="color: #969696;padding-top: 8rpx;font-size: 24rpx;"
  61. @click="jump('/pages/life/life','type')">
  62. <text>查看更多></text>
  63. </view>
  64. </view>
  65. <view>
  66. <goods :goodsList="goodsList"></goods>
  67. </view>
  68. </view>
  69. <view style="height: 80rpx;" v-if="fasle">
  70. <u-divider bgColor="#f1f1f1;" height="80">到底了</u-divider>
  71. </view>
  72. <login ref="login" @signIn="signIn"></login>
  73. <bindHome v-if="vuex_member" @reload="onshow"></bindHome>
  74. </view>
  75. </template>
  76. <script>
  77. import bindHome from "@/comps/bindHome.vue"
  78. import login from "@/comps/login.vue"
  79. import hotConsult from "@/comps/hot-consult/hot-consult.vue"
  80. import goods from "@/comps/goods/goods.vue"
  81. var app = getApp();
  82. let that;
  83. export default {
  84. components: {
  85. bindHome,
  86. login,
  87. goods,
  88. hotConsult,
  89. },
  90. data() {
  91. return {
  92. background: {
  93. backgroundColor: '#e54d42',
  94. },
  95. noticeList: [],
  96. userInfo: {},
  97. jsCode: '',
  98. openid: '',
  99. sessionKey: '',
  100. isFirst: false,
  101. goodsList: [],
  102. isIPX: false,
  103. residentialIdList: [], //小区id
  104. //广告轮播图
  105. swiperIndex: 0,
  106. plot: null,
  107. plotArray: [],
  108. //小区名字
  109. plotIndex: 0,
  110. adList: [{
  111. 'videoType': 0,
  112. 'videoUri': "https://szsq.nxzhsq.cn/community/miniofile/app/banner.jpg"
  113. }, ],
  114. gridList: [{
  115. icon: '../../static/home/fangwu.png',
  116. title: "我的房屋",
  117. badge: 0,
  118. index: 1
  119. },
  120. {
  121. icon: '../../static/home/renyuan.png',
  122. title: "家庭成员",
  123. badge: 0,
  124. index: 2
  125. },
  126. {
  127. icon: '../../static/home/cheliang.png',
  128. title: "我的车辆",
  129. badge: 0,
  130. index: 3
  131. },
  132. {
  133. icon: '/static/home/baoxiu1.png',
  134. title: "物业报修",
  135. badge: 0,
  136. index: 8
  137. },
  138. {
  139. icon: '../../static/home/fangke1.png',
  140. title: "访客授权",
  141. badge: this.vuex_auth_audit_count,
  142. index: 4
  143. },
  144. {
  145. icon: '/static/home/fanyi1.png',
  146. title: "防疫登记",
  147. badge: 0,
  148. index: 6
  149. },
  150. ]
  151. }
  152. },
  153. onShow() {
  154. this.onshow()
  155. },
  156. onLoad(options) {
  157. that = this
  158. //处理进入小程序的场景
  159. that.handelShare(options)
  160. this.isFirst = true
  161. //拉取后台用户信息
  162. this.isIPX = uni.getStorageSync('isIPX')
  163. //获取轮播列表
  164. this.getAdList();
  165. //获取推荐商品列表
  166. // this.fetchGoodsList()
  167. },
  168. methods: {
  169. onshow() {
  170. this.login()
  171. // this.fetchNoticeList()
  172. //获取访客授权待审核的数量
  173. if (this.canReset) this.fetchAuthRecordNum()
  174. this.canReset = true
  175. //处理进入小程序的不同场景
  176. this.execParam();
  177. // this.loadData()
  178. //每次打开此页面都把商品数组打乱
  179. // this.$u.randomArray(this.goodsList)
  180. if (this.isFirst) {
  181. this.isFirst = false
  182. } else {
  183. this.getResidentialListByMember()
  184. }
  185. },
  186. signIn() {
  187. this.getOpenId();
  188. },
  189. /**
  190. * 做个假登录
  191. */
  192. login() {
  193. if (!this.vuex_isAuth) {
  194. this.plot = ''
  195. this.noticeList = []
  196. this.$refs.login.show()
  197. } else {
  198. this.signIn()
  199. }
  200. },
  201. fetchAuthRecordNum() {
  202. try {
  203. let memberId = app.globalData.member.id
  204. let residentialId = uni.getStorageSync("residentialId");
  205. if (!this.$isEmpty(memberId)) {
  206. let params = {
  207. userId: memberId,
  208. residentialId: uni.getStorageSync("residentialId"),
  209. size: 99,
  210. auditStatus: 0
  211. }
  212. this.$http.guestRecordsCount(params).then(res => {
  213. let count = res.data.data
  214. that.$u.vuex('vuex_auth_audit_count', count)
  215. let item = this.gridList.find(item => item.title == '访客授权')
  216. item.badge = count
  217. })
  218. }
  219. } catch (e) {
  220. }
  221. },
  222. open(item) {
  223. //直接开门
  224. that.openDoor(item)
  225. //进度条加载模式开门
  226. // this.isloading=true
  227. // let that=this
  228. // setTimeout(()=>{
  229. // that.openDoor(id)
  230. // },500)
  231. },
  232. //立即开门
  233. openDoor(item) {
  234. let params = {
  235. memberId: app.globalData.member.id,
  236. serialNum: item.deviceSerialNum,
  237. deviceFactory: item.deviceFactory,
  238. residentialId: item.residentialId,
  239. userType: 'ZH_'
  240. }
  241. this.$http.openDoor(params).then(res => {
  242. this.isloading = false
  243. if (res.data.success) {
  244. this.$u.toast('开门成功')
  245. } else {
  246. this.$u.toast('开门失败')
  247. }
  248. });
  249. },
  250. async loadData(options) {
  251. //进入小程序时进行游客登陆,
  252. //以免直接进入商品详情时会提示用户未授权
  253. await this.$nextTick(function() {
  254. this.touristLogin()
  255. })
  256. },
  257. getParam(e) {
  258. // 用来保存所有的属性名称和值
  259. let param = "";
  260. // 开始遍历
  261. for (let p in e) {
  262. // 方法
  263. if (typeof(e[p]) != "function" && p != 'type') {
  264. // p 为属性名称,e[p]为对应属性的值
  265. param += (param.length > 1 ? '&' : '') + p + "=" + e[p];
  266. }
  267. }
  268. // 最后显示所有的属性
  269. return param;
  270. },
  271. execParam() {
  272. let _this = this;
  273. if (this.e != null) {
  274. setTimeout(function() {
  275. if (_this.e == null) return;
  276. if (_this.e.type == "share") {
  277. let path = _this.e.path == null || _this.e.path.length <= 0 ?
  278. 'pagesM/pages/goods_des' : '/' + _this.e.path;
  279. let param = _this.getParam(_this.e);
  280. let url = `${path}?${param}`;
  281. console.error("url = " + url);
  282. _this.e = null;
  283. uni.navigateTo({
  284. url: url
  285. });
  286. }
  287. }, 1000);
  288. }
  289. },
  290. handelShare(options) {
  291. //二维码扫描链接 start
  292. if (!this.$isEmpty(options.scene)) {
  293. let scene = decodeURIComponent(options.scene).split(",")
  294. //从小程序二维码进入
  295. let path = "/pagesM/pages/goods_des"
  296. let params = "?id=" + scene[0] + "&storeId=" + scene[1]
  297. if (!this.$isEmpty(scene[2])) {
  298. params = params + "&inviteCode=" + scene[2]
  299. }
  300. let url = path + params
  301. uni.redirectTo({
  302. url: url
  303. })
  304. }
  305. if (!this.$isEmpty(options.source)) {}
  306. //二维码扫描链接 end
  307. //点击转发卡片进入的小程序
  308. this.execParam();
  309. wx.showShareMenu({
  310. withShareTicket: true
  311. })
  312. },
  313. tab(index) {},
  314. jump(url, type) {
  315. if (!this.$isEmpty(type)) {
  316. uni.switchTab({
  317. url: url
  318. })
  319. } else {
  320. uni.navigateTo({
  321. url: url
  322. })
  323. }
  324. },
  325. /**
  326. * 获取商品推荐列表
  327. */
  328. async fetchGoodsList() {
  329. let indexProduct = await this.$api.storeHomeProducts();
  330. this.goodsList = indexProduct[0].products
  331. this.$u.randomArray(this.goodsList)
  332. },
  333. //轮播圆点
  334. bindchange(e) {
  335. this.setData({
  336. swiperIndex: e.detail.current
  337. });
  338. },
  339. //改变小区
  340. typeChange: function(e) {
  341. let _this = this;
  342. Promise.all([_this.getResidentialListByMember()]).then(result => {
  343. let value = _this.plotArray[e.detail.value];
  344. let residentialId = _this.residentialIdList[e.detail.value];
  345. _this.fetchNoticeList(residentialId);
  346. let residentialList = uni.getStorageSync('residentialList')
  347. uni.setStorageSync("personTel", residentialList[e.detail.value].personTel);
  348. uni.setStorageSync("plotName", value);
  349. uni.setStorageSync("residentialId", residentialId);
  350. uni.setStorageSync('doorNeedAudit', residentialList[e.detail.value].doorNeedAudit)
  351. _this.setData({
  352. plotIndex: e.detail.value,
  353. plot: value
  354. });
  355. }).catch(error => {});
  356. },
  357. //一键开门
  358. goOpen: function() {
  359. var that = this;
  360. var member = app.globalData.member;
  361. var anyHousePass = app.globalData.anyHousePass; //会员认证状态:{ 0:未认证,1:待审审核,2:已认证 }
  362. if (member == null) {
  363. //未注册
  364. app.globalData.footaddmore();
  365. return;
  366. } else if (member.state == 0 && !anyHousePass) {
  367. //未认证
  368. app.globalData.choosePlot();
  369. return;
  370. } else if (member.state == 1 && !anyHousePass) {
  371. //待审核
  372. that.pending();
  373. return;
  374. } else if (member.state == 2 || anyHousePass) {
  375. //已认证
  376. uni.navigateTo({
  377. url: '/pages/oneButton/oneButton'
  378. });
  379. }
  380. },
  381. /**
  382. * 获取轮播图列表
  383. */
  384. getAdList: function() {
  385. let that = this;
  386. let params = {};
  387. let operation = 'adPushApp/getList';
  388. // app.globalData.postRequest(params, operation, function (res) {
  389. // //获取成功
  390. // if (res.data.result_code == 1) {
  391. // let adList = res.data.list;
  392. // if (adList && adList.length > 0) {
  393. // that.setData({
  394. // adList: adList
  395. // });
  396. // }
  397. // }
  398. // });
  399. },
  400. fetchNoticeList(id) {
  401. let that = this
  402. let operation = 'notice/noticeList'
  403. let params = {}
  404. params.residentialId = id;
  405. that.$http.getNoticeList(params).then(res => {
  406. //获取成功
  407. let list = res.data.data;
  408. if (this.$isEmpty(list)) {
  409. list = [{
  410. title: '暂无社区公告',
  411. content: '暂无社区公告'
  412. }]
  413. }
  414. that.noticeList = list
  415. });
  416. },
  417. //获取openid
  418. getOpenId: function() {
  419. var that = this;
  420. uni.login({
  421. success: res => {
  422. let params = {};
  423. params['js_code'] = res.code;
  424. params['name'] = 'community';
  425. params['app_type'] = 1;
  426. that.jsCode = res.code;
  427. // let operation = 'miniprogram/getOpenid'; //发起请求
  428. that.$http.getOpenid(params).then(res => {
  429. //获取成功
  430. if (res.data.result_code == 1) {
  431. //openid存入缓存
  432. uni.setStorageSync("openid", res.data.openid);
  433. uni.setStorageSync("appletType", res.data.appletType);
  434. that.$u.vuex('vuex_appletType', res.data.appletType);
  435. that.openid = res.data.openid
  436. that.sessionKey = res.data.sessionKey
  437. that.getMemberByOpenid(res.data.openid);
  438. } else {
  439. app.globalData.oneFailHint(res.data.result_msg);
  440. }
  441. }).catch(err => {});
  442. }
  443. });
  444. },
  445. //根据openid获取用户信息
  446. async getMemberByOpenid(openid) {
  447. let _this = this;
  448. let params = {};
  449. params['openid'] = openid;
  450. // let operation = 'miniprogram/getMemberByOpenid';
  451. let res = await this.$http.getMemberByOpenid(params)
  452. if (res.data.result_code == 1) {
  453. app.globalData.member = res.data.member;
  454. uni.setStorageSync("myPhone", res.data.member.phone);
  455. that.$u.vuex('vuex_member', res.data.member)
  456. app.globalData.anyHousePass = res.data.anyHousePass; //获取房屋列表
  457. _this.getResidentialListByMember();
  458. _this.fetchAuthRecordNum()
  459. _this.getOwnRoomList()
  460. } else {
  461. uni.removeStorageSync("personTel");
  462. uni.removeStorageSync("plotName");
  463. uni.removeStorageSync("residentialId");
  464. uni.removeStorageSync("doorNeedAudit");
  465. uni.removeStorageSync("myPhone");
  466. uni.removeStorageSync("residentialList");
  467. }
  468. },
  469. getOwnRoomList() {
  470. let params = {
  471. memberId: this.vuex_member.id
  472. }
  473. this.$http.getHouseUserCondition(params).then(res => {
  474. let list = res.data.data
  475. list.forEach(item => {
  476. item.address = item.residentialName + "-" + item.buildingName + "-" + item
  477. .unitName + "-" + item.roomName
  478. })
  479. getApp().globalData.own_room_list = list;
  480. this.$u.vuex('vuex_own_room_list', list)
  481. })
  482. },
  483. /**
  484. * 游客登陆
  485. */
  486. async touristLogin() {
  487. // 检查是否登录
  488. this.isLogin = this.$auth.isAuth
  489. if (!this.$auth.isAuth) { // 就算是游客,也重新登录
  490. let resp = await this.$api.touristLogin()
  491. let userType = this.$global.userType.tourist
  492. this.$auth.login(userType, resp.sessionId, resp.userId, resp)
  493. } else {
  494. console.log(`已登录!`)
  495. }
  496. },
  497. //根据会员id获取我的房屋列表
  498. getResidentialListByMember: function() {
  499. let that = this;
  500. let params = {};
  501. if (this.$isEmpty(app.globalData.member)) {
  502. return
  503. }
  504. params['id'] = app.globalData.member.id;
  505. this.$http.getResidentialListByMember(params).then(res => {
  506. if (this.$isEmpty(res.data.data)) {
  507. return
  508. }
  509. let list = [];
  510. let doorNeedAuditList = []
  511. let residentialIdList = [];
  512. let personTelList = []
  513. if (res.data.success) {
  514. that.fetchNoticeList(res.data.data[0].residentialId);
  515. app.globalData.userId = res.data.data[0].userId
  516. res.data.data.forEach(item => {
  517. list.push(item.name);
  518. doorNeedAuditList.push(item.doorNeedAudit)
  519. residentialIdList.push(item.id);
  520. personTelList.push(item.personPhone)
  521. })
  522. if (list.length < 1) {
  523. uni.removeStorageSync("personTel");
  524. uni.removeStorageSync("plotName");
  525. uni.removeStorageSync("residentialId");
  526. uni.removeStorageSync("doorNeedAudit");
  527. } else {
  528. //获取本地储存的当前所在小区
  529. let plot = that.plot;
  530. if (uni.getStorageSync('plotName')) {
  531. plot = uni.getStorageSync('plotName');
  532. that.setData({
  533. plot: plot
  534. });
  535. } else {
  536. uni.setStorageSync("personTel", personTelList[0]);
  537. uni.setStorageSync("doorNeedAudit", doorNeedAuditList[0]);
  538. uni.setStorageSync("plotName", list[0]);
  539. uni.setStorageSync("residentialId", residentialIdList[0]);
  540. that.setData({
  541. plot: list[0]
  542. });
  543. }
  544. }
  545. let residentialList = []
  546. list.forEach((item, index) => {
  547. let tmp = {}
  548. tmp.residentialName = item
  549. tmp.personTel = personTelList[index]
  550. tmp.residentialId = residentialIdList[index]
  551. tmp.doorNeedAudit = doorNeedAuditList[index]
  552. tmp.estateTel = doorNeedAuditList[index]
  553. residentialList.push(tmp)
  554. })
  555. uni.setStorage({
  556. key: "residentialList",
  557. data: residentialList
  558. })
  559. //为 小区 picker 设置默认项
  560. let defaultPlotId = uni.getStorageSync("residentialId")
  561. if (!that.$isEmpty(defaultPlotId)) {
  562. that.plotIndex = residentialIdList.indexOf(defaultPlotId)
  563. }
  564. that.setData({
  565. plotArray: list,
  566. residentialIdList: residentialIdList
  567. });
  568. }
  569. });
  570. },
  571. /**
  572. * 跳转
  573. * @param {Object} index 当前项的index属性,而不是当前项的下标
  574. */
  575. top: function(index) {
  576. if (index == 99) {
  577. //查看更多
  578. uni.navigateTo({
  579. url: "../tool-list/tool-list"
  580. })
  581. return
  582. }
  583. if (index == 9) {
  584. uni.navigateToMiniProgram({
  585. appId: 'wx2eec5fb00157a603',
  586. })
  587. return
  588. }
  589. if (!this.vuex_isAuth) {
  590. this.plot = ''
  591. this.noticeList = []
  592. this.$refs.login.show()
  593. return
  594. }
  595. var that = this;
  596. var member = app.globalData.member;
  597. var anyHousePass = app.globalData.anyHousePass; //会员认证状态:{ 0:未认证,1:待审审核,2:已认证 }
  598. if (this.$isEmpty(member)) {
  599. //去注册
  600. uni.navigateTo({
  601. url: "../empty/empty"
  602. })
  603. return
  604. } else if (member.state == 0 && !anyHousePass) {
  605. //去认证
  606. uni.navigateTo({
  607. url: "../empty/empty?type=2"
  608. })
  609. return
  610. } else if (member.state == 1 && !anyHousePass) {
  611. //待审核
  612. that.pending();
  613. } else if (member.state == 2 || anyHousePass) {
  614. //已认证
  615. //获取页面传过来的值
  616. var url;
  617. switch (index) {
  618. case 1:
  619. //我的家人
  620. url = '/pages/myhome/myhome';
  621. break;
  622. case 2:
  623. //家庭成员
  624. url = '/pages/myFamily/myFamily';
  625. break;
  626. case 3:
  627. //我的车辆
  628. url = "/pages/myCar/myCar";
  629. break;
  630. case 4:
  631. //访客授权
  632. url = '/pages/authorize_record/authorize_record';
  633. break;
  634. case 5:
  635. if (this.$isEmpty(this.device_list)) {
  636. uni.showToast({
  637. title: "暂无设备",
  638. icon: "none"
  639. })
  640. return
  641. }
  642. if (this.device_list.length == 1) {
  643. this.open(this.device_list[0])
  644. } else {
  645. this.modalShow = !this.modalShow
  646. }
  647. break;
  648. case 6:
  649. //防疫登记
  650. url = '/pages/tool-list/epidemic-pass/epidemic-pass';
  651. break;
  652. case 7:
  653. //物业缴费
  654. uni.showToast({
  655. title: "待开发",
  656. icon: "none"
  657. })
  658. break;
  659. case 8:
  660. //物业报修
  661. url = '/pages/services/property/property';
  662. break;
  663. case 9:
  664. // url = '/pages/healthCode/healthCode';
  665. break;
  666. default:
  667. url = "";
  668. break;
  669. }
  670. if (url != '') {
  671. uni.navigateTo({
  672. url: url,
  673. success: function(res) {
  674. that.setData({
  675. firstJump: false
  676. });
  677. }
  678. });
  679. }
  680. }
  681. },
  682. openBluetoothAdapter: function() {
  683. uni.openBluetoothAdapter({
  684. success: function(res) {
  685. uni.navigateTo({
  686. url: "/pages/bluetooth/bluetooth"
  687. });
  688. },
  689. fail: function(res) {
  690. uni.showModal({
  691. content: '请开启手机蓝牙后再试'
  692. });
  693. }
  694. });
  695. },
  696. //用户信息待审核中
  697. pending: function() {
  698. var openid = uni.getStorageSync("openid");
  699. let params = {};
  700. params['openid'] = openid;
  701. // let operation = 'miniprogram/getMemberByOpenid';
  702. this.$http.getMemberByOpenid(params).then(res => {
  703. //获取成功
  704. if (res.data.result_code == 1) {
  705. let member = res.data.member; //待审核
  706. if (member.state == 1 && !res.data.anyHousePass) {
  707. app.globalData.oneFailHint('你的信息正在审核,请耐心等待');
  708. } else if (member.state == 2) {
  709. app.globalData.oneFailHint('亲,你的信息已审核通过');
  710. that.getResidentialListByMember()
  711. }
  712. app.globalData.member = member;
  713. app.globalData.anyHousePass = res.data.anyHousePass;
  714. } else {
  715. app.globalData.oneFailHint(res.data.result_msg);
  716. }
  717. });
  718. },
  719. goNoticeDetail(item) {
  720. app.globalData.noticeDetail = item
  721. uni.navigateTo({
  722. url: "../notice/detail",
  723. })
  724. }
  725. }
  726. }
  727. </script>
  728. <style lang="scss">
  729. .img1-lg {
  730. margin-top: -80rpx;
  731. }
  732. .location_item {
  733. background-color: #FFFFFF;
  734. display: flex;
  735. padding: 30rpx;
  736. font-size: 32rpx;
  737. }
  738. .active {
  739. transform: none;
  740. transition: all 0.2s ease-in 0s;
  741. }
  742. .tj-title {
  743. display: flex;
  744. justify-content: space-between;
  745. padding: 30rpx;
  746. background-color: #FFFFFF;
  747. font-size: 32rpx;
  748. .sub-title {
  749. font-size: 26rpx;
  750. padding-left: 16rpx;
  751. color: #c7c7c7;
  752. }
  753. }
  754. .nav-list {
  755. display: flex;
  756. flex-wrap: wrap;
  757. justify-content: center;
  758. }
  759. .nav-li {
  760. padding: 30upx 20rpx;
  761. border-radius: 12upx;
  762. width: 40%;
  763. margin: 20rpx 1% 10upx;
  764. // background-image: url(/static/unicorn-base/index/cc3b1807-c684-4b83-8f80-80e5b8a6b975.png);
  765. background-size: cover;
  766. background-position: center;
  767. position: relative;
  768. z-index: 1;
  769. }
  770. .nav-li::after {
  771. content: "";
  772. position: absolute;
  773. z-index: -1;
  774. background-color: inherit;
  775. width: 100%;
  776. height: 100%;
  777. left: 0;
  778. bottom: -10%;
  779. border-radius: 10upx;
  780. opacity: 0.2;
  781. transform: scale(0.9, 0.9);
  782. }
  783. .nav-li.cur {
  784. color: #fff;
  785. background: rgb(94, 185, 94);
  786. box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
  787. }
  788. .nav-title {
  789. font-size: 32upx;
  790. font-weight: 300;
  791. }
  792. .nav-title::first-letter {
  793. font-size: 40upx;
  794. margin-right: 4upx;
  795. }
  796. .nav-name {
  797. font-size: 28upx;
  798. text-transform: Capitalize;
  799. margin-top: 20upx;
  800. position: relative;
  801. }
  802. .nav-name::before {
  803. content: "";
  804. position: absolute;
  805. display: block;
  806. width: 40upx;
  807. height: 6upx;
  808. background: #fff;
  809. bottom: 0;
  810. right: 0;
  811. opacity: 0.5;
  812. }
  813. .nav-name::after {
  814. content: "";
  815. position: absolute;
  816. display: block;
  817. width: 100upx;
  818. height: 1px;
  819. background: #fff;
  820. bottom: 0;
  821. right: 40upx;
  822. opacity: 0.3;
  823. }
  824. .nav-name::first-letter {
  825. font-weight: bold;
  826. font-size: 36upx;
  827. margin-right: 1px;
  828. }
  829. .nav-li image {
  830. position: absolute;
  831. right: 30upx;
  832. top: 30upx;
  833. font-size: 52upx;
  834. width: 70upx;
  835. height: 70upx;
  836. text-align: center;
  837. line-height: 60upx;
  838. }
  839. </style>