main
YXQ 1 year ago
parent ec7b52efb7
commit 9463a158aa
  1. 2
      app.js
  2. 44
      pages/feedback/feedback.js
  3. 2
      pages/feedback/feedback.wxml
  4. 1
      pages/login/login.js

@ -16,7 +16,7 @@ App({
globalData: {
// 本地环境
baseUrl:'http://192.168.51.200:8201/mall-portal',
baseUrl:'http://192.168.51.22:8201/mall-portal',
// 线上环境
// baseUrl:'https://portal-api.macrozheng.com',
token: '',

@ -8,7 +8,7 @@ Page({
*/
data: {
array: ['请选择', 'bug问题', '业务问题', '功能使用问题', '其他'],
objectArray: [{
problemArray: [{
id: 0,
name: '请选择'
},
@ -29,16 +29,16 @@ Page({
name: '其他'
}
],
index: 0,
srxI: '',
index: 0, //问题下标
problemStr:'',
//图片数组
addImgBtn: {
isBtn: true,
text: "+",
func: "addImage"
},
imageArr: []
imageArr: [], //显示图片列表
upImageArr: [], //需要上传的图片路径
},
bindPickerChange(e) {
@ -49,15 +49,24 @@ Page({
//提交数据
goMyorder() {
if(this.data.index === 0){
if (this.data.index === 0) {
wx.showToast({
title: '请选择问题类型',
});
return;
}
var problem = objectArray[this.data.index]; //问题类型
request.post(`/feedBack/push?type=${this.data.index}&describe=${problem}`).then(res=>{
var problem = this.data.problemArray[this.data.index]; //问题类型
var data = {
'type': this.data.index,
'describe': this.data.problemStr,
'imgs':this.data.upImageArr.toString
}
console.log(JSON.stringify(data))
request.post(`/feedBack/push`, data).then(res => {
wx.showToast({
title: 'title',
})
console.log(JSON.stringify(res.data))
});
// wx.switchTab({
// url: '../about/about',
@ -77,7 +86,7 @@ Page({
count: 1,
mediaType: ['image'],
sourceType: ['album'],
sizeType:['compressed'],
sizeType: ['compressed'],
success: res => {
var imgSrc = res.tempFiles[0].tempFilePath;
_this.addCallBackImage(imgSrc);
@ -88,7 +97,6 @@ Page({
//显示回调图片
addCallBackImage(imageSrc) {
console.log("imgSrc=" + imageSrc);
var temp = {
isBtn: false,
imgUrl: imageSrc,
@ -105,18 +113,20 @@ Page({
upImg(imageSrc) {
request.upImgFile(`/feedBack/upload`, imageSrc).then(res => {
var resObj = JSON.parse(res.data);
if(resObj.code === 500){
if (resObj.code > 400) {
wx.showModal({
title: '提示',
content: resObj.message,
complete: (res) => {
if (res.cancel) {
}
if (res.confirm) {
}
//移除图片
if (res.cancel) {}
if (res.confirm) {}
//上传失败后移除图片
}
})
} else {
//保存图片路径到数组
this.data.upImageArr.push(resObj.data.url);
}
});
},

@ -9,7 +9,7 @@
<text class="why">{{array[index]}}</text>
</picker>
</view>
<textarea class="textarea" placeholder="补充描述,有助于更好的处理问题。" placeholder-class="place"></textarea>
<textarea class="textarea" placeholder="补充描述,有助于更好的处理问题。" placeholder-class="place" value="{{problemStr}}"></textarea>
</view>
<view style="margin-top: 60rpx; font-size: 26rpx;">

@ -23,7 +23,6 @@ Page({
},
//登录请求
login() {
console.log('login run');
request.post(`/sso/login?username=${this.data.username}&password=${this.data.userpwd}`).then(res => {
console.log(res);
if (res.data.code == 200) {

Loading…
Cancel
Save