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.
61 lines
1.4 KiB
61 lines
1.4 KiB
// miniprogram/components/cloudTipModal/index.js
|
|
const { isMac } = require('../../envList.js');
|
|
|
|
Component({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
showUploadTip: false,
|
|
tipText: isMac ? 'sh ./uploadCloudFunction.sh' : './uploadCloudFunction.bat'
|
|
},
|
|
properties: {
|
|
showUploadTipProps: Boolean
|
|
},
|
|
observers: {
|
|
showUploadTipProps: function(showUploadTipProps) {
|
|
this.setData({
|
|
showUploadTip: showUploadTipProps
|
|
});
|
|
}
|
|
},
|
|
methods: {
|
|
onCheckEnv(){
|
|
wx.showLoading({
|
|
title: '',
|
|
});
|
|
wx.cloud
|
|
.callFunction({
|
|
name: 'quickstartFunctions',
|
|
data: {
|
|
type: 'getOpenId',
|
|
},
|
|
})
|
|
.then(() => {
|
|
wx.hideLoading();
|
|
this.setData({
|
|
showUploadTip: !this.data.showUploadTip
|
|
});
|
|
})
|
|
.catch((e) => {
|
|
// 报错信息提示环境不存在
|
|
wx.hideLoading();
|
|
if(e.message.includes('env not exists') || e.message.includes('Environment not found') || e.message.includes('env check invalid be filterd')){
|
|
wx.showToast({
|
|
title: '环境未找到',
|
|
icon: 'error',
|
|
duration: 2000
|
|
})
|
|
}
|
|
});
|
|
},
|
|
|
|
onCheckEnvCancel(){
|
|
this.setData({
|
|
showUploadTip: !this.data.showUploadTip
|
|
});
|
|
},
|
|
}
|
|
});
|