refund.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. <template>
  2. <view class="refund">
  3. <view class="content ticket-info">
  4. <view class="title">
  5. {{info.goodsList[0].goodsInfo.goodsName}}
  6. </view>
  7. <view class="item">
  8. <view class="value">
  9. 出游日期
  10. </view>
  11. <view class="value">
  12. {{info.goodsList[0].goodsInfo.startTime}}
  13. </view>
  14. </view>
  15. <view class="item">
  16. <view class="value">
  17. 预订数量
  18. </view>
  19. <view class="value">
  20. {{info.goodsList[0].goodsInfo.bookNumber}}
  21. </view>
  22. </view>
  23. </view>
  24. <view class="content" >
  25. <view class="title">
  26. 交易信息
  27. </view>
  28. <view class="item">
  29. <view class="label">
  30. 金额
  31. </view>
  32. <view class="value black">
  33. ¥{{info.totalAmount}}
  34. </view>
  35. </view>
  36. <view class="item" >
  37. <view class="label">
  38. 优惠券
  39. </view>
  40. <view class="value red">
  41. -¥{{info.discountAmount}}
  42. </view>
  43. </view>
  44. <view class="item">
  45. <view class="label">
  46. 合计
  47. </view>
  48. <view class="value">
  49. <text class="red fs28">¥{{info.payAmount}}</text>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="content">
  54. <view class="item">
  55. <view class="label">
  56. 实付金额
  57. </view>
  58. <view class="value">
  59. <text class="red fs28">¥{{info.payAmount}}</text>
  60. </view>
  61. </view>
  62. <view class="notice">
  63. 1-3个工作日退还至原支付方,将以实际退款金额为准
  64. </view>
  65. </view>
  66. <view class="content">
  67. <view class="item">
  68. <view class="label">
  69. 说明
  70. </view>
  71. </view>
  72. <u--form labelPosition="left" labelWidth="150rpx" errorType="toast" :model="query" :rules="rules" ref="query">
  73. <u-form-item
  74. label="退订类型"
  75. borderBottom
  76. ref="causeType"
  77. required
  78. prop="causeType"
  79. >
  80. <view class="type-box" @click="chooseType">
  81. {{query.causeType | filterType(that)}}
  82. <image class="right-icon" src="@/static/right.png" mode=""></image>
  83. </view>
  84. </u-form-item>
  85. <u-form-item prop="causeContent" v-if="query.causeType == 5" :borderBottom="false" ref="item1">
  86. <textarea class="desc" v-model="query.causeContent" :maxlength="50" placeholder="请输入原因,我们将尽心为您服务"></textarea>
  87. </u-form-item>
  88. </u--form>
  89. </view>
  90. <u-picker :show="show" :columns="columns" closeOnClickOverlay keyName="label" @cancel="close" @close="close" @confirm="confirm"></u-picker>
  91. <button class="save-btn" type="default" :loading="loading" @click="submit">提交</button>
  92. </view>
  93. </template>
  94. <script>
  95. import {applyRefund} from '@/api/payment.js'
  96. import {tuiPiao} from '@/api/scenic.js'
  97. export default {
  98. data() {
  99. return {
  100. that:this,
  101. show:false,
  102. loading:false,
  103. info: {},
  104. query:{
  105. "causeContent": "",
  106. "orderId": "",
  107. 'causeType':0
  108. },
  109. rules:{
  110. 'causeContent':{
  111. required: true,
  112. message: '请输入申请原因',
  113. // blur和change事件触发检验
  114. trigger: ['blur', 'change'],
  115. },
  116. },
  117. columns: [
  118. [ {
  119. label: '行程变更',
  120. id: 0
  121. },
  122. {
  123. label: '价格不优惠',
  124. id: 1
  125. },
  126. {
  127. label: '门票预订错误',
  128. id: 2
  129. },
  130. {
  131. label: '未收到入园凭证',
  132. id: 3
  133. },
  134. {
  135. label: '景区闭园',
  136. id: 4
  137. },
  138. {
  139. label: '其他原因',
  140. id: 5
  141. },
  142. ]
  143. ],
  144. }
  145. },
  146. filters: {
  147. filterType: function(value,that) {
  148. let msg
  149. that.columns[0].map(item=>{
  150. if(value == item.id){
  151. msg = item.label
  152. }
  153. })
  154. return msg;
  155. },
  156. },
  157. methods: {
  158. confirm(val){
  159. this.show = false
  160. this.query.causeType = val.value[0].id
  161. if(this.query.causeType == 5){
  162. this.query.causeContent = ''
  163. }
  164. },
  165. close(){
  166. this.show = false
  167. },
  168. chooseType() {
  169. this.show = true
  170. },
  171. submit() {
  172. this.$refs.query.validate().then(() => {
  173. if(this.loading) return
  174. this.loading = true
  175. if(this.query.causeType != 5){
  176. this.query.causeContent = this.columns[0][this.query.causeType].label
  177. }
  178. console.log(this.query);
  179. tuiPiao(this.query).then(res=>{
  180. this.loading = false
  181. if(res.state == 'Success'){
  182. uni.showToast({
  183. title:'申请成功',
  184. icon:'success'
  185. })
  186. uni.navigateBack()
  187. }
  188. })
  189. })
  190. }
  191. },
  192. onReady() {
  193. this.$refs.query.setRules(this.rules)
  194. },
  195. onLoad() {
  196. let that = this
  197. const eventChannel = this.getOpenerEventChannel();
  198. if(JSON.stringify(eventChannel) !=='{}'){
  199. eventChannel.on('orderInfo', function(data) {
  200. that.info = data
  201. that.query.orderId = data.orderNo
  202. })
  203. }
  204. }
  205. }
  206. </script>
  207. <style lang="scss" scoped>
  208. .refund {
  209. background: #F9F9F9;
  210. min-height: 100vh;
  211. padding-top: 20rpx;
  212. padding-bottom: 80rpx;
  213. .type-box{
  214. display: flex;
  215. justify-content: flex-end;
  216. text-align: center;
  217. .right-icon{
  218. width: 48rpx;
  219. height: 48rpx;
  220. }
  221. }
  222. .save-btn {
  223. width: 688rpx;
  224. height: 80rpx;
  225. line-height: 80rpx;
  226. text-align: center;
  227. background: $uni-color-primary;
  228. box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
  229. border-radius: 46rpx 46rpx 46rpx 46rpx;
  230. position: fixed;
  231. bottom: 60rpx;
  232. left: 50%;
  233. color: #fff;
  234. font-size: 28rpx;
  235. font-weight: bold;
  236. transform: translateX(-50%);
  237. }
  238. .content{
  239. margin: 20rpx 30rpx;
  240. padding: 28rpx 24rpx;
  241. border-radius: 16rpx;
  242. background: #fff;
  243. .title{
  244. font-weight: 600;
  245. font-size: 28rpx;
  246. color: #222222;
  247. }
  248. .item{
  249. display: flex;
  250. align-items: center;
  251. justify-content: space-between;
  252. margin-top: 28rpx;
  253. .label {
  254. font-weight: 500;
  255. font-size: 28rpx;
  256. color: #222222;
  257. }
  258. .value {
  259. color: #999999;
  260. font-size: 28rpx;
  261. }
  262. }
  263. .desc {
  264. width: 100%;
  265. height: 268rpx;
  266. border-radius: 14rpx;
  267. border: 2rpx solid #DDDDDD;
  268. font-size: 24rpx;
  269. padding: 24rpx;
  270. box-sizing: border-box;
  271. margin-top: 16rpx;
  272. }
  273. }
  274. .ticket-info{
  275. .title{
  276. font-weight: 600;
  277. font-size: 36rpx;
  278. color: #222222;
  279. width: 100%;
  280. white-space: nowrap;
  281. overflow: hidden;
  282. text-overflow: ellipsis;
  283. margin-top: 10rpx;
  284. }
  285. .notice{
  286. display: flex;
  287. align-items: center;
  288. font-size: 24rpx;
  289. color: #AAAAAA;
  290. margin-top: 20rpx;
  291. .jiantou{
  292. width: 48rpx;
  293. height: 48rpx;
  294. }
  295. }
  296. }
  297. .notice {
  298. margin-top: 16rpx;
  299. font-weight: 400;
  300. color: #AAAAAA;
  301. font-size: 24rpx;
  302. }
  303. .black {
  304. color: #222222 !important;
  305. }
  306. .red {
  307. color: red !important;
  308. }
  309. .fs28 {
  310. font-size: 28rpx !important;
  311. font-weight: bold;
  312. }
  313. .info {
  314. .order-info {
  315. display: flex;
  316. .icon {
  317. width: 164rpx;
  318. height: 164rpx;
  319. border-radius: 16rpx;
  320. }
  321. .shop-info {
  322. display: flex;
  323. flex-direction: column;
  324. justify-content: space-evenly;
  325. margin-left: 24rpx;
  326. .title {
  327. color: #181818;
  328. font-size: 28rpx;
  329. }
  330. .goods-desc{
  331. font-size: 24rpx;
  332. color: #AAAAAA;
  333. width: 450rpx;
  334. white-space: nowrap;
  335. overflow: hidden;
  336. text-overflow: ellipsis;
  337. margin-top: 10rpx;
  338. }
  339. .price {
  340. font-weight: 600;
  341. font-size: 32rpx;
  342. color: #FF4D3A;
  343. }
  344. .code-btn {
  345. width: 88rpx;
  346. height: 32rpx;
  347. line-height: 32rpx;
  348. text-align: center;
  349. font-size: 22rpx;
  350. color: #FC8945;
  351. border-radius: 0rpx 16rpx 0rpx 16rpx;
  352. border: 2rpx solid #FC8945;
  353. }
  354. }
  355. }
  356. }
  357. }
  358. </style>