my.vue 8.4 KB

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