unknown
1 year ago
19 changed files with 828 additions and 452 deletions
-
21components/commentItem/commentItem.vue
-
19config/api.js
-
52config/request - 副本.js
-
51config/request.js
-
8config/site.config.js
-
51config/utils.js
-
2manifest.json
-
29pages.json
-
58pages/login/login.vue
-
0pages/login/loginByPhone.vue
-
60pages/tabbar/examSimulation/comp/studentComment.vue
-
5pages/tabbar/examSimulation/index.vue
-
2pages/userCenter/personaInfo/personaInfo.vue
-
1pages/userCenter/studentComment/studentComment.vue
-
12site.config.js
-
150store/modules/user.js
-
3uni_modules/uview-ui/components/u-album/u-album.vue
@ -1,10 +1,21 @@ |
|||||
|
|
||||
|
|
||||
const http = uni.$u.http |
|
||||
|
var http = uni.$u.http |
||||
|
|
||||
// 隐私政策
|
// 隐私政策
|
||||
export const getAgreement = (params, config = {}) => http.post('/util/manage/getAgreement.do', params, config) |
export const getAgreement = (params, config = {}) => http.post('/util/manage/getAgreement.do', params, config) |
||||
// 验证码登录
|
// 验证码登录
|
||||
export const loginSMS = (data) => http.post('/account/manage/login.do', data) |
|
||||
// 登录发验证码
|
|
||||
export const getLoginCode = (data) => http.post('/util/manage/getLoginRegistCode.do', data) |
|
||||
|
export const loginPwd = (data) => http.post('system/auth/login', data, { custom: { noToken: true , 'Tenant-Id': data['Tenant-Id']}}) |
||||
|
// 获取个人信息
|
||||
|
export const getUserInfo = (data) => http.post('member/user/get', {header: {'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'}}) |
||||
|
// 退出登录
|
||||
|
export const logOut = (data={}) => http.post('member/auth/logout', data, { custom: { noToken: true }}) |
||||
|
// 驾校列表分页
|
||||
|
export const schoolPage = (params) => http.get('business/school/page', {params: params}) |
||||
|
// 获得租户分页
|
||||
|
export const tenantPage = (params) => http.get('system/tenant/pages', {params: params}) |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
@ -0,0 +1,52 @@ |
|||||
|
|
||||
|
// 此vm参数为页面的实例,可以通过它引用vuex中的变量
|
||||
|
module.exports = (vm) => { |
||||
|
// 初始化请求配置
|
||||
|
uni.$u.http.setConfig((config) => { |
||||
|
/* config 为默认全局配置*/ |
||||
|
config.baseURL = 'http://121.41.97.244:8090'; /* 根域名 */ |
||||
|
config.header['content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8' |
||||
|
return config |
||||
|
}) |
||||
|
|
||||
|
// 请求拦截
|
||||
|
uni.$u.http.interceptors.request.use((config) => { // 可使用async await 做异步操作
|
||||
|
// 初始化请求拦截器时,会执行此方法,此时data为undefined,赋予默认{}
|
||||
|
config.data = config.data || {} |
||||
|
// 根据custom参数中配置的是否需要token,添加对应的请求头
|
||||
|
if(config?.custom?.auth) { |
||||
|
// 可以在此通过vm引用vuex中的变量,具体值在vm.$store.state中
|
||||
|
config.header.token = vm.$store.state.userInfo.token |
||||
|
} |
||||
|
return config |
||||
|
}, config => { // 可使用async await 做异步操作
|
||||
|
return Promise.reject(config) |
||||
|
}) |
||||
|
|
||||
|
// 响应拦截
|
||||
|
uni.$u.http.interceptors.response.use((response) => { /* 对响应成功做点什么 可使用async await 做异步操作*/ |
||||
|
const data = response.data |
||||
|
console.log('response') |
||||
|
console.log(data) |
||||
|
// 自定义参数
|
||||
|
const custom = response.config?.custom |
||||
|
if (data.code !== 0) { |
||||
|
// 如果没有显式定义custom的toast参数为false的话,默认对报错进行toast弹出提示
|
||||
|
if (custom.toast !== false) { |
||||
|
uni.$u.toast(data.message) |
||||
|
} |
||||
|
|
||||
|
// 如果需要catch返回,则进行reject
|
||||
|
if (custom?.catch) { |
||||
|
return Promise.reject(data) |
||||
|
} else { |
||||
|
// 否则返回一个pending中的promise,请求不会进入catch中
|
||||
|
return new Promise(() => { }) |
||||
|
} |
||||
|
} |
||||
|
return data === undefined ? {} : data |
||||
|
}, (response) => { |
||||
|
// 对响应错误做点什么 (statusCode !== 200)
|
||||
|
return Promise.reject(response) |
||||
|
}) |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
const VUE_APP_PLATFORM = process.env.VUE_APP_PLATFORM; |
||||
|
// localIp = false
|
||||
|
module.exports = { |
||||
|
H5_API: VUE_APP_PLATFORM === 'h5' ? '/api' : '',//h5代理
|
||||
|
WX_API: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.26:48080/',//非代理地址
|
||||
|
TEMP_HOST: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.26:48080/', |
||||
|
httpPrefix: '/admin-api/' |
||||
|
}; |
@ -0,0 +1,51 @@ |
|||||
|
export function checkToken(vm) { |
||||
|
let expiresTime = vm.$store.state.user.vuex_loginInfo.expiresTime |
||||
|
let nowTime = new Date() * 1 |
||||
|
console.log('超时了') |
||||
|
console.log(expiresTime) |
||||
|
if (nowTime > expiresTime * 1) { |
||||
|
vm.$store.commit('goLogin') |
||||
|
// 如果小于20分钟就刷新一下token &&
|
||||
|
} else if ((expiresTime * 1 - nowTime) / 60000 < 30) { |
||||
|
vm.$store.dispatch('refreshToken') |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function dateRangeFn(dateRange) { |
||||
|
let tmp = [] |
||||
|
let dateArr = [] |
||||
|
dateRange.forEach((date) => { |
||||
|
let dateStr = date.toISOString().split('T')[0] |
||||
|
let dd = dateStr.split('-')[2] |
||||
|
const daysOfWeek = ['日', '一', '二', '三', '四', '五', '六']; |
||||
|
const dayOfWeek = date.getDay(); |
||||
|
const weekName = daysOfWeek[dayOfWeek]; |
||||
|
console.log(dateStr) |
||||
|
console.log(weekName) |
||||
|
if (tmp.length == 0) { |
||||
|
dateArr.push(tmp) |
||||
|
} |
||||
|
let obj = { |
||||
|
week: weekName, |
||||
|
num: dd, |
||||
|
date: dateStr |
||||
|
} |
||||
|
tmp.push(obj) |
||||
|
if (tmp.length == 5) { |
||||
|
tmp = [] |
||||
|
} |
||||
|
}); |
||||
|
console.log(dateArr) |
||||
|
return dateArr |
||||
|
} |
||||
|
|
||||
|
export function getDates(startDate, endDate) { |
||||
|
const dates = []; |
||||
|
let currentDate = new Date(startDate); |
||||
|
|
||||
|
while (currentDate <= endDate) { |
||||
|
dates.push(new Date(currentDate)); |
||||
|
currentDate.setDate(currentDate.getDate() + 1); |
||||
|
} |
||||
|
return dateRangeFn(dates) |
||||
|
} |
@ -0,0 +1,60 @@ |
|||||
|
<template> |
||||
|
<view class="pageBgImg"> |
||||
|
<view class="status_bar"></view> |
||||
|
<view class="navH"></view> |
||||
|
<view class="pad"> |
||||
|
<view class="searchBox"> |
||||
|
<searchRow placeholder="搜索学员姓名"></searchRow> |
||||
|
</view> |
||||
|
<view class="tabs"> |
||||
|
<view class="tab active">全部(10)</view> |
||||
|
<view class="tab">匿名(1)</view> |
||||
|
<view class="tab">有图(2)</view> |
||||
|
<view class="tab">有视频(6)</view> |
||||
|
</view> |
||||
|
<view class="list"> |
||||
|
<view class="card"> |
||||
|
<commentItem/> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.navH { |
||||
|
width: 100%; |
||||
|
height: 90rpx; |
||||
|
} |
||||
|
.card { |
||||
|
padding: 28rpx; |
||||
|
margin-bottom: 20rpx; |
||||
|
} |
||||
|
.tabs { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
padding: 24rpx 12rpx; |
||||
|
.tab { |
||||
|
line-height: 76rpx; |
||||
|
font-size: 28rpx; |
||||
|
color: #fff; |
||||
|
&.active { |
||||
|
position: relative; |
||||
|
&::before { |
||||
|
position: absolute; |
||||
|
content: ''; |
||||
|
left: 50%; |
||||
|
bottom: 0; |
||||
|
transform: translateX(-50%); |
||||
|
width: 56rpx; |
||||
|
height: 6rpx; |
||||
|
background: #FFFFFF; |
||||
|
border-radius: 3rpx; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -1,12 +0,0 @@ |
|||||
const VUE_APP_PLATFORM = process.env.VUE_APP_PLATFORM; |
|
||||
module.exports = { |
|
||||
APP_API: VUE_APP_PLATFORM === 'h5' ? 'http://121.41.97.244:8090' : '', |
|
||||
APP_HOST: VUE_APP_PLATFORM === 'h5' ? '' : 'https://www.jaxc.cn/api', |
|
||||
TEMP_HOST: VUE_APP_PLATFORM === 'h5' ? '' : 'http://121.41.97.244:8090 https://www.jaxc.cn/api', |
|
||||
ADD_API: VUE_APP_PLATFORM === 'h5' ? '/addApi': 'http://121.41.97.244:48084', //http://121.41.97.244:48084
|
|
||||
APP_NAME: '', |
|
||||
VERSION: '1.0.0', |
|
||||
gaodeMapUrl: 'https://webapi.amap.com/maps?v=1.4.15&key=4545202996c625152b7f2c1aa0ffb8ea&plugin=AMap.DistrictSearch,AMap.CustomLayer,AMap.MarkerClusterer', |
|
||||
locationIcon: 'http://3dtest.hzhuishi.cn/images/location.png', |
|
||||
AThreeFace : true, //是否启用人脸识别
|
|
||||
}; |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue