sellCar.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <view class="body">
  3. <view class="content">
  4. <!-- 意向品牌 -->
  5. <view style="width: 85vw; height: 12vw; display: flex; border-bottom: 0.5px solid #f8f8f8;">
  6. <p style="display: flex;"><span style="color: red; line-height: 11vw;">*</span> <span
  7. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">我的品牌</span>
  8. </p>
  9. <view style="margin-left: 8vw; width: 50vw;">
  10. <uni-data-select v-model="value" :localdata="range" :clear="false" @change="change"></uni-data-select>
  11. </view>
  12. </view>
  13. <view style="width: 85vw; height: 12vw; display: flex; border-bottom: 0.5px solid #f8f8f8;" @click="LikeStore">
  14. <p style="display: flex;"><span style="color: red; line-height: 11vw;">*</span> <span
  15. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">意向门店</span> <input type="text"
  16. placeholder="请选择意向门店"
  17. v-model="storeName"
  18. style="font-size: 0.8rem; height: 10vw; line-height: 10vw; margin-left: 9vw; " /> </p>
  19. </view>
  20. <!-- 车型 -->
  21. <view style="width: 85vw; height: 12vw; display: flex; border-bottom: 0.5px solid #f8f8f8;">
  22. <p style="display: flex;"><span style="color: red; line-height: 11vw;">*</span> <span
  23. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">车型</span> <input type="text"
  24. placeholder="车型"
  25. v-model="Vehiclemodel"
  26. style="font-size: 0.8rem; width: 50vw; height: 10vw; line-height: 10vw; margin-left: 16vw; "
  27. > </p>
  28. </view>
  29. <!-- 电话 -->
  30. <view style="width: 85vw; height: 12vw; display: flex; border-bottom: 0.5px solid #f8f8f8;">
  31. <p style="display: flex;"><span style="color: red; line-height: 11vw;">*</span> <span
  32. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">联系方式</span> <input type="text"
  33. placeholder="联系方式"
  34. v-model="tel"
  35. style="font-size: 0.8rem; width: 50vw; height: 10vw; line-height: 10vw; margin-left: 9vw; "
  36. > </p>
  37. </view>
  38. <!-- 上牌日期 -->
  39. <view style="width: 85vw; height: 12vw; display: flex; border-bottom: 0.5px solid #f8f8f8;">
  40. <p style="display: flex;"><span style="color: red; line-height: 11vw;">*</span> <span
  41. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">上牌日期</span>
  42. <input type="text" placeholder="上牌日期"
  43. style="font-size: 0.8rem; width: 50vw; height: 10vw; line-height: 10vw; margin-left: 9vw; "
  44. v-model="upcarNumberData" @focus="timeFocus" />
  45. <u-picker mode="time" v-model="show" @confirm="confirm" @cancel="cancel"></u-picker>
  46. </p>
  47. </view>
  48. <!-- 行驶里程 -->
  49. <view style="width: 85vw; height: 12vw; display: flex; border-bottom: 0.5px solid #f8f8f8;">
  50. <p style="display: flex;"><span style="color: red; line-height: 11vw;">*</span> <span
  51. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">行驶里程</span> <input type="Numbber"
  52. placeholder="行驶里程"
  53. v-model="Mileagevalue"
  54. style="font-size: 0.8rem; width: 48vw; height: 10vw; line-height: 10vw; margin-left: 9vw; " />
  55. </p>
  56. <p style="display: flex; align-items: center; font-size: 0.8rem; color: gray;">
  57. 万公里
  58. </p>
  59. </view>
  60. <!-- 行驶里程 -->
  61. <view style="width: 85vw; height: 12vw; display: flex; border-bottom: 0.5px solid #f8f8f8;" @click="city">
  62. <p 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> <input type="text"
  64. placeholder="所在城市"
  65. v-model="areaValue"
  66. style="font-size: 0.8rem; width: 50vw; height: 10vw; line-height: 10vw; margin-left: 9vw; " />
  67. </p>
  68. </view>
  69. <!-- 备注说明 -->
  70. <view style="width: 85vw; height: 12vw; display: flex; border-bottom: 0.5px solid #f8f8f8;">
  71. <p style="display: flex;"><span style="color: red; line-height: 11vw;"></span> <span
  72. style="font-size: 0.8rem; line-height: 10vw; margin-left: 1vw;">备注说明</span> <input type="number"
  73. v-model="text"
  74. placeholder="请输入备注说明"
  75. style="font-size: 0.8rem; width: 50vw; height: 10vw; line-height: 10vw; margin-left: 6vw; " />
  76. </p>
  77. </view>
  78. <view class="button" @click="submit">提交</view>
  79. <u-toast ref="uToast" />
  80. <u-picker mode="region" v-model="showAred" @cancel="cancelAred" @confirm="confirmAred"
  81. :area-code='["13", "1303", "130304"]'></u-picker>
  82. </view>
  83. <!-- <view>
  84. <image src="../../static/liucheng.png"></image>
  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. data() {
  92. return {
  93. value: 0,
  94. Vehiclemodel:"",
  95. upcarNumberData:null,
  96. Mileagevalue:'',
  97. storeName:'',
  98. storeId:'',
  99. areaValue:'',
  100. range: [],
  101. showAred: false,
  102. carList: false,
  103. ageShow: false,
  104. time: '',
  105. tel:'',
  106. show: false,
  107. timeValue: Number(new Date()),
  108. text:'',
  109. jiantou: '../../static/xiajiantou.png',
  110. agejiantou: '../../static/xiajiantou.png',
  111. }
  112. },
  113. onLoad() {
  114. this.getBrandsList()
  115. },
  116. onShow(object) {
  117. if(object){
  118. this.storeName=object.name
  119. this.storeId=object.id
  120. }
  121. if(this.$db.get('tel')){
  122. this.tel=this.$db.get('tel')
  123. }
  124. },
  125. methods: {
  126. LikeStore(){
  127. uni.navigateTo({
  128. url:'/pages/index/storeList'
  129. })
  130. },
  131. submit(){
  132. if(!this.$db.get('token')){
  133. uni.navigateTo({
  134. url:'/pages/login/login'
  135. })
  136. return
  137. }
  138. this.$api.postUserdCar({shop:this.storeId,brand:this.value,tel:this.tel, model:this.Vehiclemodel,plate_date:this.upcarNumberData,area:this.areaValue,mileage:this.Mileagevalue,notes:this.text},res=>{
  139. if(res.code==0){
  140. this.successToast('操作成功')
  141. setTimeout(function(){
  142. uni.navigateBack({
  143. url:1
  144. })
  145. },1000)
  146. }else{
  147. this.errorToast('请输入必填项')
  148. }
  149. })
  150. },
  151. city() {
  152. this.showAred = true
  153. },
  154. change(e) {
  155. this.value=e.id
  156. },
  157. getBrandsList() {
  158. this.$api.getBrands(res => {
  159. if (res.code == 0) {
  160. this.range = res.data
  161. }
  162. })
  163. },
  164. confirmAred(e) {
  165. this.areaValue = e.province.label + e.city.label + e.area.label
  166. },
  167. cancelAred(e) {
  168. this.showAred = false
  169. },
  170. successToast(msg) {
  171. this.$refs.uToast.show({
  172. title: msg,
  173. type: 'success',
  174. duration: 1000
  175. })
  176. },
  177. errorToast(msg) {
  178. this.$refs.uToast.show({
  179. title: msg,
  180. type: 'error',
  181. duration: 1000
  182. })
  183. },
  184. timeFocus() {
  185. this.show = true
  186. },
  187. // 时间
  188. confirm(e) {
  189. this.upcarNumberData=e.year+'-'+e.month+'-'+e.day
  190. },
  191. cancel() {
  192. this.show = false
  193. },
  194. }
  195. }
  196. </script>
  197. <style scoped lang="scss">
  198. .body {
  199. width: 100vw;
  200. height: 100vh;
  201. background-color: #f8f8f8;
  202. display: flex;
  203. // flex-direction: column;
  204. justify-content: center;
  205. .content {
  206. width: 90vw;
  207. height: 50vh;
  208. background-color: white;
  209. border-radius: 15px;
  210. box-sizing: border-box;
  211. padding: 2vw;
  212. .carModel {
  213. width: 87vw;
  214. height: 80vw;
  215. border-radius: 5vw;
  216. background-color: white;
  217. border: 0.5px solid #dbddbd;
  218. top: 14vw;
  219. left: 5vw;
  220. overflow: auto;
  221. z-index: 99;
  222. }
  223. .carList {
  224. width: 85vw;
  225. line-height: 10vw;
  226. font-size: 0.85rem;
  227. height: 10vw;
  228. border-bottom: 0.5px solid #f8f8f8;
  229. color: grey;
  230. box-sizing: border-box;
  231. padding: 0 4vw;
  232. }
  233. .ageModel {
  234. width: 87vw;
  235. height: 80vw;
  236. border-radius: 5vw;
  237. z-index: 99;
  238. background-color: white;
  239. border: 0.5px solid #dbddbd;
  240. top: 43vw;
  241. left: 5vw;
  242. text-align: center;
  243. overflow: auto;
  244. }
  245. }
  246. .button {
  247. width: 85vw;
  248. height: 10vw;
  249. margin-top: 10vw;
  250. background-color: red;
  251. line-height: 10vw;
  252. border-radius: 5vw;
  253. color: white;
  254. text-align: center;
  255. }
  256. }
  257. </style>