VrRefundForm.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <member-base :show="false"><view class="div member-information">
  3. <view class="div common-header-wrap">
  4. <view :style="'height:'+navHeight+'px'"></view>
  5. <view class="common-header-holder"></view>
  6. <view class="common-header-fixed">
  7. <title-header />
  8. <uni-nav-bar title="新增退款" class="common-header" left-icon="back" @clickLeft="goBack()">
  9. </uni-nav-bar>
  10. </view>
  11. </view>
  12. <view class="div form">
  13. <view class="div field-line-right" ><textarea class="order-message field-input" v-model="buyer_message" placeholder="退款说明:" ></textarea></view>
  14. <view class="div" @click="showPopup('codeVisible')">
  15. <flex-line :is-link="true" :show-border="true"><text class="span line-name">可退款兑换码</text></flex-line>
  16. </view>
  17. <view class="div pt-10 pb-10"><view class="div common-btn ds-button-large" @click="submitInformation">保存</view></view>
  18. </view>
  19. <uni-popup background-color="#fff" ref="codeVisible" type="right" >
  20. <view :style="'width:'+screenWidth+'px'" class="common-popup-wrapper">
  21. <view class="div common-header-wrap">
  22. <view :style="'height:'+navHeight+'px'"></view>
  23. <view class="common-header-holder"></view>
  24. <view class="common-header-fixed">
  25. <title-header />
  26. <uni-nav-bar title="可退款兑换码" class="common-header" left-icon="back" @clickLeft="hidePopup('codeVisible')">
  27. </uni-nav-bar>
  28. </view>
  29. </view>
  30. <view class="div common-popup-content">
  31. <scroll-view style="position: absolute;top:0;right:0;left:0;bottom:0" scroll-y="true">
  32. <checkbox-group @change="checkboxChange">
  33. <label v-for="(item,index) in code_options" :key="index">
  34. <checkbox :value="item.value" :checked="code==item.value" />{{item.label}}
  35. </label>
  36. </checkbox-group>
  37. </scroll-view>
  38. </view>
  39. </view>
  40. </uni-popup>
  41. </view></member-base>
  42. </template>
  43. <script>
  44. import {getFontSize} from '@/util/common'
  45. import TitleHeader from '../../TitleHeader'
  46. import MemberBase from '../MemberBase'
  47. import { getCommonData, addVrRefund } from '../../../api/memberVrRefund'
  48. import flexLine from '../../flexLine'
  49. export default {
  50. components:{
  51. TitleHeader,
  52. MemberBase,
  53. flexLine,
  54. },
  55. name:'MemberVrRefundForm',
  56. data(){
  57. return {
  58. navHeight: 0,
  59. screenWidth:0,
  60. code: [],
  61. code_options: [],
  62. order_id: 0,
  63. buyer_message: '',
  64. }
  65. },
  66. mounted(){
  67. // #ifdef MP-WEIXIN
  68. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  69. // #endif
  70. this.screenWidth=uni.getSystemInfoSync().screenWidth
  71. },
  72. computed:{
  73. fontSize(){
  74. return getFontSize()
  75. },
  76. },
  77. onLoad: function (option) {
  78. this.order_id=option.order_id
  79. getCommonData(this.order_id).then(res => {
  80. let code_list = res.result.code_list
  81. for (var i in code_list) {
  82. this.code_options.push({
  83. label: code_list[i].vr_code,
  84. value: code_list[i].rec_id+''
  85. })
  86. }
  87. }).catch(function (error) {
  88. uni.showToast({icon:'none',title: error.message})
  89. })
  90. },
  91. methods:{
  92. checkboxChange(e){
  93. this.code = e.detail.value;
  94. },
  95. showPopup(id){
  96. this.$refs[id].open()
  97. },
  98. hidePopup(id){
  99. this.$refs[id].close()
  100. },
  101. goBack(){uni.navigateBack({delta:1})},
  102. submitInformation () {
  103. addVrRefund(this.order_id, this.code, this.buyer_message).then(res => {
  104. uni.showToast({icon:'none',title: res.message})
  105. uni.navigateTo({url:'/pages/member/vrrefund/VrRefundList'})
  106. }).catch(function (error) {
  107. uni.showToast({icon:'none',title: error.message})
  108. })
  109. }
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. .member-information {
  115. background: #fff;
  116. .form{background: #fff;padding:0 $pageSpace}
  117. .order-message{background: #fbfbfb;
  118. margin: .5rem 0;
  119. font-size: .7rem;
  120. padding: .5rem;
  121. height: 4rem;
  122. border: 0;
  123. box-sizing: border-box;
  124. width: 100%;
  125. }
  126. }
  127. </style>