mine.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="mine">
  3. <view class="top">
  4. <view class="topBox">
  5. <image src="/static/img/pic_def_ava@2x.png" mode="" class="touxiang"></image>
  6. <view class="name">{{ currentUser.name }}</view>
  7. </view>
  8. <!-- <image :src="currentUser.avatar"></image> -->
  9. </view>
  10. <view class="cont" style="margin-top: -50rpx;">
  11. <view class="contBox">
  12. <!-- <view class="line" >
  13. <view class="lineName">
  14. <image src="/static/img/my_icon_history@2x.png" mode="" class="lineIcon"></image>
  15. 语音播报提醒
  16. </view>
  17. <image src="/static/img/icon_arrow.png" mode="" class="jtImg"></image>
  18. </view> -->
  19. <view class="line" @click="goUp">
  20. <view class="lineName">
  21. <image src="/static/img/my_icon_psw@2x.png" mode="" class="lineIcon"></image>
  22. 修改密码
  23. </view>
  24. <image src="/static/img/icon_arrow.png" mode="" class="jtImg"></image>
  25. </view>
  26. <view class="line" @click="goBrand">
  27. <view class="lineName">
  28. <image src="/static/img/my_icon_jiuc@2x.png" mode="" class="lineIcon"></image>
  29. 经营品牌</view>
  30. <image src="/static/img/icon_arrow.png" mode="" class="jtImg"></image>
  31. </view>
  32. </view>
  33. <!-- <view class="contBox" style="margin-top: 20rpx;">
  34. <view class="line">
  35. <view class="lineName">当前版本</view>
  36. <view class="version">version1.0.0</view>
  37. </view>
  38. <view class="line" @click="claerHc">
  39. <view class="lineName">清除缓存</view>
  40. <image src="/static/img/icon_arrow.png" mode="" class="jtImg"></image>
  41. </view>
  42. </view> -->
  43. </view>
  44. <view class="bottom">
  45. <view class="logout" @click="logout">退出</view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. const GoEasy = uni.$GoEasy;
  51. export default {
  52. data() {
  53. return {
  54. currentUser: null,
  55. token:'',
  56. }
  57. },
  58. onShow() {
  59. this.currentUser = uni.getStorageSync("currentUser")
  60. var token= uni.getStorageSync("accessToken")
  61. this.token=token
  62. if(token){
  63. //this.imLoginUrl()
  64. }else{
  65. uni.navigateTo({
  66. url: './login'
  67. })
  68. }
  69. },
  70. methods: {
  71. imLoginUrl(){
  72. this.$http('imSys/imLoginUrl', {
  73. token:this.token,
  74. },'POST').then(res => {
  75. console.log(res)
  76. if(res.code!=0){
  77. uni.clearStorageSync();
  78. uni.navigateTo({
  79. url: './login'
  80. })
  81. }
  82. })
  83. },
  84. claerHc(){
  85. uni.showToast({
  86. icon: 'none',
  87. title: '清除成功',
  88. duration: 3000
  89. });
  90. },
  91. goUp(){
  92. uni.navigateTo({
  93. url:'editPass'
  94. })
  95. },
  96. goBrand(){
  97. uni.navigateTo({
  98. url:'brand'
  99. })
  100. },
  101. logout() {
  102. uni.removeStorageSync('currentUser');
  103. uni.navigateTo({
  104. url: './login'
  105. })
  106. /* if(GoEasy.getConnectionStatus() === 'disconnected') {
  107. return
  108. }
  109. uni.showLoading({
  110. title: '注销中',
  111. mask: true,
  112. });
  113. GoEasy.disconnect({
  114. onSuccess: function () {
  115. uni.hideLoading();
  116. console.log('注销成功')
  117. uni.$currentUser = null;
  118. },
  119. onFailed: function (error) {
  120. uni.hideLoading();
  121. uni.showToast({
  122. icon: 'none',
  123. title: '注销超时,请检查网络!(务必确保注销成功才允许客户退出应用,否则有可能会收到上个用户的消息。)',
  124. duration: 6000
  125. });
  126. console.log('注销失败', error);
  127. }
  128. }); */
  129. }
  130. }
  131. }
  132. </script>
  133. <style scoped>
  134. .topBox{
  135. display: flex;
  136. color: #FFFFFF;
  137. font-weight: 500;
  138. font-size: 34rpx;
  139. color: #FFFFFF;
  140. padding-left: 25rpx;
  141. padding-top: 70rpx;
  142. }
  143. .cont{
  144. padding: 0 24rpx;
  145. }
  146. .lineIcon{
  147. width: 40rpx;height: 40rpx;margin-right: 10rpx;
  148. }
  149. .lineName{
  150. display: flex;line-height: 42rpx;
  151. }
  152. .contBox{
  153. background: #FFFFFF;
  154. border-radius: 10rpx;
  155. }
  156. .mine {
  157. width: 100%;
  158. height: 100%;
  159. display: flex;
  160. flex-direction: column;
  161. background: #F7F7F7;
  162. }
  163. .top {
  164. height: 240rpx;
  165. background: #46B1F8;
  166. /* display: flex;
  167. flex-direction: column;
  168. justify-content: center;
  169. align-items: center; */
  170. }
  171. .top .touxiang {
  172. width: 82rpx;
  173. height: 82rpx;
  174. /* border-radius: 156rpx; */
  175. }
  176. .top .name {
  177. line-height: 82rpx;
  178. padding-left: 16rpx;
  179. }
  180. .bottom {
  181. text-align: center;
  182. line-height: 200rpx;
  183. margin-top: 100rpx;
  184. }
  185. .logout {
  186. width: 702rpx;
  187. height: 88rpx;
  188. background: #FFFFFF;
  189. border-radius: 10rpx;
  190. margin: 0 auto;
  191. text-align: center;
  192. line-height: 88rpx;
  193. font-size: 28rpx;
  194. color: #F03B3B;
  195. }
  196. .line{
  197. display: flex;justify-content: space-between;
  198. padding: 30rpx 20rpx;
  199. border-bottom: 1px solid #eee;
  200. color: #333333;
  201. }
  202. .jtImg{
  203. width: 20rpx;height: 20rpx;margin-top: 6rpx;
  204. }
  205. </style>