123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- import {
- request
- } from "../js/network/request";
- import {
- storageKey
- } from "./storageKey.js";
-
-
- //1.订单状态 2.车牌颜色 3.车型
- export function getLicensePlateColor(type, callBack) {
- let name = ''
- if (type === 2) {
- name = 'getLicensePlateColor'
- } else if (type === 3) {
- name = 'getLicensePlateType'
- }
- // let data = uni.getStorageSync(name)
- let data = []
-
- if (data && data.length > 0) {
- console.log('输出内容', data)
- callBack(data)
- } else {
- request('IF01001202212130849', {
- data: {
- 'codeType': type
- },
- showLoading: true
- }).then((res) => {
- console.log('输出内容', res.rd.rd)
- callBack(res.rd.rd)
- uni.setStorageSync(name, res.rd.rd)
- }).catch((error) => {
- console.log('错误提示', error)
- })
- }
- }
-
- //查询职业编号
- export function getOccupationNumber(callBack) {
- let getOccupationNumber = 'getOccupationNumber'
- let data = uni.getStorageSync(getOccupationNumber)
- if (data && data.length > 0) {
- console.log('输出内容', data)
- callBack(data)
- } else {
- let signChannel = uni.getStorageSync(storageKey.signChannel);
- console.log('输出内容signChannel', signChannel);
- var param = {};
- if(signChannel.channelCode == "10002") {
- // channelCode 版本 1-通用版 2-民生银行版
- param.version = 2;
- } else {
- param.version = 1;
- }
-
-
- request('IF01001202209190896', {
- data: param,
- showLoading: true
- }).then((res) => {
- console.log('输出内容', res.rd.data)
- callBack(res.rd.data)
- uni.setStorageSync(getOccupationNumber, res.rd.data)
- }).catch((error) => {
- console.log('错误提示', error)
- })
- }
- }
-
- /**
- * 车牌数字转车牌中文
- */
- export function getPlateColorText(num, successFun) {
- var vehicleColorStr;
- switch (num) {
- case 0:
- vehicleColorStr = "蓝色";
- successFun(vehicleColorStr);
- break;
- case 1:
- vehicleColorStr = "黄色";
- successFun(vehicleColorStr);
- break;
- case 2:
- vehicleColorStr = "黑色";
- successFun(vehicleColorStr);
- break;
- case 3:
- vehicleColorStr = "白色";
- successFun(vehicleColorStr);
- break;
- case 4:
- vehicleColorStr = "渐变绿色";
- successFun(vehicleColorStr);
- break;
- case 5:
- vehicleColorStr = "黄绿双拼色";
- successFun(vehicleColorStr);
- break;
- case 6:
- vehicleColorStr = "蓝白渐变色";
- successFun(vehicleColorStr);
- break;
- case 7:
- vehicleColorStr = "临时牌照";
- successFun(vehicleColorStr);
- break;
- case 9:
- vehicleColorStr = "未确定";
- successFun(vehicleColorStr);
- break;
- case 11:
- vehicleColorStr = "绿色";
- successFun(vehicleColorStr);
- break;
- case 12:
- vehicleColorStr = "红色";
- successFun(vehicleColorStr);
- break;
- default:
- vehicleColorStr = "未知";
- successFun(vehicleColorStr);
- break;
- }
- }
|