Commit 02a8ac56 by 陈玉桐

add

parent 2084ac3d
......@@ -9,7 +9,7 @@
</div>
<div id="addpicBox">
<img @click="selectPic" src="../assets/addpic.png">
<img :src="uploadPic" v-show="false">
<img :src="uploadPic" v-show="uploadPic">
</div>
<div id="posterBom">
<div id="posterTime">
......@@ -197,13 +197,14 @@ export default {
this.$router.push({name: 'index'})
},
selectPic() {
if(this.enrollStatus==1){//已报名
let me = this
if(me.enrollStatus==1){//已报名
wx.config({
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: this.appId, // 必填,公众号的唯一标识
timestamp: this.timestamp, // 必填,生成签名的时间戳
nonceStr: this.nonceStr, // 必填,生成签名的随机串
signature: this.signature,// 必填,签名
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: me.appId, // 必填,公众号的唯一标识
timestamp: me.timestamp, // 必填,生成签名的时间戳
nonceStr: me.nonceStr, // 必填,生成签名的随机串
signature: me.signature,// 必填,签名
jsApiList: ['chooseImage'] // 必填,需要使用的JS接口列表
})
wx.ready(function(){
......@@ -217,8 +218,7 @@ export default {
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
console.log(res.localIds)
this.uploadPic = res.localIds // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
me.uploadPic = res.localIds[0] // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
}
});
}
......
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