form.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <view class="container operator clearfix">
  3. <view class="operator-content">
  4. <view class="operator-from">
  5. <view class="from-row">
  6. <input class="input" type="text" v-model="params.linkName" placeholder="请输入运营人员姓名" maxlength="6"/>
  7. </view>
  8. <view class="from-row">
  9. <input class="input" type="text" v-model="params.mobile" placeholder="请输入运营人员手机号" maxlength="11"/>
  10. </view>
  11. <button class="add-btn" @click="hanldConfirm">确定</button>
  12. </view>
  13. <view class="operator-text">
  14. <view class="text-main">
  15. <view>1. 添加运营人员后,运营人员会收到一条邀请码短信</view>
  16. <view>2. 运营人员在微信搜索【采美采购商城】小程序,或者搜索关注【采美365】公众号,从底部菜单进入【采美采购商城】小程序</view>
  17. <view>3. 使用邀请码进行登录并绑定微信</view>
  18. <view>4. 绑定后,运营人员可通过微信直接登录采美365网</view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import authorize from '@/common/config/authorize.js'
  26. export default {
  27. data() {
  28. return {
  29. params:{
  30. mobile:'',
  31. linkName:'',
  32. userId:0,
  33. clubId:0,
  34. configFlag:2
  35. }
  36. }
  37. },
  38. onLoad(option){
  39. },
  40. methods: {
  41. //提交
  42. hanldConfirm(){
  43. let data = this.addressData;
  44. if(this.params.linkName== ''){
  45. this.$util.msg('请输入运营人员姓名');
  46. return;
  47. }
  48. if(this.params.mobile == ''){
  49. this.$util.msg('请输入运营人员手机号');
  50. return;
  51. }
  52. if(!/(^1[0-9][0-9]{9}$)/.test(this.params.mobile)){
  53. this.$util.msg('请输入正确的手机号码');
  54. return;
  55. }
  56. this.UserService.PostAddOperator(this.params).then(response =>{
  57. this.$util.msg('添加成功',2000,true,'success')
  58. setTimeout(() =>{
  59. uni.navigateBack();
  60. },2000)
  61. }).catch(error =>{
  62. this.$util.msg(error.msg,2000);
  63. })
  64. }
  65. },
  66. onShow() {
  67. this.$api.getStorage().then((resolve) =>{
  68. this.params.userId = resolve.userId ? resolve.userId : 0
  69. this.params.clubId = resolve.clubId ? resolve.clubId : 0
  70. })
  71. }
  72. }
  73. </script>
  74. <style lang="scss">
  75. page{
  76. height: auto;
  77. background: $bg-color;
  78. border-top: 1px solid #EBEBEB;
  79. }
  80. .operator{
  81. padding-top: 160rpx;
  82. .operator-content{
  83. width: 100%;
  84. padding: 0 75rpx;
  85. box-sizing: border-box;
  86. .operator-from{
  87. width: 100%;
  88. height: auto;
  89. .from-row{
  90. height: 40rpx;
  91. padding: 24rpx 0;
  92. background: #FFFFFF;
  93. margin-bottom: 40rpx;
  94. font-size: $font-size-28;
  95. color: $text-color;
  96. border-bottom: 1px solid #E1E1E1;
  97. .input{
  98. width: 100%;
  99. height: 100%;
  100. text-align: left;
  101. }
  102. }
  103. }
  104. .operator-text{
  105. width: 100%;
  106. height: auto;
  107. margin-top: 50rpx;
  108. line-height: 40rpx;
  109. .title{
  110. margin-bottom: 50rpx;
  111. .icon-gantanhao-yuankuang{
  112. font-size: $font-size-32;
  113. color: #166CE1;
  114. margin-right: 10rpx;
  115. }
  116. .text-m{
  117. font-size: $font-size-30;
  118. color: #166CE1;
  119. }
  120. .text-s{
  121. font-size: $font-size-24;
  122. color: #999999;
  123. }
  124. }
  125. .text-main{
  126. width: 100%;
  127. height: auto;
  128. view{
  129. line-height: 40rpx;
  130. font-size: $font-size-28;
  131. color: $text-color;
  132. text-align: justify;
  133. margin-bottom: 10rpx;
  134. }
  135. }
  136. }
  137. }
  138. .add-btn{
  139. width: 600rpx;
  140. height: 88rpx;
  141. font-size: $font-size-28;
  142. line-height: 88rpx;
  143. color: #FFFFFF;
  144. margin: 0 auto;
  145. text-align: center;
  146. background: $btn-confirm;
  147. border-radius: 44rpx;
  148. margin-top: 80rpx;
  149. }
  150. .add-btn.disabled{
  151. background: #F8F8F8;
  152. border-radius: 44rpx;
  153. }
  154. }
  155. </style>