refund.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <view class="refund">
  3. <view class="shop-box">
  4. <view class="shop-name">
  5. {{info.shopName}}
  6. </view>
  7. <view class="address">
  8. 贵州省贵阳市花溪区天河潭旅游度假区天河潭奥特莱斯F4
  9. </view>
  10. </view>
  11. <view class="content info">
  12. <view class="order-info">
  13. <image class="icon" :src="info.goodsList[0].goodsImg" mode=""></image>
  14. <view class="shop-info">
  15. <view class="title">
  16. {{info.goodsList[0].goodsName}}
  17. </view>
  18. <view class="price">
  19. ¥{{info.goodsAmount}}
  20. </view>
  21. </view>
  22. </view>
  23. <view class="item">
  24. <view class="label">
  25. 购买数量
  26. </view>
  27. <view class="value black">
  28. 1
  29. </view>
  30. </view>
  31. <view class="notice">
  32. 最多可退1
  33. </view>
  34. <view class="item">
  35. <view class="label">
  36. 实付金额
  37. </view>
  38. <view class="value">
  39. <text class="red fs28">¥{{info.payAmount}}</text>
  40. </view>
  41. </view>
  42. <view class="notice">
  43. 1-3个工作日退还至原支付方,将以实退款际金额为准
  44. </view>
  45. <view class="item">
  46. <view class="label">
  47. 说明
  48. </view>
  49. </view>
  50. <u--form labelPosition="left" errorType="toast" :model="query" :rules="rules" ref="query">
  51. <u-form-item prop="remark" :borderBottom="false" ref="item1">
  52. <textarea class="desc" v-model="query.remark" placeholder="请输入原因,我们将尽心为您服务"></textarea>
  53. </u-form-item>
  54. </u--form>
  55. </view>
  56. <button class="save-btn" type="default" @click="submit">提交</button>
  57. </view>
  58. </template>
  59. <script>
  60. import {applyRefund} from '@/api/payment.js'
  61. export default {
  62. data() {
  63. return {
  64. info: {},
  65. query:{
  66. "remark": "",
  67. "orderNo": "",
  68. },
  69. rules:{
  70. 'remark':{
  71. required: true,
  72. message: '请输入申请原因',
  73. // blur和change事件触发检验
  74. trigger: ['blur', 'change'],
  75. },
  76. }
  77. }
  78. },
  79. methods: {
  80. submit() {
  81. this.$refs.query.validate().then(() => {
  82. applyRefund(this.query).then(res=>{
  83. if(res.state == 'Success'){
  84. uni.showToast({
  85. title:'申请成功',
  86. icon:'success'
  87. })
  88. uni.navigateBack()
  89. }
  90. })
  91. })
  92. }
  93. },
  94. onReady() {
  95. this.$refs.query.setRules(this.rules)
  96. },
  97. onLoad() {
  98. let that = this
  99. const eventChannel = this.getOpenerEventChannel();
  100. if(JSON.stringify(eventChannel) !=='{}'){
  101. eventChannel.on('orderInfo', function(data) {
  102. that.info = data
  103. that.query.orderNo = data.orderNo
  104. })
  105. }
  106. }
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. .refund {
  111. background: #F9F9F9;
  112. min-height: 100vh;
  113. padding-top: 20rpx;
  114. padding-bottom: 80rpx;
  115. .save-btn {
  116. width: 688rpx;
  117. height: 80rpx;
  118. line-height: 80rpx;
  119. text-align: center;
  120. background: $uni-color-primary;
  121. box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
  122. border-radius: 46rpx 46rpx 46rpx 46rpx;
  123. position: fixed;
  124. bottom: 60rpx;
  125. left: 50%;
  126. color: #fff;
  127. font-size: 28rpx;
  128. font-weight: bold;
  129. transform: translateX(-50%);
  130. }
  131. .shop-box {
  132. width: 690rpx;
  133. margin: 0 30rpx 20rpx;
  134. padding: 24rpx 24rpx 30rpx;
  135. background: #fff;
  136. border-radius: 16rpx;
  137. box-sizing: border-box;
  138. .shop-name {
  139. font-size: 32rpx;
  140. color: #181818;
  141. }
  142. .address {
  143. color: #999999;
  144. font-size: 24rpx;
  145. margin-top: 15rpx;
  146. }
  147. }
  148. .content {
  149. margin: 0 30rpx 20rpx;
  150. padding: 24rpx;
  151. border-radius: 16rpx;
  152. background: #fff;
  153. .item {
  154. display: flex;
  155. align-items: center;
  156. justify-content: space-between;
  157. margin-top: 28rpx;
  158. .label {
  159. color: #222222;
  160. font-size: 28rpx;
  161. }
  162. .value {
  163. color: #999999;
  164. font-size: 28rpx;
  165. }
  166. }
  167. .notice {
  168. margin-top: 16rpx;
  169. font-weight: 400;
  170. color: #AAAAAA;
  171. font-size: 24rpx;
  172. }
  173. .desc {
  174. width: 100%;
  175. height: 268rpx;
  176. border-radius: 14rpx;
  177. border: 2rpx solid #DDDDDD;
  178. font-size: 24rpx;
  179. padding: 24rpx;
  180. box-sizing: border-box;
  181. margin-top: 16rpx;
  182. }
  183. }
  184. .black {
  185. color: #222222 !important;
  186. }
  187. .red {
  188. color: red !important;
  189. }
  190. .fs28 {
  191. font-size: 28rpx !important;
  192. font-weight: bold;
  193. }
  194. .info {
  195. .order-info {
  196. display: flex;
  197. .icon {
  198. width: 164rpx;
  199. height: 164rpx;
  200. border-radius: 16rpx;
  201. }
  202. .shop-info {
  203. display: flex;
  204. flex-direction: column;
  205. justify-content: space-evenly;
  206. margin-left: 24rpx;
  207. .title {
  208. color: #181818;
  209. font-size: 28rpx;
  210. }
  211. .price {
  212. color: #181818;
  213. font-size: 32rpx;
  214. font-weight: bold;
  215. }
  216. .code-btn {
  217. width: 88rpx;
  218. height: 32rpx;
  219. line-height: 32rpx;
  220. text-align: center;
  221. font-size: 22rpx;
  222. color: #FC8945;
  223. border-radius: 0rpx 16rpx 0rpx 16rpx;
  224. border: 2rpx solid #FC8945;
  225. }
  226. }
  227. }
  228. }
  229. }
  230. </style>