处理工单接口调整

master
chen 2022-04-13 20:36:32 +08:00
parent 487c8099a9
commit eb1c0ac14d
21 changed files with 1613 additions and 326 deletions

View File

@ -16,14 +16,16 @@
this.globalData.hostapi = 'https://7and5.cn'; this.globalData.hostapi = 'https://7and5.cn';
// #endif // #endif
// #ifdef H5 // #ifdef H5
this.globalData.hostapi = 'https://7and5.cn'; // this.globalData.hostapi = 'https://7and5.cn';
// this.globalData.hostapi = '/web'; this.globalData.hostapi = '/web';
// #endif // #endif
}, },
onShow: function() { onShow: function() {
// if(uni.getStorageSync('token')){ // if(uni.getStorageSync('token')){
// // token // token
// this.$toolAll.tools.refreshToken(); // this.$toolAll.tools.refreshToken();
//
this.$toolAll.tools.renewLocationEv();
// } // }
}, },
onHide: function() { onHide: function() {

23
jsFile/base64-png.js Normal file
View File

@ -0,0 +1,23 @@
const fsm = wx.getFileSystemManager();
const FILE_BASE_NAME = 'tmp_base64src'; //自定义文件名
function base64src(base64data, cb) {
const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64data) || [];
if (!format) {
return (new Error('ERROR_BASE64SRC_PARSE'));
}
const filePath = `${wx.env.USER_DATA_PATH}/${FILE_BASE_NAME}.${format}`;
const buffer = wx.base64ToArrayBuffer(bodyData);
fsm.writeFile({
filePath,
data: buffer,
encoding: 'binary',
success() {
cb(filePath);
},
fail() {
return (new Error('ERROR_BASE64SRC_WRITE'));
},
});
};
module.exports = base64src;

891
jsFile/map/qqmap-wx-jssdk.min.js vendored Normal file
View File

@ -0,0 +1,891 @@
var ERROR_CONF = {
KEY_ERR: 311,
KEY_ERR_MSG: 'key格式错误',
PARAM_ERR: 310,
PARAM_ERR_MSG: '请求参数信息有误',
SYSTEM_ERR: 600,
SYSTEM_ERR_MSG: '系统错误',
WX_ERR_CODE: 1000,
WX_OK_CODE: 200
};
var BASE_URL = 'https://apis.map.qq.com/ws/';
var URL_SEARCH = BASE_URL + 'place/v1/search';
var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion';
var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/';
var URL_CITY_LIST = BASE_URL + 'district/v1/list';
var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren';
var URL_DISTANCE = BASE_URL + 'distance/v1/';
var URL_DIRECTION = BASE_URL + 'direction/v1/';
var MODE = {
driving: 'driving',
transit: 'transit'
};
var EARTH_RADIUS = 6378136.49;
var Utils = {
safeAdd(x, y) {
var lsw = (x & 0xffff) + (y & 0xffff);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xffff)
},
bitRotateLeft(num, cnt) {
return (num << cnt) | (num >>> (32 - cnt))
},
md5cmn(q, a, b, x, s, t) {
return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b)
},
md5ff(a, b, c, d, x, s, t) {
return this.md5cmn((b & c) | (~b & d), a, b, x, s, t)
},
md5gg(a, b, c, d, x, s, t) {
return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t)
},
md5hh(a, b, c, d, x, s, t) {
return this.md5cmn(b ^ c ^ d, a, b, x, s, t)
},
md5ii(a, b, c, d, x, s, t) {
return this.md5cmn(c ^ (b | ~d), a, b, x, s, t)
},
binlMD5(x, len) {
x[len >> 5] |= 0x80 << (len % 32);
x[((len + 64) >>> 9 << 4) + 14] = len;
var i;
var olda;
var oldb;
var oldc;
var oldd;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
for (i = 0; i < x.length; i += 16) {
olda = a;
oldb = b;
oldc = c;
oldd = d;
a = this.md5ff(a, b, c, d, x[i], 7, -680876936);
d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586);
c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819);
b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897);
d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983);
a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063);
b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101);
c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510);
d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713);
b = this.md5gg(b, c, d, a, x[i], 20, -373897302);
a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691);
d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083);
c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335);
b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848);
a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438);
d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961);
b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784);
c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558);
d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556);
a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632);
b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174);
d = this.md5hh(d, a, b, c, x[i], 11, -358537222);
c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979);
b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189);
a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487);
d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835);
c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520);
b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651);
a = this.md5ii(a, b, c, d, x[i], 6, -198630844);
d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055);
a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523);
b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744);
c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070);
d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259);
b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551);
a = this.safeAdd(a, olda);
b = this.safeAdd(b, oldb);
c = this.safeAdd(c, oldc);
d = this.safeAdd(d, oldd)
}
return [a, b, c, d]
},
binl2rstr(input) {
var i;
var output = '';
var length32 = input.length * 32;
for (i = 0; i < length32; i += 8) {
output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff)
}
return output
},
rstr2binl(input) {
var i;
var output = [];
output[(input.length >> 2) - 1] = undefined;
for (i = 0; i < output.length; i += 1) {
output[i] = 0
}
var length8 = input.length * 8;
for (i = 0; i < length8; i += 8) {
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32)
}
return output
},
rstrMD5(s) {
return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8))
},
rstrHMACMD5(key, data) {
var i;
var bkey = this.rstr2binl(key);
var ipad = [];
var opad = [];
var hash;
ipad[15] = opad[15] = undefined;
if (bkey.length > 16) {
bkey = this.binlMD5(bkey, key.length * 8)
}
for (i = 0; i < 16; i += 1) {
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5c5c5c5c
}
hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8);
return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128))
},
rstr2hex(input) {
var hexTab = '0123456789abcdef';
var output = '';
var x;
var i;
for (i = 0; i < input.length; i += 1) {
x = input.charCodeAt(i);
output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f)
}
return output
},
str2rstrUTF8(input) {
return unescape(encodeURIComponent(input))
},
rawMD5(s) {
return this.rstrMD5(this.str2rstrUTF8(s))
},
hexMD5(s) {
return this.rstr2hex(this.rawMD5(s))
},
rawHMACMD5(k, d) {
return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d))
},
hexHMACMD5(k, d) {
return this.rstr2hex(this.rawHMACMD5(k, d))
},
md5(string, key, raw) {
if (!key) {
if (!raw) {
return this.hexMD5(string)
}
return this.rawMD5(string)
}
if (!raw) {
return this.hexHMACMD5(key, string)
}
return this.rawHMACMD5(key, string)
},
getSig(requestParam, sk, feature, mode) {
var sig = null;
var requestArr = [];
Object.keys(requestParam).sort().forEach(function(key) {
requestArr.push(key + '=' + requestParam[key])
});
if (feature == 'search') {
sig = '/ws/place/v1/search?' + requestArr.join('&') + sk
}
if (feature == 'suggest') {
sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk
}
if (feature == 'reverseGeocoder') {
sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk
}
if (feature == 'geocoder') {
sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk
}
if (feature == 'getCityList') {
sig = '/ws/district/v1/list?' + requestArr.join('&') + sk
}
if (feature == 'getDistrictByCityId') {
sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk
}
if (feature == 'calculateDistance') {
sig = '/ws/distance/v1/?' + requestArr.join('&') + sk
}
if (feature == 'direction') {
sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk
}
sig = this.md5(sig);
return sig
},
location2query(data) {
if (typeof data == 'string') {
return data
}
var query = '';
for (var i = 0; i < data.length; i++) {
var d = data[i];
if (!!query) {
query += ';'
}
if (d.location) {
query = query + d.location.lat + ',' + d.location.lng
}
if (d.latitude && d.longitude) {
query = query + d.latitude + ',' + d.longitude
}
}
return query
},
rad(d) {
return d * Math.PI / 180.0
},
getEndLocation(location) {
var to = location.split(';');
var endLocation = [];
for (var i = 0; i < to.length; i++) {
endLocation.push({
lat: parseFloat(to[i].split(',')[0]),
lng: parseFloat(to[i].split(',')[1])
})
}
return endLocation
},
getDistance(latFrom, lngFrom, latTo, lngTo) {
var radLatFrom = this.rad(latFrom);
var radLatTo = this.rad(latTo);
var a = radLatFrom - radLatTo;
var b = this.rad(lngFrom) - this.rad(lngTo);
var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(
radLatTo) * Math.pow(Math.sin(b / 2), 2)));
distance = distance * EARTH_RADIUS;
distance = Math.round(distance * 10000) / 10000;
return parseFloat(distance.toFixed(0))
},
getWXLocation(success, fail, complete) {
wx.getLocation({
type: 'gcj02',
success: success,
fail: fail,
complete: complete
})
},
getLocationParam(location) {
if (typeof location == 'string') {
var locationArr = location.split(',');
if (locationArr.length === 2) {
location = {
latitude: location.split(',')[0],
longitude: location.split(',')[1]
}
} else {
location = {}
}
}
return location
},
polyfillParam(param) {
param.success = param.success || function() {};
param.fail = param.fail || function() {};
param.complete = param.complete || function() {}
},
checkParamKeyEmpty(param, key) {
if (!param[key]) {
var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key + '参数格式有误');
param.fail(errconf);
param.complete(errconf);
return true
}
return false
},
checkKeyword(param) {
return !this.checkParamKeyEmpty(param, 'keyword')
},
checkLocation(param) {
var location = this.getLocationParam(param.location);
if (!location || !location.latitude || !location.longitude) {
var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误');
param.fail(errconf);
param.complete(errconf);
return false
}
return true
},
buildErrorConfig(errCode, errMsg) {
return {
status: errCode,
message: errMsg
}
},
handleData(param, data, feature) {
if (feature == 'search') {
var searchResult = data.data;
var searchSimplify = [];
for (var i = 0; i < searchResult.length; i++) {
searchSimplify.push({
id: searchResult[i].id || null,
title: searchResult[i].title || null,
latitude: searchResult[i].location && searchResult[i].location.lat || null,
longitude: searchResult[i].location && searchResult[i].location.lng || null,
address: searchResult[i].address || null,
category: searchResult[i].category || null,
tel: searchResult[i].tel || null,
adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null,
city: searchResult[i].ad_info && searchResult[i].ad_info.city || null,
district: searchResult[i].ad_info && searchResult[i].ad_info.district || null,
province: searchResult[i].ad_info && searchResult[i].ad_info.province || null
})
}
param.success(data, {
searchResult: searchResult,
searchSimplify: searchSimplify
})
} else if (feature == 'suggest') {
var suggestResult = data.data;
var suggestSimplify = [];
for (var i = 0; i < suggestResult.length; i++) {
suggestSimplify.push({
adcode: suggestResult[i].adcode || null,
address: suggestResult[i].address || null,
category: suggestResult[i].category || null,
city: suggestResult[i].city || null,
district: suggestResult[i].district || null,
id: suggestResult[i].id || null,
latitude: suggestResult[i].location && suggestResult[i].location.lat || null,
longitude: suggestResult[i].location && suggestResult[i].location.lng || null,
province: suggestResult[i].province || null,
title: suggestResult[i].title || null,
type: suggestResult[i].type || null
})
}
param.success(data, {
suggestResult: suggestResult,
suggestSimplify: suggestSimplify
})
} else if (feature == 'reverseGeocoder') {
var reverseGeocoderResult = data.result;
var reverseGeocoderSimplify = {
address: reverseGeocoderResult.address || null,
latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null,
longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null,
adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null,
city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city ||
null,
district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component
.district || null,
nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component
.nation || null,
province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component
.province || null,
street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component
.street || null,
street_number: reverseGeocoderResult.address_component && reverseGeocoderResult
.address_component.street_number || null,
recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult
.formatted_addresses.recommend || null,
rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses
.rough || null
};
if (reverseGeocoderResult.pois) {
var pois = reverseGeocoderResult.pois;
var poisSimplify = [];
for (var i = 0; i < pois.length; i++) {
poisSimplify.push({
id: pois[i].id || null,
title: pois[i].title || null,
latitude: pois[i].location && pois[i].location.lat || null,
longitude: pois[i].location && pois[i].location.lng || null,
address: pois[i].address || null,
category: pois[i].category || null,
adcode: pois[i].ad_info && pois[i].ad_info.adcode || null,
city: pois[i].ad_info && pois[i].ad_info.city || null,
district: pois[i].ad_info && pois[i].ad_info.district || null,
province: pois[i].ad_info && pois[i].ad_info.province || null
})
}
param.success(data, {
reverseGeocoderResult: reverseGeocoderResult,
reverseGeocoderSimplify: reverseGeocoderSimplify,
pois: pois,
poisSimplify: poisSimplify
})
} else {
param.success(data, {
reverseGeocoderResult: reverseGeocoderResult,
reverseGeocoderSimplify: reverseGeocoderSimplify
})
}
} else if (feature == 'geocoder') {
var geocoderResult = data.result;
var geocoderSimplify = {
title: geocoderResult.title || null,
latitude: geocoderResult.location && geocoderResult.location.lat || null,
longitude: geocoderResult.location && geocoderResult.location.lng || null,
adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null,
province: geocoderResult.address_components && geocoderResult.address_components.province ||
null,
city: geocoderResult.address_components && geocoderResult.address_components.city || null,
district: geocoderResult.address_components && geocoderResult.address_components.district ||
null,
street: geocoderResult.address_components && geocoderResult.address_components.street || null,
street_number: geocoderResult.address_components && geocoderResult.address_components
.street_number || null,
level: geocoderResult.level || null
};
param.success(data, {
geocoderResult: geocoderResult,
geocoderSimplify: geocoderSimplify
})
} else if (feature == 'getCityList') {
var provinceResult = data.result[0];
var cityResult = data.result[1];
var districtResult = data.result[2];
param.success(data, {
provinceResult: provinceResult,
cityResult: cityResult,
districtResult: districtResult
})
} else if (feature == 'getDistrictByCityId') {
var districtByCity = data.result[0];
param.success(data, districtByCity)
} else if (feature == 'calculateDistance') {
var calculateDistanceResult = data.result.elements;
var distance = [];
for (var i = 0; i < calculateDistanceResult.length; i++) {
distance.push(calculateDistanceResult[i].distance)
}
param.success(data, {
calculateDistanceResult: calculateDistanceResult,
distance: distance
})
} else if (feature == 'direction') {
var direction = data.result.routes;
param.success(data, direction)
} else {
param.success(data)
}
},
buildWxRequestConfig(param, options, feature) {
var that = this;
options.header = {
"content-type": "application/json"
};
options.method = 'GET';
options.success = function(res) {
var data = res.data;
if (data.status === 0) {
that.handleData(param, data, feature)
} else {
param.fail(data)
}
};
options.fail = function(res) {
res.statusCode = ERROR_CONF.WX_ERR_CODE;
param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg))
};
options.complete = function(res) {
var statusCode = +res.statusCode;
switch (statusCode) {
case ERROR_CONF.WX_ERR_CODE: {
param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
break
}
case ERROR_CONF.WX_OK_CODE: {
var data = res.data;
if (data.status === 0) {
param.complete(data)
} else {
param.complete(that.buildErrorConfig(data.status, data.message))
}
break
}
default: {
param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG))
}
}
};
return options
},
locationProcess(param, locationsuccess, locationfail, locationcomplete) {
var that = this;
locationfail = locationfail || function(res) {
res.statusCode = ERROR_CONF.WX_ERR_CODE;
param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg))
};
locationcomplete = locationcomplete || function(res) {
if (res.statusCode == ERROR_CONF.WX_ERR_CODE) {
param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg))
}
};
if (!param.location) {
that.getWXLocation(locationsuccess, locationfail, locationcomplete)
} else if (that.checkLocation(param)) {
var location = Utils.getLocationParam(param.location);
locationsuccess(location)
}
}
};
class QQMapWX {
constructor(options) {
if (!options.key) {
throw Error('key值不能为空')
}
this.key = options.key
};
search(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
if (!Utils.checkKeyword(options)) {
return
}
var requestParam = {
keyword: options.keyword,
orderby: options.orderby || '_distance',
page_size: options.page_size || 10,
page_index: options.page_index || 1,
output: 'json',
key: that.key
};
if (options.address_format) {
requestParam.address_format = options.address_format
}
if (options.filter) {
requestParam.filter = options.filter
}
var distance = options.distance || "1000";
var auto_extend = options.auto_extend || 1;
var region = null;
var rectangle = null;
if (options.region) {
region = options.region
}
if (options.rectangle) {
rectangle = options.rectangle
}
var locationsuccess = function(result) {
if (region && !rectangle) {
requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," +
result.longitude + ")";
if (options.sig) {
requestParam.sig = Utils.getSig(requestParam, options.sig, 'search')
}
} else if (rectangle && !region) {
requestParam.boundary = "rectangle(" + rectangle + ")";
if (options.sig) {
requestParam.sig = Utils.getSig(requestParam, options.sig, 'search')
}
} else {
requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance +
"," + auto_extend + ")";
if (options.sig) {
requestParam.sig = Utils.getSig(requestParam, options.sig, 'search')
}
}
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_SEARCH,
data: requestParam
}, 'search'))
};
Utils.locationProcess(options, locationsuccess)
};
getSuggestion(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
if (!Utils.checkKeyword(options)) {
return
}
var requestParam = {
keyword: options.keyword,
region: options.region || '全国',
region_fix: options.region_fix || 0,
policy: options.policy || 0,
page_size: options.page_size || 10,
page_index: options.page_index || 1,
get_subpois: options.get_subpois || 0,
output: 'json',
key: that.key
};
if (options.address_format) {
requestParam.address_format = options.address_format
}
if (options.filter) {
requestParam.filter = options.filter
}
if (options.location) {
var locationsuccess = function(result) {
requestParam.location = result.latitude + ',' + result.longitude;
if (options.sig) {
requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest')
}
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_SUGGESTION,
data: requestParam
}, "suggest"))
};
Utils.locationProcess(options, locationsuccess)
} else {
if (options.sig) {
requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest')
}
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_SUGGESTION,
data: requestParam
}, "suggest"))
}
};
reverseGeocoder(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
var requestParam = {
coord_type: options.coord_type || 5,
get_poi: options.get_poi || 0,
output: 'json',
key: that.key
};
if (options.poi_options) {
requestParam.poi_options = options.poi_options
}
var locationsuccess = function(result) {
requestParam.location = result.latitude + ',' + result.longitude;
if (options.sig) {
requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder')
}
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_GET_GEOCODER,
data: requestParam
}, 'reverseGeocoder'))
};
Utils.locationProcess(options, locationsuccess)
};
geocoder(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
if (Utils.checkParamKeyEmpty(options, 'address')) {
return
}
var requestParam = {
address: options.address,
output: 'json',
key: that.key
};
if (options.region) {
requestParam.region = options.region
}
if (options.sig) {
requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder')
}
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_GET_GEOCODER,
data: requestParam
}, 'geocoder'))
};
getCityList(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
var requestParam = {
output: 'json',
key: that.key
};
if (options.sig) {
requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList')
}
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_CITY_LIST,
data: requestParam
}, 'getCityList'))
};
getDistrictByCityId(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
if (Utils.checkParamKeyEmpty(options, 'id')) {
return
}
var requestParam = {
id: options.id || '',
output: 'json',
key: that.key
};
if (options.sig) {
requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId')
}
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_AREA_LIST,
data: requestParam
}, 'getDistrictByCityId'))
};
calculateDistance(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
if (Utils.checkParamKeyEmpty(options, 'to')) {
return
}
var requestParam = {
mode: options.mode || 'walking',
to: Utils.location2query(options.to),
output: 'json',
key: that.key
};
if (options.from) {
options.location = options.from
}
if (requestParam.mode == 'straight') {
var locationsuccess = function(result) {
var locationTo = Utils.getEndLocation(requestParam.to);
var data = {
message: "query ok",
result: {
elements: []
},
status: 0
};
for (var i = 0; i < locationTo.length; i++) {
data.result.elements.push({
distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i]
.lat, locationTo[i].lng),
duration: 0,
from: {
lat: result.latitude,
lng: result.longitude
},
to: {
lat: locationTo[i].lat,
lng: locationTo[i].lng
}
})
}
var calculateResult = data.result.elements;
var distanceResult = [];
for (var i = 0; i < calculateResult.length; i++) {
distanceResult.push(calculateResult[i].distance)
}
return options.success(data, {
calculateResult: calculateResult,
distanceResult: distanceResult
})
};
Utils.locationProcess(options, locationsuccess)
} else {
var locationsuccess = function(result) {
requestParam.from = result.latitude + ',' + result.longitude;
if (options.sig) {
requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance')
}
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_DISTANCE,
data: requestParam
}, 'calculateDistance'))
};
Utils.locationProcess(options, locationsuccess)
}
};
direction(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
if (Utils.checkParamKeyEmpty(options, 'to')) {
return
}
var requestParam = {
output: 'json',
key: that.key
};
if (typeof options.to == 'string') {
requestParam.to = options.to
} else {
requestParam.to = options.to.latitude + ',' + options.to.longitude
}
var SET_URL_DIRECTION = null;
options.mode = options.mode || MODE.driving;
SET_URL_DIRECTION = URL_DIRECTION + options.mode;
if (options.from) {
options.location = options.from
}
if (options.mode == MODE.driving) {
if (options.from_poi) {
requestParam.from_poi = options.from_poi
}
if (options.heading) {
requestParam.heading = options.heading
}
if (options.speed) {
requestParam.speed = options.speed
}
if (options.accuracy) {
requestParam.accuracy = options.accuracy
}
if (options.road_type) {
requestParam.road_type = options.road_type
}
if (options.to_poi) {
requestParam.to_poi = options.to_poi
}
if (options.from_track) {
requestParam.from_track = options.from_track
}
if (options.waypoints) {
requestParam.waypoints = options.waypoints
}
if (options.policy) {
requestParam.policy = options.policy
}
if (options.plate_number) {
requestParam.plate_number = options.plate_number
}
}
if (options.mode == MODE.transit) {
if (options.departure_time) {
requestParam.departure_time = options.departure_time
}
if (options.policy) {
requestParam.policy = options.policy
}
}
var locationsuccess = function(result) {
requestParam.from = result.latitude + ',' + result.longitude;
if (options.sig) {
requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction', options.mode)
}
wx.request(Utils.buildWxRequestConfig(options, {
url: SET_URL_DIRECTION,
data: requestParam
}, 'direction'))
};
Utils.locationProcess(options, locationsuccess)
}
};
module.exports = QQMapWX;

