refund.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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.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" @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. that.info = data
  114. that.query.id = data.goodsList[0].id
  115. })
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped>
  121. .refund {
  122. background: #F9F9F9;
  123. min-height: 100vh;
  124. padding-top: 20rpx;
  125. padding-bottom: 80rpx;
  126. .save-btn {
  127. width: 688rpx;
  128. height: 80rpx;
  129. line-height: 80rpx;
  130. text-align: center;
  131. background: $uni-color-primary;
  132. box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
  133. border-radius: 46rpx 46rpx 46rpx 46rpx;
  134. position: fixed;
  135. bottom: 60rpx;
  136. left: 50%;
  137. color: #fff;
  138. font-size: 28rpx;
  139. font-weight: bold;
  140. transform: translateX(-50%);
  141. }
  142. .shop-box {
  143. width: 690rpx;
  144. margin: 0 30rpx 20rpx;
  145. padding: 24rpx 24rpx 30rpx;
  146. background: #fff;
  147. border-radius: 16rpx;
  148. box-sizing: border-box;
  149. .shop-name{
  150. font-weight: 600;
  151. font-size: 32rpx;
  152. color: #181818;
  153. width: 100%;
  154. white-space: nowrap;
  155. overflow: hidden;
  156. text-overflow: ellipsis;
  157. }
  158. .address{
  159. font-weight: 300;
  160. font-size: 24rpx;
  161. color: #AAAAAA;
  162. margin-top: 20rpx;
  163. width: 100%;
  164. white-space: nowrap;
  165. overflow: hidden;
  166. text-overflow: ellipsis;
  167. }
  168. }
  169. .content {
  170. margin: 0 30rpx 20rpx;
  171. padding: 24rpx;
  172. border-radius: 16rpx;
  173. background: #fff;
  174. .item {
  175. display: flex;
  176. align-items: center;
  177. justify-content: space-between;
  178. // margin-top: 28rpx;
  179. .label {
  180. font-weight: 500;
  181. font-size: 28rpx;
  182. color: #222222;
  183. }
  184. .value {
  185. color: #999999;
  186. font-size: 28rpx;
  187. }
  188. }
  189. .notice {
  190. margin-top: 16rpx;
  191. font-weight: 400;
  192. color: #AAAAAA;
  193. font-size: 24rpx;
  194. }
  195. .desc {
  196. width: 100%;
  197. height: 268rpx;
  198. border-radius: 14rpx;
  199. border: 2rpx solid #DDDDDD;
  200. font-size: 24rpx;
  201. padding: 24rpx;
  202. box-sizing: border-box;
  203. margin-top: 16rpx;
  204. }
  205. }
  206. .black {
  207. color: #222222 !important;
  208. }
  209. .red {
  210. color: red !important;
  211. }
  212. .fs28 {
  213. font-size: 28rpx !important;
  214. font-weight: bold;
  215. }
  216. .info {
  217. .order-info {
  218. display: flex;
  219. .icon {
  220. width: 164rpx;
  221. height: 164rpx;
  222. border-radius: 16rpx;
  223. }
  224. .shop-info {
  225. display: flex;
  226. flex-direction: column;
  227. justify-content: space-evenly;
  228. margin-left: 24rpx;
  229. .title {
  230. color: #181818;
  231. font-size: 28rpx;
  232. }
  233. .goods-desc{
  234. font-size: 24rpx;
  235. color: #AAAAAA;
  236. width: 450rpx;
  237. white-space: nowrap;
  238. overflow: hidden;
  239. text-overflow: ellipsis;
  240. margin-top: 10rpx;
  241. }
  242. .price {
  243. font-weight: 600;
  244. font-size: 32rpx;
  245. color: #FF4D3A;
  246. }
  247. .code-btn {
  248. width: 88rpx;
  249. height: 32rpx;
  250. line-height: 32rpx;
  251. text-align: center;
  252. font-size: 22rpx;
  253. color: #FC8945;
  254. border-radius: 0rpx 16rpx 0rpx 16rpx;
  255. border: 2rpx solid #FC8945;
  256. }
  257. }
  258. }
  259. }
  260. }
  261. </style>