refund.vue 4.4 KB

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