index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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="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="flexc pr" v-if="deptName">
  21. <image :src="headl"></image>
  22. <view class="txt">{{deptName}}点击登录 享受更多精彩信息</view>
  23. <image :src="headr"></image>
  24. </view> -->
  25. </view>
  26. <image :src="wrimg" class="wrimg"></image>
  27. <!-- 登录 -->
  28. <!-- <image v-if="avatar" @click.stop="handleToAvatar" :src="avatar" class="limg" mode="aspectFill"></image>
  29. <image v-else @click.stop="handleToAvatar" :src="avatarimg" class="limg" mode="aspectFill"></image> -->
  30. <!-- 未登录 -->
  31. </view>
  32. <view class="conts flexc">
  33. <view class="contn" v-if="checkPermi([''])" @click="handleToYy">
  34. <view class="img">
  35. <image :src="listimga" class="imga"></image>
  36. </view>
  37. <view class="ctit">党建发布</view>
  38. </view>
  39. <view class="contn" v-if="checkPermi([''])" @click="handleToYy">
  40. <view class="img">
  41. <image :src="listimgb" class="imgb"></image>
  42. </view>
  43. <view class="ctit">健康资讯发布</view>
  44. </view>
  45. <view class="contn">
  46. <view class="img">
  47. <image :src="listimgc" class="imga"></image>
  48. </view>
  49. <view class="ctit">商品发布</view>
  50. </view>
  51. <view class="contn">
  52. <view class="img">
  53. <image :src="listimgd" class="imgc"></image>
  54. </view>
  55. <view class="ctit">投诉回复</view>
  56. </view>
  57. </view>
  58. <view class="mbgbox">
  59. <view class="flexc mine_list" @click="getClockcontFn" v-if="checkPermi([''])">
  60. <view class="limg">
  61. <image :src="listimge" class="imga"></image>
  62. </view>
  63. <view class="tit flex1">报修管理</view>
  64. <image :src="rimg" class="rimg"></image>
  65. </view>
  66. <view class="flexc mine_list" @click="getYqMeetFn">
  67. <view class="limg">
  68. <image :src="listimgf" class="imgb"></image>
  69. </view>
  70. <view class="tit flex1">物业费催缴</view>
  71. <image :src="rimg" class="rimg"></image>
  72. </view>
  73. <view class="flexc mine_list" @click="handleUpassword">
  74. <view class="limg">
  75. <image :src="listimgg" class="imgc"></image>
  76. </view>
  77. <view class="tit flex1">修改密码</view>
  78. <image :src="rimg" class="rimg"></image>
  79. </view>
  80. <!-- <view class="flexc mine_list" @click="handleToSetting">
  81. <view class="limg">
  82. <image :src="listimgg" class="imga"></image>
  83. </view>
  84. <view class="tit flex1">设置</view>
  85. <image :src="rimg" class="rimg"></image>
  86. </view> -->
  87. <!-- #ifdef APP-PLUS -->
  88. <view class="flexc mine_list"@click="onlineWgt">
  89. <view class="limg">
  90. <image :src="listimgh" class="imga"></image>
  91. </view>
  92. <view class="tit flex1">版本号</view>
  93. <view class="txt">{{wgtcode}}</view>
  94. <image :src="rimg" class="rimg"></image>
  95. </view>
  96. <!-- #endif -->
  97. <view class="flexc mine_list" @click="handleLogout">
  98. <view class="limg">
  99. <image :src="listimgi" class="imgd"></image>
  100. </view>
  101. <view class="tit flex1">退出登录</view>
  102. <image :src="rimg" class="rimg"></image>
  103. </view>
  104. <!-- <view class="flexc mine_list" @click="handleUpassword">
  105. <view class="limg">
  106. <image :src="listimgh" class="imga"></image>
  107. </view>
  108. <view class="tit flex1">修改密码</view>
  109. <image :src="rimg" class="rimg"></image>
  110. </view> -->
  111. </view>
  112. </view>
  113. <view class="ztit">安徽中新云计算有限公司提供支持</view>
  114. <footers v-if="isfootflag" :footerindex="footerindex" :isHomeIndex="false"></footers>
  115. </view>
  116. </template>
  117. <script>
  118. import storage from '@/utils/storage'
  119. import footers from '@/components/footer/footer.vue'
  120. import {findVersion} from "@/api/system/user.js"
  121. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  122. import config from '@/config'
  123. const baseUrl = config.baseUrl
  124. const webUrl=config.webUrl
  125. export default {
  126. data() {
  127. return {
  128. bgimg: require("@/static/images/mine/mbg.png"),
  129. avatarimg:require("@/static/images/mine/head.png"),
  130. listimga: require('@/static/images/mine/mtaba.png'),
  131. listimgb: require('@/static/images/mine/mtabb.png'),
  132. listimgc: require('@/static/images/mine/mtabc.png'),
  133. listimgd: require('@/static/images/mine/mtabd.png'),
  134. listimge: require('@/static/images/mine/mtabe.png'),
  135. listimgf: require('@/static/images/mine/mtabf.png'),
  136. listimgg: require('@/static/images/mine/mtabg.png'),
  137. listimgh: require('@/static/images/mine/mtabh.png'),
  138. listimgi: require('@/static/images/mine/mtabi.png'),
  139. // listimgj: require('@/static/images/mine/minej.png'),
  140. // listimgk: require('@/static/images/mine/minek.png'),
  141. // listimgl: require('@/static/images/mine/minel.png'),
  142. // listimgm: require('@/static/images/mine/minem.png'),
  143. head:require('@/static/images/mine/head.png'),
  144. wrimg:require("@/static/images/mine/wrimg.png"),
  145. rimg:require("@/static/images/home/rimg.png"),
  146. wyimg:require("@/static/images/mine/wy.png"),
  147. border: false,
  148. backgroundColor: 'transparent',
  149. name: this.$store.state.user.nickName,
  150. deptName:this.$store.state.user.deptName,
  151. // version: getApp().globalData.config.appInfo.version,
  152. footerindex: 'mine',
  153. isfootflag: true,
  154. noticenum: 0,
  155. deptId: this.$store.state.user.deptId,
  156. wgtcode: this.$store.state.user.wgtcode,
  157. platform: 'Android',
  158. nvaHeight:44,
  159. }
  160. },
  161. components: {
  162. footers
  163. },
  164. computed: {
  165. avatar() {
  166. return this.$store.state.user.avatar
  167. },
  168. windowHeight() {
  169. return uni.getSystemInfoSync().windowHeight - 50
  170. }
  171. },
  172. onPageScroll(e) {
  173. // var scrollTop = Number(e.scrollTop);
  174. // var listTop=Number(this.listTop)-Number(this.nvaHeight)
  175. // if (scrollTop <=this.nvaHeight) {
  176. // const opacity = scrollTop / 100 // 计算透明度值
  177. // const color = `rgba(29, 100, 226, ${opacity})`
  178. // this.backgroundColor = color // 更新盒子背景颜色
  179. // } else {
  180. // // this.backgroundColor = '#00A9F0'
  181. // }
  182. },
  183. onLoad() {
  184. var that=this;
  185. this.nvaHeight=uni.getSystemInfoSync().statusBarHeight+44;
  186. // #ifdef APP-PLUS
  187. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  188. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {
  189. that.wgtcode=widgetInfo.version
  190. })
  191. });
  192. // #endif
  193. },
  194. mounted() {
  195. },
  196. methods: {
  197. checkPermi,checkRole,
  198. // 待我审批
  199. handleToYy(){
  200. this.$tab.navigateTo("/pages/order/list")
  201. },
  202. //访客预约
  203. handleToAddYy(){
  204. this.$tab.navigateTo("/pages/order/come")
  205. },
  206. //在线会议
  207. getYqMeetFn(){
  208. // var url='https://www.baidu.com'
  209. this.$tab.navigateTo("/pages/common/webview/index?url="+webUrl)
  210. },
  211. //我的会议
  212. handleToMyhy(){
  213. this.$tab.navigateTo("/work/pages/yyorder/meetlist")
  214. },
  215. //我的就餐
  216. handleToMyjc(){
  217. this.$tab.navigateTo("/work/pages/yyorder/eatlist")
  218. },
  219. //我的申报
  220. handleToMysb(){
  221. // this.$tab.navigateTo("/work/pages/business/list?from=my&type=0")
  222. },
  223. // 考勤设置
  224. handleToKq(){
  225. this.$tab.navigateTo('/work/pages/clock/kaorules')
  226. },
  227. // 考勤记录
  228. getClockjlFn(){
  229. this.$tab.navigateTo("/work/pages/record/clockin")
  230. },
  231. // 考勤统计
  232. getClockcontFn(){
  233. this.$tab.navigateTo("/work/pages/clock/personnel")
  234. },
  235. // 设置
  236. handleToSetting() {
  237. this.$tab.navigateTo('/pages/mine/setting/index')
  238. },
  239. // 修改密码
  240. handleUpassword(){
  241. this.$tab.navigateTo(`/pages/mine/pwd/index`)
  242. },
  243. // 账号信息
  244. handleToInfo() {
  245. this.$tab.navigateTo('/pages/mine/info/index')
  246. },
  247. handleToLogin() {
  248. this.$tab.reLaunch('/pages/login')
  249. },
  250. handleToAvatar() {
  251. this.$tab.navigateTo('/pages/mine/avatar/index')
  252. },
  253. handleLogout() {
  254. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  255. this.$store.dispatch('LogOut').then(() => {
  256. this.$tab.reLaunch('/pages/index')
  257. })
  258. })
  259. },
  260. onlineWgt() {
  261. let that = this;
  262. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  263. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {
  264. that.wgtcode=widgetInfo.version
  265. })
  266. that.comparisonVersionNo(widgetInfo.versionCode);
  267. });
  268. // that.comparisonVersionNo()
  269. },
  270. comparisonVersionNo(versionCode) {
  271. let that = this;
  272. // console.log("aaaaaaa===versionCode", versionCode);
  273. const parmas = {
  274. model: that.platform
  275. }
  276. findVersion(parmas).then(res => {
  277. if (res.code == "200") {
  278. let versionNos = res.data.code;
  279. console.log(versionNos, 'versionNos')
  280. // console.log(res.data.path);
  281. let filePath = res.data.path;
  282. if (Number(versionNos) > Number(versionCode)) { //服务器返回1更新,0则不更新
  283. uni.showModal({
  284. title: '提示',
  285. content: '发现新版本,是否升级',
  286. success: function(res) {
  287. // console.log(widgetInfo.version);
  288. if (res.confirm) {
  289. console.log('用户点击确定');
  290. that.getProperty(filePath);
  291. } else if (res.cancel) {
  292. console.log('用户点击取消');
  293. }
  294. }
  295. });
  296. } else {
  297. this.$toast('该版本已是最新版')
  298. }
  299. }
  300. }).catch(error => {
  301. uni.hideLoading()
  302. console.log(error)
  303. })
  304. },
  305. getProperty(getProperty) {
  306. // console.log("bbbbbbbbb----------->", getProperty)
  307. let that = this;
  308. // 在线升级app/热更新
  309. that.showwri = true;
  310. const downloadTask = uni.downloadFile({ //下载文件
  311. url: baseUrl + getProperty,
  312. success: (downloadResult) => {
  313. // console.log(downloadResult);
  314. if (downloadResult.statusCode == 200) {
  315. // 更新升级
  316. plus.runtime.install(downloadResult.tempFilePath, {
  317. force: true
  318. }, function() {
  319. // console.log('install success...');
  320. that.showwri = false;
  321. plus.nativeUI.alert("应用资源更新完成!", function() {
  322. plus.runtime.restart();
  323. });
  324. }, function(e) {
  325. that.showwri = false;
  326. plus.nativeUI.alert("更新失败,请稍后再试");
  327. });
  328. }
  329. }
  330. });
  331. downloadTask.onProgressUpdate((res) => { //下载文件的进度
  332. that.totalBytesWritten = res.totalBytesWritten; //当前下载大小
  333. that.progress = res.progress; //当前下载比例
  334. that.totalBytesExpectedToWrite = res.totalBytesExpectedToWrite; //
  335. });
  336. },
  337. }
  338. }
  339. </script>
  340. <style lang="scss">
  341. page{background-color: #ffffff;}
  342. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  343. .deptbox{height: 34rpx;position: relative;margin-left: 16rpx;padding-left: 40rpx;box-sizing: border-box;padding-top: 4rpx;
  344. image{width: 102rpx;height: 34rpx;position: absolute;left: 0;top: 0;}
  345. 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;}
  346. }
  347. .zxbox{
  348. .navbg{width: 100%;height: 782rpx;}
  349. .mbox{padding: 148rpx 24rpx 0;z-index: 1;position: relative;
  350. .infobox{margin-bottom: 48rpx;padding: 0 20rpx;
  351. .limg{width: 98rpx;height: 98rpx;flex: 0 0 auto;margin-right: 24rpx;border-radius: 50%;box-sizing: border-box;border: 6rpx solid #FFFFFF;}
  352. .cbox{flex: 1;z-index: 1;
  353. .tit{font-weight: bold;font-size: 36rpx;color: #161616;margin-bottom: 10rpx;}
  354. .txt{font-weight: 500;font-size: 26rpx;color: #76829B;}
  355. }
  356. .wrimg{width: 14rpx;height: 26rpx;flex: 0 0 auo;}
  357. }
  358. .conts{box-sizing: border-box;background: #FFFFFF;box-shadow: 0px 0px 10rpx 0px #C4DEE8;border-radius: 20rpx;
  359. .contn{padding: 32rpx 0 30rpx;
  360. display: flex;align-items: center;flex: 0 0 auto;width: 25%;flex-direction: column;
  361. .img{width: 40rpx;height: 40rpx;display: flex;align-items: center;justify-content: center;margin-bottom: 24rpx;flex: 0 0 auto;
  362. .imga{width: 36rpx;height: 36rpx;}
  363. .imgb{width: 40rpx;height: 38rpx;}
  364. .imgc{width: 40rpx;height: 40rpx;}
  365. }
  366. .ctit{font-weight: bold;font-size: 26rpx;color: #272727;}
  367. }
  368. }
  369. .mbgbox{width: 100%;margin-bottom: 24rpx;padding-top: 32rpx;
  370. .mine_list{
  371. padding: 28rpx 20rpx;
  372. .limg{flex: 0 0 auto;width: 32rpx;height: 32rpx;margin-right: 26rpx;display: flex;align-items: center;justify-content: center;
  373. .imga{width: 32rpx;height: 32rpx;}
  374. .imgb{width: 32rpx;height: 30rpx;}
  375. .imgc{width: 30rpx;height: 32rpx;}
  376. .imgd{width: 26rpx;height: 32rpx;}
  377. }
  378. .tit{font-weight: bold;font-size: 26rpx;color: #272727;}
  379. .txt{font-weight: 500;font-size: 26rpx;color: #666666;margin-left: 20rpx;flex: 0 0 auto;}
  380. .rimg{width: 14rpx;height: 26rpx;margin-left: 20rpx;flex: 0 0 auto;}
  381. }
  382. }
  383. }
  384. }
  385. .ztit{font-size: 24rpx;color:#c6c6c9;text-align: center;flex:0 0 auto;margin-bottom: 28rpx;margin-top: 40rpx;}
  386. </style>