basePrice.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <template>
  2. <view class="body">
  3. <view class="header">
  4. <view class="headercon">
  5. <view>
  6. <p>
  7. <image style="width: 20vw; height: 20vw;" :src="detial.img_url.url"></image>
  8. </p>
  9. </view>
  10. <view style="margin-left: 4vw;">
  11. <p style="font-weight: 550; font-size: 1rem;">{{detial.series_name}}</p>
  12. <p>
  13. <span>品牌:</span> <span>{{detial.brand_name}}</span> </p>
  14. <view style="display: flex; margin-top: 2vw;">
  15. <span>指导价:</span>
  16. <span style="color: red;">{{Number(detial.sale_price/10000)}}w</span>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="content">
  22. <view class="contentInfo">
  23. <view style="width: 90vw; height: 12vw; border-bottom: 0.5px solid #f8f8f8; margin-top: 2vw;">
  24. <view style="display: flex;"><span style="color: red; line-height: 11vw;">*</span> <span
  25. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">您的姓名</span>
  26. <input type="text"
  27. placeholder="姓名"
  28. v-model="name"
  29. style="font-size: 0.8rem; height: 10vw; line-height: 10vw; margin-left: 9vw; " />
  30. </view>
  31. </view>
  32. <!-- 车牌-->
  33. <view style=" display: flex; width: 85vw; height: 12vw; border-bottom: 0.5px solid #f8f8f8;">
  34. <p style="display: flex; align-items: center;"><span style="color: red; line-height: 11vw;">*</span> <span
  35. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">联系方式</span> <input type="text"
  36. placeholder="联系方式"
  37. v-model="phone"
  38. style="font-size: 0.8rem; height: 10vw; line-height: 10vw; margin-left: 10vw; " /> </p>
  39. <view style="display: flex; align-items: center;">
  40. </view>
  41. </view>
  42. <!-- 您的城市 -->
  43. <view style="width: 90vw; height: 12vw; border-bottom: 0.5px solid #f8f8f8; " @click="city" >
  44. <view style="display: flex; align-items: center;"><span style="color: red; line-height: 11vw;" >*</span> <span
  45. <p style=" margin-left: 1vw;">您的城市</p>
  46. <p> <input style="margin-left: 8vw;" v-model="citys" type="text" disabled="true" placeholder="请选择省/市/区"> </p>
  47. <p>
  48. <image style="width: 5vw; height: 5vw; margin-left: 5vw;" src="../../static/dingwei.png"></image>
  49. </p>
  50. </view>
  51. </view>
  52. <!-- 意向稳门店 -->
  53. <view style="width: 90vw; height: 12vw; border-bottom: 0.5px solid #f8f8f8;" @click="LikeStore">
  54. <p style="display: flex;"><span style="color: red; line-height: 11vw;">*</span> <span
  55. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">意向门店</span> <input type="text"
  56. placeholder="请选择意向门店"
  57. v-model="storeName"
  58. style="font-size: 0.8rem; height: 10vw; line-height: 10vw; margin-left: 9vw; " /> </p>
  59. </view>
  60. <!-- 联系人-->
  61. <view style="width: 90vw; height: 12vw; border-bottom: 0.5px solid #f8f8f8;">
  62. <view style="display: flex;"><span style="color: red; line-height: 11vw;">*</span> <span
  63. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">旧车置换</span>
  64. <view style=" width: 37vw; margin-left: 9vw; display: flex; align-items: center;">
  65. <u-radio-group v-model="CarRadio" @change="radioGroupChange">
  66. <u-radio
  67. @change="radioChange"
  68. active-color="red"
  69. v-for="(item, index) in Carlist" :key="index"
  70. :name="item.name"
  71. :disabled="item.disabled"
  72. >
  73. {{item.name}}
  74. </u-radio>
  75. </u-radio-group>
  76. </view>
  77. </view>
  78. </view>
  79. <u-toast ref="uToast" />
  80. <!-- button -->
  81. <view class="button" @click="submit">提交</view>
  82. <u-picker mode="region" v-model="show" @cancel="cancel" @confirm="confirm"
  83. :area-code='["13", "1303", "130304"]'></u-picker>
  84. </view>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. import UniDataSelect from '@/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue'
  90. export default {
  91. components: {
  92. UniDataSelect
  93. },
  94. data() {
  95. return {
  96. value: 0,
  97. CarNumber:false,
  98. show:false,
  99. region:'',
  100. storeName:'',
  101. storeId:'',
  102. name:'匿名',
  103. phone:'',
  104. citys:'',
  105. VehicleSeries:'',
  106. selectRadio:'先生',
  107. CarRadio:'否',
  108. Radios:false,
  109. detial:{},
  110. id:'',
  111. list: [{
  112. name: '先生',
  113. disabled: false
  114. },
  115. {
  116. name: '女士',
  117. disabled: false
  118. },
  119. ],
  120. Carlist:[{
  121. name: '是',
  122. disabled: false
  123. },
  124. {
  125. name: '否',
  126. disabled: false
  127. }],
  128. range: [{
  129. value: 0,
  130. text: "首保"
  131. },
  132. {
  133. value: 1,
  134. text: "定保"
  135. },
  136. {
  137. value: 2,
  138. text: "检测"
  139. },
  140. {
  141. value: 3,
  142. text: "维修"
  143. },
  144. ],
  145. chexi: [{
  146. value: 0,
  147. text: "首保"
  148. },
  149. {
  150. value: 1,
  151. text: "定保"
  152. },
  153. {
  154. value: 2,
  155. text: "检测"
  156. },
  157. {
  158. value: 3,
  159. text: "维修"
  160. },
  161. ],
  162. }
  163. },
  164. onShow(object){
  165. if(object){
  166. this.storeName=object.name
  167. this.storeId=object.id
  168. }
  169. },
  170. onLoad(option) {
  171. if(option.id){
  172. this.id=option.id
  173. this.getBuyCarDetialInfo(option.id)
  174. }
  175. if(this.$db.get('tel')){
  176. this.phone=this.$db.get('tel')
  177. }
  178. },
  179. methods: {
  180. submit(){
  181. if(!this.$db.get('token')){
  182. uni.navigateTo({
  183. url:'/pages/login/login'
  184. })
  185. return
  186. }
  187. if(this.phone!=''){
  188. this.$api.postAskPrice({model:this.id, shop:this.storeId,name:this.name,tel:this.phone,area:this.citys,displace:this.Radios},res=>{
  189. if(res.code==0){
  190. this.successToast('提交成功')
  191. uni.navigateBack({
  192. delta: 1
  193. })
  194. }else{
  195. this.errorToast('请输入必填项')
  196. }
  197. })
  198. }else{
  199. this.errorToast('请输入必填项')
  200. }
  201. },
  202. city() {
  203. this.show = true
  204. },
  205. LikeStore(){
  206. uni.navigateTo({
  207. url:'/pages/index/storeList'
  208. })
  209. },
  210. getBuyCarDetialInfo(id){
  211. this.$api.getBuyCarDetial(id,res=>{
  212. if(res.code==0){
  213. this.detial=res.data
  214. }
  215. })
  216. },
  217. confirm(e) {
  218. this.citys=e.province.label+'-'+ e.city.label+'-'+e.area.label
  219. console.log("确认", e)
  220. },
  221. cancel(e) {
  222. this.show=false
  223. console.log("取消")
  224. },
  225. radioChange(e){
  226. if(e=='是'){
  227. this.Radios=true
  228. }else{
  229. this.Radios=false
  230. }
  231. },
  232. radioGroupChange(e){
  233. console.log(e)
  234. },
  235. checkboxChange(e) {
  236. if(this.CarNumber==true){
  237. this.CarNumber = false
  238. }else{
  239. this.CarNumber = true
  240. }
  241. },
  242. change(e) {
  243. console.log("e:", e);
  244. },
  245. successToast(msg) {
  246. this.$refs.uToast.show({
  247. title: msg,
  248. type: 'success',
  249. duration: 1000
  250. })
  251. },
  252. errorToast(msg) {
  253. this.$refs.uToast.show({
  254. title: msg,
  255. type: 'error',
  256. duration: 1000
  257. })
  258. },
  259. }
  260. }
  261. </script>
  262. <style lang="scss" scoped>
  263. .body {
  264. width: 100vw;
  265. height: 100vh;
  266. background-color: #f8f8f8f8;
  267. .header {
  268. width: 100vw;
  269. height: 13vh;
  270. background-color: white;
  271. box-sizing: border-box;
  272. display: flex;
  273. flex-direction: column;
  274. padding: 2vw;
  275. .headercon {
  276. width: 96vw;
  277. height: 13vh;
  278. display: flex;
  279. padding: 2vw;
  280. }
  281. .headerContent {
  282. display: flex;
  283. margin-top: 4vw;
  284. }
  285. }
  286. .content {
  287. width: 100vw;
  288. height: 70vh;
  289. box-sizing: border-box;
  290. padding: 0 2vw;
  291. border-radius: 5px;
  292. overflow: hidden;
  293. .contentInfo {
  294. width: 96vw;
  295. height: 70vh;
  296. box-sizing: border-box;
  297. padding: 2vw;
  298. background-color: white;
  299. border-radius: 10px;
  300. margin-top: 2vw;
  301. }
  302. }
  303. .button{
  304. width: 90vw;
  305. height: 10vw;
  306. margin-top: 10vw;
  307. background-color: red;
  308. line-height: 10vw;
  309. border-radius: 5vw;
  310. color: white;
  311. text-align: center;
  312. }
  313. }
  314. </style>