activities.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view>
  3. <view class="tui-alert-class tui-alert-box" :class="[show?'tui-alert-show':'tui-alert-hide']" @touchmove.stop.prevent="discard">
  4. <view class="tui-goods__item">
  5. <swiper class="tui-goods__ross"
  6. circular
  7. @change="swiperChange"
  8. :indicator-dots="false"
  9. :autoplay="false"
  10. >
  11. <swiper-item v-for="(item, index) in list" :key="item">
  12. <view class="tui-goods__ross" @click="handleClick(item)">
  13. <image class="ross-image" :src="item.crmImage" mode=""></image>
  14. </view>
  15. </swiper-item>
  16. </swiper>
  17. <text class="iconfont icon-2guanbi" @click.stop="handleClickCancel"></text>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. name:'tuiAlert',
  25. props: {
  26. list:{
  27. type:Array,
  28. default:[]
  29. },
  30. //控制显示
  31. show: {
  32. type: Boolean,
  33. default: false
  34. },
  35. //提示信息字体大小
  36. size: {
  37. type: Number,
  38. default: 30
  39. },
  40. //提示信息字体颜色
  41. color: {
  42. type: String,
  43. default: '#333'
  44. },
  45. //按钮字体颜色
  46. btnColor: {
  47. type: String,
  48. default: '#EB0909'
  49. },
  50. btnText:{
  51. type: String,
  52. default: ''
  53. },
  54. //点击遮罩 是否可关闭
  55. maskClosable: {
  56. type: Boolean,
  57. default: false
  58. },
  59. current:{
  60. type: Number,
  61. default: 0
  62. }
  63. },
  64. created() {},
  65. methods: {
  66. swiperChange(e) {//轮播图切换
  67. this.current = e.detail.current
  68. },
  69. handleClick(item) {
  70. this.$emit('click',item)
  71. },
  72. handleClickCancel() {
  73. this.$emit('cancel',false)
  74. },
  75. discard(){
  76. //丢弃
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss">
  82. .tui-alert-box {
  83. width: 100%;
  84. height: 100%;
  85. display: flex;
  86. align-items: center;
  87. justify-content: center;
  88. flex-direction: column;
  89. position: fixed;
  90. left: 0;
  91. top: 100%;
  92. opacity: 0;
  93. background: rgba(0,0,0,.5);
  94. z-index: 99999;
  95. .tui-goods__item {
  96. width: 480rpx;
  97. height: 702rpx;
  98. box-sizing: border-box;
  99. position: relative;
  100. margin-top: 50rpx;
  101. .tui-goods__ross{
  102. width: 480rpx;
  103. height: 702rpx;
  104. text-align: center;
  105. color: #fff;
  106. float: left;
  107. overflow: hidden;
  108. .ross-image{
  109. width: 100%;
  110. height: 100%;
  111. display: block;
  112. }
  113. }
  114. }
  115. }
  116. .tui-alert-show {
  117. top: 0;
  118. opacity: 1;
  119. // animation:rundtop 0.5s;
  120. }
  121. .tui-alert-hide{
  122. top: 100%;
  123. opacity: 0;
  124. // animation:rundbottom 0.5s;
  125. }
  126. .icon-2guanbi{
  127. display: block;
  128. width: 80rpx;
  129. height: 80rpx;
  130. line-height: 80rpx;
  131. text-align: center;
  132. color: #FFFFFF;
  133. position: absolute;
  134. bottom: -18%;
  135. left: 50%;
  136. font-size: 52rpx;
  137. margin-left: -20px;
  138. }
  139. .tui-alert-mask-show {
  140. visibility: visible;
  141. opacity: 1;
  142. }
  143. .tui-alert-btn {
  144. width: 100%;
  145. height: 90rpx;
  146. display: flex;
  147. align-items: center;
  148. justify-content: center;
  149. background-color: #fff;
  150. box-sizing: border-box;
  151. position: relative;
  152. font-size: 32rpx;
  153. line-height: 32rpx;
  154. }
  155. .tui-alert-btn-hover {
  156. background-color: #f7f7f7;
  157. }
  158. .tui-alert-btn::before {
  159. width: 100%;
  160. content: "";
  161. position: absolute;
  162. border-top: 1rpx solid #E0E0E0;
  163. -webkit-transform: scaleY(0.5);
  164. transform: scaleY(0.5);
  165. left: 0;
  166. top: 0;
  167. }
  168. @keyframes rundtop{
  169. 0%{top: 100%;opacity: 0;}
  170. 100%{top:0;opacity: 1;}
  171. }
  172. @keyframes rundbottom{
  173. 0%{top: 0;opacity: 1;}
  174. 100%{top:100%;opacity: 0;}
  175. }
  176. </style>