t-select-coupons.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <view>
  3. <tui-bottom-popup :show="show" @close="close">
  4. <view class="tui-coupon__box">
  5. <view class="tui-coupon__title">
  6. <text>优惠券</text>
  7. <view class="tui-icon-close" @tap="close">
  8. <tui-icon name="shut" :size="22" color="#BFBFBF"></tui-icon>
  9. </view>
  10. </view>
  11. <scroll-view scroll-y class="tui-coupon__list">
  12. <radio-group>
  13. <label class="tui-not-used tui-top20">
  14. <text>不使用优惠券</text>
  15. <radio value="-1" class="tui-coupon-radio" color="#e41f19"></radio>
  16. </label>
  17. <label v-for="(item, index) in couponList" :key="index">
  18. <view class="tui-coupon-item tui-top20">
  19. <image :src="webURL + '/static/images/mall/coupon/bg_coupon_3x.png'" class="tui-coupon-bg" mode="widthFix"></image>
  20. <view class="tui-coupon-item-left">
  21. <view class="tui-coupon-price-box">
  22. <view class="tui-coupon-price-sign" v-if="index % 2 == 0">¥</view>
  23. <view class="tui-coupon-price" :class="{ 'tui-price-small': false }">{{ index % 2 == 0 ? 50 * (index + 1) : 2.5 }}</view>
  24. <view class="tui-coupon-price-sign" v-if="index % 2 != 0">折</view>
  25. </view>
  26. <view class="tui-coupon-intro">满38元可用</view>
  27. </view>
  28. <view class="tui-coupon-item-right">
  29. <view class="tui-coupon-content">
  30. <view class="tui-coupon-title-box">
  31. <view class="tui-coupon-btn">全场券</view>
  32. <view class="tui-coupon-title">全部商品可用</view>
  33. </view>
  34. <view class="tui-coupon-rule">
  35. <view class="tui-rule-box tui-padding-btm">
  36. <view class="tui-coupon-circle"></view>
  37. <view class="tui-coupon-text">不可叠加使用</view>
  38. </view>
  39. <view class="tui-rule-box">
  40. <view class="tui-coupon-circle"></view>
  41. <view class="tui-coupon-text">{{ index % 2 == 0 ? '自领取之日起30天有效' : '2019-11-01至2019-12-31' }}</view>
  42. </view>
  43. </view>
  44. </view>
  45. <radio value="1" class="tui-coupon-radio" color="#e41f19" :checked="index==0"></radio>
  46. </view>
  47. </view>
  48. </label>
  49. </radio-group>
  50. <view class="tui-seat__box tui-top20"></view>
  51. </scroll-view>
  52. <view class="tui-btn-pay">
  53. <tui-button height="88rpx" type="danger" shape="circle" shadow @click="btnConfirm">确定</tui-button>
  54. </view>
  55. </view>
  56. </tui-bottom-popup>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. name: 'tSelectCoupons',
  62. emits: ['close'],
  63. props: {
  64. couponList: {
  65. type: Array,
  66. default () {
  67. return [{}, {}, {}, {}, {}];
  68. }
  69. },
  70. //控制显示
  71. show: {
  72. type: Boolean,
  73. default: false
  74. },
  75. page: {
  76. type: Number,
  77. default: 1
  78. }
  79. },
  80. data() {
  81. return {
  82. webURL: "https://www.thorui.cn/wx"
  83. };
  84. },
  85. methods: {
  86. close() {
  87. this.$emit('close', {});
  88. },
  89. btnConfirm() {
  90. this.close();
  91. }
  92. }
  93. };
  94. </script>
  95. <style scoped>
  96. .tui-coupon__box {
  97. width: 100%;
  98. }
  99. .tui-coupon__title {
  100. width: 100%;
  101. padding: 40rpx 30rpx;
  102. box-sizing: border-box;
  103. display: flex;
  104. align-items: center;
  105. justify-content: center;
  106. position: relative;
  107. }
  108. .tui-icon-close {
  109. position: absolute;
  110. right: 30rpx;
  111. top: 50%;
  112. transform: translateY(-50%);
  113. }
  114. .tui-coupon__list {
  115. width: 100%;
  116. height: 640rpx;
  117. padding: 0 30rpx;
  118. box-sizing: border-box;
  119. background-color: #FAFAFA;
  120. }
  121. .tui-not-used{
  122. width: 100%;
  123. display: flex;
  124. align-items: center;
  125. justify-content: space-between;
  126. font-size: 28rpx;
  127. color: #333333;
  128. background-color: #fff;
  129. padding:20rpx 30rpx;
  130. box-sizing: border-box;
  131. border-radius:6rpx;
  132. }
  133. .tui-coupon-item {
  134. width: 100%;
  135. height: 210rpx;
  136. position: relative;
  137. display: flex;
  138. align-items: center;
  139. padding-right: 30rpx;
  140. box-sizing: border-box;
  141. overflow: hidden;
  142. }
  143. .tui-coupon-bg {
  144. width: 100%;
  145. height: 210rpx;
  146. position: absolute;
  147. left: 0;
  148. top: 0;
  149. z-index: 1;
  150. }
  151. .tui-coupon-sign {
  152. height: 110rpx;
  153. width: 110rpx;
  154. position: absolute;
  155. z-index: 9;
  156. top: -30rpx;
  157. right: 40rpx;
  158. }
  159. .tui-coupon-item-left {
  160. width: 218rpx;
  161. height: 210rpx;
  162. position: relative;
  163. z-index: 2;
  164. display: flex;
  165. align-items: center;
  166. justify-content: center;
  167. flex-direction: column;
  168. flex-shrink: 0;
  169. }
  170. .tui-coupon-price-box {
  171. display: flex;
  172. color: #e41f19;
  173. align-items: flex-end;
  174. }
  175. .tui-coupon-price-sign {
  176. font-size: 30rpx;
  177. }
  178. .tui-coupon-price {
  179. font-size: 70rpx;
  180. line-height: 68rpx;
  181. font-weight: bold;
  182. }
  183. .tui-price-small {
  184. font-size: 58rpx !important;
  185. line-height: 56rpx !important;
  186. }
  187. .tui-coupon-intro {
  188. background: #f7f7f7;
  189. padding: 8rpx 10rpx;
  190. font-size: 26rpx;
  191. line-height: 26rpx;
  192. font-weight: 400;
  193. color: #666;
  194. margin-top: 18rpx;
  195. }
  196. .tui-coupon-item-right {
  197. flex: 1;
  198. height: 210rpx;
  199. position: relative;
  200. z-index: 2;
  201. display: flex;
  202. align-items: center;
  203. justify-content: space-between;
  204. padding-left: 24rpx;
  205. box-sizing: border-box;
  206. overflow: hidden;
  207. }
  208. .tui-coupon-content {
  209. width: 82%;
  210. display: flex;
  211. flex-direction: column;
  212. justify-content: center;
  213. }
  214. .tui-coupon-title-box {
  215. display: flex;
  216. align-items: center;
  217. }
  218. .tui-coupon-btn {
  219. padding: 6rpx;
  220. background: #ffebeb;
  221. color: #e41f19;
  222. font-size: 25rpx;
  223. line-height: 25rpx;
  224. display: flex;
  225. align-items: center;
  226. justify-content: center;
  227. transform: scale(0.9);
  228. transform-origin: 0 center;
  229. border-radius: 4rpx;
  230. flex-shrink: 0;
  231. }
  232. .tui-coupon-title {
  233. width: 100%;
  234. font-size: 26rpx;
  235. color: #333;
  236. white-space: nowrap;
  237. overflow: hidden;
  238. text-overflow: ellipsis;
  239. }
  240. .tui-coupon-rule {
  241. padding-top: 52rpx;
  242. }
  243. .tui-rule-box {
  244. display: flex;
  245. align-items: center;
  246. transform: scale(0.8);
  247. transform-origin: 0 100%;
  248. }
  249. .tui-padding-btm {
  250. padding-bottom: 6rpx;
  251. }
  252. .tui-coupon-circle {
  253. width: 8rpx;
  254. height: 8rpx;
  255. background: rgb(160, 160, 160);
  256. border-radius: 50%;
  257. }
  258. .tui-coupon-text {
  259. font-size: 28rpx;
  260. line-height: 28rpx;
  261. font-weight: 400;
  262. color: #666;
  263. padding-left: 8rpx;
  264. white-space: nowrap;
  265. }
  266. .tui-top20 {
  267. margin-top: 20rpx;
  268. }
  269. .tui-coupon-title {
  270. font-size: 28rpx;
  271. line-height: 28rpx;
  272. }
  273. .tui-coupon-radio {
  274. transform: scale(0.7);
  275. transform-origin: 100% center;
  276. }
  277. /* #ifdef APP-PLUS || MP */
  278. .wx-radio-input {
  279. margin-right: 0 !important;
  280. }
  281. /* #endif */
  282. /* #ifdef H5 */
  283. ::v-deep uni-radio .uni-radio-input {
  284. margin-right: 0 !important;
  285. }
  286. /* #endif */
  287. .tui-seat__box {
  288. width: 100%;
  289. height: 1rpx;
  290. }
  291. .tui-btn-pay {
  292. width: 100%;
  293. padding: 20rpx 60rpx 40rpx;
  294. box-sizing: border-box;
  295. }
  296. </style>