huhaobangding.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. const app = getApp()
  2. Page({
  3. data: {
  4. selectedTag: '',
  5. showCustomInput: false,
  6. customTagLength: 0,
  7. customTagName: '',
  8. tzd: '/static_file/jcsfcjtzd.jpg',
  9. showPreview: false
  10. },
  11. selectTag(e) {
  12. const tag = e.currentTarget.dataset.tag;
  13. this.setData({
  14. selectedTag: tag,
  15. showCustomInput: tag === '自定义'
  16. });
  17. },
  18. onCustomInput(e) {
  19. const value = e.detail.value;
  20. this.setData({
  21. customTagName: value,
  22. customTagLength: value.length
  23. });
  24. },
  25. // 显示抽屉
  26. showDrawer() {
  27. this.setData({
  28. showDrawer: true
  29. });
  30. },
  31. // 隐藏抽屉
  32. hideDrawer() {
  33. this.setData({
  34. showDrawer: false
  35. });
  36. },
  37. // 拨打电话
  38. makePhoneCall() {
  39. wx.makePhoneCall({
  40. phoneNumber: '17630145126'
  41. });
  42. },
  43. // 修改预览图片方法
  44. previewImage: function() {
  45. this.setData({
  46. showPreview: true
  47. });
  48. },
  49. // 关闭预览
  50. closePreview: function() {
  51. this.setData({
  52. showPreview: false
  53. });
  54. },
  55. // 防止点击图片内容时关闭预览
  56. preventBubble: function() {
  57. return;
  58. }
  59. });