index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <style>
  2. page {
  3. background: #f5f5f5
  4. }
  5. .user-line {
  6. padding: 0 15px;
  7. height: 70px;
  8. background: #fff;
  9. border-top: 1px #f5f5f5 solid;
  10. display: flex;
  11. align-items: center
  12. }
  13. .ul-left {
  14. color: #585858;
  15. font-size: 14px
  16. }
  17. .ul-right {
  18. width: 60%;
  19. margin-left: auto;
  20. display: flex;
  21. align-items: center;
  22. justify-content: flex-end
  23. }
  24. .ulr-name {
  25. color: #9b9b9b;
  26. font-size: 13px
  27. }
  28. .ulr-img {
  29. width: 50px;
  30. height: 50px
  31. }
  32. .ulr-img image {
  33. width: 100%;
  34. height: 100%;
  35. border-radius: 100%
  36. }
  37. .ulr-jiantou {
  38. width: 16px;
  39. height: 16px;
  40. margin-left: 10px
  41. }
  42. .ulr-jiantou image {
  43. width: 100%;
  44. height: 100%
  45. }
  46. </style>
  47. <template>
  48. <view id="box">
  49. <view class="user-line" style="margin-top: 10px;" @tap="tapOpen" data-url="/pages/user/userinfo/password">
  50. <view class="ul-left"><text>修改密码</text></view>
  51. <view class="ul-right">
  52. <view class="ulr-name">
  53. <text></text>
  54. </view>
  55. <view class="ulr-jiantou">
  56. <image src="/static/img/ic_next.png"></image>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="user-line" style="margin-top: 10px;" @tap="tapOpen" data-url="/pages/user/userinfo/cancellation">
  61. <view class="ul-left"><text>注销账号</text></view>
  62. <view class="ul-right">
  63. <view class="ulr-name">
  64. <text></text>
  65. </view>
  66. <view class="ulr-jiantou">
  67. <image src="/static/img/ic_next.png"></image>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="user-line" style="margin-top: 10px;" @tap="onUpdate">
  72. <view class="ul-left"><text>检查更新</text></view>
  73. <view class="ul-right">
  74. <view class="ulr-name">
  75. <text>{{version}}</text>
  76. </view>
  77. <view class="ulr-jiantou">
  78. <image src="/static/img/ic_next.png"></image>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="user-line" @tap="tapOpen" data-url="/pages/operation/user">
  83. <view class="ul-left"><text>用户协议</text></view>
  84. <view class="ul-right">
  85. <view class="ulr-name">
  86. <text></text>
  87. </view>
  88. <view class="ulr-jiantou">
  89. <image src="/static/img/ic_next.png"></image>
  90. </view>
  91. </view>
  92. </view>
  93. <view class="user-line" @tap="tapOpen" data-url="/pages/operation/agreement">
  94. <view class="ul-left"><text>隐私条款</text></view>
  95. <view class="ul-right">
  96. <view class="ulr-name">
  97. <text></text>
  98. </view>
  99. <view class="ulr-jiantou">
  100. <image src="/static/img/ic_next.png"></image>
  101. </view>
  102. </view>
  103. </view>
  104. <view class="user-line" style="margin-top: 10px;" @tap="outClick()">
  105. <view class="ul-left"><text>退出登陆</text></view>
  106. <view class="ul-right" >
  107. <view class="ulr-name">
  108. <text></text>
  109. </view>
  110. <view class="ulr-jiantou">
  111. <image src="/static/img/ic_next.png"></image>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. </template>
  117. <script>
  118. import {
  119. mapState,
  120. mapMutations
  121. } from 'vuex'
  122. import global from "../../../config/global.js";
  123. export default {
  124. computed: mapState(['user']),
  125. data() {
  126. return {
  127. version:""
  128. }
  129. },
  130. onLoad() {
  131. this.version = global.version;
  132. },
  133. methods: {
  134. ...mapMutations(['loginOut','sysInit','setSys']),
  135. /**
  136. * 打开文件
  137. * @param {Object} ev
  138. */
  139. tapOpen: function(ev) {
  140. console.log(ev)
  141. let url = ev.currentTarget.dataset.url
  142. uni.navigateTo({
  143. url: url
  144. });
  145. },
  146. outClick:function(){
  147. this.utils.showModal("确认要退出吗",()=>{
  148. this.loginOut();
  149. uni.showToast({ title: '退出成功',mask: true,icon: 'none'});
  150. uni.reLaunch({ url:"/pages/login/index" });
  151. });
  152. },
  153. /**
  154. * 基本逻辑
  155. */
  156. onUpdate:function(){
  157. this
  158. .request
  159. .post("sysInit")
  160. .then(res => {
  161. if (res.code == 200) {
  162. this.setSys(res.data);
  163. if(plus != null){
  164. plus.runtime.getProperty(plus.runtime.appid,(wgtinfo)=>{
  165. console.log(wgtinfo);
  166. this.version = wgtinfo.version;
  167. if(wgtinfo.versionCode < res.data.app_code){
  168. uni.showModal({
  169. title:"新版本",
  170. content:res.data.app_update,
  171. success:()=> {
  172. console.log(this.$device.platform);
  173. if(this.$device.platform == 'ios') {
  174. var urlStr = encodeURI(res.data.ios_url);
  175. plus.runtime.openURL(urlStr);
  176. }
  177. if(this.$device.platform != 'ios') {
  178. var urlStr = encodeURI(res.data.android_url);
  179. plus.runtime.openURL(urlStr);
  180. }
  181. }
  182. })
  183. } else {
  184. this.utils.Tip("无新版本");
  185. }
  186. })
  187. }
  188. }
  189. });
  190. },
  191. },
  192. }
  193. </script>