teamUserDetail.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="default_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header :title='title'></cus-header>
  4. <view class="form">
  5. <view class="form-item adfacjb">
  6. <view class="form-item-left">姓名</view>
  7. <view class="form-item-right">
  8. <u-input v-model="userInfo.realName" placeholder="请输入团队人员姓名" border="none" style="font-size: 28rpx;color: #B3BFC8;line-height: 28rpx;" inputAlign="right"></u-input>
  9. </view>
  10. </view>
  11. <view class="form-item adfacjb">
  12. <view class="form-item-left">手机号码</view>
  13. <view class="form-item-right">
  14. <u-input v-model="userInfo.mobile" placeholder="请输入手机号码" border="none" style="font-size: 28rpx;color: #B3BFC8;line-height: 28rpx;" inputAlign="right"></u-input>
  15. </view>
  16. </view>
  17. <view class="form-item adfacjb">
  18. <view class="form-item-left">邮箱</view>
  19. <view class="form-item-right">
  20. <u-input v-model="userInfo.email" placeholder="请输入邮箱" border="none" style="font-size: 28rpx;color: #B3BFC8;line-height: 28rpx;" inputAlign="right"></u-input>
  21. </view>
  22. </view>
  23. </view>
  24. <!-- <view class="type adfacjb" @click="typeShow=true">
  25. <view class="type-left">团队人员身份类型</view>
  26. <view class="type-right adfac">
  27. <text>{{typeText}}</text>
  28. <image :src="imgBase+'my_arrow_right.png'"></image>
  29. </view>
  30. </view> -->
  31. <view class="zt_btn" @click="handleConfirm">确定</view>
  32. <u-picker :itemHeight="88" :immediateChange="true" :show="typeShow" :columns="typeData" title="成员身份类型"
  33. @cancel="typeShow=false" @confirm="typeConfirm" keyName="name" ></u-picker>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. data(){
  39. return {
  40. type:'',
  41. title:'团队成员',
  42. userInfo:{
  43. id:'',
  44. coachId:JSON.parse(uni.getStorageSync('userInfo')).id,
  45. realName:'',
  46. mobile:'',
  47. email:'',
  48. },
  49. typeText:'请选择',
  50. typeShow:false,
  51. typeData:[[
  52. {id:1,name:'团队Leader'},
  53. {id:2,name:'团队成员Member'},
  54. {id:3,name:'利益相关者Stakeholder'},
  55. {id:4,name:'赞助人Sponsor'}
  56. ]],
  57. }
  58. },
  59. onLoad(options) {
  60. this.type = options.type;
  61. if(options.id){
  62. this.title = '编辑成员';
  63. this.getDetail(options.id)
  64. }
  65. },
  66. methods:{
  67. getDetail(id){
  68. this.$api.get(`/core/member/${id}`).then(({data:res})=>{
  69. if(res.code!==0) return this.$showToast(res.msg)
  70. this.userInfo = {...this.userInfo,...res.data}
  71. })
  72. },
  73. typeConfirm(e){
  74. this.typeShow = false;
  75. },
  76. handleConfirm(){
  77. if(!this.userInfo.realName) return this.$showToast('请输入姓名')
  78. if(!this.$reg.mobile(this.userInfo.mobile)) return this.$showToast('请输入正确的手机号')
  79. if(!this.$reg.email(this.userInfo.email)) return this.$showToast('请输入正确的邮箱')
  80. this.$api[this.userInfo.id?'put':'post']('/core/member',this.userInfo).then(({data:res})=>{
  81. if(res.code!==0) return this.$showToast(res.msg)
  82. this.$showToast(`${this.userInfo.id?'编辑':'添加'}成功`);
  83. uni.navigateBack();
  84. })
  85. }
  86. }
  87. }
  88. </script>
  89. <style scoped lang="scss">
  90. .default_page{
  91. padding: 0 24rpx 54rpx;
  92. box-sizing: border-box;
  93. background: #F7F7F7;
  94. .form{
  95. background: #FFFFFF;
  96. border-radius: 24rpx 24rpx 0rpx 0rpx;
  97. margin-top: 20rpx;
  98. &-item{
  99. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EFEFEF;
  100. padding: 28rpx 24rpx;
  101. &-left{
  102. font-family: PingFangSC, PingFang SC;
  103. font-weight: 400;
  104. font-size: 30rpx;
  105. color: #002846;
  106. line-height: 42rpx;
  107. }
  108. }
  109. }
  110. .type{
  111. background: #FFFFFF;
  112. box-shadow: inset 0rpx -1rpx 0rpx 0rpx rgba(229,231,235,0.5);
  113. border-radius: 24rpx;
  114. margin-top: 20rpx;
  115. padding: 28rpx 24rpx;
  116. &-left{
  117. font-family: PingFangSC, PingFang SC;
  118. font-weight: 400;
  119. font-size: 30rpx;
  120. color: #002846;
  121. line-height: 42rpx;
  122. }
  123. &-right{
  124. text{
  125. font-family: PingFangSC, PingFang SC;
  126. font-weight: 400;
  127. font-size: 28rpx;
  128. color: #B3BFC8;
  129. line-height: 40rpx;
  130. }
  131. image{
  132. width: 30rpx;
  133. height: 30rpx;
  134. box-sizing: border-box;
  135. }
  136. }
  137. }
  138. .zt_btn{
  139. width: calc(100% - 100rpx);
  140. position: fixed;
  141. left: 50rpx;
  142. bottom: 54px;
  143. }
  144. }
  145. </style>