Commit 627840de by 莫晓莉

mxl

parent 16f7059d
...@@ -32,7 +32,7 @@ export const applyProject = (data) => { ...@@ -32,7 +32,7 @@ export const applyProject = (data) => {
//意见反馈 //意见反馈
export const satisfactionEvaluation = (data) => { export const satisfactionEvaluation = (data) => {
return request('satisfactionEvaluation', data) return request('satisfactionEvaluation', data,'POST')
} }
//获取已审批的项目 //获取已审批的项目
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
margin-top: 25upx; margin-top: 25upx;
border: 1upx solid #ccc; border: 1upx solid #ccc;
padding: 15upx; padding: 15upx;
font-size: 25upx; font-size: 30upx;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
...@@ -87,6 +87,8 @@ ...@@ -87,6 +87,8 @@
/* margin-right: 25upx; /* margin-right: 25upx;
margin-bottom: 15upx; */ margin-bottom: 15upx; */
margin:10upx; margin:10upx;
/* border:1upx soild #ccc;
box-sizing: border-box; */
} }
.imgs-area .add-box { .imgs-area .add-box {
...@@ -94,7 +96,7 @@ ...@@ -94,7 +96,7 @@
box-sizing: border-box; box-sizing: border-box;
font-size: 25upx; font-size: 25upx;
/* padding-top: 30upx; */ /* padding-top: 30upx; */
/* border: 1upx solid #ccc; */ border: 1upx solid #ccc;
background: #F4F7F8; background: #F4F7F8;
width: 200upx; width: 200upx;
height: 200upx; height: 200upx;
...@@ -265,4 +267,11 @@ ...@@ -265,4 +267,11 @@
margin:20upx; margin:20upx;
font-size:55upx; font-size:55upx;
} }
.trangle{
display:inline-block;
border-top: 15upx solid;
border-right: 8upx solid;
border-left: 8upx solid;
border-color: black transparent transparent transparent;
}
/***************************************** */ /***************************************** */
...@@ -24,11 +24,21 @@ ...@@ -24,11 +24,21 @@
</view> </view>
</view> --> </view> -->
<view class="category-title">
反馈项目<text style="color:red;">*</text>
</view>
<picker style="border:1upx solid #ccc;" @change="proChange" :value="projectTypeIndex" :range="projectTypeList" range-key="projectName">
<view class="flex-a-c" style="height:80upx;line-height: 80upx;padding:0 25upx;">
<view class="flex1 picker-content">{{projectTypeIndex>-1?projectTypeList[projectTypeIndex].projectName:'点击选择'}}</view>
<view class="trangle"></view>
</view>
</picker>
<view class="category-title"> <view class="category-title">
反馈内容<text style="color:red;">*</text> 反馈内容<text style="color:red;">*</text>
</view> </view>
<textarea v-model="evaluationForm.remark" class="suggest-area" placeholder="请详细描述您的问题或建议" name="content" ></textarea> <textarea v-model="evaluationForm.remark" class="suggest-area" placeholder="请详细描述您的问题或建议" name="content"></textarea>
<view class="category-title"> <view class="category-title">
上传图片 上传图片
...@@ -36,9 +46,9 @@ ...@@ -36,9 +46,9 @@
</view> </view>
<view class="imgs-area"> <view class="imgs-area">
<view class="img-box" v-for="(item,index) in imageList" :key="index"> <view class="img-box" v-for="(item,index) in imageUrl" :key="index">
<image class="pic" :src="item" @tap="previewPictures(item)"/> <image class="pic" :src="item" @tap="previewPictures(item)" />
<image @click="del(index)" class="delete-icon" src="../../static/comment/delete.png" /> <image @click="del(index)" class="delete-icon" src="../../static/comment/delete.png" />
</view> </view>
<view class="flex-ac-jc add-box" @click="uploadPictures"> <view class="flex-ac-jc add-box" @click="uploadPictures">
<image class="add-btn" style='' src='../../static/comment/add-icon.png'></image> <image class="add-btn" style='' src='../../static/comment/add-icon.png'></image>
...@@ -49,18 +59,23 @@ ...@@ -49,18 +59,23 @@
<view> <view>
<view class="btns-area"> <view class="btns-area">
<button class="send-btn flex-ac-jc">提交反馈</button> <button @click="satisfactionEvaluation" class="send-btn flex-ac-jc">提交反馈</button>
<button class="cancel-btn flex-ac-jc">取 消</button> <button @click="back" class="cancel-btn flex-ac-jc">取 消</button>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import {
satisfactionEvaluation
} from "@/api/login"
export default { export default {
data() { data() {
return { return {
imageList: [], projectId:0,
evaluationForm: {},
imageUrl: [], //
starsList: [{ starsList: [{
id: 1, id: 1,
content: "★", content: "★",
...@@ -111,40 +126,41 @@ ...@@ -111,40 +126,41 @@
// } // }
// ], // ],
starLevel: [ starLevel: [{
{ level: 1,
level:1,
name: "不满意", name: "不满意",
face: "../../static/comment/level1.png" face: "../../static/comment/level1.png"
}, },
{ {
level:2, level: 2,
name: "较不满意", name: "较不满意",
face: "../../static/comment/level2.png" face: "../../static/comment/level2.png"
}, },
{ {
level:3, level: 3,
name: "一般", name: "一般",
face: "../../static/comment/level3.png" face: "../../static/comment/level3.png"
}, },
{ {
level:4, level: 4,
name: "较满意", name: "较满意",
face: "../../static/comment/level4.png" face: "../../static/comment/level4.png"
}, },
{ {
level:5, level: 5,
name: "很满意", name: "很满意",
face: "../../static/comment/praise.png" face: "../../static/comment/praise.png"
}, },
], ],
cur_starLevel:0 cur_starLevel: 0
} }
}, },
methods: { methods: {
// uni-app上传图片
uploadPictures() { uploadPictures() {
var that = this;
uni.chooseImage({ uni.chooseImage({
count: 6, //默认9 count: 6, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
...@@ -152,22 +168,41 @@ ...@@ -152,22 +168,41 @@
success: res => { success: res => {
console.log(res) console.log(res)
// 将选择的本地图片赋值给data中定义的images变量 // 将选择的本地图片赋值给data中定义的images变量
this.imageList =this.imageList.concat(res.tempFilePaths); // Start
console.log(this.imageList) var tempFilePaths = res.tempFilePaths;
tempFilePaths.forEach(item => {
this.urlTobase64(item);
});
// end
} }
}) })
}, },
urlTobase64(url) {
var that=this;
uni.request({
url: url,
method: 'GET',
responseType: 'arraybuffer',
success: res => {
let base64 = uni.arrayBufferToBase64(res.data); //把arraybuffer转成base64
base64 = 'data:image/jpeg;base64,' + base64; //不加上这串字符,在页面无法显示
that.imageUrl = that.imageUrl.concat(base64);
that.evaluationForm.imageUrl=that.imageUrl;
}
});
},
/* /*
图片预览 图片预览
*/ */
previewPictures(item) { previewPictures(item) {
uni.previewImage({ uni.previewImage({
current: item, current: item,
urls: this.imageList urls: this.imageUrl
}) })
}, },
del(index){ del(index) {
this.imageList.splice(index, 1) this.imageUrl.splice(index, 1)
}, },
selStar(e) { selStar(e) {
...@@ -178,27 +213,26 @@ ...@@ -178,27 +213,26 @@
list[i].selected = i < idx ? true : false; list[i].selected = i < idx ? true : false;
} }
this.starsList = list; this.starsList = list;
this.cur_starLevel=idx-1; this.cur_starLevel = idx - 1;
}, },
// 提交反馈 // 提交反馈
//申请服务
satisfactionEvaluation() { satisfactionEvaluation() {
if (this.evaluationForm.remark==undefined) { if (this.evaluationForm.remark == undefined) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '请输入反馈内容' title: '请输入反馈内容'
}); });
return; return;
} }
if (this.disableLevelIndex==-1) { if (this.imageUrl.length==0) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '请上传照片' title: '请上传照片'
}); });
return; return;
} }
satisfactionEvaluation(this.evaluationForm).then(res => { satisfactionEvaluation( JSON.stringify(this.evaluationForm)).then(res => {
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
icon: 'success', icon: 'success',
...@@ -213,8 +247,8 @@ ...@@ -213,8 +247,8 @@
}) })
}, },
}
} }
}
</script> </script>
<style> <style>
......
...@@ -34,12 +34,39 @@ ...@@ -34,12 +34,39 @@
export default { export default {
onLoad: function() { onLoad: function() {
const token=uni.getStorageSync('token') const token=uni.getStorageSync('token');
console.log(token); const user=uni.getStorageSync('user');
if(token){ uni.setStorageSync('token',token);
uni.switchTab({ console.log("token=",token);
url:'/pages/login/login' console.log("user=",user);
}) if(!token){
// uni.switchTab({
// url:'/pages/login/login'
// })
uni.showModal({
title: '未登录',
content: '您未登录,需要登录后才能继续',
/**
* 如果需要强制登录,不显示取消按钮
*/
showCancel: !this.forcedLogin,
success: (res) => {
if (res.confirm) {
/**
* 如果需要强制登录,使用reLaunch方式
*/
if (this.forcedLogin) {
uni.reLaunch({
url: '../login/login'
});
} else {
uni.navigateTo({
url: '../login/login'
});
}
}
}
});
} }
// getUserByToken().then(res=>{ // getUserByToken().then(res=>{
......
...@@ -116,6 +116,7 @@ ...@@ -116,6 +116,7 @@
}, },
onShow() { onShow() {
// this.mylike(); // this.mylike();
}, },
methods: { methods: {
// ...mapMutations(['logout']), // ...mapMutations(['logout']),
......
export default { export default {
baseURL:'http://192.168.7.122:9100', //接口请求地址 baseURL:'http://192.168.7.122:9888/API-SERVER', //接口请求地址
fileURL:'http://192.168.7.122:9100' //文件请求地址 fileURL:'http://192.168.7.122:9100' //文件请求地址
} }
\ No newline at end of file
...@@ -12,6 +12,9 @@ let req = (method, p, reqMethod) => { ...@@ -12,6 +12,9 @@ let req = (method, p, reqMethod) => {
uni.request({ uni.request({
url: etc.baseURL + url, url: etc.baseURL + url,
method: reqMethod || 'GET', method: reqMethod || 'GET',
header: {
'Content-Type': reqMethod == "POST" ? 'application/x-www-form-urlencoded' : 'application/json'
},
data: { data: {
p: p ? p : {} p: p ? p : {}
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment