consult.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="container consult">
  3. <view class="consult-main">
  4. <text class="main-text">注:若暂不方便入驻机构或无法入驻,您可以留下您的姓名和联系方式,采美工作人员会第一时间联系您</text>
  5. </view>
  6. <view class="consult-input">
  7. <input type="text" v-model="userName" maxlength="6" class="input" placeholder="姓名"/>
  8. </view>
  9. <view class="consult-input">
  10. <input type="number" v-model="mobile" maxlength="11" class="input" placeholder="手机号"/>
  11. </view>
  12. <view class="consult-btn" @click="goconsult">提交</view>
  13. </view>
  14. </template>
  15. <script>
  16. import {mapState,mapMutations } from 'vuex';
  17. import authorize from '@/common/config/authorize.js'
  18. import { quickConsultation } from '@/api/use.js'
  19. export default{
  20. data() {
  21. return{
  22. userName:'',
  23. mobile:''
  24. }
  25. },
  26. onLoad(option) {
  27. },
  28. methods:{
  29. goconsult(){
  30. if( this.userName == ''){
  31. this.$util.msg('请输入姓名',2000);
  32. return
  33. }
  34. if( this.mobile == ''){
  35. this.$util.msg('请输入手机号',2000);
  36. return
  37. }
  38. if(!this.$reg.isMobile(this.mobile)){
  39. this.$util.msg('手机号格式不正确',2000);
  40. return
  41. }
  42. quickConsultation({name:this.userName,mobile:this.mobile}).then(response=>{
  43. this.$util.modal('提交成功','您的信息已提交成功,采美工作人员会第一时间联系您','确定','',false,() =>{
  44. this.$api.switchTabTo('/pages/tabBar/home/home')
  45. })
  46. }).catch(error=>{
  47. this.$util.msg(error.msg,2000);
  48. })
  49. },
  50. }
  51. }
  52. </script>
  53. <style lang="scss">
  54. .consult{
  55. width: 100%;
  56. height: auto;
  57. .consult-main{
  58. width: 100%;
  59. display: flex;
  60. flex-direction: column;
  61. align-items: center;
  62. height: auto;
  63. padding: 260rpx 0 60rpx 0;
  64. .main-text{
  65. width: 654rpx;
  66. display: block;
  67. font-size: $font-size-28;
  68. color: #999999;
  69. }
  70. }
  71. .consult-input{
  72. width: 654rpx;
  73. height: 40rpx;
  74. padding: 24rpx;
  75. margin: 0 auto;
  76. margin-bottom: 60rpx;
  77. background: #F7F7F7;
  78. border-radius: 14rpx;
  79. margin-bottom: 20rpx;
  80. .input{
  81. width: 100%;
  82. height: 100%;
  83. background: #F7F7F7;
  84. font-size: $font-size-28;
  85. line-height: 40rpx;
  86. color: #333333;
  87. border-radius: 14rpx;
  88. }
  89. }
  90. .consult-btn{
  91. width: 702rpx;
  92. height: 88rpx;
  93. border-radius: 14rpx;
  94. font-size: $font-size-28;
  95. line-height: 88rpx;
  96. color: #FFFFFF;
  97. margin: 0 auto;
  98. text-align: center;
  99. background: $btn-confirm;
  100. margin-top: 80rpx;
  101. }
  102. .model-authorization{
  103. width: 100%;
  104. height: 100%;
  105. position: fixed;
  106. top: 0;
  107. left: 0;
  108. z-index: 999;
  109. .authorization{
  110. width: 518rpx;
  111. height: 320rpx;
  112. position: absolute;
  113. background: rgba(255,255,255,.7);
  114. left: 0;
  115. right: 0;
  116. bottom: 0;
  117. top: 0;
  118. margin: auto;
  119. .to-btn{
  120. position: absolute;
  121. top: 0;
  122. left: 0;
  123. right: 0;
  124. bottom: 0;
  125. margin: auto;
  126. width: 70%;
  127. height: 88rpx;
  128. font-size: $font-size-28;
  129. line-height: 88rpx;
  130. color: #FFFFFF;
  131. text-align: center;
  132. border-radius: 44rpx;
  133. }
  134. }
  135. }
  136. }
  137. </style>