mini-userinfo.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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','updateParentInfo','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.updateParentInfo()
  103. this.updateToken()
  104. uni.reLaunch({
  105. url:'/subpkg/login/login'
  106. })
  107. }
  108. },
  109. //切换孩子
  110. chooseChildren(){
  111. // if(parentdetail.childrenList.length == 1)
  112. // return uni.showMsg('您只有一个孩子,不能切换')
  113. uni.navigateTo({
  114. url: '/subpkg/guide/guide'
  115. })
  116. },
  117. //修改孩子信息
  118. updateChildrenInfo(e){
  119. console.log(e);
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss">
  125. .userinfo-container{
  126. height: 100%;
  127. // 面板区域
  128. .box-cart{
  129. margin: -100rpx 20rpx 20rpx 20rpx;
  130. display: flex;
  131. justify-content: center;
  132. align-items: center;
  133. justify-content: space-around;
  134. .cart-big{
  135. border-radius: 15rpx;
  136. width: 80px;
  137. height: 120px;
  138. overflow: hidden;
  139. margin: 10px 0 10px 0;
  140. display: flex;
  141. flex-direction: column;
  142. justify-content: center;
  143. align-items: center;
  144. background-color: #FFFFFF;
  145. box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  146. .cart-icon{
  147. width: 55px;
  148. height: 80px;
  149. margin: 10px 10px 0px 10px;
  150. }
  151. .cart-text{
  152. margin: 10px;
  153. font-size: 15px;
  154. }
  155. }
  156. .cart-small{
  157. width: 65%;
  158. height: 130px;
  159. display: flex;
  160. flex-direction: column;
  161. justify-content: space-around;
  162. .cart-item{
  163. height: 35px;
  164. background-color: #FFFFFF;
  165. display: flex;
  166. flex-direction: row;
  167. align-items: center;
  168. padding: 10px;
  169. border-radius: 15rpx;
  170. overflow: hidden;
  171. box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  172. .cart-icon-sim{
  173. width: 50rpx;
  174. height: 50rpx;
  175. margin: 10px;
  176. }
  177. .cart-text-sim{
  178. margin: 10px;
  179. font-size: 15px;
  180. color: #3B4144;
  181. }
  182. }
  183. }
  184. }
  185. // 功能列表
  186. .com-item {
  187. margin-top: 20rpx;
  188. .com-box {
  189. overflow: hidden;
  190. }
  191. }
  192. .cell {
  193. height: 80rpx;
  194. padding-left: 20rpx;
  195. padding-right: 20rpx;
  196. display: flex;
  197. justify-content: space-between;
  198. align-items: center;
  199. background: #fff;
  200. border-bottom: 1px solid #f8f8f8;
  201. &:active {
  202. background: #f2f2f2;
  203. }
  204. &:last-child {
  205. border-bottom: none !important;
  206. }
  207. .cell-left {
  208. display: flex;
  209. align-items: center;
  210. padding-left: 20rpx;
  211. .cell-icon {
  212. width: 50rpx;
  213. height: 50rpx;
  214. }
  215. .cell-text {
  216. color: #666;
  217. font-size: 28rpx;
  218. margin-left: 20rpx;
  219. }
  220. }
  221. }
  222. }
  223. </style>