mask-model.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="mask-model" v-show="showMask">
  3. <view class="mask" @click="hide"></view>
  4. <view class="model-count">
  5. <view class="amen-tit">{{ !typeShow ? '下拉提示' : '提示信息'}}</view>
  6. <view class="count" :style="{'color':titleColoe}">{{maskTitle}}</view>
  7. <button form-type="submit" class="switchBtn" v-if="typeShow">切换{{tabname}}</button>
  8. <button form-type="submit" class="switchBtn" v-if="typeShow">强制装载</button>
  9. <button form-type="submit" class="eleBtn" @click="hide" v-if="typeShow">取消</button>
  10. <view class="bot" v-if="!typeShow">
  11. <button form-type="submit" class="eleBtns" @click="hide">取消</button>
  12. <button form-type="submit" class="switchBtndel" >确定</button>
  13. </view>
  14. <!-- <view class="btm-box">
  15. <view v-show="btnType==1" class="btn cancel" @click="hide" :style="{'color':cancelColor}">取消</view>
  16. <view class="btn confirm" @click="confirm" :style="{'color':confirmColor}">确定</view>
  17. </view> -->
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. maskTitle: {//提示内容
  25. type: String,
  26. default:'提示消息'
  27. },
  28. titleColoe:{//提示信息字体颜色
  29. type: String,
  30. default:'#666666'
  31. },
  32. confirmColor:{//确定按钮字体颜色
  33. type: String,
  34. default:'#007AFF'
  35. },
  36. cancelColor:{//取消按钮字体颜色
  37. type: String,
  38. default:'#666666'
  39. },
  40. btnType:{//1显示取消按钮
  41. type: String,
  42. default:'1'
  43. },
  44. tabname:{//名称
  45. type: String,
  46. default:'1'
  47. },
  48. typeShow: {
  49. type: Boolean,
  50. }
  51. },
  52. data() {
  53. return {
  54. showMask:false,
  55. };
  56. },
  57. mounted() {
  58. },
  59. created() {
  60. },
  61. computed: {
  62. },
  63. methods: {
  64. show:function(){
  65. this.showMask = true;
  66. },
  67. hide:function(){
  68. this.$emit('cancel');
  69. this.showMask = false;
  70. },
  71. confirm:function(e){
  72. this.showMask = false;
  73. this.$emit('confirm');
  74. },
  75. }
  76. }
  77. </script>
  78. <style scoped>
  79. .mask-model{
  80. position: fixed;
  81. width: 100%;
  82. height: 100%;
  83. left: 0;
  84. top: 0;
  85. z-index: 999;
  86. }
  87. .bot{
  88. width: 100%;
  89. /* padding: 0 .55rem 0 .55rem; */
  90. display: flex;
  91. justify-content: space-between;
  92. align-items: center;
  93. margin-top: 1.25rem;
  94. }
  95. .mask-model .mask{
  96. width: 100%;
  97. height: 100%;
  98. background: rgba(0,0,0,0.65);
  99. }
  100. .switchBtn{
  101. width: 12rem;
  102. height: 2.125rem;
  103. background: linear-gradient(179.11deg, rgba(51,161,165,1.00) 1.866%,rgba(59,111,142,1.00) 137.144%,rgba(59,111,142,1.00) 137.144%,rgba(59,111,142,1.00) 137.144%);
  104. border-radius:
  105. 4px;
  106. display: flex;
  107. align-items: center;
  108. justify-content: center;
  109. color: rgb(255, 255, 255);
  110. font-family: Noto Sans SC;
  111. font-size: 15px;
  112. font-weight: 700;
  113. margin-bottom: 1rem;
  114. }
  115. .switchBtndel{
  116. width: 5rem;
  117. height: 2rem;
  118. background: linear-gradient(179.11deg, rgba(51,161,165,1.00) 1.866%,rgba(59,111,142,1.00) 137.144%,rgba(59,111,142,1.00) 137.144%,rgba(59,111,142,1.00) 137.144%);
  119. border-radius:
  120. 4px;
  121. display: flex;
  122. align-items: center;
  123. justify-content: center;
  124. color: rgb(255, 255, 255);
  125. font-family: Noto Sans SC;
  126. font-size: 15px;
  127. font-weight: 700;
  128. }
  129. .eleBtns{
  130. width: 5rem;
  131. height: 2rem;
  132. display: flex;
  133. align-items: center;
  134. justify-content: center;
  135. background: rgb(243, 253, 255);
  136. border: 1px solid rgb(172, 218, 230);
  137. border-radius:
  138. 4px;
  139. color: rgb(59, 150, 159);
  140. font-family: Noto Sans SC;
  141. font-size: 15px;
  142. font-weight: 500;
  143. }
  144. .eleBtn{
  145. width: 12rem;
  146. height: 2.125rem;
  147. display: flex;
  148. align-items: center;
  149. justify-content: center;
  150. background: rgb(243, 253, 255);
  151. border: 1px solid rgb(172, 218, 230);
  152. border-radius:
  153. 4px;
  154. color: rgb(59, 150, 159);
  155. font-family: Noto Sans SC;
  156. font-size: 15px;
  157. font-weight: 500;
  158. }
  159. .model-count{
  160. width: 14.5rem;
  161. border-radius: 20rpx;
  162. background: #FFFFFF;
  163. position: absolute;
  164. left: 50%;
  165. top: 50%;
  166. transform: translate(-50%,-50%);
  167. z-index: 9;
  168. min-height: 9.375rem;
  169. padding: 1.5rem 0 1.5rem 0;
  170. overflow: hidden;
  171. }
  172. .amen-tit{
  173. text-align: center;
  174. color: rgb(48, 51, 57);
  175. font-family: Noto Sans SC;
  176. font-size: 1rem;
  177. font-weight: 700;
  178. line-height: 80rpx;
  179. }
  180. .count{
  181. /* text-align: center; */
  182. /* padding:30rpx; */
  183. padding: .625rem .875rem 1.875rem .875rem;
  184. color: rgb(106, 113, 125);
  185. font-family: Noto Sans SC;
  186. font-size: 14px;
  187. font-weight: 500;
  188. max-height: 300rpx;
  189. overflow-y: scroll;
  190. }
  191. .btm-box{
  192. position: absolute;
  193. width: 100%;
  194. left: 0;
  195. bottom: 0;
  196. z-index: 9;
  197. display: flex;
  198. border-top: 1px solid #F5F5F5;
  199. }
  200. .btm-box .btn{
  201. flex: 1;
  202. box-sizing: border-box;
  203. height: 96rpx;
  204. line-height: 96rpx;
  205. text-align: center;
  206. font-size: 30rpx;
  207. }
  208. .btm-box .btn.confirm{
  209. color: #007AFF;
  210. }
  211. .btm-box .btn.cancel{
  212. color: #666666;
  213. border-right: 1px solid #F5F5F5;
  214. }
  215. </style>