index.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. 系统首页
  5. <uni-forms ref="form" :rules="rules" :model="form" label-width="auto">
  6. <uni-forms-item label="test" name="num">
  7. <uni-easyinput type="digit" v-model="form.num" @input="toInput" aceholder="请输入内容"></uni-easyinput>
  8. </uni-forms-item>
  9. </uni-forms>
  10. </view>
  11. </mobile-frame>
  12. </template>
  13. <script>
  14. export default {
  15. components: {},
  16. data() {
  17. return {
  18. form: {},
  19. rules: {}
  20. };
  21. },
  22. onLoad: function() {},
  23. onShow: function() {
  24. const that = this;
  25. that.search();
  26. },
  27. methods: {
  28. toInput(value) {
  29. if (value > 10) {
  30. uni.showToast({
  31. title: '可以'
  32. })
  33. } else {
  34. uni.showToast({
  35. title: '不可以'
  36. })
  37. }
  38. },
  39. search() {
  40. // 查询当前所在平台
  41. uni.getSystemInfo({
  42. success: async function(res) {
  43. uni.setStorage({
  44. key: 'system',
  45. data: res,
  46. success: function() {
  47. uni.redirectTo({
  48. // url: `/pages/home/index`
  49. // url: `/pagesMy/order/info`
  50. })
  51. }
  52. });
  53. }
  54. });
  55. },
  56. }
  57. }
  58. </script>
  59. <style lang="scss">
  60. </style>