index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="edition-intro">
  3. <image :src="theme=='light'?'/static/logo.png':'/static/logo-dark.png'" class="logo" />
  4. <!-- <h1> {{config.name}}</h1> -->
  5. <view class="version">
  6. <!-- #ifdef APP-PLUS -->
  7. Version {{localVersion.version}}
  8. <!-- #endif -->
  9. <!-- #ifdef MP-WEIXIN -->
  10. {{localVersion.version}}
  11. <!-- {{ localVersion.envVersion}} -->
  12. <!-- #endif -->
  13. </view>
  14. <!-- {{localVersion}} -->
  15. <view class="intro">
  16. <!-- <view>{{config.customerServiceMobile ? `客服热线:${config.customerServiceMobile}` : ``}}</view> -->
  17. <view style="margin:20rpx 0 0 0;">{{config.customerServiceEmail ? `客服邮箱:${config.customerServiceEmail}` : ``}}</view>
  18. <!-- <view style="margin:20rpx 0; color:#003a8c;" @click="navigateTo('/pages/mine/help/tips?type=user')">《{{config.name}}用户协议》</view> -->
  19. <view>CopyRight ©{{config.name}}</view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import config from "@/config/config";
  25. import { getAppVersion } from "@/api/message.js";
  26. export default {
  27. data() {
  28. return {
  29. config,
  30. IosWhether: false, //是否是ios
  31. editionHistory: [], //版本历史
  32. versionData: {}, //版本信息
  33. localVersion: "", //当前版本信息
  34. params: {
  35. pageNum: 1,
  36. pageSize: 5,
  37. },
  38. theme: ""
  39. };
  40. },
  41. onLoad() {
  42. // #ifdef APP-PLUS
  43. const platform = uni.getSystemInfoSync().platform;
  44. /**
  45. * 获取是否是安卓
  46. */
  47. if (platform === "android") {
  48. this.params.type = 0;
  49. } else {
  50. this.IosWhether = true;
  51. this.params.type = 1;
  52. }
  53. this.getVersion(platform);
  54. plus.runtime.getProperty(plus.runtime.appid, (inf) => {
  55. this.localVersion = {
  56. versionCode: inf.version.replace(/\./g, ""),
  57. version: inf.version,
  58. };
  59. });
  60. // #endif
  61. // #ifdef MP-WEIXIN
  62. const accountInfo = wx.getAccountInfoSync();
  63. console.log("===========accountInfo==============");
  64. console.log(accountInfo);
  65. this.version_number = accountInfo.miniProgram.version // 小程序 版本号
  66. this.localVersion = {
  67. versionCode: accountInfo.miniProgram.version.replace(/\./g, ""),
  68. version: accountInfo.miniProgram.version,// 小程序 版本号,
  69. envVersion: accountInfo.miniProgram.envVersion, //判断小程序是开发版本还是release版本
  70. };
  71. // #endif
  72. },
  73. onReady() {
  74. // 检查深浅模式,确定地图样式
  75. let _this = this
  76. uni.getSystemInfo({
  77. success: function (res) {
  78. _this.theme = res.hostTheme || 'light'
  79. console.log(_this.theme);
  80. }
  81. });
  82. },
  83. methods: {
  84. async getVersion(platform) {
  85. let type;
  86. platform == "android" ? (type = "ANDROID") : (type = "IOS");
  87. let res = await getAppVersion(type);
  88. if (res.data.success) {
  89. this.versionData = res.data.result;
  90. }
  91. },
  92. navigateTo(url) {
  93. uni.navigateTo({
  94. url,
  95. });
  96. },
  97. },
  98. };
  99. </script>
  100. <style lang="scss" scoped>
  101. // page {
  102. // background: #fff !important;
  103. // }
  104. .cell {
  105. width: 90%;
  106. margin: 0 auto;
  107. }
  108. .edition-intro {
  109. min-height: 100vh;
  110. display: flex;
  111. flex-direction: column;
  112. justify-content: center;
  113. align-items: center;
  114. > h1 {
  115. margin: 20rpx 0 20rpx 0;
  116. letter-spacing: 2rpx;
  117. }
  118. > .version {
  119. font-size: 30rpx;
  120. margin-bottom: 100rpx;
  121. }
  122. }
  123. .intro {
  124. margin-top: 100rpx;
  125. font-size: 24rpx;
  126. letter-spacing: 2rpx;
  127. text-align: center;
  128. }
  129. .logo {
  130. width: 288rpx;
  131. height: 288rpx;
  132. margin-bottom: 32rpx;
  133. }
  134. </style>