洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

249 lines
6.3 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
5 months ago
10 months ago
5 months ago
10 months ago
10 months ago
5 months ago
10 months ago
10 months ago
10 months ago
10 months ago
5 months ago
10 months ago
  1. <template>
  2. <view class="pageBg">
  3. <view class="pad">
  4. <!-- <view class="avatarBox" @click="editAvatar">
  5. <view class="avatar">
  6. <image :src="avatarBase64?avatarBase64:avatarLink" mode=""></image>
  7. <view class="imgMask" v-if="avatarBase64">审核中</view>
  8. </view>
  9. <view class="editBtn">修改头像</view>
  10. </view> -->
  11. <view class="card">
  12. <view class="row">
  13. <view class="lab">手机号</view>
  14. <view class="val">{{ vuex_userInfo.phone }}</view>
  15. </view>
  16. </view>
  17. <view class="card" v-if="vuex_userInfo.schoolName">
  18. <view class="row border">
  19. <view class="lab">我的驾校</view>
  20. <view class="val">{{ vuex_userInfo.schoolName||'' }}</view>
  21. </view>
  22. <view class="row border">
  23. <view class="lab">我的教练</view>
  24. <view class="val">{{ vuex_userInfo.coachName||'' }}</view>
  25. </view>
  26. <view class="row border">
  27. <view class="lab">所学车型</view>
  28. <view class="val">{{ vuex_userInfo.trainType||'' }}</view>
  29. </view>
  30. <view class="row">
  31. <view class="lab">报名时间</view>
  32. <view class="val">{{ $u.timeFormat(vuex_userInfo.applyDate, 'yyyy-mm-dd hh:MM:ss')}}</view>
  33. </view>
  34. </view>
  35. <view class="card" v-if="vuex_userInfo.cardType>1" @click="$goPage('/pages/mineEntry/personaInfo/myInfo')">
  36. <view class="row">
  37. <view class="lab">个人信息</view>
  38. <view class="flex">
  39. <view class="val">查看</view>
  40. <view class="icon">
  41. <u-icon name="arrow-right"></u-icon>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="card" v-if="vuex_userInfo.cardType==1">
  47. <view class="row">
  48. <view class="lab">实名认证</view>
  49. <view class="val">已完成</view>
  50. </view>
  51. </view>
  52. <!-- <view class="card" v-if="vuex_userInfo.cardType==1">
  53. <view class="row">
  54. <view class="lab">拍照&体检&面签</view>
  55. <view class="val">已完成</view>
  56. </view>
  57. </view> -->
  58. <!-- <view class="logout" @click="deleteTestClick" style="margin-top: 40rpx;">删除测试账号开发用的</view> -->
  59. </view>
  60. <view class="footerBtn">
  61. <view class="btnBg" @click="logOutFn">退出登录</view>
  62. <view class="AccountCancellation" @click="AccountCanceFn">注销账号</view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import { logOut,deleteTest } from '@/config/api.js'
  68. export default {
  69. data() {
  70. return {
  71. avatarLink: '',
  72. avatarBase64: ''
  73. }
  74. },
  75. onLoad() {
  76. uni.$on('uAvatarCropper', (res)=>{
  77. this.avatarLink = res
  78. })
  79. },
  80. onShow() {
  81. if(uni.getStorageSync('avatarBase64')) this.avatarBase64 = uni.getStorageSync('avatarBase64')
  82. },
  83. methods: {
  84. // 点击修改头像
  85. editAvatar() {
  86. this.uploadTapFn()
  87. },
  88. uploadTapFn() {
  89. const _this = this;
  90. uni.chooseImage({
  91. count: 1, // 默认9
  92. sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
  93. sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  94. success: (res) => {
  95. let url = res.tempFilePaths[0];
  96. // 获取裁剪图片资源后,给data添加src属性及其值
  97. console.log('跳转到哪了?')
  98. uni.navigateTo({
  99. url: '/pages/mineEntry/uAvatarCropper/uAvatarCropper?src=' + encodeURIComponent(url)
  100. })
  101. }
  102. });
  103. },
  104. AccountCanceFn() {
  105. this.$goPage('/pages/mineEntry/personaInfo/AccountCance')
  106. },
  107. logOutFn() {
  108. let _this = this
  109. uni.showModal({
  110. content: '确定要退出登录吗?',
  111. success: async function (res) {
  112. if (res.confirm) {
  113. logOut().then(()=>{
  114. _this.$store.commit('goLogin')
  115. }).catch(()=>{
  116. _this.$store.commit('goLogin')
  117. })
  118. } else if (res.cancel) {
  119. console.log('用户点击取消');
  120. }
  121. }
  122. });
  123. },
  124. async deleteTestClick() {
  125. const res = await deleteTest({phone: this.vuex_userInfo.phone})
  126. this.$store.commit('goLogin')
  127. console.log(res)
  128. },
  129. uploadTap() {
  130. // let studentId = uni.getStorageSync('studentId')
  131. // if(!studentId&&!this.havePay) return false
  132. const _this = this;
  133. uni.chooseImage({
  134. count: 1, // 默认9
  135. sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
  136. sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  137. success: (res) => {
  138. let url = res.tempFilePaths[0];
  139. // 获取裁剪图片资源后,给data添加src属性及其值
  140. uni.navigateTo({
  141. url: '/pages/indexEntry/enroll/uploadAvatar/uAvatarCropper/uAvatarCropper?url=' + encodeURIComponent(url)
  142. })
  143. }
  144. });
  145. },
  146. }
  147. }
  148. </script>
  149. <style lang="scss" scoped>
  150. .editBtn {
  151. padding: 10rpx 20rpx ;
  152. border: 1rpx solid #ebedf0;
  153. font-size: 28rpx;
  154. color: #333;
  155. border-radius: 10rpx;
  156. margin: 10rpx 0 30rpx 0;
  157. background-color: #fff;
  158. }
  159. .card {
  160. padding: 6rpx;
  161. margin-bottom: 20rpx;
  162. }
  163. .pad {
  164. overflow: hidden;
  165. }
  166. .avatarBox {
  167. display: flex;
  168. flex-direction: column;
  169. justify-content: center;
  170. align-items: center;
  171. position: relative;
  172. .avatar {
  173. width: 175rpx;
  174. height: 175rpx;
  175. border-radius: 50%;
  176. overflow: hidden;
  177. background-color: #E8E9EC;
  178. position: relative;
  179. .imgMask {
  180. position: absolute;
  181. left: 0;
  182. right: 0;
  183. top: 0;
  184. bottom: 0;
  185. background: rgba(0,0,0,1);
  186. // background-color: rgba(0,0,0,0.4);
  187. font-size: 24rpx;
  188. // color: rgba(255,255,255,0.8);
  189. color: #fff;
  190. opacity: 0.4;
  191. line-height: 104rpx;
  192. text-align: center;
  193. }
  194. }
  195. .phoneIcon {
  196. width: 46rpx;
  197. height: 46rpx;
  198. position: absolute;
  199. right: 0;
  200. bottom: 0;
  201. z-index: 9;
  202. }
  203. }
  204. .row {
  205. display: flex;
  206. align-items: center;
  207. justify-content: space-between;
  208. height: 98rpx;
  209. font-size: 28rpx;
  210. padding: 0 30rpx;
  211. &.border {
  212. border-bottom: 2rpx solid #E8E9EC;
  213. }
  214. }
  215. .logout {
  216. width: 396rpx;
  217. height: 72rpx;
  218. background: #FFFFFF;
  219. border-radius: 8rpx;
  220. border: 2rpx solid #E8E9EC;
  221. font-size: 28rpx;
  222. color: #ADADAD;
  223. text-align: center;
  224. line-height: 72rpx;
  225. margin: 88rpx auto;
  226. }
  227. .AccountCancellation {
  228. border: 1px solid #d1d1d1;;
  229. border-radius: 8rpx;
  230. border-color: linear-gradient(180deg, #3593FB 0%, #53D3E5 100%);
  231. line-height: 72rpx;
  232. color: #999;
  233. text-align: center;
  234. font-size: 28rpx;
  235. margin-top: 30rpx;
  236. }
  237. </style>