index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883
  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" 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" 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/open1.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-orange badge" v-if="item.badge>0">{{item.badge}}</view>
  50. </view>
  51. </view>
  52. <!-- 设备列表 -->
  53. <view v-if="modalShow==true" class="flex justify-around margin-top-30" >
  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/home/kaimen.png"/>
  56. <view class="text-center padding-top-20" 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. modalShow:false,
  111. //开门设备列表
  112. device_list: [],
  113. background: {
  114. backgroundColor: '#e54d42',
  115. },
  116. noticeList:[],
  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:0,
  202. index:4
  203. },
  204. ]
  205. }
  206. },
  207. onShow() {
  208. //从功能列表一键开门跳转过来的,打开开门设备列表
  209. this.modalShow=getApp().globalData.openDoor
  210. //处理进入小程序的不同场景
  211. this.execParam();
  212. this.loadData()
  213. //每次打开此页面都把商品数组打乱
  214. this.$u.randomArray(this.goodsList)
  215. if(this.isFirst){
  216. this.isFirst=false
  217. }else{
  218. this.getRoomByMemberId()
  219. }
  220. },
  221. onLoad(options) {
  222. that=this
  223. //处理进入小程序的场景
  224. this.handelShare(options)
  225. this.isFirst=true
  226. //拉取后台用户信息
  227. this.getOpenId();
  228. this.isIPX=uni.getStorageSync('isIPX')
  229. //获取轮播列表
  230. this.getAdList();
  231. //获取推荐商品列表
  232. this.fetchGoodsList()
  233. },
  234. methods: {
  235. open(id){
  236. //进度条加载
  237. this.isloading=true
  238. let that=this
  239. setTimeout(()=>{
  240. that.openDoor(id)
  241. },2300)
  242. },
  243. //立即开门
  244. openDoor: function (id) {
  245. let device_id=id
  246. let that = this;
  247. let params = {};
  248. params['member_id'] = app.globalData.member.id;
  249. params['device_id'] = device_id;
  250. let operation = 'member/openDoor';
  251. app.globalData.postRequest(params, operation, function (res) {
  252. that.isloading=false
  253. app.globalData.oneFailHint(res.data.result_msg,function(){
  254. that.modalShow=false
  255. });
  256. });
  257. },
  258. getAuthDevice: function () {
  259. let that = this;
  260. let params = {};
  261. params['member_id'] = app.globalData.member.id;
  262. let operation = 'member/getAuthDeviceByMemberId';
  263. app.globalData.postRequest(params, operation, function (res) {
  264. console.info("设备列表:" ,res.data); //获取成功
  265. if (res.data.result_code == 1) {
  266. let list = [];
  267. if (uni.getStorageSync('plotName')) {
  268. res.data.list.map(item => {
  269. if (item.residentialId.indexOf(uni.getStorageSync('residentialId'))>=0) {
  270. list.push(item);
  271. }
  272. });
  273. } else {
  274. console.log(res.data.list)
  275. list = res.data.list;
  276. }
  277. console.log(list)
  278. that.setData({
  279. device_list: list
  280. });
  281. app.globalData.device_list = list;
  282. }
  283. });
  284. },
  285. async loadData(options){
  286. //进入小程序时进行游客登陆,
  287. //以免直接进入商品详情时会提示用户未授权
  288. await this.$nextTick(function(){
  289. this.touristLogin()
  290. })
  291. //加载通知公告
  292. this.fetchNoticeList()
  293. },
  294. getParam(e){
  295. // 用来保存所有的属性名称和值
  296. let param = "";
  297. // 开始遍历
  298. for(let p in e){
  299. // 方法
  300. if(typeof(e[p])!="function" && p != 'type'){
  301. // p 为属性名称,e[p]为对应属性的值
  302. param += (param.length > 1 ? '&' : '') + p + "=" + e[p];
  303. }
  304. }
  305. // 最后显示所有的属性
  306. return param;
  307. },
  308. execParam(){
  309. let _this = this;
  310. if(this.e != null){
  311. setTimeout(function(){
  312. if(_this.e == null) return;
  313. if(_this.e.type == "share"){
  314. let path = _this.e.path == null || _this.e.path.length <= 0 ? 'pagesM/pages/goods_des' : '/' + _this.e.path;
  315. let param = _this.getParam(_this.e);
  316. let url = `${path}?${param}`;
  317. console.error("url = " + url);
  318. _this.e = null;
  319. uni.navigateTo({url: url});
  320. }
  321. }, 1000);
  322. }
  323. },
  324. handelShare(options){
  325. //二维码扫描链接 start
  326. if (!this.$isEmpty(options.scene)) {
  327. let scene=decodeURIComponent(options.scene).split(",")
  328. //从小程序二维码进入
  329. console.log(scene);
  330. let path="/pagesM/pages/goods_des"
  331. let params= "?id="+scene[0]+"&storeId="+scene[1]
  332. if (!this.$isEmpty(scene[2])) {
  333. params=params+"&inviteCode="+scene[2]
  334. }
  335. let url=path+params
  336. console.log(url);
  337. uni.redirectTo({
  338. url:url
  339. })
  340. }
  341. //二维码扫描链接 end
  342. //点击转发卡片进入的小程序
  343. this.execParam();
  344. wx.showShareMenu({
  345. withShareTicket: true
  346. })
  347. },
  348. tab(index){
  349. console.log(index);
  350. },
  351. jump(url,type){
  352. if(!this.$isEmpty(type)){
  353. uni.switchTab({
  354. url:url
  355. })
  356. }else{
  357. uni.navigateTo({
  358. url:url
  359. })
  360. }
  361. },
  362. /**
  363. * 获取商品推荐列表
  364. */
  365. async fetchGoodsList(){
  366. let indexProduct = await this.$api.storeHomeProducts();
  367. this.goodsList=indexProduct[1].products
  368. this.$u.randomArray(this.goodsList)
  369. },
  370. //轮播圆点
  371. bindchange(e) {
  372. this.setData({
  373. swiperIndex: e.detail.current
  374. });
  375. },
  376. //改变小区
  377. typeChange: function (e) {
  378. let _this = this;
  379. Promise.all([_this.getRoomByMemberId()]).then(result => {
  380. let value = _this.plotArray[e.detail.value];
  381. let residentialId = _this.residentialIdList[e.detail.value];
  382. let residentialList= uni.getStorageSync('residentialList')
  383. uni.setStorageSync("personTel", residentialList[e.detail.value].personTel);
  384. uni.setStorageSync("plotName", value);
  385. uni.setStorageSync("residentialId", residentialId);
  386. uni.setStorageSync('doorNeedAudit',residentialList[e.detail.value].doorNeedAudit)
  387. _this.setData({
  388. plotIndex: e.detail.value,
  389. plot: value
  390. });
  391. //更新设备列表
  392. _this.getAuthDevice()
  393. }).catch(error => {
  394. console.log(error);
  395. });
  396. },
  397. //一键开门
  398. goOpen: function () {
  399. var that = this;
  400. var member = app.globalData.member;
  401. var anyHousePass = app.globalData.anyHousePass; //会员认证状态:{ 0:未认证,1:待审审核,2:已认证 }
  402. if (member == null) {
  403. //未注册
  404. app.globalData.footaddmore();
  405. return;
  406. } else if (member.state == 0 && !anyHousePass) {
  407. //未认证
  408. app.globalData.choosePlot();
  409. return;
  410. } else if (member.state == 1 && !anyHousePass) {
  411. //待审核
  412. that.pending();
  413. return;
  414. } else if (member.state == 2 || anyHousePass) {
  415. //已认证
  416. uni.navigateTo({
  417. url: '/pages/oneButton/oneButton'
  418. });
  419. }
  420. },
  421. /**
  422. * 获取轮播图列表
  423. */
  424. getAdList: function () {
  425. let that = this;
  426. let params = {};
  427. let operation = 'adPushApp/getList';
  428. app.globalData.postRequest(params, operation, function (res) {
  429. //获取成功
  430. if (res.data.result_code == 1) {
  431. let adList = res.data.list;
  432. if (adList && adList.length > 0) {
  433. that.setData({
  434. adList: adList
  435. });
  436. }
  437. }
  438. });
  439. },
  440. fetchNoticeList(){
  441. let that=this
  442. let operation='notice/noticeList'
  443. let params={}
  444. app.globalData.postRequest(params, operation, function (res) {
  445. //获取成功
  446. that.noticeList=res.data.noticeList
  447. });
  448. },
  449. //获取openid
  450. getOpenId: function () {
  451. var that = this;
  452. uni.login({
  453. success: res => {
  454. let params = {};
  455. params['js_code'] = res.code;
  456. params['name'] = 'community';
  457. that.jsCode=res.code
  458. let operation = 'miniprogram/getOpenid'; //发起请求
  459. app.globalData.postRequest(params, operation, function (res) {
  460. //获取成功
  461. if (res.data.result_code == 1) {
  462. console.log("获取openid成功")
  463. //openid存入缓存
  464. uni.setStorageSync("openid", res.data.openid);
  465. uni.setStorageSync("appletType", res.data.appletType);
  466. that.openid=res.data.openid
  467. that.sessionKey=res.data.sessionKey
  468. that.getMemberByOpenid(res.data.openid);
  469. } else {
  470. app.globalData.oneFailHint(res.data.result_msg);
  471. }
  472. });
  473. }
  474. });
  475. },
  476. //根据openid获取用户信息
  477. getMemberByOpenid: function (openid) {
  478. let _this = this;
  479. let params = {};
  480. params['openid'] = openid;
  481. let operation = 'miniprogram/getMemberByOpenid';
  482. app.globalData.postRequest(params, operation, function (res) {
  483. console.info("getMemberByOpenid==" + res.data.result_msg); //获取成功
  484. if (res.data.result_code == 1) {
  485. app.globalData.member = res.data.member;
  486. that.$u.vuex('vuex_member',res.data.member)
  487. app.globalData.anyHousePass = res.data.anyHousePass; //获取房屋列表
  488. _this.getRoomByMemberId();
  489. _this.getAuthDevice()
  490. } else {
  491. }
  492. });
  493. },
  494. /**
  495. * 游客登陆
  496. */
  497. async touristLogin() {
  498. // 检查是否登录
  499. this.isLogin = this.$auth.isAuth
  500. console.log(this.$auth.isAuth);
  501. if (!this.$auth.isAuth) { // 就算是游客,也重新登录
  502. console.log('需要使用游客身份,执行游客登录!')
  503. let resp = await this.$api.touristLogin()
  504. console.log("Resp",resp);
  505. let userType = this.$global.userType.tourist
  506. this.$auth.login(userType, resp.sessionId, resp.userId, resp)
  507. console.log('游客登录成功!', resp)
  508. } else {
  509. console.log(`已登录!`)
  510. }
  511. },
  512. //根据会员id获取我的房屋列表
  513. getRoomByMemberId: function () {
  514. let that = this;
  515. let params = {};
  516. params['member_id'] = app.globalData.member.id;
  517. let operation = 'estate/getRoomByMemberId';
  518. app.globalData.postRequest(params, operation, function (res) {
  519. console.info("获取成功" , res.data); //获取成功
  520. let list = [];
  521. let doorNeedAuditList=[]
  522. let residentialIdList = [];
  523. let personTelList=[]
  524. if (res.data.result_code == 1) {
  525. app.globalData.userId=res.data.list[0].userId
  526. res.data.list.map(item => {
  527. if (list.indexOf(item.residentialName) == -1) {
  528. list.push(item.residentialName);
  529. doorNeedAuditList.push(item.doorNeedAudit)
  530. residentialIdList.push(item.residentialId);
  531. personTelList.push(item.personTel)
  532. }
  533. });
  534. if (list.length < 1) {
  535. uni.removeStorageSync("personTel");
  536. uni.removeStorageSync("plotName");
  537. uni.removeStorageSync("residentialId");
  538. uni.removeStorageSync("doorNeedAudit");
  539. } else {
  540. //获取本地储存的当前所在小区
  541. let plot = that.plot;
  542. if (uni.getStorageSync('plotName')) {
  543. plot = uni.getStorageSync('plotName');
  544. that.setData({
  545. plot: plot
  546. });
  547. } else {
  548. uni.setStorageSync("personTel", personTelList[0]);
  549. uni.setStorageSync("doorNeedAudit", doorNeedAuditList[0]);
  550. uni.setStorageSync("plotName", list[0]);
  551. uni.setStorageSync("residentialId", residentialIdList[0]);
  552. that.setData({
  553. plot: list[0]
  554. });
  555. }
  556. }
  557. let residentialList=[]
  558. list.forEach((item,index)=>{
  559. let tmp={}
  560. tmp.personTel=personTelList[index]
  561. tmp.residentialId=residentialIdList[index]
  562. tmp.doorNeedAudit=doorNeedAuditList[index]
  563. tmp.estateTel=doorNeedAuditList[index]
  564. residentialList.push(tmp)
  565. })
  566. uni.setStorage({
  567. key:"residentialList",
  568. data:residentialList
  569. })
  570. //为 小区 picker 设置默认项
  571. let defaultPlotId=uni.getStorageSync("residentialId")
  572. if (!that.$isEmpty(defaultPlotId)) {
  573. that.plotIndex=residentialIdList.indexOf(defaultPlotId)
  574. }
  575. that.setData({
  576. plotArray: list,
  577. residentialIdList: residentialIdList
  578. });
  579. }
  580. });
  581. },
  582. /**
  583. * 跳转
  584. * @param {Object} index 当前项的index属性,而不是当前项的下标
  585. */
  586. top: function (index) {
  587. if (index==5) {
  588. if (this.$isEmpty(this.device_list)) {
  589. uni.showToast({
  590. title:"暂无设备",
  591. icon:"none"
  592. })
  593. return
  594. }
  595. this.modalShow=!this.modalShow
  596. return
  597. }
  598. if (index==99) {
  599. //查看更多
  600. uni.navigateTo({
  601. url:"../tool-list/tool-list"
  602. })
  603. return
  604. }
  605. var that = this;
  606. var member = app.globalData.member;
  607. var anyHousePass = app.globalData.anyHousePass; //会员认证状态:{ 0:未认证,1:待审审核,2:已认证 }
  608. if (this.$isEmpty(member)) {
  609. //去注册
  610. uni.navigateTo({
  611. url:"../empty/empty"
  612. })
  613. return
  614. } else if (member.state == 0 && !anyHousePass) {
  615. //去认证
  616. uni.navigateTo({
  617. url:"../empty/empty?type=2"
  618. })
  619. return
  620. } else if (member.state == 1 && !anyHousePass) {
  621. //待审核
  622. that.pending();
  623. } else if (member.state == 2 || anyHousePass) {
  624. //已认证
  625. //获取页面传过来的值
  626. var url;
  627. switch (index) {
  628. case 1:
  629. //我的家人
  630. url='/pages/myhome/myhome';
  631. break;
  632. case 2:
  633. //家庭成员
  634. url = '/pages/myFamily/myFamily';
  635. break;
  636. case 3:
  637. //我的车辆
  638. uni.showToast({
  639. title:"待开发",
  640. icon:"none"
  641. })
  642. break;
  643. case 4:
  644. //访客授权
  645. url = '/pages/authorize_record/authorize_record';
  646. break;
  647. case 5:
  648. //一键开门
  649. uni.switchTab({
  650. url:"../device/device"
  651. })
  652. break;
  653. case 6:
  654. //防疫登记
  655. url = '/pages/tool-list/epidemic-pass/epidemic-pass';
  656. break;
  657. case 7:
  658. //物业缴费
  659. uni.showToast({
  660. title:"待开发",
  661. icon:"none"
  662. })
  663. break;
  664. case 8:
  665. //物业报修
  666. url = '/pages/services/property/property';
  667. break;
  668. case 9:
  669. url = '/pages/healthCode/healthCode';
  670. break;
  671. default:
  672. url = "";
  673. break;
  674. }
  675. if (url != '') {
  676. uni.navigateTo({
  677. url: url,
  678. success: function (res) {
  679. that.setData({
  680. firstJump: false
  681. });
  682. }
  683. });
  684. }
  685. }
  686. },
  687. openBluetoothAdapter: function () {
  688. uni.openBluetoothAdapter({
  689. success: function (res) {
  690. uni.navigateTo({
  691. url: "/pages/bluetooth/bluetooth"
  692. });
  693. },
  694. fail: function (res) {
  695. uni.showModal({
  696. content: '请开启手机蓝牙后再试'
  697. });
  698. }
  699. });
  700. },
  701. //用户信息待审核中
  702. pending: function () {
  703. var openid = uni.getStorageSync("openid");
  704. let params = {};
  705. params['openid'] = openid;
  706. let operation = 'miniprogram/getMemberByOpenid';
  707. app.globalData.postRequest(params, operation, function (res) {
  708. //获取成功
  709. if (res.data.result_code == 1) {
  710. let member = res.data.member; //待审核
  711. if (member.state == 1 && !res.data.anyHousePass) {
  712. app.globalData.oneFailHint('亲,你的信息正在审核,请耐心等待');
  713. } else if (member.state == 2) {
  714. app.globalData.oneFailHint('亲,你的信息已审核通过');
  715. that.getRoomByMemberId()
  716. }
  717. app.globalData.member = member;
  718. app.globalData.anyHousePass = res.data.anyHousePass;
  719. } else {
  720. app.globalData.oneFailHint(res.data.result_msg);
  721. }
  722. });
  723. },
  724. goNoticeDetail(item){
  725. app.globalData.noticeDetail=item
  726. uni.navigateTo({
  727. url:"../notice/detail",
  728. })
  729. }
  730. }
  731. }
  732. </script>
  733. <style lang="scss">
  734. .img1-lg{
  735. margin-top: -80rpx;
  736. }
  737. .location_item{
  738. background-color: #FFFFFF;
  739. display: flex;
  740. padding: 30rpx;
  741. font-size: 32rpx;
  742. }
  743. .active {
  744. transform: none;
  745. transition: all 0.2s ease-in 0s;
  746. }
  747. .tj-title{
  748. display: flex;
  749. justify-content: space-between;
  750. padding: 30rpx;
  751. background-color: #FFFFFF;
  752. font-size: 32rpx;
  753. .sub-title{
  754. font-size: 26rpx;
  755. padding-left: 16rpx;
  756. color: #c7c7c7;
  757. }
  758. }
  759. .nav-list {
  760. display: flex;
  761. flex-wrap: wrap;
  762. justify-content: center;
  763. }
  764. .nav-li {
  765. padding: 30upx 20rpx;
  766. border-radius: 12upx;
  767. width: 40%;
  768. margin: 20rpx 1% 10upx;
  769. // background-image: url(/static/unicorn-base/index/cc3b1807-c684-4b83-8f80-80e5b8a6b975.png);
  770. background-size: cover;
  771. background-position: center;
  772. position: relative;
  773. z-index: 1;
  774. }
  775. .nav-li::after {
  776. content: "";
  777. position: absolute;
  778. z-index: -1;
  779. background-color: inherit;
  780. width: 100%;
  781. height: 100%;
  782. left: 0;
  783. bottom: -10%;
  784. border-radius: 10upx;
  785. opacity: 0.2;
  786. transform: scale(0.9, 0.9);
  787. }
  788. .nav-li.cur {
  789. color: #fff;
  790. background: rgb(94, 185, 94);
  791. box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
  792. }
  793. .nav-title {
  794. font-size: 32upx;
  795. font-weight: 300;
  796. }
  797. .nav-title::first-letter {
  798. font-size: 40upx;
  799. margin-right: 4upx;
  800. }
  801. .nav-name {
  802. font-size: 28upx;
  803. text-transform: Capitalize;
  804. margin-top: 20upx;
  805. position: relative;
  806. }
  807. .nav-name::before {
  808. content: "";
  809. position: absolute;
  810. display: block;
  811. width: 40upx;
  812. height: 6upx;
  813. background: #fff;
  814. bottom: 0;
  815. right: 0;
  816. opacity: 0.5;
  817. }
  818. .nav-name::after {
  819. content: "";
  820. position: absolute;
  821. display: block;
  822. width: 100upx;
  823. height: 1px;
  824. background: #fff;
  825. bottom: 0;
  826. right: 40upx;
  827. opacity: 0.3;
  828. }
  829. .nav-name::first-letter {
  830. font-weight: bold;
  831. font-size: 36upx;
  832. margin-right: 1px;
  833. }
  834. .nav-li image {
  835. position: absolute;
  836. right: 30upx;
  837. top: 30upx;
  838. font-size: 52upx;
  839. width: 70upx;
  840. height: 70upx;
  841. text-align: center;
  842. line-height: 60upx;
  843. }
  844. </style>