index.js 713 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // miniprogram/components/cloudTipModal/index.js
  2. const { isMac } = require('../../envList.js');
  3. Component({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. showUploadTip: false,
  9. tipText: isMac ? 'sh ./uploadCloudFunction.sh' : './uploadCloudFunction.bat'
  10. },
  11. properties: {
  12. showUploadTipProps: Boolean
  13. },
  14. observers: {
  15. showUploadTipProps: function(showUploadTipProps) {
  16. this.setData({
  17. showUploadTip: showUploadTipProps
  18. });
  19. }
  20. },
  21. methods: {
  22. onChangeShowUploadTip() {
  23. this.setData({
  24. showUploadTip: !this.data.showUploadTip
  25. });
  26. },
  27. copyShell() {
  28. wx.setClipboardData({
  29. data: this.data.tipText,
  30. });
  31. },
  32. }
  33. });