From 779f654e0993552e422c81514185fbf200728a34 Mon Sep 17 00:00:00 2001
From: chen <2659004835@qq.com>
Date: Mon, 28 Mar 2022 18:40:48 +0800
Subject: [PATCH] =?UTF-8?q?=E5=9F=9F=E5=90=8D=E9=85=8D=E7=BD=AE=E6=9B=BF?=
=?UTF-8?q?=E6=8D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 12 +-
jsFile/requst.js | 15 +-
jsFile/tools.js | 2 +-
pages/feedback/feedback.vue | 154 +++++++++++---------
pages/tabbar/pagehome/pagehome.vue | 4 +-
pagesB/i-want-evaluate/i-want-evaluate.vue | 36 ++++-
pagesB/plan-fault-product-detail/detail.vue | 2 +-
pagesB/plan-fault/plan-fault.vue | 2 +-
pagesB/service-range/service-range.vue | 4 +-
9 files changed, 141 insertions(+), 90 deletions(-)
diff --git a/App.vue b/App.vue
index 933c09e..28f5a91 100644
--- a/App.vue
+++ b/App.vue
@@ -3,19 +3,23 @@
globalData:{
projectname:'', // 项目名称
lat:'', // 公司地址维度
- lng:'' // 公司地址经度
+ lng:'' ,// 公司地址经度
+ hostapi:'' // 域名配置
},
// 优先于show方法
onLaunch: function() {
// 配置全局域名
// #ifdef APP-PLUS
- uni.setStorageSync('hostapi','http://maintain.7and5.cn');
+ // uni.setStorageSync('hostapi','http://maintain.7and5.cn');
+ getApp().globalData.hostapi = 'http://maintain.7and5.cn';
// #endif
// #ifdef MP-WEIXIN
- uni.setStorageSync('hostapi','http://maintain.7and5.cn');
+ // uni.setStorageSync('hostapi','http://maintain.7and5.cn');
+ getApp().globalData.hostapi = 'http://maintain.7and5.cn';
// #endif
// #ifdef H5
- uni.setStorageSync('hostapi','/web');
+ // uni.setStorageSync('hostapi','/web');
+ getApp().globalData.hostapi = '/web';
// #endif
},
onShow: function() {
diff --git a/jsFile/requst.js b/jsFile/requst.js
index 5a3f313..d3811bb 100644
--- a/jsFile/requst.js
+++ b/jsFile/requst.js
@@ -1,7 +1,16 @@
// 判断当前环境
const ENV = process.env.NODE_ENV;
console.log(ENV,'当前环境'); // development:开发环境 test:测试环境 production:生产环境
-
+// 配置全局域名
+// #ifdef APP-PLUS
+ const hostapi = 'http://maintain.7and5.cn';
+// #endif
+// #ifdef MP-WEIXIN
+ const hostapi = 'http://maintain.7and5.cn';
+// #endif
+// #ifdef H5
+ const hostapi = '/web';
+// #endif
// 清理所有缓存并前往授权页
const goLogin = () => {
uni.clearStorageSync();
@@ -77,7 +86,7 @@ const request = (method, url, options) => {
params.token = uni.getStorageSync('token');
return new Promise((resolve, reject) => {
uni.request({
- url: `${uni.getStorageSync('hostapi')}${url}`,
+ url: `${hostapi}${url}`,
method: methods,
data: params,
header: headers,
@@ -108,7 +117,7 @@ const uploadFile = (url, options) => {
console.log(tempData,108);
return new Promise((resolve, reject) => {
uni.uploadFile({
- url: `${uni.getStorageSync('hostapi')}${url}`,
+ url: `${hostapi}${url}`,
filePath: tempData.file,
name: 'image',
fileType:'image',
diff --git a/jsFile/tools.js b/jsFile/tools.js
index 531362d..d9bbd38 100644
--- a/jsFile/tools.js
+++ b/jsFile/tools.js
@@ -405,7 +405,7 @@ const tools = {
if (res.code) {
var params = {code:res.code}
uni.request({
- url: `${uni.getStorageSync('hostapi')}/api/user/login`,
+ url: `${getApp().globalData.hostapi}/api/user/login`,
method: 'post',
data: params,
header: {
diff --git a/pages/feedback/feedback.vue b/pages/feedback/feedback.vue
index e18e78a..50348aa 100644
--- a/pages/feedback/feedback.vue
+++ b/pages/feedback/feedback.vue
@@ -3,64 +3,41 @@
-
- 意见类型
-
-
+ 意见类型
-
- {{item.title}}
-
+ {{item.title}}
-
-
-
-
-
-
-
-
-
- 请上传图片
-
+
+
+
+
+
+
+
+ 请上传图片
+
-
-
-
+
-
- 服务监督电话:
-
-
- 156 1566 0510
-
+ 服务监督电话:
+ 156 1566 0510
-
-
+
-
- 反馈受理时间:
-
-
- 9:00 - 18:00
-
+ 反馈受理时间:
+ 9:00 - 18:00
-
+
-
@@ -78,37 +55,73 @@
data() {
return {
isReturn:false,
- typeData: [{
- title: "未解决问题",
- state: false
- },
- {
- title: "处理不及时",
- state: false
- },
- {
- title: "软件问题",
- state: false
- },
- {
- title: "报修问题",
- state: true
- },
- {
- title: "服务投诉",
- state: false
- },
- {
- title: "其他问题反馈",
- state: false
- },
- ]
+ typeData: [
+ {title: "未解决问题",state: false},
+ {title: "处理不及时",state: false},
+ {title: "软件问题",state: false},
+ {title: "报修问题",state: false},
+ {title: "服务投诉",state: false},
+ {title: "其他问题反馈",state: false},
+ ],
+ typeNum:0,
+ opinion:'',
+ name:'',
+ phone:'',
+ imgSrc:'',
+ flag:true
}
},
onLoad() {
this.checkFeedback();
},
methods: {
+ // 提交反馈事件
+ submitData(){
+ if(this.checkEmpty()) {
+ if(this.flag) {
+ this.flag = false;
+ let params = {
+ a:this.typeData[this.typeNum].title,
+ b:this.opinion,
+ c:this.name,
+ d:this.phone,
+ e:this.imgSrc
+ }
+ console.log(params,107);
+ // this.$requst.post('',params).then(res=>{
+ // if(res.code) {
+ // uni.navigateBack({delta:1})
+ // } else {
+ // this.flag = true;
+ // }
+ // })
+ }
+ }
+ },
+ // 判空事件
+ checkEmpty() {
+ let result = false;
+ if(!this.opinion) {
+ this.$toolAll.tools.showToast('请输入意见或建议');
+ } else if(!this.name) {
+ this.$toolAll.tools.showToast('请输入联系人姓名');
+ } else if(this.$toolAll.tools.isPhone(this.phone)) {
+ this.$toolAll.tools.showToast('请正确输入联系人电话');
+ } else {
+ result = true;
+ }
+ return result;
+ },
+ // 图片选择事件
+ chooseImg(){
+ uni.chooseImage({
+ count:1,
+ sourceType:['album','camera'],
+ success: (res) => {
+ this.imgSrc = res.tempFilePaths[0]
+ }
+ })
+ },
// 查询意见反馈类型
checkFeedback(){
this.$requst.get('/universal/api.feedback/feedback_type',{page:1,list_rows:20}).then(res=>{
@@ -116,10 +129,11 @@
})
},
opinionType(index) {
- for (var i = 0; i < this.typeData.length; i++) {
- this.typeData[i].state = false
- }
- this.typeData[index].state = true
+ this.typeNum = index;
+ // for (var i = 0; i < this.typeData.length; i++) {
+ // this.typeData[i].state = false
+ // }
+ // this.typeData[index].state = true
}
}
}
diff --git a/pages/tabbar/pagehome/pagehome.vue b/pages/tabbar/pagehome/pagehome.vue
index 6d3b011..d48d84b 100644
--- a/pages/tabbar/pagehome/pagehome.vue
+++ b/pages/tabbar/pagehome/pagehome.vue
@@ -372,7 +372,7 @@
let obj = {
id:item.id,
title:item.name,
- imgsrc: uni.getStorageSync('hostapi') + '/' + item.cover_img,
+ imgsrc: getApp().globalData.hostapi + '/' + item.cover_img,
}
this.solutionList.push(obj);
})
@@ -402,7 +402,7 @@
let obj = {
id:item.id,
title:item.title,
- imgsrc: uni.getStorageSync('hostapi') + '/' + item.cover_img,
+ imgsrc: getApp().globalData.hostapi + '/' + item.cover_img,
content:item.summary,
views:item.reading
}
diff --git a/pagesB/i-want-evaluate/i-want-evaluate.vue b/pagesB/i-want-evaluate/i-want-evaluate.vue
index ed0c72e..836b44a 100644
--- a/pagesB/i-want-evaluate/i-want-evaluate.vue
+++ b/pagesB/i-want-evaluate/i-want-evaluate.vue
@@ -5,10 +5,10 @@
- 长沙XXXXXXXXX项目名称
- GD20220108-1002
+ {{project_name}}
+ {{project_number}}
- 服务时间:2022-01-11 15 : 27
+ 服务时间:{{project_time}}
@@ -29,7 +29,7 @@
- 提交保存
+ 提交保存
@@ -48,12 +48,38 @@
{imgsrc:''},
{imgsrc:''}
],
+ project_id:'',
+ project_name:'长沙XXXXXXXXX项目名称',
+ project_number:'GD20220108-1002',
+ project_time:'2022-01-11 15 : 27',
rateNum:5,//技术服务评分
attitudeNum:5,//客服态度评分
- serviceExperience:''//服务体验
+ serviceExperience:'',//服务体验
+ flag:true
}
},
methods: {
+ // 提交保存事件
+ submitData(){
+ if(this.flag) {
+ this.flag = false;
+ let params = {
+ id:this.project_id,
+ a:this.serviceExperience,
+ b:this.imgList[0].imgsrc,
+ c:this.imgList[1].imgsrc,
+ d:this.imgList[2].imgsrc,
+ f:this.rateNum,
+ g:this.attitudeNum
+ }
+ console.log(params,74);
+ // this.$requst.post('',params).then(res=>{
+ // if(res.code) {
+ // uni.navigateBack({delta:1})
+ // }
+ // })
+ }
+ },
// 选择图片
chooseImg(index){
uni.chooseImage({
diff --git a/pagesB/plan-fault-product-detail/detail.vue b/pagesB/plan-fault-product-detail/detail.vue
index 11a8cc6..28aac6c 100644
--- a/pagesB/plan-fault-product-detail/detail.vue
+++ b/pagesB/plan-fault-product-detail/detail.vue
@@ -54,7 +54,7 @@
// 日期转换
this.dataObj.create_time = this.$toolAll.tools.timestampToTime(this.dataObj.create_time);
// 封面图
- this.dataObj.cover_img = uni.getStorageSync('hostapi') + '/' + this.dataObj.cover_img,
+ this.dataObj.cover_img = getApp().globalData.hostapi + '/' + this.dataObj.cover_img,
this.rich_text = this.$toolAll.tools.escape2Html(this.dataObj.content);
}
})
diff --git a/pagesB/plan-fault/plan-fault.vue b/pagesB/plan-fault/plan-fault.vue
index 011ebb4..da71e1f 100644
--- a/pagesB/plan-fault/plan-fault.vue
+++ b/pagesB/plan-fault/plan-fault.vue
@@ -80,7 +80,7 @@
res.data.data.forEach(item=>{
let obj = {
id:item.id,
- cover_img: uni.getStorageSync('hostapi') + '/' + item.cover_img,
+ cover_img: getApp().globalData.hostapi + '/' + item.cover_img,
title:item.title,//标题
summary:item.summary,//描述
hot:item.hot,//热度
diff --git a/pagesB/service-range/service-range.vue b/pagesB/service-range/service-range.vue
index ce63115..5fa06ce 100644
--- a/pagesB/service-range/service-range.vue
+++ b/pagesB/service-range/service-range.vue
@@ -25,9 +25,7 @@
详细地址 *
-
-
-
+
服务范围 *