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