index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <view class="sdialog adffc" v-if="show">
  3. <view class="dbox adffc">
  4. <view class="db-top">{{title}}</view>
  5. <image class="db-close" :src="imgBase+'remind_close.png'" @click="close"></image>
  6. <view class="db-bottom" @click="addTeam" v-if="addShow">{{addText}}</view>
  7. <view class="db-list">
  8. <view class="db-list-item adfacjb" v-for="(item,index) in originList" :key="item.id" @click="selectItem(item,index)">
  9. <view class="db-list-item-left" :class="{'active':item.select}">{{item.name}}</view>
  10. <view class="db-list-item-right">
  11. <u-icon name="checkbox-mark" color="#199C9C" size="42rpx" v-if="item.select"></u-icon>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="zt_btn" style="margin-top: 40rpx;" @click="confirmTeam">{{confirmText}}</view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. props:{
  22. title:{
  23. typeof:String,
  24. default:'选择团队'
  25. },
  26. show:{
  27. typeof:Boolean,
  28. default:false
  29. },
  30. addShow:{
  31. typeof:Boolean,
  32. default:false
  33. },
  34. addText:{
  35. typeof:String,
  36. default:'+ 新增团队'
  37. },
  38. list:{
  39. typeof:Array,
  40. default:[]
  41. },
  42. confirmText:{
  43. typeof:String,
  44. default:'确定'
  45. }
  46. },
  47. data(){
  48. return {
  49. originList:[],
  50. current:null
  51. }
  52. },
  53. watch: {
  54. list: {
  55. handler(newValue) {
  56. this.originList = newValue;
  57. },
  58. immediate: true,
  59. deep: true
  60. }
  61. },
  62. mounted() {
  63. this.originList = this.list;
  64. },
  65. methods:{
  66. close(){
  67. this.$emit('close')
  68. },
  69. selectItem(item,index){
  70. this.current = item;
  71. this.originList.forEach((t,i)=>{
  72. this.$set(this.originList[i],'select',i===index)
  73. })
  74. },
  75. confirmTeam(){
  76. this.$emit('confirmTeam',this.current)
  77. }
  78. }
  79. }
  80. </script>
  81. <style scoped lang="less">
  82. .sdialog{
  83. position: fixed;
  84. left: 0;
  85. right: 0;
  86. top: 0;
  87. bottom: 0;
  88. z-index: 1000;
  89. background: rgba(0, 0, 0, .4);
  90. justify-content: flex-end;
  91. .dbox{
  92. width: 100%;
  93. height: 1200rpx;
  94. background: #FFFFFF;
  95. box-shadow: 0rpx -2rpx 6rpx 0rpx rgba(0,0,0,0.07);
  96. border-radius: 24rpx 24rpx 0rpx 0rpx;
  97. padding: 41rpx 30rpx 64rpx;
  98. box-sizing: border-box;
  99. position: relative;
  100. .db-top{
  101. font-family: PingFang-SC, PingFang-SC;
  102. font-weight: bold;
  103. font-size: 36rpx;
  104. color: #002846;
  105. line-height: 36rpx;
  106. text-align: center;
  107. }
  108. .db-close{
  109. width: 48rpx;
  110. height: 48rpx;
  111. position: absolute;
  112. top: 35rpx;
  113. right: 30rpx;
  114. }
  115. .db-list{
  116. flex: 1;
  117. overflow-y: auto;
  118. margin-top: 58rpx;
  119. &-item{
  120. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EFEFEF;
  121. padding: 39rpx 0;
  122. &-left{
  123. font-family: PingFangSC, PingFang SC;
  124. font-weight: 400;
  125. font-size: 32rpx;
  126. color: #002846;
  127. line-height: 32rpx;
  128. &.active{
  129. font-weight: bold;
  130. color: #009191;
  131. }
  132. }
  133. }
  134. }
  135. .db-bottom{
  136. width: 100%;
  137. height: 88rpx;
  138. background: rgba(25,156,156,0.1);
  139. border-radius: 44rpx;
  140. font-family: PingFang-SC, PingFang-SC;
  141. font-weight: bold;
  142. font-size: 32rpx;
  143. color: #009191;
  144. line-height: 88rpx;
  145. text-align: center;
  146. margin-top: 40rpx;
  147. }
  148. }
  149. }
  150. </style>