页面修改

This commit is contained in:
THK3121 2023-08-31 10:44:45 +08:00
parent d401ac77fc
commit eae3be3381
12 changed files with 2200 additions and 1818 deletions

1
.gitignore vendored
View File

@ -3,6 +3,7 @@ node_modules
/dist /dist
.hbuilderx .hbuilderx
# local env files # local env files
.env.local .env.local
.env.*.local .env.*.local

View File

@ -1,28 +1,33 @@
import oahttp from "@/utils/oahttp.js";; import oahttp from "@/utils/oahttp.js";
import oahttp2 from "@/utils/logistics.js";
// http://logistics.lihaink.cn/api/getCarHistory
/** /**
* 车辆列表 * 车辆列表
*/ */
// https://worker-task.lihaink.cn/api/vehicle/addCar // /api/vehicle/townCompanyVehicleIndex
export const getvehicleListApi = (data) => oahttp.get('/vehicle/vehicleIndex', data) export const getvehicleListApi = (data) => oahttp.get('/vehicle/townCompanyVehicleIndex', data)
// 车辆详情 // 车辆详情
export const getvehicleDetailApi = (data) => oahttp.get('/courierLstData', data) export const getvehicleDetailApi = (data) => oahttp.get('/vehicle/vehicleInfo', data)
// 车辆上传 // 车辆上传
export const upVehicleApi = (data) => oahttp.post('/vehicle/addCar', data) export const upVehicleApi = (data) => oahttp.post('/vehicle/rentApply', data)
// 申请用车 // 申请用车
export const applycarApi = (data) => oahttp.post('/vehicle/addCar', data) export const applycarApi = (data) => oahttp.post('/vehicle/rentApply', data)
// 显示轨迹 // 显示轨迹
export const locusApi = (data) => oahttp.get('/courierLstData', data) export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data)
// 签约列表 // 签约列表
export const getAgencyListApi = (data) => oahttp.get('/courierLstData', data) export const getAgencyListApi = (data) => oahttp.get('/vehicle/rentApplyList', data)
// 签约公司详情 // 签约公司详情
export const getAgencyDetailApi = (data) => oahttp.get('/courierLstData', data) export const getAgencyDetailApi = (data) => oahttp.get('/vehicle/rentApplyInfo', data)
// 车辆租赁 // 车辆租赁
export const leaseApi = (data) => oahttp.post('/vehicle/setContractByTownCompany', data) export const leaseApi = (data) => oahttp.post('/vehicle/setContractByTownCompany', data)
// 生成合同 // 生成合同
export const contractApi = (data) => oahttp.get('/courierLstData', data) export const contractApi = (data) => oahttp.post('/vehicle/setContractByVillageCompany', data)
// 发送合同
export const sendcontractApi = (data) => oahttp.post('/vehicle/initiatingRentCarContract', data)
// 申请驳回 // 申请驳回
export const overruleApi = (data) => oahttp.get('/courierLstData', data) export const overruleApi = (data) => oahttp.post('/vehicle/rejectRentApply', data)
// 小组公司详情
export const villageCompanyApi = (data) => oahttp.get('/vehicle/villageCompanyIndex', data)
// 资产详情 // 资产详情
// export const getpropertyDetil = (data) => oahttp.get('/lstDetail', data) // export const getpropertyDetil = (data) => oahttp.get('/lstDetail', data)

View File

