refund.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="popup" @tap="closePopup">
  3. <view class="model" @tap.stop>
  4. <view class="title">
  5. <text>退款规则</text>
  6. <image src="/static/index/cut.png" mode="" @tap="closePopup"></image>
  7. </view>
  8. <view class="popup-body">
  9. <view class="tag">
  10. <view class="tips">
  11. 退款标签
  12. </view>
  13. <view class="item" v-for="(item,index) in tagList" :key="index" @click="selectTag(item,index)">
  14. {{item.name}}
  15. <image src="/static/product/select.png" mode="" v-if="tagCurrent == index"></image>
  16. <image src="/static/product/round.png" mode="" v-else></image>
  17. </view>
  18. </view>
  19. <view class="tag">
  20. <view class="tips">
  21. 退款是否商家确认
  22. </view>
  23. <view class="item" v-for="(item,index) in verifyList" :key="index" @click="selectverify(item,index)">
  24. {{item.name}}
  25. <image src="/static/product/select.png" mode="" v-if="verifyCurrent == index"></image>
  26. <image src="/static/product/round.png" mode="" v-else></image>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="foot">
  31. <view class="cancel" @tap="closePopup">取消</view>
  32. <view class="sub" @tap="confirm">确定</view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. tagList:[
  42. {
  43. name:'随时退',
  44. refundLabel:1
  45. },
  46. {
  47. name:'过期自动退',
  48. refundLabel:2
  49. }
  50. ],
  51. tagCurrent:null,
  52. verifyList:[
  53. {
  54. name:'需要确认',
  55. refundConfirm:1
  56. },
  57. {
  58. name:'无需确认',
  59. refundConfirm:0
  60. }
  61. ],
  62. verifyCurrent:null,
  63. refundLabel:[],
  64. refundConfirm:[],
  65. };
  66. },
  67. methods: {
  68. closePopup() {
  69. this.$emit('close');
  70. },
  71. confirm() {
  72. if(this.refundLabel.length ==0 || this.refundConfirm.length ==0 ){
  73. console.log('5555')
  74. uni.showToast({
  75. title: '请选择退款规则',
  76. icon:'none'
  77. });
  78. }else{
  79. this.$emit('confirm', {
  80. refundLabel: this.refundLabel,
  81. refundConfirm: this.refundConfirm
  82. });
  83. this.closePopup();
  84. }
  85. },
  86. selectTag(item,index){
  87. this.tagCurrent = index
  88. this.refundLabel = item
  89. },
  90. selectverify(item,index){
  91. this.verifyCurrent = index
  92. this.refundConfirm = item
  93. }
  94. }
  95. };
  96. </script>
  97. <style lang="scss" scoped>
  98. .popup {
  99. width: 100vw;
  100. height: 100vh;
  101. position: fixed;
  102. top: 0;
  103. left: 0;
  104. background: rgba(0, 0, 0, 0.4);
  105. display: flex;
  106. // align-items: end;
  107. align-items: flex-end;
  108. z-index: 99;
  109. .model{
  110. width: 100%;
  111. background-color: #fff;
  112. border-radius: 20rpx 20rpx 0rpx 0rpx;
  113. padding: 0rpx 24rpx;
  114. padding-bottom: 20rpx;
  115. .title {
  116. width: 100%;
  117. height: 86rpx;
  118. display: flex;
  119. align-items: center;
  120. justify-content: center;
  121. position: relative;
  122. border-bottom: 1px solid #eeeeee;
  123. margin-bottom: 24rpx;
  124. image {
  125. width: 40rpx;
  126. height: 40rpx;
  127. position: absolute;
  128. right: 0px;
  129. }
  130. }
  131. .popup-body{
  132. .tag{
  133. margin-bottom: 24rpx;
  134. .tips{
  135. font-size: 28rpx;
  136. }
  137. .item{
  138. width: 100%;
  139. height: 70rpx;
  140. font-size: 26rpx;
  141. border-bottom: 1px solid #EEEEEE;
  142. display: flex;
  143. align-items: center;
  144. justify-content: space-between;
  145. image{
  146. width: 28rpx;
  147. height: 28rpx;
  148. }
  149. }
  150. }
  151. }
  152. .foot{
  153. display: flex;
  154. justify-content: space-between;
  155. border-top: 1px solid #eeeeee;
  156. padding-top: 16rpx;
  157. .cancel{
  158. width: 324rpx;
  159. height: 76rpx;
  160. border-radius: 54rpx;
  161. border: 1px solid #CCCCCC;
  162. font-size: 28rpx;
  163. color: #999999;
  164. display: flex;
  165. justify-content: center;
  166. align-items: center;
  167. }
  168. .sub{
  169. width: 324rpx;
  170. height: 76rpx;
  171. background: linear-gradient( 90deg, #77B6FF 0%, #449AFF 100%);
  172. border-radius: 54rpx;
  173. border: 1px solid #CCCCCC;
  174. font-size: 28rpx;
  175. color: #ffffff;
  176. display: flex;
  177. justify-content: center;
  178. align-items: center;
  179. }
  180. }
  181. }
  182. }
  183. </style>