tab_mine.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <view>
  3. <view class="content">
  4. <view class="bg1"></view>
  5. <view class="bg2"></view>
  6. <view class="bg3"></view>
  7. <!-- 个人信息 -->
  8. <view class="info_box">
  9. <image class="avatar" :src="parentInfo.avatarUrl"></image>
  10. <view class="flex_cloumn">
  11. <view class="YS-title" style="font-size: 55rpx;">{{parentInfo.nickName}}</view>
  12. <view class="YS-title" style="font-size: 40rpx;color: #909399;">{{childInfo.name}}家长</view>
  13. </view>
  14. </view>
  15. <!-- 卡片列表 -->
  16. <view class="card-view" style="margin-top: 50rpx;">
  17. <view class="card-item" style="background-color: #d7e4ff;" @click="navChooseChild">
  18. <view class="flex_row">
  19. <view class="t-icon t-icon-a-boshimaojiaoyu"
  20. style="width: 60rpx;height: 60rpx;margin-left: 25rpx;"></view>
  21. <view class="flex_cloumn" style="margin: 30rpx 0 30rpx 25rpx;">
  22. <view class="YS-title" style="margin: 20rpx 0;font-size: 40rpx;font-size: 300">孩子切换</view>
  23. <view class="YS-title" style="font-size:30rpx;margin: 10rpx 0;color: #909399;">查看更多信息</view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="card-item" style="background-color: #ffe1e7;" @click="navChildInfo">
  28. <view class="flex_row">
  29. <view class="t-icon t-icon-a-jiangpaijiangzhang"
  30. style="width: 60rpx;height: 60rpx;margin-left: 25rpx;"></view>
  31. <view class="flex_cloumn" style="margin: 30rpx 0 30rpx 25rpx;">
  32. <view class="YS-title" style="margin: 20rpx 0;font-size: 40rpx;font-size: 300;">孩子名片</view>
  33. <view class="YS-title" style="font-size:30rpx;margin: 10rpx 0;color: #909399;">晒出优秀表现</view>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 功能模块 -->
  38. <view class="card-item" style="width: 100%;">
  39. <view class="com-box">
  40. <view class="cell" @click="navInfo">
  41. <view class="cell-left">
  42. <view class="t-icon t-icon-zhanghu"></view>
  43. <view class="cell-text">个人信息</view>
  44. </view>
  45. <view class="t-icon t-icon-you" style="width: 45rpx;height: 45rpx;"></view>
  46. </view>
  47. <view class="cell" @click="navMsg">
  48. <view class="cell-left">
  49. <view class="t-icon t-icon-a-liaotianpingluntaolunduihua"></view>
  50. <view class="cell-text">我的消息</view>
  51. </view>
  52. <view class="cell-right" v-if="userData.msgList.length != 0">
  53. <view style="margin-right: 20rpx;">
  54. <u-badge type="warning" shape="horn" :value="userData.msgList.length"></u-badge>
  55. </view>
  56. <view class="t-icon t-icon-you" style="width: 45rpx;height: 45rpx;"></view>
  57. </view>
  58. </view>
  59. <view class="cell" @click="navSubscribe">
  60. <view class="cell-left">
  61. <view class="t-icon t-icon-shoucang"></view>
  62. <view class="cell-text">订阅中心</view>
  63. </view>
  64. <view class="t-icon t-icon-you" style="width: 45rpx;height: 45rpx;"></view>
  65. </view>
  66. </view>
  67. </view>
  68. <!-- 功能模块 -->
  69. <view class="card-item" style="width: 100%;">
  70. <view class="com-box">
  71. <view class="cell" @click="logOut">
  72. <view class="cell-left">
  73. <view class="t-icon t-icon-a-tuichulikai"></view>
  74. <view class="cell-text">退出登录</view>
  75. </view>
  76. <view class="t-icon t-icon-you" style="width: 45rpx;height: 45rpx;"></view>
  77. </view>
  78. <view class="cell">
  79. <view class="cell-left">
  80. <view class="t-icon t-icon-a-appyingyongchengxukaifa"></view>
  81. <view class="cell-text">帮助中心</view>
  82. </view>
  83. <view class="t-icon t-icon-you" style="width: 45rpx;height: 45rpx;"></view>
  84. </view>
  85. <view class="cell">
  86. <view class="cell-left">
  87. <view class="t-icon t-icon-shuji"></view>
  88. <view class="cell-text">用户协议</view>
  89. </view>
  90. <view class="t-icon t-icon-you" style="width: 45rpx;height: 45rpx;"></view>
  91. </view>
  92. </view>
  93. </view>
  94. <!-- 功能模块 -->
  95. </view>
  96. </view>
  97. </view>
  98. </template>
  99. <script>
  100. import {
  101. mapState,
  102. mapMutations
  103. } from 'vuex'
  104. export default {
  105. computed: {
  106. ...mapState('m_parent', ['parentInfo', 'userData','childrenData']),
  107. ...mapState('m_children', ['childInfo'])
  108. },
  109. data() {
  110. return {
  111. };
  112. },
  113. methods:{
  114. ...mapMutations('m_parent', ['updateToken', 'updateParentInfo', 'updatePhoneNumber','updateChildrenData','updateUserData']),
  115. ...mapMutations('m_children', ['updateChildInfo']),
  116. //退出登录事件
  117. async logOut() {
  118. const [err, succ] = await uni.showModal({
  119. title: '提示',
  120. content: '确认退出登录吗?'
  121. }).catch(err => err)
  122. if (succ && succ.confirm) {
  123. this.updateToken()
  124. this.updateParentInfo()
  125. this.updatePhoneNumber()
  126. this.updateChildrenData()
  127. this.updateUserData()
  128. this.updateChildInfo()
  129. uni.reLaunch({
  130. url: '/subpkg/startup/login'
  131. })
  132. }
  133. },
  134. //切换孩子
  135. navChooseChild() {
  136. uni.navigateTo({
  137. url: '/subpkg/startup/options'
  138. })
  139. },
  140. //孩子名片
  141. navChildInfo() {
  142. let tmdidArr = this.childrenData.map(x=>{return x.tmdid})
  143. let index = tmdidArr.indexOf(this.childInfo.tmdid)
  144. uni.navigateTo({
  145. url: `/subpkg/mine/childinfo?index=${index}`
  146. })
  147. },
  148. //家长信息
  149. navInfo() {
  150. uni.navigateTo({
  151. url: '/subpkg/mine/parentinfo'
  152. })
  153. },
  154. //我的消息
  155. navMsg() {
  156. uni.navigateTo({
  157. url: '/subpkg/mine/messagelist'
  158. })
  159. },
  160. //订阅信息
  161. navSubscribe(){
  162. uni.navigateTo({
  163. url: '/subpkg/mine/subscribeinfo'
  164. })
  165. }
  166. }
  167. }
  168. </script>
  169. <style lang="scss">
  170. //登录页面
  171. .content {
  172. height: 100%;
  173. width: 100%;
  174. overflow-x: hidden;
  175. .bg1 {
  176. position: fixed;
  177. top: -250rpx;
  178. right: -250rpx;
  179. width: 680rpx;
  180. height: 680rpx;
  181. border-radius: 100%;
  182. background-color: $color-blue;
  183. z-index: 5;
  184. }
  185. .bg2 {
  186. position: fixed;
  187. right: -300rpx;
  188. top: 200rpx;
  189. width: 600rpx;
  190. height: 600rpx;
  191. border-radius: 100%;
  192. background-color: $color-red;
  193. z-index: 4;
  194. }
  195. .bg3 {
  196. position: fixed;
  197. top: 500rpx;
  198. right: 450rpx;
  199. width: 600rpx;
  200. height: 600rpx;
  201. border-radius: 100%;
  202. background-color: $color-yellow;
  203. z-index: 4;
  204. }
  205. .info_box {
  206. width: 100%;
  207. margin-top: 200rpx;
  208. margin-left: 40rpx;
  209. display: flex;
  210. align-items: center;
  211. z-index: 10;
  212. .avatar {
  213. width: 120rpx;
  214. height: 120rpx;
  215. border-radius: 100%;
  216. border: 4rpx solid #FFFFFF;
  217. box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
  218. }
  219. .flex_cloumn {
  220. margin-left: 40rpx;
  221. width: 200rpx;
  222. height: 120rpx;
  223. justify-content: space-around;
  224. }
  225. }
  226. // 功能按钮模块
  227. .com-box {
  228. overflow: hidden;
  229. border-radius: $border-radius;
  230. .cell {
  231. height: 100rpx;
  232. padding-left: 20rpx;
  233. padding-right: 20rpx;
  234. display: flex;
  235. justify-content: space-between;
  236. align-items: center;
  237. background: #fff;
  238. border-bottom: 1px solid #f8f8f8;
  239. &:active {
  240. background: #f2f2f2;
  241. }
  242. &:last-child {
  243. border-bottom: none !important;
  244. }
  245. .cell-left {
  246. display: flex;
  247. align-items: center;
  248. padding-left: 20rpx;
  249. .t-icon {
  250. width: 40rpx;
  251. height: 40rpx;
  252. }
  253. .cell-text {
  254. color: #666;
  255. font-size: 28rpx;
  256. margin-left: 20rpx;
  257. }
  258. }
  259. .cell-right {
  260. display: flex;
  261. align-items: center;
  262. .u-badge {
  263. margin-right: 10rpx;
  264. }
  265. }
  266. }
  267. }
  268. }
  269. </style>