sellerExchangeCoupon.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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('orderUserInfo').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. })
  68. .catch(error =>{
  69. this.$util.msg(error.msg,2000);
  70. })
  71. },
  72. hidePopup(){
  73. this.$parent.isExchangePopup = false
  74. },
  75. },
  76. onShow(){
  77. }
  78. }
  79. </script>
  80. <style lang="scss">
  81. /*弹窗*/
  82. .model-warp.none{
  83. display: none;
  84. }
  85. .model-warp.show{
  86. display: block;
  87. }
  88. .coupon-popup{
  89. width: 100%;
  90. height: 100%;
  91. background: rgba(0,0,0,.5);
  92. position: fixed;
  93. top: 0;
  94. left: 0;
  95. z-index: 8888;
  96. transition: all 0.4s;
  97. &.none{
  98. display: none;
  99. }
  100. &.show{
  101. display: block;
  102. }
  103. .content{
  104. width: 580rpx;
  105. height: 700rpx;
  106. position: absolute;
  107. background: $bg-color;
  108. left: 0;
  109. right: 0;
  110. bottom: 0;
  111. top: 0;
  112. margin: auto;
  113. padding: 20rpx 25rpx;
  114. border-radius: 12rpx;
  115. .title{
  116. width: 100%;
  117. height: 68rpx;
  118. line-height: 68rpx;
  119. font-size: $font-size-28;
  120. color: $text-color;
  121. text-align: center;
  122. margin-bottom: 32rpx;
  123. position: relative;
  124. font-weight: bold;
  125. .icon-iconfontguanbi{
  126. width: 68rpx;
  127. height: 68rpx;
  128. text-align: center;
  129. line-height: 68rpx;
  130. position: absolute;
  131. right: 0;
  132. top: 0;
  133. font-size: $font-size-36;
  134. color: #999999;
  135. }
  136. }
  137. .text-content{
  138. width: 100%;
  139. height: auto;
  140. .coupon-input{
  141. width: 100%;
  142. height: auto;
  143. margin-bottom: 48rpx;
  144. .input{
  145. width: 100%;
  146. height: 66rpx;
  147. box-sizing: border-box;
  148. border: 1px solid #e2e2e2;
  149. line-height: 66rpx;
  150. padding: 0 20rpx;
  151. font-size: $font-size-26;
  152. color: #333333;
  153. border-radius: 2rpx;
  154. }
  155. }
  156. .coupon-main{
  157. width: 100%;
  158. height: auto;
  159. box-sizing: border-box;
  160. .coupon-button{
  161. width: 520rpx;
  162. height: 84rpx;
  163. margin: 0 auto;
  164. border-radius: 50rpx;
  165. line-height: 84rpx;
  166. text-align: center;
  167. background: $btn-confirm;
  168. color: #FFFFFF;
  169. font-size: $font-size-30;
  170. }
  171. .coupon-text{
  172. width: 100%;
  173. box-sizing: border-box;
  174. padding: 0 20rpx;
  175. margin-top: 40rpx;
  176. line-height: 44rpx;
  177. text-align: justify;
  178. font-size: $font-size-24;
  179. .coupon-h1{
  180. color: #333333;
  181. }
  182. .coupon-h2{
  183. color: #999999;
  184. &.indet{
  185. text-indent: 28rpx;
  186. }
  187. }
  188. }
  189. }
  190. }
  191. .btn{
  192. width: 100%;
  193. height: 88rpx;
  194. float: left;
  195. background: $btn-confirm;
  196. line-height: 88rpx;
  197. font-size: $font-size-28;
  198. text-align: center;
  199. color: #FFFFFF;
  200. border-radius: 0;
  201. padding: 0;
  202. margin-top: 2rpx;
  203. }
  204. }
  205. }
  206. </style>