@ -110,7 +110,176 @@
} }
} }
}, },
"nativePlugins" : {} "nativePlugins" : {
"JG-JCore" : {
"JPUSH_APPKEY_ANDROID" : "5ced5ec5fa7bb86302944f0f",
"JPUSH_APPKEY_IOS" : "",
"JPUSH_CHANNEL_ANDROID" : "",
"JPUSH_CHANNEL_IOS" : "",
"__plugin_info__" : {
"name" : "极光推送 JCore 官方 SDK",
"description" : "极光推送 JCore 官方 SDK HBuilder 插件版本",
"platforms" : "Android,iOS",
"url" : "https://ext.dcloud.net.cn/plugin?id=4028",
"android_package_name" : "uni.UNIB5B1EDD",
"ios_bundle_id" : "uni.UNIB5B1EDD",
"isCloud" : true,
"bought" : 1,
"pid" : "4028",
"parameters" : {
"JPUSH_APPKEY_ANDROID" : {
"des" : "[Android]极光portal配置应用信息时分配的AppKey",
"key" : "JPUSH_APPKEY",
"value" : ""
},
"JPUSH_APPKEY_IOS" : {
"des" : "[iOS]极光portal配置应用信息时分配的AppKey",
"key" : "JCore:APP_KEY",
"value" : ""
},
"JPUSH_CHANNEL_ANDROID" : {
"des" : "[Android]用于统计分发渠道不需要可填默认值developer-default",
"key" : "JPUSH_CHANNEL",
"value" : ""
},
"JPUSH_CHANNEL_IOS" : {
"des" : "[iOS]用于统计分发渠道不需要可填默认值developer-default",
"key" : "JCore:CHANNEL",
"value" : ""
}
}
}
},
"JG-JPush" : {
"JPUSH_ADVERTISINGID_IOS" : "",
"JPUSH_DEFAULTINITJPUSH_IOS" : "",
"JPUSH_GOOGLE_API_KEY" : "",
"JPUSH_GOOGLE_APP_ID" : "",
"JPUSH_GOOGLE_PROJECT_ID" : "",
"JPUSH_GOOGLE_PROJECT_NUMBER" : "",
"JPUSH_GOOGLE_STORAGE_BUCKET" : "",
"JPUSH_HONOR_APPID" : "",
"JPUSH_HUAWEI_APPID" : "",
"JPUSH_ISPRODUCTION_IOS" : "",
"JPUSH_MEIZU_APPID" : "",
"JPUSH_MEIZU_APPKEY" : "",
"JPUSH_OPPO_APPID" : "",
"JPUSH_OPPO_APPKEY" : "",
"JPUSH_OPPO_APPSECRET" : "",
"JPUSH_VIVO_APPID" : "",
"JPUSH_VIVO_APPKEY" : "",
"JPUSH_XIAOMI_APPID" : "",
"JPUSH_XIAOMI_APPKEY" : "",
"__plugin_info__" : {
"name" : "极光推送 JPush 官方 SDK",
"description" : "极光推送JPush官方SDK HBuilder插件版本",
"platforms" : "Android,iOS",
"url" : "https://ext.dcloud.net.cn/plugin?id=4035",
"android_package_name" : "uni.UNIB5B1EDD",
"ios_bundle_id" : "uni.UNIB5B1EDD",
"isCloud" : true,
"bought" : 1,
"pid" : "4035",
"parameters" : {
"JPUSH_ADVERTISINGID_IOS" : {
"des" : "[iOS]广告标识符IDFA如果不需要使用IDFA可不填",
"key" : "JPush:ADVERTISINGID",
"value" : ""
},
"JPUSH_DEFAULTINITJPUSH_IOS" : {
"des" : "[iOS]是否默认初始化是填true不是填false或者不填",
"key" : "JPush:DEFAULTINITJPUSH",
"value" : ""
},
"JPUSH_GOOGLE_API_KEY" : {
"des" : "厂商google api_key,示例:g-12346578",
"key" : "google_api_key",
"value" : ""
},
"JPUSH_GOOGLE_APP_ID" : {
"des" : "厂商google mobilesdk_app_id,示例g-12346578",
"key" : "google_app_id",
"value" : ""
},
"JPUSH_GOOGLE_PROJECT_ID" : {
"des" : "厂商google project_id ,示例g-12346578",
"key" : "project_id",
"value" : ""
},
"JPUSH_GOOGLE_PROJECT_NUMBER" : {
"des" : "厂商google project_number,示例g-12346578",
"key" : "gcm_defaultSenderId",
"value" : ""
},
"JPUSH_GOOGLE_STORAGE_BUCKET" : {
"des" : "厂商google storage_bucket,示例g-12346578",
"key" : "google_storage_bucket",
"value" : ""
},
"JPUSH_HONOR_APPID" : {
"des" : "厂商HONOR-appId,示例12346578",
"key" : "com.hihonor.push.app_id",
"value" : ""
},
"JPUSH_HUAWEI_APPID" : {
"des" : "厂商HUAWEI-appId,示例appid=12346578",
"key" : "com.huawei.hms.client.appid",
"value" : ""
},
"JPUSH_ISPRODUCTION_IOS" : {
"des" : "[iOS]是否是生产环境是填true不是填false或者不填",
"key" : "JPush:ISPRODUCTION",
"value" : ""
},
"JPUSH_MEIZU_APPID" : {
"des" : "厂商MEIZU-appId,示例MZ-12345678",
"key" : "MEIZU_APPID",
"value" : ""
},
"JPUSH_MEIZU_APPKEY" : {
"des" : "厂商MEIZU-appKey,示例MZ-12345678",
"key" : "MEIZU_APPKEY",
"value" : ""
},
"JPUSH_OPPO_APPID" : {
"des" : "厂商OPPO-appId,示例OP-12345678",
"key" : "OPPO_APPID",
"value" : ""
},
"JPUSH_OPPO_APPKEY" : {
"des" : "厂商OPPO-appkey,示例OP-12345678",
"key" : "OPPO_APPKEY",
"value" : ""
},
"JPUSH_OPPO_APPSECRET" : {
"des" : "厂商OPPO-appSecret,示例OP-12345678",
"key" : "OPPO_APPSECRET",
"value" : ""
},
"JPUSH_VIVO_APPID" : {
"des" : "厂商VIVO-appId,示例12345678",
"key" : "com.vivo.push.app_id",
"value" : ""
},
"JPUSH_VIVO_APPKEY" : {
"des" : "厂商VIVO-appkey,示例12345678",
"key" : "com.vivo.push.api_key",
"value" : ""
},
"JPUSH_XIAOMI_APPID" : {
"des" : "厂商XIAOMI-appId,示例MI-12345678",
"key" : "XIAOMI_APPID",
"value" : ""
},
"JPUSH_XIAOMI_APPKEY" : {
"des" : "厂商XIAOMI-appKey,示例MI-12345678",
"key" : "XIAOMI_APPKEY",
"value" : ""
}
}
}
}
}
}, },
/* */ /* */
"quickapp" : {}, "quickapp" : {},

1187
pages.json

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,19 @@
<template> <template>
<view class="box"> <view class="box">
<view class="li" v-for="item,index in dataList" :key="index" @tap="navgo('/subpkg/property/chosseCompany')"> <view class="li" v-for="item,index in dataList" :key="index"
<view class="date"> @tap="navgo(`/subpkg/property/chosseCompany?id=${item.id}`)">
<!-- 2023.07.24 --> <view class="">
<!-- {{item.}} --> <view style="display: flex;justify-content: space-between;">
</view> <view class="">
<view class="text"> 签约申请
<!-- {{item.}} --> </view>
</view> <view class="">
<view class="detail"> 更多
<u-icon name="arrow-right"></u-icon> </view>
</view>
<view class="" style="margin-top: 20rpx;">
{{item.village_company_name}}提出租赁车辆一辆
</view>
</view> </view>
</view> </view>
</view> </view>
@ -17,12 +21,12 @@
<script> <script>
import { import {
getAgencyList, getAgencyListApi,
} from "@/api/property.js" } from "@/api/property.js"
export default { export default {
data() { data() {
return { return {
dataList: [1, 1, 1] dataList: []
} }
}, },
methods: { methods: {
@ -33,8 +37,8 @@
} }
}, },
onLoad() { onLoad() {
getAgencyList().then(res => { getAgencyListApi().then(res => {
// this.dataList=res this.dataList = res.data
}) })
} }
} }
@ -43,36 +47,12 @@
<style> <style>
.box { .box {
padding: 20rpx; padding: 20rpx;
}
.li {} .li {
padding: 10rpx;
.li { background-color: white;
background-color: #fff;
margin-bottom: 10rpx;
padding: 20rpx;
border-radius: 15rpx;
display: flex;
justify-content: space-between;
.date {
background-color: #FF7C32;
color: white;
padding: 0 10rpx;
border-radius: 15rpx; border-radius: 15rpx;
// width: 170rpx; margin-bottom: 10rpx;
}
.text {
// background-color: lightyellow;
max-width: 450rpx;
}
.detail {
// background-color: black;
// width: 50rpx;
} }
} }
</style> </style>

