洛阳学员端
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.

268 lines
7.3 KiB

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