详情小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

138 lines
2.7 KiB

  1. <template>
  2. <view>
  3. <view class="head">
  4. <image class="img" src="../../static/images/add_wechat.png"></image>
  5. </view>
  6. <view class="content">
  7. <view class="title">添加微信号</view>
  8. <view class="desc">请输入正确的微信号以便客服人员能准确的联系到你哟</view>
  9. <view class="input-box">
  10. <input v-model="wechat_num"
  11. :adjust-position="false"
  12. :auto-blur="true"
  13. @focus="inputFocus"
  14. @blur="inputBlur"
  15. placeholder="请输入微信号" />
  16. <view class="clear" v-if="wechat_num.length" @click="wechat_num = ''">
  17. <text class="lf-iconfont icon-shanchu"></text>
  18. </view>
  19. </view>
  20. <button class="confirm" hover-class="lf-opacity" @click="confirm">确认</button>
  21. </view>
  22. <view class="hide-view" :style="is_focus ? 'height: 540rpx' : 'height: 40rpx'"></view>
  23. </view>
  24. </template>
  25. <script>
  26. let time = null;
  27. export default {
  28. data(){
  29. return {
  30. wechat_num: '',
  31. is_focus: false,
  32. button_click: false
  33. }
  34. },
  35. onLoad(){
  36. },
  37. methods: {
  38. inputFocus(){
  39. time = setTimeout(() => {
  40. this.is_focus = true;
  41. }, 0); // 给blur事件留出时间
  42. setTimeout(() => {
  43. uni.pageScrollTo({
  44. scrollTop: 190,
  45. duration: 100
  46. })
  47. }, 200);
  48. },
  49. inputBlur(){
  50. time = setTimeout(() => {
  51. this.is_focus = false;
  52. }, 0); // 给click事件留出时间
  53. },
  54. confirm(){
  55. this.$msg('确定')
  56. }
  57. }
  58. }
  59. </script>
  60. <style>
  61. page{
  62. width: 100vw;
  63. height: 100%;
  64. /* overflow-x: hidden; */
  65. /* background: linear-gradient(180deg, #FE3EA5 0%, #FE7749 100%); */
  66. background: linear-gradient(180deg, #FE3EA5 0%, #FE7749 100%);
  67. }
  68. </style>
  69. <style lang="scss" scoped="scoped">
  70. .head{
  71. width: 100vw;
  72. height: max-content;
  73. display: flex;
  74. justify-content: center;
  75. padding-top: 80rpx;
  76. .img{
  77. width: 661rpx;
  78. height: 620rpx;
  79. }
  80. }
  81. .content{
  82. width: 630rpx;
  83. height: 572rpx;
  84. background: #FFFFFF;
  85. border-radius: 60rpx;
  86. position: relative;
  87. z-index: 2;
  88. margin: 0 auto;
  89. margin-top: -150rpx;
  90. box-sizing: border-box;
  91. padding: 60rpx;
  92. .title{
  93. text-align: center;
  94. font-weight: bold;
  95. font-size: 32rpx;
  96. color: #222222;
  97. }
  98. .desc{
  99. font-size: 24rpx;
  100. margin-top: 20rpx;
  101. color: #999999;
  102. }
  103. .input-box{
  104. margin-top: 60rpx;
  105. border-bottom: 1rpx solid #e5e5e5;
  106. width: 100%;
  107. height: 80rpx;
  108. display: flex;
  109. align-items: center;
  110. justify-content: space-between;
  111. & > input{
  112. width: 430rpx;
  113. height: 80rpx;
  114. font-size: 28rpx;
  115. }
  116. .clear{
  117. padding: 20rpx;
  118. }
  119. }
  120. .confirm{
  121. width: 100%;
  122. height: 100rpx;
  123. background: #E21196;
  124. border-radius: 60rpx;
  125. margin-top: 80rpx;
  126. color: #FFFFFF;
  127. line-height: 100rpx;
  128. }
  129. }
  130. .hide-view{
  131. background-color: #fe7054;
  132. }
  133. </style>