RefundForm.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <seller-base :show="false">
  3. <view class="div seller-refund-form">
  4. <view class="div common-header-wrap">
  5. <view :style="'height:'+navHeight+'px'"></view>
  6. <view class="common-header-holder"></view>
  7. <view class="common-header-fixed">
  8. <title-header />
  9. <uni-nav-bar :title="'处理'+title" class="common-header" left-icon="back" @clickLeft="goBack()">
  10. </uni-nav-bar>
  11. </view>
  12. </view>
  13. <view class="div form">
  14. <flex-line :show-border="true">
  15. <text class="span">{{'同意'+title}}</text>
  16. <view class="div" slot="right">
  17. <radio-group @change="radioChange(1,$event)">
  18. <label v-for="(item, index) in seller_state_options" :key="index">
  19. <radio :value="item.value" :checked="seller_state==item.value" />
  20. <text>{{item.label}}</text>
  21. </label>
  22. </radio-group>
  23. </view>
  24. </flex-line>
  25. <flex-line v-if="refund_type==2" :show-border="true">
  26. <text class="span">弃货</text>
  27. <view class="div" slot="right">
  28. <radio-group @change="radioChange(2,$event)">
  29. <label v-for="(item, index) in return_type_options" :key="index">
  30. <radio :value="item.value" :checked="return_type==item.value" />
  31. <text>{{item.label}}</text>
  32. </label>
  33. </radio-group>
  34. </view>
  35. </flex-line>
  36. <flex-line class="field-line menu-item" :show-border="true"><text class="span field-name">备注信息</text><view class="div field-line-right" slot="right"><input class="field-input" type="textarea" v-model="seller_message" /></view></flex-line>
  37. <view class="div pt-10 pb-10"><view class="div common-btn ds-button-large" @click="submitInformation">保存</view></view>
  38. </view>
  39. </view>
  40. </seller-base>
  41. </template>
  42. <script>
  43. import {getFontSize} from '@/util/common'
  44. import TitleHeader from '../../TitleHeader'
  45. import SellerBase from '../SellerBase'
  46. import { editRefund } from '../../../api/sellerRefund'
  47. import flexLine from '../../flexLine'
  48. export default {
  49. components:{
  50. TitleHeader,
  51. SellerBase,
  52. flexLine,
  53. },
  54. name: 'SellerRefundForm',
  55. data(){
  56. return {
  57. navHeight: 0,
  58. refund_id: 0,
  59. seller_message: '',
  60. seller_state: '2',
  61. refund_type: '',
  62. title: '',
  63. return_type: '2',
  64. return_type_options: [
  65. {
  66. label: '是',
  67. value: '1'
  68. },
  69. {
  70. label: '否',
  71. value: '2'
  72. }
  73. ],
  74. seller_state_options: [
  75. {
  76. label: '是',
  77. value: '2'
  78. },
  79. {
  80. label: '否',
  81. value: '3'
  82. }
  83. ]
  84. }
  85. },
  86. mounted(){
  87. // #ifdef MP-WEIXIN
  88. this.navHeight = uni.getMenuButtonBoundingClientRect().height
  89. // #endif
  90. },
  91. computed:{
  92. fontSize(){
  93. return getFontSize()
  94. },
  95. },
  96. onLoad: function (option) {
  97. this.refund_id = option.refund_id
  98. this.refund_type = option.refund_type
  99. this.title = option.refund_type == 2 ? '退货' : '退款'
  100. },
  101. methods:{
  102. radioChange(i,e){
  103. switch(i){
  104. case 1:
  105. this.seller_state=e.detail.value
  106. break
  107. case 2:
  108. this.return_type=e.detail.value
  109. break
  110. }
  111. },
  112. goBack(){uni.navigateBack({delta:1})},
  113. submitInformation () {
  114. editRefund(this.refund_id, this.return_type, this.seller_message, this.seller_state).then(res => {
  115. uni.showToast({icon:'none',title: res.message})
  116. uni.navigateBack({delta:1})
  117. }).catch(function (error) {
  118. uni.showToast({icon:'none',title: error.message})
  119. })
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss">
  125. .seller-refund-form{
  126. .mint-radiolist {
  127. display: flex;
  128. .mint-cell {
  129. flex: 1;
  130. .mint-radio-input:checked + .mint-radio-core {
  131. background-color: $primaryColor !important;
  132. border-color: $primaryColor !important;
  133. }
  134. &:after{display: none}
  135. }
  136. }
  137. }
  138. </style>
  139. <style lang="scss" scoped>
  140. .form{background: #fff;padding:0 $pageSpace}
  141. .seller-refund-form {
  142. background: #fff;
  143. .menu-item {
  144. }
  145. }
  146. </style>