diff --git a/App.vue b/App.vue index cc1058b..651fe9f 100644 --- a/App.vue +++ b/App.vue @@ -3,7 +3,7 @@ onLaunch: function() { }, onShow: function() { - // this.$store.commit('initConfig') + this.$store.commit('initConfig') }, onHide: function() { } diff --git a/api/api.js b/api/api.js index d566315..154d37a 100644 --- a/api/api.js +++ b/api/api.js @@ -5,7 +5,7 @@ import utils from '../utils/utils.js' let limit = {} let debounce = {} -const models = ['login', 'index', 'vip', 'info'] +const models = ['index'] const config = { // 示例 @@ -14,7 +14,7 @@ const config = { // limit : 1000 // }, - getConfig : {url : '/config_common/getConfig', method : 'GET', limit : 500}, + getConfig : {url : '/config/queryConfigList', method : 'GET', limit : 500}, } diff --git a/api/model/index.js b/api/model/index.js index 3bd6c97..b30f057 100644 --- a/api/model/index.js +++ b/api/model/index.js @@ -1,215 +1,34 @@ // 首页相关接口 const api = { - // 获取首页轮播图 - getRiceBanner: { - url: '/index_common/getRiceBanner', + /** + * 获取banner图列表 + */ + queryBannerList: { + url: '/index/queryBannerList', method: 'GET', }, - // 获取首页常规产品【废弃】 - // getRiceCommonProductList: { - // url: '/index_common/getRiceCommonProductList', - // method: 'GET', - // }, - // 获取首页跳转图标 - getRiceIconList: { - url: '/index_common/getRiceIconList', + /** + * 获取论文分类列表 + */ + queryCategoryThesisList: { + url: '/config/queryCategoryThesisList', method: 'GET', }, - // 获取首页新闻详情 - getRiceNewsDetail: { - url: '/index_common/getCommonNewsDetail', + /** + * 获取论文文章列表 + */ + queryThesisList: { + url: '/index/queryThesisList', method: 'GET', }, - // 获取首页新闻列表 - getRiceNewsList: { - url: '/index_common/getRiceNewsList', + /** + * 获取论文文章详情 + */ + queryThesisById: { + url: '/index/queryThesisById', method: 'GET', }, - // 获取首页公告列表 - getRiceNoticeList: { - url: '/index_common/getRiceNoticeList', - method: 'GET', - }, - // 获取首页商品详情 - getRiceProductDetail: { - url: '/index_common/getRiceProductDetail', - method: 'GET', - }, - // 获取首页体验产品 - getRiceProductList: { - url: '/index_common/getRiceProductList', - method: 'GET', - }, - // 查询分类接口 - getCategoryList: { - url: '/index_common/getCategoryList', - method: 'GET', - }, - // 新查询分类以及商品数据接口 - getCategoryPidList: { - url: '/index_common/getCategoryPidList', - method: 'GET', - debounce : 250, - }, - // 查询一级分类接口 - getPidList: { - url: '/index_common/getCategoryPidList', - method: 'GET', - }, - // 获取分类分页商品列表接口 - getClassShopPageList: { - url: '/index_common/getClassShopPageList', - method: 'GET', - }, - // 加入购物车 - addCart: { - url: '/index_common/addCart', - method: 'GET', - auth: true, - showLoading: true, - limit : 500, - }, - // 删除购物车信息 - deleteCart: { - url: '/index_common/deleteCart', - method: 'DELETE', - auth: true, - showLoading: true, - }, - // 修改购物车信息数量 - updateCartNum: { - url: '/index_common/updateCartNum', - method: 'POST', - auth: true, - debounce: 300, - }, - // 创建订单 - createOrder: { - url: '/index_common/createOrder', - method: 'GET', - auth: true, - limit: 1000, - showLoading: true, - }, - // 创建订单-再次支付 - createOrderTwo: { - url: '/index_common/createOrderTwo', - method: 'GET', - auth: true, - limit: 1000, - showLoading: true, - }, - // 多商品创建订单 - createSumOrder: { - url: '/index_common/createSumOrder', - method: 'POST', - auth: true, - limit: 1000, - showLoading: true, - }, - // 多商品订单再次支付 - createSumOrderAgain: { - url: '/index_common/createSumOrderAgain', - method: 'POST', - auth: true, - limit: 1000, - showLoading: true, - }, - // 确认收货 - confirmOrder: { - url: '/index_common/confirmOrder', - method: 'GET', - auth: true, - limit: 1000, - showLoading: true, - }, - // 取消订单 - cancelOrder: { - url: '/index_common/cancelOrder', - method: 'GET', - auth: true, - limit: 1000, - showLoading: true, - }, - // 获取首页广告列表 - getRiceProductList: { - url: '/index_common/getRiceAdList', - method: 'GET', - }, - // 获取首页广告列表 - getRiceAdDetail: { - url: '/index_common/getRiceAdDetail', - method: 'GET', - }, - //获取优惠券信息 - getRiceCouponList: { - url: '/info_common/getRiceCouponList', - method: 'GET', - }, - //增加或者修改合伙人申请信息 - addOrUpdateCommonUser: { - url: '/index_common/addOrUpdateCommonUser', - method: 'POST', - }, - //根据用户查询渠合伙人申请信息表单 - getCommonUser: { - url: '/index_common/getCommonUser', - method: 'GET' - }, - //提交反馈信息 - addFeedback: { - url: '/info_common/addFeedback', - method: 'POST' - }, - // 获取我的直接推荐间接推荐用户列表带分页 - getHanHaiMemberUser: { - url: '/info_common/getHanHaiMemberUser', - method: 'GET' - }, - // 获取祝福背景图 - getRiceBlessing: { - url: '/index_common/getRiceBlessing', - method: 'GET' - }, - // 随机获取祝福语 - getRiceBlessingWords: { - url: '/index_common/getRiceBlessingWords', - method: 'GET' - }, - // 根据订单标识修改订单祝福语背景 - updateOrderBlessing: { - url: '/index_common/updateOrderBlessing', - method: 'POST', - auth : true, - limit : 1000, - }, - // 1.收礼流程 =》点击收礼 - getGiveShop: { - url: '/index_common/getGiveShop', - method: 'GET', - auth : true, - limit : 1000, - }, - // 2.点击抽奖 =》抽奖 - getGiveShopLottery: { - url: '/index_common/getGiveShopLottery', - method: 'GET', - auth : true, - limit : 1000, - }, - // 获取我的礼品订单 - getMyGiftOrder: { - url: '/index_common/getMyGiftOrder', - method: 'GET', - auth : true, - }, - // 获取我的礼品订单详情 - getMyGiftOrderDetail: { - url: '/index_common/getMyGiftOrderDetail', - method: 'GET', - auth : true, - }, } export default api \ No newline at end of file diff --git a/api/model/info.js b/api/model/info.js deleted file mode 100644 index a695abd..0000000 --- a/api/model/info.js +++ /dev/null @@ -1,115 +0,0 @@ -// 个人相关接口 - -const api = { - // 充值 - recharge: { - url: '/info_common/withdraw', - method: 'GET', - auth: true, - limit: 1000, - showLoading: true, - }, - // 提现 - withdraw: { - url: '/info_common/withdraw', - method: 'GET', - auth: true, - limit: 1000, - showLoading: true, - }, - // 获取地址列表带分页 - getAddressPageList: { - url: '/info_common/getAddressPageList', - method: 'GET', - auth: true, - }, - // 增加或修改地址信息 - addOrUpdateAddress: { - url: '/info_common/addOrUpdateAddress', - method: 'POST', - limit: 500, - auth: true, - showLoading: true, - }, - // 删除地址 - deleteAddress: { - url: '/info_common/deleteAddress', - method: 'GET', - limit: 500, - auth: true, - showLoading: true, - }, - // 修改默认地址 - updateDefaultAddress: { - url: '/info_common/updateDefaultAddress', - method: 'GET', - auth: true, - limit: 1000, - }, - // 获取粉丝列表带分页 - getFansPageList: { - url: '/info_common/getFansPageList', - method: 'GET', - auth: true, - }, - // 获取相关介绍 - getInfoIntroduce: { - url: '/info_common/getInfoIntroduce', - method: 'GET', - auth: true, - }, - // 获取个人邀请码 - getInviteCode: { - url: '/info_common/getInviteCode', - method: 'GET', - auth: true, - }, - // 获取订单列表带分页 - getOrderPageList: { - url: '/info_common/getOrderPageList', - method: 'GET', - auth: true, - }, - // 获取订单详情 - getOrderDetail: { - url: '/info_common/getOrderDetail', - method: 'GET', - auth: true, - }, - // 获取流水记录带分页 - getWaterPageList: { - url: '/info_common/getWaterPageList', - method: 'GET', - auth: true, - }, - // 获取相关介绍 - getInfoIntroduce: { - url: '/info_common/getInfoIntroduce', - method: 'GET', - }, - // 获取相关介绍详情 - getInfoIntroduceDetail: { - url: '/info_common/getRiceNewsDetail', - method: 'GET', - }, - // 查询个人信息相关 - getRiceInfo: { - url: '/info_common/getRiceInfo', - method: 'GET', - limit: 500, - }, - // 获取购物车信息列表带分页 - getCartPageList: { - url: '/info_common/getCartPageList', - method: 'GET', - }, - // 领取新人优惠券 - getRiceCoupon: { - url: '/info_common/getRiceCoupon', - method: 'GET', - limit: 500, - auth: true, - }, -} - -export default api \ No newline at end of file diff --git a/api/model/login.js b/api/model/login.js deleted file mode 100644 index c818a04..0000000 --- a/api/model/login.js +++ /dev/null @@ -1,35 +0,0 @@ - - -// 登录相关接口 - -const api = { - // 微信登录接口 - wxLogin: { - url: '/login_common/appletLogin', - method: 'GET', - limit : 500, - showLoading : true, - }, - // 获取绑定手机号码 - bindPhone: { - url: '/login_common/bindPhone', - method: 'GET', - auth: true, - }, - // 修改个人信息接口 - updateInfo: { - url: '/info_common/updateInfo', - method: 'POST', - auth: true, - limit : 500, - showLoading : true, - }, - // 获取个人信息 - getInfo: { - url: '/info_common/getInfo', - method: 'GET', - auth: true, - }, -} - -export default api \ No newline at end of file diff --git a/api/model/vip.js b/api/model/vip.js deleted file mode 100644 index c2d4b7b..0000000 --- a/api/model/vip.js +++ /dev/null @@ -1,20 +0,0 @@ - -// vip相关接口 - -const api = { - // 获取会员权益列表 - getRiceVipList: { - url: '/index_common/getVipInfoList', - method: 'GET', - }, - // 申请成为会员 - applyRiceVip: { - url: '/rice_vip/applyRiceVip', - method: 'POST', - limit : 500, - auth : true, - showLoading : true, - }, -} - -export default api \ No newline at end of file diff --git a/common.scss b/common.scss index 21cbe8f..5994751 100644 --- a/common.scss +++ b/common.scss @@ -45,6 +45,7 @@ background-color: $uni-bg-color; position: relative; font-family: PingFang SC; + font-weight: 400; line-height: 1.4; } diff --git a/config.js b/config.js index 81698d8..f2109a1 100644 --- a/config.js +++ b/config.js @@ -1,22 +1,23 @@ import Vue from 'vue' import api from '@/api/api.js' +import fetch from '@/api/fetch.js' import utils from './utils/utils.js' import uvUI from '@/uni_modules/uv-ui-tools' Vue.use(uvUI); // 当前环境 -const type = 'dev' +const type = 'prod' // 环境配置 const config = { dev : { - baseUrl : 'http://www.gcosc.fun:82', + baseUrl: 'http://augcl.natapp1.cc/education-admin/education', }, prod : { - baseUrl : 'http://xxx.xxx.xxx/xxx', + baseUrl: 'https://www.jgyt.chat/education-admin/education', } } diff --git a/pages.json b/pages.json index c6c9c61..1a680f5 100644 --- a/pages.json +++ b/pages.json @@ -33,16 +33,9 @@ "subPackages": [{ "root": "pages_order", "pages": [{ - "path": "auth/wxLogin" - }, - { - "path": "auth/wxUserInfo" - }, - { - "path": "auth/loginAndRegisterAndForgetPassword" - }, - { - "path": "search/index" + "path": "thesis/search" + },{ + "path": "thesis/index" } ] }], diff --git a/pages/index/index.vue b/pages/index/index.vue index 2941fc0..845c4d3 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -20,25 +20,27 @@ - {{ group.label }} + {{ group.title }} JGYT @@ -71,73 +73,66 @@ this.getData() }, methods: { - getData() { - // todo - - this.list = [ - { - id: '001', - label: '导航检索', - children: [ - { id: '0011', label: 'AHCI', icon: '/static/image/temp-4.png', }, - { id: '0012', label: 'EI会议', icon: '/static/image/temp-9.png', }, - { id: '0013', label: 'EI源刊', icon: '/static/image/temp-10.png', }, - { id: '0014', label: 'ESCI', icon: '/static/image/temp-5.png', }, - { id: '0015', label: 'SCI', icon: '/static/image/temp-6.png', }, - { id: '0016', label: 'Scoupus', icon: '/static/image/temp-7.png', }, - { id: '0017', label: 'SSCI', icon: '/static/image/temp-8.png', }, - ], - }, - { - id: '002', - label: '精选内容', - children: [ - { id: '0021', label: 'AHCI', icon: '/static/image/temp-4.png', }, - { id: '0022', label: 'EI会议', icon: '/static/image/temp-9.png', }, - { id: '0023', label: 'AHCI', icon: '/static/image/temp-4.png', }, - { id: '0024', label: 'EI会议', icon: '/static/image/temp-9.png', }, - ], - }, - { - id: '003', - label: '精选内容', - children: [ - { id: '0031', label: 'AHCI', icon: '/static/image/temp-4.png', }, - { id: '0032', label: 'EI会议', icon: '/static/image/temp-9.png', }, - { id: '0033', label: 'AHCI', icon: '/static/image/temp-4.png', }, - { id: '0034', label: 'EI会议', icon: '/static/image/temp-9.png', }, - ], - }, - ] + async getData() { + try { + let records = (await this.$fetch('queryCategoryThesisList', { pageNo: 1, pageSize: 1000 }))?.records + + let groups = [] + + records.forEach(record => { + if (record.hasChild == 1) { + // todo: icon + const { id, title, createTime } = record + const index = groups.findIndex(group => group.id === id) + if (index === -1) { + groups.push({ id, title, createTime, children: [] }) + } else { + groups[index].title = title + groups[index].createTime = createTime + } + } else { + // todo: icon + const { pid, id, title, createTime } = record + const index = groups.findIndex(group => group.id === pid) + const item = { id, title, createTime } + if (index === -1) { + groups.push({ id: pid, children: [item] }) + } else { + groups[index].children.push(item) + } + } + }) + + groups.forEach(group => { + let { children } = group + children.sort((a, b) => new Date(a.createTime).getTime() - new Date(b.createTime).getTime()) + group.children = children + }) + + groups.sort((a, b) => new Date(a.createTime).getTime() - new Date(b.createTime).getTime()) + + this.list = groups + } catch (err) { + + } }, search() { uni.navigateTo({ - url: '/pages_order/search/index?search=' + this.keyword + url: '/pages_order/thesis/search?search=' + this.keyword }) this.keyword = '' }, // 获取轮播图 async fetchBanner() { try { - // todo - // this.bannerList = (await this.$fetch('queryBannerList'))?.records - - this.bannerList = [ - { image: '/static/image/temp-1.png' }, - { image: '/static/image/temp-2.png' }, - { image: '/static/image/temp-3.png' }, - { image: '/static/image/temp-2.png' }, - ] - + this.bannerList = (await this.$fetch('queryBannerList', { type: '0' }))?.records // type:0-首页 1-案例 2-服务 3-其他 } catch (err) { } }, - jumpToCategory(obj) { - const { id, label } = obj - + jumpToCategory(categoryOne, categoryTwo, title) { uni.navigateTo({ - url: `/pages_order/search/index?cid=${id}&title=${label}` + url: `/pages_order/thesis/search?categoryOne=${categoryOne}&categoryTwo=${categoryTwo}&title=${title}` }) }, }, diff --git a/pages_order/auth/loginAndRegisterAndForgetPassword.vue b/pages_order/auth/loginAndRegisterAndForgetPassword.vue deleted file mode 100644 index 7de7898..0000000 --- a/pages_order/auth/loginAndRegisterAndForgetPassword.vue +++ /dev/null @@ -1,514 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/pages_order/auth/wxLogin.vue b/pages_order/auth/wxLogin.vue deleted file mode 100644 index 292f9d1..0000000 --- a/pages_order/auth/wxLogin.vue +++ /dev/null @@ -1,155 +0,0 @@ - - - - - diff --git a/pages_order/auth/wxUserInfo.vue b/pages_order/auth/wxUserInfo.vue deleted file mode 100644 index 50c988f..0000000 --- a/pages_order/auth/wxUserInfo.vue +++ /dev/null @@ -1,133 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages_order/search/index.vue b/pages_order/search/index.vue deleted file mode 100644 index 9eacd1e..0000000 --- a/pages_order/search/index.vue +++ /dev/null @@ -1,254 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages_order/thesis/index.vue b/pages_order/thesis/index.vue new file mode 100644 index 0000000..7b82631 --- /dev/null +++ b/pages_order/thesis/index.vue @@ -0,0 +1,660 @@ + + + + + \ No newline at end of file diff --git a/pages_order/thesis/search.vue b/pages_order/thesis/search.vue new file mode 100644 index 0000000..c2b7423 --- /dev/null +++ b/pages_order/thesis/search.vue @@ -0,0 +1,191 @@ + + + + + \ No newline at end of file diff --git a/static/image/icon-degree.png b/static/image/icon-degree.png new file mode 100644 index 0000000..4079270 Binary files /dev/null and b/static/image/icon-degree.png differ diff --git a/static/image/icon-empty.png b/static/image/icon-empty.png new file mode 100644 index 0000000..5735ca9 Binary files /dev/null and b/static/image/icon-empty.png differ diff --git a/static/image/icon-pdf.png b/static/image/icon-pdf.png new file mode 100644 index 0000000..4a2e254 Binary files /dev/null and b/static/image/icon-pdf.png differ diff --git a/static/image/icon-word.png b/static/image/icon-word.png new file mode 100644 index 0000000..502cd75 Binary files /dev/null and b/static/image/icon-word.png differ diff --git a/static/image/temp-11.png b/static/image/temp-11.png new file mode 100644 index 0000000..58a4b2f Binary files /dev/null and b/static/image/temp-11.png differ diff --git a/static/image/temp-12.png b/static/image/temp-12.png new file mode 100644 index 0000000..c1a5cfb Binary files /dev/null and b/static/image/temp-12.png differ diff --git a/static/image/temp-13.png b/static/image/temp-13.png new file mode 100644 index 0000000..bb42541 Binary files /dev/null and b/static/image/temp-13.png differ diff --git a/static/image/temp-14.png b/static/image/temp-14.png new file mode 100644 index 0000000..7886741 Binary files /dev/null and b/static/image/temp-14.png differ diff --git a/store/store.js b/store/store.js index 3b6d27d..c99ed44 100644 --- a/store/store.js +++ b/store/store.js @@ -26,7 +26,7 @@ const store = new Vuex.Store({ ...state.configList, } if (res.code == 200) { - res.result.forEach(n => { + res.result?.records?.forEach(n => { configList[n.keyName] = n.keyContent; configList[n.keyName + '_keyValue'] = n.keyValue; }); @@ -44,65 +44,6 @@ const store = new Vuex.Store({ // }) // }) }, - // 微信登录 - login(state){ - uni.showLoading({ - title: '登录中...' - }) - uni.login({ - success(res) { - if(res.errMsg != "login:ok"){ - return - } - - api('wxLogin', { - code : res.code - }, res => { - - uni.hideLoading() - - if(res.code != 200){ - return - } - - state.userInfo = res.result.userInfo - uni.setStorageSync('token', res.result.token) - - if(!state.userInfo.nickName || !state.userInfo.headImage){ - uni.navigateTo({ - url: '/pages_order/auth/wxUserInfo' - }) - }else{ - uni.navigateBack(-1) - } - }) - } - }) - }, - // 获取用户个人信息 - getUserInfo(state){ - api('getInfo', res => { - if(res.code == 200){ - state.userInfo = res.result - } - }) - }, - // 退出登录 - logout(state){ - uni.showModal({ - title: '确认退出登录吗', - success(r) { - if(r.confirm){ - state.userInfo = {} - state.role = false - uni.removeStorageSync('token') - uni.reLaunch({ - url: '/pages/index/index' - }) - } - } - }) - }, }, actions: {}, }) diff --git a/utils/utils.js b/utils/utils.js index 2dd6729..0ad70c8 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -209,23 +209,6 @@ export function redirectTo(...args){ uni.redirectTo(params(...args)) } -/** - * 登录跳转函数,防止短时间内多次调用 - * @returns {Function} 节流处理后的登录跳转函数 - */ -export const toLogin = function(){ - let time = 0 - return () => { - if(new Date().getTime() - time < 1000){ - return - } - time = new Date().getTime() - uni.navigateTo({ - url: '/pages_order/auth/wxLogin' - }) - } -}() - export default { toArray, generateUUID, @@ -240,5 +223,4 @@ export default { redirectTo, copyText, stringFormatHtml, - toLogin } \ No newline at end of file