feat(洒大山): 说的是
风格化法国
BREAKING CHANGE: dsf
8个文件已删除
52个文件已修改
76个文件已添加
| | |
| | | import updateManager from './common/updateManager'; |
| | | import MG from './assets/js/middleGround/WebMiddleGroundApi' |
| | | import MG from './assets/js/middleGround/WebMiddleGroundApi'; |
| | | import config from './assets/js/config'; |
| | | App({ |
| | | MG:MG, |
| | | MG: MG, |
| | | config: config, |
| | | onLaunch: function () { }, |
| | | onShow: function () { |
| | | updateManager(); |
| | |
| | | "pages/cart/index", |
| | | "pages/home/home", |
| | | "pages/aboutUs/index", |
| | | "pages/bookServices/index", |
| | | "pages/bookServices/assort/index", |
| | | "pages/bookServices/detail/index", |
| | | "pages/bookServices/list/index", |
| | | "pages/bookExhibitionList/index", |
| | | "pages/bookExhibitionDetails/index", |
| | | "pages/bibliographyList/index", |
| | |
| | | "list": [ |
| | | { |
| | | "pagePath": "pages/home/home", |
| | | "text": "首页" |
| | | "text": "首页", |
| | | "iconPath": "/static/images/home/Home@2x.png", |
| | | "selectedIconPatn": "/static/images/home/Home-click@2x.png" |
| | | }, |
| | | { |
| | | "pagePath": "pages/bookServices/index", |
| | | "text": "图书服务" |
| | | "pagePath": "pages/bookServices/assort/index", |
| | | "text": "图书服务", |
| | | "iconPath": "/static/images/home/service@2x.png", |
| | | "selectedIconPatn": "/static/images/home/service-click@2x.png" |
| | | }, |
| | | { |
| | | "pagePath": "pages/goods/category/index", |
| | | "text": "学习" |
| | | "text": "学习", |
| | | "iconPath": "/static/images/home/learn@2x.png", |
| | | "selectedIconPatn": "/static/images/home/learn-click@2x.png" |
| | | }, |
| | | { |
| | | "pagePath": "pages/cart/index", |
| | | "text": "购物车" |
| | | "text": "购物车", |
| | | "iconPath": "/static/images/home/cart@2x.png", |
| | | "selectedIconPatn": "/static/images/home/cart-click@2x.png" |
| | | }, |
| | | { |
| | | "pagePath": "pages/usercenter/index", |
| | | "text": "我的" |
| | | "pagePath": "pages/personalCenter/index", |
| | | "text": "我的", |
| | | "iconPath": "/static/images/home/my@2x.png", |
| | | "selectedIconPatn": "/static/images/home/my-click@2x.png" |
| | | } |
| | | ] |
| | | }, |
| | | "requiredPrivateInfos": [ |
| | | "chooseAddress" |
| | | ], |
| | | "lazyCodeLoading": "requiredComponents", |
| | | "usingComponents": {}, |
| | | "window": { |
| | | "backgroundTextStyle": "light", |
| | |
| | | @import 'style/iconfont.wxss'; |
| | | |
| | | @import 'style/theme.wxss'; |
| | | @import 'style/theme.wxss'; |
| | |
| | | |
| | | export const reg_tel = |
| | | /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; // 电话号正则 |
| | | export const reg_telphone =/^0\d{2}-\d{8}$|^0\d{3}-\d{7}$/; //座机号正则 |
| | | export const reg_telphone = /^0\d{2}-\d{8}$|^0\d{3}-\d{7}$/; //座机号正则 |
| | | 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"; |
| | |
| | | }); |
| | | }, |
| | | |
| | | //检查微信小程序是否注册 |
| | | checkWeChatAppAccount(data) { |
| | | return request({ |
| | | url: "/identity/api/CheckWeChatAppAccount", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | |
| | | // 通过手机号重置密码 |
| | | changePasswordByMobilePhone(data) { |
| | |
| | | data, |
| | | }); |
| | | }, |
| | | loginByWeChatAppCode(data) { |
| | | return request({ |
| | | url: "/identity/api/LoginByWeChatAppCode", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 获取邮箱验证码 |
| | | getEmailCode(data) { |
| | |
| | | import config from "@/assets/js/config.js"; |
| | | |
| | | import jobApi from "./middleGround/api/job"; // newJobWithNewView // newSession, |
| | | import config from "./config.js"; |
| | | import jobApi from "./middleGround/api/job";// newJobWithNewView // newSession, |
| | | |
| | | export function setSessionGuid(type, id) { |
| | | var cityCode = null; |
| | |
| | | }; |
| | | |
| | | jobApi.newSession(params).then(res => { |
| | | storage.set("sessionGuid", res, 30); |
| | | wx.setStorageSync("sessionGuid", res); |
| | | setNewView(type, id); |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | export function setNewView(type, id) { |
| | | if (!sessionStorage.getItem("sessionGuid")) { |
| | | if (!wx.getStorageSync("sessionGuid")) { |
| | | setSessionGuid(type, id); |
| | | } |
| | | |
| | | const sessionGuid = sessionStorage.getItem("sessionGuid"); |
| | | const fromPath = sessionStorage.getItem("fromPath"); |
| | | const toPath = sessionStorage.getItem("toPath"); |
| | | const sessionGuid = wx.getStorageSync("sessionGuid"); |
| | | const fromPath = wx.getStorageSync("fromPath"); |
| | | const toPath = wx.getStorageSync("toPath"); |
| | | if (sessionGuid) { |
| | | let params = { |
| | | sessionGuid: sessionGuid, |
| | |
| | | if (id) { |
| | | params[type] = id; |
| | | } |
| | | jobApi.newJobWithNewView(params).then(res => {}); |
| | | jobApi.newJobWithNewView(params).then(res => { }); |
| | | } |
| | | } |
| | |
| | | import config from "../js/config" |
| | | |
| | | |
| | | let clearStorage = false; |
| | | let timer = null; |
| | | const request = (params) => { |
| | | let fullUrl = `${config.requestCtx}${params.url}` |
| | | let token = wx.getStorageSync(config.tokenKey) ? wx.getStorageSync(config.tokenKey) : '' |
| | |
| | | } |
| | | currentUrl = JSON.stringify(currentUrl) |
| | | wx.reLaunch({ |
| | | url: urlargs ? '/pages/index/index?backUrl=' + encodeURIComponent(currentUrl) : '/pages/index/index' |
| | | url: urlargs ? '/pages/home/home?backUrl=' + encodeURIComponent(currentUrl) : '/pages/home/home' |
| | | }) |
| | | } |
| | | } else { |
| | |
| | | export default [ |
| | | { |
| | | icon: 'home', |
| | | text: '首页', |
| | | url: 'pages/home/home', |
| | | icon: '/static/images/home/Home@2x.png', |
| | | activeIcon: '/static/images/home/Home-click@2x.png' |
| | | }, |
| | | { |
| | | icon: 'sort', |
| | | text: '图书服务', |
| | | url: 'pages/bookServices/index' |
| | | url: 'pages/bookServices/assort/index', |
| | | icon: '/static/images/home/service@2x.png', |
| | | activeIcon: '/static/images/home/service-click@2x.png' |
| | | }, |
| | | |
| | | { |
| | | icon: 'sort', |
| | | text: '学习', |
| | | url: 'pages/goods/category/index', |
| | | icon: '/static/images/home/learn@2x.png', |
| | | activeIcon: '/static/images/home/learn-click@2x.png' |
| | | }, |
| | | { |
| | | icon: 'cart', |
| | | text: '购物车', |
| | | url: 'pages/cart/index', |
| | | icon: '/static/images/home/cart@2x.png', |
| | | activeIcon: '/static/images/home/cart-click@2x.png' |
| | | }, |
| | | { |
| | | icon: 'person', |
| | | text: '个人中心', |
| | | url: 'pages/personalCenter/index', |
| | | icon: '/static/images/home/my@2x.png', |
| | | activeIcon: '/static/images/home/my-click@2x.png' |
| | | }, |
| | | ]; |
| | |
| | | "usingComponents": { |
| | | "t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar", |
| | | "t-tab-bar-item": "tdesign-miniprogram/tab-bar-item/tab-bar-item", |
| | | "t-icon": "tdesign-miniprogram/icon/icon" |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-image": "tdesign-miniprogram/image/image" |
| | | } |
| | | } |
| | |
| | | <t-tab-bar |
| | | value="{{active}}" |
| | | bindchange="onChange" |
| | | split="{{false}}" |
| | | > |
| | | <t-tab-bar-item |
| | | wx:for="{{list}}" |
| | | wx:for-item="item" |
| | | wx:for-index="index" |
| | | wx:key="index" |
| | | > |
| | | <view class="custom-tab-bar-wrapper"> |
| | | <t-icon prefix="wr" name="{{item.icon}}" size="48rpx" /> |
| | | <view class="text">{{ item.text }}</view> |
| | | </view> |
| | | </t-tab-bar-item> |
| | | </t-tab-bar> |
| | | |
| | | <t-tab-bar value="{{active}}" bindchange="onChange" split="{{false}}"> |
| | | <t-tab-bar-item wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| | | <view class="custom-tab-bar-wrapper"> |
| | | <!-- <t-icon prefix="wr" name="{{item.icon}}" size="48rpx" /> |
| | | <view class="text">{{ item.text }}</view> --> |
| | | <t-image wx:if="{{active !== index}}" class="tabImg" src="{{item.icon}}" mode="heightFix" width="22" height="22" /> |
| | | <t-image wx:else class="tabImg" src="{{item.activeIcon}}" mode="heightFix" width="22" height="22" /> |
| | | <view class="text">{{ item.text }}</view> |
| | | </view> |
| | | </t-tab-bar-item> |
| | | </t-tab-bar> |
| | |
| | | |
| | | .custom-tab-bar-wrapper .text { |
| | | font-size: 20rpx; |
| | | } |
| | | margin-top: 10rpx; |
| | | } |
New file |
| | |
| | | // pages/bookServices/assort/index.js |
| | | const app = getApp(); |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | assortList: [], |
| | | assortCheck: { |
| | | name: '', |
| | | code: '', |
| | | }, |
| | | startList: [], |
| | | startCheck: '', |
| | | bookList: [], |
| | | listLoding: false, |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | // this.getAssortList() |
| | | console.log(options); |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | this.getAssortList(); |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() {}, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() {}, |
| | | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() {}, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() {}, |
| | | |
| | | // 获取侧边栏列表 |
| | | getAssortList() { |
| | | const query = { |
| | | path: '*', |
| | | filterList: [ |
| | | { |
| | | value: 'Normal', |
| | | field: 'state', |
| | | }, |
| | | ], |
| | | queryType: '\\', |
| | | searchList: [], |
| | | size: '30', |
| | | start: '0', |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' }, |
| | | }; |
| | | app.MG.store.getStoreChannelList(query).then((res) => { |
| | | const list = res.datas.filter((item) => item.refCode != 'jsek_homepageBookService'); |
| | | this.setData({ |
| | | assortList: list, |
| | | }); |
| | | this.setData({ |
| | | assortCheck: { |
| | | name: res.datas[0].name, |
| | | code: res.datas[0].refCode, |
| | | }, |
| | | }); |
| | | this.getStairList(res.datas[0].refCode); |
| | | }); |
| | | }, |
| | | // 侧边栏切换 |
| | | changeAssort(data) { |
| | | this.setData({ |
| | | assortCheck: { |
| | | name: data.detail.label, |
| | | code: data.detail.value, |
| | | }, |
| | | }); |
| | | this.getStairList(data.detail.value); |
| | | }, |
| | | // 获取一级分类 |
| | | getStairList(path) { |
| | | this.setData({ |
| | | listLoding: true, |
| | | }); |
| | | const query = { |
| | | path, |
| | | filterList: [], |
| | | queryType: '\\', |
| | | searchList: [], |
| | | size: '30', |
| | | start: '0', |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' }, |
| | | }; |
| | | app.MG.store.getStoreChannelList(query).then(async (res) => { |
| | | // 一级分类选中 |
| | | this.setData({ |
| | | startCheck: res.datas[0].refCode, |
| | | }); |
| | | // 获取二级分类 |
| | | for (let index = 0; index < res.datas.length; index++) { |
| | | const item = res.datas[index]; |
| | | item.children = await this.getSecondList(item); |
| | | } |
| | | // 一级分类赋值 |
| | | this.setData({ |
| | | startList: res.datas, |
| | | }); |
| | | }); |
| | | this.setData({ |
| | | listLoding: false, |
| | | }); |
| | | }, |
| | | |
| | | // 获取一级分类下二级分类 |
| | | async getSecondList(tab) { |
| | | const path = `${this.data.assortCheck.code}\\${tab.refCode}`; |
| | | let datas; |
| | | const query = { |
| | | path, |
| | | filterList: [], |
| | | queryType: '\\', |
| | | searchList: [], |
| | | size: '30', |
| | | start: '0', |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' }, |
| | | }; |
| | | await app.MG.store.getStoreChannelList(query).then((res) => { |
| | | datas = res.datas; |
| | | }); |
| | | return datas; |
| | | }, |
| | | tabClick(tabData) { |
| | | const data = tabData.currentTarget.dataset.tabdata; |
| | | this.setData({ |
| | | startCheck: data.refCode, |
| | | }); |
| | | }, |
| | | // 跳转列表页 |
| | | goPageList(item) { |
| | | const secondCode = `${item.currentTarget.dataset.staircode.pathLinks[0].linkPath}\\${item.currentTarget.dataset.staircode.id}`; |
| | | wx.navigateTo({ |
| | | url: `/pages/bookServices/list/index?assorName=${this.data.assortCheck.name}&assortCode=${this.data.assortCheck.code}&stairCode=${this.data.startCheck}&secondCode=${secondCode}`, |
| | | }); |
| | | }, |
| | | navToSearchPage(e) { |
| | | console.log(e.detail.value); |
| | | wx.navigateTo({ |
| | | url: `/pages/bookServices/list/index?assorName=${this.data.assortCheck.name}&assortCode=${this.data.assortCheck.code}&stairCode=${this.data.startCheck}&searchValue=${e.detail.value}`, |
| | | }); |
| | | }, |
| | | }); |
New file |
| | |
| | | { |
| | | "navigationBarTitleText": "图书服务", |
| | | "onReachBottomDistance": 10, |
| | | "backgroundTextStyle": "light", |
| | | "enablePullDownRefresh": true, |
| | | "usingComponents": { |
| | | "t-search": "tdesign-miniprogram/search/search", |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-side-bar": "tdesign-miniprogram/side-bar/side-bar", |
| | | "t-side-bar-item": "tdesign-miniprogram/side-bar-item/side-bar-item", |
| | | "t-radio": "tdesign-miniprogram/radio/radio", |
| | | "t-radio-group": "tdesign-miniprogram/radio-group/radio-group", |
| | | "t-button": "tdesign-miniprogram/button/button", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-image": "/components/webp-image/index" |
| | | } |
| | | } |
New file |
| | |
| | | <!--图书服务分类--> |
| | | <view class="page-header"> |
| | | <!-- 搜索框 --> |
| | | <view class="search"> |
| | | <t-search |
| | | t-class-input="t-search__input" |
| | | t-class-input-container="t-search__input-container" |
| | | placeholder="请输入关键词/书名/ISBN/作者" |
| | | leftIcon="" |
| | | bind:submit="navToSearchPage" |
| | | > |
| | | <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" /> |
| | | </t-search> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="page-container"> |
| | | <view class="side-bar-wrapper"> |
| | | <view class="tab-left"> |
| | | <t-side-bar value="{{assortCheck.code}}" bind:change="changeAssort"> |
| | | <t-side-bar-item |
| | | wx:for="{{assortList}}" |
| | | wx:key="id" |
| | | value="{{item.refCode}}" |
| | | label="{{item.name}}" |
| | | badge-props="{{item.badgeProps}}" |
| | | /> |
| | | </t-side-bar> |
| | | </view> |
| | | <view class="side-bar-content"> |
| | | <!-- 一级分类 --> |
| | | <view class="tab-top"> |
| | | <scroll-view scroll-x="{{true}}" class="myScroll"> |
| | | <view |
| | | wx:for="{{startList}}" |
| | | wx:key="id" |
| | | class="row {{startCheck == item.refCode ? 'tab-active' : ''}}" |
| | | bind:tap="tabClick" |
| | | data-tabData="{{item}}" |
| | | wx:if="{{item.children.length}}" |
| | | >{{item.name}}</view |
| | | > |
| | | </scroll-view> |
| | | </view> |
| | | <!-- 内容 --> |
| | | <scroll-view scroll-y="{{true}}" class="class-list" scroll-into-view="{{startCheck}}"> |
| | | <view wx:if="{{listLoading}}"> |
| | | <t-loading theme="spinner" size="400rpx" loading="{{listLoading}}"></t-loading> |
| | | </view> |
| | | <view |
| | | wx:for="{{startList}}" |
| | | wx:for-item="item" |
| | | wx:key="item.refCode" |
| | | id="{{item.refCode}}" |
| | | class="class-box" |
| | | wx:if="{{item.children.length && !listLoading}}" |
| | | > |
| | | <view class="class-name">{{item.name}}</view> |
| | | <view class="class-content"> |
| | | <view |
| | | wx:for="{{item.children}}" |
| | | wx:for-item="citem" |
| | | wx:key="id" |
| | | class="book-box" |
| | | bind:tap="goPageList" |
| | | data-stairCode="{{citem}}" |
| | | > |
| | | <t-image src="/static/images/bookService/assort/book-img.png" mode="heightFix" width="58" height="72" /> |
| | | <view class="classify">{{citem.name}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | </view> |
| | | </view> |
New file |
| | |
| | | page { |
| | | box-sizing: border-box; |
| | | padding-bottom: calc(env(safe-area-inset-bottom) + 96rpx); |
| | | } |
| | | |
| | | .page-header { |
| | | position: relative; |
| | | } |
| | | |
| | | .search { |
| | | position: absolute; |
| | | top: 20rpx; |
| | | left: 0; |
| | | width: 100%; |
| | | z-index: 99; |
| | | } |
| | | |
| | | .page-header .t-search__input-container { |
| | | border-radius: 15rpx !important; |
| | | margin: 0 24rpx; |
| | | height: 64rpx !important; |
| | | } |
| | | |
| | | .page-container { |
| | | padding: 120rpx 0 20rpx 0; |
| | | width: 100%; |
| | | } |
| | | |
| | | .side-bar-wrapper { |
| | | background-color: #f2f3f8; |
| | | display: flex; |
| | | } |
| | | |
| | | .side-bar-content { |
| | | width: 70%; |
| | | padding: 0 20rpx; |
| | | } |
| | | |
| | | .tab-left { |
| | | --td-side-bar-font-size: 14px; |
| | | /* 选中文字颜色 */ |
| | | --td-side-bar-active-color: #ff6c00; |
| | | /* 整体背景 */ |
| | | --td-side-bar-bg-color: #fff; |
| | | /* 选中背景 */ |
| | | --td-bg-color-container: #f2f3f8; |
| | | /* 未选中文字颜色 */ |
| | | --td-side-bar-color: '#333' |
| | | } |
| | | |
| | | .tab-top { |
| | | overflow-x: scroll; |
| | | } |
| | | |
| | | .tab-active { |
| | | background-color: #ff6c00 !important; |
| | | color: #fff; |
| | | } |
| | | |
| | | .myScroll { |
| | | /* 盒子的样式 */ |
| | | width: 100%; |
| | | height: 98rpx; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | .myScroll .row { |
| | | font-size: 14px; |
| | | padding: 10rpx 14rpx; |
| | | margin: 20rpx 0; |
| | | border-radius: 10rpx; |
| | | /* 定义每个子件 */ |
| | | height: 40rpx; |
| | | background: #fff; |
| | | margin-right: 20rpx; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .myScroll .row:last-child { |
| | | /* 选择最后一个子件 清零边距 */ |
| | | margin-right: 0; |
| | | } |
| | | |
| | | .class-list { |
| | | /* overflow-y: auto; */ |
| | | height: 72.5vh; |
| | | width: 262px; |
| | | } |
| | | |
| | | .class-box { |
| | | background-color: #fff; |
| | | margin-bottom: 10rpx; |
| | | padding: 10rpx 12rpx; |
| | | border-radius: 12rpx; |
| | | /* height: 60rpx; */ |
| | | } |
| | | |
| | | .class-name { |
| | | font-size: 32rpx; |
| | | font-weight: 700; |
| | | } |
| | | |
| | | .class-content { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | padding: 5rpx 20rpx 30rpx 30rpx; |
| | | } |
| | | |
| | | .book-box { |
| | | width: 140rpx; |
| | | margin-right: 10rpx; |
| | | } |
| | | |
| | | .book-box:nth-child(3n) { |
| | | margin-right: 0; |
| | | } |
| | | |
| | | .book-box image { |
| | | width: 58px; |
| | | height: 70px; |
| | | } |
| | | |
| | | .classify { |
| | | max-width: 90%; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | font-size: 14px; |
| | | } |
New file |
| | |
| | | Component({ |
| | | properties: { |
| | | content: { |
| | | type: String, |
| | | value: '', |
| | | }, |
| | | authorIntroduction: { |
| | | type: String, |
| | | value: '', |
| | | }, |
| | | }, |
| | | }); |
New file |
| | |
| | | { |
| | | "usingComponents": { |
| | | "t-image": "tdesign-miniprogram/image/image" |
| | | }, |
| | | "component": true |
| | | } |
New file |
| | |
| | | <view class="message"> |
| | | <view class="basic"> |
| | | <view class="basic-title"> |
| | | <view> |
| | | <t-image src="/static/images/bookService/detail/label.png"></t-image> |
| | | </view> |
| | | <view class="title-name">基本信息</view> |
| | | </view> |
| | | <rich-text |
| | | nodes="{{content}}" |
| | | style="font-size: 28rpx; color: #333; line-height: 48rpx; text-align: justify" |
| | | ></rich-text> |
| | | </view> |
| | | <view class="basic"> |
| | | <view class="basic-title"> |
| | | <view> |
| | | <t-image src="/static/images/bookService/detail/author.png"></t-image> |
| | | </view> |
| | | <view class="title-name">作者简介</view> |
| | | </view> |
| | | </view> |
| | | <rich-text |
| | | nodes="{{authorIntroduction}}" |
| | | style="font-size: 28rpx; color: #333; line-height: 48rpx; text-align: justify" |
| | | /> |
| | | </view> |
New file |
| | |
| | | /* pages/bookServices/detail/components/brief/index.wxss */ |
| | | .message { |
| | | padding: 0 40rpx 40rpx 40rpx; |
| | | } |
| | | |
| | | .message image { |
| | | width: 42rpx; |
| | | height: 48rpx; |
| | | } |
| | | |
| | | .basic-title { |
| | | margin-top: 40rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 24rpx; |
| | | } |
| | | |
| | | .title-name { |
| | | margin-left: 18rpx; |
| | | font-size: 32rpx; |
| | | color: #333; |
| | | font-weight: bold; |
| | | } |
New file |
| | |
| | | // pages/bookServices/detail/index.js |
| | | import Message from 'tdesign-miniprogram/message/index'; |
| | | const app = getApp(); |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | barHeight: '', |
| | | navBarHeight: '', |
| | | options: { |
| | | id: '', |
| | | name: '', |
| | | }, |
| | | bookDetail: {}, |
| | | link: { |
| | | jd: '', |
| | | tamll: '', |
| | | dang: '', |
| | | micro: '', |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | this.setData({ |
| | | barHeight: systInfo.statusBarHeight, |
| | | navBarHeight: navBarHeight, |
| | | }); |
| | | this.setData({ |
| | | options: { |
| | | id: options.id, |
| | | name: options.name, |
| | | }, |
| | | }); |
| | | this.getBookInfo(options.id); |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() {}, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() {}, |
| | | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() {}, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() {}, |
| | | // 格式化日期 |
| | | formatDate(dateString) { |
| | | if (!dateString) { |
| | | return 'Invalid date'; |
| | | } |
| | | const match = dateString.match(/^(\d{4})\/(\d{1,2})\/(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/); |
| | | if (!match) { |
| | | throw new Error('Invalid date format'); |
| | | } |
| | | |
| | | const [, year, month, day, hours, minutes, seconds] = match; |
| | | const date = new Date( |
| | | parseInt(year, 10), |
| | | parseInt(month, 10) - 1, |
| | | parseInt(day, 10), |
| | | parseInt(hours, 10), |
| | | parseInt(minutes, 10), |
| | | parseInt(seconds, 10), |
| | | ); |
| | | |
| | | if (isNaN(date.getTime())) { |
| | | throw new Error('Invalid date'); |
| | | } |
| | | |
| | | // 由于小程序环境可能不支持 Intl.DateTimeFormat,我们使用简化的格式化方法 |
| | | const formatted = `${year}年${this.formatMonth(month)}`; |
| | | return formatted; |
| | | }, |
| | | // 简化的月份格式化函数,返回月份的中文表达 |
| | | formatMonth(month) { |
| | | const months = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']; |
| | | return months[parseInt(month, 10) - 1]; |
| | | }, |
| | | // 金额显示.00格式 |
| | | numFormat(value) { |
| | | if (!value) return '0.00'; |
| | | value = Number(value).toFixed(2); |
| | | var intPart = Math.trunc(value); // 获取整数部分 |
| | | var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'); // 将整数部分逢三一断 |
| | | var floatPart = '.00'; // 预定义小数部分 |
| | | var value2Array = value.split('.'); |
| | | // =2表示数据有小数位 |
| | | if (value2Array.length === 2) { |
| | | floatPart = value2Array[1].toString(); // 拿到小数部分 |
| | | if (floatPart.length === 1) { |
| | | return `${intPartFormat}.${floatPart}0`; |
| | | } |
| | | return `${intPartFormat}.${floatPart}`; |
| | | } |
| | | return intPartFormat + floatPart; |
| | | }, |
| | | // 返回 |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | | // 获取图书详情 |
| | | getBookInfo(id) { |
| | | const query = { |
| | | path: '*', |
| | | queryType: '*', |
| | | productId: id, |
| | | favoriteTypes: 'FavoriteBookCity', |
| | | itemFields: { |
| | | 'SysType=': 'CmsFolder', |
| | | }, |
| | | coverSize: { |
| | | height: 300, |
| | | }, |
| | | fields: { |
| | | seriesName: [], |
| | | author: [], |
| | | isbn: [], |
| | | publicationDate: [], |
| | | bookClassification: [], |
| | | paperPrice: [], |
| | | JDLink: [], |
| | | tmallLink: [], |
| | | dangdangLink: [], |
| | | weidianLink: [], |
| | | content: [], |
| | | authorIntroduction: [], |
| | | // isApplyPaperBook: [], |
| | | // isApplyEBook: [], |
| | | isApplyBook: [], |
| | | isSell: [], |
| | | pdf: [], |
| | | protectedEpub: [], |
| | | probationPage: [], //pdf试读页数 |
| | | freeEpubPage: [], //epub试读百分比 |
| | | }, |
| | | }; |
| | | app.MG.store.getProductDetail(query).then((res) => { |
| | | this.setData({ |
| | | bookDetail: res.datas, |
| | | }); |
| | | console.log('详情', res.datas); |
| | | // 获取图书分类 |
| | | const iconType = JSON.parse(res.datas.bookClassification)[0][0]; |
| | | const classType = JSON.parse(res.datas.bookClassification)[0][1]; |
| | | this.setData({ |
| | | 'bookDetail.publicationDate': this.formatDate(this.data.bookDetail.publicationDate), |
| | | 'bookDetail.class': this.getBookClass(iconType, classType), |
| | | 'bookDetail.price': this.numFormat(this.data.bookDetail.price), |
| | | 'bookDetail.oldPrice': this.numFormat(this.data.bookDetail.oldPrice), |
| | | 'bookDetail.paperPrice': this.numFormat(this.data.bookDetail.paperPrice), |
| | | }); |
| | | }); |
| | | }, |
| | | // 获取图书分类 |
| | | getBookClass(iconType, classType) { |
| | | let name = ''; |
| | | const query = { |
| | | refCodes: ['bookClassification'], |
| | | }; |
| | | app.MG.store.getProductTypeField(query).then((res) => { |
| | | JSON.parse(res[0].config).option.forEach((item) => { |
| | | if (item.value == iconType) { |
| | | item.child.forEach((item) => { |
| | | if (item.value == classType) { |
| | | name = item.name; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | return name; |
| | | }, |
| | | // 收藏 |
| | | setCollect() { |
| | | if (this.data.bookDetail.isFavourite) { |
| | | app.MG.store |
| | | .delProductLink({ |
| | | productIds: [this.data.bookDetail.id], |
| | | linkType: 'FavoriteBookCity', |
| | | }) |
| | | .then(() => { |
| | | this.data.bookDetail.isFavourite = false; |
| | | Message.success({ |
| | | context: this, |
| | | offset: ['20rpx', '32rpx'], |
| | | duration: 2000, |
| | | content: '取消收藏', |
| | | }); |
| | | }); |
| | | } else { |
| | | const params = { |
| | | productIds: [this.data.bookDetail.id], |
| | | linkType: 'FavoriteBookCity', |
| | | }; |
| | | app.MG.store.addProductLink(params).then((res) => { |
| | | console.log(res); |
| | | this.data.bookDetail.isFavourite = true; |
| | | Message.success({ |
| | | context: this, |
| | | offset: ['20rpx', '32rpx'], |
| | | duration: 2000, |
| | | content: '收藏成功', |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | // 跳转网店 |
| | | goShop(e) { |
| | | const { link } = e.currentTarget.dataset; |
| | | wx.navigateTo({ |
| | | url: link, |
| | | }); |
| | | }, |
| | | }); |
New file |
| | |
| | | { |
| | | "usingComponents": { |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-image": "tdesign-miniprogram/image/image", |
| | | "t-tabs": "tdesign-miniprogram/tabs/tabs", |
| | | "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", |
| | | "book-brief": "/pages/bookServices/detail/components/brief/index" |
| | | }, |
| | | "navigationStyle": "custom" |
| | | } |
New file |
| | |
| | | <!--pages/bookServices/detail/index.wxml--> |
| | | <!--导航区域 --> |
| | | <view style="width: 100%; height: {{barHeight}}px; "></view> |
| | | <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> |
| | | <view> |
| | | <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> |
| | | </view> |
| | | <view class="navbar-title">{{options.name}}</view> |
| | | </view> |
| | | <scroll-view scroll-y="{{true}}" class="book"> |
| | | <!-- 图书详情 --> |
| | | <view class="book-box"> |
| | | <view class="book-detail"> |
| | | <view class="detail-left"> |
| | | <view class="book-img"> |
| | | <t-image |
| | | src="{{bookDetail.icon}}" |
| | | mode="aspectFill" |
| | | width="120" |
| | | height="170" |
| | | aria-label="{{bookDetail.name}}" |
| | | /> |
| | | </view> |
| | | <view class="book-use"> |
| | | <view class="collect" bind:tap="setCollect"> |
| | | <view> |
| | | <t-image |
| | | src="/static/images/bookService/detail/collect.png" |
| | | wx:if="{{!bookDetail.isFavourite}}" |
| | | ></t-image> |
| | | <t-image |
| | | src="/static/images/bookService/detail/collecting.png" |
| | | wx:if="{{bookDetail.isFavourite}}" |
| | | ></t-image> |
| | | </view> |
| | | <view>收藏</view> |
| | | </view> |
| | | <view class="suggest"> |
| | | <view> |
| | | <t-image src="/static/images/bookService/detail/suggest.png"></t-image> |
| | | </view> |
| | | <view>我要建议</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="detail-right"> |
| | | <view class="book-name">{{bookDetail.name}}</view> |
| | | <view class="book-message"> |
| | | <view class="message-li"> |
| | | <view class="li-title">丛书名:</view> |
| | | <view class="li-content">{{bookDetail.seriesName}}</view> |
| | | </view> |
| | | <view class="message-li"> |
| | | <view class="li-title">作者:</view> |
| | | <view class="li-content">{{bookDetail.author}}</view> |
| | | </view> |
| | | <view class="message-li"> |
| | | <view class="li-title">ISBN:</view> |
| | | <view class="li-content">{{bookDetail.isbn}}</view> |
| | | </view> |
| | | <view class="message-li"> |
| | | <view class="li-title">出版时间:</view> |
| | | <view class="li-content">{{bookDetail.publicationDate}}</view> |
| | | </view> |
| | | <view class="message-li"> |
| | | <view class="li-title">图书分类:</view> |
| | | <view class="li-content">{{bookDetail.class}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- 销售信息 --> |
| | | <view class="book-sale"> |
| | | <view class="book-price"> |
| | | <!-- 电子书售价 --> |
| | | <view class="electron-price"> |
| | | <view> |
| | | <t-image src="/static/images/bookService/detail/electon-price.png"></t-image> |
| | | </view> |
| | | <view class="price"> |
| | | <view>¥{{bookDetail.price}}</view> |
| | | <view class="price-old">¥{{bookDetail.oldPrice}} <view class="line"></view> </view> |
| | | </view> |
| | | <view> </view> |
| | | </view> |
| | | <!-- 纸质书售价 --> |
| | | <view class="paper-price"> |
| | | <view> |
| | | <t-image src="/static/images/bookService/detail/paper-price.png"></t-image> |
| | | </view> |
| | | <view class="price">¥{{bookDetail.paperPrice}}</view> |
| | | </view> |
| | | </view> |
| | | <!-- 网店 --> |
| | | <view class="book-web"> |
| | | <t-image |
| | | src="/static/images/bookService/detail/jd.png" |
| | | wx:if="{{bookDetail.JDLink}}" |
| | | bind:tap="goShop" |
| | | data-link="{{bookDetail.tmallLink}}" |
| | | data-type="jd" |
| | | ></t-image> |
| | | <t-image |
| | | src="/static/images/bookService/detail/tmall.png" |
| | | width="32" |
| | | height="22" |
| | | bind:tap="goShop" |
| | | data-link="{{bookDetail.tmallLink}}" |
| | | wx:if="{{bookDetail.tmallLink}}" |
| | | ></t-image> |
| | | <t-image |
| | | src="/static/images/bookService/detail/dangdang.png" |
| | | bind:tap="goShop" |
| | | data-link="{{bookDetail.dangdangLink}}" |
| | | wx:if="{{bookDetail.dangdangLink}}" |
| | | ></t-image> |
| | | <t-image |
| | | src="/static/images/bookService/detail/jd.png" |
| | | bind:tap="goShop" |
| | | data-link="{{bookDetail.weidianLink}}" |
| | | wx:if="{{bookDetail.weidianLink}}" |
| | | ></t-image> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="book-resource"> |
| | | <t-tabs |
| | | defaultValue="{{0}}" |
| | | bind:change="onTabsChange" |
| | | bind:click="onTabsClick" |
| | | t-class="custom-tabs" |
| | | t-class-content="custom-panel" |
| | | > |
| | | <t-tab-panel label="图书简介" value="0" style="{{tabPanelstyle}}"> |
| | | <book-brief |
| | | content="{{bookDetail.content}}" |
| | | authorIntroduction="{{bookDetail.authorIntroduction}}" |
| | | ></book-brief> |
| | | </t-tab-panel> |
| | | <t-tab-panel label="电子书" value="1" style="{{tabPanelstyle}}">选项二内容</t-tab-panel> |
| | | <t-tab-panel label="云学习" value="2" style="{{tabPanelstyle}}">选项三内容</t-tab-panel> |
| | | <t-tab-panel label="云测试" value="3" style="{{tabPanelstyle}}">选项四内容</t-tab-panel> |
| | | </t-tabs> |
| | | </view> |
| | | <!-- 购买按钮 --> |
| | | <view class="box-bottom"> |
| | | <view class="bottom-btn"> |
| | | <view> |
| | | <t-image src="/static/images/bookService/detail/ebook.png"></t-image> |
| | | </view> |
| | | <view>电子样书申请</view> |
| | | </view> |
| | | <view class="bottom-btn"> |
| | | <view> |
| | | <t-image src="/static/images/bookService/detail/paper-book.png"></t-image> |
| | | </view> |
| | | <view>纸质样书申请</view> |
| | | </view> |
| | | <view class="shopCar">加入购物车</view> |
| | | <view class="buy">立即购买</view> |
| | | </view> |
| | | </scroll-view> |
New file |
| | |
| | | /* pages/bookServices/detail/index.wxss */ |
| | | |
| | | |
| | | .nacigationBar { |
| | | background-color: #fff; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .navbar-title { |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | color: #0F1214; |
| | | font-size: 40rpx; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .book { |
| | | position: relative; |
| | | height: 81vh; |
| | | background-color: #F2F3F8; |
| | | } |
| | | |
| | | .book-detail { |
| | | padding: 32rpx; |
| | | display: flex; |
| | | border-radius: 0 0 20rpx 20rpx; |
| | | } |
| | | |
| | | .detail-left { |
| | | margin-right: 36rpx; |
| | | } |
| | | |
| | | .detail-right .book-name { |
| | | font-weight: bold; |
| | | font-size: 36rpx; |
| | | color: #000000; |
| | | } |
| | | |
| | | .book-message { |
| | | margin-top: 10rpx; |
| | | } |
| | | |
| | | .message-li { |
| | | font-size: 28rpx; |
| | | color: #333333; |
| | | display: flex; |
| | | height: 40rpx; |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | .li-title { |
| | | width: 140rpx; |
| | | } |
| | | |
| | | .book-use { |
| | | margin-top: 16rpx; |
| | | display: flex; |
| | | justify-content: space-evenly; |
| | | font-size: 24rpx; |
| | | color: #949494; |
| | | } |
| | | |
| | | .collect, |
| | | .suggest { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | } |
| | | |
| | | .book-use image { |
| | | width: 38rpx; |
| | | height: 38rpx; |
| | | margin-bottom: 8rpx; |
| | | } |
| | | |
| | | .book-box { |
| | | background: linear-gradient(to right, #FFB400, #FF6C00); |
| | | border-radius: 0 0 20rpx 20rpx; |
| | | } |
| | | |
| | | .book-detail { |
| | | background-color: #fff; |
| | | } |
| | | |
| | | /* 销售信息 */ |
| | | .book-sale { |
| | | padding: 0 30rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | width: 100%; |
| | | height: 150rpx; |
| | | border-radius: 0 0 20rpx 20rpx; |
| | | } |
| | | |
| | | .book-price { |
| | | height: 100%; |
| | | display: flex; |
| | | } |
| | | |
| | | .book-price image { |
| | | width: 58rpx; |
| | | height: 70rpx; |
| | | } |
| | | |
| | | .paper-price, |
| | | .electron-price { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .paper-price { |
| | | margin-left: 30rpx; |
| | | } |
| | | |
| | | .price { |
| | | margin-left: 12rpx; |
| | | font-size: 34rpx; |
| | | color: #fff; |
| | | } |
| | | |
| | | .price-old { |
| | | margin-left: 10rpx; |
| | | position: relative; |
| | | font-size: 28rpx; |
| | | opacity: 0.6; |
| | | } |
| | | |
| | | .line { |
| | | position: absolute; |
| | | top: 50%; |
| | | left: -5rpx; |
| | | width: 80%; |
| | | height: 3rpx; |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .book-web { |
| | | margin-left: 30rpx; |
| | | } |
| | | |
| | | .book-web image { |
| | | margin-left: 20rpx; |
| | | width: 45rpx; |
| | | height: 45rpx; |
| | | } |
| | | |
| | | .book-web image:first-child { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | /* 图书资源 */ |
| | | .book-resource { |
| | | margin-top: 20rpx; |
| | | } |
| | | |
| | | .custom-tabs { |
| | | --td-tab-item-active-color: #FF6C00 |
| | | } |
| | | |
| | | |
| | | /* 底部 */ |
| | | .box-bottom { |
| | | position: fixed; |
| | | left: 0; |
| | | bottom: 40rpx; |
| | | width: 100%; |
| | | height: 110rpx; |
| | | |
| | | } |
| | | |
| | | .box-bottom { |
| | | display: flex; |
| | | border: 1px solid #DDD; |
| | | } |
| | | |
| | | .box-bottom image { |
| | | width: 36rpx; |
| | | height: 44rpx; |
| | | } |
| | | |
| | | .bottom-btn { |
| | | background-color: #fff; |
| | | width: 25%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | flex-direction: column; |
| | | font-size: 24rpx; |
| | | color: #010101; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .bottom-btn image { |
| | | margin-bottom: 6rpx; |
| | | } |
| | | |
| | | .bottom-btn:nth-child(1) { |
| | | border-right: 1px solid #DDD; |
| | | } |
| | | |
| | | .shopCar, |
| | | .buy { |
| | | width: 25%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | color: #fff; |
| | | } |
| | | |
| | | .shopCar { |
| | | background-color: #F1AC37; |
| | | } |
| | | |
| | | .buy { |
| | | background-color: #F14B3B; |
| | | } |
New file |
| | |
| | | const app = getApp(); |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | barHeight: '', |
| | | navBarHeight: '', |
| | | searchValue: '', |
| | | path: '', |
| | | pathList: [], |
| | | page: 1, |
| | | assortCheck: { |
| | | name: '', |
| | | code: '', |
| | | }, |
| | | bookList: [], |
| | | stairList: { |
| | | value: '', |
| | | options: [ |
| | | { |
| | | value: '', |
| | | label: '一级', |
| | | }, |
| | | ], |
| | | }, |
| | | secondList: { |
| | | value: [], |
| | | options: [], |
| | | }, |
| | | majorProjectList: { |
| | | value: [], |
| | | options: [], |
| | | }, |
| | | newTextBook: { |
| | | value: [], |
| | | options: [], |
| | | }, |
| | | stairCode: '', // 一级分类选中项 |
| | | secondCode: '', // 二级分类选中项 |
| | | sort: '', // 排序 |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | this.setData({ |
| | | barHeight: systInfo.statusBarHeight, |
| | | navBarHeight: navBarHeight, |
| | | }); |
| | | // 搜索赋值 |
| | | if (options.searchValue) { |
| | | this.setData({ |
| | | searchValue: options.searchValue, |
| | | }); |
| | | } |
| | | // 高级分类赋值 |
| | | this.setData({ |
| | | assortCheck: { |
| | | name: options.assorName, |
| | | code: options.assortCode, |
| | | }, |
| | | }); |
| | | if (this.data.assortCheck.code) { |
| | | this.setData({}); |
| | | } |
| | | // 获取一级分类 |
| | | this.getStairList(options.assortCode); |
| | | // 一级分类和path赋值 |
| | | if (options.stairCode) { |
| | | this.setData({ |
| | | 'stairList.value': options.stairCode, |
| | | stairCode: options.stairCode, |
| | | secondCode: options.secondCode, |
| | | 'secondList.value': options.secondCode, |
| | | path: `${options.assortCode}\\${options.stairCode}`, |
| | | }); |
| | | } |
| | | // 获取二级分类 |
| | | this.getSecondList(`${options.assortCode}\\${options.stairCode}`); |
| | | this.getBookList(`${options.assortCode}\\${options.stairCode}`); |
| | | // 获取重点项目 |
| | | this.getProjectList('bookClassification'); |
| | | this.getProjectList('newFormsTextbooks'); |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() {}, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() {}, |
| | | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() {}, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() {}, |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | | // 获取一级列表 |
| | | getStairList(path) { |
| | | const query = { |
| | | path, |
| | | filterList: [], |
| | | queryType: '\\', |
| | | searchList: [], |
| | | size: '30', |
| | | start: '0', |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' }, |
| | | }; |
| | | app.MG.store.getStoreChannelList(query).then(async (res) => { |
| | | const options = [ |
| | | { |
| | | value: '', |
| | | label: '一级', |
| | | }, |
| | | ]; |
| | | for (let index = 0; index < res.datas.length; index++) { |
| | | const item = res.datas[index]; |
| | | options.push({ |
| | | value: item.refCode, |
| | | label: item.name, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | 'stairList.options': options, |
| | | 'stairList.value': this.data.stairCode, |
| | | }); |
| | | }); |
| | | }, |
| | | // 获取一级分类下二级分类 |
| | | getSecondList(path) { |
| | | const options = []; |
| | | const query = { |
| | | path, |
| | | filterList: [], |
| | | queryType: '\\', |
| | | searchList: [], |
| | | size: '30', |
| | | start: '0', |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' }, |
| | | }; |
| | | app.MG.store.getStoreChannelList(query).then((res) => { |
| | | for (let index = 0; index < res.datas.length; index++) { |
| | | const item = res.datas[index]; |
| | | options.push({ |
| | | value: `${item.pathLinks[0].linkPath}\\${item.id}`, |
| | | label: item.name, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | 'secondList.options': options, |
| | | 'secondList.value': this.data.secondCode, |
| | | }); |
| | | }); |
| | | }, |
| | | // 获取重点项目 |
| | | getProjectList(type) { |
| | | const options = []; |
| | | const arr = []; |
| | | let array = []; |
| | | const query = { |
| | | refCodes: [type], |
| | | }; |
| | | app.MG.store.getProductTypeField(query).then((res) => { |
| | | array = JSON.parse(res[0].config).option; |
| | | for (let index = 0; index < array.length; index++) { |
| | | const element = array[index]; |
| | | if (element.child) { |
| | | for (let index = 0; index < element.child.length; index++) { |
| | | const item = element.child[index]; |
| | | arr.push(item); |
| | | } |
| | | } |
| | | } |
| | | if (type == 'bookClassification') { |
| | | for (let index = 0; index < arr.length; index++) { |
| | | const element = arr[index]; |
| | | options.push({ |
| | | value: element.value, |
| | | label: element.name, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | 'majorProjectList.options': options, |
| | | }); |
| | | } else if (type == 'newFormsTextbooks') { |
| | | for (let index = 0; index < arr.length; index++) { |
| | | const element = arr[index]; |
| | | options.push({ |
| | | value: element.value, |
| | | label: element.name, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | 'newTextBook.options': options, |
| | | }); |
| | | console.log('重点项目', this.data.newTextBook); |
| | | } |
| | | }); |
| | | }, |
| | | // 获取图书列表 |
| | | getBookList(path) { |
| | | let sort; |
| | | let pathObj = {}; |
| | | if (this.data.pathList.length) { |
| | | pathObj = { |
| | | subAccess: this.data.pathList, |
| | | }; |
| | | } else { |
| | | pathObj = { |
| | | path, |
| | | queryType: '*', |
| | | }; |
| | | } |
| | | if (this.data.sort) { |
| | | sort = { |
| | | Name: this.data.sort, |
| | | BaseType: '', |
| | | }; |
| | | } else { |
| | | sort = { |
| | | type: 'Desc', |
| | | field: 'ViewCount', |
| | | }; |
| | | } |
| | | // 搜索 |
| | | let searchObj = {}; |
| | | if (this.data.searchValue) { |
| | | searchObj = { |
| | | 'Name*': this.data.searchValue, |
| | | '||author*': this.data.searchValue, |
| | | '||isbn*': this.data.searchValue, |
| | | '||seriesName*': this.data.searchValue, |
| | | }; |
| | | } |
| | | const query = { |
| | | ...pathObj, |
| | | filterList: [ |
| | | { |
| | | value: 'Normal', |
| | | field: 'state', |
| | | }, |
| | | ], |
| | | sort, |
| | | coverSize: { |
| | | height: 145, |
| | | }, |
| | | paging: { |
| | | start: (this.data.page - 1) * 16, |
| | | size: 16, |
| | | }, |
| | | fields: { |
| | | author: [], |
| | | publicationDate: [], |
| | | ...searchObj, |
| | | 'bookClassification*': this.data.majorProjectList.value, |
| | | 'newFormsTextbooks*': this.data.newTextBook.value, |
| | | }, |
| | | }; |
| | | app.MG.store.getProductList(query).then((res) => { |
| | | this.setData({ |
| | | bookList: res.datas, |
| | | }); |
| | | }); |
| | | }, |
| | | // 一级分类切换 |
| | | onChangeStair(e) { |
| | | const path = e.detail.value.length |
| | | ? `${this.data.assortCheck.code}\\${e.detail.value}` |
| | | : this.data.assortCheck.code; |
| | | this.setData({ |
| | | stairCode: e.detail.value, |
| | | secondCode: '', |
| | | path: path, |
| | | 'stairList.value': e.detail.value, |
| | | }); |
| | | this.getBookList(path); |
| | | this.getSecondList(path); |
| | | }, |
| | | // 二级分类切换 |
| | | onChangeSecond(e) { |
| | | console.log(e); |
| | | const pathList = []; |
| | | for (let index = 0; index < e.detail.value.length; index++) { |
| | | const element = e.detail.value[index]; |
| | | pathList.push({ |
| | | Path: element, |
| | | Type: '*', |
| | | StoreRefCode: app.config.goodsStore, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | pathList: pathList, |
| | | 'secondList.value': e.detail.value, |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | }, |
| | | // 重点项目改变 |
| | | changeMajorProject(e) { |
| | | this.setData({ |
| | | 'majorProjectList.value': e.detail.value, |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | }, |
| | | // 重点项目重置 |
| | | resetMajorProject() { |
| | | this.setData({ |
| | | 'majorProjectList.value': [], |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | }, |
| | | changeNewText(e) { |
| | | this.setData({ |
| | | 'newTextBook.value': e.detail.value, |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | }, |
| | | resetNewText() { |
| | | this.setData({ |
| | | 'newTextBook.value': [], |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | }, |
| | | // 排序按钮 |
| | | sortClick() { |
| | | if (!this.data.sort.length) { |
| | | this.setData({ |
| | | sort: 'Desc', |
| | | }); |
| | | } else if (this.data.sort == 'Desc') { |
| | | this.setData({ |
| | | sort: 'Asc', |
| | | }); |
| | | } else if (this.data.sort == 'Asc') { |
| | | this.setData({ |
| | | sort: '', |
| | | }); |
| | | } |
| | | let path; |
| | | if (this.data.secondCode) { |
| | | path = this.data.secondCode; |
| | | } else if (this.data.stairCode) { |
| | | path = `${this.data.assortCheck.code}\\${this.data.stairCode}`; |
| | | } else { |
| | | path = this.data.assortCheck.code; |
| | | } |
| | | this.setData({ |
| | | path: path, |
| | | }); |
| | | this.getBookList(path); |
| | | }, |
| | | // 搜索图书 |
| | | searchBook(e) { |
| | | console.log(e.detail.value); |
| | | this.setData({ |
| | | searchValue: e.detail.value, |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | }, |
| | | // 跳转图书详情 |
| | | goDetail(e) { |
| | | const { book } = e.currentTarget.dataset; |
| | | wx.navigateTo({ |
| | | url: `/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`, |
| | | }); |
| | | }, |
| | | }); |
New file |
| | |
| | | { |
| | | "usingComponents": { |
| | | "t-dropdown-menu": "tdesign-miniprogram/dropdown-menu/dropdown-menu", |
| | | "t-dropdown-item": "tdesign-miniprogram/dropdown-item/dropdown-item", |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-image": "tdesign-miniprogram/image/image", |
| | | "t-search": "tdesign-miniprogram/search/search" |
| | | }, |
| | | "navigationStyle": "custom" |
| | | } |
New file |
| | |
| | | <!-- 图书服务-列表 --> |
| | | <view style="width: 100%; height: {{barHeight}}px;"></view> |
| | | |
| | | <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> |
| | | <view> |
| | | <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> |
| | | </view> |
| | | <t-search |
| | | model:value="{{searchValue}}" |
| | | shape="round" |
| | | placeholder="请输入关键词/书名/ISBN/作者" |
| | | class="navBar-search" |
| | | style="width: 464rpx" |
| | | bind:submit="searchBook" |
| | | /> |
| | | </view> |
| | | |
| | | <view class="bookServices-list"> |
| | | <view class="list-header"> |
| | | <scroll-view scroll-x="{{true}}" class="header-scroll"> |
| | | <t-dropdown-menu> |
| | | <t-dropdown-item options="{{stairList.options}}" value="{{stairList.value}}" bindchange="onChangeStair" /> |
| | | <t-dropdown-item |
| | | label="二级" |
| | | options="{{secondList.options}}" |
| | | optionsColumns="2" |
| | | multiple |
| | | defaultValue="{{secondList.value}}" |
| | | bind:confirm="onChangeSecond" |
| | | /> |
| | | <t-dropdown-item |
| | | label="重点项目" |
| | | options="{{majorProjectList.options}}" |
| | | optionsColumns="2" |
| | | multiple |
| | | defaultValue="{{majorProjectList.value}}" |
| | | bind:confirm="changeMajorProject" |
| | | bind:reset="resetMajorProject" |
| | | /> |
| | | <t-dropdown-item |
| | | label="新形态教材" |
| | | options="{{newTextBook.options}}" |
| | | optionsColumns="2" |
| | | multiple |
| | | defaultValue="{{newTextBook.value}}" |
| | | bind:confirm="changeNewText" |
| | | bind:reset="resetNewText" |
| | | /> |
| | | </t-dropdown-menu> |
| | | </scroll-view> |
| | | <view class="header-sort" bind:tap="sortClick"> |
| | | <view class="sort-name">排序</view> |
| | | <view class="sort-icon"> |
| | | <t-icon name="swap-left" size="24rpx" class="icon-right" color="{{sort == 'Asc' ? '#ff6c00' : ''}}" /> |
| | | <t-icon name="swap-left" size="24rpx" class="icon-left" color="{{sort == 'Desc' ? '#ff6c00' : ''}}" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <scroll-view scroll-y="{{true}}" class="list-container"> |
| | | <view class="assort-title"> |
| | | <view class="title-box"></view> |
| | | <view class="title-name">{{assortCheck.name}}</view> |
| | | </view> |
| | | <view class="book-list"> |
| | | <view class="book-box" wx:for="{{bookList}}" wx:key="id" bind:tap="goDetail" data-book="{{item}}"> |
| | | <view class="book-img"> |
| | | <t-image src="{{item.icon}}" width="105" height="145" aria-label="{item.name{}}" /> |
| | | </view> |
| | | <view class="book-name book-color">{{ item.name}}</view> |
| | | <view class="book-author book-color">{{item.author}}</view> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
New file |
| | |
| | | /* pages/bookServices/list/index.wxss */ |
| | | page { |
| | | background-color: #f7f7f7; |
| | | } |
| | | |
| | | .nacigationBar { |
| | | display: flex; |
| | | align-items: center; |
| | | --td-search-font-size: 28rpx; |
| | | margin-bottom: 30rpx; |
| | | } |
| | | |
| | | .list-header { |
| | | display: flex; |
| | | } |
| | | |
| | | .header-sort { |
| | | background-color: #fff; |
| | | line-height: 96rpx; |
| | | width: 150rpx; |
| | | font-size: 28rpx; |
| | | color: #999; |
| | | display: flex; |
| | | } |
| | | |
| | | .header-scroll { |
| | | width: 80vw; |
| | | } |
| | | |
| | | .sort-icon { |
| | | transform: rotate(90deg); |
| | | position: relative; |
| | | } |
| | | |
| | | .sort-icon .icon-left { |
| | | transform: rotate(180deg); |
| | | } |
| | | |
| | | .list-container { |
| | | height: 80vh; |
| | | margin-top: 20rpx; |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .assort-title { |
| | | padding: 20rpx 0; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .assort-title .title-box { |
| | | width: 8rpx; |
| | | height: 60rpx; |
| | | background-color: #ff6c00; |
| | | } |
| | | |
| | | .assort-title .title-name { |
| | | font-size: 32rpx; |
| | | margin-left: 32rpx; |
| | | font-weight: 700; |
| | | } |
| | | |
| | | .book-list { |
| | | padding: 32rpx; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | .book-box { |
| | | box-sizing: border-box; |
| | | width: 48%; |
| | | background-color: #f7f7f7; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | margin-bottom: 40rpx; |
| | | padding: 50rpx 20rpx 32rpx 20rpx; |
| | | box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.16); |
| | | } |
| | | |
| | | .book-box:nth-child(2n) { |
| | | margin-left: 18rpx; |
| | | } |
| | | |
| | | .book-color { |
| | | color: #333; |
| | | } |
| | | |
| | | .book-img image { |
| | | object-fit: contain; |
| | | box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.16); |
| | | } |
| | | |
| | | .book-name { |
| | | margin-top: 24rpx; |
| | | width: 100%; |
| | | font-size: 28rpx; |
| | | font-weight: 700; |
| | | word-break: break-all; |
| | | display: -webkit-box; |
| | | -webkit-line-clamp: 2; |
| | | -webkit-box-orient: vertical; |
| | | overflow: hidden; |
| | | text-align: center; |
| | | } |
| | | |
| | | .book-author { |
| | | margin-top: 16rpx; |
| | | width: 100%; |
| | | font-size: 24rpx; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | text-align: center; |
| | | } |
| | |
| | | { |
| | | "component": true, |
| | | "usingComponents": { |
| | | "price": "/components/price/index", |
| | | "t-icon": "tdesign-miniprogram/icon/icon" |
| | | } |
| | | } |
| | |
| | | import { fetchHome } from '../../services/home/home'; |
| | | import moment from 'moment' |
| | | import { setSessionGuid } from "../../assets/js/userAction" |
| | | const app = getApp() |
| | | Page({ |
| | | data: { |
| | | isWhite: false, |
| | | backUrl: null, |
| | | userInfo: {}, |
| | | tabList: [], //目录 |
| | | pageLoading: false, |
| | | current: 1,//轮播图参数 |
| | |
| | | navigation: { type: 'dots' },//轮播图参数 |
| | | bannerList: [], //轮播图列表 |
| | | specialSubjectList: [],//专题讨论 |
| | | activeItem: 0,//精选课程默认选中 |
| | | courseTypeList: [],//精选课程分类 |
| | | courseList: [], |
| | | bookTypeList: [],//图书类型 |
| | | activeItem1: 0, |
| | | booksList: [], |
| | | textbookList: [] |
| | | readBookList: [], //数字阅读 |
| | | textbookList: [], //数字教材 |
| | | rankingList: []//排行榜 |
| | | }, |
| | | |
| | | goodListPagination: { |
| | | index: 0, |
| | | num: 20, |
| | | }, |
| | | |
| | | privateData: { |
| | | tabIndex: 0, |
| | | }, |
| | | |
| | | onShow() { |
| | | this.getTabBar().init(); |
| | | this.loadHomePage(); |
| | |
| | | |
| | | }, |
| | | |
| | | onLoad() { |
| | | onLoad(options) { |
| | | if (options.backUrl) { |
| | | let backUrl = JSON.parse(decodeURIComponent(options.backUrl)); |
| | | if (backUrl.options) { |
| | | for (let key in backUrl.options) { |
| | | const value = backUrl.options[key] |
| | | backUrl.backUrl += `${key}=${value}&` |
| | | } |
| | | } |
| | | this.setData({ |
| | | backUrl: backUrl.backUrl |
| | | }) |
| | | } |
| | | this.getTestLoginInfo() |
| | | this.init(); |
| | | }, |
| | | |
| | | onReachBottom() { |
| | | }, |
| | | onPullDownRefresh() { |
| | |
| | | }, |
| | | init() { |
| | | this.getSubjectList(); |
| | | this.getCourseList(); |
| | | this.getCourseTypeListList(); |
| | | this.getBookTypeList(); |
| | | this.getReadBookList(); |
| | | this.getTextbookListList(); |
| | | this.getRankingList() |
| | | }, |
| | | // 获取测试登录时的token |
| | | getTestLoginInfo() { |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | wx.login({ |
| | | success: (res) => { |
| | | wx.getUserInfo({ |
| | | success: (infoRes) => { |
| | | app.MG.identity.checkWeChatAppAccount({ |
| | | code: res.code, |
| | | appCode: app.config.appRefCode, |
| | | encryptedData: infoRes.encryptedData, |
| | | iv: infoRes.iv |
| | | }).then(loginRes => { |
| | | if (!loginRes) { |
| | | // wx.navigateTo({ |
| | | // url: "/pages/index/bindInfo/index?code=" + res.code, |
| | | // }); |
| | | } else { |
| | | wx.login({ |
| | | success: (res) => { |
| | | app.MG.identity.loginByWeChatAppCode({ |
| | | code: res.code, |
| | | appRefCode: app.config.appRefCode, |
| | | platform: "weChatApp", |
| | | encryptedData: infoRes.encryptedData, |
| | | iv: infoRes.iv |
| | | }).then(res => { |
| | | if (res && res.status == "Ok") { |
| | | wx.setStorageSync(app.config.tokenKey, res.token); |
| | | setSessionGuid() |
| | | this.getCurrentUserInfo() |
| | | } |
| | | }) |
| | | }, |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | getCurrentUserInfo() { |
| | | app.MG.identity.getCurrentAppUser().then(res => { |
| | | console.log(res, "userInfo"); |
| | | // 用户信息优先级:教师认证 > 微信 > 学生(注册时默认) |
| | | if (res) { |
| | | let defaultUser = {}; |
| | | let WeChatInfo = res.infoList.find((item) => item.type === "WeChat"); |
| | | let phoneNumber = res.secretList.find(i => i.type == 'MobilePhone') |
| | | if (WeChatInfo) { |
| | | defaultUser = { |
| | | nickName: WeChatInfo.name, |
| | | avatarUrl: WeChatInfo.icon, |
| | | weChatId: WeChatInfo.id |
| | | } |
| | | } |
| | | if (phoneNumber) { |
| | | defaultUser.phoneNumber = phoneNumber.credential |
| | | } |
| | | this.setData({ |
| | | userInfo: defaultUser, |
| | | }) |
| | | wx.setStorageSync(app.config.userInfoKey, JSON.stringify(this.data.userInfo)); |
| | | } |
| | | if (this.data.backUrl) { |
| | | wx.navigateTo({ |
| | | url: this.data.backUrl, |
| | | }) |
| | | } else { |
| | | wx.switchTab({ |
| | | url: '/pages/home/home' |
| | | }) |
| | | } |
| | | |
| | | }); |
| | | }, |
| | | getBannerList() { |
| | | const list = [] |
| | |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 3 |
| | | size: 4 |
| | | }, |
| | | fields: { |
| | | liveTime: [], |
| | |
| | | } |
| | | } |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | res.datas.forEach((item) => { |
| | | item.liveTime = item.liveTime ? moment(item.liveTime).format("MM-DD HH:mm:ss") : ''; |
| | | item.startTime = item.startTime ? moment(item.startTime).format("MM-DD HH:mm:ss") : ''; |
| | | item.price = item.price ? item.price.toFixed(2) : item.price; |
| | | }); |
| | | this.setData({ |
| | | specialSubjectList: res.datas |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | //精选课程分类 |
| | | getCourseTypeListList() { |
| | | const data = { |
| | | path: 'jsek_homepageDigitalCourses', |
| | | filterList: [], |
| | | queryType: '\\', |
| | | searchList: [], |
| | | size: '20', |
| | | start: '0', |
| | | storeRefCode: app.config.digitalCourses, |
| | | sort: { type: 'Asc', field: 'LinkOrder' } |
| | | } |
| | | app.MG.store.getStoreChannelList(data).then((res) => { |
| | | if (res.datas && res.datas.length > 0) { |
| | | let dataList = []; |
| | | dataList.push(...res.datas) |
| | | this.setData({ |
| | | courseTypeList: dataList, |
| | | activeItem: 0 |
| | | }) |
| | | this.getCourseList(res.datas[0]) |
| | | } |
| | | }) |
| | | }, |
| | | //精选课程列表 |
| | | getCourseList(item) { |
| | | const obj = { |
| | | storeInfo: "app.config.goodsStore", |
| | | path: 'jsek_homepageDigitalTextbooks', |
| | | path: item.pathList + '\\' + item.id, |
| | | coverSize: { |
| | | width: 260 |
| | | }, |
| | |
| | | } |
| | | } |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | res.datas.forEach((item) => { |
| | | item.price = item.price ? item.price.toFixed(2) : item.price; |
| | | }); |
| | | this.setData({ |
| | | courseList: res.datas |
| | | }) |
| | | }) |
| | | }, |
| | | tabChangeHandle(item) { |
| | | let info = this.data.courseTypeList[item.detail.value] |
| | | this.getCourseList(info) |
| | | }, |
| | | //图书服务分类 |
| | | getBookTypeList() { |
| | | const data = { |
| | | path: 'jsek_homepageBookService', |
| | | filterList: [], |
| | | queryType: '\\', |
| | | searchList: [], |
| | | size: '20', |
| | | start: '0', |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' } |
| | | } |
| | | app.MG.store.getStoreChannelList(data).then((res) => { |
| | | if (res.datas && res.datas.length > 0) { |
| | | let dataList = []; |
| | | dataList.push(...res.datas) |
| | | this.setData({ |
| | | bookTypeList: dataList, |
| | | activeItem1: 0 |
| | | }) |
| | | this.getBooksList(dataList[0]) |
| | | } |
| | | }) |
| | | }, |
| | | //图书服务列表 |
| | | getBooksList(item) { |
| | | const obj = { |
| | | storeInfo: app.config.goodsStore, |
| | | path: item.pathList + '\\' + item.id, |
| | | queryType: '*', |
| | | coverSize: { |
| | | width: 150 |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 6 |
| | | }, |
| | | fields: { |
| | | author: [] |
| | | } |
| | | } |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | this.setData({ |
| | | booksList: res.datas, |
| | | }) |
| | | }) |
| | | }, |
| | | //图书服务 |
| | | tabBookClick(item) { |
| | | let info = this.data.bookTypeList[item.detail.value] |
| | | this.getBooksList(info) |
| | | }, |
| | | //数字阅读 |
| | | getReadBookList() { |
| | | const obj = { |
| | | storeInfo: app.config.digitalTextbooks, |
| | | path: 'jsek_homepageDigitalTextbooks', |
| | | coverSize: { |
| | | width: 150 |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 3 |
| | | }, |
| | | fields: { |
| | | author: [] |
| | | } |
| | | } |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | this.setData({ |
| | | readBookList: res.datas |
| | | }) |
| | | }) |
| | | }, |
| | | //数字教材 |
| | | getTextbookListList() { |
| | | const obj = { |
| | | storeInfo: app.config.digitalTextbooks, |
| | | path: 'jsek_homepageDigitalTextbooks', |
| | | coverSize: { |
| | | width: 150 |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 6 |
| | | }, |
| | | fields: { |
| | | author: [], |
| | | } |
| | | } |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | this.setData({ |
| | | textbookList: res.datas |
| | | }) |
| | | }) |
| | | }, |
| | | //获取排行榜 |
| | | getRankingList() { |
| | | const obj = { |
| | | storeInfo: app.config.digitalTextbooks, |
| | | path: 'jsek_homepageDigitalTextbooks', |
| | | coverSize: { |
| | | width: 150 |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 6 |
| | | }, |
| | | fields: { |
| | | author: [], |
| | | } |
| | | } |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | this.setData({ |
| | | rankingList: res.datas |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | onPageScroll(e) { |
| | | this.setData({ |
| | | isWhite: e.scrollTop > 50 ? true : false |
| | | }) |
| | | |
| | | } |
| | | |
| | | }); |
| | |
| | | { |
| | | "navigationBarTitleText": "首页", |
| | | "navigationStyle": "custom", |
| | | "onReachBottomDistance": 10, |
| | | "backgroundTextStyle": "light", |
| | | "enablePullDownRefresh": true, |
| | |
| | | "goods-list": "/components/goods-list/index", |
| | | "load-more": "/components/load-more/index", |
| | | "t-grid": "tdesign-miniprogram/grid/grid", |
| | | "t-grid-item": "tdesign-miniprogram/grid-item/grid-item" |
| | | "t-grid-item": "tdesign-miniprogram/grid-item/grid-item", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | } |
| | | } |
| | |
| | | <view style="text-align: center; color: #b9b9b9" wx:if="{{pageLoading}}"> |
| | | <t-loading theme="circular" size="40rpx" text="加载中..." inherit-color /> |
| | | </view> |
| | | <view class="background {{ isWhite ? 'white':''}}"> |
| | | <text class="text">京师E课</text> |
| | | </view> |
| | | <view class="home-page-header"> |
| | | <view class="bg"> |
| | | <image src="/static/images/home/home-bg@2x.png" mode="heightFix" class="image" /> |
| | | </view> |
| | | <view class="search"> |
| | | <t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" placeholder="请输入关键词/书名/ISBN/作者" leftIcon=""> |
| | | <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" bind:tap="navToSearchPage" /> |
| | |
| | | <view class="icon"> |
| | | <t-image src="/static/images/home/zhuantitaolun.png" mode="heightFix" class="iconImage" /> |
| | | </view> |
| | | <view bindtap="onMoreGuide"> |
| | | <view bindtap="onMoreGuide" class="flex"> |
| | | <text class="more">更多</text> |
| | | <t-icon name="chevron-right" size="32rpx" color="#ff6d00" /> |
| | | </view> |
| | | </view> |
| | | <view> |
| | | <view wx:for="{{specialSubjectList}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toList" data-info="{{item}}"> |
| | | <view class="specialSubject-img"> |
| | | <t-image src="{{item.icon}}" mode="aspectFill" width="50" height="50" /> |
| | | </view> |
| | | <view class="body-info"> |
| | | <view>{{item.name}}</view> |
| | | <view class="listBox"> |
| | | <view wx:for="{{specialSubjectList}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toList" data-info="{{item}}" class="listItemBox"> |
| | | <view class="listItem"> |
| | | <view class="specialSubject-img"> |
| | | <image src="{{item.icon}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="body-info"> |
| | | <view class="name">{{item.name}}</view> |
| | | <view class="time" wx:if="{{item.liveTime}}">直播时间:<text>{{item.liveTime}}</text></view> |
| | | <view class="time" wx:if="{{item.startTime}}">开播时间:<text>{{ item.startTime }}</text></view> |
| | | <view class="time" wx:if="{{!item.liveTime && !item.startTime}}">开播时间:<text class="grey">待定</text></view> |
| | | <view class="flex jc-sb"> |
| | | <text class="author">{{item.lecturer}}</text> |
| | | <text class="price" wx:if="{{item.price == 0}}">免费</text> |
| | | <text class="price" wx:if="{{item.price !== 0}}">¥{{item.price}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view class="tabCardPublic"> |
| | | <view class="icon"> |
| | | <t-image src="/static/images/home/jingxuankecheng@2x.png" mode="heightFix" class="iconImage" /> |
| | | </view> |
| | | <view bindtap="onMoreGuide" class="flex"> |
| | | <text class="more">更多</text> |
| | | <t-icon name="chevron-right" size="32rpx" color="#ff6d00" /> |
| | | </view> |
| | | </view> |
| | | <view class="home-page-tabs"> |
| | | <t-tabs t-class="t-tabs" t-class-active="tabs-external__active" t-class-item="tabs-external__item" defaultValue="{{activeItem}}" space-evenly="{{false}}" bind:change="tabChangeHandle"> |
| | | <t-tab-panel wx:for="{{courseTypeList}}" wx:for-index="index" wx:key="index" label="{{item.name}}" value="{{index}}" /> |
| | | </t-tabs> |
| | | </view> |
| | | <view class="listBox1"> |
| | | <view wx:if="{{courseList.length>0}}"> |
| | | <view wx:for="{{courseList}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toList" data-info="{{item}}" class="listItemBox"> |
| | | <view class="listItem flex"> |
| | | <view class="specialSubject-img"> |
| | | <image src="{{item.icon}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="body-info"> |
| | | <view class="name">{{item.name}}</view> |
| | | <view class="flex jc-sb"> |
| | | <text class="author">{{item.courseLeader}}</text> |
| | | <text>{{item.classHours}}课时</text> |
| | | </view> |
| | | <view class="priceBox flex jc-sb"> |
| | | <text class="price" wx:if="{{item.price == 0}}">免费</text> |
| | | <text class="price" wx:if="{{item.price !== 0}}">¥{{item.price}}</text> |
| | | <image src="/static/images/home/home-cart.png" mode="aspectFill" class="addCartImg" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="empyt" wx:else> |
| | | <t-empty icon="folder-open" description="暂无数据" font-size="80" /> |
| | | </view> |
| | | </view> |
| | | <view class="tabCardPublic"> |
| | | <view class="icon"> |
| | | <t-image src="/static/images/home/tushufuwu@2x.png" mode="heightFix" class="iconImage" /> |
| | | </view> |
| | | <view bindtap="onMoreGuide" class="flex"> |
| | | <text class="more">更多</text> |
| | | <t-icon name="chevron-right" size="32rpx" color="#ff6d00" /> |
| | | </view> |
| | | </view> |
| | | <view class="home-page-tabs"> |
| | | <t-tabs t-class="t-tabs" t-class-active="tabs-external__active" t-class-item="tabs-external__item" defaultValue="{{activeItem1}}" space-evenly="{{false}}" bind:change="tabBookClick"> |
| | | <t-tab-panel wx:for="{{bookTypeList}}" wx:for-index="index" wx:key="index" label="{{item.name}}" value="{{index}}" /> |
| | | </t-tabs> |
| | | </view> |
| | | <view class="listBox2"> |
| | | <view wx:if="{{booksList.length > 0}}" class="flex"> |
| | | <view wx:for="{{booksList}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toList" data-info="{{item}}" class="booksListItemBox"> |
| | | <view class="listItem"> |
| | | <view class="specialSubject-img"> |
| | | <image src="{{item.icon}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="body-info"> |
| | | <view class="name">{{item.name}}</view> |
| | | <view class="author">{{item.author}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="empyt" wx:else> |
| | | <t-empty icon="folder-open" description="暂无数据" font-size="80" /> |
| | | </view> |
| | | </view> |
| | | <view class="tabCardPublic"> |
| | | <view class="icon"> |
| | | <t-image src="/static/images/home/shuziyuedu1@2x.png" mode="heightFix" class="iconImage" /> |
| | | </view> |
| | | <view bindtap="onMoreGuide" class="flex"> |
| | | <text class="more">更多</text> |
| | | <t-icon name="chevron-right" size="32rpx" color="#ff6d00" /> |
| | | </view> |
| | | </view> |
| | | <view class="listBox2 flex"> |
| | | <view wx:for="{{readBookList}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toList" data-info="{{item}}" class="booksListItemBox"> |
| | | <view class="listItem"> |
| | | <view class="specialSubject-img"> |
| | | <image src="{{item.icon}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="body-info"> |
| | | <view class="name">{{item.name}}</view> |
| | | <view class="author">{{item.author}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="tabCardPublic"> |
| | | <view class="icon"> |
| | | <t-image src="/static/images/home/shuzijiaocai1@2x.png" mode="heightFix" class="iconImage" /> |
| | | </view> |
| | | <view bindtap="onMoreGuide" class="flex"> |
| | | <text class="more">更多</text> |
| | | <t-icon name="chevron-right" size="32rpx" color="#ff6d00" /> |
| | | </view> |
| | | </view> |
| | | <view class="listBox3"> |
| | | <view wx:if="{{textbookList.length > 0}}" class="listBox3"> |
| | | <view wx:for="{{textbookList}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toList" data-info="{{item}}" class="textbooksItemBox"> |
| | | <view class="listItem flex"> |
| | | <view class="specialSubject-img"> |
| | | <image src="{{item.icon}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="body-info"> |
| | | <view class="name">{{item.name}}</view> |
| | | <view class="introduction">{{item.description}}</view> |
| | | <view class="author">{{item.author}}</view> |
| | | <view class="priceBox flex jc-sb"> |
| | | <text class="price" wx:if="{{item.price == 0}}">免费</text> |
| | | <text class="price" wx:if="{{item.price !== 0}}">¥{{item.price}}</text> |
| | | <image src="/static/images/home/home-cart.png" mode="aspectFill" class="addCartImg" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="empyt" wx:else> |
| | | <t-empty icon="folder-open" description="暂无数据" font-size="80" /> |
| | | </view> |
| | | </view> |
| | | <view class="tabCardPublic"> |
| | | <view class="icon"> |
| | | <t-image src="/static/images/home/paihangbang@2x.png" mode="heightFix" class="iconImage" /> |
| | | </view> |
| | | <view bindtap="onMoreGuide" class="flex"> |
| | | <text class="more">更多</text> |
| | | <t-icon name="chevron-right" size="32rpx" color="#ff6d00" /> |
| | | </view> |
| | | </view> |
| | | <view class="listBox2 rankingList flex"> |
| | | <view wx:for="{{rankingList}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toList" data-info="{{item}}" class="booksListItemBox"> |
| | | <view class="listItem"> |
| | | <view class="specialSubject-img"> |
| | | <image src="{{item.icon}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="body-info"> |
| | | <view class="name">{{item.name}}</view> |
| | | <view class="author">{{item.author}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <load-more list-is-empty="{{!goodsList.length}}" status="{{goodsListLoadStatus}}" bind:retry="onReTry" /> |
| | | <t-toast id="t-toast" /> |
| | |
| | | padding-bottom: calc(env(safe-area-inset-bottom) + 96rpx); |
| | | } |
| | | |
| | | .home-page-header { |
| | | position: relative; |
| | | } |
| | | |
| | | .home-page-header .search { |
| | | position: absolute; |
| | | top: 20rpx; |
| | | left: 0; |
| | | .background { |
| | | width: 100%; |
| | | z-index: 99; |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | height: 80rpx; |
| | | z-index: 3; |
| | | text-align: center; |
| | | padding-top: 110rpx; |
| | | color: #fff; |
| | | font-size: 36rpx; |
| | | } |
| | | |
| | | .home-page-header .t-search__input-container { |
| | | border-radius: 15rpx !important; |
| | | margin: 0 24rpx; |
| | | height: 64rpx !important; |
| | | .white { |
| | | background: #fff; |
| | | color: #333; |
| | | } |
| | | |
| | | .background .text { |
| | | height: 100%; |
| | | } |
| | | |
| | | .home-page-header, |
| | | .home-page-menu, |
| | | .home-page-container { |
| | | position: relative; |
| | | padding: 0 24rpx; |
| | | } |
| | | |
| | | .home-page-header { |
| | | padding-top: 230rpx; |
| | | } |
| | | |
| | | .home-page-header .bg { |
| | | height: 680rpx; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | z-index: -1; |
| | | } |
| | | |
| | | .home-page-header .bg .image { |
| | | height: 100%; |
| | | } |
| | | |
| | | .home-page-header .search .t-search__input-container { |
| | | height: 96rpx; |
| | | background: #fff !important; |
| | | font-size: 28rpx !important; |
| | | } |
| | | |
| | | .home-page-header .t-search__input { |
| | |
| | | color: rgb(116, 116, 116) !important; |
| | | } |
| | | |
| | | .home-page-header .swiper-wrap .t-swiper-host { |
| | | border-radius: 0; |
| | | .home-page-header .swiper-wrap { |
| | | margin-top: 30rpx; |
| | | margin-bottom: 10rpx; |
| | | } |
| | | |
| | | .home-page-header .t-image__swiper { |
| | | width: 100%; |
| | | height: 300rpx; |
| | | .home-page-menu .t-grid--card { |
| | | margin: 0; |
| | | } |
| | | |
| | | .flex { |
| | | display: flex; |
| | | } |
| | | |
| | | .jc-sb { |
| | | justify-content: space-between |
| | | } |
| | | |
| | | .home-page-container { |
| | | margin-top: 20rpx; |
| | | display: block; |
| | | padding: 0 24rpx; |
| | | } |
| | |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 20rpx 5rpx; |
| | | margin: 20rpx 5rpx; |
| | | box-sizing: border-box; |
| | | border-bottom: 2rpx solid #fadfbc; |
| | | } |
| | | |
| | | .tabCardPublic .icon { |
| | | width: 246rpx; |
| | | height: 72rpx; |
| | | width: 156rpx; |
| | | height: 48rpx; |
| | | } |
| | | |
| | | .tabCardPublic .icon .t-image { |
| | |
| | | |
| | | .tabCardPublic .more { |
| | | font-size: 24rpx; |
| | | color: #999; |
| | | color: #ff6d00; |
| | | } |
| | | |
| | | .listBox { |
| | | padding: 20rpx 0; |
| | | display: flex; |
| | | flex-flow: row wrap; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .listBox .listItemBox { |
| | | width: 49%; |
| | | margin-bottom: 30rpx; |
| | | } |
| | | |
| | | .listItemBox .listItem { |
| | | background: #fff; |
| | | box-sizing: border-box; |
| | | border-radius: 5px; |
| | | overflow: hidden; |
| | | box-shadow: 0px 0px 20rpx 2px #f1f1f1; |
| | | } |
| | | |
| | | .listBox .specialSubject-img { |
| | | width: 100%; |
| | | height: 120rpx; |
| | | } |
| | | |
| | | .specialSubject-img image { |
| | | width: 100%; |
| | | height: 100%; |
| | | object-fit: contain; |
| | | } |
| | | |
| | | .body-info { |
| | | padding: 20rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .body-info .name { |
| | | font-size: 32rpx; |
| | | height: 88rpx; |
| | | color: #333333; |
| | | font-weight: bold; |
| | | line-height: 44rpx; |
| | | display: -webkit-box; |
| | | margin-bottom: 10rpx; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .body-info .time { |
| | | font-size: 26rpx; |
| | | margin-bottom: 10rpx; |
| | | } |
| | | |
| | | .body-info .author { |
| | | font-size: 26rpx; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .body-info .price { |
| | | font-size: 26rpx; |
| | | color: #ff6d00; |
| | | } |
| | | |
| | | .t-tabs .t-tabs__item--active { |
| | | color: #ff6d00; |
| | | font-size: 30rpx; |
| | | /* background-image: url('/static/images/home/click-icon@2x.png'); */ |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | /* 确保背景图像不会被拉伸 */ |
| | | /* background-position: right; */ |
| | | } |
| | | |
| | | .t-tabs .t-tabs__track { |
| | | display: none; |
| | | } |
| | | |
| | | .t-tabs .t-tabs--top .t-tabs__scroll { |
| | | border-bottom: none !important; |
| | | } |
| | | |
| | | .t-tabs .t-tabs-scroll { |
| | | border: none !important; |
| | | } |
| | | |
| | | .listBox1, |
| | | .listBox2 { |
| | | padding: 50rpx 0; |
| | | } |
| | | |
| | | .listBox1 .listItemBox { |
| | | height: 220rpx; |
| | | margin-bottom: 30rpx; |
| | | } |
| | | |
| | | .listBox1 .specialSubject-img { |
| | | width: 400rpx; |
| | | height: 218rpx; |
| | | } |
| | | |
| | | .listBox1 .addCartImg, |
| | | .listBox3 .addCartImg { |
| | | width: 30rpx; |
| | | height: 30rpx; |
| | | } |
| | | |
| | | .listBox1 .priceBox { |
| | | margin-top: 14rpx; |
| | | } |
| | | |
| | | .listBox2 { |
| | | flex-flow: row wrap; |
| | | } |
| | | |
| | | .listBox2 .flex { |
| | | flex-flow: row wrap; |
| | | } |
| | | |
| | | .listBox2 .booksListItemBox { |
| | | width: calc(100%/3 - 30rpx); |
| | | margin-bottom: 30rpx; |
| | | margin-right: 45rpx; |
| | | } |
| | | |
| | | .listBox2 :nth-child(3), |
| | | .listBox2 :nth-child(6) { |
| | | margin-right: 0; |
| | | } |
| | | |
| | | .listBox2 .specialSubject-img { |
| | | height: 300rpx; |
| | | width: 100%; |
| | | box-shadow: 0px 0px 20rpx 2px #f1f1f1; |
| | | } |
| | | |
| | | .listBox2 .body-info { |
| | | padding: 20rpx 0; |
| | | } |
| | | |
| | | .listBox2 .author { |
| | | height: 30rpx; |
| | | color: #333333; |
| | | font-weight: bold; |
| | | line-height: 30rpx; |
| | | display: -webkit-box; |
| | | margin-bottom: 10rpx; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 1; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .listBox2 .empyt { |
| | | padding: 20rpx; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .listBox3 .textbooksItemBox { |
| | | margin-bottom: 30rpx; |
| | | } |
| | | |
| | | .listBox3 .textbooksItemBox .specialSubject-img { |
| | | width: 190rpx; |
| | | height: 260rpx; |
| | | box-shadow: 0px 0px 20rpx 2px #f1f1f1; |
| | | } |
| | | |
| | | .listBox3 .body-info { |
| | | width: calc(100% - 190rpx); |
| | | } |
| | | |
| | | .listBox3 .name { |
| | | font-size: 32rpx; |
| | | height: 44rpx; |
| | | color: #333333; |
| | | font-weight: bold; |
| | | line-height: 44rpx; |
| | | display: -webkit-box; |
| | | margin-bottom: 10rpx; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 1; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .listBox3 .introduction { |
| | | color: #B4B6BD; |
| | | line-height: 36rpx; |
| | | display: -webkit-box; |
| | | margin-bottom: 10rpx; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .listBox3 .author { |
| | | line-height: 40rpx; |
| | | margin-bottom: 30rpx; |
| | | } |
| | | |
| | | .readList { |
| | | overflow: auto; |
| | | } |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(options); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "navigationBarTitleText": "激活商品", |
| | | "usingComponents": {} |
| | | } |
| | |
| | | // pages/personalCenter/certificate/index.js |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(options); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "navigationBarTitleText": "我的证书", |
| | | "usingComponents": {} |
| | | } |
| | |
| | | <!--pages/personalCenter/certificate/index.wxml--> |
| | | <text>pages/personalCenter/certificate/index.wxml</text> |
| | | <text>pages/personalCenter/certificate/index.wxml</text> |
New file |
| | |
| | | const AuthStepType = { |
| | | ONE: 1, |
| | | TWO: 2, |
| | | THREE: 3, |
| | | }; |
| | | |
| | | Component({ |
| | | options: { |
| | | multipleSlots: true, |
| | | }, |
| | | properties: { |
| | | currAuthStep: { |
| | | type: Number, |
| | | value: AuthStepType.ONE, |
| | | }, |
| | | userInfo: { |
| | | type: Object, |
| | | value: {}, |
| | | }, |
| | | isNeedGetUserInfo: { |
| | | type: Boolean, |
| | | value: false, |
| | | }, |
| | | }, |
| | | data: { |
| | | defaultAvatarUrl: |
| | | 'https://cdn-we-retail.ym.tencent.com/miniapp/usercenter/icon-user-center-avatar@2x.png', |
| | | AuthStepType, |
| | | }, |
| | | methods: { |
| | | gotoUserEditPage() { |
| | | this.triggerEvent('gotoUserEditPage'); |
| | | }, |
| | | }, |
| | | }); |
New file |
| | |
| | | { |
| | | "component": true, |
| | | "usingComponents": { |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-avatar": "tdesign-miniprogram/avatar/avatar" |
| | | } |
| | | } |
| | |
| | | .user-center-card { |
| | | background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png'); |
| | | /* background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png'); */ |
| | | background-size: cover; |
| | | background-repeat: no-repeat; |
| | | padding: 0 24rpx; |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(options); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "navigationBarTitleText": "我的下载", |
| | | "usingComponents": {} |
| | | } |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(options); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "navigationBarTitleText": "建议与反馈", |
| | | "usingComponents": {} |
| | | } |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(options); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "navigationBarTitleText": "意见反馈", |
| | | "usingComponents": {} |
| | | } |
| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | isWhite: false, |
| | | show: false, |
| | | userInfo: { |
| | | avatarUrl: |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | console.log(options); |
| | | }, |
| | | |
| | | |
| | |
| | | */ |
| | | onShareAppMessage() { |
| | | |
| | | }, |
| | | |
| | | onPageScroll(e) { |
| | | this.setData({ |
| | | isWhite: e.scrollTop > 50 ? true : false |
| | | }) |
| | | |
| | | } |
| | | }) |
| | |
| | | { |
| | | "usingComponents": {} |
| | | "navigationBarTitleText": "个人中心", |
| | | "navigationStyle": "custom", |
| | | "usingComponents": { |
| | | "t-user-center-card": "./components/user-center-card/index", |
| | | "t-image": "/components/webp-image/index" |
| | | }, |
| | | "enablePullDownRefresh": true |
| | | } |
| | |
| | | <!--pages/personalCenter/index.wxml--> |
| | | <text>pages/personalCenter/index.wxml</text> |
| | | <view class="background {{ isWhite ? 'white':''}}"> |
| | | <text class="text">个人中心</text> |
| | | </view> |
| | | <view class="home-page"> |
| | | <view class="bg"> |
| | | <image src="/static/images/personal/my-bg.png" mode="heightFix" class="image" /> |
| | | </view> |
| | | <image class="background" src="/static/images/personal/my-bg.png" mode="heightFix" /> |
| | | <t-user-center-card userInfo="{{userInfo}}" isPhoneHide="{{true}}" name-class="custom-name-class" phone-class="custom-phone-class" avatar-class="customer-avatar-class" currAuthStep="{{currAuthStep}}" bind:gotoUserEditPage="gotoUserEditPage" /> |
| | | <view class="content-wrapper"> |
| | | <view class="topBox"> |
| | | <view class="teacherBox"> |
| | | <view> |
| | | <view class="wait" wx:if="{{teacherState.state == 'WaitAudit'}}">等待审核</view> |
| | | <view class="yes" wx:if="{{teacherState.state == 'Normal'}}">已认证</view> |
| | | <view class="no" wx:if="{{teacherState.state == 'Reject'}}">已驳回</view> |
| | | <view class="wait" wx:if="{{teacherState.state == ''}}">待认证</view> |
| | | <view class="title"><text>教师认证</text> |
| | | <text class="change-info" wx:if="{{teacherState.state == ''}}">认证</text> |
| | | <text class="change-info" wx:if="{{teacherState.state == 'Normal' || teacherState.state == 'Reject'}}">修改</text> |
| | | </view> |
| | | </view> |
| | | <view> |
| | | <view>{{integral}}</view> |
| | | <view class="title">积分</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="domainBox"> |
| | | <view class="title"> |
| | | <text>常用功能</text> |
| | | </view> |
| | | <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" /> |
| | | </view> |
| | | <view class="label"> |
| | | <text>{{item.title}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="domainBox"> |
| | | <view class="title"> |
| | | <text>更多功能</text> |
| | | </view> |
| | | <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" /> |
| | | </view> |
| | | <view class="label"> |
| | | <text>{{item.title}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <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" /> |
| | | </view> |
| | | <view class="label"> |
| | | <text>{{item.title}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | /* pages/personalCenter/index.wxss */ |
| | | page { |
| | | background-color: #f0f2f5; |
| | | box-sizing: border-box; |
| | | padding-bottom: calc(env(safe-area-inset-bottom) + 96rpx); |
| | | } |
| | | |
| | | .background { |
| | | width: 100%; |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | height: 80rpx; |
| | | z-index: 3; |
| | | text-align: center; |
| | | padding-top: 110rpx; |
| | | font-size: 36rpx; |
| | | } |
| | | |
| | | .white { |
| | | background: #fff; |
| | | color: #333; |
| | | } |
| | | |
| | | .home-page .bg { |
| | | height: 780rpx; |
| | | width: 100%; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | z-index: -1; |
| | | } |
| | | |
| | | .home-page .bg .image { |
| | | height: 100%; |
| | | } |
| | | |
| | | .content-wrapper { |
| | | position: relative; |
| | | padding: 30rpx; |
| | | } |
| | | |
| | | .topBox { |
| | | width: 100%; |
| | | background-color: #fff; |
| | | border-radius: 20rpx; |
| | | box-shadow: 0px 0px 20rpx 2px #f1f1f1; |
| | | } |
| | | |
| | | .teacherBox { |
| | | display: flex; |
| | | padding: 40rpx 20rpx; |
| | | justify-content: space-around; |
| | | text-align: center; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .teacherBox .title { |
| | | margin-top: 20rpx; |
| | | line-height: 40rpx; |
| | | } |
| | | |
| | | .teacherBox .change-info { |
| | | color: #ff6d00; |
| | | margin-left: 20rpx; |
| | | } |
| | | |
| | | .wait { |
| | | color: #ff6d00; |
| | | } |
| | | |
| | | .no { |
| | | color: #EE1818 |
| | | } |
| | | |
| | | .yes { |
| | | color: #1FBC1F |
| | | } |
| | | |
| | | .domainBox { |
| | | width: 100%; |
| | | margin: 20rpx auto; |
| | | background-color: #fff; |
| | | border-radius: 20rpx; |
| | | box-shadow: 0px 0px 20rpx 2px #f1f1f1; |
| | | } |
| | | |
| | | .domainBox .title { |
| | | font-weight: bold; |
| | | padding: 30rpx; |
| | | } |
| | | |
| | | .domainList { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: center; |
| | | padding-bottom: 30rpx; |
| | | } |
| | | |
| | | .domainList1 { |
| | | /* width: 100%; */ |
| | | display: flex; |
| | | /* flex-wrap: wrap; */ |
| | | border-bottom: 2rpx solid #f1f1f1; |
| | | margin: 0 30rpx; |
| | | } |
| | | |
| | | .domainList2 { |
| | | display: flex; |
| | | margin: 0 30rpx; |
| | | } |
| | | |
| | | .listItem { |
| | | width: 160rpx; |
| | | min-width: 160rpx; |
| | | flex-shrink: 0; |
| | | padding: 30rpx 0; |
| | | } |
| | | |
| | | .listItem .icon { |
| | | width: 46rpx; |
| | | height: 46rpx; |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .listItem .icon .t-image { |
| | | width: 100%; |
| | | height: 100%; |
| | | object-fit: contain; |
| | | } |
| | | |
| | | .listItem .label { |
| | | width: 100%; |
| | | font-size: 28rpx; |
| | | line-height: 40rpx; |
| | | text-align: center; |
| | | margin-top: 20rpx; |
| | | } |
| | |
| | | // pages/personalCenter/myCollection/index.js |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(options); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "navigationBarTitleText": "我的收藏", |
| | | "usingComponents": {} |
| | | } |
| | |
| | | <!--pages/personalCenter/myCollection/index.wxml--> |
| | | <text>pages/personalCenter/myCollection/index.wxml</text> |
| | | <text>我的收藏</text> |
| | |
| | | */ |
| | | onLoad(options) { |
| | | this.getDataList(false); |
| | | console.log(options); |
| | | }, |
| | | |
| | | getDataList(isReachBottom) { |
| | |
| | | { |
| | | "usingComponents": {} |
| | | "navigationBarTitleText": "我的消息", |
| | | "usingComponents": { |
| | | "t-back-top": "tdesign-miniprogram/back-top/back-top", |
| | | "t-image": "tdesign-miniprogram/image/image", |
| | | "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | } |
| | | } |
| | |
| | | // pages/personalCenter/myOrder/index.js |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(options); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "navigationBarTitleText": "我的订单", |
| | | "usingComponents": {} |
| | | } |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(options); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "navigationBarTitleText": "出书申请", |
| | | "usingComponents": {} |
| | | } |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(options); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "navigationBarTitleText": "样书申请", |
| | | "usingComponents": {} |
| | | } |
| | |
| | | // pages/teacherCertification/index.js |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(options); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "navigationBarTitleText": "教师认证", |
| | | "enablePullDownRefresh": true, |
| | | "backgroundTextStyle": "light", |
| | | "usingComponents": {} |
| | | } |
| | |
| | | <!--pages/teacherCertification/index.wxml--> |
| | | <text>pages/teacherCertification/index.wxml</text> |
| | | <view class="container"> |
| | | <view class="tips"> 仅限学校本课程任课教师申请;请上传有效在职教师工作证将有助于审核。 </view> |
| | | <view class="page-body"> |
| | | <form catchsubmit="formSubmit" catchreset="formReset" class="formBox"> |
| | | <view class="from-item"> |
| | | <view class="label"> 当前状态: </view> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="input" placeholder="" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 学校: </view> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="input" placeholder="请输入学校" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 真实姓名: </view> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="input" placeholder="请输入真实姓名" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 职称: </view> |
| | | <view class="item-content"> |
| | | <!-- <input class="weui-input" name="input" placeholder="请选择职称" /> --> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 任教课程: </view> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="input" placeholder="请输入任教课程" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 手机号: </view> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="input" placeholder="请输入手机号" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 座机: </view> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="input" placeholder="请输入座机" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 邮箱: </view> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="input" placeholder="请输入邮箱" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 详细地址: </view> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="input" placeholder="请输入详细地址" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 在职教师工作证: </view> |
| | | <view class="item-content"> </view> |
| | | </view> |
| | | <view class="btn-area"> |
| | | <button class="submit" formType="submit">提交</button> |
| | | </view> |
| | | </form> |
| | | </view> |
| | | </view> |
| | |
| | | /* pages/teacherCertification/index.wxss */ |
| | | .tips { |
| | | line-height: 24px; |
| | | font-size: 28rpx; |
| | | padding: 5px; |
| | | background: rgba(255, 108, 0, 0.1); |
| | | color: #ff6c00; |
| | | text-align: center; |
| | | margin: 0 auto 20px auto; |
| | | } |
| | | |
| | | .page-body { |
| | | padding: 20rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .from-item { |
| | | margin-bottom: 20rpx; |
| | | display: flex; |
| | | } |
| | | |
| | | .from-item .label { |
| | | width: 240rpx; |
| | | height: 68rpx; |
| | | line-height: 68rpx; |
| | | } |
| | | |
| | | .from-item .item-content { |
| | | width: 56%; |
| | | border: 2rpx solid #D9D9D9; |
| | | padding: 10rpx; |
| | | } |
| | | |
| | | .submit { |
| | | background: #ff6c00; |
| | | color: #fff; |
| | | } |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(options); |
| | | }, |
| | | |
| | | /** |
| | |
| | | overflow: hidden; |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | .icon-color { |
| | | color: #aaa; |
| | | } |
| | | |
| | | .cell-class { |
| | | height: 100rpx; |
| | | display: flex; |
| | |
| | | -ms-transform: translate(-50%, -50%); |
| | | transform: translate(-50%, -50%); |
| | | } |
| | | |
| | | .order-content-t { |
| | | margin-top: 10rpx; |
| | | font-size: 24rpx; |
| | |
| | | margin-bottom: env(safe-area-inset-bottom); |
| | | border-radius: 16rpx 16rpx 0 0; |
| | | } |
| | | |
| | | .popup-content .popup-title { |
| | | background: #fff; |
| | | text-align: center; |
| | |
| | | transform-origin: left top; |
| | | border-bottom: 2rpx solid #e5e5e5; |
| | | } |
| | | |
| | | .popup-content .popup-phone, |
| | | .popup-content .popup-close { |
| | | background: #fff; |
| | |
| | | font-weight: 400; |
| | | color: #333; |
| | | } |
| | | |
| | | .popup-content .popup-phone.online { |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | .popup-content .popup-phone.online::after { |
| | | content: none; |
| | | } |
| | | |
| | | .popup-content .popup-close { |
| | | color: #333; |
| | | border: 0; |
| | |
| | | font-size: 24rpx; |
| | | line-height: 32rpx; |
| | | } |
| | | |
| | | .cell-box .order-group__left { |
| | | margin-right: 0; |
| | | } |
| | | |
| | | .cell-box .t-cell-padding { |
| | | padding: 24rpx 18rpx 24rpx 32rpx; |
| | | } |
| | | } |
| | |
| | | { |
| | | text: '图书服务', |
| | | key: 0, |
| | | icon: '/static/images/home/1.png', |
| | | url: '/pages/bookServices/index', |
| | | icon: '/static/images/home/zhutichuban@2x.png', |
| | | url: '/pages/bookServices/assort/index.wxml', |
| | | }, |
| | | { |
| | | text: '数字阅读', |
| | | key: 1, |
| | | icon: '', |
| | | icon: '/static/images/home/shuziyuedu@2x.png', |
| | | url: '', |
| | | }, |
| | | { |
| | | text: '数字课程', |
| | | key: 2, |
| | | icon: "", |
| | | icon: '/static/images/home/shuzikecheng@2x.png', |
| | | url: '', |
| | | }, |
| | | { |
| | | text: '数字教材', |
| | | key: 3, |
| | | icon: "", |
| | | icon: '/static/images/home/shuzijiaocai@2x.png', |
| | | url: '', |
| | | }, |
| | | { |
| | | text: '专题讨论', |
| | | key: 4, |
| | | icon: "", |
| | | icon: '/static/images/home/zhuantitaolun@2x.png', |
| | | url: '', |
| | | }, |
| | | { |
| | | text: '线上书展', |
| | | key: 5, |
| | | icon: "", |
| | | icon: '/static/images/home/xianshangshuzhan@2x.png', |
| | | url: '', |
| | | }, |
| | | { |
| | | text: '书目下载', |
| | | key: 6, |
| | | icon: "", |
| | | icon: '/static/images/home/shumuxiazai@2x.png', |
| | | url: '', |
| | | }, |
| | | { |
| | | text: '教师认证', |
| | | key: 7, |
| | | icon: "", |
| | | url: '', |
| | | icon: '/static/images/home/jiaoshirenzheng@2x.png', |
| | | url: '/pages/teacherCertification/index', |
| | | }, |
| | | { |
| | | text: '样书申请', |
| | | key: 8, |
| | | icon: "", |
| | | icon: '/static/images/home/yangshushenqing@2x.png', |
| | | url: '', |
| | | }, |
| | | { |
| | | text: '我要出书', |
| | | key: 9, |
| | | icon: "", |
| | | icon: '/static/images/home/xueshuzhuzuo@2x.png', |
| | | url: '', |
| | | } |
| | | }, |
| | | ], |
| | | }; |
| | | }); |
| | |
| | | /* 主题定制 */ |
| | | |
| | | .t-input { |
| | | --td-input-placeholder-text-color: #bbbbbb; |
| | | --td-input-text-color: #333333; |
| | |
| | | |
| | | .dialog__button-cancel { |
| | | color: #aeb3b7 !important; |
| | | } |
| | | } |