ruleName.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. .input {
  43. display: flex;
  44. align-items: center;
  45. margin: 0 auto;
  46. width: 690rpx;
  47. height: 87rpx;
  48. background-color: #fff;
  49. }
  50. .button {
  51. margin: 0 auto;
  52. margin-top: 118rpx;
  53. width: 690rpx;
  54. height: 80rpx;
  55. line-height: 80rpx;
  56. text-align: center;
  57. color: #fff;
  58. font-size: 32rpx;
  59. font-weight: 500;
  60. border-radius: 16rpx;
  61. background-color: #3396FB;
  62. }
  63. }
  64. </style>