popViewGG.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view>
  3. <view class="tui-actionsheet-mask" :class="[show?'tui-mask-show':'']" @tap="handleClickMask"></view>
  4. <view class="tui-actionsheet-class tui-actionsheet" :class="[show?'tui-actionsheet-show':'']">
  5. <view class="tui-tips" :style="{fontSize:size+'rpx',color:color}" v-if="tips">
  6. {{tips}}
  7. </view>
  8. <view :class="[isCancel?'tui-operate-box':'tui-operate-boxN']">
  9. <slot></slot>
  10. </view>
  11. <view v-if="showbotom">
  12. <view class="tui-actionsheet-btn tui-actionsheet-cancel" hover-class="tui-actionsheet-hover"
  13. :hover-stay-time="150" v-if="isCancel" @tap="handleClickCancel(1)">{{$t("order.wancheng")}}</view>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. name: "tuiActionsheet",
  21. props: {
  22. //点击遮罩 是否可关闭
  23. maskClosable: {
  24. type: Boolean,
  25. default: true
  26. },
  27. //显示操作菜单
  28. show: {
  29. type: Boolean,
  30. default: false
  31. },
  32. //菜单按钮数组,自定义文本颜色,红色参考色:#e53a37
  33. itemList:{},
  34. //提示文字
  35. tips: {
  36. type: String,
  37. default: ""
  38. },
  39. //提示文字
  40. acttips: {
  41. type: String,
  42. default:''
  43. },
  44. //提示文字颜色
  45. color: {
  46. type: String,
  47. default: "#9a9a9a"
  48. },
  49. //提示文字大小 rpx
  50. size: {
  51. type: Number,
  52. default: 26
  53. },
  54. //是否需要取消按钮
  55. isCancel: {
  56. type: Boolean,
  57. default: true
  58. },
  59. //是否需要底部按钮
  60. showbotom: {
  61. type: Boolean,
  62. default: true
  63. },
  64. },
  65. watch: {
  66. show(val){
  67. if(val){
  68. // 背景不可滚动
  69. //document.body.style.overflow='hidden';
  70. }
  71. else{
  72. // 背景可滚动
  73. //document.body.style.overflow='';
  74. }
  75. }
  76. },
  77. methods: {
  78. handleClickMask() {
  79. if (!this.maskClosable) return;
  80. this.handleClickCancel(0);
  81. },
  82. handleClickItem(e) {
  83. if (!this.show) return;
  84. const dataset = e.currentTarget.dataset;
  85. this.$emit('click', {
  86. index: dataset.index
  87. });
  88. },
  89. selectGuige(index,name){
  90. this.$emit('EselectGuige',index,name);
  91. },
  92. handleClickCancel(type) {
  93. if(type==1){
  94. this.$emit('ClickCancel');
  95. }
  96. this.$emit('chooseCancel');
  97. }
  98. }
  99. }
  100. </script>
  101. <style>
  102. .tui-actionsheet {
  103. width:750upx;
  104. position: fixed;
  105. left: 0;
  106. right: 0;
  107. bottom: 0;
  108. z-index: 9999;
  109. visibility: hidden;
  110. transform: translate3d(0, 100%, 0);
  111. transform-origin: center;
  112. transition: all 0.3s ease-in-out;
  113. background: #eaeaec;
  114. min-height: 100rpx;
  115. }
  116. .tui-actionsheet-show {
  117. transform: translate3d(0, 0, 0);
  118. visibility: visible;
  119. }
  120. .tui-tips {
  121. width:750upx;
  122. padding: 30rpx 60rpx;
  123. box-sizing: border-box;
  124. text-align: center;
  125. background: #fff;
  126. display: flex;
  127. align-items: center;
  128. justify-content: center;
  129. }
  130. .tui-operate-box {
  131. padding-bottom: 12rpx;
  132. max-height: 80vh;
  133. overflow: scroll;
  134. }
  135. .tui-operate-boxN {
  136. max-height: 80vh;
  137. overflow: scroll;
  138. }
  139. .tui-actionsheet-btn {
  140. width:750upx;
  141. height: 100rpx;
  142. background: #fff;
  143. display: flex;
  144. align-items: center;
  145. justify-content: center;
  146. text-align: center;
  147. font-size: 36rpx;
  148. position: relative;
  149. }
  150. .tui-btn-last {
  151. padding-bottom: env(safe-area-inset-bottom);
  152. }
  153. .tui-actionsheet-divider::before {
  154. content: '';
  155. width:750upx;
  156. border-top: 1rpx solid #d9d9d9;
  157. position: absolute;
  158. top: 0;
  159. left: 0;
  160. -webkit-transform: scaleY(0.5);
  161. transform: scaleY(0.5);
  162. }
  163. .tui-actionsheet-cancel {
  164. color: #1a1a1a;
  165. padding-bottom: env(safe-area-inset-bottom);
  166. }
  167. .tui-actionsheet-hover {
  168. background: #f7f7f9;
  169. }
  170. .tui-actionsheet-mask {
  171. position: fixed;
  172. top: 0;
  173. left: 0;
  174. right: 0;
  175. bottom: 0;
  176. background: rgba(0, 0, 0, 0.6);
  177. z-index: 9996;
  178. transition: all 0.3s ease-in-out;
  179. opacity: 0;
  180. visibility: hidden;
  181. }
  182. .tui-mask-show {
  183. opacity: 1;
  184. visibility: visible;
  185. }
  186. .skuViewCt{
  187. display: flex;
  188. flex-direction: column;
  189. justify-content:center;
  190. width: 100%;
  191. margin-top: 10rpx;
  192. }
  193. .contensbgg{
  194. display: flex;
  195. flex-wrap: wrap;
  196. justify-content:flex-start;
  197. align-items:center;
  198. }
  199. .guigeleixing{
  200. font-size: 26rpx;
  201. line-height: 40rpx;
  202. height: 40rpx;
  203. color: black;
  204. font-weight: bold;
  205. }
  206. .youhuixinxi{
  207. margin: 8rpx;
  208. padding: 4rpx;
  209. font-size: 26rpx;
  210. line-height: 54rpx;
  211. height: 54rpx;
  212. border: 2rpx solid lightgray;
  213. border-radius: 8rpx;
  214. }
  215. .xz{
  216. background-color: #ff0000;
  217. }
  218. </style>