Commit 6f4b9f2a by 陈玉桐

add

parent 73b6863c
...@@ -119,6 +119,8 @@ export default { ...@@ -119,6 +119,8 @@ export default {
enrollStatus: '', enrollStatus: '',
uploadPic: '',// 上传的头像地址 uploadPic: '',// 上传的头像地址
activityId: '',
applyDialogShow: false, applyDialogShow: false,
createDialogShow: false, createDialogShow: false,
...@@ -181,6 +183,7 @@ export default { ...@@ -181,6 +183,7 @@ export default {
} }
}).then(response => { }).then(response => {
this.loadingShow = false this.loadingShow = false
this.activityId = response.data.activityId
this.qrcodeUrl = response.data.qrcodeUrl this.qrcodeUrl = response.data.qrcodeUrl
this.posterText1 = response.data.note1 this.posterText1 = response.data.note1
this.posterText2 = response.data.note2 this.posterText2 = response.data.note2
...@@ -193,13 +196,13 @@ export default { ...@@ -193,13 +196,13 @@ export default {
methods: { methods: {
create() { create() {
if(!this.uploadPic){ if(!this.uploadPic){
this.tipDialogShow = true
this.tipDialogText = '您还未上传照片' this.tipDialogText = '您还未上传照片'
this.tipDialogShow = true
return return
} }
if(!this.currentDay){ if(!this.currentDay){
this.tipDialogShow = true
this.tipDialogText = '您还未输入打卡天数' this.tipDialogText = '您还未输入打卡天数'
this.tipDialogShow = true
return return
} }
if(this.enrollStatus==1){//已报名 if(this.enrollStatus==1){//已报名
...@@ -218,7 +221,38 @@ export default { ...@@ -218,7 +221,38 @@ export default {
}, },
upload() { upload() {
if(this.enrollStatus==1){//已报名 if(this.enrollStatus==1){//已报名
let me = this
wx.chooseImage({
count: 1, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
// 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
wx.uploadImage({
localId: res.localIds[0], // 需要上传的图片的本地ID,由chooseImage接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (res) {
var serverId = res.serverId; // 返回图片的服务器端ID serverId
me.loadingShow = true
request({
url: '/api/MarketingToolApi/Posters/addPoster',
method: 'post',
data: {
token: localStorage.getItem("token"),
activityId: me.activityId,
day: me.currentDay,
MediaId: res.serverId
}
}).then(response => {
me.loadingShow = false
me.tipDialogText = '上传成功'
me.tipDialogShow = true
})
}
})
}
})
}else{ }else{
this.applyDialogShow = true this.applyDialogShow = true
} }
...@@ -239,7 +273,7 @@ export default { ...@@ -239,7 +273,7 @@ export default {
success: function (res) { success: function (res) {
me.uploadPic = res.localIds[0] // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片 me.uploadPic = res.localIds[0] // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
} }
}); })
}else{ }else{
this.applyDialogShow = true this.applyDialogShow = true
} }
......
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