foot_dialog.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <!-- 人数拼座 -->
  3. <view class="dialog-wrap" :style="'z-index:'+zIndex">
  4. <!-- 遮罩 -->
  5. <view class="mask" :class="{ show: visible }" @tap="tapDialogShow"></view>
  6. <view class="content-mn"
  7. :class="{
  8. bottom:direction=='bottom',
  9. top:direction=='top',
  10. right:direction=='right',
  11. left:direction=='left',
  12. center:direction=='center',
  13. show: visible,
  14. isRadius:isRadius
  15. }"
  16. :style="{'background-color':conf.mainBgColor,'padding-bottom':safeAreaBottom+'px'}">
  17. <view v-if="isTitle" class="head-wrap">
  18. <view :class="'title ' + titleClass">{{ title }}</view>
  19. <image
  20. v-if="isCloseBtn"
  21. @tap="tapDialogShow"
  22. class="close"
  23. src="http://139.9.103.171:1888/img/image/close.png"
  24. mode="widthFix"
  25. ></image>
  26. </view>
  27. <view class="main-wrap">
  28. <slot name="main"></slot>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. props: {
  36. direction:{
  37. type:String,
  38. default:'bottom' // top
  39. },
  40. isTitle: {
  41. type: Boolean,
  42. default: true
  43. },
  44. isCloseBtn: {
  45. type: Boolean,
  46. default: true
  47. },
  48. isRadius:{
  49. type: Boolean,
  50. default: true
  51. },
  52. titleClass: {
  53. type: String,
  54. default: ""
  55. },
  56. title: {
  57. type: String,
  58. default: "标题"
  59. },
  60. visible: {
  61. type: Boolean,
  62. default: false
  63. },
  64. zIndex:{
  65. type: [Number,String],
  66. default: 100
  67. },
  68. config:{
  69. type:Object,
  70. default: ()=>{
  71. return {}
  72. }
  73. }
  74. },
  75. watch:{
  76. config:{
  77. deep:true,
  78. handler:(n,o)=>{
  79. console.log(79,n)
  80. if(n){
  81. this.conf = Object.assign({},n)
  82. }
  83. }
  84. }
  85. },
  86. data(){
  87. return {
  88. conf:{}
  89. }
  90. },
  91. methods: {
  92. tapDialogShow() {
  93. this.$emit("update:visible", false);
  94. this.$emit("close")
  95. }
  96. },
  97. created(){
  98. console.log(99,'safeAreaBottom',this.safeAreaBottom)
  99. console.log(93,this.conf, this.config)
  100. this.conf = Object.assign({},this.config)
  101. },
  102. };
  103. </script>
  104. <style lang="scss">
  105. // 弹窗 选择人数拼车
  106. .dialog-wrap {
  107. position: relative;
  108. width: 100%;
  109. z-index: 100;
  110. .mask.show {
  111. visibility: visible;
  112. opacity: 1;
  113. }
  114. .mask {
  115. position: fixed;
  116. top: 0;
  117. width: 100vw;
  118. height: 100vh;
  119. background-color: rgba(0, 0, 0, 0.3);
  120. transition: all 0.3s ease;
  121. visibility: hidden;
  122. opacity: 0;
  123. }
  124. .isRadius{
  125. border-radius:14upx 14upx 0upx 0upx;
  126. }
  127. .content-mn {
  128. position: fixed;
  129. left: 0;
  130. width: 100%;
  131. background-color: #fff;
  132. // padding-bottom: 1upx;
  133. transition: all 0.3s ease;
  134. z-index: 102;
  135. .head-wrap {
  136. position: relative;
  137. display: flex;
  138. align-items: center;
  139. padding: 0 30upx;
  140. min-height: 90upx;
  141. font-size: 28upx;
  142. .title {
  143. width: 100%;
  144. font-size:30upx;
  145. }
  146. .title-center {
  147. text-align: center;
  148. }
  149. .close {
  150. position: absolute;
  151. right: 0;
  152. top: 50%;
  153. transform: translateY(-50%);
  154. padding: 30upx;
  155. width: 22upx;
  156. height: 22upx;
  157. }
  158. }
  159. .main-wrap {
  160. width: 100%;
  161. }
  162. }
  163. .center{
  164. top:50%;
  165. left:50%;
  166. transform: translate(-50%,-50%) scale(0.5);
  167. opacity: 0;
  168. visibility:hidden;
  169. }
  170. .top{
  171. top: 0;
  172. transform: translateY(-100%);
  173. }
  174. .right{
  175. top:0;
  176. right:0;
  177. transform: translateX(100%);
  178. }
  179. .bottom{
  180. bottom: 0;
  181. transform: translateY(100%);
  182. }
  183. .left{
  184. top:0;
  185. left:0;
  186. transform: translateX(-100%);
  187. }
  188. .center.show{
  189. transform: translate(-50%,-50%) scale(1);
  190. opacity:1;
  191. visibility:visible;
  192. }
  193. .top.show,
  194. .bottom.show {
  195. transform: translateY(0);
  196. }
  197. .right.show,
  198. .left.show{
  199. transform: translateX(0);
  200. }
  201. }
  202. </style>