index.vue 24 KB

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