域名配置替换

master
chen 2022-03-28 18:40:48 +08:00
parent 73e2f94fe3
commit 779f654e09
9 changed files with 141 additions and 90 deletions

12
App.vue
View File

@ -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() {

View File

@ -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',

View File

@ -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: {

View File

@ -3,64 +3,41 @@
<statusNav :ifReturn="isReturn" navBarTitle="意见反馈"></statusNav>
<container-subgroup-two>
<view slot="content" style="margin: 0 -30rpx;">
<view class="opinion-type">
意见类型
</view>
<view class="opinion-type">意见类型</view>
<view class="opinion-type-content">
<view class="li" @click="opinionType(index)" :class="item.state?'on':''"
v-for="(item,index) in typeData">
{{item.title}}
</view>
<view class="li" @click="opinionType(index)" :class="typeNum==index ? 'on':''" v-for="(item,index) in typeData">{{item.title}}</view>
</view>
<view class="feedback-input">
<input type="text" class="inputCss" placeholder="请填写您的意见或建议内容" placeholder-class="inputCss-input"
value="" />
<input type="text" class="inputCss" placeholder="请输入联系人姓名" placeholder-class="inputCss-input"
value="" />
<input type="text" class="inputCss" placeholder="请输入联系人电话" placeholder-class="inputCss-input"
value="" />
<view class="fault-pictures">
<image class="img" src="../../static/iocn/gz.png" mode="aspectFill"></image>
<view class="text">
请上传图片
</view>
<input type="text" v-model="opinion" class="inputCss" placeholder="请填写您的意见或建议内容" placeholder-class="inputCss-input" />
<input type="text" v-model="name" class="inputCss" placeholder="请输入联系人姓名" placeholder-class="inputCss-input" />
<input type="text" v-model="phone" class="inputCss" placeholder="请输入联系人电话" placeholder-class="inputCss-input" />
<view class="fault-pictures" @tap="chooseImg">
<image :src="imgSrc" v-if="imgSrc!=''" mode="aspectFill" lazy-load style="width: 100%;"></image>
<view class="disjcac fc" v-if="imgSrc==''">
<image class="img" src="/static/iocn/gz.png" mode="aspectFill" lazy-load></image>
<view class="text">请上传图片</view>
</view>
</view>
</view>
<view class="feedback-approach">
<view class="feedback-con">
<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="text">
服务监督电话
</view>
<view class="tel">
156 1566 0510
</view>
<view class="text">服务监督电话</view>
<view class="tel">156 1566 0510</view>
</view>
</view>
<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="text">
反馈受理时间
</view>
<view class="tel">
9:00 - 18:00
</view>
<view class="text">反馈受理时间</view>
<view class="tel">9:00 - 18:00</view>
</view>
</view>
</view>
<button class="submit-button" type="default">提交反馈</button>
<button class="submit-button" @tap="submitData" type="default">提交反馈</button>
</view>
</container-subgroup-two>
<footTabOne :current="3"></footTabOne>
</view>
</template>
@ -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
}
}
}

View File

@ -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
}

View File

@ -5,10 +5,10 @@
<view slot="content" style="margin: 0 -30rpx;">
<view class="bacf fon28 pad-sx30 pad-zy40">
<view class=" bold disjbac fw line-h50">
<view class="mar-y20">长沙XXXXXXXXX项目名称</view>
<view>GD20220108-1002</view>
<view class="mar-y20">{{project_name}}</view>
<view>{{project_number}}</view>
</view>
<view class="mar-s10 mar-x30" style="color: #6b6a6a;">服务时间2022-01-11 15 : 27</view>
<view class="mar-s10 mar-x30" style="color: #6b6a6a;">服务时间{{project_time}}</view>
<view class="radius20 pad30 dis" style="border: 2rpx solid #dcdcdc;">
<image src="/static/public/icon-evaluate-pen.png" mode="widthFix" lazy-load style="width: 25rpx;height: 30rpx;"></image>
<textarea v-model="serviceExperience" class="fon24 mar-z20 width100" style="height: 200rpx;" placeholder="写下您的服务体验,帮助我们更好的管理提升" placeholder-style="font-size:24rpx;color: #aaaaaa;" />
@ -29,7 +29,7 @@
</view>
</view>
<!-- 提交保存 -->
<view class="person-btn" style="margin-top: 50rpx;">提交保存</view>
<view class="person-btn" @tap="submitData" style="margin-top: 50rpx;">提交保存</view>
</view>
</container-subgroup>
</view>
@ -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({

View File

@ -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);
}
})

View File

@ -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,//

View File

@ -25,9 +25,7 @@
</view>
<view class="bbot disac pad-sx30 pad-zy30">
<view class="mar-y30 flexs">详细地址 <text style="color: red;">*</text></view>
<view class="disac">
<input class="fon28" type="text" v-model="detailed_address" placeholder="请输入详细地址" placeholder-style="font-size:28rpx;"/>
</view>
<input class="fon28 width100" type="text" v-model="detailed_address" placeholder="请输入详细地址" placeholder-style="font-size:28rpx;"/>
</view>
<view class="bbot disac pad-sx30 pad-zy30">
<view class="mar-y30 flexs">服务范围 <text style="color: red;">*</text></view>