ruleName.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. // 输入框绑定数值
  18. name: "",
  19. };
  20. },
  21. methods: {
  22. // 点击确认按钮回调
  23. handleConfirm() {
  24. if (!this.name) {
  25. uni.showToast({
  26. title: "请输入规则名称",
  27. icon: 'none'
  28. })
  29. } else {
  30. uni.$emit('updateRuleName', this.name)
  31. uni.navigateBack({
  32. delta: 1
  33. })
  34. }
  35. }
  36. }
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .container {
  41. padding-top: 22rpx;
  42. background-color: #F2F2F2;
  43. .input {
  44. display: flex;
  45. align-items: center;
  46. margin: 0 auto;
  47. width: 690rpx;
  48. height: 87rpx;
  49. border-radius: 14rpx;
  50. background-color: #fff;
  51. }
  52. .button {
  53. margin: 0 auto;
  54. margin-top: 118rpx;
  55. width: 690rpx;
  56. height: 80rpx;
  57. line-height: 80rpx;
  58. text-align: center;
  59. color: #fff;
  60. font-size: 32rpx;
  61. font-weight: 500;
  62. border-radius: 16rpx;
  63. background-color: #3396FB;
  64. }
  65. }
  66. </style>