refund.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view>
  3. <!--标题栏-->
  4. <bar-title bgColor="bg-white" isBack title="申请退款">
  5. <block slot="content">申请退款</block>
  6. </bar-title>
  7. <view class="cu-form-group margin-top">
  8. <view class="title">申请类型</view>
  9. <picker @change="typePickerChange" :value="typeIndex" :range="type" range-key="name">
  10. <view class="picker">
  11. {{type[typeIndex] && type[typeIndex].name}}
  12. </view>
  13. </picker>
  14. </view>
  15. <view class="cu-form-group">
  16. <view class="title">申请原因</view>
  17. <picker @change="descPickerChange" :value="descIndex" :range="desc_type" range-key="name">
  18. <view class="picker">
  19. {{desc_type[descIndex] && desc_type[descIndex].name}}
  20. </view>
  21. </picker>
  22. </view>
  23. <!-- <view class="cu-form-group">
  24. <view class="title">退货数量</view>
  25. <input placeholder="请输入新昵称" v-model="name"></input>
  26. </view> -->
  27. <view class="cu-form-group">
  28. <view class="title">申请金额</view>
  29. ¥<input placeholder="请输入退款金额" v-model="cash"></input>
  30. </view>
  31. <view class="cu-form-group">
  32. <view class="title">申请说明</view>
  33. </view>
  34. <view class="cu-form-group" style="position: relative;">
  35. <textarea v-model="desc" placeholder="优秀的用户会这么写。例如:我是XX熊,最爱收集各种闲置物品,交朋友。在架的宝贝都可以交易,快来联系我吧!"/>
  36. <text class="text-gray font-num-view">0 / 300</text>
  37. </view>
  38. <view class="bg-white zaiui-footer-fixed zaiui-foot-padding-bottom" style="padding: 20upx;">
  39. <view class="flex flex-direction">
  40. <button class="cu-btn bg-red" @click="submit">提交</button>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import barTitle from '@/components/zaiui-common/basics/bar-title';
  47. import _tool from '@/static/zaiui/util/tools.js'; //工具函数
  48. export default {
  49. components: {
  50. barTitle
  51. },
  52. data() {
  53. return {
  54. id: '',
  55. info: {},
  56. desc_type: [],
  57. type: [],
  58. typeIndex: 0,
  59. descIndex: 0,
  60. name: '',
  61. cash: '',
  62. desc: ''
  63. }
  64. },
  65. onLoad(options) {
  66. this.id = options.id;
  67. this.loadInfo()
  68. },
  69. onReady() {
  70. _tool.setBarColor(true);
  71. uni.pageScrollTo({
  72. scrollTop: 0,
  73. duration: 0
  74. });
  75. },
  76. methods: {
  77. typePickerChange(e) {
  78. this.typeIndex = e.detail.value
  79. },
  80. descPickerChange(e) {
  81. this.descIndex = e.detail.value
  82. },
  83. loadInfo() {
  84. this.reqByuser({
  85. url: '?l=resource.applyRefund',
  86. data: {
  87. type: 3,
  88. id: this.id
  89. },
  90. success: res => {
  91. if(res.data.status == 1) {
  92. this.info = res.data.data.detail;
  93. this.type = res.data.data.type;
  94. this.desc_type = res.data.data.desc_type;
  95. this.cash = res.data.data.cash;
  96. }else {
  97. uni.showToast({
  98. icon: 'error',
  99. title: res.data.msg
  100. })
  101. }
  102. }
  103. })
  104. },
  105. submit() {
  106. uni.showModal({
  107. title: '提示',
  108. content: '确定要退款吗?',
  109. success: res => {
  110. if (res.confirm) {
  111. this.reqByuser({
  112. url: '?l=resource.applyRefundAct',
  113. data: {
  114. type: 3,
  115. id: this.id,
  116. cash: this.cash,
  117. apply_type: this.type[this.typeIndex].id,
  118. desc_type: this.desc_type[this.descIndex].id,
  119. desc: this.desc
  120. },
  121. success: res => {
  122. if(res.data.status == 1) {
  123. console.log(res.data.data)
  124. }else {
  125. uni.showToast({
  126. icon: 'error',
  127. title: res.data.msg
  128. })
  129. }
  130. }
  131. })
  132. }
  133. }
  134. })
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss">
  140. /* #ifdef APP-PLUS */
  141. @import "../../static/colorui/main.css";
  142. @import "../../static/colorui/icon.css";
  143. @import "../../static/zaiui/style/app.scss";
  144. /* #endif */
  145. .cu-form-group {
  146. textarea {
  147. height: 8.6em;
  148. }
  149. .font-num-view {
  150. position: absolute;
  151. bottom: 9.09upx;
  152. right: 27.27upx;
  153. }
  154. }
  155. </style>