View File

@ -7,3 +7,23 @@ export function uploadImg(data) {
export function getPlanType(data) { export function getPlanType(data) {
return request.get("/universal/api.solution/solution_list", data); return request.get("/universal/api.solution/solution_list", data);
} }
// 更新用户地理位置
export function renewLocation(data) {
return request.post("/universal/api.user/update_location", data);
}
// 搜索客户、项目、备品
export function queryFun(data) {
return request.post("/universal/api.search/search", data);
}
// 处理工单,获取
export function handleWorkOrderGet(data) {
return request.get("/universal/api.order/process_order", data);
}
// 处理工单,提交
export function handleWorkOrderSubmit(data) {
return request.post("/universal/api.order/process_order", data);
}

View File

@ -1,5 +1,213 @@
const app = getApp(); const app = getApp();
import { renewLocation } from './public-api.js';
// 解决微信小程序
var QQMapWX = require('./map/qqmap-wx-jssdk.min.js');
var qqmapsdk = new QQMapWX({
key: 'QNHBZ-55RKF-OMFJJ-NPU7O-EPSDH-ACBAA'
});
// 解决H5跨域
const jsonp = function(url, data) {
return new Promise((resolve, reject) => {
// 1.初始化url
let dataString = url.indexOf('?') === -1 ? '?' : '&'
let callbackName = `jsonpCB_${ Date.now() }`;
url += `${ dataString }callback=${ callbackName }`
if(data) {
// 2.有请求参数依次添加到url
for(let k in data) {
url += `&${ k }=${ data[k] }`
}
}
let scriptNode = document.createElement('script');
scriptNode.src = url;
// 3. callback
window[callbackName] = (result) => {
result ? resolve(result) : reject('没有返回数据');
delete window[callbackName];
document.body.removeChild(scriptNode);
}
// 4. 异常情况
scriptNode.addEventListener('error', () => {
reject('接口返回数据失败');
delete window[callbackName];
document.body.removeChild(scriptNode);
}, false)
// 5. 开始请求
document.body.appendChild(scriptNode)
})
}
const tools = { const tools = {
// 更新用户地理位置
locationTimer:null,
// 每十分钟调用一次
renewLocationEv(){
this.platformEv();
clearInterval(this.locationTimer);
this.locationTimer = setInterval(()=>{
this.platformEv();
},600000)
},
// 平台判断
platformEv(){
// #ifdef APP-PLUS
this.getAddress();
// #endif
// #ifdef MP-WEIXIN
this.getAddressWx();
// #endif
// #ifdef H5
this.getAddressH5();
// #endif
},
// app获取经纬度和详细地址
getAddress(){
uni.getLocation({
type: 'gcj02',
geocode:true,
success: (res)=> {
// console.log(res,'地址信息');
let params = {
latitude:res.latitude,
longitude:res.longitude,
address:`${res.address.province}${res.address.city}${res.address.district || ''}${res.address.street || ''}${res.address.streetNum || ''}${res.address.poiName || ''}`
}
console.log(params,'APP');
this.renewAddressApi(params);
}
});
},
// 微信获取经纬度和详细地址
getAddressWx(){
uni.getLocation({
type: 'gcj02',
geocode:true,
success: (res)=> {
// console.log(res,'地址信息');
qqmapsdk.reverseGeocoder({
location: {latitude: res.latitude, longitude: res.longitude},
success:(res)=> {
// console.log(res,'WX');
let params = {
latitude:res.result.location.lat,
longitude:res.result.location.lng,
address:`${res.result.address}`
}
console.log(params,'WX');
this.renewAddressApi(params);
},
fail(err) {
console.log(err)
}
})
}
});
},
// h5
getAddressH5(){
uni.getLocation({
type: 'wgs84',
success: (res)=> {
uni.showLoading({
title: '加载中',
mask:true
});
let str = `output=jsonp&key=QNHBZ-55RKF-OMFJJ-NPU7O-EPSDH-ACBAA&location=${res.latitude},${res.longitude}`
jsonp('https://apis.map.qq.com/ws/geocoder/v1/?'+str,{}).then(res=>{
// console.log(res,'H5');
uni.hideLoading();
if(res.status == 0){
// that.locationName = res.result.address; //当前定位
let params = {
latitude:res.result.location.lat,
longitude:res.result.location.lng,
address:`${res.result.address}`
}
console.log(params,'H5');
this.renewAddressApi(params);
}
})
}
});
},
// 更新地址事件
renewAddressApi(params){
console.log(params,'最终提交参数');
// renewLocation(params).then(res=>{})
},
// 刷新token
refreshToken(){
console.log('进入检测token是否过期');
var date = new Date();
var timestamp = date.getTime();//精确到毫秒
// 如果过期时间 减 10分钟 小于当前时间刷新token
if((uni.getStorageSync('expire')*1000 - 600000) < timestamp) {
uni.login({
provider: 'weixin',
success: (res)=> {
if (res.code) {
var params = {code:res.code}
uni.request({
url: `${app.globalData.hostapi}/api/user/login`,
method: 'post',
data: params,
header: {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
},
success: res => {
if(res.data.data.token!=''){
uni.setStorageSync('token',res.data.data.token)//缓存token
uni.setStorageSync('openid',res.data.data.openid)//缓存Openid
uni.setStorageSync('expire',res.data.data.expire)//缓存失效时间(时间戳格式)
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
uni.setStorageSync('phone_active',res.data.data.phone_active)//是否绑定手机号
uni.setStorageSync('userId',res.data.data.account_id)//用户id
uni.setStorageSync('invite_code',res.data.data.invite_code)//邀请码
}
}
})
}
},
});
}
},
// 判断是否授权,没授权,前往登录页面授权
authTimer:null,
judgeAuth(){
let auth = false;
clearTimeout(this.authTimer);
if(!uni.getStorageSync('token')) {
this.showToast('请登录');
this.authTimer = setTimeout(()=>{
uni.navigateTo({url:'/pages/login/login'});
},2000)
} else {
auth = true;
}
return auth;
},
// 判断当前环境、清空日志、设置全局域名
currentContext(){
// #ifdef APP-PLUS
if(uni.getSystemInfoSync().platform != "devtools"){//devtools开发版 值域为ios、android、mac3.1.10+、windows3.1.10+、linux3.1.10+
// console.log = () =>{}
}
// #endif
// 微信小程序原生API性能优化
// #ifdef MP-WEIXIN
let hInfo = wx.getAccountInfoSync();
// console.log(hInfo.envVersion);//develop:开发版 trial体验版 release正式版
// if(hInfo.miniProgram.envVersion == "develop"){
if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){
} else {
// 清除所有输出日志
console.log = () =>{};
// 开启埋点倒计时
this.daoTime();//开启埋点倒计时
}
// #endif
},
timer:'', timer:'',
timerNot:'', timerNot:'',
// 埋点倒计时 // 埋点倒计时
@ -501,80 +709,6 @@ const tools = {
} }
return newTime; return newTime;
}, },
// 刷新token
refreshToken(){
console.log('进入检测token是否过期');
var date = new Date();
var timestamp = date.getTime();//精确到毫秒
// 如果过期时间 减 10分钟 小于当前时间刷新token
if((uni.getStorageSync('expire')*1000 - 600000) < timestamp) {
uni.login({
provider: 'weixin',
success: (res)=> {
if (res.code) {
var params = {code:res.code}
uni.request({
url: `${app.globalData.hostapi}/api/user/login`,
method: 'post',
data: params,
header: {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
},
success: res => {
if(res.data.data.token!=''){
uni.setStorageSync('token',res.data.data.token)//缓存token
uni.setStorageSync('openid',res.data.data.openid)//缓存Openid
uni.setStorageSync('expire',res.data.data.expire)//缓存失效时间(时间戳格式)
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
uni.setStorageSync('phone_active',res.data.data.phone_active)//是否绑定手机号
uni.setStorageSync('userId',res.data.data.account_id)//用户id
uni.setStorageSync('invite_code',res.data.data.invite_code)//邀请码
}
}
})
}
},
});
}
},
// 判断是否授权,没授权,前往登录页面授权
authTimer:null,
judgeAuth(){
let auth = false;
clearTimeout(this.authTimer);
if(!uni.getStorageSync('token')) {
this.showToast('请登录');
this.authTimer = setTimeout(()=>{
uni.navigateTo({url:'/pages/login/login'});
},2000)
} else {
auth = true;
}
return auth;
},
// 判断当前环境、清空日志、设置全局域名
currentContext(){
// #ifdef APP-PLUS
if(uni.getSystemInfoSync().platform != "devtools"){//devtools开发版 值域为ios、android、mac3.1.10+、windows3.1.10+、linux3.1.10+
// console.log = () =>{}
}
// #endif
// 微信小程序原生API性能优化
// #ifdef MP-WEIXIN
let hInfo = wx.getAccountInfoSync();
// console.log(hInfo.envVersion);//develop:开发版 trial体验版 release正式版
// if(hInfo.miniProgram.envVersion == "develop"){
if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){
} else {
// 清除所有输出日志
console.log = () =>{};
// 开启埋点倒计时
this.daoTime();//开启埋点倒计时
}
// #endif
},
// 禁止小程序使用分享 // 禁止小程序使用分享
disableShareEv(){ disableShareEv(){
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN

View File

@ -39,7 +39,11 @@
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ]
}, },
"ios" : {}, "ios" : {
"privacyDescription" : {
"NSLocationWhenInUseUsageDescription" : ""
}
},
/* ios */ /* ios */
"sdkConfigs" : { "sdkConfigs" : {
"maps" : { "maps" : {
@ -57,6 +61,9 @@
}, },
"push" : {}, "push" : {},
"geolocation" : { "geolocation" : {
"system" : {
"__platform__" : [ "ios", "android" ]
},
"baidu" : { "baidu" : {
"__platform__" : [ "ios", "android" ], "__platform__" : [ "ios", "android" ],
"appkey_ios" : "", "appkey_ios" : "",
@ -103,12 +110,14 @@
"sdkConfigs" : { "sdkConfigs" : {
"maps" : { "maps" : {
"qqmap" : { "qqmap" : {
"key" : "TMWBZ-XA3CD-HA74Y-PNUS4-SAV6Q-X7FXH" "key" : "QNHBZ-55RKF-OMFJJ-NPU7O-EPSDH-ACBAA"
} }
} }
}, },
"devServer" : { "devServer" : {
"https" : false, "https" : false,
"port" : 8080,
"disableHostCheck" : true,
"proxy" : { "proxy" : {
"/web" : { "/web" : {
"target" : "https://7and5.cn", "target" : "https://7and5.cn",

View File

@ -31,11 +31,18 @@
<input class="input" type="text" v-model="data.brand" value="" placeholder="请输入品牌" /> <input class="input" type="text" v-model="data.brand" value="" placeholder="请输入品牌" />
</view> </view>
<view class="li"> <view class="li">
<view class="title"> <view class="title flexs">
<text class="cor">*</text>产品尺寸 <text class="cor">*</text>产品尺寸
</view> </view>
<input class="input" type="text" v-model="data.width" placeholder="请填写产品尺寸 宽" /> <view class="disac fon26">
<input class="input" type="text" v-model="data.height" placeholder="请填写产品尺寸 高" /> <view class="disac">
<input class="input" style="width: 100rpx;" type="digit" v-model="data.width" placeholder="38.5" />
</view>
<view class="mar-y40 mar-z10">x</view>
<view class="disac">
<input class="input" style="width: 100%;" type="digit" v-model="data.height" placeholder="14.5" />
</view>
</view>
</view> </view>
</view> </view>
<view class="supplementTitle">补充信息</view> <view class="supplementTitle">补充信息</view>
@ -67,18 +74,18 @@
<textarea class="textarea" v-model="data.addres" placeholder="请输入详细地址" /> <textarea class="textarea" v-model="data.addres" placeholder="请输入详细地址" />
</view> </view>
<view class="scene-img"> <view class="scene-img dis">
<view class="title">现场图片</view> <view class="title flexs">现场图片</view>
<view class="img-content"> <view class="disac fw">
<image v-for="(item,index) in imgsrcArr" class="img" :src="item" :key="index" <view class="img-content" v-for="(item,index) in imgsrcArr" :key="index">
mode="aspectFill"></image> <image class="img mar-x10" :src="item" mode="aspectFill" lazy-load></image>
</view> </view>
<view class="iocn-content" @click="chooseImg()"> <view class="iocn-content flexs mar-x10" @click="chooseImg()">
<image class="icon" src="../../static/iocn/jia.png" mode=""></image> <image class="icon" src="../../static/iocn/jia.png" mode=""></image>
</view> </view>
</view> </view>
</view> </view>
</view>
<button class="submit-button" @click="submitData()" type="default">确认提交</button> <button class="submit-button" @click="submitData()" type="default">确认提交</button>
</view> </view>
@ -106,36 +113,21 @@
return { return {
data: { data: {
type_id: 1, type_id: 1,
title: "广场大屏显示器", title: "",
brand: "苹果", brand: "",
model: "IP445152", model: "",
width: 100, width: '',
height: 100, height: '',
contact_name: "张某", contact_name: "",
contact_phone: "17552525252", contact_phone: "",
appointment_time: '', appointment_time: '',
addres: "上海市闵行区莘浜路421号", addres: "",
pictures: "", pictures:''
}, },
pictures: [],
imgsrcArr: [], imgsrcArr: [],
typeIndex: 0, typeIndex: 0,
typeData: [{ typeData: []
title: '巡检',
state: false
},
{
title: '保养',
state: false
},
{
title: '移屏',
state: false
},
{
title: '拆屏',
state: false
},
]
} }
}, },
onLoad(op) { onLoad(op) {
@ -146,13 +138,12 @@
// //
typeIndexFun(index) { typeIndexFun(index) {
this.typeIndex = index this.typeIndex = index
this.data.type_id = this.typeData this.data.type_id = this.typeData[index].id;
}, },
getType() { getType() {
this.$requst.post('/universal/api.vas/vas_type', this.data).then(res => { this.$requst.post('/universal/api.vas/vas_type', this.data).then(res => {
if (res.code == 1) { if (res.code == 1) {
this.typeData = [...res.data] this.typeData = [...res.data]
console.log(this.typeData)
} else { } else {
} }
@ -164,7 +155,6 @@
// //
handleSubmit(e) { handleSubmit(e) {
// {year: "2019", month: "07", day: "17", hour: "15", minute: "21"} // {year: "2019", month: "07", day: "17", hour: "15", minute: "21"}
console.log(e)
this.data.appointment_time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`; this.data.appointment_time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`;
@ -175,7 +165,6 @@
count: 2, count: 2,
sourceType: ['album', 'camera'], sourceType: ['album', 'camera'],
success: (res) => { success: (res) => {
this.imgsrcArr = []
let imgsrc = res.tempFilePaths; let imgsrc = res.tempFilePaths;
imgsrc.forEach(item => { imgsrc.forEach(item => {
this.imgsrcArr.push(item); this.imgsrcArr.push(item);
@ -186,11 +175,7 @@
}).then(res => { }).then(res => {
if (res.code) { if (res.code) {
this.$toolAll.tools.showToast('上传成功'); this.$toolAll.tools.showToast('上传成功');
if (!this.data.pictures) { this.pictures.push(res.data.id);
this.data.pictures = res.data.id + ","
} else {
this.data.pictures += res.data.id
}
} }
}) })
} }
@ -199,6 +184,8 @@
}, },
// //
submitData() { submitData() {
this.data.pictures = this.pictures.join(',');
console.log(this.data.pictures);
if (!this.data.title) { if (!this.data.title) {
this.$toolAll.tools.showToast("请填写产品名称"); this.$toolAll.tools.showToast("请填写产品名称");
return return
@ -222,17 +209,18 @@
this.$toolAll.tools.showToast("请正确填写详细地址"); this.$toolAll.tools.showToast("请正确填写详细地址");
return return
} }
if (!this.data.pictures) { if (!this.pictures.length) {
this.$toolAll.tools.showToast("请选择现场图片"); this.$toolAll.tools.showToast("请选择现场图片");
return return
} }
console.log(this.data.appointment_time) this.data.appointment_time = new Date(this.data.appointment_time).getTime()/1000;
this.data.appointment_time = new Date(this.data.appointment_time).getTime()/1000 this.data.pictures = this.pictures.join(',');
this.data.width=this.data.width-0
this.data.height= this.data.height-0
this.$requst.post('/universal/api.vas/vas', this.data).then(res => { this.$requst.post('/universal/api.vas/vas', this.data).then(res => {
if (res.code == 1) { if (res.code) {
console.log(res) this.$toolAll.tools.showToast('提交成功');
setTimeout(()=>{
uni.navigateBack({delta:1})
},1000)
} else { } else {
} }
@ -384,7 +372,6 @@
} }
.scene-img { .scene-img {
display: flex;
margin-top: 27rpx; margin-top: 27rpx;
padding-bottom: 30rpx; padding-bottom: 30rpx;
} }
@ -397,12 +384,13 @@
.scene-img .img-content .img { .scene-img .img-content .img {
width: 170rpx; width: 170rpx;
height: 130rpx; height: 135rpx;
margin-right: 10rpx; margin-right: 10rpx;
vertical-align: middle;
} }
.scene-img .iocn-content { .scene-img .iocn-content {
width: 135rpx; width: 170rpx;
height: 135rpx; height: 135rpx;
background-color: #DCDCDC; background-color: #DCDCDC;
display: flex; display: flex;
@ -411,7 +399,6 @@
} }
.scene-img .iocn-content .icon { .scene-img .iocn-content .icon {
width: 62rpx; width: 62rpx;
height: 62rpx; height: 62rpx;

View File

@ -27,6 +27,7 @@
<script> <script>
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue'; import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
import statusNav from '../../components/status-nav.vue'; import statusNav from '../../components/status-nav.vue';
import {queryFun} from '../../jsFile/public-api.js';
export default { export default {
components: { components: {
statusNav, statusNav,
@ -80,9 +81,9 @@
], ],
} }
}, },
onLoad(option) { onLoad(op) {
console.log(option) //
console.log( option.key_word,"--------") this.queryFunEv();
}, },
methods: { methods: {
// //
@ -90,6 +91,14 @@
uni.navigateTo({ uni.navigateTo({
url:'/pages/dataQuery/details' url:'/pages/dataQuery/details'
}) })
},
//
queryFunEv(){
queryFun({type_id:1}).then(res=>{
if(res.code) {
}
})
} }
} }
} }

View File

@ -120,6 +120,7 @@
<script> <script>
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue'; import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
import statusNav from '../../components/status-nav.vue'; import statusNav from '../../components/status-nav.vue';
import {queryFun} from '../../jsFile/public-api.js';
export default { export default {
components: { components: {
statusNav, statusNav,
@ -130,9 +131,20 @@
} }
}, },
onLoad(op) {
//
this.queryFunEv();
},
methods: { methods: {
//
queryFunEv(){
queryFun({type_id:3}).then(res=>{
if(res.code) {
} }
})
}
}
} }
</script> </script>

View File

@ -40,6 +40,7 @@
<script> <script>
import statusNav from '../../components/status-nav.vue'; import statusNav from '../../components/status-nav.vue';
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue'; import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
import {queryFun} from '../../jsFile/public-api.js';
export default { export default {
components:{ components:{
containerSubgroupTwo, containerSubgroupTwo,
@ -117,19 +118,22 @@
], ],
} }
}, },
onLoad(op) {
//
this.queryFunEv();
},
methods: { methods: {
projectDetailsFun(){ projectDetailsFun(){
uni.navigateTo({ uni.navigateTo({
url:"/pages/dataQuery/projectDetails" url:"/pages/dataQuery/projectDetails"
}) })
}, },
// //
getData(){ queryFunEv(){
this.$requst.get('', { queryFun({type_id:2}).then(res=>{
page: dataPage.page, if(res.code) {
list_rows:dataPage.list_rows
}).then(res => {
}
}) })
}, },
bindPickerChange(data){ bindPickerChange(data){

View File

@ -27,8 +27,6 @@
</view> </view>
</view> </view>
</view> </view>
<view class="imgJCon"> <view class="imgJCon">
<image class="imgJ" src="../../static/iocn/jh.png" mode=""></image> <image class="imgJ" src="../../static/iocn/jh.png" mode=""></image>
</view> </view>
@ -194,7 +192,7 @@
] ]
uni.navigateTo({ uni.navigateTo({
url: `${urls[index]}?key_word='${this.key_word}'` url: `${urls[index]}?key_word=${this.key_word}`
}) })
}, },
// //

View File

@ -80,7 +80,6 @@
username: "", username: "",
fault_picture: "", fault_picture: "",
fault_describe: "", fault_describe: "",
images: "",
phone: "", phone: "",
visit_time: "" visit_time: ""
}, },
@ -142,7 +141,6 @@
this.imgsrcArr = [] this.imgsrcArr = []
let imgsrc = res.tempFilePaths; let imgsrc = res.tempFilePaths;
imgsrc.forEach(item => { imgsrc.forEach(item => {
this.data.images = item
this.imgsrcArr.push(item); this.imgsrcArr.push(item);
}) })

View File

@ -28,16 +28,16 @@
<view class="disjbac" style="padding: 60rpx 80rpx 60rpx 60rpx;"> <view class="disjbac" style="padding: 60rpx 80rpx 60rpx 60rpx;">
<view class="disac"> <view class="disac">
<!-- 用户头像 --> <!-- 用户头像 -->
<image class="flexs mar-y10 radius_100" @tap="replaceImg" :src="userInfo.avatar || '/static/public/icon-my-headimg.png'" mode="aspectFill" style="width: 91rpx;height: 91rpx;" lazy-load></image> <image class="flexs mar-y10 radius_100" @tap="replaceImg" :src="userHeadImg || '/static/public/icon-my-headimg.png'" mode="aspectFill" style="width: 91rpx;height: 91rpx;" lazy-load></image>
<view class="disjb fc" style="height: 91rpx;"> <view class="disjb fc" style="height: 91rpx;">
<!-- 用户手机号 --> <!-- 用户手机号 -->
<view class="fon34 bold">{{tel(userInfo.username)}}</view> <view class="fon34 bold">{{tel(userInfo.username)}}</view>
<!-- 是否实名认证 --> <!-- 是否实名认证 -->
<view class="fon22" style="color: #717171;">未实名认证</view> <view class="fon22" style="color: #717171;">{{ifAuthentication ? '已认证' : '未实名认证'}}</view>
</view> </view>
</view> </view>
<!-- 等级图标 --> <!-- 等级图标 -->
<image src="/static/public/icon-my-level.png" mode="aspectFill" <image v-if="ifAuthentication" src="/static/public/icon-my-level.png" mode="aspectFill"
style="width: 49rpx;height: 76rpx;" lazy-load></image> style="width: 49rpx;height: 76rpx;" lazy-load></image>
</view> </view>
<!-- 信用分项目数量未评价 --> <!-- 信用分项目数量未评价 -->
@ -159,12 +159,16 @@
title: '设置' title: '设置'
}, },
], ],
userInfo: {} userInfo: {},
ifAuthentication:false,//
userHeadImg:''//
} }
}, },
onShow() { onShow() {
if(this.userHeadImg=='') {
// //
this.checkInfo(); this.checkInfo();
}
}, },
onPageScroll(e) { onPageScroll(e) {
let navHeight = uni.getSystemInfoSync().statusBarHeight + 50; let navHeight = uni.getSystemInfoSync().statusBarHeight + 50;
@ -186,8 +190,8 @@
count: 1, count: 1,
sourceType:['album','camera'], sourceType:['album','camera'],
success: (res) => { success: (res) => {
this.userInfo.avatar = res.tempFilePaths[0]; this.userHeadImg = res.tempFilePaths[0];
// this.$requst.upload('/universal/api.user/avatar',{path:this.userInfo.avatar}).then(res=>{ // this.$requst.upload('/universal/api.user/avatar',{path:this.userHeadImg}).then(res=>{
// if(res.code) { // if(res.code) {
// // // //
// this.checkInfo(); // this.checkInfo();
@ -228,6 +232,7 @@
this.percentageList[0].num= this.userInfo.reserve_rate-0 this.percentageList[0].num= this.userInfo.reserve_rate-0
this.percentageList[1].num= this.userInfo.visit_rate-0 this.percentageList[1].num= this.userInfo.visit_rate-0
this.percentageList[2].num= this.userInfo.repair_rate-0 this.percentageList[2].num= this.userInfo.repair_rate-0
this.userHeadImg = this.userInfo.avatar;
} }
}) })
}, },

