meetingFeedback.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="bigbox">
  3. <!-- 顶部导航栏 -->
  4. <uni-nav-bar status-bar=true fixed=true left-icon="arrowleft" background-color="#3387ff" color="#ffffff"
  5. @clickLeft="navigateBack">
  6. <text slot="default" style="text-align: center; flex: 1; font-size: 18px; font-weight: bold;">会议反馈</text>
  7. </uni-nav-bar>
  8. <!-- 表单 -->
  9. <uni-list
  10. :border="false"
  11. style="width: 686rpx;margin: 32rpx;overflow: hidden;">
  12. <uni-list-item clickable>
  13. <text slot="header" class="text_style">姓名</text>
  14. <input placeholder="请填写您的姓名" slot="body" class="uni-input-info" v-model="form.umsUsername"/>
  15. </uni-list-item>
  16. <uni-list-item clickable>
  17. <text slot="header" class="text_style">联系电话</text>
  18. <input placeholder="请填写您的联系电话" slot="body" class="uni-input-info" v-model="form.userMobile"/>
  19. </uni-list-item>
  20. <uni-list-item clickable>
  21. <text slot="header" class="text_style">单位</text>
  22. <input placeholder="请填写您的单位" slot="body" class="uni-input-info" v-model="form.unit"/>
  23. </uni-list-item>
  24. <uni-list-item clickable>
  25. <text slot="header" class="text_style">职务</text>
  26. <input placeholder="请填写您的职务" slot="body" class="uni-input-info" v-model="form.job"/>
  27. </uni-list-item>
  28. <uni-list-item clickable style="border: none;">
  29. <text slot="header" class="text_style label">意见反馈</text>
  30. <textarea slot="body" value="" placeholder="" v-model="form.ideaPointOpinion"/>
  31. <!-- <input placeholder="请填写您的反馈意见" slot="body" class="" /> -->
  32. </uni-list-item>
  33. </uni-list>
  34. <button type="default" @click="submitForm">提交</button>
  35. </view>
  36. </template>
  37. <script>
  38. import uniNavBar from "@/components/uni-nav-bar/uni-nav-bar.vue";
  39. export default{
  40. data(){
  41. return{
  42. form: {
  43. meetingId: '',
  44. umsUsername: '',
  45. userMobile: '',
  46. unit: '',
  47. job: '',
  48. ideaPointOpinion: ''
  49. },
  50. }
  51. },
  52. methods:{
  53. async submitForm(){
  54. if (this.checkContent(this.form.userMobile)&&!this.checkMobile(this.form.userMobile)) {
  55. uni.showToast({
  56. title: '请填写正确的手机格式',
  57. icon: 'none'
  58. });
  59. return;
  60. }else if (!this.checkContent(this.form.ideaPointOpinion)) {
  61. uni.showToast({
  62. title: '请填写反馈意见',
  63. icon: 'none'
  64. });
  65. return;
  66. }
  67. const token = await this.$myRequest({
  68. url: '/sys/token',
  69. data: {}
  70. });
  71. const res = await this.$myRequest({
  72. url: '/meeting/meetingIdeaPoints',
  73. method: (this.form.id ? 'PUT' : 'POST'),
  74. data: {
  75. meetingIdeaPoint:JSON.stringify(this.form),
  76. token:token.data
  77. }
  78. });
  79. if(res.msg == '保存成功'){
  80. uni.showToast({
  81. title: '反馈成功',
  82. icon: 'none'
  83. });
  84. setTimeout(()=>{
  85. uni.navigateBack()
  86. }, 1500)
  87. }
  88. },
  89. // 验证手机号格式
  90. checkMobile(mobile) {
  91. return RegExp(/^1[34578]\d{9}$/).test(mobile);
  92. },
  93. //验证是否为空
  94. checkContent(content) {
  95. return RegExp(/^[\s\S]*.*[^\s][\s\S]*$/).test(content);
  96. },
  97. navigateBack() {
  98. uni.navigateBack()
  99. },
  100. },
  101. onLoad(option) {
  102. this.form.meetingId = option.id
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. page{
  108. background-color: #FFFFFF;
  109. }
  110. .bigbox {
  111. height: calc(100vh);
  112. background-color: #FFFFFF;
  113. padding-bottom: 20px;
  114. }
  115. .uni-list-item{
  116. // height: 144rpx;
  117. line-height: 104rpx;
  118. border-bottom: 1px solid #979797;
  119. }
  120. // uni-input{
  121. // border: 1px solid black;
  122. // width: 100%;
  123. // height: 60%;
  124. // }
  125. textarea{
  126. border: 1px solid #979797;
  127. width: 100%;
  128. }
  129. /deep/.uni-list--border::after{
  130. background-color: #FFFFFF;
  131. }
  132. /deep/.uni-list-item__container{
  133. flex-wrap: wrap;
  134. }
  135. .uni-list:after, .uni-list:before{
  136. height: 0px;
  137. }
  138. .text_style{
  139. width: 100%;
  140. font-weight: bold;
  141. font-size: 14px;
  142. display: flex;
  143. align-items: center;
  144. margin-bottom: 10rpx;
  145. }
  146. .uni-input-info {
  147. height: 54rpx;
  148. width: 650rpx;
  149. font-size: 30rpx;
  150. }
  151. uni-button{
  152. width: 315px;
  153. height: 44px;
  154. font-size: 21px;
  155. color: #FFFFFF;
  156. line-height: 44px;
  157. border-radius: 25px;
  158. background-image: linear-gradient(to right, #33afff , #1777fe);
  159. }
  160. .label:before {
  161. content: '* ';
  162. color: red;
  163. }
  164. </style>