t-select-coupons.vue 7.1 KB

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