refund.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <view class="refund">
  3. <!-- <view @click="toMap()" class="shop-box">
  4. <view class="shop-name">
  5. 印象贵大文创店
  6. </view>
  7. <view class="address">
  8. 贵州大学西校区西一区体育场楼下
  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. <!-- 电影订单 -->
  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.activityDetail}}
  27. </view> -->
  28. <view class="price">
  29. ¥{{info.goodsList[0].goodsInfo.price}}
  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" @click="submit">提交</button>
  60. </view>
  61. </template>
  62. <script>
  63. import {applyRefund} from '@/api/payment.js'
  64. export default {
  65. data() {
  66. return {
  67. info: {},
  68. query:{
  69. "remark": "",
  70. "id": "",
  71. },
  72. rules:{
  73. 'remark':{
  74. required: true,
  75. message: '请输入申请原因',
  76. // blur和change事件触发检验
  77. trigger: ['blur', 'change'],
  78. },
  79. }
  80. }
  81. },
  82. methods: {
  83. toMap() {
  84. uni.openLocation({
  85. latitude: 26.4401,
  86. longitude: 106.664,
  87. name: "印象贵大文创店",
  88. address: "贵州大学西校区西一区体育场楼下",
  89. });
  90. },
  91. submit() {
  92. this.$refs.query.validate().then(() => {
  93. applyRefund(this.query).then(res=>{
  94. if(res.state == 'Success'){
  95. uni.showToast({
  96. title:'申请成功',
  97. icon:'success'
  98. })
  99. uni.navigateBack()
  100. }
  101. })
  102. })
  103. }
  104. },
  105. onReady() {
  106. this.$refs.query.setRules(this.rules)
  107. },
  108. onLoad() {
  109. let that = this
  110. const eventChannel = this.getOpenerEventChannel();
  111. if(JSON.stringify(eventChannel) !=='{}'){
  112. eventChannel.on('orderInfo', function(data) {
  113. console.log(data)
  114. that.info = data
  115. that.query.id = data.goodsList[0].id
  116. })
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. .refund {
  123. background: #F9F9F9;
  124. min-height: 100vh;
  125. padding-top: 20rpx;
  126. padding-bottom: 80rpx;
  127. .save-btn {
  128. width: 688rpx;
  129. height: 80rpx;
  130. line-height: 80rpx;
  131. text-align: center;
  132. background: $uni-color-primary;
  133. box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
  134. border-radius: 46rpx 46rpx 46rpx 46rpx;
  135. position: fixed;
  136. bottom: 60rpx;
  137. left: 50%;
  138. color: #fff;
  139. font-size: 28rpx;
  140. font-weight: bold;
  141. transform: translateX(-50%);
  142. }
  143. .shop-box {
  144. width: 690rpx;
  145. margin: 0 30rpx 20rpx;
  146. padding: 24rpx 24rpx 30rpx;
  147. background: #fff;
  148. border-radius: 16rpx;
  149. box-sizing: border-box;
  150. .shop-name{
  151. font-weight: 600;
  152. font-size: 32rpx;
  153. color: #181818;
  154. width: 100%;
  155. white-space: nowrap;
  156. overflow: hidden;
  157. text-overflow: ellipsis;
  158. }
  159. .address{
  160. font-weight: 300;
  161. font-size: 24rpx;
  162. color: #AAAAAA;
  163. margin-top: 20rpx;
  164. width: 100%;
  165. white-space: nowrap;
  166. overflow: hidden;
  167. text-overflow: ellipsis;
  168. }
  169. }
  170. .content {
  171. margin: 0 30rpx 20rpx;
  172. padding: 24rpx;
  173. border-radius: 16rpx;
  174. background: #fff;
  175. .item {
  176. display: flex;
  177. align-items: center;
  178. justify-content: space-between;
  179. // margin-top: 28rpx;
  180. .label {
  181. font-weight: 500;
  182. font-size: 28rpx;
  183. color: #222222;
  184. }
  185. .value {
  186. color: #999999;
  187. font-size: 28rpx;
  188. }
  189. }
  190. .notice {
  191. margin-top: 16rpx;
  192. font-weight: 400;
  193. color: #AAAAAA;
  194. font-size: 24rpx;
  195. }
  196. .desc {
  197. width: 100%;
  198. height: 268rpx;
  199. border-radius: 14rpx;
  200. border: 2rpx solid #DDDDDD;
  201. font-size: 24rpx;
  202. padding: 24rpx;
  203. box-sizing: border-box;
  204. margin-top: 16rpx;
  205. }
  206. }
  207. .black {
  208. color: #222222 !important;
  209. }
  210. .red {
  211. color: red !important;
  212. }
  213. .fs28 {
  214. font-size: 28rpx !important;
  215. font-weight: bold;
  216. }
  217. .info {
  218. .order-info {
  219. display: flex;
  220. .icon {
  221. width: 164rpx;
  222. height: 164rpx;
  223. border-radius: 16rpx;
  224. }
  225. .shop-info {
  226. display: flex;
  227. flex-direction: column;
  228. justify-content: space-evenly;
  229. margin-left: 24rpx;
  230. .title {
  231. color: #181818;
  232. font-size: 28rpx;
  233. }
  234. .goods-desc{
  235. font-size: 24rpx;
  236. color: #AAAAAA;
  237. width: 450rpx;
  238. white-space: nowrap;
  239. overflow: hidden;
  240. text-overflow: ellipsis;
  241. margin-top: 10rpx;
  242. }
  243. .price {
  244. font-weight: 600;
  245. font-size: 32rpx;
  246. color: #FF4D3A;
  247. }
  248. .code-btn {
  249. width: 88rpx;
  250. height: 32rpx;
  251. line-height: 32rpx;
  252. text-align: center;
  253. font-size: 22rpx;
  254. color: #FC8945;
  255. border-radius: 0rpx 16rpx 0rpx 16rpx;
  256. border: 2rpx solid #FC8945;
  257. }
  258. }
  259. }
  260. }
  261. }
  262. </style>