index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view class="head">
  3. <!-- <u-navbar :border-bottom="false"></u-navbar> -->
  4. <view class="content">
  5. <view style="text-align: center;">
  6. <image src="../../static/192x192.png" mode=""
  7. style="width: 200rpx;height: 200rpx;border-radius: 25rpx;"></image>
  8. <h3>{{name}}</h3>
  9. <view>version:{{version}}</view>
  10. </view>
  11. <view class="u-m-t-20">
  12. <uni-list>
  13. <uni-list-item title="检查更新" clickable @click="checkVersion" />
  14. </uni-list>
  15. </view>
  16. </view>
  17. <view style="width: 100%;position:fixed; bottom:200rpx;padding: 0;">
  18. <view style="width: 92%;margin: 0 auto;">
  19. <button type="primary" @click="logOut">退出登录</button>
  20. </view>
  21. </view>
  22. <!-- 更新组件 force 是否强制更新 tabbar:页面是否有原生tabbar组件-->
  23. <app-update ref="app_update" :force="false" :tabbar="false"></app-update>
  24. </view>
  25. </template>
  26. <script>
  27. import appUpdate from "@/components/yzhua006-update/app-update.vue"
  28. export default {
  29. data() {
  30. return {
  31. name: '获取失败',
  32. version: '获取失败'
  33. }
  34. },
  35. components: {
  36. appUpdate
  37. },
  38. onLoad() {
  39. },
  40. created() {
  41. // #ifdef APP-PLUS
  42. plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
  43. this.version = wgtinfo.version
  44. this.name = wgtinfo.name
  45. })
  46. //#endif
  47. },
  48. onBackPress(e) {
  49. console.log(e.from)
  50. if (e.from == 'backbutton') {
  51. return true
  52. }
  53. },
  54. methods: {
  55. logOut() {
  56. uni.clearStorageSync();
  57. uni.redirectTo({
  58. url: '../login/index'
  59. });
  60. },
  61. checkVersion() {
  62. // console.log(11)
  63. this.$refs.app_update.update(); //调用子组件 检查更新
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .content {
  70. width: 96%;
  71. margin: 140rpx auto;
  72. }
  73. .head ::v-deep.u-navbar-inner {
  74. z-index: -99999;
  75. }
  76. </style>