Browse Source

评价接口

master
unknown 1 year ago
parent
commit
19f8a569cd
  1. 6
      config/api.js
  2. 2
      config/site.config.js
  3. 10
      pages.json
  4. 159
      pages/carEntry/evaluate/comp/evaluateItem.vue
  5. 188
      pages/carEntry/evaluate/evaluate.vue
  6. 1
      pages/indexEntry/findShcool/comments/comments.vue
  7. 35
      pages/indexEntry/findShcool/shcoolComment/shcoolComment.vue
  8. 29
      pages/indexEntry/theory/theory.vue
  9. 45
      pages/indexEntry/webView/webView.vue

6
config/api.js

@ -20,6 +20,12 @@ export const getexamSite = (params) => http.get('business/school/getexamSite', {
export const getExamSiteDatil = (params) => http.get('business/school/getExamSiteDatil', {params: params})
// 考场资讯
export const getExamSiteInfo = (params) => http.get('business/school/getExamSiteInfo', {params: params})
// 创建驾校评价
export const addSchoolComment = (data={}) => http.post('business/appcomplain/addSchoolComment', data,)
// 创建教练评价
export const addCoachComment = (data={}) => http.post('business/appcomplain/addCoachComment', data,)
// 获取已报名驾校
export const getStudentinfo = (params) => http.get('business/appcomplain/getStudentinfo', {params: params})
// 驾校评论分页
export const getSchoolListComment = (params) => http.get('business/school/getListComment', {params: params})
// 驾校详情

2
config/site.config.js

@ -2,7 +2,7 @@ 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/',//非代理地址
WX_API: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.36:48080/',//非代理地址
TEMP_HOST: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.26:48080/',
httpPrefix: 'app-api/',
imgUrl: 'https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/defaultImages/app/bigImg/'

10
pages.json

@ -42,6 +42,16 @@
}
},
{
"path": "webView/webView",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom",
// "navigationBarLoading": false,
"backgroundTextStyle": "dark"
}
},
{
"path": "industryPolicy/industryPolicy",
"style": {
"navigationBarTitleText": "行业政策",

159
pages/carEntry/evaluate/comp/evaluateItem.vue

@ -5,31 +5,37 @@
<view class="top_row">
<view class="tit">{{ info.tit }}</view>
<u-checkbox-group iconPlacement="right" :size="14" >
<u-checkbox v-model="checked" shape="circle" label="匿名提交" :iconSize="12" :labelSize="12" ></u-checkbox>
<u-checkbox v-model="info.anonymity" shape="circle" label="匿名提交" :iconSize="12" :labelSize="12" ></u-checkbox>
</u-checkbox-group>
</view>
<view class="user_row">
<view class="avatar">
<image src="@/static/images/logo.png" mode=""></image>
<image :src="info.photoPath" mode=""></image>
</view>
<view class="name">王一宝</view>
<view class="name">{{info.school? info.schoolName: info.coachName}}</view>
</view>
<view class="star_row">
<view class="lab">服务态度</view>
<view class="star">
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" :value="4" ></u-rate>
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" v-model="info.serviceLevel" ></u-rate>
</view>
</view>
<view class="star_row" v-if="info.school">
<view class="lab">驾校风貌</view>
<view class="star">
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" v-model="info.schoolLevel" ></u-rate>
</view>
</view>
<view class="star_row">
<view class="lab">教学安排</view>
<view class="star">
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" :value="4" ></u-rate>
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" v-model="info.teachLevel" ></u-rate>
</view>
</view>
<view class="star_row">
<view class="lab">教学质量</view>
<view class="star">
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" :value="4" ></u-rate>
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" v-model="info.qualityLevel" ></u-rate>
</view>
</view>
<!-- 写内容上传图片 -->
@ -39,24 +45,38 @@
<image src="@/static/images/index/edit.png" mode=""></image>
</view>
<view class="inputBox">
<u-textarea v-model="value" ref="textarea" placeholder="详细说明问题,以便获得更好的回答~" border="none"></u-textarea>
<u-textarea v-model="info.description" ref="textarea" placeholder="详细说明问题,以便获得更好的回答~" border="none"></u-textarea>
</view>
</view>
<view class="phoneBox">
<view class="imgBox">
<view class="img">
<view class="minusCircle">
<u-icon name="close-circle-fill" size="20" color="#9FA3A4"></u-icon>
<view class="img" v-for="(item,index) in info.imgArr" :key="item">
<view class="minusCircle" @click="deleteImg(item)">
<u-icon name="close-circle-fill" size="20" color="#b9061d"></u-icon>
</view>
<image src="@/static/logo.png" mode=""></image>
<image :src="item" mode=""></image>
</view>
</view>
<view class="phone" @click="chooseImages">
<view class="phone" @click="chooseImages" v-if="info.imgArr.length<3">
<view class="phoneIcon">
<image src="@/static/images/index/btn_tupian.png" mode=""></image>
</view>
<view class="lab">添加图片</view>
</view>
<view class="phone" @click="chooseVideo" v-if="!info.videoUrl" >
<view class="phoneIcon">
<image src="@/static/images/index/btn_tupian.png" mode=""></image>
</view>
<view class="lab">添加视频</view>
</view>
<view class="imgBox" style="margin-left: 16rpx;" v-else>
<view class="img">
<view class="minusCircle" @click="info.videoUrl=''">
<u-icon name="close-circle-fill" size="20" color="#b9061d"></u-icon>
</view>
<video :src="info.videoUrl" style="width: 160rpx;height: 160rpx;display: block;" ></video>
</view>
</view>
</view>
</view>
@ -68,18 +88,131 @@
</template>
<script>
import { WX_API, H5_API, prefix } from '@/config/site.config.js';
var _url = H5_API+ WX_API
export default {
props: [ 'info' ],
data() {
return {
checked: false
checked: false,
imgArr:[]
}
},
methods: {
deleteImg(item) {
let index = this.info.imgArr.findIndex(val=>val==item)
this.info.imgArr.splice(index, 1)
},
chooseVideo() {
uni.chooseVideo({
sourceType: ['album', 'camera'],
compressed: true,
success: (res)=> {
//
console.log(res.tempFilePath);
//
this.uploadImgApi(res.tempFilePath, res.name, 'video')
},
fail: function (error) {
console.log(error);
}
});
},
uploadVideo(filePath) {
uni.uploadFile({
url: 'https://your-upload-api.com/upload-video',
filePath: filePath,
name: 'video',
formData: {
//
},
success: function (res) {
var data = JSON.parse(res.data);
if (data.code === 0) {
//
console.log('上传成功', data);
} else {
//
console.log('上传失败', data);
}
},
fail: function (error) {
console.log('上传失败', error);
}
});
},
//
chooseImages(type) {
let imgNum = 3 - (this.imgArr.length)
uni.chooseImage({
count: imgNum, //
sizeType: ['original', 'compressed'], //
sourceType: ['album', 'camera'], //
success: res => {
uni.showLoading({
title: '图片上传中...'
});
console.log(res)
res.tempFiles.forEach( (item,index)=>{
this.uploadImgApi(item.path, item.name)
})
}
})
},
uploadImgApi(filePath, imgName, vdo) {
console.log(filePath)
let token = 'Bearer '+ this.$store.state.user.vuex_loginInfo.accessToken
let _this = this
let timer = new Date() * 1
//
uni.uploadFile({
url: _url + 'app-api/infra/file/upload',//
filePath: filePath,//
name: 'file',
formData: {
path: 'complain/'+ uni.$u.date(name, 'yyyy-mm-dd')+'/'+timer + '-'+ imgName,
type: 1,
fileSuffix: "png"
},
header: {
Authorization: token,
'tenant-id': 1
},
success(res) {
console.log('上传成功')
let res2 = JSON.parse(res.data)
if(vdo) {
_this.info.videoUrl = res2.data
}else {
_this.info.imgArr.push(res2.data)
}
console.log(res2)
uni.hideLoading();
},
complete: (err)=> {
console.log(err)
}
})
},
}
}
</script>
<style lang="scss" scoped>
@import '../../../../common/css/textareaBg.scss';
.phoneBox {
flex-wrap: wrap;
.img {
margin-bottom: 16rpx;
}
.phone {
margin-right: 16rpx;
}
.imgBox {
flex-wrap: wrap;
}
}
.card {
padding: 28rpx;
margin-bottom: 20rpx;

188
pages/carEntry/evaluate/evaluate.vue

@ -1,91 +1,171 @@
<template>
<view class="pageBgImg">
<topNavbar title="评价"></topNavbar>
<evaluateItem :info="info"/>
<evaluateItem :info="{tit: '您对教练满意吗'}"/>
<evaluateItem :info="schoolInfo" key="1"/>
<evaluateItem :info="coachInfo" key="2"/>
<view class="btnBox">
<view class="btnBg">提交</view>
<view class="btnBg" @click="submintFn">提交</view>
</view>
</view>
</template>
<script>
import evaluateItem from './comp/evaluateItem'
import { getStudentinfo, addSchoolComment,addCoachComment } from '@/config/api.js'
export default {
components: { evaluateItem },
components: {
evaluateItem
},
data() {
return {
checked: false,
info: {
schoolInfo: {
tit: '您对驾校满意吗?',
school: 1,
"schoolId": 8750,
"schoolName": "赵六",
"stars": 0,
"studentId": '',
"studentName": "张三",
"studentIdcard": "",
"studentPhone": "",
"serviceLevel": 0,
"schoolLevel": 0,
"qualityLevel": 0,
"teachLevel": 0,
"subject": 0,
"description": "随便",
"images": "",
"videoUrl": "",
"anonymity": 0,
"userId": 0,
imgArr: []
},
coachInfo: {
tit: '您对驾校满意吗?',
"schoolId": 8750,
"schoolName": "赵六",
"stars": 0,
"studentId": '',
"studentName": "张三",
"studentIdcard": "",
"studentPhone": "",
"serviceLevel": 0,
"schoolLevel": 0,
"qualityLevel": 0,
"teachLevel": 0,
"subject": 0,
"description": "随便",
"images": "",
"videoUrl": "",
"anonymity": 0,
"userId": 0,
coachName: '',
imgArr: []
}
}
},
onLoad() {
this.schoolInfo.userId = this.$store.state.user.vuex_loginInfo.userId
this.getStudentinfoFn()
},
computed: {
btnActive() {
// if(this.schoolInfo.)
}
},
methods: {
//
async getStudentinfoFn() {
const {data: res} = await getStudentinfo({id: this.schoolInfo.userId})
this.coachInfo.schoolId = this.schoolInfo.schoolId = res.schoolId
this.coachInfo.schoolName = this.schoolInfo.schoolName = res.schoolName
this.coachInfo.coachName = res.coachName
this.coachInfo.coachId = res.coachId
},
async submintFn() {
if(this.coachInfo.imgArr.length) {
this.coachInfo.images = this.coachInfo.imgArr.join(',')
}
if(this.schoolInfo.imgArr.length) {
this.schoolInfo.images = this.schoolInfo.imgArr.join(',')
}
const res = await addSchoolComment(this.schoolInfo)
const res2 = await addCoachComment(this.coachInfo)
}
}
}
</script>
<style lang="scss" scoped>
@import '../../../common/css/textareaBg.scss';
.btnBox {
padding-bottom: 76rpx;
}
.btnBg {
margin: 124rpx auto 0 auto;
width: 396rpx;
}
.textareaBg {
margin-top: 22rpx;
}
.card {
padding: 28rpx;
.top_row {
display: flex;
align-items: center;
padding-bottom: 24rpx;
border-bottom: 2rpx solid #E8E9EC;
justify-content: space-between;
.tit {
font-weight: 600;
color: #333333;
font-size: 32rpx;
}
}
.user_row {
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
.avatar {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
overflow: hidden;
}
.name {
font-size: 28rpx;
font-weight: 500;
padding-left: 26rpx;
}
}
.star_row {
padding: 14rpx 0;
display: flex;
align-items: center;
.lab {
font-size: 28rpx;
font-weight: 500;
padding-right: 32rpx;
}
.star {
}
}
.top_row {
display: flex;
align-items: center;
padding-bottom: 24rpx;
border-bottom: 2rpx solid #E8E9EC;
justify-content: space-between;
.tit {
font-weight: 600;
color: #333333;
font-size: 32rpx;
}
}
.user_row {
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
.avatar {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
overflow: hidden;
}
.name {
font-size: 28rpx;
font-weight: 500;
padding-left: 26rpx;
}
}
.star_row {
padding: 14rpx 0;
display: flex;
align-items: center;
.lab {
font-size: 28rpx;
font-weight: 500;
padding-right: 32rpx;
}
.star {}
}
}
</style>

1
pages/indexEntry/findShcool/comments/comments.vue

@ -28,6 +28,7 @@
methods: {
changeNav(item) {
this.currentNav = item.id
this.$emit('changeNav', item.id)
}
}
}

35
pages/indexEntry/findShcool/shcoolComment/shcoolComment.vue

@ -1,6 +1,9 @@
<template>
<view class="main">
<comments :list="list"></comments>
<comments :list="list" @changeNav="changeNav"></comments>
<view style="padding-bottom: 20rpx;">
<u-loadmore :status="status" />
</view>
</view>
</template>
@ -15,21 +18,47 @@
pageNo: 1,
pageSize: 20,
schoolId: '',
condition: 0
},
total: 20,
list: []
list: [],
status: 'loading'
}
},
onLoad(options) {
this.params.schoolId = options.id
this.getSchoolListCommentFn()
},
onPullDownRefresh() {
this.getSchoolListCommentFn().then(()=>{
uni.stopPullDownRefresh()
})
},
onReachBottom() {
if(this.list.length>this.total) this.getSchoolListCommentFn()
},
methods: {
changeNav(val) {
this.params.condition = val
this.initList()
},
initList() {
this.params.pageNo = 1
this.status = 'loading'
this.list = []
},
async getSchoolListCommentFn() {
const {data: res} = await getSchoolListComment(this.params)
this.params.pageNo ++
this.list.push(...res.list)
let arr = res.list.map(item=>{
if(item.images) {
item.images = item.images.split(',')
}
return item
})
this.list.push(...arr)
this.total = res.total
if(this.list.length>=this.total) this.status = 'nomore'
}
}
}

