mine.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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.supplierName }}</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("loginInfo")
  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.$http2('imSys/imLoginUrl', {
  73. token:this.token,
  74. type:1
  75. },'POST').then(res => {
  76. console.log(res)
  77. if(res.code!=0){
  78. uni.clearStorageSync();
  79. uni.navigateTo({
  80. url: './login'
  81. })
  82. }
  83. })
  84. },
  85. claerHc(){
  86. uni.showToast({
  87. icon: 'none',
  88. title: '清除成功',
  89. duration: 3000
  90. });
  91. },
  92. goUp(){
  93. uni.navigateTo({
  94. url:'editPass'
  95. })
  96. },
  97. goBrand(){
  98. uni.navigateTo({
  99. url:'brand'
  100. })
  101. },
  102. logout() {
  103. uni.clearStorageSync();
  104. uni.navigateTo({
  105. url: './login'
  106. })
  107. /* if(GoEasy.getConnectionStatus() === 'disconnected') {
  108. return
  109. }
  110. uni.showLoading({
  111. title: '注销中',
  112. mask: true,
  113. });
  114. GoEasy.disconnect({
  115. onSuccess: function () {
  116. uni.hideLoading();
  117. console.log('注销成功')
  118. uni.$currentUser = null;
  119. },
  120. onFailed: function (error) {
  121. uni.hideLoading();
  122. uni.showToast({
  123. icon: 'none',
  124. title: '注销超时,请检查网络!(务必确保注销成功才允许客户退出应用,否则有可能会收到上个用户的消息。)',
  125. duration: 6000
  126. });
  127. console.log('注销失败', error);
  128. }
  129. }); */
  130. }
  131. }
  132. }
  133. </script>
  134. <style scoped>
  135. .topBox{
  136. display: flex;
  137. color: #FFFFFF;
  138. font-weight: 500;
  139. font-size: 34rpx;
  140. color: #FFFFFF;
  141. padding-left: 25rpx;
  142. padding-top: 70rpx;
  143. }
  144. .cont{
  145. padding: 0 24rpx;
  146. }
  147. .lineIcon{
  148. width: 40rpx;height: 40rpx;margin-right: 10rpx;
  149. }
  150. .lineName{
  151. display: flex;line-height: 42rpx;
  152. }
  153. .contBox{
  154. background: #FFFFFF;
  155. border-radius: 10rpx;
  156. }
  157. .mine {
  158. width: 100%;
  159. height: 100%;
  160. display: flex;
  161. flex-direction: column;
  162. background: #F7F7F7;
  163. }
  164. .top {
  165. height: 240rpx;
  166. background: #46B1F8;
  167. /* display: flex;
  168. flex-direction: column;
  169. justify-content: center;
  170. align-items: center; */
  171. }
  172. .top .touxiang {
  173. width: 82rpx;
  174. height: 82rpx;
  175. /* border-radius: 156rpx; */
  176. }
  177. .top .name {
  178. line-height: 82rpx;
  179. padding-left: 16rpx;
  180. }
  181. .bottom {
  182. text-align: center;
  183. line-height: 200rpx;
  184. margin-top: 100rpx;
  185. }
  186. .logout {
  187. width: 702rpx;
  188. height: 88rpx;
  189. background: #FFFFFF;
  190. border-radius: 10rpx;
  191. margin: 0 auto;
  192. text-align: center;
  193. line-height: 88rpx;
  194. font-size: 28rpx;
  195. color: #F03B3B;
  196. }
  197. .line{
  198. display: flex;justify-content: space-between;
  199. padding: 30rpx 20rpx;
  200. border-bottom: 1px solid #eee;
  201. color: #333333;
  202. }
  203. .jtImg{
  204. width: 20rpx;height: 20rpx;margin-top: 6rpx;
  205. }
  206. </style>