keeps.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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>
  52. </view>
  53. <view class="line-height"></view>
  54. </scroll-view>
  55. <view class="footer">
  56. <view class="tips">申请退款后需商家审核,审核时间预计1-3个工作日</view>
  57. <view class="footer-op">
  58. <button :loading="isSubmit" :disabled="isSubmit" class="btn full" @click="submitForm">提交申请</button>
  59. </view>
  60. <view class="footer-safe"></view>
  61. </view>
  62. </template>
  63. <refundMain ref="refundMain" @success="refundHandle"></refundMain>
  64. </view>
  65. </template>
  66. <script>
  67. var app;
  68. import refundMain from "@/components/kfService/refund";
  69. export default {
  70. components: {
  71. refundMain
  72. },
  73. data() {
  74. return {
  75. orderId:0,
  76. current: 0,
  77. goodsData:null,
  78. orderData:null,
  79. loading:true,
  80. refundMsgText:null,
  81. isSubmit:false
  82. }
  83. },
  84. onLoad({order}) {
  85. app = this;
  86. app.orderId = order;
  87. const eventChannel = this.getOpenerEventChannel();
  88. app.getOrder();
  89. },
  90. methods: {
  91. async submitForm(){
  92. var formData = {};
  93. if (!app.refundMsgText) return app.$dialog.showSuccess("请至少选择1项")
  94. formData.order = app.orderId;
  95. formData.msg = app.refundMsgText;
  96. app.isSubmit = true;
  97. var resp = await app.$api.order.keeps.post(formData);
  98. app.isSubmit = false;
  99. if (resp.code !== 1) return app.$dialog.showSuccess(resp.msg)
  100. app.$dialog.showSuccess(resp.msg)
  101. setTimeout(function(){
  102. const eventChannel = app.getOpenerEventChannel();
  103. eventChannel.emit('acceptKeepData', { msg: '会员信息已完善' });
  104. uni.navigateBack();
  105. },900)
  106. },
  107. refundMsg(){
  108. this.$refs.refundMain.open();
  109. },
  110. refundHandle(data){
  111. app.refundMsgText = data;
  112. },
  113. async getOrder(){
  114. app.loading = true;
  115. var res = await app.$api.order.detail.get({"order":app.orderId});
  116. app.loading = false;
  117. if (res.code && res.code == 0) {
  118. app.$dialog.showSuccess(res.msg);
  119. uni.navigateBack()
  120. return ;
  121. }
  122. app.goodsData = res.data.product;
  123. app.orderData = res.data;
  124. },
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. .content{
  130. position: fixed;
  131. z-index: 1;
  132. top: 0;
  133. left: 0;
  134. bottom: 0;
  135. right: 0;
  136. background-color: #f1f1f1;
  137. display: flex;
  138. flex-direction: column;
  139. .line-height{
  140. height: 40rpx;
  141. width: 100%;
  142. }
  143. }
  144. .right-input{
  145. border: 0;
  146. box-shadow: none;
  147. text-align: right;
  148. width: 100%;
  149. }
  150. .flex-radio{
  151. display: flex;
  152. align-items: center;
  153. gap: 20rpx;
  154. .uni-list-cell{
  155. display: flex;
  156. align-items: center;
  157. }
  158. }
  159. .goods-body{
  160. height: 0;
  161. flex: 1;
  162. }
  163. .footer{
  164. background-color: #fff;
  165. padding: 20upx 20upx 0 20upx;border-top: 2upx solid #f8f8f8;
  166. .footer-safe {
  167. height: env(safe-area-inset-bottom);width: 100%;
  168. }
  169. .tips{
  170. font-size: 24rpx;
  171. color: #999;
  172. margin-bottom: 20rpx;
  173. }
  174. .btn{
  175. font-size: 32rpx;
  176. height: 100upx;
  177. border-radius: 10upx;
  178. line-height: 100upx;
  179. text-align: center;
  180. min-width: 200rpx;
  181. color: #333;
  182. border: 2rpx solid #ccc;
  183. &.full{
  184. background-color: $main-color;
  185. color: #fff;
  186. border: 2rpx solid $main-color;
  187. }
  188. }
  189. }
  190. .order-body {
  191. width: 95%;
  192. margin: 20rpx auto;
  193. .order-info{
  194. border-radius: 20rpx;
  195. background-color: #fff;padding: 20upx;margin-top: 20upx;
  196. .title{font-size: 32upx;color: #333;font-weight: bold;margin-bottom: 20upx;}
  197. .info-item{
  198. font-size: 28upx;display: flex;align-items: center;
  199. padding: 30rpx 0;
  200. .name{
  201. text {
  202. color: $main-color;
  203. margin-left: 10rpx;
  204. }
  205. }
  206. .right{
  207. &.red{
  208. color: $main-color;
  209. font-size: 32rpx;
  210. }
  211. display: flex;
  212. align-items: center;
  213. color: #666;margin-left: auto;margin-right: 0;
  214. flex: 1;
  215. justify-content: right;
  216. image {
  217. width: 40rpx;
  218. height: 40rpx;
  219. }
  220. text{border: 2upx solid #ccc;color: #333;font-size: 24upx;padding: 0 15upx;margin-left: 20upx;border-radius: 5upx;}
  221. }
  222. }
  223. }
  224. .item-goods{
  225. background-color: #fff;
  226. margin-top: 20rpx;
  227. border-radius: 20rpx;
  228. padding: 20rpx;
  229. .item-goods-body{
  230. display: flex;
  231. align-items: center;
  232. gap: 20rpx;
  233. }
  234. .stock{
  235. text-align: right;
  236. }
  237. .image {
  238. height: 140rpx;
  239. overflow: hidden;display: flex;align-items: center;min-width: 140rpx;
  240. position: relative;
  241. image {
  242. width: 140rpx;
  243. border-radius: 10upx;
  244. height: 100%;
  245. }
  246. }
  247. .info{
  248. flex: 1 1 0%;
  249. overflow: hidden;
  250. .title{
  251. display: flex;
  252. align-items: center;
  253. justify-content: space-between;
  254. .name {
  255. overflow: hidden;
  256. text-overflow: ellipsis;
  257. font-size: 32rpx;
  258. display: -webkit-box;
  259. -webkit-line-clamp: 2;
  260. -webkit-box-orient: vertical;
  261. color: #333;
  262. font-weight: 900;
  263. }
  264. }
  265. .price-right{
  266. text-align: right;
  267. color: $main-color;
  268. margin-top: 20rpx;
  269. font-size: 28rpx;
  270. text {
  271. font-size: 30rpx;
  272. font-weight: 800;
  273. }
  274. }
  275. .tags {
  276. color: #94a3b8;
  277. font-size: 24rpx;
  278. margin: 10rpx 0;
  279. display: flex;
  280. align-items: center;
  281. justify-content: space-between;
  282. .price {
  283. font-size: 28rpx;
  284. color: $main-text-color;
  285. font-weight: 600;
  286. }
  287. }
  288. }
  289. }
  290. }
  291. </style>