ruleName.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view class="container">
  3. <!-- 规则名称输入区域 -->
  4. <view class="input">
  5. <uni-easyinput :inputBorder="false" focus v-model="name" placeholder="请输入规则名称"></uni-easyinput>
  6. </view>
  7. <!-- 确认按钮区域 -->
  8. <view class="button" @click="handleConfirm">
  9. 确认
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. name: ""
  18. };
  19. },
  20. methods: {
  21. // 点击确认按钮回调
  22. handleConfirm() {
  23. if (!this.name) {
  24. uni.showToast({
  25. title: "请输入规则名称",
  26. icon: 'none'
  27. })
  28. } else {
  29. uni.$emit('update', this.name)
  30. uni.navigateBack({
  31. delta: 1
  32. })
  33. }
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .container {
  40. padding-top: 22rpx;
  41. .input {
  42. display: flex;
  43. align-items: center;
  44. margin: 0 auto;
  45. width: 690rpx;
  46. height: 87rpx;
  47. background-color: #fff;
  48. }
  49. .button {
  50. margin: 0 auto;
  51. margin-top: 118rpx;
  52. width: 690rpx;
  53. height: 80rpx;
  54. line-height: 80rpx;
  55. text-align: center;
  56. color: #fff;
  57. font-size: 32rpx;
  58. font-weight: 500;
  59. border-radius: 16rpx;
  60. background-color: #3396FB;
  61. }
  62. }
  63. </style>