View File

@ -4,7 +4,7 @@
<view slot="leftContent" @tap="goMessage" style="width: 70px;"> <view slot="leftContent" @tap="goMessage" style="width: 70px;">
<view class="home-message-box posir disac"> <view class="home-message-box posir disac">
<image src="/static/public/icon-home-message.png" mode=""></image> <image src="/static/public/icon-home-message.png" mode=""></image>
<view v-if="messageNumber!=0">{{messageNumber}}</view> <view v-if="messageNumber">{{messageNumber}}</view>
</view> </view>
</view> </view>
<view slot="centerContent" class="disjcac"> <view slot="centerContent" class="disjcac">
@ -37,12 +37,12 @@
<view class="disjcac pad-sx20 bbot"> <view class="disjcac pad-sx20 bbot">
<view class="disjcac fc width50"> <view class="disjcac fc width50">
<view class="fon26 col9">项目总数</view> <view class="fon26 col9">项目总数</view>
<view class="fon60 bold">126</view> <view class="fon60 bold">{{project_count || 0}}</view>
</view> </view>
<view class="bleft" style="height: 90rpx;"></view> <view class="bleft" style="height: 90rpx;"></view>
<view class="disjcac fc width50"> <view class="disjcac fc width50">
<view class="fon26 col9">实时工单</view> <view class="fon26 col9">实时工单</view>
<view class="fon60 bold">116</view> <view class="fon60 bold">{{fault_count || 0}}</view>
</view> </view>
</view> </view>
<view class="disac pad-s30 pad-x10"> <view class="disac pad-s30 pad-x10">
@ -249,7 +249,7 @@
role: 2, // 1 2: 3: 4 role: 2, // 1 2: 3: 4
role: uni.getStorageSync('type_id'), // 1 2: 3: 4 role: uni.getStorageSync('type_id'), // 1 2: 3: 4
statusHeight: uni.getSystemInfoSync().statusBarHeight + 50, statusHeight: uni.getSystemInfoSync().statusBarHeight + 50,
messageNumber: 16 ,// messageNumber: 0 ,//
noticeList:[{id:1,title:'2021年11月06日公司团建维保服务暂停一天服务暂停一天服务暂停一天。一天服务暂停一天服务暂停一天。'}],// noticeList:[{id:1,title:'2021年11月06日公司团建维保服务暂停一天服务暂停一天服务暂停一天。一天服务暂停一天服务暂停一天。'}],//
// //
repairList:[ repairList:[
@ -317,8 +317,16 @@
], ],
// //
faultsList:[], faultsList:[],
locationstr:'',
contactPhone:'',//
project_count:0,//
fault_count:0,//
} }
}, },
onShow() {
//
this.checkHome();
},
onLoad(options) { onLoad(options) {
// url // url
this.$toolAll.tools.obtainUrl(); this.$toolAll.tools.obtainUrl();
@ -328,8 +336,30 @@
this.getIncrementServiceType(); this.getIncrementServiceType();
// //
this.getFaultsList(); this.getFaultsList();
}, },
methods: { methods: {
//
checkHome(){
this.$requst.get('/universal/api.home/home').then(res=>{
if(res.code) {
let homeObj = res.data;
this.messageNumber = homeObj.message;//
this.contactPhone = homeObj.contact;//
this.project_count = homeObj.project_count;//
this.fault_count = homeObj.fault_count;//
if(homeObj.notice.length) {
homeObj.notice.forEach(item=>{
let obj = {
id:1,
title:`${item.name}${item.content}`
}
this.noticeList.push(obj);
})
}
}
})
},
goNoticeDetail(e){ goNoticeDetail(e){
console.log(e); console.log(e);
}, },

View File

@ -11,6 +11,7 @@
</view> </view>
<swiper class="swiper" @change="swiperCurrentFun" :current="swiperCurrent" <swiper class="swiper" @change="swiperCurrentFun" :current="swiperCurrent"
:style="'height:'+swiHeight+'px'"> :style="'height:'+swiHeight+'px'">
<!-- 基础信息 start -->
<swiper-item> <swiper-item>
<view class="swiper-item uni-bg-red"> <view class="swiper-item uni-bg-red">
<view id="swi1"> <view id="swi1">
@ -18,68 +19,68 @@
<view class="state" :style="{backgroundColor: statusColor}">状态{{statusText}}</view> <view class="state" :style="{backgroundColor: statusColor}">状态{{statusText}}</view>
<view class="li" style="margin-top: 20rpx;"> <view class="li" style="margin-top: 20rpx;">
<view class="title">工单编号</view> <view class="title">工单编号</view>
<input type="text" disabled class="input" placeholder="" value="GD20211203-001" /> <input type="text" disabled class="input" :value="detailObj.order_number" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">项目编号</view> <view class="title">项目编号</view>
<input type="text" disabled class="input" placeholder="" value="GD20211203-001" /> <input type="text" disabled class="input" :value="detailObj.project_number" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">项目名称</view> <view class="title">项目名称</view>
<input type="text" disabled class="input input-black" placeholder="" value="湖南省林业科学院11楼会议室P2.5" /> <input type="text" disabled class="input input-black" :value="detailObj.project_name" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">产品类型</view> <view class="title">产品类型</view>
<input type="text" disabled class="input" placeholder="" value="Q2.5-E" /> <input type="text" disabled class="input" :value="detailObj.product_type" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">安装位置</view> <view class="title">安装位置</view>
<input type="text" disabled class="input" placeholder="" value="详细地址+某某栋11楼会议室" /> <input type="text" disabled class="input" :value="detailObj.installation_location" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">维保类型</view> <view class="title">维保类型</view>
<input type="text" class="input" placeholder="" value="供电不足" /> <input type="text" class="input" :value="detailObj.fault_type" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">紧急程度</view> <view class="title">紧急程度</view>
<input type="text" disabled class="input" placeholder="" value="紧急" /> <input type="text" disabled class="input" :value="detailObj.emergency_level_view" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">维保说明</view> <view class="title">维保说明</view>
<textarea auto-height disabled class="input" <textarea style="max-height: 260rpx;overflow: hidden;overflow-y: scroll;" disabled class="input" :value="detailObj.failure_description" />
value="*********************************************************************************************************"
placeholder="" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">维保图片</view> <view class="title">维保图片</view>
<view class="input"> <view class="input">
<image class="img" src="../../static/del/img001.png" mode="aspectFill" lazy-load></image> <image class="img" v-for="(item,index) in detailObj.fault_picture" :key="index" :src="item" mode="aspectFill" lazy-load></image>
<image class="img" src="../../static/del/img001.png" mode="aspectFill" lazy-load></image>
</view> </view>
</view> </view>
</view> </view>
<view class="work-order-from"> <view class="work-order-from">
<view class="li"> <view class="li">
<view class="title"> </view> <view class="title"> </view>
<input type="text" disabled class="input" placeholder="" value="林某" /> <input type="text" disabled class="input" :value="detailObj.order_contact" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">报单时间</view> <view class="title">报单时间</view>
<input type="text" disabled class="input" placeholder="" value="2021/12/3 12:00:05" /> <input type="text" disabled class="input" :value="detailObj.order_times" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">服务方式</view> <view class="title">服务方式</view>
<input type="text" disabled class="input input-black" placeholder="" value="上门服务" /> <input type="text" disabled class="input input-black" :value="detailObj.service_method_view" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">定位地址</view> <view class="title">定位地址</view>
<input type="text" disabled class="input" placeholder="" value="*******************************" /> <input type="text" disabled class="input" :value="detailObj.service_address" />
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
<!-- 基础信息 end -->
<!-- 处理详情 start -->
<swiper-item> <swiper-item>
<view class="swiper-item uni-bg-green"> <view class="swiper-item uni-bg-green">
<view id="swi2"> <view id="swi2">
@ -87,39 +88,39 @@
<view class="state" :style="{backgroundColor: statusColor}">状态{{statusText}}</view> <view class="state" :style="{backgroundColor: statusColor}">状态{{statusText}}</view>
<view class="li" style="margin-top: 20rpx;"> <view class="li" style="margin-top: 20rpx;">
<view class="title">开始时间</view> <view class="title">开始时间</view>
<input type="text" disabled class="input " placeholder="" value="2022-01-25 09:39" /> <input type="text" disabled class="input " :value="handleDetail.start_times" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">结束时间</view> <view class="title">结束时间</view>
<input type="text" disabled class="input " placeholder="" value="2022-01-25 15:30" /> <input type="text" disabled class="input " :value="handleDetail.completion_times" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">维保用时 </view> <view class="title">维保用时 </view>
<input type="text" disabled class="input input-black" placeholder="" value="5小时51分钟" /> <input type="text" disabled class="input input-black" :value="handleDetail.maintenance_time" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">维保费用</view> <view class="title">维保费用</view>
<input type="text" disabled class="input " placeholder="" value="¥500.00元" /> <input type="text" disabled class="input " :value="`¥${handleDetail.pay_price}元`" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">等待时长</view> <view class="title">等待时长</view>
<input type="text" disabled class="input " placeholder="" value="1天6小时35分钟" /> <input type="text" disabled class="input " :value="handleDetail.waiting_time" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">主维保人</view> <view class="title">主维保人</view>
<input type="text" disabled class="input " placeholder="" value="陈志远" /> <input type="text" disabled class="input " :value="handleDetail.maintenance_name" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">更换配件</view> <view class="title">更换配件</view>
<view class="rideo"> <view class="rideo">
<view class="isrideo"> <view class="isrideo">
<view class="icon " :class="isrideo?'on':''"> <view class="icon " :class="handleDetail.is_accessory == 1 ?'on':''">
<view class="icon-content"></view> <view class="icon-content"></view>
</view> </view>
<view class="fon24" style="color: #8b8b8b;"></view> <view class="fon24" style="color: #8b8b8b;"></view>
</view> </view>
<view class="isrideo"> <view class="isrideo">
<view class="icon" :class="isrideo?'':'on'"> <view class="icon" :class="handleDetail.is_accessory == 1 ?'':'on'">
<view class="icon-content"></view> <view class="icon-content"></view>
</view> </view>
<view class="fon24" style="color: #8b8b8b;"></view> <view class="fon24" style="color: #8b8b8b;"></view>
@ -128,40 +129,39 @@
</view> </view>
<view class="li"> <view class="li">
<view class="title">工作描述</view> <view class="title">工作描述</view>
<textarea auto-height disabled class="input " <textarea style="max-height: 260rpx;overflow: hidden;overflow-y: scroll;" disabled class="input " :value="handleDetail.work_explanation"/>
value="*********************************************************************************************************"
placeholder="" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">维保图片</view> <view class="title">维保图片</view>
<view class="input add-display"> <view class="input add-display">
<view class=""> <view class="">
<image class="img" src="../../static/del/img001.png" mode="aspectFill" lazy-load></image> <image class="img" v-for="(item,index) in handleDetail.maintenance_pictures" :key="index" :src="item" mode="aspectFill" lazy-load></image>
<image class="img" src="../../static/del/img001.png" mode="aspectFill" lazy-load></image>
</view> </view>
</view> </view>
</view> </view>
<view class="li"> <view class="li">
<view class="title">维保原因</view> <view class="title">维保原因</view>
<textarea auto-height disabled class="input " <textarea auto-height disabled class="input " :value="handleDetail.failure_reason"/>
value="*********************************************************************************************************"
placeholder="" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">维保人员 </view> <view class="title">维保人员 </view>
<input type="text" disabled class="input " placeholder="" value="罗帅 陈志远" /> <input type="text" disabled class="input " :value="handleDetail.maintenance_more" />
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
<!-- 处理详情 end -->
<!-- 更换配件 start -->
<swiper-item> <swiper-item>
<view class="swiper-item uni-bg-blue"> <view class="swiper-item uni-bg-blue">
<view id="swi3"> <view id="swi3">
<view class="change-accessory"> <view class="change-accessory">
<view class="state" :style="{backgroundColor: statusColor}">状态{{statusText}}</view> <view class="state" :style="{backgroundColor: statusColor}">状态{{statusText}}</view>
<view class="list"> <view class="list">
<view class="li"> <view class="li" v-for="(item,index) in replaceParts" :key="index">
<image class="img" src="../../static/del/img001.png" mode="aspectFill" lazy-load></image> <image class="img" src="../../static/del/img001.png" mode="aspectFill" lazy-load></image>
<view class="text-content"> <view class="text-content">
<view class="title"> <view class="title">
@ -203,35 +203,38 @@
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
<!-- 更换配件 end -->
<!-- 处理过程 start -->
<swiper-item> <swiper-item>
<view class="swiper-item uni-bg-blue"> <view class="swiper-item uni-bg-blue">
<view id="swi4"> <view id="swi4">
<view class="course-nav"> <view class="course-nav">
<view class="state" :style="{backgroundColor: statusColor}">状态{{statusText}}</view> <view class="state" :style="{backgroundColor: statusColor}">状态{{statusText}}</view>
<view class="date">报修时间2022年02月10日</view> <view class="date">报修时间{{handleProcess.order_times}}</view>
<view class="code"> <view class="code">
<view class="">工单编号1254635996212345</view> <view class="">工单编号{{handleProcess.order_number}}</view>
<view class="btn" @click="copy('1254635996212345')"></view> <view class="btn" @click="copy(handleProcess.order_number)"></view>
</view> </view>
</view> </view>
<view class="course-content"> <view class="course-content">
<view class="record-content"> <view class="record-content">
<view class="title">过程追踪</view> <view class="title">过程追踪</view>
<view class="list"> <view class="list">
<view class="li pad-z40 fon27 col9 pad-x20" :class="index==0 ? 'activeTrack' : ''" v-for="(item,index) in 10" :key="index"> <view class="li pad-z40 fon27 col9 pad-x20" :class="index==0 ? 'activeTrack' : ''" v-for="(item,index) in handleProcess.time_line" :key="index">
<view class="disac fw line-h40"> <view class="disac fw line-h40">
<view class="text">部分模组不显示维保陈志远已处理</view> <view class="text">{{item.value}}</view>
<view class="date">2020-05-15 16:00</view> <view class="date">{{item.create_time}}</view>
</view> </view>
</view> </view>
</view> </view>
<view class="button" @tap="goEvaluate()"></view>
</view> </view>
<view class="button" @tap="goEvaluate(1)"></view>
</view> </view>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
<!-- 处理过程 end -->
</swiper> </swiper>
</view> </view>
</container-subgroup-two> </container-subgroup-two>
@ -243,6 +246,7 @@
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue'; import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
import statusNav from '../../components/status-nav.vue'; import statusNav from '../../components/status-nav.vue';
import footTabOne from "../../components/foot-tabs/foot-tab-one.vue" import footTabOne from "../../components/foot-tabs/foot-tab-one.vue"
import {handleWorkOrderGet} from '../../jsFile/public-api.js';
export default { export default {
components: { components: {
footTabOne, footTabOne,
@ -274,7 +278,11 @@
}, },
], ],
orderId:'',//id
detailObj:{},//
handleDetail:{},//
replaceParts:[],//
handleProcess:{}//
} }
}, },
mounted() { mounted() {
@ -286,11 +294,46 @@
}, },
onLoad(op) { onLoad(op) {
console.log(op,333);
this.statusText = op.statusText; this.statusText = op.statusText;
this.statusColor = op.statusColor; this.statusColor = op.statusColor;
if(op.orderId!=undefined) {
this.orderId = op.orderId;
//
this.getDetail(1);
}
}, },
methods: { methods: {
//
getDetail(type){
let params = {
order_id:this.orderId,
type
}
this.$requst.get('/universal/api.order/order_info',params).then(res=>{
if(res.code) {
switch (type){
case 1:
this.detailObj = res.data;
break;
case 2:
this.handleDetail = res.data;
break;
case 3:
this.replaceParts = res.data.accessory;
break;
case 4:
this.handleProcess = res.data;
break;
}
setTimeout(()=>{
const query = uni.createSelectorQuery().in(this);
query.select(`#swi${type}`).boundingClientRect(data => {
this.swiHeight = data.height
}).exec();
},100)
}
})
},
isrideoFun(is) { isrideoFun(is) {
this.isrideo = is this.isrideo = is
}, },
@ -312,37 +355,11 @@
} }
}); });
}, },
swiperCurrentFun(data) { swiperCurrentFun(data) {
let current = data.detail.current;
console.log(data.detail.current) //
this.detailSwitch(current);
if (data.detail.current == 0) { this.detailsNavFun(current);
const query = uni.createSelectorQuery().in(this);
query.select('#swi1').boundingClientRect(data => {
this.swiHeight = data.height
}).exec();
} else if (data.detail.current == 1) {
const query = uni.createSelectorQuery().in(this);
query.select('#swi2').boundingClientRect(data => {
this.swiHeight = data.height
}).exec();
} else if (data.detail.current == 2) {
const query = uni.createSelectorQuery().in(this);
query.select('#swi3').boundingClientRect(data => {
this.swiHeight = data.height
}).exec();
} else if (data.detail.current == 3) {
const query = uni.createSelectorQuery().in(this);
query.select('#swi4').boundingClientRect(data => {
this.swiHeight = data.height
}).exec();
}
this.detailsNavFun(data.detail.current)
}, },
detailsNavFun(index) { detailsNavFun(index) {
for (var i = 0; i < this.detailsNav.length; i++) { for (var i = 0; i < this.detailsNav.length; i++) {
@ -351,12 +368,19 @@
this.detailsNav[index].state = true this.detailsNav[index].state = true
}, },
detailsNavpa(index) { detailsNavpa(index) {
this.swiperCurrent = index this.swiperCurrent = index;
//
this.detailSwitch(index);
},
//
detailSwitch(index){
let type = [1,2,3,4][index];
this.getDetail(type);
}, },
// //
goEvaluate(id) { goEvaluate() {
uni.navigateTo({ uni.navigateTo({
url:`/pagesB/i-want-evaluate/i-want-evaluate?id=${id}` url:`/pagesB/i-want-evaluate/i-want-evaluate?id=${this.orderId}`
}) })
} }
@ -504,7 +528,7 @@ white-space: nowrap;
.course-content { .course-content {
background-color: #FFFFFF; background-color: #FFFFFF;
padding-bottom: 60rpx; padding-bottom: 20rpx;
margin-top: 20rpx; margin-top: 20rpx;
padding-top: 20rpx; padding-top: 20rpx;
} }
@ -597,7 +621,7 @@ white-space: nowrap;
text-align: center; text-align: center;
line-height: 88rpx; line-height: 88rpx;
margin: auto; margin: auto;
margin-top: 101rpx; margin-top: 50rpx;
color: #FFFFFF; color: #FFFFFF;
} }

