my.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <template>
  2. <view class="my-container">
  3. <view class="bg1"></view>
  4. <view class="bg2"></view>
  5. <!-- 家长信息头部 -->
  6. <view class="userinfo-topinfo">
  7. <image class="parent-avatar" :src="parentinfo.avatarUrl"></image>
  8. <view class="parent-name">
  9. <text class="name">{{parentinfo.nickName}}</text>
  10. <u-tag :text="childreninfo.name + '家长'" shape="circle" plain plainFill></u-tag>
  11. </view>
  12. </view>
  13. <!-- 功能组件 -->
  14. <view class="userinfo-container">
  15. <!-- 面板区域 -->
  16. <view class="box-cart">
  17. <view class="box-cart-item left-box" @click="chooseChildren">
  18. <view class="t-icon t-icon-a-boshimaojiaoyu"></view>
  19. <view class="card-text">
  20. 孩子管理
  21. <view class="card-des">
  22. 查看您的孩子
  23. </view>
  24. </view>
  25. </view>
  26. <view class="box-cart-item right-box" @click="childrenInfo">
  27. <view class="t-icon t-icon-a-jiangpaijiangzhang"></view>
  28. <view class="card-text">
  29. 孩子名片
  30. <view class="card-des">
  31. 晒出TA的优秀表现
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- 用户功能 -->
  37. <view class="com-item">
  38. <view class="com-box">
  39. <view class="cell" @click="myInfo">
  40. <view class="cell-left">
  41. <view class="t-icon t-icon-zhanghu"></view>
  42. <view class="cell-text">个人信息</view>
  43. </view>
  44. <u-icon name="arrow-right" color="#bababa" size="16"></u-icon>
  45. </view>
  46. <view class="cell" @click="myMsg">
  47. <view class="cell-left">
  48. <view class="t-icon t-icon-a-liaotianpingluntaolunduihua"></view>
  49. <view class="cell-text">我的消息</view>
  50. </view>
  51. <view class="cell-right">
  52. <u-badge type="warning" shape="horn" :value="myData.msgList.length"></u-badge>
  53. <u-icon name="arrow-right" color="#bababa" size="16"></u-icon>
  54. </view>
  55. </view>
  56. <view class="cell" @click="logout">
  57. <view class="cell-left">
  58. <view class="t-icon t-icon-a-tuichulikai"></view>
  59. <view class="cell-text">退出登录</view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- 用户服务 -->
  65. <view class="com-item">
  66. <view class="com-box">
  67. <view class="cell">
  68. <view class="cell-left">
  69. <view class="t-icon t-icon-shoucang"></view>
  70. <view class="cell-text">客服中心</view>
  71. </view>
  72. </view>
  73. <view class="cell">
  74. <view class="cell-left">
  75. <view class="t-icon t-icon-a-appyingyongchengxukaifa"></view>
  76. <view class="cell-text">帮助中心</view>
  77. </view>
  78. </view>
  79. <view class="cell">
  80. <view class="cell-left">
  81. <view class="t-icon t-icon-shuji"></view>
  82. <view class="cell-text">用户协议</view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </template>
  90. <script>
  91. import {
  92. mapState,
  93. mapMutations
  94. } from 'vuex'
  95. export default {
  96. computed: {
  97. ...mapState('m_parent', ['token', 'parentdetail', 'parentinfo', 'myData']),
  98. ...mapState('m_children', ['childreninfo', 'semesterList'])
  99. },
  100. data() {
  101. return {
  102. show: false,
  103. };
  104. },
  105. onLoad() {},
  106. methods: {
  107. ...mapMutations('m_parent', ['updateParentDetail', 'updateParentInfo', 'updateToken']),
  108. ...mapMutations('m_children', ['updateChildrenInfo', 'updateChildrenSemester']),
  109. //退出登录事件
  110. async logout() {
  111. const [err, succ] = await uni.showModal({
  112. title: '提示',
  113. content: '确认退出登录吗?'
  114. }).catch(err => err)
  115. if (succ && succ.confirm) {
  116. this.updateChildrenInfo()
  117. this.updateChildrenSemester(this.semesterList[0][0])
  118. this.updateParentDetail()
  119. this.updateParentInfo()
  120. this.updateToken()
  121. uni.reLaunch({
  122. url: '/subpkg/login/login'
  123. })
  124. }
  125. },
  126. //切换孩子
  127. chooseChildren() {
  128. // if(parentdetail.childrenList.length == 1)
  129. // return uni.showMsg('您只有一个孩子,不能切换')
  130. // if(uni.getStorageSync('parentdetail')){
  131. // uni.setStorageSync('parentdetail',)
  132. // }
  133. uni.navigateTo({
  134. url: '/subpkg/childrenlist/childrenlist'
  135. })
  136. },
  137. //孩子名片
  138. childrenInfo() {
  139. uni.navigateTo({
  140. url: '/subpkg/childrenInfo/childrenInfo'
  141. })
  142. },
  143. //我的消息
  144. myMsg() {
  145. uni.navigateTo({
  146. url: '/subpkg/mymsg/mymsg'
  147. })
  148. },
  149. //我的信息
  150. myInfo() {
  151. uni.navigateTo({
  152. url: '/subpkg/parentInfo/parentInfo'
  153. })
  154. }
  155. }
  156. }
  157. </script>
  158. <style lang="scss">
  159. .my-container {
  160. height: 100%;
  161. .bg1 {
  162. position: fixed;
  163. top: -400rpx;
  164. right: -250rpx;
  165. width: 1000rpx;
  166. height: 1000rpx;
  167. margin-right: 500rpx;
  168. border-radius: 100%;
  169. background-color: #6495ed;
  170. z-index: -1;
  171. }
  172. .bg2 {
  173. position: fixed;
  174. top: -300rpx;
  175. right: -320rpx;
  176. width: 800rpx;
  177. height: 800rpx;
  178. border-radius: 100%;
  179. background-color: #4169E1;
  180. z-index: -2;
  181. }
  182. .userinfo-topinfo {
  183. height: 350rpx;
  184. display: flex;
  185. justify-content: flex-start;
  186. align-items: center;
  187. .parent-avatar {
  188. margin-top: 40rpx;
  189. margin-left: 40rpx;
  190. width: 120rpx;
  191. height: 120rpx;
  192. border-radius: 100%;
  193. border: 6rpx solid #FFFFFF;
  194. box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
  195. }
  196. .parent-name {
  197. margin-top: 40rpx;
  198. margin-left: 20rpx;
  199. display: flex;
  200. flex-direction: column;
  201. font-weight: bold;
  202. .name {
  203. color: #3B4144;
  204. font-size: 36rpx;
  205. font-weight: bold;
  206. margin-left: 10rpx;
  207. }
  208. .u-tag {
  209. margin-top: 10rpx !important;
  210. height: 40rpx;
  211. line-height: 36rpx;
  212. .u-tag__text {
  213. font-size: 24rpx !important;
  214. }
  215. }
  216. .detail {
  217. height: 20rpx;
  218. font-size: 24rpx;
  219. margin: 10rpx 0 0 10rpx;
  220. }
  221. }
  222. }
  223. .userinfo-container {
  224. height: 100%;
  225. .box-cart {
  226. height: 180rpx;
  227. padding: 0 4%;
  228. display: flex;
  229. justify-content: space-between;
  230. align-items: center;
  231. .box-cart-item {
  232. width: 48%;
  233. height: 100%;
  234. padding-left: 20rpx;
  235. border-radius: $card-border-radius;
  236. background-color: #fff;
  237. display: flex;
  238. align-items: center;
  239. box-sizing: border-box;
  240. .t-icon {
  241. width: 60rpx !important;
  242. height: 60rpx !important;
  243. margin-right: 20rpx;
  244. }
  245. .card-text {
  246. font-size: 32rpx;
  247. font-weight: bolder;
  248. margin: 20rpx 0;
  249. color: #616161;
  250. .card-des {
  251. margin-top: 10rpx;
  252. font-weight: 400;
  253. font-size: 24rpx;
  254. color: #a6aaaf;
  255. }
  256. }
  257. }
  258. .left-box {
  259. background-image: linear-gradient(to top, #d7e4ff 0%, #d7e4ff 100%);
  260. }
  261. .right-box {
  262. background-image: linear-gradient(to top, #ffe1e7 0%, #ffe1e7 100%);
  263. }
  264. }
  265. // 功能列表
  266. .com-item {
  267. width: 92%;
  268. margin: 20rpx 4% 0 4%;
  269. .com-box {
  270. overflow: hidden;
  271. border-radius: $card-border-radius;
  272. }
  273. }
  274. .cell {
  275. height: 100rpx;
  276. padding-left: 20rpx;
  277. padding-right: 20rpx;
  278. display: flex;
  279. justify-content: space-between;
  280. align-items: center;
  281. background: #fff;
  282. border-bottom: 1px solid #f8f8f8;
  283. &:active {
  284. background: #f2f2f2;
  285. }
  286. &:last-child {
  287. border-bottom: none !important;
  288. }
  289. .cell-left {
  290. display: flex;
  291. align-items: center;
  292. padding-left: 20rpx;
  293. .t-icon {
  294. width: 40rpx;
  295. height: 40rpx;
  296. }
  297. .cell-text {
  298. color: #666;
  299. font-size: 28rpx;
  300. margin-left: 20rpx;
  301. }
  302. }
  303. .cell-right {
  304. display: flex;
  305. align-items: center;
  306. .u-badge {
  307. margin-right: 10rpx;
  308. }
  309. }
  310. }
  311. .calendar {
  312. z-index: 999;
  313. }
  314. }
  315. }
  316. </style>