View File

@ -1,14 +1,15 @@
<template> <template>
<view class=""> <view class="">
<view class="date"> <view class="date">
2022年12月12日提出申请 <!-- 2022年12月12日提出申请 -->
{{dataList.create_time.slice(0,10)}} 提出申请
</view> </view>
<view class="cards"> <view class="cards">
<view class="cards_head"> <view class="cards_head">
<view class="cards_head_top"> <view class="cards_head_top">
<text><u--image src="../../static/img/company/company.png" width="33.29rpx" height="33.29rpx" <text><u--image src="../../static/img/company/company.png" width="33.29rpx" height="33.29rpx"
style="margin-right:20rpx"></u--image></text> style="margin-right:20rpx"></u--image></text>
<text>{item.company_name}</text> <text>{{dataList.village_company_name}}</text>
</view> </view>
<text @click="navTo('/subpkg/companySign/companySign?id=')">详情 <uni-icons type="forward" <text @click="navTo('/subpkg/companySign/companySign?id=')">详情 <uni-icons type="forward"
style="margin-left: 10rpx;" color="white"></uni-icons></text> style="margin-left: 10rpx;" color="white"></uni-icons></text>
@ -18,28 +19,20 @@
<view class="is_contract"> <view class="is_contract">
<view> <view>
<text>法人姓名 :</text> <text>法人姓名 :</text>
<text>{item.master_name}</text> <text>{{dataList.village_company_user}}</text>
</view> </view>
<view> <view>
<text style="color: green;" v-if="true">已签约</text> <text style="color: green;" v-if="true">已签约</text>
<text style="color: red;" v-else>未签约</text> <!-- <text style="color: red;" v-else>未签约</text> -->
</view> </view>
</view> </view>
<view class="is_contract">
<view>
<text>担任职务 :</text>
<text>{item.master_position}</text>
</view>
</view>
<view class="" @click="copyPhone()"> <view class="" @click="copyPhone()">
<text>联系电话 :</text> <text>联系电话 :</text>
<text>{item.master_phone}</text> <text>{{dataList.village_company_phone}}</text>
</view>
<view class="">
<text>负责区域 :</text>
<text> {item.city_name+item.area_name}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
@ -49,11 +42,11 @@
<text v-else>自有车辆</text> <text v-else>自有车辆</text>
</view> </view>
<view class="car_li" v-for="item,index in carList"> <view class="car_li" v-for="item,index in carList">
车牌号 川Y103D2 车牌号{{item.car_license}}
<view class="" style="float: right;display: flex;"> <view class="" style="float: right;display: flex;">
<text style="margin-right: 10rpx;">租赁车辆</text> <text style="margin-right: 10rpx;">租赁车辆</text>
<u-checkbox-group v-model="checked"> <u-checkbox-group v-model="checked">
<u-checkbox active-color="#0122C7" :label="item" :name="item" shape="square" <u-checkbox active-color="#0122C7" :label="id" :name="item" shape="square"
label=""></u-checkbox> label=""></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
</view> </view>
@ -61,30 +54,58 @@
</view> </view>
<view class="btns"> <view class="btns">
<u-button type="primary" @click="showPop=true" style="margin-bottom: 20rpx;width: 100%;" color="#FF7C32" <!-- 生成合同 -->
text="申请驳回"></u-button> <view class="" v-if="1">
<u-button type="primary" text="生成合同" @tap="contractFn" color="#0122C7"></u-button> <u-button :disabled="false" type="primary" @click="showPop=true"
style="margin-bottom: 20rpx;width: 100%;" color="#FF7C32" text="申请驳回"></u-button>
<u-button :disabled="false" type="primary" text="生成合同" @tap="contractFn" color="#0122C7"></u-button>
</view>
<!-- 审核中 -->
<view class="" v-if="0">
<u-button :disabled="true" type="primary" text="合同已上传,等待审核" @tap="contractFn" color="grey"></u-button>
</view>
<!-- 审核通过 -->
<view class="" v-if="0">
<view class="card">
<view class="contract">
<view class="left">
<image class="contract_img" src="../../static/img/contract/pdf.png"></image>
<view class="text">
<view class="name">入股合同</view>
<view>
<text>{{'2023-03-03'}}</text>
</view>
</view>
</view>
<view class="right" @click="navToContract('fdsf')">
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
<view>查看</view>
</view>
</view>
</view>
<u-button :disabled="false" type="primary" text="发送合同" @tap="sendcontractFn" color="#0122C7"></u-button>
</view>
</view> </view>
<view class=""> <view class="">
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true" <u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
title="请输入驳回理由"> title="请输入驳回理由">
<view class="slot-content"> <view class="slot-content">
<!-- <u--input placeholder="请输入内容" type="number" v-model="newCarNum"></u--input> -->
<u--textarea v-model="overruleValue" placeholder="请输入内容" class="textarea_cls"></u--textarea> <u--textarea v-model="overruleValue" placeholder="请输入内容" class="textarea_cls"></u--textarea>
</view> </view>
</u-modal> </u-modal>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { import {
getAgencyDetail, getAgencyDetailApi,
contractApi, contractApi,
overruleApi overruleApi,
sendcontractApi
} from "@/api/property.js" } from "@/api/property.js"
import { import {
Toast Toast
@ -92,30 +113,49 @@
export default { export default {
data() { data() {
return { return {
dataList: [], dataList: {},
overruleValue: "", overruleValue: "",
showPop: false, showPop: false,
checked: [], checked: [],
carList: [1, 2] carList: [1, 2]
} }
}, },
onLaunch() { onLoad() {
getAgencyDetail().then(res => { console.log(this.$route.query)
this.dataList = res // console.log(6565)
getAgencyDetailApi({
id: this.$route.query.id
}).then(res => {
// 13043214321
this.dataList = res.data.apply
this.carList = res.data.cars
}) })
}, },
methods: { methods: {
confirm() { confirm() {
// console.log(this.overruleValue) // console.log(this.overruleValue)
overruleApi().then(res => { overruleApi({
apply_id: this.dataList.id,
content: this.overruleValue,
}).then(res => {
Toast("操作成功") Toast("操作成功")
this.showPop = false this.showPop = false
}) })
}, },
contractFn() { contractFn() {
contractApi().then(res => { console.log(this.checked)
Toast("操作成功") contractApi({
apply_id: this.dataList.id,
car_id: this.checked[0].car_id
}).then(res => {
this.navTo('/subpkg/property/success')
}) })
this.navTo('/subpkg/property/success')
},
sendcontractFn() {
// sendcontractApi({
// id:
// })
}, },
navTo(url) { navTo(url) {
uni.navigateTo({ uni.navigateTo({
@ -132,6 +172,79 @@
padding: 10rpx 28rpx 0; padding: 10rpx 28rpx 0;
} }
.card {
margin: 28rpx;
width: 694rpx;
background-color: #fff;
border-radius: 14rpx;
.c_title {
color: #0022C7;
font-size: 32rpx;
font-weight: 500;
padding: 28rpx;
}
.c_body {
margin: 28rpx;
padding-bottom: 28rpx;
display: flex;
border-bottom: 1px solid #F3F4F8;
&:last-child {
border-bottom: none;
}
.icon {
width: 77rpx;
height: 77rpx;
flex-shrink: 0;
margin-right: 12rpx;
}
.body_text {
flex: 1;
font-size: 25rpx;
.b_title {
font-size: 32rpx;
color: #333;
font-weight: 500;
}
.b_text {
display: flex;
justify-content: space-between;
padding: 16rpx 0;
font-size: 28rpx;
.b_avatar {
width: 52rpx;
height: 52rpx;
margin-right: 8rpx;
}
&_left {
display: flex;
align-items: center;
}
&_right {
color: #F02828;
display: flex;
align-items: center;
font-size: 35rpx;
}
}
.b_time {
color: #666666;
}
}
}
}
.cards { .cards {
margin: 28rpx; margin: 28rpx;
width: 694rpx; width: 694rpx;

View File

@ -1,161 +1,186 @@
<template> <template>
<view class=""> <view class="" style="position: relative;">
<!-- 没有测含量 --> <view v-if='true'>
<view class="noCar" v-if='dataList.length==0'> <u-loading-page :loading="showLoading"></u-loading-page>
<!-- 申请 -->
<view class="" v-if="step==1">
<view class="">
你还没有所属车辆哦,请向镇公司申请用车或使用自有车辆并绑定系统
</view>
<view class="" style="margin: 20rpx 0;">
<u-button @tap="applycarFn" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
申请用车</u-button>
</view>
<view class="">
<u-button @tap="show=true" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
上传自有车辆</u-button>
</view>
<u-modal :show="show" @close="show=false" @confirm="upCarFn" :closeOnClickOverlay="true" title="车辆上传">
<view class="slot-content">
<u--input placeholder="请输入您的车牌号" v-model="carLicense"></u--input>
</view>
</u-modal>
</view>
<!-- 等待 -->
<view class="" v-if='step==2'>
<view class="">
您已上传自用车辆,系统正在审核中,请耐心等待
</view>
</view>
</view> </view>
<view v-else> <view class="" v-else>
<!-- <view class="serch"> <!-- 小组公司 -->
<u-search placeholder="输入车牌号进行搜索" :show-action="true" bg-color="white" v-model="keywords" @search="serchFn" <view class="noCar" v-if='company_type==18'>
@custom="serchFn"></u-search> <!-- 申请 -->
</view> --> <view class="" v-if="step==999">
<view class="info">
<text>可监管车辆数量 10</text>
<view @click="showPop=true" class="not_leased">
<view class=""> <view class="">
租赁 10 你还没有所属车辆哦,请向镇公司申请用车或使用自有车辆并绑定系统
</view> </view>
<view class="triangle-up" v-if="1"> <view class="" style="margin: 20rpx 0;">
<u-button @tap="applycarFn" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
申请用车</u-button>
</view> </view>
<view class="message_bottom" v-if="1"> <view class="">
可再租赁车辆:2 <u-button @tap="show=true" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
上传自有车辆</u-button>
</view>
<u-modal :show="show" @close="show=false" :showCancelButton="true" @confirm="upCarFn"
:closeOnClickOverlay="true" @cancel="show=false" title="车辆上传">
<view class="slot-content">
<u--input placeholder="请输入您的车牌号" v-model="carLicense"></u--input>
</view>
</u-modal>
</view>
<!-- 等待 -->
<view class="" v-if='step==-1'>
<!-- 上传自有车辆 -->
<view v-if="0">
<view class="loading">
<span>您已上传自用车辆,系统正在审核中,请耐心等待</span>
<span class="dots">...</span>
</view>
</view>
<!-- 申请用车 -->
<view v-else>
<view class="loading">
<span>你已提交用车申请后台正在加快处理中请耐心等待哦</span>
<span class="dots">...</span>
</view>
</view>
</view>
<!-- 审核结束 -->
<view class="" v-if="step==4">
<view class="">
你的申请于2022年12月12日被驳回
</view>
<view class="">
驳回理由:xxxxxxxxxx
</view>
<view class="">
请修改相应内容重新提交哦
</view>
<view class="">
<view class="" style="margin: 20rpx 0;">
<u-button @tap="applycarFn" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
申请用车</u-button>
</view>
<view class="">
<u-button @tap="show=true" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
上传自有车辆</u-button>
</view>
<u-modal :show="show" @close="show=false" @confirm="upCarFn" :closeOnClickOverlay="true"
title="车辆上传">
<view class="slot-content">
<u--input placeholder="请输入您的车牌号" v-model="carLicense"></u--input>
</view>
</u-modal>
</view> </view>
</view> </view>
<text>自有车辆 10</text>
</view> </view>
<!-- 公告栏 --> <!-- 镇街公司 -->
<view class="application_tit"> <view v-if='company_type==16'>
<view class="head" @click="navgo('/subpkg/property/agencyList')"> <view class="info">
<text>签约申请</text> <text>可监管车辆数量 {{datas.monitor_num}}</text>
<view style="display: flex;"> <view @click="showPop=true" class="not_leased">
<text>更多 </text> <view class="">
<u-icon name="arrow-right"></u-icon> 租赁 {{datas.rent_num}}
</view>
<view class="triangle-up" v-if="datas.can_rent_num">
</view>
<view class="message_bottom" v-if="datas.can_rent_num">
可再租赁车辆:{{datas.can_rent_num}}
</view>
</view> </view>
<text>自有车辆 {{datas.self_num}}</text>
</view> </view>
<view class="content"> <!-- 公告栏 -->
<view class="li" @click="navgo('/subpkg/property/chosseCompany')" <view class="application_tit">
v-for="item,index in applicationList.slice(0, 2)"> <view class="head" @click="navgo('/subpkg/property/agencyList')">
<view class="date"> <text>签约申请</text>
<!-- {{item.}} --> <view style="display: flex;">
</view> <text>更多 </text>
<view class="text">
<!-- {{item.}} -->
</view>
<view class="detail">
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</view> </view>
</view> </view>
<view class="content">
</view> <view class="li" @click="navgo(`/subpkg/property/chosseCompany?id=${item.id}`)"
</view> v-for="item,index in applicationList">
<view class="date">
<view v-if="true" class="personnel_list"> {{item.create_time.slice(0, 10)}}
<view v-if="dataList.length"> </view>
<view class="cards" v-for="item,index in dataList" :key="index" <view class="text">
@click="navgo('/subpkg/property/vehicle_a')"> {{item.village_company_name}}提出租赁车辆一台
<view class="cards_head"> </view>
<text><!-- {{item.}} --></text> <view class="detail">
<u-icon name="arrow-right"></u-icon>
</view>
</view> </view>
<view class="cards_content">
<view class="right"> </view>
<!-- 已出租 --> </view>
<view v-if="1"> <view class="personnel_list">
<view class="li"> <view>
<text>使用人: </text> <view class="cards" v-for="item,index in dataList" :key="index"
<text> <!-- {{item.}} --></text> @click="navgo(`/subpkg/property/vehicle_a?id=${item.car_id}`)">
<view style="float: right;"> <view class="cards_head">
<text style="color: green;" v-if="true">自有车辆</text> <text>{{item.car_license}}</text>
<text style="color: orange;" v-else>租赁车辆</text> </view>
<view class="cards_content">
<view class="right">
<!-- 已出租 -->
<view v-if="item.status==1">
<view class="li">
<text>使用人: </text>
<text> {{item.rent_company.master_name}}</text>
<view style="float: right;">
<text style="color: green;" v-if="item.type==1">自有车辆</text>
<text style="color: orange;" v-else>租赁车辆</text>
</view>
</view>
<view class="li">
<text>联系方式: </text>
<text>{{item.rent_company.master_phone}}</text>
</view>
<view class="li">
<text>所属公司: </text>
<text> {{item.rent_company.company_name}} </text>
</view>
<view class="li">
<text>签约时间: </text>
<text> {{item.rent_time}} </text>
</view> </view>
</view>
<view class="li">
<text>联系方式: </text>
<text><!-- {{item.}} --></text>
</view>
<view class="li">
<text>所属公司: </text>
<text> <!-- {{item.}} --> </text>
</view>
<view class="li">
<text>签约时间: </text>
<text> <!-- {{item.}} --> </text>
</view>
</view>
<!-- 未出租 -->
<view class="" v-else>
<view class="li">
<text>车牌号: </text>
<text> <!-- {{item.}} --></text>
<view style="float: right;">
<text style="color: green;" v-if="true">自有车辆</text>
<text style="color: orange;" v-else>租赁车辆</text>
</view>
</view> </view>
<view class="li"> <!-- 未出租 -->
暂未出租快去选择承租对象吧 <view class="" v-else>
<view class="li">
<text>车牌号: </text>
<text> {{item.car_license}}</text>
<view style="float: right;">
<text style="color: green;" v-if="item.type==1">自有车辆</text>
<text style="color: orange;" v-else>租赁车辆</text>
</view>
</view>
<view class="li">
暂未出租快去选择承租对象吧
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view v-if="dataList.length==0&&!isNewCheck"> <u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
<view class="empty"> :title="`请输入您需要租赁的车辆数量(上限为${datas.can_rent_num})`">
<!-- <view> <view class="slot-content">
当前没有可以签约的的车辆,快去签约新车吧! <u--input placeholder="请输入内容" type="number" v-model="newCarNum"></u--input>
</view> -->
<!-- <u-button @click="showPop=true" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
签约新车</u-button> -->
</view> </view>
</view> </u-modal>
<!-- <view style="padding: 0 60rpx;" v-if="isNewCheck">
你已发起租赁{{newCarNum}}两新车的申请,后台正在为您加急处理中,请稍后~~
</view> -->
</view> </view>
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
:title="`请输入您需要租赁的车辆数量(上限为${dataList[0]})`">
<view class="slot-content">
<u--input placeholder="请输入内容" type="number" v-model="newCarNum"></u--input>
</view>
</u-modal>
<!-- <u-modal @close="show=false" @cancel="show=false" @confirm="relieveFn" :show="show" :showCancelButton="true"
:showConfirmButton='true' :content='content'></u-modal> -->
</view> </view>
</view> </view>
</template> </template>
<script> <script>
@ -163,8 +188,12 @@
getvehicleListApi, getvehicleListApi,
getAgencyListApi, getAgencyListApi,
leaseApi, leaseApi,
upVehicleApi upVehicleApi,
getAgencyDetailApi,
getvehicleDetailApi,
villageCompanyApi
} from "@/api/property.js" } from "@/api/property.js"
import Cache from '@/utils/cache';
// import mybtn from "@/components/mybtn/mybtn.vue" // import mybtn from "@/components/mybtn/mybtn.vue"
import { import {
Toast Toast
@ -177,50 +206,99 @@
name: "vehicle", name: "vehicle",
data() { data() {
return { return {
showLoading: true,
company_type: "",
// 123
step: 1, step: 1,
applicationList: [1, 1], applicationList: [1],
// isNewCheck: true,
show: false, show: false,
carLicense: "", carLicense: "",
showPop: false, showPop: false,
datas: {},
dataList: [], dataList: [],
tabLists: [{
name: '未出租',
}, {
name: '已出租'
}, ],
curNow: 0,
keywords: "",
newCarNum: "", newCarNum: "",
newcarTit: "请输入您需要租赁的车辆数量(上限为2)" newcarTit: ""
}; };
}, },
onLoad() { onLoad() {
getvehicleListApi().then(res => { let type = (JSON.parse(Cache.get("USER_INFO")).company.company_type)
console.log(res) this.company_type = type
// this.getvehicleList = res //
}) if (type == 18) {
getAgencyListApi().then(res => { // getvehicleDetailApi().then(res => {})
// this.applicationList=res villageCompanyApi().then(res => {
this.showLoading = false
this.step = res.data.status || 999
console.log(res.data.cars_info.id)
switch (this.step) {
case 3:
uni.navigateTo({
url: `/subpkg/property/vehicle_a?type=2`
})
// this.step =
break;
default:
break;
}
}) })
}
//
else {
getvehicleListApi().then(res => {
this.datas = res.data
res.data.apply.length >= 2 ? this.applicationList = res.data.apply : this.applicationList = res
.data.apply.slice(0, 2)
this.applicationList = res.data.apply
this.dataList = res.data.car_list
this.showLoading = false
})
// getAgencyListApi().then(res => {
// this.applicationList = res.data
// })
}
// if (true) {
// uni.navigateTo({
// url: '/subpkg/property/vehicle_a'
// })
// }
// getvehicleListApi().then(res => {
// console.log(res)
// // this.getvehicleList = res
// })
// getAgencyListApi().then(res => {
// // this.applicationList=res
// })
}, },
methods: { methods: {
//
applycarFn() { applycarFn() {
upVehicleApi().then(res => {
Toast(res.msg)
})
this.step = 2 this.step = 2
}, },
//
upCarFn() { upCarFn() {
upVehicleApi({ upVehicleApi({
license: this.carLicense license: this.carLicense
}).then(res => { }).then(res => {
this.show = false this.show = false
this.step = 2
}) })
// upVehicleApi({
// license: this.carLicense
// }).then(res => {
// this.show = false
// })
console.log(this.carLicense) console.log(this.carLicense)
}, },
signFn() { signFn() {
@ -235,10 +313,6 @@
Toast(res.msg) Toast(res.msg)
}) })
this.showPop = false this.showPop = false
// this.isNewCheck = true
}, },
navgo(url) { navgo(url) {
@ -246,23 +320,50 @@
url url
}) })
}, },
sectionChange(index) {
this.curNow = index.index;
console.log(this.curNow)
// this.getOrderList()
},
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.serch { .dots {
margin: 28rpx 28rpx 0 28rpx; animation: loadingDots 1s infinite;
}
@keyframes loadingDots {
0% {
opacity: 0;
}
25% {
opacity: 0;
}
50% {
opacity: 1;
}
75% {
opacity: 1;
}
100% {
opacity: 0;
}
} }
.noCar { .noCar {
// background-color: red;
padding: 50rpx; padding: 50rpx;
margin-top: 30vh;
// position: absolute;
// width: 80vw;
// height: auto;
// position: absolute;
// top: 40vh;
// left: 50vw;
// transform: translate(-50%, -50%);
} }
.info { .info {
@ -316,13 +417,12 @@
background-color: #FF7C32; background-color: #FF7C32;
color: white; color: white;
padding: 0 10rpx; padding: 0 10rpx;
border-radius: 15rpx; border-radius: 15rpx // width: 170rpx;
// width: 170rpx;
} }
.text { .text {
// background-color: lightyellow; // background-color: lightyellow;
max-width: 450rpx; max-width: 400rpx;
white-space: nowrap; white-space: nowrap;
/* 让文本不换行 */ /* 让文本不换行 */

View File

@ -0,0 +1,69 @@
<template>
<view class="">
<view class="box">
<view class="">
<u--image :showLoading="true" src="/static/img/contract/ok_b.png" width="150rpx" height="150rpx"
mode="aspectFill">
</u--image>
</view>
<view class="info">
生成合同成功,等待风控部审核 <text class="dots">...</text>
</view>
</view>
</view>
</template>
<script>
</script>
<style lang="scss" scoped>
.box {
// background-color: red;
display: flex;
align-items: center;
flex-direction: column;
text-align: center;
margin-top: 30vh;
}
.info {
margin-top: 50rpx;
// font-size: 52.63rpx;
font-weight: bold;
}
.dots {
animation: loadingDots 1s infinite;
opacity: 0;
animation-delay: 0.2s;
}
@keyframes loadingDots {
0% {
opacity: 0;
}
25% {
opacity: 0;
}
50% {
opacity: 1;
}
75% {
opacity: 1;
}
100% {
opacity: 0;
}
}
</style>

View File

@ -1,175 +1,139 @@
<template> <template>
<view> <view>
<!-- 有车辆 --> <view class="content">
<view v-if="1"> <view :class="allMap?'map1':'map2'" style="position: relative;">
<view class="content"> <map :class="mapClass" id="map" :enable-zoom="true" :polyline="polyline" :markers='markers'
<view :class="allMap?'map1':'map2'" style="position: relative;"> :scale="scale" style="width:100%;height: 100%;" :latitude="markers[0].latitude"
<map :class="mapClass" id="map" :enable-zoom="true" :polyline="polyline" :markers='markers' :enable-scroll="true" :longitude="markers[0].longitude" @tap="allMap=!allMap">
:scale="scale" style="width:100%;height: 100%;" :latitude="markers[0].latitude" </map>
:enable-scroll="true" :longitude="markers[0].longitude" @tap="allMap=!allMap"> </view>
</map> <view v-if="!allMap">
</view> <view class="query">
<view v-if="!allMap"> <view class="ipt" @click="showDate=true">
<view class="query"> <text>{{queryData}}</text>
<!-- <u--input placeholder="请选择日期" suffixIcon="clock" class="ipt" border="surround" <u-icon name="clock" size="24"></u-icon>
v-model="queryData" @focus='fousFn'></u--input> -->
<view class="ipt" @click="showDate=true">
<text>{{queryData}}</text>
<u-icon name="clock" size="24"></u-icon>
</view>
<u-button type="primary" class='poline_btn' @click="showPloyline" text="显示轨迹"></u-button>
</view> </view>
<view class="personnel_list" @click="toDetail('/subpkg/property/vehicle')"> <u-button type="primary" class='poline_btn' @click="showPloyline" text="显示轨迹"></u-button>
<view class="cards"> </view>
<view class="cards_head"> <view class="personnel_list" @click="toDetail('/subpkg/property/vehicle')">
<text><!-- <!-- {{datas.}} --></text> <view class="cards">
</view> <view class="cards_head">
<view class="cards_content"> <text>{{datas.car_license}}</text>
<view class="right"> </view>
<view class="li"> <view class="cards_content">
<text>行驶总里程: </text> <view class="right">
<text> <!-- {{datas.}} --></text> <view class="li">
</view> <text>行驶总里程: {{datas.mileage}}</text>
<view class="li">
<text>本公司签约时间: </text> </view>
<text><!-- {{datas.}} --></text> <view class="li">
</view> <text>承租公司: </text>
<view class="li"> <text>{{datas.company.company_name}} </text>
<text>承租公司: </text> </view>
<text><!-- {{datas.}} --> </text> <view class="li">
</view> <text>负责人: </text>
<view class="li"> <text>{{datas.company.master_name}} </text>
<text>负责人: </text> </view>
<text><!-- {{datas.}} --> </text> <view class="li">
</view> <text>联系方式: </text>
<view class="li"> <text> {{datas.company.master_phone}} </text>
<text>联系方式: </text> </view>
<text> <!-- {{datas.}} --> </text> <view class="li">
</view> <text>所属区域: </text>
<view class="li"> <text> {{datas.company.area_name}}</text>
<text>所属区域: </text> </view>
<text> <!-- {{datas.}} --></text> <view class="li">
</view> <text>签约时间: </text>
<view class="li"> <text>{{datas.rent_time}} </text>
<text>签约时间: </text> </view>
<text><!-- {{datas.}} --> </text> <view class="li">
</view> <text>到期时间: </text>
<view class="li"> <text> {{datas.rent_time}} </text>
<text>到期时间: </text>
<text> <!-- {{datas.}} --> </text>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<u-calendar @close='showDate=false' color="#0122C7" :show="showDate" @confirm="dateFn"></u-calendar>
</view> </view>
<u-calendar @close='showDate=false' :minDate="minDate" :maxDate="maxDate" color="#0122C7" :show="showDate"
@confirm="dateFn"></u-calendar>
<!-- 没有车辆 -->
<!-- <view class="" v-else>
<view class="" v-if="!isMycar">
<view class="empty_car">
<view>
您还没有所属车辆哦,请等待镇公司发放车辆或使用自有车辆并绑定系统
</view>
<u-button @click="showPop=true" type="primary" class="btn_cls">
上传自有车辆</u-button>
</view>
<view class="">
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
title="请输入车牌号">
<view class="slot-content">
<u--input placeholder="请输入内容" v-model="myCarnum"></u--input>
</view>
</u-modal>
</view>
</view>
<view style="text-align: center;margin-top: 100rpx;" v-if="isMycar">
您上传自有车两,系统正在审核中,请耐心等待
</view>
</view>
-->
</view> </view>
</template> </template>
<script> <script>
import mybtn from "@/components/mybtn/mybtn.vue" import mybtn from "@/components/mybtn/mybtn.vue"
import { import {
getvehicleDetail, getvehicleDetailApi,
locusApi locusApi,
villageCompanyApi
} from "@/api/property.js" } from "@/api/property.js"
import { import {
Toast Toast
} from "../../libs/uniApi"; } from "../../libs/uniApi";
const d = new Date()
const year = d.getFullYear()
let month = d.getMonth() + 1
month = month < 10 ? `0${month}` : month
const date = d.getDate()
export default { export default {
components: { components: {
mybtn mybtn
}, },
data() { data() {
return { return {
minDate: `${year}-${month}-${date -30}`,
maxDate: `${year}-${month}-${date }`,
allMap: false, allMap: false,
showDate: false, showDate: false,
// isMycar: false,
showPop: false, showPop: false,
datas: {}, datas: {},
queryData: "请选择时间", queryData: "请选择时间",
// myCarnum: "",
mapClass: 'custom-map', mapClass: 'custom-map',
scale: 17, scale: 17,
markers: [ markers: [{
// id: 2,
{ latitude: 28.8733,
id: 1, longitude: 105.444828,
latitude: 28.8733, iconPath: '../../static/img/logistics/QS.png', //
longitude: 105.445717, }],
iconPath: '../../static/img/logistics/WZ.png', //
},
//
{
id: 2,
latitude: 28.8733,
longitude: 105.444828,
iconPath: '../../static/img/logistics/QS.png', //
}
],
polyline: [], polyline: [],
} }
}, },
onLoad(options) { onLoad(options) {
// getvehicleDetail().then(res => { if (this.$route.query.type) {
// this.datas = res villageCompanyApi().then(res => {
// }) this.datas = res.data
})
return
}
// console.log(this.$route.query.id)
getvehicleDetailApi({
car_id: this.$route.query.id
}).then(res => {
this.datas = res.data
console.log()
})
}, },
methods: { methods: {
dateFn(e) { dateFn(e) {
// console.log(e) // console.log(e)
this.queryData = e[0] this.queryData = e[0]
this.showDate = false this.showDate = false
}, },
// confirm() {
// if (this.myCarnum) {
// console.log(this.myCarnum)
// this.showPop = false
// this.isMycar = true
// }
// },
showPloyline() { showPloyline() {
// console.log(this.queryData) console.log(this.queryData)
return
// this.queryData // this.queryData
locusApi({
// car_id: 7,
// start_time: `${this.queryData} 00:00:00`,
// end_time: `${this.queryData} 23:59:59`,
car_id: 7,
end_time: '2023-08-29 23:59:59',
start_time: '2023-08-29 00:00:00',
}).then(res => {
console.log(res)
})
let points = [{ let points = [{
latitude: 28.916722, latitude: 28.916722,
longitude: 105.443274, longitude: 105.443274,
@ -192,8 +156,6 @@
}, },
}, },
onPullDownRefresh() { onPullDownRefresh() {
// this.getOrderList();
// this.getIndexList()
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, },

View File

@ -21,7 +21,7 @@ function baseRequestTwo(url, method, data, {
noAuth = false, noAuth = false,
noVerify = false noVerify = false
}) { }) {
let Url = "http://logistics.lihaink.cn", let Url = "https://logistics.lihaink.cn",
header = HEADER; header = HEADER;
if (!noAuth) { if (!noAuth) {
// 已经未登录了,禁止请求 // 已经未登录了,禁止请求
@ -49,7 +49,12 @@ function baseRequestTwo(url, method, data, {
// url: Url + '/api/v1' + url, // url: Url + '/api/v1' + url,
url: Url + '/api' + url, url: Url + '/api' + url,
method: method || 'GET', method: method || 'GET',
header: header, header: {
...header,
...{
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
}
},
data: method != 'GET' ? data || {} : {}, data: method != 'GET' ? data || {} : {},
params: method == 'GET' ? data : {}, params: method == 'GET' ? data : {},
success: (res) => { success: (res) => {

View File

@ -1,113 +1,118 @@
import { import {
HTTP_REQUEST_URL_THREE, HTTP_REQUEST_URL_THREE,
HEADER, HEADER,
TOKENNAME, TOKENNAME,
} from '@/config/app'; } from '@/config/app';
import { Toast } from '../libs/uniApi'; import {
Toast
} from '../libs/uniApi';
// import { checkLogin } from '../libs/login'; // import { checkLogin } from '../libs/login';
import store from '../store'; import store from '../store';
function toLogin() { function toLogin() {
uni.showToast({ uni.showToast({
title: '请先登录', title: '请先登录',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}); });
} }
function baseRequestTwo(url, method, data, { function baseRequestTwo(url, method, data, {
noAuth = false, noAuth = false,
noVerify = false noVerify = false
}) { }) {
let Url = HTTP_REQUEST_URL_THREE, let Url = HTTP_REQUEST_URL_THREE,
header = HEADER; header = HEADER;
if (!noAuth) { if (!noAuth) {
// 已经未登录了,禁止请求 // 已经未登录了,禁止请求
if (!store.state.config.request) return Promise.reject({ if (!store.state.config.request) return Promise.reject({
msg: '未登录' msg: '未登录'
}); });
//登录过期自动登录 //登录过期自动登录
if (!store.state.app.token) { if (!store.state.app.token) {
toLogin(); toLogin();
store.commit("SET_REQUEST", false); store.commit("SET_REQUEST", false);
return Promise.reject({ return Promise.reject({
msg: '未登录' msg: '未登录'
}); });
} }
} }
// if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token; // if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token;
if (store.state.app.token) header[TOKENNAME] = store.state.app.token; if (store.state.app.token) header[TOKENNAME] = store.state.app.token;
// header[TOKENNAME] = 'Bearer sdjflidshjgfkbdasgjmasbgvhauuiavhkesvndkaesbvkjsdbv'; // header[TOKENNAME] = 'Bearer sdjflidshjgfkbdasgjmasbgvhauuiavhkesvndkaesbvkjsdbv';
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {
// uni.showLoading({ // uni.showLoading({
// title: '加载中' // title: '加载中'
// }) // })
uni.request({ uni.request({
// url: Url + '/api/v1' + url, // url: Url + '/api/v1' + url,
url: Url + '/api' + url, url: Url + '/api' + url,
method: method || 'GET', method: method || 'GET',
header: header, header: {
data: method != 'GET' ? data || {} : {}, ...header,
params: method == 'GET' ? data : {}, ...{
success: (res) => { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
// uni.hideLoading() }
if (noVerify) },
// reslove(res.data, res); data: method != 'GET' ? data || {} : {},
reslove(res.data); params: method == 'GET' ? data : {},
else if (res.data.code == -1) { success: (res) => {
store.commit("LOGOUT"); // uni.hideLoading()
store.commit("SET_REQUEST", false); if (noVerify)
reject(res.data); // reslove(res.data, res);
} else if (res.data.code == 0) { reslove(res.data);
// uni.hideLoading(); else if (res.data.code == -1) {
uni.showToast({ store.commit("LOGOUT");
title: res.data.msg || '请检查网络', store.commit("SET_REQUEST", false);
icon: 'none', reject(res.data);
}) } else if (res.data.code == 0) {
reject(res.data); // uni.hideLoading();
} else if (res.data.code == 1){ uni.showToast({
store.commit("SET_REQUEST"); title: res.data.msg || '请检查网络',
reslove(res.data); icon: 'none',
} })
else if (res.data.code == 200){ reject(res.data);
store.commit("SET_REQUEST"); } else if (res.data.code == 1) {
reslove(res.data.data); store.commit("SET_REQUEST");
} reslove(res.data);
else if ([410000, 410001, 410002, 40000].indexOf(res.data.code) !== -1) { } else if (res.data.code == 200) {
toLogin(); store.commit("SET_REQUEST");
reject(res.data); reslove(res.data.data);
} else if (res.data.code == 501) { } else if ([410000, 410001, 410002, 40000].indexOf(res.data.code) !== -1) {
// uni.reLaunch({ toLogin();
// url: '/pages/error/index' reject(res.data);
// }) } else if (res.data.code == 501) {
reject(res.data); // uni.reLaunch({
} else { // url: '/pages/error/index'
// uni.hideLoading(); // })
uni.showToast({ reject(res.data);
title: res.data.msg || '请检查网络', } else {
icon: 'none' // uni.hideLoading();
}) uni.showToast({
reject(res.data.msg || '请检查网络'); title: res.data.msg || '请检查网络',
} icon: 'none'
}, })
fail: (message) => { reject(res.data.msg || '请检查网络');
// uni.hideLoading() }
uni.showToast({ },
title: '网络错误', fail: (message) => {
icon: 'none' // uni.hideLoading()
}) uni.showToast({
reject('请求失败'); title: '网络错误',
} icon: 'none'
}) })
}); reject('请求失败');
}
})
});
} }
const oahttp = {}; const oahttp = {};
['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => { ['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => {
oahttp[method] = (api, data, opt) => baseRequestTwo(api, method, data, opt || {}) oahttp[method] = (api, data, opt) => baseRequestTwo(api, method, data, opt || {})
}); });
export default oahttp; export default oahttp;