29
pages/indexEntry/theory/theory.vue

@ -12,7 +12,7 @@
</view>
</view>
</view>
<view class="btn">去练习</view>
<view class="btn" @click="goPage">去练习</view>
</view>
</view>
</template>
@ -32,6 +32,33 @@
methods: {
changeNav(item) {
this.currentId = item.id
},
goPage() {
if(this.currentId==1) {
// let url = 'https://www.hzsjspx.com/theory/scienceStudy?token=amlhcGVpMTY5NTc3NzUzODg5ODA5NjU1&lat=30.343055&lng=120.183711&isUni=1'
let questionUrl = 'http://192.168.1.44:92/question/'
let phone = this.vuex_userInfo.mobile
let obj = {
phone,
cityCode: '3311',
}
// #ifdef MP-WEIXIN
obj.isWx = 1
// #endif
let uniItem = encodeURIComponent(JSON.stringify(obj))
let url = `${questionUrl}?uniItem=${uniItem}`
console.log(url)
this.$store.commit('updateWebVeiwUrl', url)
this.$goPage('/pages/indexEntry/webView/webView')
}else if(this.currentId==2) {
let theory = 'http://192.168.1.44:91/theory/'
let token = this.$store.state.user.vuex_loginInfo.accessToken
let lat = this.vuex_cityInfo.lat|| 30.27419537786047
let lng = this.vuex_cityInfo.lng|| 120.20633397715788
let url = `${theory}?token=${token}&lat=${lat}&lng=${lng}&isUni=1`
this.$store.commit('updateWebVeiwUrl', url)
this.$goPage('/pages/indexEntry/webView/webView')
}
}
}
}

