index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view class="">
  3. <view class="h-content">
  4. <u--form
  5. labelPosition="left"
  6. :model="reqParm"
  7. ref="form1">
  8. <!-- <u-form-item-->
  9. <!-- labelWidth="auto"-->
  10. <!-- labelAlign="right"-->
  11. <!-- prop="tradPassword"-->
  12. <!-- borderBottom-->
  13. <!-- >-->
  14. <!-- <u&#45;&#45;input-->
  15. <!-- v-model="reqParm.tradPassword"-->
  16. <!-- disabledColor="#ffffff"-->
  17. <!-- placeholder="请输入账号密码"-->
  18. <!-- border="bottom"-->
  19. <!-- type="password"-->
  20. <!-- maxlength="6"-->
  21. <!-- ></u&#45;&#45;input>-->
  22. <!-- </u-form-item>-->
  23. <u--textarea v-model="reqParm.refundReason" placeholder="请在此处输入退款原因" ></u--textarea>
  24. </u--form>
  25. <view @click="orderRechargeRefund" class="op-btn">
  26. <text>提交</text>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. order:{},
  36. reqParm: {
  37. auth: true,
  38. orderNo: null,
  39. tradPassword: '',
  40. refundReason: ''
  41. },
  42. // rules: {
  43. // tradPassword: {
  44. // required: true,
  45. // min: 6,
  46. // max: 6,
  47. // message: '请输入6位密码',
  48. // trigger: ['blur', 'change'],
  49. // }
  50. // },
  51. };
  52. },
  53. onLoad(option) {
  54. // 判断Openid是否为空
  55. this.order = JSON.parse(option.data)
  56. this.reqParm.orderNo = this.order.orderNo;
  57. },
  58. // onReady() {
  59. // this.$refs.form1.setRules(this.rules)
  60. // },
  61. methods: {
  62. // submitData() {
  63. // let that = this;
  64. // // 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true
  65. // this.$refs.form1.validate().then(res => {
  66. // that.orderRechargeRefund();
  67. // }).catch(errors => {
  68. // uni.$u.toast('校验失败,请认真填写')
  69. // })
  70. //
  71. // },
  72. // 退款
  73. orderRechargeRefund(){
  74. this.$api.orderRechargeRefund(this.reqParm).then((res)=>{
  75. uni.showToast({
  76. title: '已提交申请,请耐心等待'
  77. })
  78. uni.$emit('rechargeRecordDownCallback')
  79. setTimeout(()=>{
  80. uni.navigateBack({
  81. url: '/myPages/rechargeRecord/index?isRefunded = '+ true
  82. });
  83. },2000)
  84. })
  85. },
  86. }
  87. };
  88. </script>
  89. <style lang="scss" scoped>
  90. .h-content{
  91. // margin-top: 100px;
  92. background: #fff;
  93. padding-top: 20px;
  94. padding-left: 12px;
  95. padding-right: 12px;
  96. padding-bottom: 100px;
  97. .op-btn{
  98. margin: 0 auto;
  99. margin-top: 20px;
  100. text-align: center;
  101. line-height: 42px;
  102. width: 343px;
  103. height: 42px;
  104. background: #FFE05C;
  105. border-radius: 27px;
  106. }
  107. }
  108. </style>