123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- var antmove_export = {};
- function indexOf(array, appointmentAuth, checkAuth, serivceAuth) {
- // var userMsg= wx.getStorageSync('userMsg')
- // 1预约权限;2审核权限;3会议服务权限
- if (array) {
- if (array.length == 2 && (appointmentAuth || checkAuth)) {
- return true;
- }
- if (array.indexOf(1) > -1) {
- if (appointmentAuth) {
- return true;
- } else {
- return false;
- }
- }
- if (array.indexOf(2) > -1) {
- if (checkAuth) {
- return true;
- } else {
- return false;
- }
- }
- if (array.indexOf(3) > -1) {
- if (serivceAuth) {
- return true
- } else {
- return false
- }
- }
- }
- }
- function indexOf1(array, value) {
- if (array) {
- if (array.indexOf(value) < 0) {
- return false;
- } else {
- return true;
- }
- }
- }
- function indexOf2(array, name, status, continueMeeting) {
- if (array) {
- if (array.indexOf(status) < 0) {
- return false;
- } else {
- var isTrue = true
- if (name == '会议续约') {
- continueMeeting ? isTrue = true : isTrue = false
- }
- return isTrue
- }
- }
- }
- function getVehicleType(id) {
- var drivingModelList = [{
- id: 1,
- name: 'A1'
- }, {
- id: 2,
- name: 'A2'
- }, {
- id: 3,
- name: 'A3'
- }, {
- id: 4,
- name: 'B1'
- }, {
- id: 5,
- name: 'B2'
- }, {
- id: 6,
- name: 'C1'
- }, {
- id: 7,
- name: 'C2'
- }, {
- id: 8,
- name: 'C3'
- }, {
- id: 9,
- name: 'C4'
- }, {
- id: 10,
- name: 'C5'
- }, {
- id: 11,
- name: 'D'
- }];
- var name = '';
- drivingModelList.forEach(function (item) {
- if (item.id == id) {
- name = item.name;
- }
- });
- return name;
- }
- function desensitization(string = "", start, end) {
- var star = '';
- function makeStar(number) {
- if (number > 0) {
- star += '*';
- return makeStar(--number);
- } else {
- return star;
- }
- }
- ;
- return string.substring(0, start) + makeStar(end - start) + string.substring(end);
- }
- antmove_export = {
- indexOf: indexOf,
- indexOf1: indexOf1,
- getVehicleType: getVehicleType,
- desensitization: desensitization,
- indexOf2: indexOf2,
- };
- export default antmove_export;
|