45
pages/indexEntry/webView/webView.vue

@ -0,0 +1,45 @@
<template>
<view>
<topNavbar title="学员报名"></topNavbar>
<!-- <web-view :webview-styles="webviewStyles" src="http://192.168.1.44:92/question/?uniItem=%7B%22phone%22%3A%2218267103167%22%2C%22cityCode%22%3A%223311%22%2C%22isUni%22%3A1%7D"></web-view> -->
<web-view :webview-styles="webviewStyles" class="custom-webview" :src="link" :update-title="true"></web-view>
<!-- <iframe src="https://your-h5-url.com" frameborder="0"></iframe> -->
</view>
</template>
<script>
export default {
data() {
return {
webviewStyles: {
progress: {
color: '#FF3333'
},
width: '100vw', // WebView 100%
height: '100vh', // WebView 100vh
},
link: ''
}
},
onLoad() {
this.link = this.$store.state.webViewUrl
console.log('噜噜哇'+ this.$store.state.webViewUrl)
// http://192.168.1.44:92/question/?uniItem=%7B%22phone%22%3A%2218267103167%22%2C%22cityCode%22%3A%223311%22%2C%22isUni%22%3A1%7D
// uni.hideNavigationBarLoading()
},
// onReady() {
// uni.hideNavigationBarLoading();
// }
}
</script>
<style>
.custom-webview::after {
content: none !important; /* 隐藏返回按钮 */
}
.iframe {
display: block;
width: 100vw;
height: 100vh;
}
</style>
Loading…
Cancel
Save