index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872
  1. <template>
  2. <view class="content">
  3. <view class="">
  4. <!-- <view class="cu-modal" :class="modalShow?'show':''" @tap="modalShow=false">
  5. <view class="cu-dialog" @tap.stop="">
  6. <view class="bg-white" style="height: 20rpx;"></view>
  7. <radio-group class="block" @change="RadioChange">
  8. <view class="cu-list menu text-left">
  9. <view class="cu-item" v-for="(item,index) in device_list" :key="index">
  10. <label class="flex justify-between align-center flex-sub">
  11. <view class="flex-sub margin-left-sm">{{item.name}}</view>
  12. <radio class="roundn blue" :class="doorValue==item.id?'checked':''" :checked="doorValue==item.id?true:false"
  13. :value="item.id"></radio>
  14. </label>
  15. </view>
  16. </view>
  17. </radio-group>
  18. <view class="bg-white" style="height: 120rpx;"></view>
  19. </view>
  20. </view> -->
  21. <loading isFullScreen color="#2f7ff5" :active="isloading" text="开门中..."></loading>
  22. <u-navbar :is-back="false" title=" ">
  23. <view class="slot-wrap">
  24. <picker @change="typeChange" :value="plotIndex" :range="plotArray">
  25. <view class="padding-left-20 ">
  26. <u-icon name="map" size="34"></u-icon>
  27. <text class="padding-left-sm " style="font-size: 34rpx;">{{plot?plot:'暂无小区信息'}}</text>
  28. </view>
  29. </picker>
  30. </view>
  31. </u-navbar>
  32. <!-- 头图 -->
  33. <swiper class="screen-swiper square-dot " :indicator-dots="true" :circular="true"
  34. :autoplay="true" interval="5000" duration="500">
  35. <swiper-item v-for="(item,index) in adList" :key="index">
  36. <image v-if="item.videoType==0" :src="item.videoUri" mode="aspectFill" ></image>
  37. <video v-if="item.videoType==1" :src="item.videoUri" autoplay loop muted :show-play-btn="false" :controls="false" objectFit="cover"></video>
  38. </swiper-item>
  39. </swiper>
  40. <view class="">
  41. <view class="bg-white" style="height: 10rpx;"></view>
  42. <hotConsult @onTap="jump('../notice/notice')" @detailTap="jump('../notice/detail')" :swiperTexts="swiperTexts"></hotConsult>
  43. </view>
  44. <view style="background-color: #FFFFFF;">
  45. <view style="padding: 30rpx 30rpx 0 30rpx;">
  46. <text class="text-bold text-lg">智慧社区</text>
  47. </view>
  48. <view style="padding: 40rpx 10rpx 0rpx;" class="cu-list grid col-5 no-border" >
  49. <view class="cu-item" :class="item.index==5?'img1-lg':''" @click="top(item.index)" v-for="(item,index) in gridList" :key="index">
  50. <block v-if="item.index==5">
  51. <view class="grid-icon" >
  52. <image style="width: 100rpx;height: 100rpx;" :src="modalShow?'../../static/grid1/kaisuo1.png':'../../static/grid1/kaisuo0.png'"/>
  53. </view>
  54. <text style="color: #333333;font-size: 30rpx;font-weight: 800;" >{{item.title}}</text>
  55. </block>
  56. <block v-else>
  57. <view class="grid-icon" >
  58. <image style="width: 48rpx;height: 48rpx;" :src="item.icon"/>
  59. </view>
  60. <text style="color: #333333;font-size: 26rpx;" >{{item.title}}</text>
  61. </block>
  62. <view class="cu-tag bg-orange badge" v-if="item.badge>0">{{item.badge}}</view>
  63. </view>
  64. </view>
  65. <view v-if="modalShow==true" class="flex justify-around margin-top-30" >
  66. <view @click="open" v-for="(item,index) in device_list" :key="index" style="flex-direction: column;" class="flex justify-center align-center">
  67. <image style="width: 60rpx;height: 60rpx;" src="../../static/grid1/kaimen.png"/>
  68. <view class="text-center padding-top-20" style="font-size: 24rpx;">
  69. {{item.name}}
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="nav-list bg-white padding-top-20" >
  75. <view hover-class="none"
  76. @click="top(item.index)"
  77. class="nav-li light" navigateTo :style="{backgroundColor:item.color}"
  78. v-for="(item,index) in elements" :key="index">
  79. <view class="nav-title" style="color: #000000;font-size: 28rpx;">{{item.title}}</view>
  80. <view class="" style="padding-top: 10rpx;font-size: 24rpx;color: #acacac;">{{item.name}}</view>
  81. <image :src="item.icon" mode=""></image>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="bg-white">
  86. <image src="/static/banner.png" style="width: 100%;" mode="widthFix"></image>
  87. </view>
  88. <view >
  89. <view class="tj-title">
  90. <view class="">
  91. <text class="text-lg text-bold">为您推荐</text>
  92. <text class="sub-title">有料</text>
  93. <text class="sub-title">好物</text>
  94. <text class="sub-title">有优惠</text>
  95. </view>
  96. <view class="sub-title" style="color: #969696;padding-top: 8rpx;font-size: 24rpx;" @click="jump('/pages/life/life','type')">
  97. <text >查看更多></text>
  98. </view>
  99. </view>
  100. <view>
  101. <goods :goodsList="goodsList"></goods>
  102. </view>
  103. </view>
  104. <view style="height: 80rpx;">
  105. <u-divider bgColor="#f1f1f1;" height="80">到底了</u-divider>
  106. </view>
  107. </view>
  108. </template>
  109. <script>
  110. import loading from "@/comps/loading/loading.vue"
  111. import hotConsult from "@/comps/hot-consult/hot-consult.vue"
  112. import goods from "@/comps/goods/goods.vue"
  113. var app = getApp();
  114. let that;
  115. export default {
  116. components:{
  117. goods,hotConsult,loading
  118. },
  119. data() {
  120. return {
  121. isloading:false,
  122. modalShow:false,
  123. //开门设备列表
  124. doorValue:'',
  125. device_list: [],
  126. background: {
  127. backgroundColor: '#e54d42',
  128. },
  129. swiperTexts:[
  130. {
  131. title:'疫情期间,出入小区请佩戴好口罩,配合门卫大叔做好测温登记工作。谢谢大家的配合。'
  132. },
  133. {
  134. title:'停水停电通知。市政通水设施突发性故障抢修,本小区供水压力暂受影响,敬请做好储水准备,预约影响时间2020年11月28号22时至11月29号16时,由此给您带来不便,敬请谅解。'
  135. },
  136. {
  137. title:'2020年10月1日-2020年10月8日,中秋 国庆节放假,假期间需注意,祝国庆节玩的开心。'
  138. },
  139. {
  140. title:'疫情期间,出入小区请佩戴好口罩,配合门卫大叔做好测温登记工作。谢谢大家的配合。'
  141. }
  142. ],
  143. userInfo:{},
  144. jsCode:'',
  145. openid:'',
  146. sessionKey:'',
  147. isFirst:false,
  148. goodsList:[],
  149. isIPX:false,
  150. //广告轮播图
  151. swiperIndex: 0,
  152. plot: null,
  153. plotArray: [],
  154. //小区名字
  155. plotIndex: 0,
  156. residentialIdList: [] ,//小区id
  157. adList: [
  158. {
  159. 'videoType': 0,
  160. 'videoUri': "http://139.9.103.171:1888/miniofile/app/abcd.png"
  161. },
  162. ],
  163. elements: [{
  164. title: '防疫登记',
  165. name: '在线防疫登记',
  166. color: '#e3f5ff',
  167. icon: '../../static/home/fanyi1.png',
  168. index:6
  169. }, {
  170. title: '物业缴费',
  171. name: '在线物业缴费',
  172. color: '#e9f9f3',
  173. icon: '../../static/home/jiaofei.png',
  174. index:7
  175. },
  176. {
  177. title: '物业报修',
  178. name: '在线物业报修',
  179. color: '#ffefef',
  180. icon: '../../static/home/baoxiu1.png',
  181. index:8
  182. }, {
  183. title: '更多服务',
  184. name: '更多智慧服务',
  185. color: '#eeeeee',
  186. icon: '../../static/home/more.png',
  187. index:99
  188. }],
  189. gridList2:[
  190. {
  191. icon:'../../static/grid1/kaisuo.png',
  192. title:"A区",
  193. badge:0,
  194. index:1
  195. },
  196. {
  197. icon:'../../static/grid1/kaisuo.png',
  198. title:"D区",
  199. badge:0,
  200. index:1
  201. },
  202. ],
  203. gridList:[
  204. {
  205. icon:'../../static/grid1/fangwu.png',
  206. title:"我的房屋",
  207. badge:0,
  208. index:1
  209. },
  210. {
  211. icon:'../../static/grid1/renyuan.png',
  212. title:"家庭成员",
  213. badge:0,
  214. index:2
  215. },
  216. {
  217. icon:'../../static/grid1/kaisuo1.png',
  218. title:"开门",
  219. badge:0,
  220. index:5
  221. },
  222. {
  223. icon:'../../static/grid1/cheliang.png',
  224. title:"我的车辆",
  225. badge:0,
  226. index:3
  227. },
  228. {
  229. icon:'../../static/grid1/fangke1.png',
  230. title:"访客授权",
  231. badge:0,
  232. index:4
  233. },
  234. ]
  235. }
  236. },
  237. onShow() {
  238. //处理进入小程序的不同场景
  239. this.execParam();
  240. this.loadData()
  241. //每次打开此页面都把商品数组打乱
  242. this.$u.randomArray(this.goodsList)
  243. if(this.isFirst){
  244. this.isFirst=false
  245. }else{
  246. this.getRoomByMemberId()
  247. }
  248. },
  249. onLoad(options) {
  250. that=this
  251. //处理进入小程序的场景
  252. this.handelShare(options)
  253. this.isFirst=true
  254. //拉取后台用户信息
  255. this.getOpenId();
  256. this.isIPX=uni.getStorageSync('isIPX')
  257. //获取轮播列表
  258. this.getAdList();
  259. //获取推荐商品列表
  260. this.fetchGoodsList()
  261. },
  262. methods: {
  263. open(){
  264. //进度条加载
  265. this.isloading=true
  266. let that=this
  267. setTimeout(()=>{
  268. that.openDoor()
  269. },2300)
  270. },
  271. //立即开门
  272. openDoor: function (event) {
  273. // let device_id = event.currentTarget.dataset.device_id;
  274. let device_id=this.doorValue
  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. that.modalShow=false
  284. });
  285. });
  286. },
  287. getAuthDevice: function () {
  288. let that = this;
  289. let params = {};
  290. params['member_id'] = app.globalData.member.id;
  291. let operation = 'member/getAuthDeviceByMemberId';
  292. app.globalData.postRequest(params, operation, function (res) {
  293. console.info("查询结果:" + res.data.result_msg); //获取成功
  294. if (res.data.result_code == 1) {
  295. let list = [];
  296. if (uni.getStorageSync('plotName')) {
  297. res.data.list.map(item => {
  298. if (item.name.indexOf(uni.getStorageSync('plotName')) >= 0) {
  299. list.push(item);
  300. }
  301. });
  302. } else {
  303. console.log(res.data.list)
  304. list = res.data.list;
  305. }
  306. console.log(list)
  307. that.setData({
  308. device_list: list
  309. });
  310. console.log(that.device_list)
  311. if(!that.$isEmpty(that.device_list)){
  312. that.doorValue=that.device_list[0].id
  313. }
  314. app.globalData.device_list = list;
  315. }
  316. });
  317. },
  318. async loadData(options){
  319. //进入小程序时进行游客登陆,
  320. //以免直接进入商品详情时会提示用户未授权
  321. await this.$nextTick(function(){
  322. this.touristLogin()
  323. })
  324. },
  325. getParam(e){
  326. // 用来保存所有的属性名称和值
  327. let param = "";
  328. // 开始遍历
  329. for(let p in e){
  330. // 方法
  331. if(typeof(e[p])!="function" && p != 'type'){
  332. // p 为属性名称,e[p]为对应属性的值
  333. param += (param.length > 1 ? '&' : '') + p + "=" + e[p];
  334. }
  335. }
  336. // 最后显示所有的属性
  337. return param;
  338. },
  339. execParam(){
  340. let _this = this;
  341. if(this.e != null){
  342. setTimeout(function(){
  343. if(_this.e == null) return;
  344. if(_this.e.type == "share"){
  345. let path = _this.e.path == null || _this.e.path.length <= 0 ? 'pagesM/pages/goods_des' : '/' + _this.e.path;
  346. let param = _this.getParam(_this.e);
  347. let url = `${path}?${param}`;
  348. console.error("url = " + url);
  349. _this.e = null;
  350. uni.navigateTo({url: url});
  351. }
  352. }, 1000);
  353. }
  354. },
  355. handelShare(e){
  356. this.e = e;
  357. console.log(12,e)
  358. //二维码扫描链接 start
  359. if(e != null && e.q != null){
  360. let url = decodeURIComponent(e.q);
  361. let param = {};
  362. // 把参数按&拆分成数组
  363. let index = url.indexOf("?");
  364. let query = url.substring(index+1,index.length);
  365. var param_arr = query.split("&");
  366. for (var i = 0; i < param_arr.length; i++) {
  367. var pair = param_arr[i].split("=");
  368. param[pair[0]]=pair[1];
  369. }
  370. if(param['type'] == "share"){
  371. let path = 'pagesM/pages/goods_des';
  372. let params = `id=${param['id']}&storeId=${param['storeId']}&inviteCode=${param['inviteCode']}`
  373. let url = `${path}?${params}`;
  374. console.error("url = " + url);
  375. this.e = null;
  376. uni.navigateTo({url: url});
  377. }
  378. }
  379. //二维码扫描链接 end
  380. //点击转发卡片进入的小程序
  381. this.execParam();
  382. wx.showShareMenu({
  383. withShareTicket: true
  384. })
  385. },
  386. tab(index){
  387. console.log(index);
  388. },
  389. jump(url,type){
  390. if(!this.$isEmpty(type)){
  391. uni.switchTab({
  392. url:url
  393. })
  394. }else{
  395. uni.navigateTo({
  396. url:url
  397. })
  398. }
  399. },
  400. async fetchGoodsList(){
  401. let indexProduct = await this.$api.storeHomeProducts();
  402. this.goodsList=indexProduct[1].products
  403. this.$u.randomArray(this.goodsList)
  404. },
  405. //轮播圆点
  406. bindchange(e) {
  407. this.setData({
  408. swiperIndex: e.detail.current
  409. });
  410. },
  411. //改变小区
  412. typeChange: function (e) {
  413. let _this = this;
  414. Promise.all([_this.getRoomByMemberId()]).then(result => {
  415. let value = _this.plotArray[e.detail.value];
  416. let residentialId = _this.residentialIdList[e.detail.value];
  417. uni.removeStorageSync("plotName");
  418. uni.removeStorageSync("residentialId");
  419. uni.setStorageSync("plotName", value);
  420. uni.setStorageSync("residentialId", residentialId);
  421. _this.setData({
  422. plotIndex: e.detail.value,
  423. plot: value
  424. });
  425. }).catch(error => {
  426. console.log(error);
  427. });
  428. },
  429. //一键开门
  430. goOpen: function () {
  431. var that = this;
  432. var member = app.globalData.member;
  433. var anyHousePass = app.globalData.anyHousePass; //会员认证状态:{ 0:未认证,1:待审审核,2:已认证 }
  434. if (member == null) {
  435. //未注册
  436. app.globalData.footaddmore();
  437. return;
  438. } else if (member.state == 0 && !anyHousePass) {
  439. //未认证
  440. app.globalData.choosePlot();
  441. return;
  442. } else if (member.state == 1 && !anyHousePass) {
  443. //待审核
  444. that.pending();
  445. return;
  446. } else if (member.state == 2 || anyHousePass) {
  447. //已认证
  448. uni.navigateTo({
  449. url: '/pages/oneButton/oneButton'
  450. });
  451. }
  452. },
  453. getAdList: function () {
  454. let that = this;
  455. let params = {};
  456. let operation = 'adPushApp/getList';
  457. app.globalData.postRequest(params, operation, function (res) {
  458. //获取成功
  459. if (res.data.result_code == 1) {
  460. let adList = res.data.list;
  461. if (adList && adList.length > 0) {
  462. that.setData({
  463. adList: adList
  464. });
  465. }
  466. }
  467. });
  468. },
  469. //获取openid
  470. getOpenId: function () {
  471. var openid = uni.getStorageSync("openid");
  472. console.info("缓存中获取的openid=" + openid);
  473. var that = this;
  474. if (openid == null || openid == '') {
  475. uni.login({
  476. success: res => {
  477. let params = {};
  478. params['js_code'] = res.code;
  479. that.jsCode=res.code
  480. let operation = 'miniprogram/getOpenid'; //发起请求
  481. app.globalData.postRequest(params, operation, function (res) {
  482. //获取成功
  483. if (res.data.result_code == 1) {
  484. console.log("获取openid成功")
  485. //openid存入缓存
  486. uni.setStorageSync("openid", res.data.openid);
  487. that.openid=res.data.openid
  488. that.sessionKey=res.data.sessionKey
  489. that.getMemberByOpenid(res.data.openid);
  490. } else {
  491. app.globalData.oneFailHint(res.data.result_msg);
  492. }
  493. });
  494. }
  495. });
  496. } else {
  497. that.getMemberByOpenid(openid);
  498. }
  499. },
  500. //根据openid获取用户信息
  501. getMemberByOpenid: function (openid) {
  502. let _this = this;
  503. let params = {};
  504. params['openid'] = openid;
  505. let operation = 'miniprogram/getMemberByOpenid';
  506. app.globalData.postRequest(params, operation, function (res) {
  507. console.info("getMemberByOpenid==" + res.data.result_msg); //获取成功
  508. if (res.data.result_code == 1) {
  509. app.globalData.member = res.data.member;
  510. app.globalData.anyHousePass = res.data.anyHousePass; //获取房屋列表
  511. _this.getRoomByMemberId();
  512. _this.getAuthDevice()
  513. } else {
  514. }
  515. });
  516. },
  517. /**
  518. * 游客登陆
  519. */
  520. async touristLogin() {
  521. // 检查是否登录
  522. this.isLogin = this.$auth.isAuth
  523. console.log(this.$auth.isAuth);
  524. if (!this.$auth.isAuth) { // 就算是游客,也重新登录
  525. console.log('需要使用游客身份,执行游客登录!')
  526. let resp = await this.$api.touristLogin()
  527. console.log("Resp",resp);
  528. let userType = this.$global.userType.tourist
  529. this.$auth.login(userType, resp.sessionId, resp.userId, resp)
  530. console.log('游客登录成功!', resp)
  531. } else {
  532. console.log(`已登录!`)
  533. }
  534. },
  535. //根据会员id获取我的房屋列表
  536. getRoomByMemberId: function () {
  537. let that = this;
  538. let params = {};
  539. params['member_id'] = app.globalData.member.id;
  540. let operation = 'estate/getRoomByMemberId';
  541. app.globalData.postRequest(params, operation, function (res) {
  542. console.info("获取成功" + res.data.result_msg); //获取成功
  543. let list = [];
  544. let residentialIdList = [];
  545. if (res.data.result_code == 1) {
  546. app.globalData.userId=res.data.list[0].userId
  547. res.data.list.map(item => {
  548. if (list.indexOf(item.residentialName) == -1) {
  549. list.push(item.residentialName);
  550. residentialIdList.push(item.residentialId);
  551. }
  552. });
  553. if (list.length < 1) {
  554. uni.removeStorageSync("plotName");
  555. uni.removeStorageSync("residentialId");
  556. } else {
  557. //获取本地储存的当前所在小区
  558. let plot = that.plot;
  559. if (uni.getStorageSync('plotName')) {
  560. plot = uni.getStorageSync('plotName');
  561. that.setData({
  562. plot: plot
  563. });
  564. } else {
  565. uni.setStorageSync("plotName", list[0]);
  566. uni.setStorageSync("residentialId", residentialIdList[0]);
  567. that.setData({
  568. plot: list[0]
  569. });
  570. }
  571. }
  572. let residentialList=[]
  573. list.forEach((item,index)=>{
  574. let tmp={}
  575. tmp.residentialName=item
  576. tmp.residentialId=residentialIdList[index]
  577. residentialList.push(tmp)
  578. })
  579. uni.setStorage({
  580. key:"residentialList",
  581. data:residentialList
  582. })
  583. console.log();
  584. that.setData({
  585. plotArray: list,
  586. residentialIdList: residentialIdList
  587. });
  588. }
  589. });
  590. },
  591. top: function (index) {
  592. if (index==5) {
  593. if (this.$isEmpty(this.device_list)) {
  594. uni.showToast({
  595. title:"暂无设备",
  596. icon:"none"
  597. })
  598. return
  599. }
  600. this.modalShow=!this.modalShow
  601. return
  602. }
  603. if (index==99) {
  604. //查看更多
  605. uni.navigateTo({
  606. url:"../tool-list/tool-list"
  607. })
  608. return
  609. }
  610. var that = this;
  611. var member = app.globalData.member;
  612. var anyHousePass = app.globalData.anyHousePass; //会员认证状态:{ 0:未认证,1:待审审核,2:已认证 }
  613. if (member == null) {
  614. //去注册
  615. uni.navigateTo({
  616. url:"../empty/empty"
  617. })
  618. return
  619. } else if (member.state == 0 && !anyHousePass) {
  620. //去认证
  621. uni.navigateTo({
  622. url:"../empty/empty?type=2"
  623. })
  624. return
  625. } else if (member.state == 1 && !anyHousePass) {
  626. //待审核
  627. that.pending();
  628. } else if (member.state == 2 || anyHousePass) {
  629. //已认证
  630. //获取页面传过来的值
  631. var url;
  632. switch (index) {
  633. case 1:
  634. //我的家人
  635. url='/pages/myhome/myhome';
  636. break;
  637. case 2:
  638. //家庭成员
  639. url = '/pages/myFamily/myFamily';
  640. break;
  641. case 3:
  642. //我的车辆
  643. uni.showToast({
  644. title:"待开发",
  645. icon:"none"
  646. })
  647. break;
  648. case 4:
  649. //访客授权
  650. url = '/pages/authorize_record/authorize_record';
  651. break;
  652. case 5:
  653. //一键开门
  654. uni.switchTab({
  655. url:"../device/device"
  656. })
  657. break;
  658. case 6:
  659. //防疫登记
  660. url = '/pages/tool-list/epidemic-pass/epidemic-pass';
  661. break;
  662. case 7:
  663. //物业缴费
  664. uni.showToast({
  665. title:"待开发",
  666. icon:"none"
  667. })
  668. break;
  669. case 8:
  670. //物业报修
  671. url = '/pages/services/property/property';
  672. break;
  673. default:
  674. url = "";
  675. break;
  676. }
  677. if (url != '') {
  678. uni.navigateTo({
  679. url: url,
  680. success: function (res) {
  681. that.setData({
  682. firstJump: false
  683. });
  684. }
  685. });
  686. }
  687. }
  688. },
  689. openBluetoothAdapter: function () {
  690. uni.openBluetoothAdapter({
  691. success: function (res) {
  692. uni.navigateTo({
  693. url: "/pages/bluetooth/bluetooth"
  694. });
  695. },
  696. fail: function (res) {
  697. uni.showModal({
  698. content: '请开启手机蓝牙后再试'
  699. });
  700. }
  701. });
  702. },
  703. //用户信息待审核中
  704. pending: function () {
  705. var openid = uni.getStorageSync("openid");
  706. let params = {};
  707. params['openid'] = openid;
  708. let operation = 'miniprogram/getMemberByOpenid';
  709. app.globalData.postRequest(params, operation, function (res) {
  710. //获取成功
  711. if (res.data.result_code == 1) {
  712. let member = res.data.member; //待审核
  713. if (member.state == 1 && !res.data.anyHousePass) {
  714. app.globalData.oneFailHint('亲,你的信息正在审核,请耐心等待');
  715. } else if (member.state == 2) {
  716. app.globalData.oneFailHint('亲,你的信息已审核通过');
  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. }
  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>