mine.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. <template>
  2. <view>
  3. <view class="background">
  4. <view class="head" @click="toEditProfile">
  5. <view class="photo">
  6. <u-avatar class="avatar" :src="form.headImg != null ? form.headImg : '../../assets/img/head.png'" size="112">
  7. </u-avatar>
  8. </view>
  9. <view class="infos">
  10. <view class="name">
  11. {{form.studentName}}
  12. </view>
  13. <view class="modification">
  14. 点击修改个人信息
  15. </view>
  16. </view>
  17. </view>
  18. <!-- <view class="class-times">
  19. <view class="box">
  20. <view class="times"> 36节 </view>
  21. <view class="text"> 购买课次 </view>
  22. </view> <u-line direction="col" color="rgba(232, 232, 232, 1)" length="80rpx" margin="auto 0"></u-line>
  23. <view class="box">
  24. <view class="times"> 4节 </view>
  25. <view class="text"> 赠送课次 </view>
  26. </view>
  27. </view> -->
  28. </view>
  29. <view class="option-group">
  30. <!-- <view class="item">
  31. <view class="title">
  32. <view class="icon">
  33. <img src="../../../assets/img/riLine-user-smile-line@1x.png" alt="">
  34. </view>
  35. <view class="text">
  36. 人脸信息采集
  37. </view>
  38. </view>
  39. <view class="value">
  40. <view class="text">
  41. </view>
  42. <view class="icon">
  43. <u-icon name="arrow-right" color="#cccccc"></u-icon>
  44. </view>
  45. </view>
  46. </view> -->
  47. <view class="item" @click="gotoUrl('pages/youth/mine/changePhoneNumber/changePhoneNumber')">
  48. <view class="title">
  49. <view class="icon">
  50. <img src="../../../assets/img/riLine-smartphone-line@1x(1).png" alt="">
  51. </view>
  52. <view class="text">
  53. 绑定手机
  54. </view>
  55. </view>
  56. <view class="value">
  57. <view class="text">
  58. {{form.phone.slice(0,3) + '****' + form.phone.slice(-4)}}
  59. </view>
  60. <view class="icon">
  61. <u-icon name="arrow-right" color="#cccccc"></u-icon>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="item" @click="gotoUrl('pages/youth/mine/optionsList')">
  66. <view class="title">
  67. <view class="icon">
  68. <img src="../../../assets/img/riLine-file-edit-line@1x.png" alt="">
  69. </view>
  70. <view class="text">
  71. 意见反馈
  72. </view>
  73. </view>
  74. <view class="value">
  75. <view class="icon">
  76. <u-icon name="arrow-right" color="#cccccc"></u-icon>
  77. </view>
  78. </view>
  79. </view>
  80. <!-- <view class="item">
  81. <view class="title">
  82. <view class="icon">
  83. <img src="../../../assets/img/riLine-customer-service-2-line@1x.png" alt="">
  84. </view>
  85. <view class="text">
  86. 联系我们
  87. </view>
  88. </view>
  89. <view class="value">
  90. <view class="text">
  91. 0716-8888888
  92. </view>
  93. <view class="icon">
  94. <u-icon name="arrow-right" color="#cccccc"></u-icon>
  95. </view>
  96. </view>
  97. </view> -->
  98. <view class="item" @click="gotoUrl('pages/youth/mine/logout')">
  99. <view class="title">
  100. <view class="icon">
  101. <img src="../../../assets/img/riLine-spam-3-line@1x.png" alt="">
  102. </view>
  103. <view class="text">
  104. 注销账号
  105. </view>
  106. </view>
  107. <view class="value">
  108. <view class="text">
  109. 注销后无法恢复,请谨慎操作
  110. </view>
  111. <view class="icon">
  112. <u-icon name="arrow-right" color="#cccccc"></u-icon>
  113. </view>
  114. </view>
  115. </view>
  116. <view class="item" @click="signOut">
  117. <view class="title">
  118. <view class="icon">
  119. <img src="../../../assets/img/riLine-logout-box-r-line@1x(1).png" alt="">
  120. </view>
  121. <view class="text">
  122. 退出账号
  123. </view>
  124. </view>
  125. <view class="value">
  126. <view class="text">
  127. </view>
  128. <view class="icon">
  129. <u-icon name="arrow-right" color="#cccccc"></u-icon>
  130. </view>
  131. </view>
  132. </view>
  133. <u-modal v-model="show" @confirm="confirm" confirm-color="#FF3D00" :show-cancel-button="true" ref="uModal"
  134. :asyncClose="true" :title="title" :content="content" :content-style="{color: '#333333'}"></u-modal>
  135. </view>
  136. <YouthTabbar :current="3" ref="tabbarMain"></YouthTabbar>
  137. </view>
  138. </template>
  139. <script>
  140. import * as mineApi from '@/apis/youth/mine.js'
  141. import * as loginApi from '@/apis/login.js'
  142. import * as API from '@/apis/index.js'
  143. import YouthTabbar from '@/components/YouthTabbar.vue'
  144. export default {
  145. components: {
  146. YouthTabbar
  147. },
  148. data() {
  149. return {
  150. form: {
  151. id: '',
  152. headImg: '',
  153. nickName: '',
  154. phone: ''
  155. },
  156. show: false,
  157. title: '退出账号',
  158. content: '是否退出当前账号?',
  159. }
  160. },
  161. onReady() {
  162. this.getInfo();
  163. },
  164. methods: {
  165. getInfo() {
  166. uni.showLoading({
  167. title: "加载中",
  168. mask: true,
  169. })
  170. loginApi.findByOpenId({
  171. openId: this.carhelp.getOpenId()
  172. }).then((response) => {
  173. uni.hideLoading();
  174. this.form = response.data.nsStudentInfo;
  175. this.carhelp.setNsStudentId({studentId: response.data.nsStudentInfo.id});
  176. }).catch(error => {
  177. uni.showToast({
  178. title: error,
  179. icon: "none"
  180. })
  181. })
  182. },
  183. signOut() {
  184. this.show = true;
  185. },
  186. confirm() {
  187. uni.showLoading({
  188. title: "加载中",
  189. mask: true,
  190. })
  191. API.logout().then((res) => {
  192. uni.hideLoading();
  193. this.show = false;
  194. this.carhelp.logoff()
  195. uni.reLaunch({
  196. url: '/pages/youth/login/login'
  197. })
  198. }).catch(error => {
  199. uni.showToast({
  200. title: error,
  201. icon: "none"
  202. })
  203. })
  204. },
  205. toEditProfile() {
  206. uni.navigateTo({
  207. url: '/pages/youth/mine/editProfile'
  208. })
  209. },
  210. }
  211. }
  212. </script>
  213. <style lang="scss" scoped>
  214. .background {
  215. height: 400rpx;
  216. background: linear-gradient(180.17deg, rgba(123, 217, 224, 1) 0.45%, rgba(13, 186, 199, 0) 101.25%);
  217. }
  218. .head {
  219. padding: 80rpx 40rpx;
  220. display: flex;
  221. align-items: center;
  222. .photo {
  223. width: 120rpx;
  224. height: 120rpx;
  225. border-radius: 100rpx;
  226. border: 4rpx solid rgba(255, 255, 255, 1);
  227. overflow: hidden;
  228. img {
  229. width: 100%;
  230. height: 100%;
  231. }
  232. }
  233. .infos {
  234. margin-left: 32rpx;
  235. .name {
  236. color: rgba(51, 51, 51, 1);
  237. font-size: 20px;
  238. line-height: 20px;
  239. font-weight: bold;
  240. }
  241. .modification {
  242. color: rgba(119, 119, 119, 1);
  243. font-size: 24rpx;
  244. line-height: 24rpx;
  245. margin-top: 16rpx;
  246. }
  247. }
  248. }
  249. .my-children {
  250. margin: 0 32rpx;
  251. padding: 32rpx 24rpx;
  252. border-radius: 12px;
  253. background: linear-gradient(90deg, rgba(13, 186, 199, 1) 0%, rgba(37, 209, 146, 1) 100%);
  254. .top {
  255. display: flex;
  256. justify-content: space-between;
  257. .text {
  258. color: rgba(255, 255, 255, 1);
  259. font-size: 18px;
  260. }
  261. .add {
  262. width: 120rpx;
  263. line-height: 28px;
  264. border-radius: 50px;
  265. background-color: rgba(255, 174, 0, 1);
  266. color: rgba(255, 255, 255, 1);
  267. font-size: 28rpx;
  268. text-align: center;
  269. }
  270. }
  271. .children {
  272. margin-top: 12px;
  273. border-radius: 16rpx;
  274. background-color: rgba(255, 255, 255, 1);
  275. padding: 24rpx 24rpx 8rpx 24rpx;
  276. display: -webkit-box;
  277. overflow-x: auto;
  278. position: relative;
  279. .check-box {
  280. width: 48%;
  281. padding: 16rpx 40rpx 16rpx 16rpx;
  282. border-radius: 100rpx;
  283. background-color: rgba(13, 186, 199, 0.1);
  284. border: 1px solid rgba(13, 186, 199, 0.5);
  285. display: flex;
  286. position: relative;
  287. margin-right: 24rpx;
  288. margin-bottom: 16rpx;
  289. .photo {
  290. width: 80rpx;
  291. height: 80rpx;
  292. border-radius: 100rpx;
  293. overflow: hidden;
  294. img {
  295. width: 100%;
  296. height: 100%;
  297. }
  298. }
  299. @media screen and(max-width:320px) {
  300. .photo {
  301. width: 70rpx;
  302. height: 70rpx;
  303. border-radius: 999rpx;
  304. overflow: hidden;
  305. img {
  306. width: 100%;
  307. height: 100%;
  308. vertical-align: middle;
  309. }
  310. }
  311. }
  312. .infos {
  313. margin-left: 16rpx;
  314. .name {
  315. width: 96rpx;
  316. overflow: hidden;
  317. white-space: nowrap;
  318. text-overflow: ellipsis;
  319. color: rgba(51, 51, 51, 1);
  320. font-size: 32rpx;
  321. line-height: 48rpx;
  322. }
  323. .age {
  324. color: rgba(119, 119, 119, 1);
  325. font-size: 24rpx;
  326. line-height: 28rpx;
  327. }
  328. }
  329. .radio {
  330. position: absolute;
  331. bottom: -2rpx;
  332. right: -40rpx;
  333. ::v-deep.uni-radio-input {
  334. width: 40rpx;
  335. height: 40rpx;
  336. background-color: rgba(221, 241, 242, 1);
  337. }
  338. ::v-deep.uni-radio-input-checked {
  339. background-color: #43C9D3 !important;
  340. border-color: #43C9D3 !important;
  341. }
  342. }
  343. ::v-deep.u-radio__icon-wrap {
  344. background-color: rgba(221, 241, 242, 1);
  345. }
  346. }
  347. @media screen and(max-width:320px) {
  348. .check-box {
  349. margin-right: 16rpx;
  350. }
  351. }
  352. }
  353. .children::-webkit-scrollbar {
  354. display: none;
  355. }
  356. }
  357. .class-times {
  358. border-radius: 12px;
  359. background-color: rgba(255, 255, 255, 1);
  360. display: flex;
  361. padding: 40rpx 0;
  362. margin: 0 32rpx 24rpx;
  363. .box {
  364. width: 50%;
  365. text-align: center;
  366. .times {
  367. color: rgba(51, 51, 51, 1);
  368. font-size: 20px;
  369. font-weight: bold;
  370. }
  371. .text {
  372. color: rgba(119, 119, 119, 1);
  373. font-size: 14px;
  374. margin-top: 8px;
  375. }
  376. }
  377. }
  378. .option-group {
  379. margin: -80rpx 32rpx 0;
  380. background-color: #fff;
  381. border-radius: 12px;
  382. .item {
  383. display: flex;
  384. justify-content: space-between;
  385. align-items: center;
  386. padding: 24rpx;
  387. border-bottom: 1px solid rgba(244, 244, 244, 1);
  388. .title {
  389. display: flex;
  390. align-items: center;
  391. img {
  392. vertical-align: middle;
  393. }
  394. .text {
  395. margin-left: 16rpx;
  396. color: rgba(119, 119, 119, 1);
  397. font-size: 28rpx
  398. }
  399. }
  400. .value {
  401. display: flex;
  402. align-items: center;
  403. .icon {
  404. margin-left: 16rpx;
  405. }
  406. .text {
  407. color: rgba(119, 119, 119, 1);
  408. font-size: 24rpx;
  409. }
  410. }
  411. }
  412. }
  413. </style>