View File

@ -90,6 +90,7 @@
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue'; import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
import statusNav from '../../components/status-nav.vue'; import statusNav from '../../components/status-nav.vue';
import footTabOne from "../../components/foot-tabs/foot-tab-one.vue" import footTabOne from "../../components/foot-tabs/foot-tab-one.vue"
import {handleWorkOrderGet,handleWorkOrderSubmit} from '../../jsFile/public-api.js';
export default { export default {
components: { components: {
footTabOne, footTabOne,
@ -131,18 +132,29 @@
uni.removeStorageSync('targetObj'); uni.removeStorageSync('targetObj');
}, },
onLoad(op) { onLoad(op) {
this.checkInfoSignIn(op.id); if(op.id!=undefined) {
this.orderId = op.id;
this.handleWorkOrderGet(this.orderId);
}
}, },
methods: { methods: {
// //
checkInfoSignIn(id){ handleWorkOrderGet(id){
let params = { let params = {
order_id:3, order_id:id,
steps:1, steps:1
start_address:'四川省成都市成华区' }
handleWorkOrderGet(params).then(res=>{
if(res.code) {
let dataObj = res.data;
this.targetObj.workOrderNo = dataObj.order_number;//
this.targetObj.projectNo = dataObj.project_number;//
this.targetObj.projectName = dataObj.project_name;//
this.targetObj.urgentDegree = dataObj.emergency_level_view;//
this.targetObj.reporter = dataObj.order_contact;//
this.targetObj.declarationTime = dataObj.order_times;//
this.targetObj.address = dataObj.order_times;//
} }
this.$requst.post('/universal/api.order/process_order',params).then(res=>{
}) })
}, },
// //
@ -156,16 +168,32 @@
} }
}) })
}, },
//
goWorkOrderThree() { goWorkOrderThree() {
if(this.checkEmpty()){ if(this.checkEmpty()){
if(this.flag) { if(this.flag) {
this.flag = false; this.flag = false;
this.targetObj.startTime = this.$toolAll.tools.returnCurrentTime('-',0); this.targetObj.startTime = this.$toolAll.tools.returnCurrentTime('-',0);
uni.setStorageSync('targetObj',this.targetObj); uni.setStorageSync('targetObj',this.targetObj);
let params = {
steps:1,
order_id:this.orderId || 14,//id
start_address:'四川省成都市成华区',//
a:this.targetObj.productType,//
b:this.targetObj.installLocation,//
c:this.targetObj.faultType,//
d:this.targetObj.faultExplain,//
e:this.targetObj.maintenanceImgList,//
f:this.targetObj.serviceMode//
}
handleWorkOrderSubmit(params).then(res=>{
if(res.code) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/workOrder/workorderTwo" url: `/pages/workOrder/workorderTwo?id=${this.orderId}`
}) })
}
this.flag = true; this.flag = true;
})
} }
} }
}, },

