index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883
  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. this.$u.vuex('vuex_tenantId',this.vuex_residentialList[e.detail.value].tenantId)
  342. let _this = this;
  343. Promise.all([_this.getResidentialListByMember()]).then(result => {
  344. let value = _this.plotArray[e.detail.value];
  345. let residentialId = _this.residentialIdList[e.detail.value];
  346. console.log(residentialId,"123456");
  347. _this.fetchNoticeList(residentialId);
  348. let residentialList = uni.getStorageSync('residentialList')
  349. uni.setStorageSync("personTel", residentialList[e.detail.value].personTel);
  350. uni.setStorageSync("plotName", value);
  351. uni.setStorageSync("residentialId", residentialId);
  352. uni.setStorageSync('doorNeedAudit', residentialList[e.detail.value].doorNeedAudit)
  353. _this.setData({
  354. plotIndex: e.detail.value,
  355. plot: value
  356. });
  357. }).catch(error => {});
  358. },
  359. //一键开门
  360. goOpen: function() {
  361. var that = this;
  362. var member = app.globalData.member;
  363. var anyHousePass = app.globalData.anyHousePass; //会员认证状态:{ 0:未认证,1:待审审核,2:已认证 }
  364. if (member == null) {
  365. //未注册
  366. app.globalData.footaddmore();
  367. return;
  368. } else if (member.state == 0 && !anyHousePass) {
  369. //未认证
  370. app.globalData.choosePlot();
  371. return;
  372. } else if (member.state == 1 && !anyHousePass) {
  373. //待审核
  374. that.pending();
  375. return;
  376. } else if (member.state == 2 || anyHousePass) {
  377. //已认证
  378. uni.navigateTo({
  379. url: '/pages/oneButton/oneButton'
  380. });
  381. }
  382. },
  383. /**
  384. * 获取轮播图列表
  385. */
  386. getAdList: function() {
  387. let that = this;
  388. let params = {};
  389. let operation = 'adPushApp/getList';
  390. // app.globalData.postRequest(params, operation, function (res) {
  391. // //获取成功
  392. // if (res.data.result_code == 1) {
  393. // let adList = res.data.list;
  394. // if (adList && adList.length > 0) {
  395. // that.setData({
  396. // adList: adList
  397. // });
  398. // }
  399. // }
  400. // });
  401. },
  402. fetchNoticeList(id) {
  403. let that = this
  404. let operation = 'notice/noticeList'
  405. let params = {}
  406. params.residentialId = id;
  407. that.$http.getNoticeList(params).then(res => {
  408. //获取成功
  409. let list = res.data.data;
  410. if (this.$isEmpty(list)) {
  411. list = [{
  412. title: '暂无社区公告',
  413. content: '暂无社区公告'
  414. }]
  415. }
  416. that.noticeList = list
  417. });
  418. },
  419. //获取openid
  420. getOpenId: function() {
  421. var that = this;
  422. uni.login({
  423. success: res => {
  424. let params = {};
  425. params['js_code'] = res.code;
  426. params['name'] = 'community';
  427. params['app_type'] = 1;
  428. that.jsCode = res.code;
  429. // let operation = 'miniprogram/getOpenid'; //发起请求
  430. that.$http.getOpenid(params).then(res => {
  431. //获取成功
  432. if (res.data.result_code == 1) {
  433. //openid存入缓存
  434. uni.setStorageSync("openid", res.data.openid);
  435. uni.setStorageSync("appletType", res.data.appletType);
  436. that.$u.vuex('vuex_appletType', res.data.appletType);
  437. that.openid = res.data.openid
  438. that.sessionKey = res.data.sessionKey
  439. that.getMemberByOpenid(res.data.openid);
  440. } else {
  441. app.globalData.oneFailHint(res.data.result_msg);
  442. }
  443. }).catch(err => {});
  444. }
  445. });
  446. },
  447. //根据openid获取用户信息
  448. async getMemberByOpenid(openid) {
  449. let _this = this;
  450. let params = {};
  451. params['openid'] = openid;
  452. // let operation = 'miniprogram/getMemberByOpenid';
  453. let res = await this.$http.getMemberByOpenid(params)
  454. if (res.data.result_code == 1) {
  455. app.globalData.member = res.data.member;
  456. uni.setStorageSync("myPhone", res.data.member.phone);
  457. that.$u.vuex('vuex_member', res.data.member)
  458. app.globalData.anyHousePass = res.data.anyHousePass; //获取房屋列表
  459. _this.getResidentialListByMember();
  460. _this.fetchAuthRecordNum()
  461. _this.getOwnRoomList()
  462. } else {
  463. uni.removeStorageSync("personTel");
  464. uni.removeStorageSync("plotName");
  465. uni.removeStorageSync("residentialId");
  466. uni.removeStorageSync("doorNeedAudit");
  467. uni.removeStorageSync("myPhone");
  468. uni.removeStorageSync("residentialList");
  469. }
  470. },
  471. getOwnRoomList() {
  472. let params = {
  473. memberId: this.vuex_member.id
  474. }
  475. this.$http.getHouseUserCondition(params).then(res => {
  476. let list = res.data.data
  477. list.forEach(item => {
  478. item.address = item.residentialName + "-" + item.buildingName + "-" + item
  479. .unitName + "-" + item.roomName
  480. })
  481. getApp().globalData.own_room_list = list;
  482. this.$u.vuex('vuex_own_room_list', list)
  483. })
  484. },
  485. /**
  486. * 游客登陆
  487. */
  488. async touristLogin() {
  489. // 检查是否登录
  490. this.isLogin = this.$auth.isAuth
  491. if (!this.$auth.isAuth) { // 就算是游客,也重新登录
  492. let resp = await this.$api.touristLogin()
  493. let userType = this.$global.userType.tourist
  494. this.$auth.login(userType, resp.sessionId, resp.userId, resp)
  495. } else {
  496. console.log(`已登录!`)
  497. }
  498. },
  499. //根据会员id获取我的房屋列表
  500. getResidentialListByMember: function() {
  501. let that = this;
  502. let params = {};
  503. if (this.$isEmpty(app.globalData.member)) {
  504. return
  505. }
  506. params['id'] = app.globalData.member.id;
  507. this.$http.getResidentialListByMember(params).then(res => {
  508. if (this.$isEmpty(res.data.data)) {
  509. return
  510. }
  511. let list = [];
  512. let doorNeedAuditList = []
  513. let residentialIdList = [];
  514. let personTelList = []
  515. if (res.data.success) {
  516. this.$u.vuex('vuex_residentialList',res.data.data)
  517. that.fetchNoticeList(res.data.data[0].residentialId);
  518. app.globalData.userId = res.data.data[0].userId
  519. res.data.data.forEach(item => {
  520. list.push(item.name);
  521. doorNeedAuditList.push(item.doorNeedAudit)
  522. residentialIdList.push(item.id);
  523. personTelList.push(item.personPhone)
  524. })
  525. if (list.length < 1) {
  526. uni.removeStorageSync("personTel");
  527. uni.removeStorageSync("plotName");
  528. uni.removeStorageSync("residentialId");
  529. uni.removeStorageSync("doorNeedAudit");
  530. } else {
  531. //获取本地储存的当前所在小区
  532. let plot = that.plot;
  533. if (uni.getStorageSync('plotName')) {
  534. plot = uni.getStorageSync('plotName');
  535. that.setData({
  536. plot: plot
  537. });
  538. } else {
  539. uni.setStorageSync("personTel", personTelList[0]);
  540. uni.setStorageSync("doorNeedAudit", doorNeedAuditList[0]);
  541. uni.setStorageSync("plotName", list[0]);
  542. uni.setStorageSync("residentialId", residentialIdList[0]);
  543. that.setData({
  544. plot: list[0]
  545. });
  546. }
  547. }
  548. let residentialList = []
  549. list.forEach((item, index) => {
  550. let tmp = {}
  551. tmp.residentialName = item
  552. tmp.personTel = personTelList[index]
  553. tmp.residentialId = residentialIdList[index]
  554. tmp.doorNeedAudit = doorNeedAuditList[index]
  555. tmp.estateTel = doorNeedAuditList[index]
  556. residentialList.push(tmp)
  557. })
  558. uni.setStorage({
  559. key: "residentialList",
  560. data: residentialList
  561. })
  562. //为 小区 picker 设置默认项
  563. let defaultPlotId = uni.getStorageSync("residentialId")
  564. if (!that.$isEmpty(defaultPlotId)) {
  565. let item= this.vuex_residentialList.find(item=>item.id==defaultPlotId)
  566. this.$u.vuex('vuex_tenantId',item.tenantId)
  567. console.log(item,"456");
  568. that.plotIndex = residentialIdList.indexOf(defaultPlotId)
  569. }
  570. that.setData({
  571. plotArray: list,
  572. residentialIdList: residentialIdList
  573. });
  574. }
  575. });
  576. },
  577. /**
  578. * 跳转
  579. * @param {Object} index 当前项的index属性,而不是当前项的下标
  580. */
  581. top: function(index) {
  582. if (index == 99) {
  583. //查看更多
  584. uni.navigateTo({
  585. url: "../tool-list/tool-list"
  586. })
  587. return
  588. }
  589. if (index == 9) {
  590. uni.navigateToMiniProgram({
  591. appId: 'wx2eec5fb00157a603',
  592. })
  593. return
  594. }
  595. if (!this.vuex_isAuth) {
  596. this.plot = ''
  597. this.noticeList = []
  598. this.$refs.login.show()
  599. return
  600. }
  601. var that = this;
  602. var member = app.globalData.member;
  603. var anyHousePass = app.globalData.anyHousePass; //会员认证状态:{ 0:未认证,1:待审审核,2:已认证 }
  604. if (this.$isEmpty(member)) {
  605. //去注册
  606. uni.navigateTo({
  607. url: "../empty/empty"
  608. })
  609. return
  610. } else if (member.state == 0 && !anyHousePass) {
  611. //去认证
  612. uni.navigateTo({
  613. url: "../empty/empty?type=2"
  614. })
  615. return
  616. } else if (member.state == 1 && !anyHousePass) {
  617. //待审核
  618. that.pending();
  619. } else if (member.state == 2 || anyHousePass) {
  620. //已认证
  621. //获取页面传过来的值
  622. var url;
  623. switch (index) {
  624. case 1:
  625. //我的家人
  626. url = '/pages/myhome/myhome';
  627. break;
  628. case 2:
  629. //家庭成员
  630. url = '/pages/myFamily/myFamily';
  631. break;
  632. case 3:
  633. //我的车辆
  634. url = "/pages/myCar/myCar";
  635. break;
  636. case 4:
  637. //访客授权
  638. url = '/pages/authorize_record/authorize_record';
  639. break;
  640. case 5:
  641. if (this.$isEmpty(this.device_list)) {
  642. uni.showToast({
  643. title: "暂无设备",
  644. icon: "none"
  645. })
  646. return
  647. }
  648. if (this.device_list.length == 1) {
  649. this.open(this.device_list[0])
  650. } else {
  651. this.modalShow = !this.modalShow
  652. }
  653. break;
  654. case 6:
  655. //防疫登记
  656. url = '/pages/tool-list/epidemic-pass/epidemic-pass';
  657. break;
  658. case 7:
  659. //物业缴费
  660. uni.showToast({
  661. title: "待开发",
  662. icon: "none"
  663. })
  664. break;
  665. case 8:
  666. //物业报修
  667. url = '/pages/services/property/property';
  668. break;
  669. case 9:
  670. // url = '/pages/healthCode/healthCode';
  671. break;
  672. default:
  673. url = "";
  674. break;
  675. }
  676. if (url != '') {
  677. uni.navigateTo({
  678. url: url,
  679. success: function(res) {
  680. that.setData({
  681. firstJump: false
  682. });
  683. }
  684. });
  685. }
  686. }
  687. },
  688. openBluetoothAdapter: function() {
  689. uni.openBluetoothAdapter({
  690. success: function(res) {
  691. uni.navigateTo({
  692. url: "/pages/bluetooth/bluetooth"
  693. });
  694. },
  695. fail: function(res) {
  696. uni.showModal({
  697. content: '请开启手机蓝牙后再试'
  698. });
  699. }
  700. });
  701. },
  702. //用户信息待审核中
  703. pending: function() {
  704. var openid = uni.getStorageSync("openid");
  705. let params = {};
  706. params['openid'] = openid;
  707. // let operation = 'miniprogram/getMemberByOpenid';
  708. this.$http.getMemberByOpenid(params).then(res => {
  709. //获取成功
  710. if (res.data.result_code == 1) {
  711. let member = res.data.member; //待审核
  712. if (member.state == 1 && !res.data.anyHousePass) {
  713. app.globalData.oneFailHint('你的信息正在审核,请耐心等待');
  714. } else if (member.state == 2) {
  715. app.globalData.oneFailHint('亲,你的信息已审核通过');
  716. that.getResidentialListByMember()
  717. }
  718. app.globalData.member = member;
  719. app.globalData.anyHousePass = res.data.anyHousePass;
  720. } else {
  721. app.globalData.oneFailHint(res.data.result_msg);
  722. }
  723. });
  724. },
  725. goNoticeDetail(item) {
  726. app.globalData.noticeDetail = item
  727. uni.navigateTo({
  728. url: "../notice/detail",
  729. })
  730. }
  731. }
  732. }
  733. </script>
  734. <style lang="scss">
  735. .img1-lg {
  736. margin-top: -80rpx;
  737. }
  738. .location_item {
  739. background-color: #FFFFFF;
  740. display: flex;
  741. padding: 30rpx;
  742. font-size: 32rpx;
  743. }
  744. .active {
  745. transform: none;
  746. transition: all 0.2s ease-in 0s;
  747. }
  748. .tj-title {
  749. display: flex;
  750. justify-content: space-between;
  751. padding: 30rpx;
  752. background-color: #FFFFFF;
  753. font-size: 32rpx;
  754. .sub-title {
  755. font-size: 26rpx;
  756. padding-left: 16rpx;
  757. color: #c7c7c7;
  758. }
  759. }
  760. .nav-list {
  761. display: flex;
  762. flex-wrap: wrap;
  763. justify-content: center;
  764. }
  765. .nav-li {
  766. padding: 30upx 20rpx;
  767. border-radius: 12upx;
  768. width: 40%;
  769. margin: 20rpx 1% 10upx;
  770. // background-image: url(/static/unicorn-base/index/cc3b1807-c684-4b83-8f80-80e5b8a6b975.png);
  771. background-size: cover;
  772. background-position: center;
  773. position: relative;
  774. z-index: 1;
  775. }
  776. .nav-li::after {
  777. content: "";
  778. position: absolute;
  779. z-index: -1;
  780. background-color: inherit;
  781. width: 100%;
  782. height: 100%;
  783. left: 0;
  784. bottom: -10%;
  785. border-radius: 10upx;
  786. opacity: 0.2;
  787. transform: scale(0.9, 0.9);
  788. }
  789. .nav-li.cur {
  790. color: #fff;
  791. background: rgb(94, 185, 94);
  792. box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
  793. }
  794. .nav-title {
  795. font-size: 32upx;
  796. font-weight: 300;
  797. }
  798. .nav-title::first-letter {
  799. font-size: 40upx;
  800. margin-right: 4upx;
  801. }
  802. .nav-name {
  803. font-size: 28upx;
  804. text-transform: Capitalize;
  805. margin-top: 20upx;
  806. position: relative;
  807. }
  808. .nav-name::before {
  809. content: "";
  810. position: absolute;
  811. display: block;
  812. width: 40upx;
  813. height: 6upx;
  814. background: #fff;
  815. bottom: 0;
  816. right: 0;
  817. opacity: 0.5;
  818. }
  819. .nav-name::after {
  820. content: "";
  821. position: absolute;
  822. display: block;
  823. width: 100upx;
  824. height: 1px;
  825. background: #fff;
  826. bottom: 0;
  827. right: 40upx;
  828. opacity: 0.3;
  829. }
  830. .nav-name::first-letter {
  831. font-weight: bold;
  832. font-size: 36upx;
  833. margin-right: 1px;
  834. }
  835. .nav-li image {
  836. position: absolute;
  837. right: 30upx;
  838. top: 30upx;
  839. font-size: 52upx;
  840. width: 70upx;
  841. height: 70upx;
  842. text-align: center;
  843. line-height: 60upx;
  844. }
  845. </style>