You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.2 KiB

1 year ago
  1. <template>
  2. <view class="select-payment">
  3. <u-action-sheet :actions="payMethodList" :round="10" @select="selectPayMethod" @close="close"
  4. :title="$t('page.payOrder.pay-method-title')" :show="show"></u-action-sheet>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. payMethodList: [{
  12. id: 1,
  13. name: this.$t('page.payOrder.balance-payment')
  14. }],
  15. method: '',
  16. }
  17. },
  18. computed : {
  19. show : {
  20. get(){
  21. return this.open;
  22. },
  23. set(val){
  24. this.$emit('update:open', val)
  25. }
  26. }
  27. },
  28. props: {
  29. open : { //是否打开选择框
  30. type : Boolean,
  31. default : false
  32. }
  33. },
  34. created() {
  35. this.getPayMethodList()
  36. this.method = this.payMethodList[0].name
  37. },
  38. methods: {
  39. getPayMethodList() { //获取支付方式列表(暂无接口)
  40. },
  41. selectPayMethod(currentPayMethod) { //用户选择了支付方式
  42. this.method = currentPayMethod.name
  43. this.$emit('selectPayMethod', currentPayMethod); //把选择的值给外面组件
  44. },
  45. close() { //用户关闭选择弹框
  46. this.show = false
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .select-payment {
  53. .celi {
  54. background-color: #F8F8F8;
  55. border-radius: 10px;
  56. margin: 10px 0;
  57. }
  58. }
  59. </style>