index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template>
  2. <view class="zxbox">
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" :background-color="backgroundColor" :border="false"
  5. statusBar='true' fixed="true">
  6. </uni-nav-bar>
  7. </view>
  8. <image :src="bgimg" class="navbg"></image>
  9. <view class="mbox">
  10. <view class="infobox flexc" @click="handleToInfo">
  11. <image @click.stop="handleToAvatar" :src="avatar?baseUrl+avatar:avatarimg" class="limg" mode="aspectFill"></image>
  12. <view class="cbox">
  13. <view class="tit flexc">{{name?name:'登录账号'}}
  14. <view class="deptbox">
  15. <image :src="wyimg"></image>
  16. <view>业主</view>
  17. </view>
  18. </view>
  19. <!-- <view class="txt">点击详情 享受更多精彩信息</view> -->
  20. <view class="txt" v-if="house">{{house.communityName}}{{house.detailedAddress}}</view>
  21. <!-- <view class="flexc pr" v-if="deptName">
  22. <image :src="headl"></image>
  23. <view class="txt">{{deptName}}点击登录 享受更多精彩信息</view>
  24. <image :src="headr"></image>
  25. </view> -->
  26. </view>
  27. <image :src="wrimg" class="wrimg"></image>
  28. <!-- 登录 -->
  29. <!-- <image v-if="avatar" @click.stop="handleToAvatar" :src="avatar" class="limg" mode="aspectFill"></image>
  30. <image v-else @click.stop="handleToAvatar" :src="avatarimg" class="limg" mode="aspectFill"></image> -->
  31. <!-- 未登录 -->
  32. </view>
  33. <view class="conts flexc">
  34. <view class="contn" @click="handleRepair" v-if="checkPermi(['wuYe:repair:list'])">
  35. <view class="img">
  36. <image :src="listimga" class="imga"></image>
  37. </view>
  38. <view class="ctit">我的报修</view>
  39. </view>
  40. <view class="contn" @click="handleToYy">
  41. <view class="img">
  42. <image :src="listimgb" class="imgb"></image>
  43. </view>
  44. <view class="ctit">供求订单</view>
  45. </view>
  46. <view class="contn">
  47. <view class="img">
  48. <image :src="listimgc" class="imgc"></image>
  49. </view>
  50. <view class="ctit">商圈订单</view>
  51. </view>
  52. <view class="contn">
  53. <view class="img">
  54. <image :src="listimgd" class="imgd"></image>
  55. </view>
  56. <view class="ctit">家政订单</view>
  57. </view>
  58. </view>
  59. <!-- v-if="checkPermi([''])" -->
  60. <view class="mbgbox">
  61. <view class="flexc mine_list" @click="getAuthFn" >
  62. <view class="limg">
  63. <image :src="listimgr" class="imgh"></image>
  64. </view>
  65. <view class="tit flex1">认证信息</view>
  66. <image :src="rimg" class="rimg"></image>
  67. </view>
  68. <view class="flexc mine_list" @click="getFeeFn" v-if="checkPermi(['wuYe:fee:list'])">
  69. <view class="limg">
  70. <image :src="listimge" class="imga"></image>
  71. </view>
  72. <view class="tit flex1">物业费账单</view>
  73. <image :src="rimg" class="rimg"></image>
  74. </view>
  75. <view class="flexc mine_list" @click="getYqMeetFn">
  76. <view class="limg">
  77. <image :src="listimgf" class="imgb"></image>
  78. </view>
  79. <view class="tit flex1">优惠券</view>
  80. <image :src="rimg" class="rimg"></image>
  81. </view>
  82. <view class="flexc mine_list" @click="getClockcontFn" >
  83. <view class="limg">
  84. <image :src="listimgg" class="imgc"></image>
  85. </view>
  86. <view class="tit flex1">积分收支</view>
  87. <image :src="rimg" class="rimg"></image>
  88. </view>
  89. <view class="flexc mine_list" @click="getMyParkFn" v-if="checkPermi(['wuYe:illegalParking:list'])">
  90. <view class="limg">
  91. <image :src="listimgh" class="imgd"></image>
  92. </view>
  93. <view class="tit flex1">我的违停</view>
  94. <image :src="rimg" class="rimg"></image>
  95. </view>
  96. <view class="flexc mine_list" @click="getMyHdFn" v-if="checkPermi(['wuYe:news:getCommentInteraction'])">
  97. <view class="limg">
  98. <image :src="listimgo" class="imgd"></image>
  99. </view>
  100. <view class="tit flex1">我的互动</view>
  101. <image :src="rimg" class="rimg"></image>
  102. </view>
  103. <view class="flexc mine_list" @click="getWdHdFn" v-if="checkPermi(['wuYe:commentIndex:list'])">
  104. <view class="limg">
  105. <image :src="listimgq" class="imgd"></image>
  106. </view>
  107. <view class="tit flex1">我的点评赞</view>
  108. <image :src="rimg" class="rimg"></image>
  109. </view>
  110. <view class="flexc mine_list" @click="getPlShFn" v-if="checkPermi(['wuYe:commentIndex:commentSh'])">
  111. <view class="limg">
  112. <image :src="listimgp" class="imgg"></image>
  113. </view>
  114. <view class="tit flex1">评论审核</view>
  115. <image :src="rimg" class="rimg"></image>
  116. </view>
  117. <view class="flexc mine_list" @click="getClockcontFn" >
  118. <view class="limg">
  119. <image :src="listimgk" class="imgd"></image>
  120. </view>
  121. <view class="tit flex1">收款方式</view>
  122. <image :src="rimg" class="rimg"></image>
  123. </view>
  124. <view class="flexc mine_list" @click="handleUpassword">
  125. <view class="limg">
  126. <image :src="listimgl" class="imgc"></image>
  127. </view>
  128. <view class="tit flex1">修改密码</view>
  129. <image :src="rimg" class="rimg"></image>
  130. </view>
  131. <!-- <view class="flexc mine_list" @click="handleToSetting">
  132. <view class="limg">
  133. <image :src="listimgg" class="imga"></image>
  134. </view>
  135. <view class="tit flex1">设置</view>
  136. <image :src="rimg" class="rimg"></image>
  137. </view> -->
  138. <!-- #ifdef APP-PLUS -->
  139. <view class="flexc mine_list"@click="onlineWgt">
  140. <view class="limg">
  141. <image :src="listimgm" class="imgd"></image>
  142. </view>
  143. <view class="tit flex1">版本号</view>
  144. <view class="txt">{{wgtcode}}</view>
  145. <image :src="rimg" class="rimg"></image>
  146. </view>
  147. <!-- #endif -->
  148. <view class="flexc mine_list" @click="handleLogout">
  149. <view class="limg">
  150. <image :src="listimgn" class="imgf"></image>
  151. </view>
  152. <view class="tit flex1">退出登录</view>
  153. <image :src="rimg" class="rimg"></image>
  154. </view>
  155. <!-- <view class="flexc mine_list" @click="handleUpassword">
  156. <view class="limg">
  157. <image :src="listimgh" class="imga"></image>
  158. </view>
  159. <view class="tit flex1">修改密码</view>
  160. <image :src="rimg" class="rimg"></image>
  161. </view> -->
  162. </view>
  163. </view>
  164. <view class="ztit">安徽中新云计算有限公司提供支持</view>
  165. <footers v-if="isfootflag" :footerindex="footerindex" :isHomeIndex="false"></footers>
  166. </view>
  167. </template>
  168. <script>
  169. import storage from '@/utils/storage'
  170. import footers from '@/components/footer/footer.vue'
  171. import {findVersion} from "@/api/system/user.js"
  172. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  173. import config from '@/config'
  174. const baseUrl = config.baseUrl
  175. const webUrl=config.webUrl
  176. export default {
  177. data() {
  178. return {
  179. bgimg: require("@/static/images/mine/mbg.png"),
  180. avatarimg:require("@/static/images/mine/head.png"),
  181. listimga: require('@/static/images/mine/mtaba.png'),
  182. listimgb: require('@/static/images/mine/mtabb.png'),
  183. listimgc: require('@/static/images/mine/mtabc.png'),
  184. listimgd: require('@/static/images/mine/mtabd.png'),
  185. listimge: require('@/static/images/mine/mtabe.png'),
  186. listimgf: require('@/static/images/mine/mtabf.png'),
  187. listimgg: require('@/static/images/mine/mtabg.png'),
  188. listimgh: require('@/static/images/mine/mtabh.png'),
  189. listimgi: require('@/static/images/mine/mtabi.png'),
  190. listimgj: require('@/static/images/mine/mtabj.png'),
  191. listimgk: require('@/static/images/mine/mtabk.png'),
  192. listimgl: require('@/static/images/mine/mtabl.png'),
  193. listimgm: require('@/static/images/mine/mtabm.png'),
  194. listimgn: require('@/static/images/mine/mtabn.png'),
  195. listimgo: require('@/static/images/mine/mtabo.png'),
  196. listimgp: require('@/static/images/mine/mtabp.png'),
  197. listimgq: require('@/static/images/mine/mtabq.png'),
  198. listimgr: require('@/static/images/mine/mtabr.png'),
  199. head:require('@/static/images/mine/head.png'),
  200. wrimg:require("@/static/images/mine/wrimg.png"),
  201. rimg:require("@/static/images/rimg.png"),
  202. wyimg:require("@/static/images/mine/wy.png"),
  203. border: false,
  204. backgroundColor: 'transparent',
  205. baseUrl:config.baseUrl,
  206. name: this.$store.state.user.nickName,
  207. deptName:this.$store.state.user.deptName,
  208. house:this.$store.state.user.house,
  209. // version: getApp().globalData.config.appInfo.version,
  210. footerindex: 'mine',
  211. isfootflag: true,
  212. noticenum: 0,
  213. deptId: this.$store.state.user.deptId,
  214. wgtcode: this.$store.state.user.wgtcode,
  215. platform: 'Android',
  216. appPort:'2', //appPort 1:物管端,2:用户端
  217. nvaHeight:44,
  218. }
  219. },
  220. components: {
  221. footers
  222. },
  223. computed: {
  224. avatar() {
  225. return this.$store.state.user.avatar
  226. },
  227. windowHeight() {
  228. return uni.getSystemInfoSync().windowHeight - 50
  229. }
  230. },
  231. onPageScroll(e) {
  232. // var scrollTop = Number(e.scrollTop);
  233. // var listTop=Number(this.listTop)-Number(this.nvaHeight)
  234. // if (scrollTop <=this.nvaHeight) {
  235. // const opacity = scrollTop / 100 // 计算透明度值
  236. // const color = `rgba(29, 100, 226, ${opacity})`
  237. // this.backgroundColor = color // 更新盒子背景颜色
  238. // } else {
  239. // // this.backgroundColor = '#00A9F0'
  240. // }
  241. },
  242. onLoad() {
  243. var that=this;
  244. this.nvaHeight=uni.getSystemInfoSync().statusBarHeight+44;
  245. // #ifdef APP-PLUS
  246. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  247. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {
  248. that.wgtcode=widgetInfo.version
  249. })
  250. });
  251. // #endif
  252. },
  253. mounted() {
  254. },
  255. onShow() {
  256. this.name=this.$store.state.user.nickName;
  257. },
  258. methods: {
  259. checkPermi,checkRole,
  260. getClockcontFn(){
  261. },
  262. handleToYy(){
  263. },
  264. // 设置
  265. handleToSetting() {
  266. },
  267. getAuthFn(){//认证信息
  268. this.$tab.navigateTo('/mine/pages/info/authen')
  269. },
  270. handleRepair(){//我的报修
  271. this.$tab.navigateTo(`/work/pages/service/warranty`)
  272. },
  273. getFeeFn(){//物业费
  274. this.$tab.navigateTo(`/work/pages/manage/index`)
  275. },
  276. // 修改密码
  277. handleUpassword(){
  278. this.$tab.navigateTo(`/mine/pages/pwd/index`)
  279. },
  280. getPlShFn(){//评论审核
  281. this.$tab.navigateTo('/mine/pages/news/sh')
  282. },
  283. getMyHdFn(){//我的互动
  284. this.$tab.navigateTo('/mine/pages/news/index')
  285. },
  286. getWdHdFn(){//我的点评赞
  287. this.$tab.navigateTo('/mine/pages/news/myhd')
  288. },
  289. getMyParkFn(){//我的违停
  290. this.$tab.navigateTo('/mine/pages/car/illegalParking')
  291. },
  292. // 账号信息
  293. handleToInfo() {
  294. this.$tab.navigateTo('/mine/pages/info')
  295. },
  296. handleToLogin() {
  297. this.$tab.reLaunch('/pages/login')
  298. },
  299. handleToAvatar() {
  300. this.$tab.navigateTo('/mine/pages/avatar/index')
  301. },
  302. handleLogout() {
  303. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  304. this.$store.dispatch('LogOut').then(() => {
  305. this.$tab.reLaunch('/pages/index')
  306. })
  307. })
  308. },
  309. onlineWgt() {
  310. let that = this;
  311. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  312. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {
  313. that.wgtcode=widgetInfo.version
  314. })
  315. that.comparisonVersionNo(widgetInfo.versionCode);
  316. });
  317. // that.comparisonVersionNo()
  318. },
  319. comparisonVersionNo(versionCode) {
  320. let that = this;
  321. // console.log("aaaaaaa===versionCode", versionCode);
  322. const parmas = {
  323. model: that.platform,
  324. appPort:that.appPort
  325. }
  326. findVersion(parmas).then(res => {
  327. if (res.code == "200") {
  328. let versionNos = res.data.code;
  329. console.log(versionNos, 'versionNos')
  330. // console.log(res.data.path);
  331. let filePath = res.data.path;
  332. if (Number(versionNos) > Number(versionCode)) { //服务器返回1更新,0则不更新
  333. uni.showModal({
  334. title: '提示',
  335. content: '发现新版本,是否升级',
  336. success: function(res) {
  337. // console.log(widgetInfo.version);
  338. if (res.confirm) {
  339. console.log('用户点击确定');
  340. that.getProperty(filePath);
  341. } else if (res.cancel) {
  342. console.log('用户点击取消');
  343. }
  344. }
  345. });
  346. } else {
  347. this.$toast('该版本已是最新版')
  348. }
  349. }
  350. }).catch(error => {
  351. uni.hideLoading()
  352. console.log(error)
  353. })
  354. },
  355. getProperty(getProperty) {
  356. // console.log("bbbbbbbbb----------->", getProperty)
  357. let that = this;
  358. // 在线升级app/热更新
  359. that.showwri = true;
  360. const downloadTask = uni.downloadFile({ //下载文件
  361. url: baseUrl + getProperty,
  362. success: (downloadResult) => {
  363. // console.log(downloadResult);
  364. if (downloadResult.statusCode == 200) {
  365. // 更新升级
  366. plus.runtime.install(downloadResult.tempFilePath, {
  367. force: true
  368. }, function() {
  369. // console.log('install success...');
  370. that.showwri = false;
  371. plus.nativeUI.alert("应用资源更新完成!", function() {
  372. plus.runtime.restart();
  373. });
  374. }, function(e) {
  375. that.showwri = false;
  376. plus.nativeUI.alert("更新失败,请稍后再试");
  377. });
  378. }
  379. }
  380. });
  381. downloadTask.onProgressUpdate((res) => { //下载文件的进度
  382. that.totalBytesWritten = res.totalBytesWritten; //当前下载大小
  383. that.progress = res.progress; //当前下载比例
  384. that.totalBytesExpectedToWrite = res.totalBytesExpectedToWrite; //
  385. });
  386. },
  387. }
  388. }
  389. </script>
  390. <style lang="scss">
  391. page{background-color: #ffffff;}
  392. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  393. .deptbox{height: 34rpx;position: relative;margin-left: 16rpx;padding-left: 40rpx;box-sizing: border-box;padding-top: 4rpx;
  394. image{width: 102rpx;height: 34rpx;position: absolute;left: 0;top: 0;}
  395. view{font-weight: bold;font-size: 22rpx;color: #FFFFFF;position: relative;z-index: 2;height: 30rpx;min-width: 60rpx;background: linear-gradient(90deg, #FFB54D, #FE5B0E);border-radius: 0 15rpx 15rpx 0;}
  396. }
  397. .zxbox{
  398. .navbg{width: 100%;height: 782rpx;}
  399. .mbox{padding: 148rpx 24rpx 0;z-index: 1;position: relative;
  400. .infobox{margin-bottom: 48rpx;padding: 0 20rpx;
  401. .limg{width: 98rpx;height: 98rpx;flex: 0 0 auto;margin-right: 24rpx;border-radius: 50%;box-sizing: border-box;border: 6rpx solid #FFFFFF;}
  402. .cbox{flex: 1;z-index: 1;
  403. .tit{font-weight: bold;font-size: 36rpx;color: #161616;margin-bottom: 10rpx;}
  404. .txt{font-weight: 500;font-size: 26rpx;color: #76829B;}
  405. }
  406. .wrimg{width: 14rpx;height: 26rpx;flex: 0 0 auo;}
  407. }
  408. .conts{box-sizing: border-box;background: #FFFFFF;box-shadow: 0px 0px 10rpx 0px #EFD3B6;border-radius: 20rpx;
  409. .contn{padding: 32rpx 0 28rpx;
  410. display: flex;align-items: center;flex: 0 0 auto;width: 25%;flex-direction: column;
  411. .img{width: 50rpx;height: 50rpx;display: flex;align-items: center;justify-content: center;margin-bottom: 16rpx;flex: 0 0 auto;
  412. .imga{width: 48rpx;height: 46rpx;}
  413. .imgb{width: 48rpx;height: 48rpx;}
  414. .imgc{width: 46rpx;height: 48rpx;}
  415. .imgd{width: 40rpx;height: 50rpx;}
  416. }
  417. .ctit{font-weight: bold;font-size: 26rpx;color: #272727;}
  418. }
  419. }
  420. .mbgbox{width: 100%;margin-bottom: 24rpx;padding-top: 32rpx;
  421. .mine_list{
  422. padding: 28rpx 36rpx;
  423. .limg{flex: 0 0 auto;width: 32rpx;height: 32rpx;margin-right: 26rpx;display: flex;align-items: center;justify-content: center;
  424. .imga{width: 30rpx;height: 30rpx;}//15 15
  425. .imgb{width: 30rpx;height: 26rpx;}//15 13
  426. .imgc{width: 30rpx;height: 32rpx;}//15 16
  427. .imgd{width: 32rpx;height: 32rpx;}//16 16
  428. .imge{width: 26rpx;height: 30rpx;}//13 15
  429. .imgf{width: 26rpx;height: 32rpx;}//13 16
  430. .imgg{width: 32rpx;height: 30rpx;}//16 15
  431. .imgh{width: 28rpx;height: 32rpx;}//14 16
  432. }
  433. .tit{font-weight: bold;font-size: 26rpx;color: #272727;}
  434. .txt{font-weight: 500;font-size: 26rpx;color: #666666;margin-left: 20rpx;flex: 0 0 auto;}
  435. .rimg{width: 14rpx;height: 26rpx;margin-left: 20rpx;flex: 0 0 auto;}
  436. }
  437. }
  438. }
  439. }
  440. .ztit{font-size: 24rpx;color:#c6c6c9;text-align: center;flex:0 0 auto;margin-bottom: 28rpx;margin-top: 40rpx;}
  441. </style>