bindOrder.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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" v-if="haveAuthorizeCode">
  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.reLaunch({
  38. url: '/pagesMain/orderList?type=4'
  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. box-sizing: border-box;
  61. padding-bottom: 70px;
  62. overflow-y: auto;
  63. .form-handle {
  64. width: calc(100% - 30px);
  65. height: 40px;
  66. position: fixed;
  67. bottom: 20px;
  68. left: 15px;
  69. .handle-custom {
  70. background-color: #51A539;
  71. }
  72. }
  73. }
  74. </style>