additional.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="container">
  3. <form @submit="bindSave" :report-submit="true">
  4. <tui-list-cell :hover="false" :lineLeft="false">
  5. <view class="tui-cell-input">
  6. <input name="amount" :placeholder="'输入与客户沟通的尾款金额'" placeholder-class="tui-phcolor" type="text"
  7. :auto-focus="true" :focus="true" maxlength="40" />
  8. </view>
  9. </tui-list-cell>
  10. <view class="tui-btn-box">
  11. <tui-button formType="submit" :shadow="false" height="88rpx" shape="circle" type="danger">确认
  12. </tui-button>
  13. </view>
  14. </form>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. id: ''
  22. };
  23. },
  24. onLoad: function(e) {
  25. this.id = e.id;
  26. },
  27. onShow: function() {
  28. },
  29. methods: {
  30. async bindSave(e) {
  31. const _this = this
  32. const amount = e.detail.value.amount;
  33. if (amount == "" || amount * 1 < 0) {
  34. wx.showToast({
  35. title: '请填写尾款金额',
  36. icon: 'none'
  37. })
  38. return
  39. }
  40. _this.$request.post('order.additional', {
  41. orderid: _this.id,
  42. additional: amount
  43. }).then(function(res) {
  44. if (res.errno == 0) {
  45. uni.navigateBack({})
  46. }
  47. });
  48. }
  49. },
  50. /**
  51. * 页面相关事件处理函数--监听用户下拉动作
  52. */
  53. onPullDownRefresh: function() {
  54. setTimeout(() => {
  55. uni.stopPullDownRefresh()
  56. }, 200);
  57. },
  58. };
  59. </script>
  60. <style lang="scss">
  61. .container {
  62. padding-top: 20rpx;
  63. .tui-cell-input {
  64. width: 100%;
  65. display: flex;
  66. align-items: center;
  67. box-sizing: border-box;
  68. input {
  69. flex: 1;
  70. padding-left: $uni-spacing-row-base;
  71. }
  72. }
  73. .tui-btn-box {
  74. padding: 40rpx 30rpx 10rpx 30rpx;
  75. box-sizing: border-box;
  76. }
  77. }
  78. </style>