mine.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view class="mine">
  3. <view :style="'padding-top:'+padtop+'px'">
  4. <navbar title="我的" :back="false" :bgcolor="backgroundColor" fixed zIndex="1010" :center="true" :custom='true' @getTop="getTop" color="#fff"/>
  5. <view class="head">
  6. <image :src="headimg" class="headimg"></image>
  7. <view class="headt">
  8. <view class="headtit">{{userInfo.userName}}</view>
  9. <view class="flext">
  10. <image :src="adrimg" class="headai"></image>
  11. <view class="headat">{{userInfo.nickName}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="mine_b">
  16. <view class="mine_l" @click="getrecond">
  17. <image :src="mineh" class="mine_limg"></image>
  18. <view class="mine_lt">核销记录</view>
  19. <image :src="rimg" class="mine_lr"></image>
  20. </view>
  21. <view class="mine_l" @click="getUse">
  22. <image :src="mineu" class="mine_limg"></image>
  23. <view class="mine_lt">使用指南</view>
  24. <image :src="rimg" class="mine_lr"></image>
  25. </view>
  26. <view class="mine_l" @click="getScLogin">
  27. <image :src="mined" class="mine_limg"></image>
  28. <view class="mine_lt">扫码登录</view>
  29. <image :src="rimg" class="mine_lr"></image>
  30. </view>
  31. <view class="mine_l" @click="getUpdate">
  32. <image :src="minex" class="mine_limg"></image>
  33. <view class="mine_lt">修改密码</view>
  34. <image :src="rimg" class="mine_lr"></image>
  35. </view>
  36. <view class="mine_l" @click="getOut">
  37. <image :src="mineo" class="mine_limg"></image>
  38. <view class="mine_lt">退出登录</view>
  39. <image :src="rimg" class="mine_lr"></image>
  40. </view>
  41. </view>
  42. <view class="bgbox" v-if="outflag"></view>
  43. <view v-if="outflag" class="outbox">
  44. <view class="outboxtit">退出登录</view>
  45. <view class="outboxtxt">是否确认退出当前账号?</view>
  46. <view class="outboxbtn">
  47. <view class="outbox_btn btn1" @click="getClose">我在想想</view>
  48. <view class="outbox_btn btn2" @click="getSure">立即退出</view>
  49. </view>
  50. </view>
  51. <!-- 底部 导航栏 currentPage 当前页面ID -->
  52. <tab-bar :currentPage="2"></tab-bar>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import tabBar from "@/components/tabbar/tabbar.vue"
  58. export default{
  59. data(){
  60. return{
  61. padtop:this.$http._GET.customBarH||0,
  62. backgroundColor:'transparent',
  63. headimg:require("static/images/headimg.png"),
  64. adrimg:require("static/images/adrimg.png"),
  65. mineh:require("static/images/mineh.png"),
  66. mineu:require("static/images/mineu.png"),
  67. mined:require("static/images/mined.png"),
  68. minex:require("static/images/minex.png"),
  69. mineo:require("static/images/out.png"),
  70. rimg:require('static/images/backrimg.png'),
  71. userId:'',
  72. userInfo:{},
  73. outflag:false
  74. }
  75. },
  76. components: {
  77. tabBar
  78. },
  79. onLoad() {
  80. this.getUserInfo()
  81. },
  82. methods:{
  83. getTop(e){
  84. this.padtop=e
  85. },
  86. getrecond(){
  87. var businessId=uni.getStorageSync('businessId')
  88. if(businessId&&businessId=='-1'){
  89. uni.showToast({
  90. title:'暂无核销记录',
  91. icon:"none"
  92. })
  93. }else{
  94. this.$http.routePage('/pages/index/record','nav')
  95. }
  96. },
  97. getUse(){
  98. this.$http.routePage('/pages/index/guidedetail?type=use','nav')
  99. },
  100. // 扫码登录
  101. getScLogin(){
  102. uni.navigateTo({
  103. url:'/pages/index/scan'
  104. })
  105. },
  106. getUpdate(){
  107. uni.navigateTo({
  108. url:'/pages/login/updatpaw?userName='+this.userInfo.userName
  109. })
  110. },
  111. getOut(){
  112. this.outflag=true
  113. },
  114. getClose(){
  115. this.outflag=false
  116. },
  117. getSure(){
  118. this.outflag=false
  119. uni.clearStorage()
  120. uni.reLaunch({
  121. url: '/pages/login/login'
  122. })
  123. },
  124. getUserInfo() {
  125. var userId=this.userId
  126. if(!userId){
  127. userId = uni.getStorageSync('userId')||''
  128. if(!userId){
  129. uni.reLaunch({
  130. url: '/pages/login/login'
  131. })
  132. return
  133. }
  134. }
  135. this.userId=userId
  136. this.$http.get('system/user/'+userId).then(res=>{
  137. // console.log(JSON.stringify(res))
  138. if(res.code == 200 ) {
  139. this.userInfo = res.data
  140. // 手机号是否展示
  141. // var d=['city01','queryApp','queryApp','city02']
  142. // var roles=res.roles.some((ite,idx)=>{
  143. // if(ite=='queryApp'){
  144. // return true
  145. // }
  146. // })
  147. // uni.setStorageSync('roles', roles)
  148. // uni.setStorageSync('phone', this.userInfo.phonenumber)
  149. }
  150. })
  151. },
  152. }
  153. }
  154. </script>
  155. <style scoped lang="scss">
  156. .flext{display: flex;align-items: flex-start;}
  157. .mine{width: 100%;background: url("@/static/images/minebg.png") no-repeat;background-size: 100%562rpx;min-height: 100vh;padding: 82rpx 34rpx 0;box-sizing: border-box;}
  158. .head{padding: 0 30rpx;display: flex;align-items: center;
  159. .headimg{width: 116rpx;height: 122rpx;margin-right: 28rpx;flex:0 0 auto;}
  160. .headt{overflow: hidden;
  161. .headtit{font-size: 34rpx;font-weight: bold;color: #FFFFFF;margin-bottom: 16rpx;}
  162. .headai{width: 36rpx;height: 38rpx;margin-top: 8rpx;flex:0 0 auto;}
  163. .headat{font-size: 26rpx;color: #FBDADC;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
  164. }
  165. }
  166. .mine_b{margin-top: 38rpx;width: 100%;background: #FFFFFF;box-shadow: 4rpx 6rpx 6rpx 0px rgba(91,91,91,0.2000);border-radius: 10rpx;}
  167. .mine_l{padding: 24rpx 32rpx 24rpx 28rpx;display: flex;align-items: center;min-height: 100rpx;box-sizing: border-box;}
  168. .mine_limg{width: 52rpx;height: 52rpx;margin-right: 18rpx;flex: 0 0 auto;}
  169. .mine_lt{font-size: 28rpx;font-weight: 400;flex: 1;}
  170. .mine_lr{width: 16rpx;height: 28rpx;flex: 0 0 auto;}
  171. .bgbox{position: fixed;left: 0;right: 0;bottom: 0;top: 0;background-color: rgba(0,0,0,0.5);z-index: 1200;}
  172. .outbox{width: 600rpx;border-radius: 30rpx;background-color: #fff;position: fixed;left:75rpx;right:75rpx;z-index: 1300;top: 50%;transform: translateY(-100rpx);
  173. .outboxtit{display: flex;flex-direction: row;justify-content: center;padding-top: 30rpx; padding-bottom: 10rpx;font-size: 32rpx;color: #909399;}
  174. .outboxtxt{display: flex;flex-direction: row;justify-content: center;align-items: center; padding: 10rpx 30rpx 30rpx 30rpx;font-size: 28rpx;color: #6e6e6e;}
  175. .outboxbtn{display: flex;flex-direction: row;border-top: 2rpx solid #f5f5f5;
  176. .outbox_btn{display: flex;flex: 1; flex-direction: row;justify-content: center;align-items: center;height: 90rpx;font-size: 28rpx;
  177. &.btn1{color: #009de7;}
  178. &.btn2{color: red;border-left:2rpx solid #f5f5f5;}
  179. }
  180. }
  181. }
  182. </style>