View File

@ -32,16 +32,16 @@
</view> </view>
<view class="project-list"> <view class="project-list">
<!-- 列表循环体 --> <!-- 列表循环体 -->
<view class="li" @click="projectDetailsFun(item.order_status,item.order_id,item.attributes.text,item.attributes.color)" v-for="(item,index) in dataList" :key="index"> <view class="li" @click="projectDetailsFun(item.order_status,item.order_id,item.btn.attributes.text,item.btn.attributes.color)" v-for="(item,index) in dataList" :key="index">
<view class="work-order-code">工单编号{{item.order_number}}</view> <view class="work-order-code">工单编号{{item.order_number}}</view>
<view class="message"> <view class="message">
<image class="img" src="../../static/del/img001.png" mode="aspectFill"></image> <image class="img" src="../../static/del/img001.png" mode="aspectFill"></image>
<view class="text"> <view class="text disjb fc" style="height: 180rpx;">
<view class="title"> <view class="title flexs">
<view class="text clips1">{{item.project_name}}</view> <view class="text clips1">{{item.project_name}}</view>
<view class="icon" :style="{backgroundColor: item.attributes.color}">{{item.attributes.text}}</view> <view class="icon" :style="{backgroundColor: item.btn.attributes.color}">{{item.btn.attributes.text}}</view>
</view> </view>
<view class="disjb fc" style="margin-left: -20rpx;height: 70%;"> <view class="disjb fc line-h38" style="margin-left: -20rpx;">
<view class="serial-number scal09"> <view class="serial-number scal09">
<view class="type">#{{item.fault_type}}#</view> <view class="type">#{{item.fault_type}}#</view>
<view class="date">{{item.failure_time}}</view> <view class="date">{{item.failure_time}}</view>
@ -175,7 +175,7 @@
} else { } else {
// //
uni.navigateTo({ uni.navigateTo({
url: `/pages/workOrder/details?id=${id}&status=${status}&statusText=${statusText}&statusColor=${statusColor}` url: `/pages/workOrder/details?orderId=${id}&status=${status}&statusText=${statusText}&statusColor=${statusColor}`
}) })
} }
}, },
@ -356,6 +356,7 @@
border-radius: 50rpx; border-radius: 50rpx;
color: #FFFFFF; color: #FFFFFF;
display: flex;justify-content: center;align-items: center; display: flex;justify-content: center;align-items: center;
line-height: 40rpx;
} }
.project-list .li .message .text .title .icon1 { .project-list .li .message .text .title .icon1 {
@ -369,7 +370,6 @@
.project-list .li .message .serial-number { .project-list .li .message .serial-number {
color: #9b9ba3; color: #9b9ba3;
font-size: 24rpx; font-size: 24rpx;
margin-bottom: 10rpx;
display: flex; display: flex;
} }
@ -380,7 +380,6 @@
.project-list .li .message .specification { .project-list .li .message .specification {
color: #9b9ba3; color: #9b9ba3;
font-size: 24rpx; font-size: 24rpx;
margin-bottom: 10rpx;
display: flex; display: flex;
} }
@ -431,9 +430,6 @@
.project-list-address .address { .project-list-address .address {
display: flex; display: flex;
align-items: center; align-items: center;
width: 80%;
} }
.project-list .work-order-code { .project-list .work-order-code {

View File

@ -147,6 +147,8 @@
import footTabOne from "../../components/foot-tabs/foot-tab-one.vue" import footTabOne from "../../components/foot-tabs/foot-tab-one.vue"
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue'; import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
import {base64ToPath} from '@/jsFile/base64-src.js'; import {base64ToPath} from '@/jsFile/base64-src.js';
import {handleWorkOrderGet,handleWorkOrderSubmit,uploadImg} from '../../jsFile/public-api.js';
var content = null; var content = null;
var touchs = []; var touchs = [];
var canvasw = 0; var canvasw = 0;
@ -174,7 +176,7 @@
], ],
currentWay:0,// currentWay:0,//
signatureState:false, signatureState:false,
array: ['微信', '支付宝', '现金', '类型'], array: ['微信', '支付宝', '银行转账'],
paymentModeIndex:0, paymentModeIndex:0,
serviceTime:'' ,// serviceTime:'' ,//
detailObj:{ detailObj:{
@ -198,6 +200,8 @@
remarkText:'',// remarkText:'',//
saveTimer:null,// saveTimer:null,//
flag:true,// flag:true,//
signId:'',//id
orderId:''//id
} }
}, },
computed:{ computed:{
@ -222,7 +226,7 @@
return taxesResult; return taxesResult;
} }
}, },
onLoad: function(options) { onLoad: function(op) {
//Canvas //Canvas
content = uni.createCanvasContext('firstCanvas') content = uni.createCanvasContext('firstCanvas')
//线 //线
@ -235,37 +239,65 @@
content.setLineJoin('round'); content.setLineJoin('round');
// //
// this.conversionEv(); // this.conversionEv();
if(op.id!=undefined) {
this.orderId = op.id;
//
this.handleWorkOrderGet(this.orderId);
}
this.handleWorkOrderGet();
}, },
methods: { methods: {
//
handleWorkOrderGet(id){
let params = {
order_id:14,
steps:3
}
handleWorkOrderGet(params).then(res=>{
if(res.code) {
let dataObj = res.data;
}
})
},
// //
submitEv() { submitEv() {
if(this.checkEmpty()) { if(this.checkEmpty()) {
if(this.flag) { if(this.flag) {
this.flag = false; this.flag = false;
let params = { let params = {
a:this.clearingForm[this.currentWay].title, order_id:this.orderId,
b:this.serviceTime, steps:3,
settlement_type:[1,2,3,4][this.currentWay],//1 2 3 4
c:this.detailObj.doorToDoorFee, c:this.detailObj.doorToDoorFee,
d:this.detailObj.taxes, d:this.detailObj.taxes,
e:this.detailObj.materialCost, e:this.detailObj.materialCost,
f:this.detailObj.otherCost, f:this.detailObj.otherCost,
g:this.totalPrice, g:this.totalPrice,
h:this.paymentMode, pay_type:[1,2,3][this.paymentModeIndex],//1 2 3
i:this.billingIndex, invoice_type:[3,2,1][this.billingIndex],//3 2 1
j:this.isMoney, is_collection:this.isMoney ? 1 : 0,//
k:this.signImage, signature:this.signId,//id
m:this.remarkText settlement_remark:this.remarkText//
} }
console.log(params); console.log(params);
handleWorkOrderSubmit(params).then(res=>{
if(res.code) {
uni.navigateTo({
url: `/pages/workOrder/workorderTwo?id=${this.orderId}`
})
}
this.flag = true;
})
} }
} }
}, },
// //
checkEmpty(){ checkEmpty(){
let result = false; let result = false;
if(!this.serviceTime) { // if(!this.serviceTime) {
this.$toolAll.tools.showToast('请选择服务时间'); // this.$toolAll.tools.showToast('');
} else if(!this.paymentMode) { // } else
if(!this.paymentMode) {
this.$toolAll.tools.showToast('请选择付款方式'); this.$toolAll.tools.showToast('请选择付款方式');
} else if(!this.signImage) { } else if(!this.signImage) {
this.$toolAll.tools.showToast('请签名'); this.$toolAll.tools.showToast('请签名');
@ -382,7 +414,14 @@
// base64 // base64
base64ToPath(res.tempFilePath).then(path => { base64ToPath(res.tempFilePath).then(path => {
that.signImage = path; that.signImage = path;
console.log(that.signImage,308); console.log(that.signImage);
uploadImg({path:that.signImage}).then(res=>{
if(res.code) {
that.signId = res.data.id;
} else {
that.$toolAll.tools.showToast(res.msg);
}
})
}).catch(error => {}) }).catch(error => {})
} }
}) })

