index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. "use strict";
  2. var _page = _interopRequireDefault(require("../../common/page"));
  3. var _toast = _interopRequireDefault(require("../../dist/toast/toast"));
  4. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  5. (0, _page["default"])({
  6. data: {
  7. column1: ["杭州", "宁波", "温州", "嘉兴", "湖州"],
  8. column2: [{
  9. text: "杭州",
  10. disabled: true
  11. }, {
  12. text: "宁波"
  13. }, {
  14. text: "温州"
  15. }],
  16. column3: {
  17. 浙江: ["杭州", "宁波", "温州", "嘉兴", "湖州"],
  18. 福建: ["福州", "厦门", "莆田", "三明", "泉州"]
  19. },
  20. column4: [{
  21. values: ["浙江", "福建"],
  22. className: "column1"
  23. }, {
  24. values: ["杭州", "宁波", "温州", "嘉兴", "湖州"],
  25. className: "column2",
  26. defaultIndex: 2
  27. }]
  28. },
  29. onChange1: function onChange1(event) {
  30. var _event$detail = event.detail,
  31. value = _event$detail.value,
  32. index = _event$detail.index;
  33. (0, _toast["default"])("Value: ".concat(value, ", Index\uFF1A").concat(index));
  34. },
  35. onConfirm: function onConfirm(event) {
  36. var _event$detail2 = event.detail,
  37. value = _event$detail2.value,
  38. index = _event$detail2.index;
  39. (0, _toast["default"])("Value: ".concat(value, ", Index\uFF1A").concat(index));
  40. },
  41. onCancel: function onCancel() {
  42. (0, _toast["default"])("取消");
  43. },
  44. onChange2: function onChange2(event) {
  45. var _event$detail3 = event.detail,
  46. picker = _event$detail3.picker,
  47. value = _event$detail3.value;
  48. picker.setColumnValues(1, this.data.column3[value[0]]);
  49. getApp().picker = picker;
  50. }
  51. });