bindOrder.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view class="container">
  3. <u-cell-group :border="false">
  4. <u-field label="快递单号" placeholder="请输入快递单号" v-model="logisticsNum"></u-field>
  5. </u-cell-group>
  6. <view class="form-handle">
  7. <u-button type="success" shape="circle" :ripple="true" @click="submitData" class="handle-custom" :disabled="!logisticsNum">绑定</u-button>
  8. </view>
  9. <u-top-tips ref="uTips"></u-top-tips>
  10. </view>
  11. </template>
  12. <script>
  13. const NET = require('@/utils/request')
  14. const API = require('@/config/api')
  15. export default {
  16. data() {
  17. return {
  18. orderId: '',
  19. logisticsNum: '',
  20. }
  21. },
  22. onLoad(options) {
  23. this.orderId = options.orderId
  24. },
  25. methods: {
  26. // 提交数据
  27. submitData() {
  28. NET.request(API.bindOrder, {
  29. orderId: this.orderId,
  30. logisticsNum: this.logisticsNum,
  31. }, 'GET').then(res => {
  32. this.$refs.uTips.show({
  33. title: '绑定成功',
  34. type: 'success',
  35. })
  36. setTimeout(() => {
  37. uni.redirectTo({
  38. url: '/pagesMain/orderList?type=3'
  39. });
  40. }, 1000)
  41. }).catch(error => {
  42. this.$refs.uTips.show({
  43. title: error.data.msg,
  44. type: 'warning',
  45. })
  46. })
  47. },
  48. },
  49. }
  50. </script>
  51. <style lang="less" scoped>
  52. page {
  53. width: 100%;
  54. height: 100%;
  55. }
  56. .container {
  57. width: 100%;
  58. height: 100%;
  59. float: left;
  60. position: absolute;
  61. box-sizing: border-box;
  62. padding-bottom: 70px;
  63. overflow-y: auto;
  64. .form-handle {
  65. width: calc(100% - 30px);
  66. height: 40px;
  67. position: fixed;
  68. bottom: 20px;
  69. left: 15px;
  70. .handle-custom {
  71. background-color: #51A539;
  72. /deep/button {
  73. background-color: #56a83a;
  74. }
  75. /deep/.u-btn--success--disabled {
  76. background-color: #74bd60 !important;
  77. }
  78. }
  79. }
  80. }
  81. </style>