View File

@ -51,7 +51,7 @@
<textarea auto-height disabled class="input input-black" :value="targetObj.faultExplain" /> <textarea auto-height disabled class="input input-black" :value="targetObj.faultExplain" />
</view> </view>
<view class="li"> <view class="li">
<view class="title">维保图片</view> <view class="title">故障图片</view>
<view class="input add-display"> <view class="input add-display">
<view class=""> <view class="">
<image class="img" v-for="(item,index) in targetObj.faultImgList" :src="item" mode="aspectFill" lazy-load></image> <image class="img" v-for="(item,index) in targetObj.faultImgList" :src="item" mode="aspectFill" lazy-load></image>
@ -161,6 +161,7 @@
import footTabOne from "../../components/foot-tabs/foot-tab-one.vue" import footTabOne from "../../components/foot-tabs/foot-tab-one.vue"
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue'; import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
import yyMmDdHhSs from '@/components/dates/yy-mm-dd-hh-ss.vue'; import yyMmDdHhSs from '@/components/dates/yy-mm-dd-hh-ss.vue';
import {handleWorkOrderGet,handleWorkOrderSubmit,uploadImg} from '../../jsFile/public-api.js';
export default { export default {
components: { components: {
footTabOne, footTabOne,
@ -172,7 +173,8 @@
return { return {
// isrideo: true, // isrideo: true,
accessoriesData: [], accessoriesData: [],
targetObj:'' targetObj:'',
temporaryImg:[]//id
} }
}, },
computed:{ computed:{
@ -190,10 +192,28 @@
// uni.removeStorageSync('partsList') // uni.removeStorageSync('partsList')
this.accessoriesData = uni.getStorageSync('partsList'); this.accessoriesData = uni.getStorageSync('partsList');
}, },
onLoad() { onLoad(op) {
this.targetObj = uni.getStorageSync('targetObj'); this.targetObj = uni.getStorageSync('targetObj');
if(op.id!=undefined) {
this.orderId = op.id;
//
this.handleWorkOrderGet(this.orderId);
}
}, },
methods: { methods: {
//
handleWorkOrderGet(id){
let params = {
order_id:this.orderId,
steps:2
}
handleWorkOrderGet(params).then(res=>{
if(res.code) {
let dataObj = res.data;
this.targetObj.startTime = dataObj.start_times;
}
})
},
// //
chooseImg(){ chooseImg(){
uni.chooseImage({ uni.chooseImage({
@ -202,7 +222,14 @@
success: (res) => { success: (res) => {
let imgsrc = res.tempFilePaths; let imgsrc = res.tempFilePaths;
imgsrc.forEach(item=>{ imgsrc.forEach(item=>{
uploadImg({path:item}).then(res=>{
if(res.code) {
this.temporaryImg.push(res.data.id);
this.targetObj.maintenanceImgList.push(item); this.targetObj.maintenanceImgList.push(item);
} else {
this.$toolAll.tools.showToast(res.msg);
}
})
}) })
} }
}) })
@ -210,6 +237,7 @@
// //
delImg(index) { delImg(index) {
this.targetObj.maintenanceImgList.splice(index,1); this.targetObj.maintenanceImgList.splice(index,1);
this.temporaryImg.splice(index,1);
}, },
// //
//isrideoFun(is) { //isrideoFun(is) {
@ -217,10 +245,34 @@
// this.targetObj.ifParts = this.isrideo; // this.targetObj.ifParts = this.isrideo;
//}, //},
goWorkorderTwo(){ goWorkorderTwo(){
console.log(this.targetObj);
if(this.checkEmpty()) { if(this.checkEmpty()) {
let accessoryArr = [];
if(this.accessoriesData.length) {
this.accessoriesData.forEach(item=>{
let obj = {
id:item.id,
quantity:item.num
}
accessoryArr.push(obj);
})
}
let params = {
order_id:this.orderId,
steps:2,
completion_time:this.targetObj.endTime,//
work_explanation:this.targetObj.workDescribe,//
failure_reason:this.targetObj.faultReason,//
maintenance_pictures:this.temporaryImg.join(','),//
maintenance_more:this.targetObj.maintenancePersonnel,//
accessory:accessoryArr,//
completion_address:'完工地址'
}
handleWorkOrderSubmit(params).then(res=>{
if(res.code) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/workOrder/workOrderThree" url: `/pages/workOrder/workOrderThree?id=${this.orderId}`
})
}
}) })
} }

View File

@ -105,10 +105,12 @@
e_mail:'', // e_mail:'', //
id_card_no:'', // id_card_no:'', //
imgList:[], imgList:[],
flag:true flag:true,
temporaryImg:[]
} }
}, },
onLoad() { onLoad() {
//
this.getData() this.getData()
}, },
methods: { methods: {
@ -116,13 +118,28 @@
getData(){ getData(){
this.$requst.get('/universal/api.user/user_info').then(res => { this.$requst.get('/universal/api.user/user_info').then(res => {
if (res.code == 1 && res.data.length != 1) { if (res.code == 1 && res.data.length != 1) {
//
this.nickname=res.data.nickname; this.nickname=res.data.nickname;
//
this.full_name=res.data.name; this.full_name=res.data.name;
// res.data.sex ==> 2 1 0 // res.data.sex ==> 2 1 0
res.data.sex != 1 ? this.genderNum = 1 : this.genderNum = 2; res.data.sex != 1 ? this.genderNum = 1 : this.genderNum = 2;
this.contact_number=res.data.phone //
this.e_mail=res.data.email this.contact_number=res.data.phone;
this.id_card_no=res.data.idcard //
this.e_mail = res.data.email;
//
this.id_card_no = res.data.idcard;
//
this.imgList[0] = res.data.idcard_front;
//
this.imgList[1] = res.data.idcard_reverse;
//
this.imgList[2] = res.data.accident_insurance;
//
this.imgList[3] = res.data.agreement_document;
//
this.imgList[3] = res.data.skills_certificate;
} }
}) })
}, },
@ -138,16 +155,19 @@
phone:this.contact_number, phone:this.contact_number,
email:this.e_mail, email:this.e_mail,
idcard:this.id_card_no, idcard:this.id_card_no,
g:this.imgList[0] || '', idcard_front:this.temporaryImg[0] || '',
accident_insurance:this.imgList[1] || '', idcard_reverse:this.temporaryImg[1] || '',
agreement_document:this.imgList[2] || '', accident_insurance:this.temporaryImg[2] || '',
skills_certificate:this.imgList[3] || '' agreement_document:this.temporaryImg[3] || '',
skills_certificate:this.temporaryImg[4] || ''
} }
this.$requst.post('/universal/api.user/user_info',params).then(res=>{ this.$requst.post('/universal/api.user/user_info',params).then(res=>{
if(res.code==1){ if(res.code==1){
this.$toolAll.tools.showToast('保存成功');
// uni.navigateBack({delta:1}) setTimeout(()=>{
uni.navigateBack({delta:1})
},1000)
} }
}) })
@ -156,7 +176,6 @@
} }
} }
}, },
// //
checkEmpty(){ checkEmpty(){
let result = false; let result = false;
@ -173,12 +192,14 @@
} else if(this.$toolAll.tools.isIdentity(this.id_card_no)) { } else if(this.$toolAll.tools.isIdentity(this.id_card_no)) {
this.$toolAll.tools.showToast('请正确输入身份证号码'); this.$toolAll.tools.showToast('请正确输入身份证号码');
} else if(!this.imgList[0]) { } else if(!this.imgList[0]) {
this.$toolAll.tools.showToast('请上传身份证正面'); this.$toolAll.tools.showToast('请上传身份证正');
} else if(!this.imgList[1]) { } else if(!this.imgList[1]) {
this.$toolAll.tools.showToast('请上传意外险材料'); this.$toolAll.tools.showToast('请上传身份证反面照');
} else if(!this.imgList[2]) { } else if(!this.imgList[2]) {
this.$toolAll.tools.showToast('请上传合作协议'); this.$toolAll.tools.showToast('请上传意外险材料');
} else if(!this.imgList[3]) { } else if(!this.imgList[3]) {
this.$toolAll.tools.showToast('请上传合作协议');
} else if(!this.imgList[4]) {
this.$toolAll.tools.showToast('请上传技能证书'); this.$toolAll.tools.showToast('请上传技能证书');
} else { } else {
result = true; result = true;
@ -199,10 +220,11 @@
sourceType:['album'], sourceType:['album'],
success: (res) => { success: (res) => {
let tempImg = res.tempFilePaths[0]; let tempImg = res.tempFilePaths[0];
this.imgList[index] = tempImg;
uploadImg({path:tempImg}).then(res=>{ uploadImg({path:tempImg}).then(res=>{
if(res.code) { if(res.code) {
this.$toolAll.tools.showToast('上传成功'); this.$toolAll.tools.showToast('上传成功');
this.imgList[index] = tempImg;
this.temporaryImg[index] = res.data.id;
} }
}) })
} }
@ -215,6 +237,7 @@
this.imgList.forEach((item,index)=>{ this.imgList.forEach((item,index)=>{
if(current==index) arr.push(item); if(current==index) arr.push(item);
}) })
console.log(this.imgList);
if(arr.length) { if(arr.length) {
uni.previewImage({ uni.previewImage({
current:current, current:current,

View File

@ -6,13 +6,13 @@
<view class="bbot disac pad-sx30 pad-zy30"> <view class="bbot disac pad-sx30 pad-zy30">
<view class="mar-y30 flexs">人员状态 <text style="color: red;">*</text></view> <view class="mar-y30 flexs">人员状态 <text style="color: red;">*</text></view>
<view class="disac"> <view class="disac">
<view @tap="chooseStatus(index,0)" v-for="(item,index) in personnelStatus" :key="index" class="service-range-status mar-y10 pad-zy20 pad-sx6" :class="statusNum==index ? 'service-range-activeStatus' : ''">{{item}}</view> <view @tap="chooseStatus(index,0)" v-for="(item,index) in personnelStatus" :key="index" class="service-range-status mar-y10 pad-zy20 pad-sx6" :class="statusNum==index ? 'service-range-activeStatus' : ''">{{item.title}}</view>
</view> </view>
</view> </view>
<view class="bbot disac pad-sx30 pad-zy30"> <view class="bbot disac pad-sx30 pad-zy30">
<view id="timeBox" class="mar-y30 flexs">工作时段 <text style="color: red;">*</text></view> <view id="timeBox" class="mar-y30 flexs">工作时段 <text style="color: red;">*</text></view>
<view class="disac"> <view class="disac">
<view @tap="chooseStatus(index,1)" v-for="(item,index) in workingHours" :key="index" class="service-range-status mar-y10" style="padding: 6rpx 46rpx;" :class="hoursNum==index ? 'service-range-activeStatus' : ''">{{item}}</view> <view @tap="chooseStatus(index,1)" v-for="(item,index) in workingHours" :key="index" class="service-range-status mar-y10" style="padding: 6rpx 46rpx;" :class="hoursNum==index ? 'service-range-activeStatus' : ''">{{item.title}}</view>
</view> </view>
</view> </view>
<view class="bbot disac pad-sx30 pad-zy30"> <view class="bbot disac pad-sx30 pad-zy30">
@ -56,9 +56,9 @@
}, },
data() { data() {
return { return {
personnelStatus:['工作状态','休息状态'], personnelStatus:[{id:1,title:'工作状态'},{id:0,title:'休息状态'}],
statusNum:0, statusNum:0,
workingHours:['不限','白天','晚上'], workingHours:[{id:3,title:'不限'},{id:1,title:'白天'},{id:2,title:'晚上'}],
hoursNum:0, hoursNum:0,
serviceRange:['30KM','80KM','1500KM','其他','其他','其他','其他'], serviceRange:['30KM','80KM','1500KM','其他','其他','其他','其他'],
rangeNum:0, rangeNum:0,
@ -91,17 +91,20 @@
if(this.flag) { if(this.flag) {
this.flag = false; this.flag = false;
let params = { let params = {
a:this.personnelStatus[this.statusNum], is_working:this.personnelStatus[this.statusNum].id,//
b:this.workingHours[this.hoursNum], working_hours:this.workingHours[this.hoursNum].id ,//
c:this.region, area:this.region,//
d:this.detailed_address, address:this.detailed_address,//
f:this.serviceRange[this.rangeNum], service_distance: parseFloat(this.serviceRange[this.rangeNum]) || 0,//
g:this.remarkText remark:this.remarkText//
} }
console.log(params,87); console.log(params,87);
// this.$requst.post().then(res=>{ // this.$requst.post('/universal/api.user/service_area',params).then(res=>{
// if(res.code) { // if(res.code) {
// this.$toolAll.tools.showToast('');
// setTimeout(()=>{
// uni.navigateBack({delta:1}) // uni.navigateBack({delta:1})
// },1000)
// } // }
// }) // })
} }