baoxian.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view class="body">
  3. <view class="content">
  4. <view class="heade">
  5. 欢迎您光顾,请仔细填写您的信息!
  6. </view>
  7. <!-- 门店 -->
  8. <view style="width: 85vw; height: 12vw; display: flex; border-bottom: 1px solid #f8f8f8;" @click="storeInfo">
  9. <p style="display: flex;"><span style="color: red; line-height: 11vw;">*</span> <span
  10. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">门店</span> <input type="text"
  11. v-model="storeName" placeholder="请选择门店"
  12. disabled="true"
  13. style="font-size: 0.8rem; width: 50vw; height: 10vw; line-height: 10vw; margin-left: 6vw; " />
  14. </p>
  15. </view>
  16. <!-- 姓名 -->
  17. <view style="width: 85vw; height: 12vw; display: flex; border-bottom: 1px solid #f8f8f8;">
  18. <p style="display: flex;"><span style="color: red; line-height: 11vw;">*</span> <span
  19. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">姓名</span> <input type="text"
  20. placeholder="请输入你的姓名" v-model="name"
  21. style="font-size: 0.8rem; width: 50vw; height: 10vw; line-height: 10vw; margin-left: 6vw; " />
  22. </p>
  23. </view>
  24. <!-- 手机号 -->
  25. <view style="width: 85vw; height: 12vw; display: flex; border-bottom: 1px solid #f8f8f8;">
  26. <p style="display: flex;"><span style="color: red; line-height: 11vw;">*</span> <span
  27. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">电话</span> <input type="text"
  28. placeholder="请输入你的车牌" v-model="tel"
  29. style="font-size: 0.8rem; width: 50vw; height: 10vw; line-height: 10vw; margin-left: 9vw; " />
  30. </p>
  31. </view>
  32. <!-- 车型 -->
  33. <view style="width: 85vw; height: 65vw; border-bottom: 1px solid #f8f8f8;">
  34. <p style="display: flex;"><span style="color: red; line-height: 11vw;"></span> <span
  35. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">备注</span>
  36. </p>
  37. <p style="height: 40vw;">
  38. <textarea style="width: 75vw; border: 1px solid #f8f8f8; height: 40vw; overflow: auto;" placeholder="请输入备注信息"
  39. v-model="content"></textarea>
  40. </p>
  41. </view>
  42. <u-toast ref="uToast" />
  43. <view class="button" @click="submit">提交</view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. shop: '',
  52. name: '',
  53. tel: '',
  54. content: '',
  55. storeName:''
  56. }
  57. },
  58. onShow(object) {
  59. if(object){
  60. this.storeName=object.name
  61. this.shop=object.id
  62. }
  63. },
  64. onLoad() {
  65. if (this.$db.get('tel')) {
  66. this.tel = this.$db.get('tel')
  67. }
  68. },
  69. methods: {
  70. storeInfo(){
  71. uni.navigateTo({
  72. url:'/pages/index/storeList'
  73. })
  74. },
  75. // 提交
  76. submit() {
  77. if (!this.$db.get('token')) {
  78. uni.navigateTo({
  79. url: '/pages/login/login'
  80. })
  81. return
  82. }
  83. this.$api.postConsultation({
  84. shop: this.shop,
  85. name: this.name,
  86. tel: this.tel,
  87. content: this.content
  88. }, res => {
  89. if (res.code == 0) {
  90. this.successToast('提交成功')
  91. this.$nextTick(() => {
  92. this.storeName=''
  93. this.name = ''
  94. this.shop = ''
  95. this.content = ''
  96. })
  97. } else {
  98. this.errorToast('请输入必填项')
  99. }
  100. })
  101. },
  102. successToast(msg) {
  103. this.$refs.uToast.show({
  104. title: msg,
  105. type: 'success',
  106. duration: 1000
  107. })
  108. },
  109. errorToast(msg) {
  110. this.$refs.uToast.show({
  111. title: msg,
  112. type: 'error',
  113. duration: 1000
  114. })
  115. },
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. .body {
  121. width: 100vw;
  122. height: 100vh;
  123. background-color: #f8f8f8;
  124. display: flex;
  125. justify-content: center;
  126. .content {
  127. width: 95vw;
  128. height: 80vh;
  129. background-color: white;
  130. border-radius: 5px;
  131. padding: 2vw;
  132. .heade {
  133. width: 95vw;
  134. height: 22vw;
  135. box-sizing: border-box;
  136. text-align: center;
  137. padding: 8vw 15vw 5vw 15vw;
  138. font-size: 0.9rem;
  139. color: gray;
  140. border-bottom: 1px solid #f8f8f8;
  141. ;
  142. }
  143. .picture {
  144. width: 95vw;
  145. height: 14vh;
  146. display: flex;
  147. justify-content: space-around;
  148. align-items: center;
  149. .front {
  150. width: 40vw;
  151. height: 25vw;
  152. background-color: #f8f8f8;
  153. border: 1px dashed #d8d8d8;
  154. display: flex;
  155. flex-direction: column;
  156. justify-content: center;
  157. align-items: center;
  158. }
  159. .opposite {
  160. width: 40vw;
  161. height: 25vw;
  162. background-color: #f8f8f8;
  163. border: 1px dashed #d8d8d8;
  164. display: flex;
  165. flex-direction: column;
  166. justify-content: center;
  167. align-items: center;
  168. }
  169. }
  170. .agreement {
  171. display: flex;
  172. font-size: 0.8rem;
  173. width: 96vw;
  174. justify-content: center;
  175. align-items: center;
  176. height: 10vh;
  177. }
  178. .button {
  179. width: 85vw;
  180. height: 10vw;
  181. margin-top: 10vw;
  182. background-color: red;
  183. line-height: 10vw;
  184. border-radius: 5vw;
  185. color: white;
  186. text-align: center;
  187. margin-left: 5vw;
  188. }
  189. }
  190. }
  191. </style>