mine.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <!-- 个人中心 -->
  2. <template>
  3. <view id="register">
  4. <view class="register_li">
  5. <view class="register_li_min" @click="goPage('datum')">
  6. <view>修改资料</view>
  7. <view class="view-three-type" :class="state==0?'colorA':'colorB'">{{state==0?'审核未通过':'审核已通过'}}</view>
  8. <img class="right-img" src="@/pages_supplier/images/icon_04.png">
  9. </view>
  10. <view class="register_li_min" @click="goPage('password')" style="border: none;">
  11. <view>修改密码</view>
  12. <view></view>
  13. <img class="right-img" src="@/pages_supplier/images/icon_04.png">
  14. </view>
  15. </view>
  16. <view class="sub_btn" @click="clickOut()">退出登录</view>
  17. </view>
  18. </template>
  19. <script>
  20. import {logout} from '@/api/apiDemo/index.js'
  21. import { config } from '@/api/request/config.js'
  22. export default {
  23. data() {
  24. return {
  25. form:{
  26. name:'',
  27. },
  28. state:null,
  29. }
  30. },
  31. onLoad(option) {//审核状态(0:未审核,1:审核通过,2:审核未通过)
  32. this.state=option.state
  33. },
  34. onShow(){
  35. },
  36. methods: {
  37. //页面跳转
  38. goPage(type){
  39. if(type == 'datum'){//修改资料
  40. uni.redirectTo({
  41. url: '/pages_supplier/register/register?pageStatus=1',//注册页面
  42. });
  43. }else if(type == 'password'){//修改密码
  44. uni.redirectTo({
  45. url: '/pages_supplier/mine/changePassword',
  46. });
  47. }
  48. },
  49. //退出按钮
  50. clickOut(){
  51. let self = this;
  52. uni.showModal({
  53. // title: '确认要退出吗?',
  54. content: '确认要退出吗',
  55. cancelColor:"#999",
  56. confirmColor:"#0183FA",
  57. success: function (res) {
  58. if (res.confirm) {
  59. self.logout();
  60. console.log('用户点击确定');
  61. } else if (res.cancel) {
  62. console.log('用户点击取消');
  63. }
  64. }
  65. });
  66. },
  67. //退出登录
  68. async logout() {
  69. let self = this;
  70. const {data} = await logout();
  71. if(data.code == 200){
  72. uni.removeStorageSync('token');
  73. uni.removeStorageSync('userId');
  74. uni.removeStorageSync('userType');
  75. uni.redirectTo({
  76. url: '/pages/login',
  77. });
  78. }
  79. },
  80. }
  81. }
  82. </script>
  83. <style lang="stylus" scoped>
  84. #register{
  85. height:100%;
  86. width:100%;
  87. display flex
  88. flex-direction column;
  89. padding-bottom: 220rpx;
  90. .register_li{
  91. background #fff;
  92. padding:20rpx 0;
  93. box-sizing: border-box;
  94. .register_li_min{
  95. margin:0 26rpx;
  96. display flex;
  97. align-items center;
  98. border-bottom: 1px solid #F5F5F5;
  99. display flex;
  100. view{
  101. line-height:110rpx;
  102. font-size:28rpx;
  103. }
  104. view:nth-child(1){
  105. font-size: 30rpx;
  106. font-family: PingFang SC;
  107. font-weight: 500;
  108. color: #333333;
  109. line-height: 110rpx;
  110. }
  111. view:nth-child(2){
  112. font-size: 28rpx;
  113. font-family: PingFang SC;
  114. font-weight: 500;
  115. line-height: 110rpx;
  116. flex:1;
  117. text-align: right;
  118. }
  119. .colorA{
  120. color:#FF3131!important;
  121. }
  122. .colorB{
  123. color:#999999!important;
  124. }
  125. >img{
  126. width: 12rpx;
  127. height: 24rpx;
  128. margin-left: 26rpx;
  129. }
  130. }
  131. }
  132. /* 按钮 */
  133. .sub_btn{
  134. width: 650rpx;
  135. height: 100rpx;
  136. background: #0183FA;
  137. border-radius: 20rpx;
  138. font-size: 28rpx;
  139. font-family: PingFang SC;
  140. font-weight: 500;
  141. color: #FFFFFF;
  142. line-height: 100rpx;
  143. text-align: center;
  144. margin-left: 50rpx;
  145. position: fixed;
  146. bottom:30rpx;
  147. z-index: 1000;
  148. }
  149. }
  150. </style>