| | |
| | | { |
| | | "pages": [ |
| | | "pages/student/index", |
| | | "pages/home/home", |
| | | "pages/retrievalPage/index", |
| | | "pages/cart/paymentPage/index", |
| | | "pages/student/index", |
| | | "pages/cart/index", |
| | | "pages/bookExhibitionList/index", |
| | | "pages/bookExhibitionDetails/index", |
| | |
| | | "pages/bookServices/list/index", |
| | | "pages/bookServices/detail/index", |
| | | "pages/bookServices/examination/examination", |
| | | "pages/bookServices/webpage/index" |
| | | "pages/bookServices/webpage/index", |
| | | "pages/components/webView/index" |
| | | ] |
| | | } |
| | | ], |
| | |
| | | export const fontUrl = "http://192.168.3.132:5173"; |
| | | // export const fontUrl = "http://182.92.203.7:3007/jsek/website"; |
| | | // export const fontUrl = "http://jsysf.bnuic.com/website"; |
| | | |
| | | // export const epubUrl = "http://182.92.203.7:3007/epubReadMobile/"; |
| | | export const epubUrl = "http://jsysf.bnuic.com/epubReadMobile/#/"; |
| | | |
| | | const config = { |
| | | requestCtx, |
| | |
| | | seminar, |
| | | fontUrl, |
| | | reg_tel, |
| | | reg_telphone |
| | | reg_telphone, |
| | | epubUrl |
| | | }; |
| | | export default config; |
| | |
| | | .box-bottom { |
| | | position: fixed; |
| | | left: 0; |
| | | bottom: 40rpx; |
| | | bottom: env(safe-area-inset-bottom); |
| | | width: 100%; |
| | | height: 110rpx; |
| | | } |
New file |
| | |
| | | // packageBookService/pages/components/webView/index.js |
| | | const app = getApp() |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | src: "", |
| | | link: false, |
| | | epubObj: null, |
| | | currentPage: '', |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | if (options && options.link) { |
| | | this.setData({ |
| | | src: decodeURIComponent(options.link), |
| | | link: options.link ? true : false, |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | epubObj: options, |
| | | src: '' |
| | | }) |
| | | if (options) { |
| | | wx.setNavigationBarTitle({ |
| | | title: options.fileName, |
| | | }) |
| | | this.getProgress(options) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | onLoadWeb(e) { |
| | | console.log(e, "load") |
| | | }, |
| | | |
| | | onError(e) { |
| | | console.log(e, "err") |
| | | }, |
| | | |
| | | setWebViewSrc: function (data) { |
| | | var url = app.config.epubUrl + |
| | | "?md5=" + |
| | | data.md5 + |
| | | "&bookName=" + |
| | | data.fileName + |
| | | "&url=" + app.config.requestCtx + |
| | | "&token=" + |
| | | wx.getStorageSync(app.config.tokenKey) + |
| | | "&recordLocation=" + |
| | | this.data.currentPage |
| | | this.setData({ |
| | | src: url |
| | | }) |
| | | }, |
| | | |
| | | |
| | | // 获取UserKey |
| | | getProgress: function (dataObj) { |
| | | app.MG.identity |
| | | .getUserKey({ |
| | | domain: "bookReadProgress", |
| | | keys: [this.data.epubObj.md5], |
| | | }) |
| | | .then((res) => { |
| | | if (res.length) { |
| | | try { |
| | | this.setData({ |
| | | currentPage: JSON.parse(res[0].value).page, |
| | | }); |
| | | } catch (error) { |
| | | this.setData({ |
| | | currentPage: "", |
| | | }); |
| | | } |
| | | if (this.data.currentPage > this.data.probationPage) { |
| | | this.setData({ |
| | | currentPage: "", |
| | | }); |
| | | } |
| | | } |
| | | this.setWebViewSrc(dataObj); |
| | | }); |
| | | }, |
| | | // 设置userKey |
| | | setProgress: function (data) { |
| | | if (data.page && data.page != this.data.currentPage) { |
| | | app.MG.identity |
| | | .setUserKey({ |
| | | setKeyRequests: [{ |
| | | domain: "bookReadProgress", |
| | | key: this.data.epubObj.md5, |
| | | value: JSON.stringify(data), |
| | | },], |
| | | }) |
| | | .then((res) => { }); |
| | | } |
| | | }, |
| | | |
| | | drawBack(e) { |
| | | let { |
| | | currentLocation, |
| | | percentage, |
| | | type |
| | | } = |
| | | e.detail.data[0]; |
| | | if (type == "progress" && type != "backDetail") { |
| | | this.setProgress({ |
| | | page: currentLocation, |
| | | progress: percentage, |
| | | }); |
| | | } else if (type == "backDetail") { |
| | | this.setProgress({ |
| | | page: 1, |
| | | progress: "0%", |
| | | }); |
| | | } |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() { |
| | | |
| | | }, |
| | | }) |
New file |
| | |
| | | { |
| | | "navigationBarTitleText": "京师E课", |
| | | "usingComponents": {} |
| | | } |
New file |
| | |
| | | <!--packageBookService/pages/components/webView/index.wxml--> |
| | | <view class="page-body"> |
| | | <web-view bind:message="drawBack" binderror="onError" bindload="onLoadWeb" src="{{src}}"></web-view> |
| | | </view> |
New file |
| | |
| | | /* packageBookService/pages/components/webView/index.wxss */ |
| | | .page-body { |
| | | width: 100vw; |
| | | height: calc(100vh - env(safe-area-inset-bottom)); |
| | | overflow: hidden; |
| | | } |
| | |
| | | // packagePersonal/pages/userSetting/index.js |
| | | const app = getApp() |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | |
| | | userInfo: {}, |
| | | defaultAvatarUrl: 'https://cdn-we-retail.ym.tencent.com/miniapp/usercenter/icon-user-center-avatar@2x.png', |
| | | visible: false |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | onLoad() { |
| | | if (wx.getStorageSync(app.config.tokenKey)) { |
| | | this.getUserInfo() |
| | | } |
| | | }, |
| | | |
| | | /** |
| | |
| | | onShow() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() { |
| | | |
| | | // 获取登录用户身份 |
| | | getUserInfo() { |
| | | app.MG.identity.getCurrentAppUser().then(res => { |
| | | // 用户信息优先级:教师认证 > 微信 > 学生(注册时默认) |
| | | if (res) { |
| | | let defaultUser = {}; |
| | | let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') |
| | | let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') |
| | | let secretData = res.secretList.find(i => i.type == 'LoginNameAndPassword') |
| | | let WeChatInfo = res.infoList.find((item) => item.type === "WeChat"); |
| | | let phoneInfo = res.secretList.find((item) => item.type == 'MobilePhone') |
| | | let emailInfo = res.secretList.find((item) => item.type == 'EMail') |
| | | if (teacherRole && teacherInfos) { |
| | | defaultUser = { |
| | | ...teacherInfos, |
| | | fullName: teacherInfos.fullName, |
| | | icon: teacherInfos.icon, |
| | | userId: res.userId, |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id, |
| | | phoneNumber: phoneInfo?.credential, |
| | | Email: emailInfo ? emailInfo.credential : JSON.parse(teacherInfos.data).email |
| | | } |
| | | } else if (WeChatInfo) { |
| | | defaultUser = { |
| | | ...WeChatInfo, |
| | | fullName: WeChatInfo.name, |
| | | icon: WeChatInfo.icon, |
| | | userId: res.userId, |
| | | phoneNumber: phoneInfo?.credential, |
| | | Email: emailInfo?.credential |
| | | } |
| | | } else if (secretData) { |
| | | defaultUser = { |
| | | fullName: secretData.credential, |
| | | icon: "", |
| | | userId: res.userId, |
| | | phoneNumber: phoneInfo?.credential, |
| | | Email: emailInfo?.credential |
| | | } |
| | | } |
| | | this.setData({ |
| | | userInfo: defaultUser |
| | | }) |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "usingComponents": {} |
| | | "navigationBarTitleText": "设置", |
| | | "usingComponents": { |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-avatar": "tdesign-miniprogram/avatar/avatar" |
| | | } |
| | | } |
| | |
| | | <!--packagePersonal/pages/userSetting/index.wxml--> |
| | | <text>packagePersonal/pages/userSetting/index.wxml</text> |
| | | <view class="container"> |
| | | <view class="itemList"> |
| | | <view class="label">头像</view> |
| | | <view class="contentImg"> |
| | | <t-avatar image="{{defaultAvatarUrl}}" class="user-center-card__header__avatar" /> |
| | | </view> |
| | | <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> |
| | | </view> |
| | | <view class="itemList"> |
| | | <view class="label">用户名</view> |
| | | <view class="content">{{userInfo.fullName || '微信用户'}}</view> |
| | | <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> |
| | | </view> |
| | | <view class="itemList"> |
| | | <view class="label">手机号码</view> |
| | | <view class="content">{{userInfo.phoneNumber || '未绑定手机号'}}</view> |
| | | <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> |
| | | </view> |
| | | <view class="itemList"> |
| | | <view class="label">邮箱</view> |
| | | <view class="content">{{userInfo.Email}}</view> |
| | | <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> |
| | | </view> |
| | | </view> |
| | | <t-popup visible="{{visible}}" bind:visible-change="onVisibleChange" placement="bottom"> |
| | | <view class="block"> |
| | | <view class="header"> |
| | | <view class="title">请选择您的用户类型</view> |
| | | </view> |
| | | <view class="body"> |
| | | |
| | | <view wx:for="{{userTypeList}}" wx:for-item="item" wx:for-index="index" wx:key="index" data-info="{{item}}" bindtap="tabUserTypeClick" class="{{item.value === userTypeActive ? 'activeItem item' : 'item'}}"> |
| | | {{ item.lable }} |
| | | </view> |
| | | </view> |
| | | <view class="footer"> |
| | | <button class="submit" bindtap="submit">确定</button> |
| | | </view> |
| | | </view> |
| | | </t-popup> |
| | |
| | | /* packagePersonal/pages/userSetting/index.wxss */ |
| | | .container { |
| | | padding: 20rpx 0; |
| | | } |
| | | |
| | | .itemList { |
| | | border-bottom: 2rpx solid #E9E9E9; |
| | | padding: 30rpx; |
| | | display: flex; |
| | | /* height: 120rpx; */ |
| | | align-items: center; |
| | | justify-content: space-between !important; |
| | | } |
| | | |
| | | .label { |
| | | font-weight: bold; |
| | | width: 180rpx; |
| | | } |
| | | |
| | | .contentImg { |
| | | height: 120rpx; |
| | | width: 120rpx; |
| | | flex: 1; |
| | | text-align: right; |
| | | margin-right: 20rpx; |
| | | } |
| | | |
| | | .user-center-card__header__avatar { |
| | | width: 120rpx; |
| | | height: 120rpx; |
| | | border-radius: 48rpx; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .content { |
| | | flex: 1; |
| | | color: #5C5C5C; |
| | | } |
| | |
| | | } |
| | | |
| | | .bottomBox { |
| | | background-color: #0052d9; |
| | | position: fixed; |
| | | bottom: 0; |
| | | /* bottom: 0; */ |
| | | left: 0; |
| | | right: 0; |
| | | |
| | | padding-bottom: 53px; |
| | | height: 112rpx; |
| | | bottom: calc(env(safe-area-inset-bottom) + 112rpx); |
| | | height: 120rpx; |
| | | background: #FFFFFF; |
| | | box-shadow: 0rpx -2rpx 0rpx 2rpx rgba(0, 0, 0, 0.08); |
| | | display: flex; |
| | |
| | | let userTypeData = res.infoList.find((item) => item.type == 'userType') |
| | | let type = ""; |
| | | if (userTypeData) { |
| | | this.data.userTypeActive = JSON.parse(userTypeData.data).userType; |
| | | this.setData({ |
| | | userTypeActive: JSON.parse(userTypeData.data).userType, |
| | | }); |
| | | type = userTypeList.find((item) => item.value === this.data.userTypeActive)?.lable; |
| | | } else { |
| | | type = '-' |
| | |
| | | }, |
| | | //修改用户类型 |
| | | editUserType() { |
| | | console.log(44) |
| | | if (!this.data.visible) { |
| | | this.setData({ |
| | | visible: true, |
| | |
| | | this.setData({ |
| | | visible: e.detail.visible, |
| | | }); |
| | | }, |
| | | tabUserTypeClick(e) { |
| | | console.log(e) |
| | | let { info } = e.currentTarget.dataset; |
| | | this.setData({ |
| | | userTypeActive: info.value, |
| | | }); |
| | | }, |
| | | submit() { |
| | | let userTypeInfo = { |
| | | requests: [ |
| | | { |
| | | data: JSON.stringify({ userType: this.data.userTypeActive }), |
| | | name: '用户类型', |
| | | type: 'userType' |
| | | } |
| | | ] |
| | | } |
| | | app.MG.identity.setAppUserInfo(userTypeInfo).then((res) => { |
| | | if (res) { |
| | | wx.showToast({ |
| | | title: "修改成功", |
| | | icon: 'success', |
| | | duration: 1000, |
| | | }) |
| | | this.getUserInfo() |
| | | this.setData({ |
| | | visible: false, |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | //设置 |
| | | gotoUserEditPage() { |
| | |
| | | onShareAppMessage() { |
| | | |
| | | }, |
| | | //跳转关于我们和联系我们 |
| | | onAboutUS() { |
| | | console.log(111); |
| | | } |
| | | }) |
| | |
| | | <view class="domainList"> |
| | | <view wx:for="{{menuData}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> |
| | | <view class="icon"> |
| | | <t-image src="{{item.icon}}" mode="heightFix" class="img" /> |
| | | <image src="{{item.icon}}" mode="aspectFit" class="img" /> |
| | | </view> |
| | | <view class="label"> |
| | | <text>{{item.title}}</text> |
| | |
| | | <view class="domainList1"> |
| | | <view wx:for="{{moreMenu}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> |
| | | <view class="icon"> |
| | | <t-image src="{{item.icon}}" mode="heightFix" class="img" /> |
| | | <image src="{{item.icon}}" mode="aspectFit" class="img" /> |
| | | </view> |
| | | <view class="label"> |
| | | <text>{{item.title}}</text> |
| | |
| | | <view class="domainList2"> |
| | | <view wx:for="{{moreMenu1}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> |
| | | <view class="icon"> |
| | | <t-image src="{{item.icon}}" mode="heightFix" class="img" /> |
| | | <image src="{{item.icon}}" mode="aspectFit" class="img" /> |
| | | </view> |
| | | <view class="label"> |
| | | <text>{{item.title}}</text> |
| | |
| | | <view class="title">请选择您的用户类型</view> |
| | | </view> |
| | | <view class="body"> |
| | | <view wx:for="{{userTypeList}}" wx:for-item="item" wx:for-index="index" wx:key="index" data-info="{{item}}" bindtap="tabUserTypeClick" :class="item.value == userTypeActive ? 'activeItem item hover' : 'item hover'"> |
| | | |
| | | <view wx:for="{{userTypeList}}" wx:for-item="item" wx:for-index="index" wx:key="index" data-info="{{item}}" bindtap="tabUserTypeClick" class="{{item.value === userTypeActive ? 'activeItem item' : 'item'}}"> |
| | | {{ item.lable }} |
| | | </view> |
| | | </view> |
| | | <view class="footer"> |
| | | <button class="submit" bindtap="submit">提交</button> |
| | | <button class="submit" bindtap="submit">确定</button> |
| | | </view> |
| | | </view> |
| | | </t-popup> |
| | |
| | | width: 46rpx; |
| | | height: 46rpx; |
| | | margin: 0 auto; |
| | | display: flex; |
| | | } |
| | | |
| | | .listItem .icon .t-image { |
| | | width: 100%; |
| | | |
| | | .listItem .icon .img { |
| | | /* width: 100%; */ |
| | | height: 100%; |
| | | object-fit: contain; |
| | | |
| | | } |
| | | |
| | | .listItem .label { |
| | |
| | | |
| | | .block { |
| | | width: 100vw; |
| | | height: 240px; |
| | | background: #fff; |
| | | border-top-left-radius: 16rpx; |
| | | border-top-right-radius: 16rpx; |
| | | } |
| | | |
| | | .header { |
| | | .block .header { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 116rpx; |
| | | } |
| | | |
| | | .title { |
| | | .block .title { |
| | | flex: 1; |
| | | text-align: center; |
| | | font-weight: 600; |
| | | font-size: 36rpx; |
| | | } |
| | | |
| | | .block .body { |
| | | padding: 0 20rpx; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .item { |
| | | width: calc(100%/2 - 30rpx); |
| | | text-align: center; |
| | | padding: 30rpx 0; |
| | | margin: 0 10rpx 20rpx 10rpx; |
| | | background: #F9F9F9; |
| | | border: 4rpx solid #F9F9F9; |
| | | border-radius: 10rpx; |
| | | } |
| | | |
| | | .activeItem { |
| | | border: 4rpx solid #ff6c00; |
| | | background: #fff; |
| | | } |
| | | |
| | | .footer { |
| | | width: 80%; |
| | | margin: 10rpx auto; |
| | | } |
| | | |
| | | .submit { |
| | | background: #ff6c00; |
| | | color: #fff; |
| | | border-radius: 50rpx; |
| | | } |