teamAdd.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view>
  3. <u-navbar title="成员信息" title-color="#101010"></u-navbar>
  4. <view class="list">
  5. <view class="item">
  6. <view class="name">
  7. <span>*</span>成员姓名
  8. </view>
  9. <view class="value">
  10. <u-input v-model="addInfo.name" placeholder="请输入成员姓名"></u-input>
  11. </view>
  12. </view>
  13. <view class="item">
  14. <view class="name">
  15. <span>*</span>登录手机号
  16. </view>
  17. <view class="value">
  18. <u-input v-model="addInfo.phone" placeholder="请输入登录手机号"></u-input>
  19. </view>
  20. </view>
  21. <view class="item">
  22. <view class="name">
  23. 登录密码
  24. </view>
  25. <view class="value">
  26. <u-input placeholder="不填写默认123456" v-model="addInfo.password"></u-input>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="floating-button">
  31. <view class="button" @click="submit">
  32. 提交
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import * as API from '@/apis/pagejs/pagesTeam.js'
  39. export default {
  40. data() {
  41. return {
  42. addInfo: {
  43. roleName:"XJ"
  44. }
  45. };
  46. },
  47. methods:{
  48. submit(){
  49. if(!this.addInfo.name){
  50. uni.showToast({
  51. title:"请输入成员姓名"
  52. })
  53. return
  54. }
  55. if(!this.addInfo.phone){
  56. uni.showToast({
  57. title:"请输入登录手机号"
  58. })
  59. return
  60. }
  61. uni.showLoading({
  62. title: "加载中",
  63. mask: true,
  64. })
  65. API.adduser(this.addInfo).then((res) => {
  66. uni.showModal({
  67. title: '提示',
  68. showCancel: false,
  69. content: "操作成功",
  70. success: res1 => {
  71. if (res1.confirm) {
  72. uni.navigateBack()
  73. } else if (res1.cancel) {
  74. //('用户点击取消');
  75. }
  76. }
  77. })
  78. uni.hideLoading();
  79. }).catch(error => {
  80. uni.hideLoading();
  81. uni.showToast({
  82. title: error,
  83. icon: "none"
  84. })
  85. })
  86. },
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. .jpmain {
  92. padding-bottom: 120rpx;
  93. }
  94. .list {
  95. background-color: rgba(255, 255, 255, 1);
  96. margin: 20rpx 0;
  97. .item:not(:last-child) {
  98. border-bottom: 2rpx solid rgba(232, 232, 232, 1);
  99. }
  100. .item {
  101. padding: 24rpx;
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-between;
  105. .name {
  106. width: 40%;
  107. font-size: 32rpx;
  108. color: #777777;
  109. span {
  110. color: red
  111. }
  112. white-space: pre;
  113. }
  114. .value {
  115. font-size: 32rpx;
  116. width: 60%;
  117. display: flex;
  118. justify-content: space-between;
  119. input::placeholder {
  120. color: #AAAAAA;
  121. }
  122. .img {
  123. width: 40rpx;
  124. height: 40rpx;
  125. }
  126. .textarea {
  127. background-color: rgba(241, 242, 245, 1);
  128. width: 100%;
  129. border-radius: 8rpx;
  130. }
  131. }
  132. }
  133. .item-plus {
  134. flex-direction: column;
  135. .value,
  136. .name {
  137. width: 100%;
  138. }
  139. .name {
  140. padding-bottom: 32rpx;
  141. }
  142. }
  143. }
  144. .floating-button {
  145. z-index: 999;
  146. position: fixed;
  147. bottom: 0;
  148. width: 100%;
  149. display: flex;
  150. height: 120rpx;
  151. justify-content: center;
  152. background-color: rgba(255, 255, 255, 1);
  153. .button {
  154. margin-top: 24rpx;
  155. border-radius: 50px;
  156. height: 80rpx;
  157. width: 80%;
  158. display: flex;
  159. align-items: center;
  160. justify-content: center;
  161. padding: 12rpx;
  162. background-color: rgba(22, 119, 255, 1);
  163. color: rgba(255, 255, 255, 1);
  164. font-size: 36rpx;
  165. }
  166. }
  167. </style>