modname.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view>
  3. <view class="uni-form-item uni-column">
  4. <view class="with-fun" style="margin-top: 10px;">
  5. <input class="uni-input" type="text" confirm-type="done" focus placeholder="请输入你的姓名" @input="onKeyInput" :value="inputValue" />
  6. </view>
  7. </view>
  8. <button class="onname" :style="{'background':dbled?'#999':'#E17503'}" :disabled="dbled" type="primary" @tap="onOKname()">确 认</button>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. inputValue: '',
  16. dbled:true
  17. }
  18. },
  19. methods: {
  20. onKeyInput(event){
  21. this.inputValue = event.target.value
  22. let lens = event.target.value
  23. if(lens.length>=2){
  24. this.dbled=false
  25. }else{
  26. this.dbled=true
  27. }
  28. },
  29. onOKname(){
  30. uni.navigateBack({
  31. delta:1
  32. })
  33. }
  34. }
  35. }
  36. </script>
  37. <style scoped>
  38. .title {
  39. padding: 10upx 25upx;
  40. }
  41. .with-fun{
  42. background: #f8f8f8;
  43. position: relative;
  44. }
  45. .with-fun:after{
  46. position: absolute;
  47. content: '姓名';
  48. height: 50px;
  49. line-height: 50px;
  50. top: 0px;
  51. left: 20px;
  52. font-size: 32upx;
  53. }
  54. .uni-input{
  55. height: 50px;
  56. line-height: 50px;
  57. font-size: 32upx;
  58. background: #f8f8f8;
  59. padding-left: 60px;
  60. color: #666;
  61. }
  62. .uni-icon-clear,
  63. .uni-icon-eye {
  64. color: #999;
  65. }
  66. .onname{
  67. width: 94%;
  68. margin: 20upx auto;
  69. background: -webkit-linear-gradient(left top, #E49315 , #E17503); /* Safari 5.1 - 6.0 */
  70. background: -o-linear-gradient(bottom right, #E49315, #E17503); /* Opera 11.1 - 12.0 */
  71. background: -moz-linear-gradient(bottom right, #E49315,#E17503); /* Firefox 3.6 - 15 */
  72. background: linear-gradient(to bottom right, #E49315 , #E17503); /* 标准的语法(必须放在最后) */
  73. }
  74. .onnames{
  75. width: 94%;
  76. margin: 20upx auto;
  77. background: -webkit-linear-gradient(left top, #f1f1f1 , #f9f9f9); /* Safari 5.1 - 6.0 */
  78. background: -o-linear-gradient(bottom right, #f1f1f1, #f9f9f9); /* Opera 11.1 - 12.0 */
  79. background: -moz-linear-gradient(bottom right, #f1f1f1,#f9f9f9); /* Firefox 3.6 - 15 */
  80. background: linear-gradient(to bottom right, #f1f1f1 , #f9f9f9); /* 标准的语法(必须放在最后) */
  81. }
  82. </style>