back-goods.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view class="slot">
  3. <view class="form">
  4. <u-form :model="form" ref="form" label-width="140rpx">
  5. <u-form-item label="换货原因"><u-input v-model="form.reason" type="select" placeholder="请选择" @click="openReasonPopup" /></u-form-item>
  6. <u-form-item label="换货说明"><u-input v-model="form.desc" placeholder="选填" /></u-form-item>
  7. </u-form>
  8. </view>
  9. <view class="btn">
  10. <u-button type="primary" shape="circle" @click="submit"><text>提交</text></u-button>
  11. </view>
  12. <!-- 原因选择框 -->
  13. <SelectReason ref="SelectReason" :ops="reasonOps" title="换货原因" @change="changeReason"></SelectReason>
  14. </view>
  15. </template>
  16. <script>
  17. import SelectReason from '@/components/select-reason.vue';
  18. export default {
  19. name: 'back-money',
  20. components: {
  21. SelectReason
  22. },
  23. data() {
  24. return {
  25. // 表单
  26. form: {
  27. reason: '',
  28. desc: '',
  29. money: '¥180.00'
  30. },
  31. // 原因
  32. currentReasonIndex: null,
  33. reasonOps: [
  34. { label: '尺码拍错/不喜欢/效果不好', value: '0' },
  35. { label: '材质、面料与商品描述不符', value: '1' },
  36. { label: '大小尺寸与商品描述不符', value: '2' },
  37. { label: '剪裁/做工瑕疵', value: '3' },
  38. { label: '颜色款式图案与描述不符', value: '4' },
  39. { label: '其他', value: '5' }
  40. ]
  41. };
  42. },
  43. methods: {
  44. // 打开原因选择框
  45. openReasonPopup() {
  46. this.$refs.SelectReason.open(this.currentReasonIndex);
  47. },
  48. // 选择原因回调
  49. changeReason(e) {
  50. this.currentReasonIndex = e;
  51. this.form.reason = this.reasonOps[e].label;
  52. },
  53. // 提交
  54. submit() {}
  55. }
  56. };
  57. </script>
  58. <style lang="scss" scoped>
  59. .form {
  60. background-color: $app-theme-bg-color;
  61. border-radius: 16rpx;
  62. box-shadow: $app-theme-shadow;
  63. padding: 0 30rpx;
  64. }
  65. .btn {
  66. padding: 60rpx 0rpx;
  67. }
  68. </style>