You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
campus_leader/doc/project2/miniprogram/pages/getMiniProgramCode/index.js

54 lines
845 B

Page({
/**
* 页面的初始数据
*/
data: {
showUploadTip: false,
haveGetCodeSrc: false,
envId: '',
codeSrc: ''
},
onLoad(options) {
this.setData({
envId: options.envId
});
},
getCodeSrc() {
wx.showLoading({
title: '',
});
wx.cloud.callFunction({
name: 'quickstartFunctions',
config: {
env: this.data.envId
},
data: {
type: 'getMiniProgramCode'
}
}).then((resp) => {
this.setData({
haveGetCodeSrc: true,
codeSrc: resp.result
});
wx.hideLoading();
}).catch((e) => {
console.log(e);
this.setData({
showUploadTip: true
});
wx.hideLoading();
});
},
clearCodeSrc() {
this.setData({
haveGetCodeSrc: false,
codeSrc: ''
});
}
});