exchangeCoupon.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template name="alert">
  2. <view class="alert spec" :class="specClass">
  3. <!-- 运费弹窗说明 -->
  4. <view class="coupon-popup">
  5. <view class="content">
  6. <view class="title">
  7. <text>兑换优惠券</text>
  8. <text class="iconfont icon-iconfontguanbi" @click.stop="hidePopup"></text>
  9. </view>
  10. <view class="text-content">
  11. <view class="coupon-input">
  12. <input class="input" type="text" v-model="params.redemptionCode" maxlength="16" placeholder="请输入16位兑换码"/>
  13. </view>
  14. <view class="coupon-main">
  15. <view class="coupon-button" @click="exchangeConfirm">立即兑换</view>
  16. <view class="coupon-text">
  17. <view class="coupon-h1">注意事项:</view>
  18. <view class="coupon-h2">1. 兑换码获取:可通过采美线下发放或者销售顾问</view>
  19. <view class="coupon-h2 indet">线上发放获得优惠券兑换码,兑换码由16位数字</view>
  20. <view class="coupon-h2 indet">和字母组成。</view>
  21. <view class="coupon-h2">2. 兑换码使用:在当前页面输入兑换码即可兑换相</view>
  22. <view class="coupon-h2 indet">应优惠券一个兑换码只能兑换一张优惠券,</view>
  23. <view class="coupon-h2 indet">不可重复使用。</view>
  24. <view class="coupon-h2">3. 输入兑换码时请区分字母大小写。</view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default{
  34. name:'alert',
  35. props:{},
  36. data() {
  37. return{
  38. params:{
  39. userId:0,
  40. redemptionCode:'',
  41. source:2,
  42. },
  43. }
  44. },
  45. created() {
  46. this.$api.getComStorage('userInfo').then((resolve) =>{
  47. this.params.userId = resolve.userId ? resolve.userId : 0;
  48. }).catch(error =>{
  49. console.log('暂无用户信息~')
  50. })
  51. },
  52. onLoad(){
  53. },
  54. methods:{
  55. exchangeConfirm(){// 立即兑换
  56. if( this.params.redemptionCode == ''){
  57. this.$util.msg('请输入位兑换码',2000)
  58. return
  59. }
  60. this.ExchangeCoupon(this.params)
  61. },
  62. ExchangeCoupon(param){// 兑换优惠券
  63. this.ProductService.ExchangeCoupon(param).then(response =>{
  64. this.$parent.ExchangeCouponData = response.data
  65. this.$parent.isExchangePopup = false
  66. this.$parent.isCouponModel = true
  67. this.$parent.isCouponShow = false
  68. })
  69. .catch(error =>{
  70. this.$util.msg(error.msg,2000);
  71. })
  72. },
  73. hidePopup(){
  74. this.$parent.isExchangePopup = false
  75. },
  76. },
  77. onShow(){
  78. }
  79. }
  80. </script>
  81. <style lang="scss">
  82. /*弹窗*/
  83. .model-warp.none{
  84. display: none;
  85. }
  86. .model-warp.show{
  87. display: block;
  88. }
  89. .coupon-popup{
  90. width: 100%;
  91. height: 100%;
  92. background: rgba(0,0,0,.5);
  93. position: fixed;
  94. top: 0;
  95. left: 0;
  96. z-index: 8888;
  97. transition: all 0.4s;
  98. &.none{
  99. display: none;
  100. }
  101. &.show{
  102. display: block;
  103. }
  104. .content{
  105. width: 580rpx;
  106. height: 700rpx;
  107. position: absolute;
  108. background: $bg-color;
  109. left: 0;
  110. right: 0;
  111. bottom: 0;
  112. top: 0;
  113. margin: auto;
  114. padding: 20rpx 25rpx;
  115. border-radius: 12rpx;
  116. .title{
  117. width: 100%;
  118. height: 68rpx;
  119. line-height: 68rpx;
  120. font-size: $font-size-28;
  121. color: $text-color;
  122. text-align: center;
  123. margin-bottom: 32rpx;
  124. position: relative;
  125. font-weight: bold;
  126. .icon-iconfontguanbi{
  127. width: 68rpx;
  128. height: 68rpx;
  129. text-align: center;
  130. line-height: 68rpx;
  131. position: absolute;
  132. right: 0;
  133. top: 0;
  134. font-size: $font-size-36;
  135. color: #999999;
  136. }
  137. }
  138. .text-content{
  139. width: 100%;
  140. height: auto;
  141. .coupon-input{
  142. width: 100%;
  143. height: auto;
  144. margin-bottom: 48rpx;
  145. .input{
  146. width: 100%;
  147. height: 66rpx;
  148. box-sizing: border-box;
  149. border: 1px solid #e2e2e2;
  150. line-height: 66rpx;
  151. padding: 0 20rpx;
  152. font-size: $font-size-26;
  153. color: #333333;
  154. border-radius: 2rpx;
  155. }
  156. }
  157. .coupon-main{
  158. width: 100%;
  159. height: auto;
  160. box-sizing: border-box;
  161. .coupon-button{
  162. width: 520rpx;
  163. height: 84rpx;
  164. margin: 0 auto;
  165. border-radius: 50rpx;
  166. line-height: 84rpx;
  167. text-align: center;
  168. background: $btn-confirm;
  169. color: #FFFFFF;
  170. font-size: $font-size-30;
  171. }
  172. .coupon-text{
  173. width: 100%;
  174. box-sizing: border-box;
  175. padding: 0 20rpx;
  176. margin-top: 40rpx;
  177. line-height: 44rpx;
  178. text-align: justify;
  179. font-size: $font-size-24;
  180. .coupon-h1{
  181. color: #333333;
  182. }
  183. .coupon-h2{
  184. color: #999999;
  185. &.indet{
  186. text-indent: 28rpx;
  187. }
  188. }
  189. }
  190. }
  191. }
  192. .btn{
  193. width: 100%;
  194. height: 88rpx;
  195. float: left;
  196. background: $btn-confirm;
  197. line-height: 88rpx;
  198. font-size: $font-size-28;
  199. text-align: center;
  200. color: #FFFFFF;
  201. border-radius: 0;
  202. padding: 0;
  203. margin-top: 2rpx;
  204. }
  205. }
  206. }
  207. </style>