parcel.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <!-- 添加包裹 -->
  3. <view class="back">
  4. <view class="box" style="border-radius: 16rpx 16rpx 0 0 ">
  5. <view class="boxitem u-flex">
  6. <text class="name">{{i18n.TrackingNumber}}</text>
  7. <input style="flex: 1;" type="text" :placeholder="i18n.trackingNumber" v-model="logistics_no" />
  8. </view>
  9. </view>
  10. <view class="box">
  11. <view class="boxitem u-flex">
  12. <text class="name">{{i18n.Expresscompany}}</text>
  13. <input style="flex: 1;" type="text" :placeholder="i18n.ExpressCompany" v-model="logistics_company_name" />
  14. </view>
  15. </view>
  16. <view class="box" style="border-radius:0 0 16rpx 16rpx">
  17. <view class="boxitem u-flex">
  18. <text class="name">{{i18n.Parcelweight}}</text>
  19. <input style="flex: 1;" type="text" :placeholder="i18n.parcelWeight" v-model="estimated_weight" />
  20. <text>kg</text>
  21. </view>
  22. </view>
  23. <view class="btn" @click="offline">
  24. {{i18n.Addlist}}
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. logistics_company_name:'',// 顺丰快递 是 String 快递公司
  33. logistics_no:'',//11111111 是 String 快递单号
  34. estimated_weight:'',// 222 是 String 包裹重量
  35. };
  36. },
  37. computed: {
  38. i18n() {
  39. return this.$t('index')
  40. }
  41. },
  42. onShow() {
  43. uni.setNavigationBarTitle({
  44. title: this.i18n.Addparcel
  45. })
  46. },
  47. methods:{
  48. //线下下单
  49. offline() {
  50. uni.$u.http.post('/api/express-order/offline-create', {
  51. logistics_company_code:this.logistics_company_name,// 顺丰快递 是 String 快递公司
  52. logistics_no:this.logistics_no,//11111111 是 String 快递单号
  53. estimated_weight:this.estimated_weight,// 222 是 String 包裹重量
  54. }).then((res) => {
  55. this.$u.toast('添加成功')
  56. // uni.navigateTo({
  57. // url:'pageB/myPackage'
  58. // })
  59. setTimeout(()=>{
  60. uni.navigateBack()
  61. },800)
  62. }).catch(() => {
  63. })
  64. },
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .btn {
  70. width: 686rpx;
  71. height: 88rpx;
  72. background: #F83224;
  73. border-radius: 44rpx;
  74. font-family: PingFangSC, PingFang SC;
  75. font-weight: 500;
  76. font-size: 32rpx;
  77. color: #FFFFFF;
  78. line-height: 88rpx;
  79. text-align: center;
  80. font-style: normal;
  81. margin-top: 94rpx;
  82. }
  83. .back {
  84. box-sizing: border-box;
  85. padding: 20rpx 24rpx;
  86. }
  87. .box {
  88. padding: 0 28rpx;
  89. box-sizing: border-box;
  90. width: 702rpx;
  91. // height: 324rpx;
  92. background: #FFFFFF;
  93. // border-radius: 16rpx;
  94. box-sizing: border-box;
  95. .boxitem {
  96. height: 100rpx;
  97. width: 646rpx;
  98. border-bottom: 2rpx solid rgba(151, 151, 151, 0.1);
  99. box-sizing: border-box;
  100. }
  101. .name {
  102. width: 150rpx;
  103. display: block;
  104. font-family: PingFangSC, PingFang SC;
  105. font-weight: 400;
  106. font-size: 30rpx;
  107. color: #222222;
  108. line-height: 42rpx;
  109. text-align: left;
  110. font-style: normal;
  111. margin-right: 44rpx;
  112. }
  113. }
  114. </style>