feedback.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view>
  3. <view class="broKerForm">
  4. <view class="broKerForm-item">
  5. <view class="item-title">姓名</view>
  6. <view class="item-area">
  7. <input class="item-area-input" placeholder="请输入姓名" data-field="name" @input="bindInput"
  8. placeholder-style="color: #979797;"></input>
  9. </view>
  10. </view>
  11. <view class="broKerForm-item">
  12. <view class="item-title">联系方式</view>
  13. <view class="item-area">
  14. <input class="item-area-input" placeholder="请输入联系方式" data-field="mobile" @input="bindInput"
  15. placeholder-style="color: #979797;"></input>
  16. </view>
  17. </view>
  18. <view class="broKerForm-item-bg">
  19. <textarea maxlength="-1" @input="bindInput" data-field="content" placeholder="请输入您的意见和建议"></textarea>
  20. </view>
  21. </view>
  22. <view class="bottomEmpty"></view>
  23. <view class="bottomArea">
  24. <view class="bottomButton" @tap="subModal">确定</view>
  25. </view>
  26. <form v-if="false">
  27. <view class="cu-form-group margin-top">
  28. <view class="title">姓名</view>
  29. <input placeholder="请输入姓名" data-field="name" @input="bindInput"></input>
  30. </view>
  31. <view class="cu-form-group">
  32. <view class="title">联系方式</view>
  33. <input placeholder="请输入联系方式" data-field="mobile" @input="bindInput"></input>
  34. </view>
  35. <view class="cu-form-group">
  36. <textarea maxlength="-1" @input="bindInput" data-field="content" placeholder="请输入您的意见和建议"></textarea>
  37. </view>
  38. <view class="cu-bar bg-white justify-end margin-top">
  39. <view class="action">
  40. <button class="cu-btn bg-green margin-left" @tap="subModal">确定</button>
  41. </view>
  42. </view>
  43. </form>
  44. </view>
  45. </template>
  46. <script>
  47. var _this;
  48. export default {
  49. data() {
  50. return {
  51. userinfo: {},
  52. info: {
  53. name: '',
  54. mobile: '',
  55. content: '',
  56. userid: 0,
  57. },
  58. }
  59. },
  60. onLoad: function(option) {
  61. _this = this;
  62. _this.userinfo = _this.checkLogin("/pages/my/myinfo");
  63. _this.info.userid = _this.userinfo.id;
  64. },
  65. methods: {
  66. textareaAInput(e) {
  67. _this.info.content = e.detail.value;
  68. },
  69. bindInput: function(e) {
  70. _this.info[e.currentTarget.dataset.field] = e.detail.value;
  71. },
  72. subModal() {
  73. if (_this.info.name == '') {
  74. uni.showModal({
  75. title: '信息提示',
  76. content: '姓名不能为空',
  77. showCancel: false
  78. });
  79. return false;
  80. }
  81. if (_this.info.mobile == '') {
  82. uni.showModal({
  83. title: '信息提示',
  84. content: '联系方式不能为空',
  85. showCancel: false
  86. });
  87. return false;
  88. }
  89. if (_this.info.content == '') {
  90. uni.showModal({
  91. title: '信息提示',
  92. content: '反馈内容不能为空',
  93. showCancel: false
  94. });
  95. return false;
  96. }
  97. _this.$req.ajax({
  98. path: "my/feedback",
  99. data: _this.info,
  100. }).then((data) => {
  101. uni.navigateBack();
  102. }).catch((err) => {
  103. uni.showModal({
  104. title: '信息提示',
  105. content: err,
  106. showCancel: false
  107. });
  108. });
  109. },
  110. }
  111. }
  112. </script>
  113. <style lang="scss">
  114. .cu-form-group .title {
  115. min-width: calc(4em + 30rpx);
  116. }
  117. .broKerForm {
  118. padding: 40rpx 70rpx;
  119. background-color: #FFFFFF;
  120. .broKerForm-item-bg {
  121. padding: 20rpx 0;
  122. display: flex;
  123. align-items: center;
  124. justify-content: center;
  125. background-color: #F7F7F7;
  126. }
  127. .broKerForm-item {
  128. margin-bottom: 35rpx;
  129. .item-area {
  130. margin-top: 15rpx;
  131. padding: 0 36rpx;
  132. width: 100%;
  133. height: 100rpx;
  134. background: #F7F7F7;
  135. font-size: 28rpx;
  136. color: #979797;
  137. .item-area-input {
  138. height: 100rpx;
  139. }
  140. }
  141. }
  142. }
  143. .bottomEmpty {
  144. margin-top: 80rpx;
  145. height: 130rpx;
  146. }
  147. .bottomArea {
  148. position: fixed;
  149. bottom: 0;
  150. z-index: 100;
  151. width: 100%;
  152. height: 130rpx;
  153. display: flex;
  154. align-items: center;
  155. justify-content: center;
  156. background-color: #FFFFFF;
  157. box-shadow: -10rpx -12rpx 12rpx 2rpx rgba(52, 85, 73, 0.16);
  158. .bottomButton {
  159. margin: 0 28rpx;
  160. width: 696rpx;
  161. height: 90rpx;
  162. line-height: 90rpx;
  163. background: #CA151C;
  164. font-size: 33rpx;
  165. text-align: center;
  166. color: #FFFFFF;
  167. border-radius: 10rpx;
  168. }
  169. }
  170. </style>