| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- const api = require('../../api/index.js');
- Page({
-
- data: {
- tabsindex:"1",
- },
- onLoad() {
- },
- // 选项卡
- onTabsChange(e){
- console.log(e.detail.value);
- this.setData({
- tabsindex:e.detail.value
- })
- this.getvehicle()
- },
- getvehicle(){
- let data ={
- carId:'',
- carType:'',
- carMondel:'',
- }
- api.request(`/syscar/selectcarall`, 'post',data,{ isPublic: false })
- .then((data) => {
- console.log(data.data);
- if (data.code==200) {
- this.setData({
- driver:data.data
- })
- }
- // wx.navigateTo({
- // url: '/pages/map/index',
- // })
- })
- .catch((err) => {
-
- console.error('请求失败:', err);
- });
- },
-
- onShow() {
- this.getvehicle()
-
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
-
- }
- });
|