refundOrderDelivery.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="content">
  3. <view class="inner">
  4. <view class="form-box">
  5. <view class="form-item">
  6. <text class="label">快递公司</text>
  7. <input type="text" v-model="form.deliveryName" placeholder="请输入物流公司" placeholder-class="form-input" />
  8. </view>
  9. <view class="form-item">
  10. <text class="label">快递单号</text>
  11. <input type="text" v-model="form.deliverySn" placeholder="请输入物流单号" placeholder-class="form-input" />
  12. </view>
  13. </view>
  14. </view>
  15. <view class="btn-box">
  16. <view class="sub-btn" @click="submit()">提交</view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import {addDelivery} from '@/api/order.js'
  22. export default {
  23. data() {
  24. return {
  25. form:{
  26. userId:this.userId,
  27. id:null,
  28. deliverySn:null,
  29. deliveryName:null,
  30. }
  31. }
  32. },
  33. onLoad(option) {
  34. this.form.id=option.id
  35. this.userId= uni.getStorageSync("userData").userId
  36. },
  37. methods: {
  38. submit(){
  39. if(this.form.deliveryName==null){
  40. uni.showToast({
  41. icon:'none',
  42. title: '请输入快递公司'
  43. });
  44. return;
  45. }
  46. if(this.form.deliverySn==null){
  47. uni.showToast({
  48. icon:'none',
  49. title: '请输入快递单号'
  50. });
  51. return;
  52. }
  53. addDelivery(this.form).then(
  54. res => {
  55. if(res.code==200){
  56. uni.showToast({
  57. icon:'success',
  58. title: "提交成功",
  59. });
  60. uni.navigateBack({
  61. delta: 1
  62. })
  63. }else{
  64. uni.showToast({
  65. icon:'none',
  66. title: res.msg,
  67. });
  68. }
  69. },
  70. rej => {}
  71. );
  72. },
  73. },
  74. }
  75. </script>
  76. <style lang="scss">
  77. page{
  78. height: 100%;
  79. }
  80. .content{
  81. display: flex;
  82. flex-direction: column;
  83. justify-content: space-between;
  84. .inner{
  85. padding: 20upx;
  86. .form-box{
  87. padding: 0 30upx;
  88. background: #FFFFFF;
  89. border-radius: 16upx;
  90. .form-item{
  91. padding: 30upx 0;
  92. display: flex;
  93. align-items: flex-start;
  94. border-bottom: 1px solid #F1F1F1;
  95. &:last-child{
  96. border-bottom: none;
  97. }
  98. .label{
  99. width: 150upx;
  100. text-align: left;
  101. font-size: 30upx;
  102. line-height: 44upx;
  103. font-family: PingFang SC;
  104. font-weight: 500;
  105. color: #222222;
  106. flex-shrink: 0;
  107. }
  108. input{
  109. text-align: left;
  110. }
  111. .form-input{
  112. font-size: 30upx;
  113. font-family: PingFang SC;
  114. font-weight: 500;
  115. color: #999999;
  116. text-align: left;
  117. }
  118. }
  119. }
  120. }
  121. .btn-box{
  122. height: 120upx;
  123. padding: 0 30upx;
  124. display: flex;
  125. align-items: center;
  126. justify-content: center;
  127. .sub-btn{
  128. width: 100%;
  129. height: 88upx;
  130. line-height: 88upx;
  131. text-align: center;
  132. font-size: 30upx;
  133. font-family: PingFang SC;
  134. font-weight: bold;
  135. color: #FFFFFF;
  136. background: #2BC7B9;
  137. border-radius: 44upx;
  138. }
  139. }
  140. }
  141. </style>