setings.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view class="content">
  3. <!-- #ifdef MP-WEIXIN -->
  4. <u-navbar :is-back="false" title=" " :background="{ background: '#ffffff' }" :border-bottom="false"></u-navbar>
  5. <!-- #endif -->
  6. <!-- #ifndef MP-WEIXIN -->
  7. <view class="status_bar"></view>
  8. <!-- #endif -->
  9. <u-cell-group>
  10. <u-cell-item title="账号与安全" @click="linkToAccount" :title-style="{ marginLeft: '10rpx' }"></u-cell-item>
  11. </u-cell-group>
  12. <view style="height: 10rpx;"></view>
  13. <u-cell-group>
  14. <u-cell-item @click="linkToCommon(index)" v-for="(item, index) in groupList" :key="index" :title="item.title" :title-style="{ marginLeft: '10rpx' }">
  15. </u-cell-item>
  16. </u-cell-group>
  17. <view style="height: 10rpx;"></view>
  18. <u-cell-group>
  19. <u-cell-item @tap="upApp" title="检查更新" :title-style="{ marginLeft: '10rpx' }">
  20. </u-cell-item>
  21. </u-cell-group>
  22. <!--<view style="height: 10rpx;"></view>
  23. <u-cell-group>
  24. <u-cell-item :arrow="false">
  25. <view style="text-align: center;">切换账号</view>
  26. </u-cell-item>
  27. </u-cell-group>-->
  28. <view style="height: 10rpx;"></view>
  29. <u-cell-group>
  30. <u-cell-item :arrow="false" @click="logout">
  31. <view style="text-align: center;">退出登录</view>
  32. </u-cell-item>
  33. </u-cell-group>
  34. </view>
  35. </template>
  36. <script>
  37. import apiconfig from '../../apiconfig.js'
  38. export default {
  39. data() {
  40. return {
  41. groupList: [
  42. /* { title: '新消息通知', color: '#409eff', icon: 'star' }, */
  43. /* { title: '隐私', color: '#409eff', icon: 'photo' }, */
  44. { title: '通用', color: '#409eff', icon: 'coupon' },
  45. /* { title: '帮助与反馈', color: '#ff9900', icon: 'heart' } */
  46. ],
  47. }
  48. },
  49. methods: {
  50. linkToCommon(index){
  51. this.$u.route({
  52. url: 'pageC/my/common'
  53. });
  54. },
  55. linkToAccount(){
  56. this.$u.route({
  57. url: 'pageC/my/account'
  58. });
  59. },
  60. logout(){
  61. uni.clearStorageSync();
  62. // this.$u.route({
  63. // url: 'pages/login/loginV2'
  64. // });
  65. this.$u.route({
  66. url: 'pages/login/loginV2'
  67. });
  68. },
  69. upApp(){
  70. // #ifdef APP-PLUS
  71. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  72. apiconfig.getCheckVersion({}).then(res=>{
  73. if(widgetInfo.version == res.data.data.version){
  74. uni.showToast({
  75. icon:"none",
  76. duration:2000,
  77. title:'暂无版本更新'
  78. })
  79. return;
  80. }
  81. uni.showLoading({
  82. title:'下载中....',
  83. mask:true
  84. })
  85. uni.downloadFile({
  86. url: res.data.data.android,
  87. success: (downloadResult) => {
  88. if (downloadResult.statusCode === 200) {
  89. plus.runtime.install(downloadResult.tempFilePath, {
  90. force: false
  91. }, function() {
  92. plus.runtime.restart();
  93. uni.hideLoading()
  94. }, function(e) {
  95. uni.hideLoading()
  96. });
  97. }
  98. },
  99. fail: (res) =>{
  100. uni.showToast({
  101. icon:"none",
  102. duration:2000,
  103. title:res
  104. })
  105. }
  106. });
  107. });
  108. });
  109. // #endif
  110. }
  111. }
  112. }
  113. </script>
  114. <style lang="scss" scoped>
  115. </style>