return-delivery.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <s-layout title="退货物流">
  3. <view>
  4. <form @submit="subRefund" report-submit='true'>
  5. <view class='apply-return'>
  6. <view class='list borRadius14'>
  7. <view class='item acea-row row-between-wrapper' style="display: flex;align-items: center;">
  8. <view>物流公司</view>
  9. <view v-if="state.expresses.length>0" style="flex:1">
  10. <picker mode='selector' class='num' @change="bindPickerChange" :value="state.expressIndex"
  11. :range="state.expresses" range-key="name">
  12. <view class="picker acea-row row-between-wrapper" style="display: flex;justify-content: space-between;">
  13. <view class='reason'>{{ state.expresses[state.expressIndex].name }}</view>
  14. <text class='iconfont _icon-forward' />
  15. </view>
  16. </picker>
  17. </view>
  18. </view>
  19. <view class='item textarea acea-row row-between' style="display: flex;align-items: center;">
  20. <view>物流单号</view>
  21. <input placeholder='请填写物流单号' class='num' name="logisticsNo"
  22. placeholder-class='placeholder' />
  23. </view>
  24. <button class='returnBnt bg-color ss-reset-button ui-BG-Main-Gradient sub-btn'
  25. form-type="submit"
  26. style="background: linear-gradient(90deg,var(--ui-BG-Main),var(--ui-BG-Main-gradient))!important">提交</button>
  27. </view>
  28. </view>
  29. </form>
  30. </view>
  31. </s-layout>
  32. </template>
  33. <script setup>
  34. import { onLoad } from '@dcloudio/uni-app';
  35. import { reactive } from 'vue';
  36. import sheep from '@/sheep';
  37. import AfterSaleApi from '@/sheep/api/trade/afterSale';
  38. import DeliveryApi from '@/sheep/api/trade/delivery';
  39. const state = reactive({
  40. id: 0, // 售后编号
  41. expressIndex: 0, // 选中的 expresses 下标
  42. expresses: [], // 可选的快递列表
  43. })
  44. function bindPickerChange(e) {
  45. state.expressIndex = e.detail.value;
  46. }
  47. async function subRefund(e) {
  48. let data = {
  49. id: state.id,
  50. logisticsId: state.expresses[state.expressIndex].id,
  51. logisticsNo: e.detail.value.logisticsNo,
  52. };
  53. const { code } = await AfterSaleApi.deliveryAfterSale(data);
  54. if (code !== 0) {
  55. return;
  56. }
  57. uni.showToast({
  58. title: '填写退货成功',
  59. });
  60. sheep.$router.go('/pages/order/aftersale/detail', { id: state.id });
  61. }
  62. // 获得快递物流列表
  63. async function getExpressList() {
  64. const { code, data } = await DeliveryApi.getDeliveryExpressList();
  65. if (code !== 0) {
  66. return;
  67. }
  68. state.expresses = data;
  69. }
  70. onLoad(options => {
  71. if (!options.id) {
  72. sheep.$helper.toast(`缺少订单信息,请检查`);
  73. return
  74. }
  75. state.id = options.id;
  76. // 获得快递物流列表
  77. getExpressList();
  78. })
  79. </script>
  80. <style lang="scss" scoped>
  81. .apply-return {
  82. padding: 20rpx 30rpx 70rpx 30rpx;
  83. }
  84. .apply-return .list {
  85. background-color: #fff;
  86. margin-top: 18rpx;
  87. padding: 0 24rpx 70rpx 24rpx;
  88. }
  89. .apply-return .list .item {
  90. min-height: 90rpx;
  91. border-bottom: 1rpx solid #eee;
  92. font-size: 30rpx;
  93. color: #333;
  94. }
  95. .apply-return .list .item .num {
  96. color: #282828;
  97. margin-left: 27rpx;
  98. // width: 227rpx;
  99. // text-align: right;
  100. }
  101. .apply-return .list .item .num .picker .reason {
  102. width: 385rpx;
  103. }
  104. .apply-return .list .item .num .picker .iconfont {
  105. color: #666;
  106. font-size: 30rpx;
  107. margin-top: 2rpx;
  108. }
  109. .apply-return .list .item.textarea {
  110. padding: 24rpx 0;
  111. }
  112. .apply-return .list .item textarea {
  113. height: 100rpx;
  114. font-size: 30rpx;
  115. }
  116. .apply-return .list .item .placeholder {
  117. color: #bbb;
  118. }
  119. .apply-return .list .item .title {
  120. height: 95rpx;
  121. width: 100%;
  122. }
  123. .apply-return .list .item .title .tip {
  124. font-size: 30rpx;
  125. color: #bbb;
  126. }
  127. .apply-return .list .item .upload {
  128. padding-bottom: 36rpx;
  129. }
  130. .apply-return .list .item .upload .pictrue {
  131. border-radius: 14rpx;
  132. margin: 22rpx 23rpx 0 0;
  133. width: 156rpx;
  134. height: 156rpx;
  135. position: relative;
  136. font-size: 24rpx;
  137. color: #bbb;
  138. }
  139. .apply-return .list .item .upload .pictrue:nth-of-type(4n) {
  140. margin-right: 0;
  141. }
  142. .apply-return .list .item .upload .pictrue image {
  143. width: 100%;
  144. height: 100%;
  145. border-radius: 14rpx;
  146. }
  147. .apply-return .list .item .upload .pictrue .icon-guanbi1 {
  148. position: absolute;
  149. font-size: 45rpx;
  150. top: -10rpx;
  151. right: -10rpx;
  152. }
  153. .apply-return .list .item .upload .pictrue .icon-icon25201 {
  154. color: #bfbfbf;
  155. font-size: 50rpx;
  156. }
  157. .apply-return .list .item .upload .pictrue:nth-last-child(1) {
  158. border: 1rpx solid #ddd;
  159. box-sizing: border-box;
  160. }
  161. .apply-return .returnBnt {
  162. font-size: 32rpx;
  163. color: #fff;
  164. width: 100%;
  165. height: 86rpx;
  166. border-radius: 50rpx;
  167. text-align: center;
  168. line-height: 86rpx;
  169. margin: 43rpx auto;
  170. }
  171. </style>