refund.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. props: {
  40. Confirm: {
  41. type: String,
  42. default: ''
  43. },
  44. Label:{
  45. type: String,
  46. default: ''
  47. }
  48. },
  49. data() {
  50. return {
  51. tagList: [{
  52. name: '随时退',
  53. refundLabel: 1
  54. },
  55. {
  56. name: '过期自动退',
  57. refundLabel: 2
  58. }
  59. ],
  60. tagCurrent: null,
  61. verifyList: [{
  62. name: '需要确认',
  63. refundConfirm: 1
  64. },
  65. {
  66. name: '无需确认',
  67. refundConfirm: 0
  68. }
  69. ],
  70. verifyCurrent: null,
  71. refundLabel: [],
  72. refundConfirm: [],
  73. };
  74. },
  75. methods: {
  76. closePopup() {
  77. this.$emit('close');
  78. },
  79. confirm() {
  80. if (this.refundLabel.length == 0 || this.refundConfirm.length == 0) {
  81. uni.showToast({
  82. title: '请选择退款规则',
  83. icon: 'none'
  84. });
  85. } else {
  86. this.$emit('confirm', {
  87. refundLabel: this.refundLabel,
  88. refundConfirm: this.refundConfirm
  89. });
  90. this.closePopup();
  91. }
  92. },
  93. selectTag(item, index) {
  94. this.tagCurrent = index
  95. this.refundLabel = item
  96. },
  97. selectverify(item, index) {
  98. this.verifyCurrent = index
  99. this.refundConfirm = item
  100. }
  101. },
  102. mounted() {
  103. setTimeout(()=>{
  104. this.tagCurrent = this.Label
  105. this.verifyCurrent = this.Confirm
  106. this.$forceUpdate()
  107. },100)
  108. }
  109. };
  110. </script>
  111. <style lang="scss" scoped>
  112. .popup {
  113. width: 100vw;
  114. height: 100vh;
  115. position: fixed;
  116. top: 0;
  117. left: 0;
  118. background: rgba(0, 0, 0, 0.4);
  119. display: flex;
  120. // align-items: end;
  121. align-items: flex-end;
  122. z-index: 99;
  123. .model {
  124. width: 100%;
  125. background-color: #fff;
  126. border-radius: 20rpx 20rpx 0rpx 0rpx;
  127. padding: 0rpx 24rpx;
  128. padding-bottom: 20rpx;
  129. .title {
  130. width: 100%;
  131. height: 86rpx;
  132. display: flex;
  133. align-items: center;
  134. justify-content: center;
  135. position: relative;
  136. border-bottom: 1px solid #eeeeee;
  137. margin-bottom: 24rpx;
  138. image {
  139. width: 40rpx;
  140. height: 40rpx;
  141. position: absolute;
  142. right: 0px;
  143. }
  144. }
  145. .popup-body {
  146. .tag {
  147. margin-bottom: 24rpx;
  148. .tips {
  149. font-size: 28rpx;
  150. }
  151. .item {
  152. width: 100%;
  153. height: 70rpx;
  154. font-size: 26rpx;
  155. border-bottom: 1px solid #EEEEEE;
  156. display: flex;
  157. align-items: center;
  158. justify-content: space-between;
  159. image {
  160. width: 28rpx;
  161. height: 28rpx;
  162. }
  163. }
  164. }
  165. }
  166. .foot {
  167. display: flex;
  168. justify-content: space-between;
  169. border-top: 1px solid #eeeeee;
  170. padding-top: 16rpx;
  171. .cancel {
  172. width: 324rpx;
  173. height: 76rpx;
  174. border-radius: 54rpx;
  175. border: 1px solid #CCCCCC;
  176. font-size: 28rpx;
  177. color: #999999;
  178. display: flex;
  179. justify-content: center;
  180. align-items: center;
  181. }
  182. .sub {
  183. width: 324rpx;
  184. height: 76rpx;
  185. background: linear-gradient(90deg, #77B6FF 0%, #449AFF 100%);
  186. border-radius: 54rpx;
  187. border: 1px solid #CCCCCC;
  188. font-size: 28rpx;
  189. color: #ffffff;
  190. display: flex;
  191. justify-content: center;
  192. align-items: center;
  193. }
  194. }
  195. }
  196. }
  197. </style>