refund.vue 5.4 KB

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