mine.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <template>
  2. <view class="supplierCylinderManagement-mine">
  3. <!-- 背景渐变色 -->
  4. <view class="back-img-box"></view>
  5. <!-- 信息面板 -->
  6. <view class="user-info-box">
  7. <view class="left-img-box">
  8. <img v-if="userData.avatar" class="avatar-img" :src="baseUrl+userData.avatar">
  9. <img v-else class="avatar-img" :src="imagesUrl('commonality/icon_01.png')">
  10. <img class="edit-img" :src="imagesUrl('commonality/icon_wd_bj@1x.png')">
  11. </view>
  12. <view class="right-name-box">
  13. <view class="right-name-top-box">
  14. <view>{{userData.userName}}</view>
  15. </view>
  16. <view class="right-name-bottom-box">{{userData.deptName}}</view>
  17. </view>
  18. </view>
  19. <view class="null-flex-p"></view>
  20. <view class="out-button" @click="clickOut">退出登录</view>
  21. <tab-bar></tab-bar>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. config
  27. } from '@/api/request/config.js'
  28. import {
  29. logout,
  30. systemUserProfile,
  31. studentinfoFacemy,
  32. creditAppletGetMyPointsLogInfo,
  33. } from '@/pages/api/index.js'
  34. import {
  35. pageRestrictVerify
  36. } from '@/utils/index'
  37. import {
  38. tabBar
  39. } from '@/pages/views/supplierCylinderManagement/tabBar.vue'
  40. export default {
  41. name: "supplierCylinderManagement-mine",
  42. components: {
  43. tabBar,
  44. },
  45. data() {
  46. return {
  47. baseUrl: config.base_url,
  48. userData: {},
  49. bonusPoints: null,
  50. creditScore: null,
  51. faceImg:'',
  52. signatureUrl:'',
  53. }
  54. },
  55. created() {
  56. },
  57. mounted() {
  58. },
  59. onShow(){
  60. },
  61. methods: {
  62. initialize(){
  63. this.systemUserProfile();
  64. },
  65. //获取个人信息
  66. async systemUserProfile() {
  67. const {
  68. data
  69. } = await systemUserProfile();
  70. if (data.code == 200) {
  71. this.$set(this, 'userData', data.data)
  72. this.faceImg=data.data.faceImg;
  73. this.signatureUrl=data.data.signature
  74. uni.setStorageSync('faceImg', data.data.faceImg);
  75. }
  76. },
  77. //退出按钮
  78. clickOut() {
  79. let self = this;
  80. uni.showModal({
  81. // title: '确认要退出吗?',
  82. content: '确认要退出吗',
  83. cancelColor: "#999",
  84. confirmColor: "#0183FA",
  85. success: function(res) {
  86. if (res.confirm) {
  87. self.logout();
  88. } else if (res.cancel) {}
  89. }
  90. });
  91. },
  92. //退出登录
  93. async logout() {
  94. let self = this;
  95. const {
  96. data
  97. } = await logout();
  98. if (data.code == 200) {
  99. uni.removeStorageSync('token');
  100. uni.removeStorageSync('userId');
  101. uni.removeStorageSync('userType');
  102. uni.redirectTo({
  103. url: '/pages/views/login/login',
  104. });
  105. }
  106. },
  107. }
  108. }
  109. </script>
  110. <style lang="stylus" scoped>
  111. .supplierCylinderManagement-mine {
  112. flex: 1;
  113. display: flex;
  114. flex-direction: column;
  115. overflow-y: scroll;
  116. overflow-x: hidden;
  117. padding-bottom:200rpx;
  118. .back-img-box {
  119. z-index: 0;
  120. position: absolute;
  121. top: 0;
  122. left: 0;
  123. width: 750rpx;
  124. height: 291rpx;
  125. background: linear-gradient(180deg, rgba(1, 131, 250, 1) 0%, rgba(255, 255, 255, 0) 100%);
  126. }
  127. .user-info-box {
  128. z-index: 10;
  129. margin: 39rpx 24rpx 0;
  130. display: flex;
  131. .left-img-box {
  132. width: 132rpx;
  133. height: 132rpx;
  134. position: relative;
  135. margin-right: 22rpx;
  136. .avatar-img {
  137. position: absolute;
  138. top: 6rpx;
  139. left: 6rpx;
  140. width: 116rpx;
  141. height: 116rpx;
  142. border-radius: 50%;
  143. border: 2rpx solid #fff;
  144. }
  145. .edit-img {
  146. z-index: 5;
  147. position: absolute;
  148. right: 0;
  149. bottom: 6rpx;
  150. width: 40rpx;
  151. height: 40rpx;
  152. }
  153. }
  154. .right-name-box {
  155. padding-top: 6rpx;
  156. .right-name-top-box {
  157. display: flex;
  158. view:nth-child(1) {
  159. height: 68rpx;
  160. line-height: 62rpx;
  161. font-size: 32rpx;
  162. color: #fff;
  163. }
  164. view:nth-child(2) {
  165. margin-top: 14rpx;
  166. margin-left: 30rpx;
  167. width: 120rpx;
  168. height: 40rpx;
  169. line-height: 40rpx;
  170. background: #FF8C00;
  171. border-radius: 50rpx;
  172. font-size: 24rpx;
  173. color: #fff;
  174. text-align: center;
  175. }
  176. }
  177. .right-name-bottom-box {
  178. height: 50rpx;
  179. line-height: 50rpx;
  180. font-size: 28rpx;
  181. color: #fff;
  182. }
  183. }
  184. }
  185. .points-max-box {
  186. z-index: 10;
  187. width: 690rpx;
  188. height: 160rpx;
  189. background: #FFFFFF;
  190. border-radius: 20rpx;
  191. margin: 38rpx 30rpx 0;
  192. display: flex;
  193. .points-big-box {
  194. flex: 1;
  195. .num-p {
  196. margin: 39rpx 0 19rpx 0;
  197. text-align: center;
  198. font-size: 28rpx;
  199. line-height: 39rpx;
  200. }
  201. .img-box {
  202. display: flex;
  203. img {
  204. width: 30rpx;
  205. height: 30rpx;
  206. display: block;
  207. margin: 0 20rpx 0 42rpx;
  208. }
  209. view {
  210. color: #333333;
  211. line-height: 30rpx;
  212. font-size: 28rpx;
  213. }
  214. }
  215. .colorA {
  216. color: #0183FA;
  217. }
  218. .colorB {
  219. color: #26C736;
  220. }
  221. .colorC {
  222. color: #333333;
  223. }
  224. }
  225. .border-null-p {
  226. width: 1rpx;
  227. height: 40rpx;
  228. margin: 60rpx 0 0;
  229. background-color: #e0e0e0;
  230. }
  231. }
  232. .button-max-big-box {
  233. background-color: #fff;
  234. border-radius: 20rpx;
  235. margin: 20rpx 30rpx 0;
  236. .button-big-box:nth-child(1) {
  237. border-top: none;
  238. }
  239. .button-big-box {
  240. border-top: 1px solid #E0E0E0;
  241. display: flex;
  242. padding: 0 30rpx 0 26rpx;
  243. .left-img {
  244. display: block;
  245. width: 36rpx;
  246. height: 36rpx;
  247. margin-top: 25rpx;
  248. margin-right: 21rpx;
  249. }
  250. .left-text-p {
  251. flex: 1;
  252. front-size: 30rpx;
  253. line-height: 40rpx;
  254. margin: 20rpx 0;
  255. }
  256. .right-text-p {
  257. front-size: 30rpx;
  258. line-height: 40rpx;
  259. margin: 20rpx 0;
  260. }
  261. .right-img {
  262. display: block;
  263. width: 30rpx;
  264. height: 30rpx;
  265. margin-top: 28rpx;
  266. }
  267. }
  268. .color-D{
  269. color:#0183FA!important;
  270. }
  271. }
  272. .null-flex-p{
  273. flex:1;
  274. }
  275. .out-button {
  276. // position absolute;
  277. // bottom: 140rpx;
  278. // left: 75rpx;
  279. margin:20rpx 0 20rpx 75rpx;
  280. width: 600rpx;
  281. height: 80rpx;
  282. line-height: 80rpx;
  283. border-radius: 100rpx;
  284. text-align center;
  285. background #0183FA;
  286. color: #ffffff;
  287. font-size: 30rpx;
  288. }
  289. }
  290. </style>