mini-userinfo.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="userinfo-container">
  3. <!-- 面板区域 -->
  4. <view class="box-cart" >
  5. <view class="cart-big" @click="updateChildrenInfo">
  6. <image class="cart-icon" src="/static/my-icons/boy-my.png" mode="aspectFill"></image>
  7. <text class="cart-text">孩子信息</text>
  8. </view>
  9. <view class="cart-small">
  10. <view class="cart-item" @click="show = true">
  11. <image class="cart-icon-sim" src="/static/my-icons/childrenmessage.png"></image>
  12. <text class="cart-text-sim">学习打卡</text>
  13. </view>
  14. <view class="cart-item" @click="chooseChildren">
  15. <image class="cart-icon-sim" src="/static/my-icons/mychildren.png" mode="aspectFill"></image>
  16. <text class="cart-text-sim">孩子管理</text>
  17. </view>
  18. </view>
  19. </view>
  20. <!-- 用户功能 -->
  21. <view class="com-item">
  22. <view class="com-box">
  23. <view class="cell">
  24. <view class="cell-left">
  25. <view class="t-icon t-icon-order_dingdan" ></view>
  26. <view class="cell-text">个人信息</view>
  27. </view>
  28. </view>
  29. <view class="cell">
  30. <view class="cell-left">
  31. <view class="t-icon t-icon-comment_wodepinglun" ></view>
  32. <view class="cell-text">我的消息</view>
  33. </view>
  34. </view>
  35. <view class="cell" @click="logout">
  36. <view class="cell-left">
  37. <view class="t-icon t-icon-Setting_shezhi"></view>
  38. <view class="cell-text">退出登录</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- 用户服务 -->
  44. <view class="com-item">
  45. <view class="com-box">
  46. <view class="cell">
  47. <view class="cell-left">
  48. <view class="t-icon t-icon-integration_jifen"></view>
  49. <view class="cell-text">客服中心</view>
  50. </view>
  51. </view>
  52. <view class="cell">
  53. <view class="cell-left">
  54. <view class="t-icon t-icon-question_wodewenda"></view>
  55. <view class="cell-text">帮助中心</view>
  56. </view>
  57. </view>
  58. <view class="cell">
  59. <view class="cell-left">
  60. <view class="t-icon t-icon-contract_hetong"></view>
  61. <view class="cell-text">用户协议</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <!-- 日历组件 -->
  67. <u-calendar :show="show" mode="single" @confirm="confirm"></u-calendar>
  68. </view>
  69. </template>
  70. <script>
  71. import { mapState,mapMutations } from 'vuex'
  72. export default {
  73. computed:{
  74. ...mapState('m_parent',['parentinfo','parentdetail']),
  75. ...mapState('m_children',['childreninfo'])
  76. },
  77. name: 'mini-userinfo',
  78. data() {
  79. return {
  80. show: false,
  81. };
  82. },
  83. methods:{
  84. ...mapMutations('m_parent',['updateParentDetail','updateToken']),
  85. ...mapMutations('m_children',['updateChildrenInfo']),
  86. //日历事件
  87. confirm(e){
  88. console.log('confirm',e)
  89. uni.$showMsg('打卡成功!')
  90. this.show = false
  91. },
  92. //退出登录
  93. async logout(){
  94. const [err,succ] = await uni.showModal({
  95. title: '提示',
  96. content: '确认退出登录吗?'
  97. }).catch(err => err)
  98. if(succ && succ.confirm)
  99. {
  100. this.updateChildrenInfo({})
  101. this.updateParentDetail({})
  102. this.updateToken('')
  103. uni.navigateTo({
  104. url:'/subpkg/login/login'
  105. })
  106. }
  107. },
  108. //切换孩子
  109. chooseChildren(){
  110. // if(parentdetail.childrenList.length == 1)
  111. // return uni.showMsg('您只有一个孩子,不能切换')
  112. uni.navigateTo({
  113. url: '/subpkg/guide/guide'
  114. })
  115. },
  116. //修改孩子信息
  117. updateChildrenInfo(e){
  118. console.log(e);
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss">
  124. .userinfo-container{
  125. height: 100%;
  126. // 面板区域
  127. .box-cart{
  128. margin: -100rpx 20rpx 20rpx 20rpx;
  129. display: flex;
  130. justify-content: center;
  131. align-items: center;
  132. justify-content: space-around;
  133. .cart-big{
  134. border-radius: 15rpx;
  135. width: 80px;
  136. height: 120px;
  137. overflow: hidden;
  138. margin: 10px 0 10px 0;
  139. display: flex;
  140. flex-direction: column;
  141. justify-content: center;
  142. align-items: center;
  143. background-color: #FFFFFF;
  144. box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  145. .cart-icon{
  146. width: 55px;
  147. height: 80px;
  148. margin: 10px 10px 0px 10px;
  149. }
  150. .cart-text{
  151. margin: 10px;
  152. font-size: 15px;
  153. }
  154. }
  155. .cart-small{
  156. width: 65%;
  157. height: 130px;
  158. display: flex;
  159. flex-direction: column;
  160. justify-content: space-around;
  161. .cart-item{
  162. height: 35px;
  163. background-color: #FFFFFF;
  164. display: flex;
  165. flex-direction: row;
  166. align-items: center;
  167. padding: 10px;
  168. border-radius: 15rpx;
  169. overflow: hidden;
  170. box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  171. .cart-icon-sim{
  172. width: 50rpx;
  173. height: 50rpx;
  174. margin: 10px;
  175. }
  176. .cart-text-sim{
  177. margin: 10px;
  178. font-size: 15px;
  179. color: #3B4144;
  180. }
  181. }
  182. }
  183. }
  184. // 功能列表
  185. .com-item {
  186. margin-top: 20rpx;
  187. .com-box {
  188. overflow: hidden;
  189. }
  190. }
  191. .cell {
  192. height: 80rpx;
  193. padding-left: 20rpx;
  194. padding-right: 20rpx;
  195. display: flex;
  196. justify-content: space-between;
  197. align-items: center;
  198. background: #fff;
  199. border-bottom: 1px solid #f8f8f8;
  200. &:active {
  201. background: #f2f2f2;
  202. }
  203. &:last-child {
  204. border-bottom: none !important;
  205. }
  206. .cell-left {
  207. display: flex;
  208. align-items: center;
  209. padding-left: 20rpx;
  210. .cell-icon {
  211. width: 50rpx;
  212. height: 50rpx;
  213. }
  214. .cell-text {
  215. color: #666;
  216. font-size: 28rpx;
  217. margin-left: 20rpx;
  218. }
  219. }
  220. }
  221. }
  222. </style>