index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. addTeam(){
  76. this.$emit('addTeam')
  77. },
  78. confirmTeam(){
  79. this.$emit('confirmTeam',this.current)
  80. }
  81. }
  82. }
  83. </script>
  84. <style scoped lang="less">
  85. .sdialog{
  86. position: fixed;
  87. left: 0;
  88. right: 0;
  89. top: 0;
  90. bottom: 0;
  91. z-index: 1000;
  92. background: rgba(0, 0, 0, .4);
  93. justify-content: flex-end;
  94. .dbox{
  95. width: 100%;
  96. height: 1200rpx;
  97. background: #FFFFFF;
  98. box-shadow: 0rpx -2rpx 6rpx 0rpx rgba(0,0,0,0.07);
  99. border-radius: 24rpx 24rpx 0rpx 0rpx;
  100. padding: 41rpx 30rpx 64rpx;
  101. box-sizing: border-box;
  102. position: relative;
  103. .db-top{
  104. font-family: PingFang-SC, PingFang-SC;
  105. font-weight: bold;
  106. font-size: 36rpx;
  107. color: #002846;
  108. line-height: 36rpx;
  109. text-align: center;
  110. }
  111. .db-close{
  112. width: 48rpx;
  113. height: 48rpx;
  114. position: absolute;
  115. top: 35rpx;
  116. right: 30rpx;
  117. }
  118. .db-list{
  119. flex: 1;
  120. overflow-y: auto;
  121. margin-top: 58rpx;
  122. &-item{
  123. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EFEFEF;
  124. padding: 39rpx 0;
  125. &-left{
  126. font-family: PingFangSC, PingFang SC;
  127. font-weight: 400;
  128. font-size: 32rpx;
  129. color: #002846;
  130. line-height: 32rpx;
  131. &.active{
  132. font-weight: bold;
  133. color: #009191;
  134. }
  135. }
  136. }
  137. }
  138. .db-bottom{
  139. width: 100%;
  140. height: 88rpx;
  141. background: rgba(25,156,156,0.1);
  142. border-radius: 44rpx;
  143. font-family: PingFang-SC, PingFang-SC;
  144. font-weight: bold;
  145. font-size: 32rpx;
  146. color: #009191;
  147. line-height: 88rpx;
  148. text-align: center;
  149. margin-top: 40rpx;
  150. }
  151. }
  152. }
  153. </style>