needSubmit.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view class="need-submit" :class="['qn-page-' + theme]">
  3. <u-input v-model="demand" placeholder="说点您的需要吧……" type="textarea" :border="true" :height="300" :auto-height="true" />
  4. <button class="add-btn primary-bg" @click="addCustomerdemand">保存提交</button>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. demand: ''
  12. };
  13. },
  14. computed:{
  15. userId(){
  16. return this.$store.state.userStatus.id
  17. }
  18. },
  19. methods: {
  20. addCustomerdemand() {
  21. if(!this.demand){
  22. this.$u.toast('说点什么再提交吧')
  23. return
  24. }
  25. this.$u.api
  26. .addCustomerdemand({
  27. customerId: this.userId,
  28. demand: this.demand
  29. })
  30. .then(res => {
  31. this.$u.toast('提交成功')
  32. setTimeout(()=>{
  33. uni.navigateBack()
  34. },2000)
  35. });
  36. }
  37. }
  38. };
  39. </script>
  40. <style>
  41. page {
  42. background-color: #ffffff;
  43. }
  44. </style>
  45. <style scoped lang="scss">
  46. .need-submit {
  47. padding: 30rpx;
  48. }
  49. .add-btn {
  50. width: 690upx;
  51. height: 80upx;
  52. font-size: 32upx;
  53. color: #fff;
  54. border-radius: 10upx;
  55. margin: 30rpx auto;
  56. }
  57. .add-btn:after {
  58. border: 0 none;
  59. }
  60. </style>