surveySubmit.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <view class="survey-box">
  3. <!-- <textarea :value="surveyText" placeholder="请详述您的调研需求" placeholder-style="color:#999999"
  4. :maxlength="100" /> -->
  5. <view class="survey-textArea">
  6. <van-field :value="surveyText" type="textarea" :maxlength="100" placeholder="请详述您的调研需求"
  7. :border="false" :show-word-limit="true" :autosize="{minHeight: 100}" @change="inputChange($event)"></van-field>
  8. </view>
  9. <view @click="submit" class="submit">提交</view>
  10. </view>
  11. </template>
  12. <script>
  13. import {leafletUrl} from '@/config/config'
  14. import {purchaserApi} from "@/config/modules/purchaser.js"
  15. export default {
  16. data() {
  17. return {
  18. surveyText:''
  19. }
  20. },
  21. methods: {
  22. inputChange(e){
  23. this.surveyText=e.detail
  24. },
  25. submit(){
  26. // console.log(this.surveyText);
  27. if(!this.surveyText){
  28. uni.showToast({
  29. title:'调研需求不能为空',
  30. icon:'none'
  31. })
  32. return
  33. }
  34. purchaserApi.purchaserSurveySubmit({Content:this.surveyText}).then(res=>{
  35. if (res.Ret === 200) {
  36. uni.showToast({
  37. title:'提交成功,请等待销售与您联系',
  38. duration:2000,
  39. icon:'none'
  40. })
  41. setTimeout(()=>{
  42. uni.navigateBack()
  43. },2000)
  44. }
  45. })
  46. }
  47. },
  48. onLoad(option) {
  49. let id = option.Id || 0
  50. this.url=`${leafletUrl}?Id=${id}#wechat_redirect`
  51. console.log(this.url);
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. .survey-box{
  57. padding: 30rpx 20rpx;
  58. display: flex;
  59. flex-direction: column;
  60. align-items: center;
  61. justify-content: center;
  62. .survey-textArea{
  63. width: 100%;
  64. border: solid 2rpx #999999;
  65. border-radius: 16rpx;
  66. padding: 6rpx;
  67. box-sizing: border-box;
  68. margin-bottom: 40rpx;
  69. }
  70. .submit{
  71. width: 240rpx;
  72. height: 60rpx;
  73. background: linear-gradient(90deg, #0151ff 0%, #01b9ff 100%);
  74. color: white;
  75. display: flex;
  76. align-items: center;
  77. justify-content: center;
  78. }
  79. }
  80. </style>