storeOrderRefundAddDelivery.vue 2.7 KB

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