| | |
| | | // 获取图书列表 |
| | | getBookList(isReachBottom) { |
| | | let that = this; |
| | | this.setData({ |
| | | skeletonLoding: true |
| | | }) |
| | | let sort; |
| | | let pathObj = {}; |
| | | if (that.data.pathList.length) { |
| | |
| | | |
| | | .book-box { |
| | | box-sizing: border-box; |
| | | width: calc(100%/2 - 10rpx); |
| | | width: calc(100%/2 - 12rpx); |
| | | margin-right: 20rpx; |
| | | display: flex; |
| | | flex-direction: column; |
| | |
| | | } else if (WeChatInfo) { |
| | | defaultUser = { |
| | | ...WeChatInfo, |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, |
| | | icon: JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | nickName: nickNameData && JSON.parse(nickNameData.data).nickName ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, |
| | | icon: nickNameData && JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | userId: res.userId, |
| | | phoneNumber: phoneInfo?.credential, |
| | | Email: emailInfo?.credential |
| | |
| | | // pages/index/bindInfo/index.js |
| | | import { setSessionGuid } from "../../assets/js/userAction" |
| | | import { |
| | | setSessionGuid |
| | | } from "../../assets/js/userAction" |
| | | const app = getApp(); |
| | | Page({ |
| | | |
| | |
| | | }, |
| | | // 获取登录用户身份 |
| | | getUserInfo() { |
| | | let that = this; |
| | | app.MG.identity.getCurrentAppUser().then(res => { |
| | | // 用户信息优先级:教师认证 > 微信 > 学生(注册时默认) |
| | | if (res) { |
| | |
| | | } |
| | | wx.setStorageSync(app.config.userInfoKey, JSON.stringify(defaultUser)); |
| | | } |
| | | wx.navigateTo({ |
| | | url: this.data.redirectPage ? this.data.redirectPage : '/pages/home/home' |
| | | if (that.data.redirectPage == "" || that.data.redirectPage == "/pages/home/home" || that.data.redirectPage == "/pages/bookServices/assort/index" || that.data.redirectPage == "/pages/study/index" || that.data.redirectPage == "/pages/cart/index" || that.data.redirectPage == "/pages/personalCenter/index") { |
| | | wx.switchTab({ |
| | | url: that.data.redirectPage != "" ? that.data.redirectPage : '/pages/home/home' |
| | | }) |
| | | } else { |
| | | wx.navigateTo({ |
| | | url: that.data.redirectPage |
| | | }) |
| | | } |
| | | }); |
| | | }, |
| | | |
| | |
| | | barHeight: '', |
| | | navBarHeight: '', |
| | | searchVal: '', |
| | | scoll: false, |
| | | isWhite: false, |
| | | userInfo: {}, |
| | | tabList: [], //目录 |
| | |
| | | |
| | | // 监听滚动条 |
| | | onScroll(e) { |
| | | this.setData({ |
| | | isWhite: true |
| | | }) |
| | | this.setData({ |
| | | isWhite: e.detail.scrollTop > 20 ? true : false |
| | | }) |
| | | if (this.data.scoll) { |
| | | if (e.detail.scrollTop < 20) { |
| | | this.data.scoll = false |
| | | this.isChange(false); |
| | | } |
| | | } else { |
| | | if (e.detail.scrollTop > 20) { |
| | | this.data.scoll = true |
| | | this.isChange(true); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | onScrollToTop(e) { |
| | | isChange(data) { |
| | | this.setData({ |
| | | isWhite: e.detail.scrollTop > 50 ? true : false |
| | | isWhite: data |
| | | }) |
| | | }, |
| | | |
| | |
| | | "component": true, |
| | | "usingComponents": { |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-image": "tdesign-miniprogram/image/image", |
| | | "t-avatar": "tdesign-miniprogram/avatar/avatar" |
| | | } |
| | | } |
| | |
| | | <!-- 未登录的情况 --> |
| | | <block wx:if="{{currAuthStep === AuthStepType.ONE}}"> |
| | | <view class="user-center-card__header"> |
| | | <t-avatar image="{{userInfo.avatarUrl || defaultAvatarUrl}}" class="user-center-card__header__avatar" /> |
| | | <!-- <t-avatar image="{{userInfo.avatarUrl || defaultAvatarUrl}}" class="user-center-card__header__avatar" /> --> |
| | | <view class="user-center-card__header__avatar"> |
| | | <t-image src="{{userInfo.icon || defaultAvatarUrl}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view> |
| | | <view class="user-center-card__header__name">{{'请登录'}}</view> |
| | | </view> |
| | |
| | | <!-- 已登录但未授权用户信息情况 --> |
| | | <block wx:if="{{currAuthStep === AuthStepType.TWO}}"> |
| | | <view class="user-center-card__header"> |
| | | <t-avatar image="{{userInfo.icon || defaultAvatarUrl}}" class="user-center-card__header__avatar" /> |
| | | <!-- <t-avatar image="{{userInfo.icon || defaultAvatarUrl}}" class="user-center-card__header__avatar" mode="aspectFill" t-class="avatar" /> --> |
| | | <view class="user-center-card__header__avatar"> |
| | | <t-image src="{{userInfo.icon || defaultAvatarUrl}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view> |
| | | <view class="user-center-card__header__name">{{userInfo.nickName || '微信用户'}}</view> |
| | | <view class="userTypeBox"> |
| | | <text>{{userInfo.userType}}</text> |
| | | <text class="txt" wx:if="{{userInfo.userType}}">{{userInfo.userType}}</text> |
| | | <text bindtap="editUserType" wx:if="{{userInfo.userType}}" class="edit">修改</text> |
| | | <text bindtap="editUserType" wx:else class="edit">设置用户类型</text> |
| | | </view> |
| | |
| | | <!-- 已登录且已经授权用户信息的情况 --> |
| | | <block wx:if="{{currAuthStep === AuthStepType.THREE}}"> |
| | | <view class="user-center-card__header"> |
| | | <t-avatar t-class="avatar" mode="aspectFill" class="user-center-card__header__avatar" image="{{userInfo.icon || defaultAvatarUrl}}" /> |
| | | <!-- <t-avatar t-class="avatar" mode="aspectFill" class="user-center-card__header__avatar" image="{{userInfo.icon || defaultAvatarUrl}}" /> --> |
| | | <view class="user-center-card__header__avatar"> |
| | | <t-image src="{{userInfo.icon || defaultAvatarUrl}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view> |
| | | <view class="user-center-card__header__name">{{userInfo.nickName || '微信用户'}}</view> |
| | | <view class="userTypeBox"> |
| | | <text>{{userInfo.userType}}</text> |
| | | <text class="txt" wx:if="{{userInfo.userType}}">{{userInfo.userType}}</text> |
| | | <text bindtap="editUserType" wx:if="{{userInfo.userType}}" class="edit">修改</text> |
| | | <text bindtap="editUserType" wx:else class="edit">设置用户类型</text> |
| | | </view> |
| | |
| | | } |
| | | |
| | | .user-center-card__header { |
| | | margin-top: 160rpx; |
| | | margin-top: 120rpx; |
| | | margin-bottom: 30rpx; |
| | | margin-left: 20rpx; |
| | | height: 120rpx; |
| | | line-height: 48rpx; |
| | | /* line-height: 48rpx; */ |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-items: center; |
| | | /* align-items: center; */ |
| | | color: #333; |
| | | position: relative; |
| | | } |
| | | |
| | | .user-center-card__header__avatar { |
| | | width: 120rpx; |
| | | height: 120rpx; |
| | | border-radius: 48rpx; |
| | | width: 120rpx !important; |
| | | height: 120rpx !important; |
| | | border-radius: 50%; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .user-center-card__header__avatar .img { |
| | | width: 100%; |
| | | height: 100%; |
| | | border-radius: 50%; |
| | | } |
| | | |
| | | |
| | | |
| | | .user-center-card__header__name { |
| | | font-size: 36rpx; |
| | | line-height: 48rpx; |
| | | font-size: 38rpx; |
| | | line-height: 56rpx; |
| | | color: #333; |
| | | font-weight: bold; |
| | | margin-left: 24rpx; |
| | |
| | | .userTypeBox { |
| | | margin-left: 24rpx; |
| | | font-size: 28rpx; |
| | | padding-top: 15rpx; |
| | | padding-top: 18rpx; |
| | | } |
| | | |
| | | .txt { |
| | | margin-right: 20rpx; |
| | | } |
| | | |
| | | .edit { |
| | | margin-left: 20rpx; |
| | | |
| | | color: #ff6d00; |
| | | } |
| | | |
| | |
| | | .setting { |
| | | margin-left: auto; |
| | | display: flex; |
| | | align-items: center; |
| | | padding-top: 8rpx; |
| | | /* align-items: center; */ |
| | | } |
| | | |
| | | .setting .img { |
| | | height: 34rpx; |
| | | width: 34rpx; |
| | | margin-right: 10rpx; |
| | | margin-top: 8rpx; |
| | | |
| | | } |
| | |
| | | data: { |
| | | barHeight: '', |
| | | navBarHeight: '', |
| | | scoll: false, |
| | | isWhite: false, |
| | | userInfo: {}, |
| | | currAuthStep: 1, |
| | |
| | | }, |
| | | |
| | | onScroll(e) { |
| | | if (this.data.scoll) { |
| | | if (e.detail.scrollTop < 20) { |
| | | this.data.scoll = false |
| | | this.isChange(false); |
| | | } |
| | | } else { |
| | | if (e.detail.scrollTop > 20) { |
| | | this.data.scoll = true |
| | | this.isChange(true); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | isChange(data) { |
| | | this.setData({ |
| | | isWhite: e.detail.scrollTop > 10 ? true : false |
| | | isWhite: data |
| | | }) |
| | | const { |
| | | scrollTop |
| | | } = e.detail; |
| | | this.setData({ |
| | | scrollTop |
| | | }); |
| | | }, |
| | | |
| | | |
| | |
| | | <view> |
| | | <t-pull-down-refresh value="{{baseRefresh.value}}" loadingProps="{{loadingProps}}" loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" bind:refresh="onPullDownRefresh" bind:scroll="onScroll"> |
| | | <t-pull-down-refresh value="{{baseRefresh.value}}" loadingProps="{{loadingProps}}" loadingTexts="{{['下拉刷新', '正在刷新', '刷新完成']}}" bind:refresh="onPullDownRefresh" bind:scroll="onScroll"> |
| | | <view style="width: 100%; height: {{barHeight}}px;"></view> |
| | | <view class="background {{ isWhite ? 'white':''}}" style="padding-top: {{barHeight}}px"> |
| | | <text class="text">个人中心</text> |
| | |
| | | |
| | | .content-wrapper { |
| | | position: relative; |
| | | padding: 30rpx; |
| | | padding: 20rpx 30rpx; |
| | | padding-bottom: calc(env(safe-area-inset-bottom) + 100rpx); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | .domainBox .title { |
| | | color: #333; |
| | | font-weight: bold; |
| | | padding: 30rpx; |
| | | padding: 30rpx 30rpx 0rpx 30rpx; |
| | | } |
| | | |
| | | .domainList { |
| | |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: center; |
| | | padding-bottom: 30rpx; |
| | | } |
| | | |
| | | .domainList1 { |
| | |
| | | width: 160rpx; |
| | | min-width: 160rpx; |
| | | flex-shrink: 0; |
| | | padding: 30rpx 0; |
| | | padding: 40rpx 0; |
| | | } |
| | | |
| | | .listItem:nth-child(5), |
| | | .listItem:nth-child(6), |
| | | .listItem:nth-child(7), |
| | | .listItem:nth-child(8) { |
| | | padding-top: 10rpx !important; |
| | | } |
| | | |
| | | .listItem .icon { |