Commit 9d013e6b by mamingqun

还原成了初始状态

parent a7e1cc4c
...@@ -279,41 +279,40 @@ export default { ...@@ -279,41 +279,40 @@ export default {
vm.isPhoto = false; vm.isPhoto = false;
vm.isPreivw = true; vm.isPreivw = true;
vm.uploadPicture();
} }
}); });
// wx.uploadImage({
// localId: vm.imgUrls[0], // 需要上传的图片的本地ID,由chooseImage接口获得 wx.uploadImage({
// isShowProgressTips: 1, // 默认为1,显示进度提示 localId: vm.imgUrls[0], // 需要上传的图片的本地ID,由chooseImage接口获得
// success: function (res) { isShowProgressTips: 1, // 默认为1,显示进度提示
// var serverId = res.serverId; // 返回图片的服务器端ID success: function (res) {
// // console.log('上传成功'); var serverId = res.serverId; // 返回图片的服务器端ID
// // console.log(res);
axios
// axios .get('/contest/wx/upload', {
// .get('/contest/wx/upload', { params: { media_id: serverId }
// params: { media_id: serverId } })
// }) .then(res => {
// .then(res => { console.log('发给服务serverid');
// console.log('发给服务serverid'); console.log(res);
// console.log(res); if (res.data.code === 0) {
// if (res.data.code === 0) { vm.small_image =
// vm.small_image = res.data.data.small_image;
// res.data.data.small_image; vm.big_image =
// vm.big_image = res.data.data.big_image;
// res.data.data.big_image; }
// } })
// }) .catch(error => {
// .catch(error => { console.log('发给服务serverid的错误');
// console.log('发给服务serverid的错误'); console.log(error);
// console.log(error); Toast({
// Toast({ message: error.response.data.msg
// message: error.response.data.msg });
// }); });
// });
// } }
// }); });
} }
}); });
}); });
...@@ -482,7 +481,8 @@ export default { ...@@ -482,7 +481,8 @@ export default {
jsApiList: [ jsApiList: [
'chooseImage', 'chooseImage',
'getLocalImgData', 'getLocalImgData',
'uploadImage' 'uploadImage',
'downloadImage'
] ]
}); });
...@@ -518,10 +518,12 @@ export default { ...@@ -518,10 +518,12 @@ export default {
}) })
}, },
uploadPicture() { uploadPicture() {
var vm = this;
axios.post('/contest/base/upload', { axios.post('/contest/base/upload', {
content: this.base64[0] content: this.base64[0]
}).then(res => { }).then(res => {
if (res.data.code === 0) { if (res.data.code === 0) {
vm.small_image = vm.small_image =
res.data.data.small_image; res.data.data.small_image;
...@@ -529,13 +531,13 @@ export default { ...@@ -529,13 +531,13 @@ export default {
res.data.data.big_image; res.data.data.big_image;
} }
}) })
.catch(error => { .catch(error => {
console.log('发给服务serverid的错误'); console.log('发给服务serverid的错误');
console.log(error); console.log(error);
Toast({ Toast({
message: error.response.data.msg message: error.response.data.msg
});
}); });
});
} }
}, },
components: { components: {
...@@ -557,6 +559,13 @@ body { ...@@ -557,6 +559,13 @@ body {
// background: red; // background: red;
} }
.bottomView {
img {
width: 100%;
height: auto;
}
}
.marginTop20 { .marginTop20 {
margin-top: 10px; margin-top: 10px;
} }
......
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 sign in to comment