|
|
@ -45,7 +45,6 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
changeStar: function (e) { |
|
|
changeStar: function (e) { |
|
|
console.log(e) |
|
|
|
|
|
wx.showLoading({ |
|
|
wx.showLoading({ |
|
|
title: '加载中' |
|
|
title: '加载中' |
|
|
}) |
|
|
}) |
|
|
@ -57,11 +56,9 @@ Page({ |
|
|
info: info, |
|
|
info: info, |
|
|
rate:info.order_product_list[index].star |
|
|
rate:info.order_product_list[index].star |
|
|
}) |
|
|
}) |
|
|
console.log(info); |
|
|
|
|
|
wx.hideLoading({}) |
|
|
wx.hideLoading({}) |
|
|
}, |
|
|
}, |
|
|
changeContent: function (e) { |
|
|
changeContent: function (e) { |
|
|
console.log(e) |
|
|
|
|
|
let index = e.currentTarget.dataset.index, |
|
|
let index = e.currentTarget.dataset.index, |
|
|
info = this.data.info; |
|
|
info = this.data.info; |
|
|
info.order_product_list[index].content = e.detail.value; |
|
|
info.order_product_list[index].content = e.detail.value; |
|
|
@ -81,7 +78,6 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
flag = false; |
|
|
flag = false; |
|
|
} |
|
|
} |
|
|
console.log(item); |
|
|
|
|
|
ajax.push(commonApi.user_post("product/product_comment", { |
|
|
ajax.push(commonApi.user_post("product/product_comment", { |
|
|
product_id: item.product_id, |
|
|
product_id: item.product_id, |
|
|
content: item.content, |
|
|
content: item.content, |
|
|
@ -93,7 +89,6 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
if (!flag) return; |
|
|
if (!flag) return; |
|
|
Promise.all(ajax).then(res => { |
|
|
Promise.all(ajax).then(res => { |
|
|
console.log(res) |
|
|
|
|
|
let flag = false; |
|
|
let flag = false; |
|
|
res.map(item => { |
|
|
res.map(item => { |
|
|
if (item.code == 1) { |
|
|
if (item.code == 1) { |
|
|
@ -109,12 +104,11 @@ Page({ |
|
|
//图片上传
|
|
|
//图片上传
|
|
|
// 上传图片
|
|
|
// 上传图片
|
|
|
chooseImg: function (e) { |
|
|
chooseImg: function (e) { |
|
|
console.log(e); |
|
|
|
|
|
var that = this; |
|
|
var that = this; |
|
|
var imgs = this.data.imgs; |
|
|
var imgs = this.data.imgs; |
|
|
if (imgs.length >= 8) { |
|
|
if (imgs.length >= 9) { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: '最多上传八张图片哦..', |
|
|
title: '最多上传九张图片哦..', |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
}) |
|
|
}) |
|
|
return false; |
|
|
return false; |
|
|
@ -142,48 +136,46 @@ Page({ |
|
|
} |
|
|
} |
|
|
var tempFilePaths = res.tempFilePaths; |
|
|
var tempFilePaths = res.tempFilePaths; |
|
|
var imgs = that.data.imgs; |
|
|
var imgs = that.data.imgs; |
|
|
wx.uploadFile({ |
|
|
console.log(imgs); |
|
|
url: 'https://test.api.cloud.sz-trip.com/api/pbservice.other/upload', //这里是上传的服务器地址
|
|
|
wx.showLoading({ |
|
|
filePath: tempFilePaths[0], |
|
|
title: '上传中', |
|
|
name: 'file', |
|
|
}) |
|
|
header: { |
|
|
|
|
|
token: wx.getStorageSync('jstrip_token'), |
|
|
|
|
|
}, |
|
|
|
|
|
success(res) { |
|
|
|
|
|
|
|
|
|
|
|
var res = JSON.parse(res.data); |
|
|
for (let i = 0; i < tempFilePaths.length; i++) { |
|
|
if (res.code!=1) { |
|
|
wx.uploadFile({ |
|
|
wx.showToast({ |
|
|
url: 'https://test.api.cloud.sz-trip.com/api/pbservice.other/upload', //这里是上传的服务器地址
|
|
|
title: res.msg, |
|
|
filePath: tempFilePaths[i], |
|
|
icon: 'none' |
|
|
name: 'file', |
|
|
}) |
|
|
header: { |
|
|
return |
|
|
token: wx.getStorageSync('jstrip_token'), |
|
|
} |
|
|
}, |
|
|
let img = res.data.url; |
|
|
success(res) { |
|
|
let arr = that.data.upImgs |
|
|
wx.hideLoading() |
|
|
arr.push(img) |
|
|
var res = JSON.parse(res.data); |
|
|
that.setData({ |
|
|
if (res.code!=1) { |
|
|
upImgs:arr |
|
|
wx.showToast({ |
|
|
}) |
|
|
title: res.msg, |
|
|
console.log(that.data.upImgs); |
|
|
icon: 'none' |
|
|
for (var i = 0; i < tempFilePaths.length; i++) { |
|
|
}) |
|
|
if (imgs.length >= 9) { |
|
|
return |
|
|
that.setData({ |
|
|
|
|
|
imgs: imgs |
|
|
|
|
|
}); |
|
|
|
|
|
return false; |
|
|
|
|
|
} else { |
|
|
|
|
|
imgs.push(tempFilePaths[i]); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
let img = res.data.url; |
|
|
|
|
|
let arr = that.data.upImgs |
|
|
|
|
|
arr.push(img) |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
upImgs:arr |
|
|
|
|
|
}) |
|
|
|
|
|
imgs.push(tempFilePaths[i]); |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
imgs: imgs |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
// console.log(imgs);
|
|
|
}) |
|
|
that.setData({ |
|
|
if (that.data,imgs.length+i==8) { |
|
|
imgs: imgs |
|
|
return |
|
|
}); |
|
|
|
|
|
console.log(that.data.imgs); |
|
|
|
|
|
const data = res.data |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
@ -218,7 +210,6 @@ Page({ |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
checked:!this.data.checked |
|
|
checked:!this.data.checked |
|
|
}) |
|
|
}) |
|
|
console.log(this.data.checked); |
|
|
|
|
|
}, |
|
|
}, |
|
|
/** |
|
|
/** |
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
|