eturn-delivery.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <s-layout>
  3. <!-- title='退货物流' -->
  4. <!-- 不知为何加上页面就错误 -->
  5. <view>
  6. <form @submit="subRefund" report-submit='true'>
  7. <view class='apply-return'>
  8. <view class='list borRadius14'>
  9. <view class='item acea-row row-between-wrapper' style="display: flex;align-items: center;">
  10. <view>物流公司</view>
  11. <picker mode='selector' class='num' @change="bindPickerChange" :value="state.expressIndex"
  12. :range="state.expresses" range-key="name">
  13. <view class="picker acea-row row-between-wrapper">
  14. <view class='reason'>{{ state.expresses[state.expressIndex].name }}</view>
  15. <text class='iconfont icon-jiantou'></text>
  16. </view>
  17. </picker>
  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 sheep from '@/sheep';
  35. import {
  36. onLoad,
  37. onReachBottom,
  38. onPullDownRefresh
  39. } from '@dcloudio/uni-app';
  40. import {
  41. computed,
  42. watch,
  43. ref,
  44. reactive,
  45. unref
  46. } from 'vue';
  47. const state = reactive({
  48. expressIndex: 0,
  49. expresses: [{
  50. "id": 1,
  51. "name": "申通快递"
  52. },
  53. {
  54. "id": 2,
  55. "name": "顺丰速运"
  56. },
  57. {
  58. "id": 3,
  59. "name": "中通快递"
  60. },
  61. {
  62. "id": 4,
  63. "name": "韵达快递"
  64. }
  65. ], //模拟物流公司数组
  66. })
  67. function bindPickerChange(e) {
  68. state.expressIndex = e.detail.value;
  69. }
  70. function subRefund(e) {
  71. const formData = e.detail.value;
  72. console.log(formData, '表单数据');
  73. console.log(state.expresses[state.expressIndex].id, '物流公司id');
  74. return;
  75. // 下面是参考逻辑
  76. AfterSaleApi.deliveryAfterSale({
  77. id: this.id,
  78. logisticsId: this.expresses[this.expressIndex].id,
  79. logisticsNo: formData.logisticsNo,
  80. }).then(res => {
  81. this.$util.Tips({
  82. title: '填写退货成功',
  83. icon: 'success'
  84. }, {
  85. tab: 5,
  86. url: '/pages/users/user_return_detail/index?id=' + this.id
  87. });
  88. }).catch(err => {
  89. return this.$util.Tips({
  90. title: err
  91. });
  92. })
  93. }
  94. function getList() {
  95. }
  96. onLoad(() => {
  97. // 拿退货编号
  98. })
  99. </script>
  100. <style lang="scss" scoped>
  101. .apply-return {
  102. padding: 20rpx 30rpx 70rpx 30rpx;
  103. }
  104. .apply-return .list {
  105. background-color: #fff;
  106. margin-top: 18rpx;
  107. padding: 0 24rpx 70rpx 24rpx;
  108. }
  109. .apply-return .list .item {
  110. min-height: 90rpx;
  111. border-bottom: 1rpx solid #eee;
  112. font-size: 30rpx;
  113. color: #333;
  114. }
  115. .apply-return .list .item .num {
  116. color: #282828;
  117. margin-left: 27rpx;
  118. // width: 227rpx;
  119. // text-align: right;
  120. }
  121. .apply-return .list .item .num .picker .reason {
  122. width: 385rpx;
  123. }
  124. .apply-return .list .item .num .picker .iconfont {
  125. color: #666;
  126. font-size: 30rpx;
  127. margin-top: 2rpx;
  128. }
  129. .apply-return .list .item.textarea {
  130. padding: 24rpx 0;
  131. }
  132. .apply-return .list .item textarea {
  133. height: 100rpx;
  134. font-size: 30rpx;
  135. }
  136. .apply-return .list .item .placeholder {
  137. color: #bbb;
  138. }
  139. .apply-return .list .item .title {
  140. height: 95rpx;
  141. width: 100%;
  142. }
  143. .apply-return .list .item .title .tip {
  144. font-size: 30rpx;
  145. color: #bbb;
  146. }
  147. .apply-return .list .item .upload {
  148. padding-bottom: 36rpx;
  149. }
  150. .apply-return .list .item .upload .pictrue {
  151. border-radius: 14rpx;
  152. margin: 22rpx 23rpx 0 0;
  153. width: 156rpx;
  154. height: 156rpx;
  155. position: relative;
  156. font-size: 24rpx;
  157. color: #bbb;
  158. }
  159. .apply-return .list .item .upload .pictrue:nth-of-type(4n) {
  160. margin-right: 0;
  161. }
  162. .apply-return .list .item .upload .pictrue image {
  163. width: 100%;
  164. height: 100%;
  165. border-radius: 14rpx;
  166. }
  167. .apply-return .list .item .upload .pictrue .icon-guanbi1 {
  168. position: absolute;
  169. font-size: 45rpx;
  170. top: -10rpx;
  171. right: -10rpx;
  172. }
  173. .apply-return .list .item .upload .pictrue .icon-icon25201 {
  174. color: #bfbfbf;
  175. font-size: 50rpx;
  176. }
  177. .apply-return .list .item .upload .pictrue:nth-last-child(1) {
  178. border: 1rpx solid #ddd;
  179. box-sizing: border-box;
  180. }
  181. .apply-return .returnBnt {
  182. font-size: 32rpx;
  183. color: #fff;
  184. width: 100%;
  185. height: 86rpx;
  186. border-radius: 50rpx;
  187. text-align: center;
  188. line-height: 86rpx;
  189. margin: 43rpx auto;
  190. }
  191. </style>