完善意见反馈接口、图片上传接口
parent
d99bdbb3d0
commit
9d5406c1f1
|
@ -196,7 +196,7 @@ uni-radio .uni-radio-input {border: 1rpx solid #444444;}
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
}
|
}
|
||||||
.solution-title {
|
.solution-title {
|
||||||
bottom: 6rpx;
|
bottom: 0rpx;
|
||||||
left: -40rpx;
|
left: -40rpx;
|
||||||
right: -40rpx;
|
right: -40rpx;
|
||||||
padding: 6rpx;
|
padding: 6rpx;
|
||||||
|
|
|
@ -123,21 +123,21 @@ const uploadFile = (url, options) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: `${hostapi}${url}`,
|
url: `${hostapi}${url}`,
|
||||||
filePath: tempData.form,
|
filePath: tempData.path,
|
||||||
name: 'image',
|
name: 'file',
|
||||||
fileType:'image',
|
fileType:'image',
|
||||||
formData: tempData,
|
formData: tempData,
|
||||||
// sslVerify:false,//验证 ssl 证书 仅App安卓端支持
|
// sslVerify:false,//验证 ssl 证书 仅App安卓端支持
|
||||||
// withCredentials:true,//跨域请求时是否携带凭证(cookies)仅H5支持
|
// withCredentials:true,//跨域请求时是否携带凭证(cookies)仅H5支持
|
||||||
header: {
|
header: {
|
||||||
'Content-Type': 'multipart/form-data;charset=UTF-8',
|
// 'Content-Type': 'multipart/form-data;charset=UTF-8',
|
||||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || '',
|
// 'Authorization': 'Bearer '+uni.getStorageSync('token') || '',
|
||||||
'token':uni.getStorageSync('token') || ''
|
token:uni.getStorageSync('token') || ''
|
||||||
},
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
let temp = JSON.parse(res.data)
|
let temp = JSON.parse(res.data)
|
||||||
if (temp.code == 0) {
|
if (temp.code == 1) {
|
||||||
resolve(temp)
|
resolve(temp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,22 @@ const tools = {
|
||||||
hideMPhone(phone){
|
hideMPhone(phone){
|
||||||
return `${phone.substr(0, 3)}****${phone.substr(7)}`
|
return `${phone.substr(0, 3)}****${phone.substr(7)}`
|
||||||
},
|
},
|
||||||
|
// 手机号中间加字符
|
||||||
|
phoneAddChat(phone,startNum=3,endNum=7,character=' '){
|
||||||
|
let phoneStr = phone;
|
||||||
|
phoneStr = phoneStr.replace(/\s*/g, "");
|
||||||
|
var phoneArr = [];
|
||||||
|
for(var i = 0; i < phoneStr.length; i++){
|
||||||
|
if (i==startNum||i==endNum){
|
||||||
|
phoneArr.push(`${character}` + phoneStr.charAt(i));
|
||||||
|
console.log(phoneArr);
|
||||||
|
} else {
|
||||||
|
phoneArr.push(phoneStr.charAt(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
phone = phoneArr.join("");
|
||||||
|
return phone;
|
||||||
|
},
|
||||||
// 昵称从第一个字开始,后面的都用"*"代替
|
// 昵称从第一个字开始,后面的都用"*"代替
|
||||||
hideName(name,num){
|
hideName(name,num){
|
||||||
return `${name.substr(0, 1)}****${name.substr(name.length-1)}`
|
return `${name.substr(0, 1)}****${name.substr(name.length-1)}`
|
||||||
|
|
|
@ -28,14 +28,15 @@
|
||||||
<image class="icon" src="/static/iocn/tel.png" mode=""></image>
|
<image class="icon" src="/static/iocn/tel.png" mode=""></image>
|
||||||
<view class="feedback-tel-con">
|
<view class="feedback-tel-con">
|
||||||
<view class="text">服务监督电话:</view>
|
<view class="text">服务监督电话:</view>
|
||||||
<view class="tel bold">156 1566 0510</view>
|
<!-- <view class="tel bold">156 1566 0510</view> -->
|
||||||
|
<view class="tel bold">{{feedbackPhone}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="feedback-con">
|
<view class="feedback-con">
|
||||||
<image class="icon" src="/static/iocn/date.png" mode=""></image>
|
<image class="icon" src="/static/iocn/date.png" mode=""></image>
|
||||||
<view class="feedback-tel-con">
|
<view class="feedback-tel-con">
|
||||||
<view class="text">反馈受理时间:</view>
|
<view class="text">反馈受理时间:</view>
|
||||||
<view class="tel bold">9:00 - 18:00</view>
|
<view class="tel bold">{{feedbackTime}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -50,6 +51,7 @@
|
||||||
import statusNav from '../../components/status-nav.vue';
|
import statusNav from '../../components/status-nav.vue';
|
||||||
import footTabOne from "../../components/foot-tabs/foot-tab-one.vue"
|
import footTabOne from "../../components/foot-tabs/foot-tab-one.vue"
|
||||||
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
|
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
|
||||||
|
import { uploadImg } from '@/jsFile/public-api.js';
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
@ -60,37 +62,17 @@
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isReturn: false,
|
isReturn: false,
|
||||||
typeData: [{
|
// 已经类型数组
|
||||||
title: "未解决问题",
|
typeData: [],
|
||||||
state: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "处理不及时",
|
|
||||||
state: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "软件问题",
|
|
||||||
state: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "报修问题",
|
|
||||||
state: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "服务投诉",
|
|
||||||
state: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "其他问题反馈",
|
|
||||||
state: false
|
|
||||||
},
|
|
||||||
],
|
|
||||||
typeNum: 0,
|
typeNum: 0,
|
||||||
opinion: '',
|
opinion: '',
|
||||||
name: '',
|
name: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
imgSrc: '',
|
imgSrc: '',
|
||||||
flag: true
|
flag: true,
|
||||||
|
feedbackPhone:'',//服务监督电话
|
||||||
|
feedbackTime:'',//反馈受理时间
|
||||||
|
type_id:''//意见类型id
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
@ -103,20 +85,23 @@
|
||||||
if (this.flag) {
|
if (this.flag) {
|
||||||
this.flag = false;
|
this.flag = false;
|
||||||
let params = {
|
let params = {
|
||||||
a: this.typeData[this.typeNum].title,
|
type_id: this.type_id,
|
||||||
b: this.opinion,
|
picture: this.imgSrc,
|
||||||
c: this.name,
|
contact_name: this.name,
|
||||||
d: this.phone,
|
contact_phone: this.phone,
|
||||||
e: this.imgSrc
|
content: this.opinion
|
||||||
}
|
}
|
||||||
console.log(params, 107);
|
this.$requst.post('/universal/api.feedback/feedback',params).then(res=>{
|
||||||
// this.$requst.post('',params).then(res=>{
|
if(res.code) {
|
||||||
// if(res.code) {
|
this.$toolAll.tools.showToast('反馈成功');
|
||||||
// uni.navigateBack({delta:1})
|
this.imgSrc = '';
|
||||||
// } else {
|
this.name = '';
|
||||||
// this.flag = true;
|
this.phone = '';
|
||||||
// }
|
this.opinion = '';
|
||||||
// })
|
} else {
|
||||||
|
this.flag = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -139,23 +124,13 @@
|
||||||
console.log( uni.getStorageSync("token"))
|
console.log( uni.getStorageSync("token"))
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
success: (chooseImageRes) => {
|
success: (chooseImageRes) => {
|
||||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
const tempFilePaths = chooseImageRes.tempFilePaths[0];
|
||||||
this.imgSrc = chooseImageRes.tempFilePaths[0]
|
this.imgSrc = tempFilePaths;
|
||||||
uni.uploadFile({
|
uploadImg({path:tempFilePaths}).then(res=>{
|
||||||
url: app.globalData.hostapi+'/universal/api.upload/upload', //仅为示例,非真实的接口地址
|
if(res.code) {
|
||||||
filePath: tempFilePaths[0],
|
this.$toolAll.tools.showToast('上传成功');
|
||||||
name: 'image',
|
}
|
||||||
header:{
|
})
|
||||||
token: uni.getStorageSync("token")
|
|
||||||
},
|
|
||||||
formData: {
|
|
||||||
dir:"images"
|
|
||||||
},
|
|
||||||
success: (uploadFileRes) => {
|
|
||||||
console.log(uploadFileRes)
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -164,17 +139,32 @@
|
||||||
checkFeedback() {
|
checkFeedback() {
|
||||||
this.$requst.get('/universal/api.feedback/feedback_type', {
|
this.$requst.get('/universal/api.feedback/feedback_type', {
|
||||||
page: 1,
|
page: 1,
|
||||||
list_rows: 20
|
list_rows: 200
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
let newData = res.data;
|
||||||
|
if(res.code){
|
||||||
|
this.typeData = [];
|
||||||
|
// 反馈受理时间
|
||||||
|
this.feedbackTime = `${newData.start_time} - ${newData.end_time}`;
|
||||||
|
// 服务监督电话
|
||||||
|
this.feedbackPhone = this.$toolAll.tools.phoneAddChat(newData.phone);
|
||||||
|
if(newData.type_list.length) {
|
||||||
|
newData.type_list.forEach(item=>{
|
||||||
|
let obj = {
|
||||||
|
title:item.name,
|
||||||
|
id:item.type_id
|
||||||
|
}
|
||||||
|
this.typeData.push(obj);
|
||||||
|
})
|
||||||
|
// 初始化意见类型id
|
||||||
|
this.type_id = this.typeData[0].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
opinionType(index) {
|
opinionType(index) {
|
||||||
this.typeNum = index;
|
this.typeNum = index;
|
||||||
// for (var i = 0; i < this.typeData.length; i++) {
|
this.type_id = this.typeData[index].id;
|
||||||
// this.typeData[i].state = false
|
|
||||||
// }
|
|
||||||
// this.typeData[index].state = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -230,7 +220,7 @@
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
color: #9f9898;
|
color: #000000;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: 16rpx;
|
margin-bottom: 16rpx;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
@ -195,7 +195,7 @@
|
||||||
<scroll-view scroll-x>
|
<scroll-view scroll-x>
|
||||||
<view :class="solutionList.length == 4 ? 'disjbac' : 'disac'">
|
<view :class="solutionList.length == 4 ? 'disjbac' : 'disac'">
|
||||||
<view @tap="goDetail(0,item.id)" class="posir flexs" v-for="(item,index) in solutionList" :key="index" style="width: 23%;height: 214rpx;" :style="{marginRight: solutionList.length != 4 ? '20rpx' : ''}">
|
<view @tap="goDetail(0,item.id)" class="posir flexs" v-for="(item,index) in solutionList" :key="index" style="width: 23%;height: 214rpx;" :style="{marginRight: solutionList.length != 4 ? '20rpx' : ''}">
|
||||||
<image style="width: 100%;height: 214rpx;" class="radius10 " :src="item.imgsrc" mode="widthFix"></image>
|
<image style="width: 100%;height: 214rpx;" class="radius10 " :src="item.imgsrc" mode="aspectFill"></image>
|
||||||
<view class="posia solution-title clips1">{{item.title}}</view>
|
<view class="posia solution-title clips1">{{item.title}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -363,9 +363,10 @@
|
||||||
},
|
},
|
||||||
// 查询解决方案类型
|
// 查询解决方案类型
|
||||||
getPlanType(){
|
getPlanType(){
|
||||||
this.$requst.post('/universal/api.solution/solution_type').then(res=>{
|
this.$requst.get('/universal/api.solution/solution',{page:1,list_rows:20}).then(res=>{
|
||||||
if(res.code) {
|
if(res.code) {
|
||||||
res.data.forEach(item=>{
|
this.solutionList = [];
|
||||||
|
res.data.data.forEach(item=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
id:item.id,
|
id:item.id,
|
||||||
title:item.name,
|
title:item.name,
|
||||||
|
@ -373,7 +374,7 @@
|
||||||
}
|
}
|
||||||
this.solutionList.push(obj);
|
this.solutionList.push(obj);
|
||||||
})
|
})
|
||||||
console.log(this.solutionList,340);
|
// console.log(this.solutionList,340);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -427,8 +428,11 @@
|
||||||
},
|
},
|
||||||
// 前往解决方案详情、常见故障详情
|
// 前往解决方案详情、常见故障详情
|
||||||
goDetail(index,id) {
|
goDetail(index,id) {
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url:`/pagesB/plan-fault-product-detail/detail?index=${index}&id=${id}`
|
||||||
|
// })
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:`/pagesB/plan-fault-product-detail/detail?index=${index}&id=${id}`
|
url:`/pagesB/plan-fault/plan-fault?index=${index}&type_id=${id}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 前往消息列表页面
|
// 前往消息列表页面
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
methods: {
|
methods: {
|
||||||
// 查询消息列表
|
// 查询消息列表
|
||||||
getMessageList(){
|
getMessageList(){
|
||||||
this.$requst.get('/universal/api.message/message_list').then(res=>{
|
this.$requst.get('/universal/api.message/message_list',{page: 1,list_rows: 200}).then(res=>{
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,27 +106,22 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取个人信息
|
// 获取个人信息
|
||||||
|
|
||||||
getData(){
|
getData(){
|
||||||
this.$requst.get('/universal/api.user/user_info').then(res => {
|
this.$requst.get('/universal/api.user/user_info').then(res => {
|
||||||
if (res.code == 1 && res.data.length != 1) {
|
if (res.code == 1 && res.data.length != 1) {
|
||||||
console.log(res.data)
|
this.nickname=res.data.nickname
|
||||||
this.nickname=res.data.nickname
|
this.full_name=res.data.name
|
||||||
this.full_name=res.data.name
|
if(res.data.sex==0){
|
||||||
if(res.data.sex==0){
|
this.genderNum=1
|
||||||
this.genderNum=1
|
}else{
|
||||||
}else{
|
this.genderNum=res.data.sex
|
||||||
this.genderNum=res.data.sex
|
}
|
||||||
}
|
this.contact_number=res.data.phone
|
||||||
this.contact_number=res.data.phone
|
this.e_mail=res.data.email
|
||||||
this.e_mail=res.data.email
|
this.id_card_no=res.data.idcard
|
||||||
this.id_card_no=res.data.idcard
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 提交保存事件
|
// 提交保存事件
|
||||||
sumbmitData(){
|
sumbmitData(){
|
||||||
if(this.checkEmpty()){
|
if(this.checkEmpty()){
|
||||||
|
@ -199,27 +194,13 @@
|
||||||
count:1,
|
count:1,
|
||||||
sourceType:['album'],
|
sourceType:['album'],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
let tempImg = res.tempFilePaths;
|
let tempImg = res.tempFilePaths[0];
|
||||||
this.imgList[index] = tempImg[0];
|
this.imgList[index] = tempImg;
|
||||||
let params = {
|
uploadImg({path:tempImg}).then(res=>{
|
||||||
token: uni.getStorageSync('token'),
|
if(res.code) {
|
||||||
dir: 'images',
|
this.$toolAll.tools.showToast('上传成功');
|
||||||
from:tempImg[0]
|
}
|
||||||
}
|
|
||||||
console.log(params,104);
|
|
||||||
uploadImg(params).then(res=>{
|
|
||||||
console.log(res);
|
|
||||||
})
|
})
|
||||||
// this.$requst.upload('file/upload/image',{file:tempImg[i]}).then(res=>{
|
|
||||||
// if(this.imgArr.length!=9){
|
|
||||||
// // this.imgArr.push(this.$http + res.data.src);
|
|
||||||
// }
|
|
||||||
// if(num==tempImg.length){
|
|
||||||
// this.$toolAll.tools.showToast('上传成功(*^▽^*)')
|
|
||||||
// } else {
|
|
||||||
// this.$toolAll.tools.showToast('上传中...')
|
|
||||||
// }
|
|
||||||
// },error=>{})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</container-subgroup>
|
</container-subgroup>
|
||||||
|
<nothing-page v-if="dataList.length==0" content="暂无更多列表数据"></nothing-page>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -42,12 +43,14 @@
|
||||||
size:10,
|
size:10,
|
||||||
page:1,
|
page:1,
|
||||||
total:0,
|
total:0,
|
||||||
|
type_id:'',//解决方案类型id
|
||||||
dataList:[]
|
dataList:[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(op) {
|
onLoad(op) {
|
||||||
this.ifPlanFault = `${['解决方案','常见故障'][op.index*1]}`;
|
this.ifPlanFault = `${['解决方案','常见故障'][op.index*1]}`;
|
||||||
this.current = op.index*1;
|
this.current = op.index*1;
|
||||||
|
if(op.type_id!=undefined) this.type_id = op.type_id;
|
||||||
this.getPlanFault();
|
this.getPlanFault();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -65,7 +68,7 @@
|
||||||
];
|
];
|
||||||
let params = [
|
let params = [
|
||||||
{
|
{
|
||||||
type_id:1,
|
type_id:this.type_id,
|
||||||
list_rows:this.size,
|
list_rows:this.size,
|
||||||
page:this.page
|
page:this.page
|
||||||
},
|
},
|
||||||
|
|
|
@ -116,7 +116,7 @@
|
||||||
// 设置
|
// 设置
|
||||||
getSettings(){
|
getSettings(){
|
||||||
this.$requst.post('/universal/api.settings/settings').then(res=>{
|
this.$requst.post('/universal/api.settings/settings').then(res=>{
|
||||||
if(res.code==1){
|
if(res.code){
|
||||||
|
|
||||||
// uni.navigateBack({delta:1})
|
// uni.navigateBack({delta:1})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue