refund.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <template>
  2. <view class="content">
  3. <template v-if="loading">
  4. <view class="skeleton">
  5. <view class="skeleton-line max animate" style="height: 200upx;"></view>
  6. <view class="skeleton-line animate"></view>
  7. <view class="skeleton-line min animate"></view>
  8. <view class="skeleton-line min animate"></view>
  9. <view class="skeleton-line max animate" style="height: 200upx;"></view>
  10. <view class="skeleton-line max animate" style="height: 200upx;"></view>
  11. </view>
  12. </template>
  13. <template v-else>
  14. <scroll-view class="goods-body" scroll-y scroll-with-animation>
  15. <view class="order-body">
  16. <view class="item-goods">
  17. <view class="item-goods-body">
  18. <view class="image">
  19. <image :src="orderData.img"></image>
  20. </view>
  21. <view class="info">
  22. <view class="title">
  23. <view class="name" v-if="goodsData.is_new == 1">{{goodsData.price}}元代{{goodsData.line_price}}元商场权益券{{ goodsData.product_name }}</view>
  24. <view class="name" v-else>{{ goodsData.product_name }}</view>
  25. <view class="num">x{{ orderData.number }}</view>
  26. </view>
  27. <view class="tags">
  28. {{orderData.sku_name?orderData.sku_name:'默认'}}
  29. <view class="price">{{ $dialog.formatMoney(orderData.price,true) }}</view>
  30. </view>
  31. <view class="price-right">实付 <text>{{ $dialog.formatMoney(orderData.pay_money,true) }}</text></view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="order-info">
  36. <view class="info-item">
  37. <view class="name">订单编号</view>
  38. <view class="right">{{ orderData.out_order_no }}</view>
  39. </view>
  40. <view class="info-item" @click="refundMsg">
  41. <view class="name">退款原因<text class="red">*</text></view>
  42. <view class="right">
  43. {{refundMsgText?refundMsgText:'请至少选择1项'}}
  44. <view class="icon"><image src="/static/image/right.svg"></image></view>
  45. </view>
  46. </view>
  47. <view class="info-item">
  48. <view class="name">退款金额</view>
  49. <view class="right red">{{ $dialog.formatMoney(orderData.pay_money,true) }}</view>
  50. </view>
  51. <view class="info-item">
  52. <view class="name">退款路径<text>*</text></view>
  53. <view class="right">
  54. <radio-group @change="radioChange">
  55. <view class="flex-radio">
  56. <label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in items" :key="item.value">
  57. <view>
  58. <radio :value="item.value" style="transform: scale(0.7);" :checked="index === current" />
  59. </view>
  60. <view>{{item.name}}</view>
  61. </label>
  62. </view>
  63. </radio-group>
  64. </view>
  65. </view>
  66. <template v-if="itemsName == 'alipay'">
  67. <view class="info-item">
  68. <view class="name">姓名<text>*</text></view>
  69. <view class="right">
  70. <input v-model="aliData.truename" placeholder="请填写真实姓名" class="right-input" />
  71. </view>
  72. </view>
  73. <view class="info-item">
  74. <view class="name">支付宝帐号<text>*</text></view>
  75. <view class="right">
  76. <input v-model="aliData.account" placeholder="请输入" class="right-input" />
  77. </view>
  78. </view>
  79. </template>
  80. <template v-if="itemsName == 'bank'">
  81. <view class="info-item">
  82. <view class="name">姓名<text>*</text></view>
  83. <view class="right">
  84. <input v-model="bankData.truename" placeholder="请填写真实姓名" class="right-input" />
  85. </view>
  86. </view>
  87. <view class="info-item">
  88. <view class="name">银行卡号<text>*</text></view>
  89. <view class="right">
  90. <input v-model="bankData.card" placeholder="请输入银行卡号" class="right-input" />
  91. </view>
  92. </view>
  93. <view class="info-item">
  94. <view class="name">开户行<text>*</text></view>
  95. <view class="right">
  96. <input v-model="bankData.name" placeholder="请输入开户行全称" class="right-input" />
  97. </view>
  98. </view>
  99. </template>
  100. </view>
  101. </view>
  102. <view class="line-height"></view>
  103. </scroll-view>
  104. <view class="footer">
  105. <view class="tips">申请退款后需商家审核,审核时间预计1-3个工作日</view>
  106. <view class="footer-op">
  107. <button :loading="isSubmit" :disabled="isSubmit" class="btn full" @click="submitForm">提交申请</button>
  108. </view>
  109. <view class="footer-safe"></view>
  110. </view>
  111. </template>
  112. <refundMain ref="refundMain" @success="refundHandle"></refundMain>
  113. </view>
  114. </template>
  115. <script>
  116. var app;
  117. import refundMain from "@/components/kfService/refund";
  118. export default {
  119. components: {
  120. refundMain
  121. },
  122. data() {
  123. return {
  124. orderId:0,
  125. current: 0,
  126. goodsData:null,
  127. orderData:null,
  128. loading:true,
  129. refundMsgText:null,
  130. isSubmit:false,
  131. items:[
  132. {
  133. value: 'alipay',
  134. name: '支付宝',
  135. checked: 'true'
  136. },
  137. {
  138. value: 'bank',
  139. name: '银行卡'
  140. }
  141. ],
  142. bankData:{},
  143. aliData:{},
  144. itemsName:"alipay"
  145. }
  146. },
  147. onLoad({order}) {
  148. app = this;
  149. app.orderId = order;
  150. app.getOrder();
  151. },
  152. methods: {
  153. async submitForm(){
  154. var formData = {};
  155. if (!app.refundMsgText) return app.$dialog.showSuccess("请至少选择1项")
  156. formData.order = app.orderId;
  157. formData.msg = app.refundMsgText;
  158. formData.type = app.itemsName;
  159. if (app.itemsName == "alipay") {
  160. formData.content = JSON.stringify(app.aliData);
  161. } else {
  162. formData.content = JSON.stringify(app.bankData);
  163. }
  164. var resp = await app.$api.order.refund.post(formData);
  165. if (resp.code !== 1) return app.$dialog.showSuccess(resp.msg)
  166. app.$dialog.showSuccess(resp.msg)
  167. app.eventChannel.emit('acceptData', { msg: '会员信息已完善' });
  168. uni.navigateBack();
  169. },
  170. refundMsg(){
  171. this.$refs.refundMain.open();
  172. },
  173. radioChange: function(evt) {
  174. app.itemsName = evt.detail.value;
  175. for (let i = 0; i < this.items.length; i++) {
  176. if (this.items[i].value === evt.detail.value) {
  177. this.current = i;
  178. break;
  179. }
  180. }
  181. },
  182. refundHandle(data){
  183. app.refundMsgText = data;
  184. },
  185. async getOrder(){
  186. app.loading = true;
  187. var res = await app.$api.order.detail.get({"order":app.orderId});
  188. app.loading = false;
  189. if (res.code && res.code == 0) {
  190. app.$dialog.showSuccess(res.msg);
  191. uni.navigateBack()
  192. return ;
  193. }
  194. app.goodsData = res.data.product;
  195. app.orderData = res.data;
  196. },
  197. }
  198. }
  199. </script>
  200. <style lang="scss" scoped>
  201. .content{
  202. position: fixed;
  203. z-index: 1;
  204. top: 0;
  205. left: 0;
  206. bottom: 0;
  207. right: 0;
  208. background-color: #f1f1f1;
  209. display: flex;
  210. flex-direction: column;
  211. .line-height{
  212. height: 40rpx;
  213. width: 100%;
  214. }
  215. }
  216. .right-input{
  217. border: 0;
  218. box-shadow: none;
  219. text-align: right;
  220. width: 100%;
  221. }
  222. .flex-radio{
  223. display: flex;
  224. align-items: center;
  225. gap: 20rpx;
  226. .uni-list-cell{
  227. display: flex;
  228. align-items: center;
  229. }
  230. }
  231. .goods-body{
  232. height: 0;
  233. flex: 1;
  234. }
  235. .footer{
  236. background-color: #fff;
  237. padding: 20upx 20upx 0 20upx;border-top: 2upx solid #f8f8f8;
  238. .footer-safe {
  239. height: env(safe-area-inset-bottom);width: 100%;
  240. }
  241. .tips{
  242. font-size: 24rpx;
  243. color: #999;
  244. margin-bottom: 20rpx;
  245. }
  246. .btn{
  247. font-size: 32rpx;
  248. height: 100upx;
  249. border-radius: 10upx;
  250. line-height: 100upx;
  251. text-align: center;
  252. min-width: 200rpx;
  253. color: #333;
  254. border: 2rpx solid #ccc;
  255. &.full{
  256. background-color: $main-color;
  257. color: #fff;
  258. border: 2rpx solid $main-color;
  259. }
  260. }
  261. }
  262. .order-body {
  263. width: 95%;
  264. margin: 20rpx auto;
  265. .order-info{
  266. border-radius: 20rpx;
  267. background-color: #fff;padding: 20upx;margin-top: 20upx;
  268. .title{font-size: 32upx;color: #333;font-weight: bold;margin-bottom: 20upx;}
  269. .info-item{
  270. font-size: 28upx;display: flex;align-items: center;
  271. padding: 30rpx 0;
  272. .name{
  273. text {
  274. color: $main-color;
  275. margin-left: 10rpx;
  276. }
  277. }
  278. .right{
  279. &.red{
  280. color: $main-color;
  281. font-size: 32rpx;
  282. }
  283. display: flex;
  284. align-items: center;
  285. color: #666;margin-left: auto;margin-right: 0;
  286. flex: 1;
  287. justify-content: right;
  288. image {
  289. width: 40rpx;
  290. height: 40rpx;
  291. }
  292. text{border: 2upx solid #ccc;color: #333;font-size: 24upx;padding: 0 15upx;margin-left: 20upx;border-radius: 5upx;}
  293. }
  294. }
  295. }
  296. .item-goods{
  297. background-color: #fff;
  298. margin-top: 20rpx;
  299. border-radius: 20rpx;
  300. padding: 20rpx;
  301. .item-goods-body{
  302. display: flex;
  303. align-items: center;
  304. gap: 20rpx;
  305. }
  306. .stock{
  307. text-align: right;
  308. }
  309. .image {
  310. height: 140rpx;
  311. overflow: hidden;display: flex;align-items: center;min-width: 140rpx;
  312. position: relative;
  313. image {
  314. width: 140rpx;
  315. border-radius: 10upx;
  316. height: 100%;
  317. }
  318. }
  319. .info{
  320. flex: 1 1 0%;
  321. overflow: hidden;
  322. .title{
  323. display: flex;
  324. align-items: center;
  325. justify-content: space-between;
  326. .name {
  327. overflow: hidden;
  328. text-overflow: ellipsis;
  329. font-size: 32rpx;
  330. display: -webkit-box;
  331. -webkit-line-clamp: 2;
  332. -webkit-box-orient: vertical;
  333. color: #333;
  334. font-weight: 900;
  335. }
  336. }
  337. .price-right{
  338. text-align: right;
  339. color: $main-color;
  340. margin-top: 20rpx;
  341. font-size: 28rpx;
  342. text {
  343. font-size: 30rpx;
  344. font-weight: 800;
  345. }
  346. }
  347. .tags {
  348. color: #94a3b8;
  349. font-size: 24rpx;
  350. margin: 10rpx 0;
  351. display: flex;
  352. align-items: center;
  353. justify-content: space-between;
  354. .price {
  355. font-size: 28rpx;
  356. color: $main-text-color;
  357. font-weight: 600;
  358. }
  359. }
  360. }
  361. }
  362. }
  363. </style>