index.js 969 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. const app = getApp();
  2. Component({
  3. properties: {
  4. show: {
  5. type: Boolean,
  6. value: false
  7. },
  8. currentValue:{
  9. type: String,
  10. value: ""
  11. },
  12. stepIndex:{
  13. type: Number,
  14. value: ""
  15. }
  16. },
  17. observers: {
  18. "currentValue": function(cur){
  19. }
  20. },
  21. id: "",
  22. data: {
  23. currentValue: "",
  24. selectIndex: 0
  25. },
  26. position: {},
  27. ready() {},
  28. methods: {
  29. onInput(e) {
  30. const { value } = e.detail;
  31. this.setData({
  32. currentValue: value
  33. });
  34. },
  35. confirm(e) {
  36. if (!this.data.currentValue) {
  37. wx.showToast({
  38. icon: "none",
  39. title: "请输入文字"
  40. });
  41. return;
  42. }
  43. this.triggerEvent("add", { currentValue: this.data.currentValue, Url: app.globalData.voice });
  44. },
  45. selectSey(e){
  46. console.log(e.currentTarget.dataset.index)
  47. this.setData({
  48. selectIndex: e.currentTarget.dataset.index - 0
  49. });
  50. }
  51. }
  52. });