refund.vue 5.6 KB

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