对接评价接口
parent
cdd36d31b1
commit
467d0d8ea0
4
App.vue
4
App.vue
|
@ -10,8 +10,8 @@
|
|||
onLaunch: function() {
|
||||
// 配置全局域名
|
||||
// #ifdef H5
|
||||
this.globalData.hostapi = 'https://7and5.cn';
|
||||
// this.globalData.hostapi = '/web';
|
||||
// this.globalData.hostapi = 'https://7and5.cn';
|
||||
this.globalData.hostapi = '/web';
|
||||
// #endif
|
||||
},
|
||||
onShow: function() {
|
||||
|
|
|
@ -75,7 +75,7 @@ button:after{content: none!important;}
|
|||
.bbot{border-bottom: 2rpx solid #EEEEEE;}
|
||||
.borbot-df{border: 2rpx solid #DFDFDF;}
|
||||
.borbot-cc{border: 2rpx solid #CCCCCC;}
|
||||
.bleft {border-left: 1rpx solid #EEEEEE;}
|
||||
.bleft {border-left: 2rpx solid #EEEEEE;}
|
||||
|
||||
/* 行高 */
|
||||
.line-h30{line-height: 30rpx;}
|
||||
|
@ -149,7 +149,7 @@ button:after{content: none!important;}
|
|||
/* 字体颜色 */
|
||||
.colf{color: #FFFFFF;}
|
||||
.colf6{color: #f6f6f6;}
|
||||
.colb{color: #000000;}
|
||||
.col0{color: #000000;}
|
||||
.colc{color: #CCCCCC;}
|
||||
.col3{color: #333333;}
|
||||
.col34{color: #343434;}
|
||||
|
@ -165,6 +165,16 @@ button:after{content: none!important;}
|
|||
.colpeili{color: #868695;}
|
||||
|
||||
|
||||
/* 背景颜色 */
|
||||
.pbackc{background-color: #3875F6;}
|
||||
.bacf{background-color: #FFFFFF;}
|
||||
.bac0{background-color: #000000;}
|
||||
.bcdb{background-color: #DBDBDB;}
|
||||
.bcf8{background: #F85050;}
|
||||
.bacf5{background: #F5F5F5;}
|
||||
.bacf6{background-color: #f6f6f6;}
|
||||
|
||||
|
||||
/* 字体位置 */
|
||||
.tright{text-align: right;}
|
||||
.tcenter{text-align: center;}
|
||||
|
@ -195,16 +205,6 @@ button:after{content: none!important;}
|
|||
.bold500{font-weight: 500;}
|
||||
|
||||
|
||||
/* 背景颜色 */
|
||||
.pbackc{background-color: #3875F6;}
|
||||
.bacf{background-color: #FFFFFF;}
|
||||
.bac0{background-color: #000000;}
|
||||
.bcdb{background-color: #DBDBDB;}
|
||||
.bcf8{background: #F85050;}
|
||||
.bacf5{background: #F5F5F5;}
|
||||
.bacf6{background-color: #f6f6f6;}
|
||||
|
||||
|
||||
|
||||
/* 圆角 */
|
||||
.radius10{border-radius: 10rpx;}
|
||||
|
|
|
@ -236,18 +236,21 @@ uni-radio .uni-radio-input {border: 1rpx solid #444444;}
|
|||
border: 4rpx solid #818181;
|
||||
border-radius: 100%;
|
||||
margin-right: 10rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.gender-box view::before {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
content: '';
|
||||
display: block;
|
||||
/* position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
tran */sform: translate(-50%,-50%);
|
||||
width: 14rpx;
|
||||
height: 14rpx;
|
||||
background-color: #818181;
|
||||
border-radius: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.gender-active view{
|
||||
border: 4rpx solid #d81e06!important;
|
||||
|
@ -314,7 +317,7 @@ uni-radio .uni-radio-input {border: 1rpx solid #444444;}
|
|||
background-color: #03affb;
|
||||
}
|
||||
.account-btn {
|
||||
border: 1rpx solid #00a2e9;
|
||||
border: 2rpx solid #00a2e9;
|
||||
color: #00a2e9;
|
||||
border-radius: 16rpx;
|
||||
padding: 8rpx 10rpx;
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
uni.reLaunch({url:'/pagesA/project/projectList'})
|
||||
break;
|
||||
case 2:
|
||||
// #ifdef APP-PLUS, MP-WEIXIN
|
||||
// #ifdef APP-PLUS || MP-WEIXIN
|
||||
uni.scanCode({
|
||||
onlyFromCamera:false, // 是否只能从相机扫码,不允许从相册选择图片
|
||||
scanType: ['qrCode'], // barCode:一维码, qrCode:二维码, datamatrix:Data Matrix 码, pdf417:PDF417 条码
|
||||
|
@ -184,7 +184,9 @@
|
|||
// console.log(res1)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
},fail:(err)=> {
|
||||
this.$toolAll.tools.checkQx(err.code);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取文件地址函数
|
||||
|
|
168
jsFile/tools.js
168
jsFile/tools.js
|
@ -1,4 +1,5 @@
|
|||
import { renewLocation } from './public-api.js';
|
||||
import permision from "@/js_sdk/wa-permission/permission.js"
|
||||
// 解决微信小程序
|
||||
var QQMapWX = require('./map/qqmap-wx-jssdk.min.js');
|
||||
var qqmapsdk = new QQMapWX({
|
||||
|
@ -37,6 +38,135 @@ const jsonp = function(url, data) {
|
|||
}
|
||||
|
||||
const tools = {
|
||||
// 检测是否授权了
|
||||
checkQx(num){
|
||||
// #ifdef APP-PLUS
|
||||
let system = uni.getSystemInfoSync(); // 获取系统信息
|
||||
let current = '-1';
|
||||
let errArr = ['相机','读取相册']
|
||||
if (system.platform === 'android') { // 判断平台
|
||||
if(num==2) {
|
||||
if(!permision.requestAndroidPermission('android.permission.CAMERA')) {
|
||||
// 如果相机没有授权
|
||||
current = 0;
|
||||
}
|
||||
}
|
||||
if(num==8) {
|
||||
if(!permision.requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE')) {
|
||||
// 如果外部存储(含相册)读取权限没有授权
|
||||
current = 1;
|
||||
}
|
||||
}
|
||||
} else if (system.platform === 'ios') {
|
||||
if(num==2) {
|
||||
if(!permision.judgeIosPermission('camera')) {
|
||||
// 如果相机没有授权
|
||||
current = 0;
|
||||
}
|
||||
}
|
||||
if(num==8) {
|
||||
if(!permision.judgeIosPermission('photoLibrary')) {
|
||||
// 如果外部存储(含相册)读取权限没有授权
|
||||
current = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(current!='-1') {
|
||||
uni.showModal({
|
||||
content: `${errArr[current]}权限未获得授权`,
|
||||
confirmText:'去设置',
|
||||
cancelText:'取消',
|
||||
success: (qx) => {
|
||||
if(qx.confirm) {
|
||||
permision.gotoAppPermissionSetting()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
wx.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting['scope.camera']) { //获取摄像头权限
|
||||
wx.authorize({
|
||||
scope:'scope.camera',
|
||||
success() {
|
||||
console.log('授权成功')
|
||||
}, fail() {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '尚未进行授权,部分功能将无法使用',
|
||||
showCancel: false,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定')
|
||||
wx.openSetting({ //这里的方法是调到一个添加权限的页面,可以自己尝试
|
||||
success: (res) => {
|
||||
if (!res.authSetting['scope.camera']) {
|
||||
wx.authorize({
|
||||
scope: 'scope.camera',
|
||||
success() {
|
||||
console.log('授权成功')
|
||||
}, fail() {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: function () {
|
||||
console.log("授权设置录音失败");
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
if (!res.authSetting['scope.writePhotosAlbum']) { //获取摄像头权限
|
||||
wx.authorize({
|
||||
scope:'scope.writePhotosAlbum',
|
||||
success() {
|
||||
console.log('授权成功')
|
||||
}, fail() {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '尚未进行授权,部分功能将无法使用',
|
||||
showCancel: false,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定')
|
||||
wx.openSetting({ //这里的方法是调到一个添加权限的页面,可以自己尝试
|
||||
success: (res) => {
|
||||
if (!res.authSetting['scope.writePhotosAlbum']) {
|
||||
wx.authorize({
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success() {
|
||||
console.log('授权成功')
|
||||
}, fail() {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: function () {
|
||||
console.log("授权设置录音失败");
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
},
|
||||
checkOpenGPSServiceByAndroidIOS() {
|
||||
// #ifdef APP-PLUS
|
||||
let system = uni.getSystemInfoSync(); // 获取系统信息
|
||||
|
@ -97,7 +227,6 @@ const tools = {
|
|||
// #ifdef MP-WEIXIN
|
||||
wx.getSetting({
|
||||
success: (res) => {
|
||||
console.log(res,99);
|
||||
if (!res.authSetting['scope.userLocation']) {
|
||||
//打开提示框,提示前往设置页面
|
||||
uni.showModal({
|
||||
|
@ -410,9 +539,10 @@ const tools = {
|
|||
},
|
||||
// 整数添加.00,小数就不添加
|
||||
addXiaoShu(num){
|
||||
console.log(num,120);
|
||||
let str = num.toString();
|
||||
if(str.length > 9){
|
||||
console.log(num,'添加小数的方法start');
|
||||
let str = '0.00'
|
||||
if(num) {
|
||||
str = str = num.toString();
|
||||
str = str*1;
|
||||
str = str.toFixed(2);
|
||||
str = str+'';
|
||||
|
@ -521,7 +651,7 @@ const tools = {
|
|||
},
|
||||
// 日期===>时间戳
|
||||
timeToTimestamp(time){
|
||||
var date = new Date(time);
|
||||
var date = new Date(time.replace(/-/g,'/'));
|
||||
var timestamp = date.getTime();//精确到毫秒
|
||||
return timestamp
|
||||
// var date = new Date('2014-04-23 18:55:49:123');
|
||||
|
@ -843,25 +973,17 @@ const tools = {
|
|||
// 拨打电话
|
||||
countCustomer(phone){
|
||||
const res = uni.getSystemInfoSync();
|
||||
if(res.platform=='ios'){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber:phone*1,
|
||||
success: () => {},
|
||||
fail: () => {}
|
||||
})
|
||||
} else {
|
||||
uni.showActionSheet({
|
||||
itemList:[phone,'立即呼叫'],
|
||||
itemColor:'#3875F6',
|
||||
success: (res) => {
|
||||
if(res.tapIndex==1){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber:phone
|
||||
})
|
||||
}
|
||||
uni.showActionSheet({
|
||||
itemList:[phone,'立即呼叫'],
|
||||
itemColor:'#3875F6',
|
||||
success: (res) => {
|
||||
if(res.tapIndex==1){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber:phone
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* @description 自动返回上一页事件
|
||||
|
|
|
@ -0,0 +1,272 @@
|
|||
/**
|
||||
* 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
|
||||
*/
|
||||
|
||||
var isIos
|
||||
// #ifdef APP-PLUS
|
||||
isIos = (plus.os.name == "iOS")
|
||||
// #endif
|
||||
|
||||
// 判断推送权限是否开启
|
||||
function judgeIosPermissionPush() {
|
||||
var result = false;
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var app = UIApplication.sharedApplication();
|
||||
var enabledTypes = 0;
|
||||
if (app.currentUserNotificationSettings) {
|
||||
var settings = app.currentUserNotificationSettings();
|
||||
enabledTypes = settings.plusGetAttribute("types");
|
||||
console.log("enabledTypes1:" + enabledTypes);
|
||||
if (enabledTypes == 0) {
|
||||
console.log("推送权限没有开启");
|
||||
} else {
|
||||
result = true;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
plus.ios.deleteObject(settings);
|
||||
} else {
|
||||
enabledTypes = app.enabledRemoteNotificationTypes();
|
||||
if (enabledTypes == 0) {
|
||||
console.log("推送权限没有开启!");
|
||||
} else {
|
||||
result = true;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
console.log("enabledTypes2:" + enabledTypes);
|
||||
}
|
||||
plus.ios.deleteObject(app);
|
||||
plus.ios.deleteObject(UIApplication);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断定位权限是否开启
|
||||
function judgeIosPermissionLocation() {
|
||||
var result = false;
|
||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||
var status = cllocationManger.authorizationStatus();
|
||||
result = (status != 2)
|
||||
console.log("定位权限开启:" + result);
|
||||
// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
|
||||
/* var enable = cllocationManger.locationServicesEnabled();
|
||||
var status = cllocationManger.authorizationStatus();
|
||||
console.log("enable:" + enable);
|
||||
console.log("status:" + status);
|
||||
if (enable && status != 2) {
|
||||
result = true;
|
||||
console.log("手机定位服务已开启且已授予定位权限");
|
||||
} else {
|
||||
console.log("手机系统的定位没有打开或未给予定位权限");
|
||||
} */
|
||||
plus.ios.deleteObject(cllocationManger);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断麦克风权限是否开启
|
||||
function judgeIosPermissionRecord() {
|
||||
var result = false;
|
||||
var avaudiosession = plus.ios.import("AVAudioSession");
|
||||
var avaudio = avaudiosession.sharedInstance();
|
||||
var permissionStatus = avaudio.recordPermission();
|
||||
console.log("permissionStatus:" + permissionStatus);
|
||||
if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
|
||||
console.log("麦克风权限没有开启");
|
||||
} else {
|
||||
result = true;
|
||||
console.log("麦克风权限已经开启");
|
||||
}
|
||||
plus.ios.deleteObject(avaudiosession);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断相机权限是否开启
|
||||
function judgeIosPermissionCamera() {
|
||||
var result = false;
|
||||
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
|
||||
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
|
||||
console.log("authStatus:" + authStatus);
|
||||
if (authStatus == 3) {
|
||||
result = true;
|
||||
console.log("相机权限已经开启");
|
||||
} else {
|
||||
console.log("相机权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(AVCaptureDevice);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断相册权限是否开启
|
||||
function judgeIosPermissionPhotoLibrary() {
|
||||
var result = false;
|
||||
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
|
||||
var authStatus = PHPhotoLibrary.authorizationStatus();
|
||||
console.log("authStatus:" + authStatus);
|
||||
if (authStatus == 3) {
|
||||
result = true;
|
||||
console.log("相册权限已经开启");
|
||||
} else {
|
||||
console.log("相册权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(PHPhotoLibrary);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断通讯录权限是否开启
|
||||
function judgeIosPermissionContact() {
|
||||
var result = false;
|
||||
var CNContactStore = plus.ios.import("CNContactStore");
|
||||
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
|
||||
if (cnAuthStatus == 3) {
|
||||
result = true;
|
||||
console.log("通讯录权限已经开启");
|
||||
} else {
|
||||
console.log("通讯录权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(CNContactStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断日历权限是否开启
|
||||
function judgeIosPermissionCalendar() {
|
||||
var result = false;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = true;
|
||||
console.log("日历权限已经开启");
|
||||
} else {
|
||||
console.log("日历权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断备忘录权限是否开启
|
||||
function judgeIosPermissionMemo() {
|
||||
var result = false;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = true;
|
||||
console.log("备忘录权限已经开启");
|
||||
} else {
|
||||
console.log("备忘录权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Android权限查询
|
||||
function requestAndroidPermission(permissionID) {
|
||||
return new Promise((resolve, reject) => {
|
||||
plus.android.requestPermissions(
|
||||
[permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
|
||||
function(resultObj) {
|
||||
var result = 0;
|
||||
for (var i = 0; i < resultObj.granted.length; i++) {
|
||||
var grantedPermission = resultObj.granted[i];
|
||||
console.log('已获取的权限:' + grantedPermission);
|
||||
result = 1
|
||||
}
|
||||
for (var i = 0; i < resultObj.deniedPresent.length; i++) {
|
||||
var deniedPresentPermission = resultObj.deniedPresent[i];
|
||||
console.log('拒绝本次申请的权限:' + deniedPresentPermission);
|
||||
result = 0
|
||||
}
|
||||
for (var i = 0; i < resultObj.deniedAlways.length; i++) {
|
||||
var deniedAlwaysPermission = resultObj.deniedAlways[i];
|
||||
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
|
||||
result = -1
|
||||
}
|
||||
resolve(result);
|
||||
// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
|
||||
// if (result != 1) {
|
||||
// gotoAppPermissionSetting()
|
||||
// }
|
||||
},
|
||||
function(error) {
|
||||
console.log('申请权限错误:' + error.code + " = " + error.message);
|
||||
resolve({
|
||||
code: error.code,
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// 使用一个方法,根据参数判断权限
|
||||
function judgeIosPermission(permissionID) {
|
||||
if (permissionID == "location") {
|
||||
return judgeIosPermissionLocation()
|
||||
} else if (permissionID == "camera") {
|
||||
return judgeIosPermissionCamera()
|
||||
} else if (permissionID == "photoLibrary") {
|
||||
return judgeIosPermissionPhotoLibrary()
|
||||
} else if (permissionID == "record") {
|
||||
return judgeIosPermissionRecord()
|
||||
} else if (permissionID == "push") {
|
||||
return judgeIosPermissionPush()
|
||||
} else if (permissionID == "contact") {
|
||||
return judgeIosPermissionContact()
|
||||
} else if (permissionID == "calendar") {
|
||||
return judgeIosPermissionCalendar()
|
||||
} else if (permissionID == "memo") {
|
||||
return judgeIosPermissionMemo()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 跳转到**应用**的权限页面
|
||||
function gotoAppPermissionSetting() {
|
||||
if (isIos) {
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var application2 = UIApplication.sharedApplication();
|
||||
var NSURL2 = plus.ios.import("NSURL");
|
||||
// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
|
||||
var setting2 = NSURL2.URLWithString("app-settings:");
|
||||
application2.openURL(setting2);
|
||||
|
||||
plus.ios.deleteObject(setting2);
|
||||
plus.ios.deleteObject(NSURL2);
|
||||
plus.ios.deleteObject(application2);
|
||||
} else {
|
||||
// console.log(plus.device.vendor);
|
||||
var Intent = plus.android.importClass("android.content.Intent");
|
||||
var Settings = plus.android.importClass("android.provider.Settings");
|
||||
var Uri = plus.android.importClass("android.net.Uri");
|
||||
var mainActivity = plus.android.runtimeMainActivity();
|
||||
var intent = new Intent();
|
||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
mainActivity.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
// 检查系统的设备服务是否开启
|
||||
// var checkSystemEnableLocation = async function () {
|
||||
function checkSystemEnableLocation() {
|
||||
if (isIos) {
|
||||
var result = false;
|
||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||
var result = cllocationManger.locationServicesEnabled();
|
||||
console.log("系统定位开启:" + result);
|
||||
plus.ios.deleteObject(cllocationManger);
|
||||
return result;
|
||||
} else {
|
||||
var context = plus.android.importClass("android.content.Context");
|
||||
var locationManager = plus.android.importClass("android.location.LocationManager");
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
||||
var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
|
||||
console.log("系统定位开启:" + result);
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
judgeIosPermission: judgeIosPermission,
|
||||
requestAndroidPermission: requestAndroidPermission,
|
||||
checkSystemEnableLocation: checkSystemEnableLocation,
|
||||
gotoAppPermissionSetting: gotoAppPermissionSetting
|
||||
}
|
|
@ -32,10 +32,12 @@
|
|||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
|
|
|
@ -76,8 +76,9 @@
|
|||
}
|
||||
this.$requst.post('/universal/api.login/password_find',params).then(res=>{
|
||||
if(res.code==1) {
|
||||
this.$toolAll.tools.showToast('找回成功');
|
||||
setTimeout(()=>{uni.navigateTo({url:'/pages/login/login'})},1000)
|
||||
this.$toolAll.tools.showToast('修改成功,请重新登录');
|
||||
uni.clearStorageSync();
|
||||
uni.reLaunch({url:'/pages/login/login'});
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
|
|
|
@ -15,58 +15,37 @@
|
|||
this.checkContext();
|
||||
},
|
||||
methods: {
|
||||
// 检测是否是微信端
|
||||
checkContext(){
|
||||
if(uni.getStorageSync('token')) {
|
||||
setTimeout(()=>{
|
||||
uni.reLaunch({
|
||||
url:'/pages/tabbar/pagehome/pagehome'
|
||||
})
|
||||
},3000)
|
||||
if(uni.getStorageSync('password')) {
|
||||
// 是否登录过,登录过就直接刷新token重新登录
|
||||
let params = {
|
||||
login_type: 'account', // 登陆手机类型: mobile:手机登陆、account:账号密码登陆
|
||||
phone: '', // 手机号码,login_type 为 mobile 时必填
|
||||
password: uni.getStorageSync('password'), // 密码,login_type 为 account 时必填
|
||||
sms_code: '', // 短信验证码,login_type 为 mobile 时必填
|
||||
username: uni.getStorageSync('phone'), //账号,login_type 为 account 时必填
|
||||
affiliation: uni.getStorageSync('unitName') // 单位名称
|
||||
}
|
||||
this.$requst.post('/universal/api.login/login',params).then(res=>{
|
||||
if(res.code==1) {
|
||||
// 缓存token和角色类型
|
||||
uni.setStorageSync('token',res.data.token);
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
this.goPage(1);
|
||||
} else {
|
||||
setTimeout(()=>{
|
||||
uni.reLaunch({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
},3000)
|
||||
this.goPage(0);
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
// if(uni.getSystemInfoSync().platform != "devtools"){//devtools:开发版 值域为:ios、android、mac(3.1.10+)、windows(3.1.10+)、linux(3.1.10+)
|
||||
// console.log = () =>{}
|
||||
// }
|
||||
// setTimeout(()=>{
|
||||
// uni.reLaunch({
|
||||
// url:'/pages/login/login'
|
||||
// })
|
||||
// },3000)
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
// if(uni.getSystemInfoSync().platform != "development"){//devtools:开发版 值域为:ios、android、mac(3.1.10+)、windows(3.1.10+)、linux(3.1.10+)
|
||||
// console.log = () =>{}
|
||||
// }
|
||||
// setTimeout(()=>{
|
||||
// uni.reLaunch({
|
||||
// url:'/pages/login/login'
|
||||
// })
|
||||
// },3000)
|
||||
// #endif
|
||||
// 微信小程序原生API性能优化
|
||||
// #ifdef MP-WEIXIN
|
||||
// let hInfo = wx.getAccountInfoSync();
|
||||
// // console.log(hInfo.envVersion);//develop:开发版 trial:体验版 release:正式版
|
||||
// if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){
|
||||
// // (开发版,体验版)-配置全局域名
|
||||
// } else {
|
||||
// // 清除所有输出日志
|
||||
// console.log = () =>{};
|
||||
// // 正式版-配置全局域名
|
||||
// }
|
||||
// setTimeout(()=>{
|
||||
// uni.reLaunch({
|
||||
// url:'/pages/tabbar/pagehome/pagehome'
|
||||
// })
|
||||
// },3000)
|
||||
// #endif
|
||||
},
|
||||
// 跳转页面
|
||||
goPage(index) {
|
||||
let arr = [
|
||||
'/pages/login/login',
|
||||
'/pages/tabbar/pagehome/pagehome'
|
||||
]
|
||||
setTimeout(()=>{uni.reLaunch({url:arr[index]})},3000)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,6 +103,11 @@
|
|||
url:'/pages/tabbar/pagehome/pagehome'
|
||||
})
|
||||
},2000)
|
||||
if(this.login_password) {
|
||||
uni.setStorageSync('password',this.login_password), // 密码,login_type 为 account 时必填
|
||||
uni.setStorageSync('phone',this.login_phone), //账号,login_type 为 account 时必填
|
||||
uni.setStorageSync('unitName',this.login_unitName) // 单位名称
|
||||
}
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
|
|
|
@ -18,13 +18,11 @@
|
|||
<view slot="rightContent" style="width: 30rpx;"></view>
|
||||
<!-- #endif -->
|
||||
</status-nav-slot>
|
||||
<view class="posir"
|
||||
style="background: url(/static/public/icon-my-logo.png) no-repeat;background-size: 100% auto;"
|
||||
<view class="posir my-content-box"
|
||||
:style="{paddingTop: newHeight + 'px'}">
|
||||
<!-- <image src="/static/public/icon-my-logo.png" class="width100" mode="widthFix" lazy-load></image> -->
|
||||
<view class="mar-zy40">
|
||||
<view
|
||||
style="background: url(../../../static/public/icon-my-head.png) no-repeat;height: 400rpx;background-size: 100% 100%;">
|
||||
<view class="my-head-box">
|
||||
<view class="disjbac" style="padding: 60rpx 80rpx 60rpx 60rpx;">
|
||||
<view class="disac">
|
||||
<!-- 用户头像 -->
|
||||
|
@ -70,9 +68,11 @@
|
|||
v-for="(item,index) in gridList" :key="index"
|
||||
:class="[`${(index%2!=0) ? 'bleft' : ''} ${(index < gridList.length-2) ? 'bbot' : ''}`]"
|
||||
style="box-sizing: border-box;">
|
||||
<image :src="item.imgsrc" mode="widthFix" lazy-load
|
||||
:style="{width: [52,52,46,50,46,52][index] + 'rpx',height: [48,45,52,52,53,52][index] + 'rpx'}">
|
||||
</image>
|
||||
<view class="" style="height: 53rpx;">
|
||||
<image :src="item.imgsrc" mode="widthFix" lazy-load
|
||||
:style="{width: [52,52,46,50,46,52][index] + 'rpx',height: [48,45,52,52,53,52][index] + 'rpx'}">
|
||||
</image>
|
||||
</view>
|
||||
<view class="fon26 col3 mar-s20">{{item.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -161,7 +161,7 @@
|
|||
],
|
||||
userInfo: {},
|
||||
ifAuthentication:0,//是否认证
|
||||
userHeadImg:''//用户头像
|
||||
userHeadImg:'',//用户头像
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
@ -191,29 +191,34 @@
|
|||
sourceType:['album','camera'],
|
||||
success: (res) => {
|
||||
this.userHeadImg = res.tempFilePaths[0];
|
||||
// this.$requst.upload('/universal/api.user/avatar',{path:this.userHeadImg}).then(res=>{
|
||||
// if(res.code) {
|
||||
// // 查询用户信息
|
||||
// this.checkInfo();
|
||||
// }
|
||||
// })
|
||||
}
|
||||
uploadImg({path:this.userHeadImg}).then(res=>{
|
||||
if(res.code) {
|
||||
this.$toolAll.tools.showToast('修改成功');
|
||||
// this.temporaryImg[index] = res.data.id;
|
||||
this.$requst.post('/universal/api.user/avatar',{avatar:res.data.id}).then(res=>{
|
||||
if(res.code) {
|
||||
// 查询用户信息
|
||||
this.checkInfo();
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},fail:(err)=> {
|
||||
this.$toolAll.tools.checkQx(err.code);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 退出登录
|
||||
logOutEv() {
|
||||
this.$requst.post('/universal/api.login/signout').then(res => {
|
||||
if (res.code == 1) {
|
||||
this.$toolAll.tools.showToast('退出成功');
|
||||
// 清除所有缓存
|
||||
uni.clearStorageSync();
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
this.$toolAll.tools.showToast('退出成功');
|
||||
// 清除所有缓存
|
||||
uni.clearStorageSync();
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}, 1000)
|
||||
this.$requst.post('/universal/api.login/signout').then(res => {})
|
||||
},
|
||||
// 手机加星号
|
||||
tel(tel="0000000000") {
|
||||
|
@ -265,4 +270,6 @@
|
|||
page {
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
.my-content-box{background: url(/static/public/icon-my-logo.png) no-repeat;background-size: 100% auto;}
|
||||
.my-head-box{background: url(/static/public/icon-my-head.png) no-repeat;height: 400rpx;background-size: 100% 100%;}
|
||||
</style>
|
||||
|
|
|
@ -10,20 +10,14 @@
|
|||
<view slot="centerContent" class="disjcac">
|
||||
<image style="width: 156rpx;height: 38rpx;" src="/static/public/icom-home-logo.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view slot="rightContent" class="disac" @tap="callEv">
|
||||
<image class="mar-y10" style="width: 26rpx;height: 26rpx;" src="/static/public/icon-home-phone.png" mode=""></image>
|
||||
<view class="fon26 col3">拨打电话</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<!-- #ifdef APP-PLUS || H5 -->
|
||||
<view slot="rightContent" class="disac" @tap="callEv">
|
||||
<image class="mar-y10" style="width: 26rpx;height: 26rpx;" src="/static/public/icon-home-phone.png" mode=""></image>
|
||||
<view class="fon26 col3">拨打电话</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view slot="rightContent" @tap="goMessage" style="width: 70px;"></view>
|
||||
<view slot="rightContent" style="width: 70px;"></view>
|
||||
<!-- #endif -->
|
||||
</status-nav-slot>
|
||||
<!-- <view :style="{paddingTop: statusHeight +'px'}"> -->
|
||||
|
@ -164,7 +158,7 @@
|
|||
<view class="disac mar-s40">
|
||||
<view @tap="stayEv(item.title,item.id)" class="disjcac fc width25" v-for="(item,index) in settlementList" :key="index">
|
||||
<view class="posir" style="height: 58rpx;">
|
||||
<image :style="{width: [58,50,58][index]+'rpx',height:[54,58,58][index] + 'rpx'}" style="width: 58rpx;height: 53rpx;" :src="item.imgsrc" mode="widthFix"></image>
|
||||
<image :style="{width: [58,50,58][index]+'rpx',height:[54,58,58][index] + 'rpx'}" style="width: 58rpx;" :src="item.imgsrc" mode="widthFix"></image>
|
||||
<view class="engineer-num" v-if="item.num!=0">{{item.num}}</view>
|
||||
</view>
|
||||
<view class="fon24 col3 mar-s10">{{item.title}}</view>
|
||||
|
@ -175,9 +169,11 @@
|
|||
<!-- 其他 -->
|
||||
<view class="home-fun-box">
|
||||
<view class="fun-title col3 fon28 disac bold">其他</view>
|
||||
<view class="disac mar-s60 mar-x20" style="height: 58rpx;">
|
||||
<view class="disac mar-s60 mar-x20">
|
||||
<view @tap="otherEv(index)" class="disjcac fc width25" v-for="(item,index) in otherList" :key="index">
|
||||
<image :style="{width: [58,49,58][index]+'rpx',height:[51,58,55][index] + 'rpx'}" style="width: 58rpx;height: 53rpx;" :src="item.imgsrc" mode="widthFix"></image>
|
||||
<view class="posir" style="height: 58rpx;">
|
||||
<image :style="{width: [58,49,58][index]+'rpx',height:[51,58,55][index] + 'rpx'}" style="width: 58rpx;" :src="item.imgsrc" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="fon24 col3 mar-s10">{{item.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -478,7 +474,8 @@
|
|||
},
|
||||
// 拨打电话事件
|
||||
callEv(){
|
||||
this.$toolAll.tools.countCustomer('15616330510');
|
||||
// this.$toolAll.tools.countCustomer('15616330510');
|
||||
this.$toolAll.tools.countCustomer('17366921088');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,13 +57,13 @@
|
|||
<view class="">
|
||||
<text class="cor">*</text>联系电话
|
||||
</view>
|
||||
<input type="text" v-model="data.contact_phone" class="input" placeholder="请填写联系电话" />
|
||||
<input type="number" v-model="data.contact_phone" maxlength="11" class="input" placeholder="请填写联系电话" />
|
||||
</view>
|
||||
<view class="li">
|
||||
<view class="">
|
||||
<text class="cor">*</text>预约时间
|
||||
</view>
|
||||
<input type="text" v-model="data.appointment_time" class="input" @tap="openDatetimePicker"
|
||||
<input type="text" disabled v-model="appointment_time" class="input" @tap="openDatetimePicker"
|
||||
placeholder="请选择预约时间" />
|
||||
|
||||
</view>
|
||||
|
@ -97,6 +97,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import permision from "@/js_sdk/wa-permission/permission.js"
|
||||
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
|
||||
import statusNav from '../../components/status-nav.vue';
|
||||
import yyMmDdHhSs from '@/components/dates/yy-mm-dd-hh-ss.vue';
|
||||
|
@ -124,6 +125,7 @@
|
|||
addres: "",
|
||||
pictures:''
|
||||
},
|
||||
appointment_time:'',
|
||||
pictures: [],
|
||||
imgsrcArr: [],
|
||||
typeIndex: 0,
|
||||
|
@ -163,14 +165,13 @@
|
|||
// 获取预约时间
|
||||
handleSubmit(e) {
|
||||
// {year: "2019", month: "07", day: "17", hour: "15", minute: "21"}
|
||||
this.data.appointment_time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`;
|
||||
|
||||
|
||||
this.appointment_time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`;
|
||||
this.data.appointment_time = this.$toolAll.tools.timeToTimestamp(`${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`)/1000;
|
||||
},
|
||||
// 选择图片
|
||||
chooseImg() {
|
||||
uni.chooseImage({
|
||||
count: 2,
|
||||
count: 1,
|
||||
sourceType: ['album', 'camera'],
|
||||
success: (res) => {
|
||||
let imgsrc = res.tempFilePaths;
|
||||
|
@ -187,13 +188,14 @@
|
|||
}
|
||||
})
|
||||
}
|
||||
},fail:(err)=> {
|
||||
this.$toolAll.tools.checkQx(err.code);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交
|
||||
submitData() {
|
||||
this.data.pictures = this.pictures.join(',');
|
||||
console.log(this.data.pictures);
|
||||
if (!this.data.title) {
|
||||
this.$toolAll.tools.showToast("请填写产品名称");
|
||||
return
|
||||
|
@ -202,8 +204,7 @@
|
|||
this.$toolAll.tools.showToast("请填写联系人名称");
|
||||
return
|
||||
}
|
||||
var reg_tel =
|
||||
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; //11位手机号码正则
|
||||
var reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; //11位手机号码正则
|
||||
|
||||
if (!reg_tel.test(this.data.contact_phone)) {
|
||||
this.$toolAll.tools.showToast("请正确填写联系人电话");
|
||||
|
@ -221,7 +222,6 @@
|
|||
this.$toolAll.tools.showToast("请选择现场图片");
|
||||
return
|
||||
}
|
||||
this.data.appointment_time = new Date(this.data.appointment_time).getTime()/1000;
|
||||
this.data.pictures = this.pictures.join(',');
|
||||
this.$requst.post('/universal/api.vas/vas', this.data).then(res => {
|
||||
if (res.code) {
|
||||
|
@ -230,7 +230,7 @@
|
|||
uni.navigateBack({delta:1})
|
||||
},1000)
|
||||
} else {
|
||||
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -130,6 +130,8 @@
|
|||
this.$toolAll.tools.showToast('上传成功');
|
||||
}
|
||||
})
|
||||
},fail:(err)=> {
|
||||
this.$toolAll.tools.checkQx(err.code);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -65,10 +65,8 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="record-nav">
|
||||
<view class="li" @click="recordNav(index)" :class="item.state?'on':''"
|
||||
v-for="(item,index) in recordState">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="li" @click="recordNav(index)" :class="item.state ? 'on' : 'mo'"
|
||||
v-for="(item,index) in recordState" :key="index">{{item.title}}</view>
|
||||
</view>
|
||||
<view class="record-content">
|
||||
<view class="title">维保追踪</view>
|
||||
|
@ -264,8 +262,8 @@
|
|||
}
|
||||
|
||||
.last-date {
|
||||
width: 100%;
|
||||
padding: 10rpx 13rpx 10rpx;
|
||||
/* width: 100%; */
|
||||
padding: 10rpx 13rpx;
|
||||
/* border-bottom: 6rpx solid #E7E7E7; */
|
||||
}
|
||||
|
||||
|
@ -274,6 +272,7 @@
|
|||
height: 57rpx;
|
||||
display: flex;
|
||||
padding-left: 20rpx;
|
||||
box-sizing: border-box;
|
||||
align-items: center;
|
||||
border-radius: 10rpx;
|
||||
|
||||
|
@ -363,27 +362,35 @@
|
|||
}
|
||||
|
||||
.record-nav .li {
|
||||
font-size: 24rpx;
|
||||
position: relative;
|
||||
width: 128rpx;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.record-nav .on {
|
||||
color: #00b1ff;
|
||||
color: #00B1FF;
|
||||
}
|
||||
|
||||
.record-nav .on::after {
|
||||
.record-nav .mo {
|
||||
color: #000000;
|
||||
}
|
||||
.record-nav .on::after,.record-nav .mo::after {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 4rpx;
|
||||
position: absolute;
|
||||
background-color: #00B1FF;
|
||||
/* #ifdef APP-PLUS || MP-WEIXIN */
|
||||
top: 68rpx;
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
top: 65rpx;
|
||||
/* #endif */
|
||||
left: 0rpx;
|
||||
}
|
||||
|
||||
.record-nav .on::after{
|
||||
background-color: #00B1FF;
|
||||
}
|
||||
.record-content {
|
||||
padding: 0 52rpx;
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
<container-subgroup>
|
||||
<view slot="content" style="margin: 0 -30rpx;">
|
||||
<view class="repairs-nav" style="margin-top: -30rpx;">
|
||||
<view :key="index" class="li" @click="repairsNavFun(index)" :class="item.state?'on':''"
|
||||
v-for="(item,index) in navDataState">
|
||||
{{item.title}}
|
||||
<view class="li" @click="repairsNavFun(index)" :class="current==index ?'on':''"
|
||||
v-for="(item,index) in navDataState" :key="index">
|
||||
{{item}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="repairs-hint padding">
|
||||
|
@ -23,14 +23,13 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="padding">
|
||||
<view class="devicename" v-if="navDataState[0].state">
|
||||
<input type="text" class="fon28 width100" v-model="data.device_name" placeholder="请填写设备名称和型号或扫描二维码" />
|
||||
<image @click="scanCodeFun()" class="sm flexs" src="../../static/iocn/sm.png" lazy-load mode=""></image>
|
||||
<view class="devicename" v-if="current==0">
|
||||
<input type="text" class="fon28 width100 col3" v-model="data.project_number" placeholder="请填写设备编号或扫描二维码" />
|
||||
<image @click="scanCodeFun" class="sm flexs" src="../../static/iocn/sm.png" lazy-load mode=""></image>
|
||||
</view>
|
||||
<input v-model="data.device_name" class="devicename" placeholder="请填写设备名称和型号(例:华为LED)" v-else />
|
||||
<input v-else v-model="data.device_name" class="devicename" placeholder="请填写设备名称和型号(例:华为LED)" />
|
||||
<view class="fault-pictures radius10" @click="chooseImg">
|
||||
<image class="fault-pictures-img" v-if="imgsrcArr.length>=1" :src="imgsrcArr[0]"
|
||||
mode="aspectFill"></image>
|
||||
<image class="fault-pictures-img" v-if="imgsrcArr.length>=1" :src="imgsrcArr[0]" mode="aspectFill"></image>
|
||||
<view class="fault-pictures-con" v-else>
|
||||
<image class="img" src="../../static/iocn/gz.png" lazy-load mode="aspectFill"></image>
|
||||
<view class="text">添加维保图片</view>
|
||||
|
@ -39,19 +38,13 @@
|
|||
<textarea v-model="data.fault_describe" class="fault-description radius10" placeholder="维保情况描述"
|
||||
placeholder-class="fault-description-text" />
|
||||
<view class="detailed-address inputCss">
|
||||
<input type="text" v-model="data.service_address" class="fon26 width100"
|
||||
placeholder="请输入详细的上门服务地址" placeholder-class="inputCss-input" />
|
||||
<image @click="mapFun()" src="../../static/iocn/map.png" class="map flexs" mode="aspectFill">
|
||||
</image>
|
||||
<input type="text" v-model="data.service_address" class="fon26 width100 mar-y20" placeholder="请输入详细的上门服务地址" placeholder-class="inputCss-input" />
|
||||
<image @click="mapFun" src="../../static/iocn/map.png" class="map flexs" mode="aspectFill"></image>
|
||||
</view>
|
||||
<input type="text" class="inputCss" v-model="data.username" placeholder="请填写您的姓名"
|
||||
placeholder-class="inputCss-input" />
|
||||
<input type="text" class="inputCss" v-model="data.phone" placeholder="请填写联系电话"
|
||||
placeholder-class="inputCss-input" />
|
||||
<input type="text" class="inputCss" @tap="openDatetimePicker" disabled v-model="data.visit_time"
|
||||
placeholder="请选择上门时间" placeholder-class="inputCss-input" />
|
||||
<yy-mm-dd-hh-ss ref="myPicker" @submit="handleSubmit" :start-year="2022" :end-year="2122">
|
||||
</yy-mm-dd-hh-ss>
|
||||
<input type="text" class="inputCss" v-model="data.username" placeholder="请填写您的姓名" placeholder-class="inputCss-input" />
|
||||
<input type="number" maxlength="11" class="inputCss" v-model="data.phone" placeholder="请填写联系电话" placeholder-class="inputCss-input" />
|
||||
<input type="text" class="inputCss" @tap="openDatetimePicker" disabled v-model="data.visit_time" placeholder="请选择上门时间" placeholder-class="inputCss-input" />
|
||||
<yy-mm-dd-hh-ss ref="myPicker" @submit="handleSubmit" :start-year="2022" :end-year="2122"></yy-mm-dd-hh-ss>
|
||||
<button class="submit-button" @click="submitButton()" type="default">提交维保申报</button>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -65,6 +58,8 @@
|
|||
import {
|
||||
uploadImg
|
||||
} from '@/jsFile/public-api.js';
|
||||
// 引入qrcode.js (必须导出qrcode.js )
|
||||
var qrcode = require('@/jsFile/qrcode.js');
|
||||
export default {
|
||||
components: {
|
||||
yyMmDdHhSs
|
||||
|
@ -86,17 +81,8 @@
|
|||
},
|
||||
imgsrcArr: [],
|
||||
indexType: 0,
|
||||
navDataState: [{
|
||||
title: "有设备",
|
||||
state: false,
|
||||
is_device: 1
|
||||
},
|
||||
{
|
||||
title: "无设备",
|
||||
state: true,
|
||||
is_device: 0
|
||||
}
|
||||
],
|
||||
navDataState: ["有设备","无设备"],
|
||||
current:0,
|
||||
faultTypeData: []
|
||||
}
|
||||
},
|
||||
|
@ -105,6 +91,39 @@
|
|||
},
|
||||
|
||||
methods: {
|
||||
submitButton() {
|
||||
this.data.fault_type = this.faultTypeData[this.indexType].id
|
||||
if(this.current) {
|
||||
if (!this.data.device_name) {
|
||||
this.$toolAll.tools.showToast("请填写设备名称或型号");
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (!this.data.project_number) {
|
||||
this.$toolAll.tools.showToast("请填写设备编号");
|
||||
return
|
||||
}
|
||||
}
|
||||
if (!this.data.username) {
|
||||
this.$toolAll.tools.showToast("请填写您的姓名");
|
||||
return
|
||||
}
|
||||
if (this.$toolAll.tools.isPhone(this.data.phone)) {
|
||||
this.$toolAll.tools.showToast("请正确填写您的电话");
|
||||
return
|
||||
}
|
||||
this.data.is_device = this.current ? 0 : 1;//0:表示无设备 1:表示有设备
|
||||
this.$requst.post('/universal/api.order/repair', this.data).then(res => {
|
||||
if (res.code) {
|
||||
this.$toolAll.tools.showToast('提交成功');
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack({delta:1})
|
||||
},1000)
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取维保类型
|
||||
getType() {
|
||||
getFaultType().then(res=>{
|
||||
|
@ -119,15 +138,7 @@
|
|||
this.$refs.myPicker.show();
|
||||
},
|
||||
handleSubmit(e) {
|
||||
// {year: "2019", month: "07", day: "17", hour: "15", minute: "21"}
|
||||
console.log(e)
|
||||
|
||||
this.data.visit_time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`;
|
||||
|
||||
},
|
||||
change(e) {
|
||||
this.single = e;
|
||||
console.log("-change事件:", e);
|
||||
this.data.visit_time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:00`;
|
||||
},
|
||||
// 获取图片
|
||||
chooseImg() {
|
||||
|
@ -140,73 +151,123 @@
|
|||
imgsrc.forEach(item => {
|
||||
this.imgsrcArr.push(item);
|
||||
})
|
||||
|
||||
|
||||
uploadImg({
|
||||
path: res.tempFilePaths[0]
|
||||
}).then(res => {
|
||||
if (res.code) {
|
||||
console.log(res.data.id)
|
||||
uploadImg({path: res.tempFilePaths[0]}).then(res => {
|
||||
if (res.code) {
|
||||
this.$toolAll.tools.showToast('上传成功');
|
||||
this.data.fault_picture = res.data.id
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
},fail:(err)=> {
|
||||
this.$toolAll.tools.checkQx(err.code);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取日期
|
||||
dateFun(data) {
|
||||
|
||||
},
|
||||
|
||||
timeFun() {},
|
||||
scanCodeFun() {
|
||||
uni.scanCode({
|
||||
success: function(res) {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
}
|
||||
});
|
||||
// #ifdef APP-PLUS || MP-WEIXIN
|
||||
uni.scanCode({
|
||||
onlyFromCamera:false, // 是否只能从相机扫码,不允许从相册选择图片
|
||||
scanType: ['qrCode'], // barCode:一维码, qrCode:二维码, datamatrix:Data Matrix 码, pdf417:PDF417 条码
|
||||
autoDecodeCharset:true, // 是否启用自动识别字符编码功能,默认为否
|
||||
success: function (res) {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
this.scanCode();
|
||||
// #endif
|
||||
},
|
||||
submitButton() {
|
||||
this.data.fault_type = this.faultTypeData[this.indexType].id
|
||||
// if (this.data.is_device == 0) {
|
||||
// if (!this.data.device_name) {
|
||||
// this.$toolAll.tools.showToast("请填写设备名称或型号");
|
||||
// return
|
||||
// }
|
||||
// } else {
|
||||
// if (!this.data.project_number) {
|
||||
// this.$toolAll.tools.showToast("请扫描设备二维码");
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
if (!this.data.device_name) {
|
||||
this.$toolAll.tools.showToast("请填写设备名称或型号");
|
||||
return
|
||||
scanCode() {
|
||||
let that = this
|
||||
// 调用uni提供的调用相机api
|
||||
uni.chooseImage({
|
||||
sizeType: ['original'],
|
||||
count: 1,
|
||||
success: (res)=> {
|
||||
qrcode.decode(this.getObjectURL(res.tempFiles[0]))
|
||||
qrcode.callback = (codeRes) => {
|
||||
if (codeRes.indexOf('error') >= 0) {
|
||||
// 二维码识别失败
|
||||
console.log('不合法二维码:' + codeRes);
|
||||
} else {
|
||||
// 二维码识别成功
|
||||
let r = this.decodeStr(codeRes)
|
||||
// this.qrCodeRes = r
|
||||
console.log(r);
|
||||
}
|
||||
}
|
||||
// const tempFilePaths = res.tempFilePaths[0] // 获取到二维码图片的链接
|
||||
// qrcode.decode(tempFilePaths); // 解析二维码图片
|
||||
// qrcode.callback = function(res1) {
|
||||
// // 解析失败返回 error decoding QR Code
|
||||
// if (res1 == "error decoding QR Code") {
|
||||
// uni.showToast({
|
||||
// title: "识别二维码失败,请重新上传!",
|
||||
// duration: 2000,
|
||||
// icon: 'none'
|
||||
// })
|
||||
// } else {
|
||||
// // 解析成功返回二维码链接
|
||||
// console.log(res1)
|
||||
// }
|
||||
// }
|
||||
},fail:(err)=> {
|
||||
this.$toolAll.tools.checkQx(err.code);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取文件地址函数
|
||||
getObjectURL(file) {
|
||||
var url = null
|
||||
if (window.createObjectURL !== undefined) { // basic
|
||||
url = window.createObjectURL(file)
|
||||
} else if (window.URL !== undefined) { // mozilla(firefox)
|
||||
url = window.URL.createObjectURL(file)
|
||||
} else if (window.webkitURL !== undefined) { // webkit or chrome
|
||||
url = window.webkitURL.createObjectURL(file)
|
||||
}
|
||||
if (!this.data.username) {
|
||||
this.$toolAll.tools.showToast("请填写您的姓名");
|
||||
return
|
||||
}
|
||||
if (this.$toolAll.tools.isPhone(this.data.phone)) {
|
||||
this.$toolAll.tools.showToast("请正确填写您的电话");
|
||||
return
|
||||
}
|
||||
this.$requst.post('/universal/api.order/repair', this.data).then(res => {
|
||||
if (res.code) {
|
||||
this.$toolAll.tools.showToast('提交成功');
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack({delta:1})
|
||||
},1000)
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
return url
|
||||
},
|
||||
// 解码,输出:中文
|
||||
decodeStr(str) {
|
||||
var out, i, len, c;
|
||||
var char2, char3;
|
||||
out = "";
|
||||
len = str.length;
|
||||
i = 0;
|
||||
while (i < len) {
|
||||
c = str.charCodeAt(i++);
|
||||
switch (c >> 4) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
// 0xxxxxxx
|
||||
out += str.charAt(i - 1);
|
||||
break;
|
||||
case 12:
|
||||
case 13:
|
||||
// 110x xxxx 10xx xxxx
|
||||
char2 = str.charCodeAt(i++);
|
||||
out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));
|
||||
break;
|
||||
case 14:
|
||||
// 1110 xxxx 10xx xxxx 10xx xxxx
|
||||
char2 = str.charCodeAt(i++);
|
||||
char3 = str.charCodeAt(i++);
|
||||
out += String.fromCharCode(((c & 0x0F) << 12) |
|
||||
((char2 & 0x3F) << 6) |
|
||||
((char3 & 0x3F) << 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
},
|
||||
mapFun() {
|
||||
const that = this
|
||||
uni.getLocation({
|
||||
|
@ -230,17 +291,11 @@
|
|||
});
|
||||
},
|
||||
repairsNavFun(index) {
|
||||
for (var i = 0; i < this.navDataState.length; i++) {
|
||||
this.navDataState[i].state = false
|
||||
}
|
||||
this.navDataState[index].state = true
|
||||
console.log(this.navDataState[index].is_device)
|
||||
this.data.is_device = this.navDataState[index].is_device
|
||||
this.current = index;
|
||||
},
|
||||
repairsTypeFun(index) {
|
||||
this.indexType = index
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -303,7 +358,7 @@
|
|||
|
||||
.fault-type-title {
|
||||
margin-top: 14rpx;
|
||||
width: 100%;
|
||||
/* width: 100%; */
|
||||
line-height: 80rpx;
|
||||
margin-bottom: 13rpx;
|
||||
border-top: 2rpx solid #e7e7e7;
|
||||
|
|
|
@ -367,7 +367,9 @@
|
|||
this.targetObj.faultImgList.push(imgsrc);
|
||||
}
|
||||
})
|
||||
}
|
||||
},fail:(err)=> {
|
||||
this.$toolAll.tools.checkQx(err.code);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 签到事件
|
||||
|
|
|
@ -231,7 +231,9 @@
|
|||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},fail:(err)=> {
|
||||
this.$toolAll.tools.checkQx(err.code);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 删除维保图片
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
<view class="mar-s20 mar-zy10" style="box-shadow: 0rpx 0rpx 20rpx rgba(0,0,0,.3);">
|
||||
<view class="bacf" style="padding: 4rpx;border-radius: 30rpx;">
|
||||
<view class="electronic-head disjcac fc">
|
||||
<image :src="userImg" mode="widthFix" lazy-load style="width: 347rpx;height: 85rpx;"></image>
|
||||
<image src="/static/public/icon-electronic-logo.png" mode="widthFix" lazy-load style="width: 347rpx;height: 85rpx;"></image>
|
||||
<view class="colf fon52 mar-sx30" style="letter-spacing: 6rpx;">ID:{{userId}}</view>
|
||||
<image class="mar-s10" src="/static/deleteImg/flying-img06.png" mode="aspectFill" style="width: 258rpx;height: 258rpx;border-radius: 100%;margin-bottom: -130rpx;border: 6rpx solid #edf1ff;background-color: #edf1ff;"></image>
|
||||
<image class="mar-s10 electronic-userImg" :src="userImg || '/static/deleteImg/flying-img06.png'" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="pad-s140 mar-s30 disjcac fc">
|
||||
<view class="col3 fon68">{{userName}}</view>
|
||||
<view class="fon32 col6 mar-sx30">{{userContent}}</view>
|
||||
<view class="fon22 col3 tcenter line-h36" style="margin: 60rpx 0 60rpx 0;">
|
||||
<view>+86 {{userPhone}}</view>
|
||||
<view v-if="userPhone">+86 {{userPhone}}</view>
|
||||
<view>{{userEmail}}</view>
|
||||
<view>{{website}}</view>
|
||||
</view>
|
||||
|
@ -30,13 +30,13 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
userImg:'/static/public/icon-electronic-logo.png',
|
||||
userId:'CW-0000',
|
||||
userName:'姓名',
|
||||
userContent:'市场部门 | 技术支持',
|
||||
userPhone:'123 4567 8910',
|
||||
userEmail:'12345678910qwer@890.com',
|
||||
website:'WWW.12345678910.com'
|
||||
userImg:'',//用户头像
|
||||
userId:'',//用户id
|
||||
userName:'',//用户昵称
|
||||
userContent:'',//用户单位
|
||||
userPhone:'',//用户电话
|
||||
userEmail:'',//用户邮箱
|
||||
website:''//用户网址
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
@ -50,12 +50,12 @@
|
|||
if(userData.avatar) {
|
||||
this.userImg = userData.avatar;
|
||||
}
|
||||
this.userId = userData.id;
|
||||
this.userName = userData.name;
|
||||
this.userContent = userData.affiliation;
|
||||
this.userPhone = userData.phone;
|
||||
this.userEmail = userData.email;
|
||||
this.website = userData.website;
|
||||
this.userId = userData.id;//用户id
|
||||
this.userName = userData.name;//用户昵称
|
||||
this.userContent = userData.affiliation;//用户单位
|
||||
this.userPhone = userData.phone;//用户电话
|
||||
this.userEmail = userData.email;//用户邮箱
|
||||
this.website = userData.website;//用户网址
|
||||
|
||||
}
|
||||
})
|
||||
|
@ -65,5 +65,5 @@
|
|||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
.electronic-userImg{width: 258rpx;height: 258rpx;border-radius: 100%;margin-bottom: -130rpx;border: 6rpx solid #edf1ff;background-color: #edf1ff;}
|
||||
</style>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<view class="mar-s10 mar-x30" style="color: #6b6a6a;">服务时间:{{project_time}}</view>
|
||||
<view class="radius20 pad30 dis" style="border: 2rpx solid #dcdcdc;">
|
||||
<image src="/static/public/icon-evaluate-pen.png" mode="widthFix" lazy-load style="width: 25rpx;height: 30rpx;"></image>
|
||||
<textarea v-model="serviceExperience" class="fon24 mar-z20 width100" style="height: 200rpx;" placeholder="写下您的服务体验,帮助我们更好的管理提升" placeholder-style="font-size:24rpx;color: #aaaaaa;" />
|
||||
<textarea v-model="serviceExperience" maxlength="-1" class="fon24 mar-z20 width100" style="height: 200rpx;" placeholder="写下您的服务体验,帮助我们更好的管理提升" placeholder-style="font-size:24rpx;color: #aaaaaa;" />
|
||||
</view>
|
||||
<view class="fon30 bold mar-sx30">上传图片</view>
|
||||
<view class="disac">
|
||||
|
@ -36,6 +36,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { uploadImg } from '@/jsFile/public-api.js';
|
||||
import rate from '@/components/rate.vue';
|
||||
export default {
|
||||
components:{
|
||||
|
@ -48,36 +49,54 @@
|
|||
{imgsrc:''},
|
||||
{imgsrc:''}
|
||||
],
|
||||
project_id:'',
|
||||
tempImgId:[],
|
||||
project_name:'长沙XXXXXXXXX项目名称',
|
||||
project_number:'GD20220108-1002',
|
||||
project_time:'2022-01-11 15 : 27',
|
||||
rateNum:5,//技术服务评分
|
||||
attitudeNum:5,//客服态度评分
|
||||
serviceExperience:'',//服务体验
|
||||
flag:true
|
||||
flag:true,
|
||||
orderId:''//工单id
|
||||
}
|
||||
},
|
||||
onLoad(op) {
|
||||
this.orderId = op.orderId;
|
||||
// 调用查询订单信息
|
||||
this.getOrderInfo();
|
||||
},
|
||||
methods: {
|
||||
// 查询订单信息
|
||||
getOrderInfo(){
|
||||
this.$requst.get('/universal/api.order/evaluate_order',{order_id:this.orderId}).then(res=>{
|
||||
if(res.code) {
|
||||
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交保存事件
|
||||
submitData(){
|
||||
if(this.flag) {
|
||||
this.flag = false;
|
||||
// this.flag = false;
|
||||
let idArr = [];
|
||||
idArr = this.tempImgId.filter(item => {return item!=''; });
|
||||
let params = {
|
||||
id:this.project_id,
|
||||
a:this.serviceExperience,
|
||||
b:this.imgList[0].imgsrc,
|
||||
c:this.imgList[1].imgsrc,
|
||||
d:this.imgList[2].imgsrc,
|
||||
f:this.rateNum,
|
||||
g:this.attitudeNum
|
||||
order_id:this.orderId,
|
||||
evaluate_content:this.serviceExperience,
|
||||
evaluate_images:idArr.join(','),
|
||||
technology_score:this.rateNum,
|
||||
customer_service_attitude_score:this.attitudeNum
|
||||
}
|
||||
console.log(params,74);
|
||||
// this.$requst.post('',params).then(res=>{
|
||||
// if(res.code) {
|
||||
// uni.navigateBack({delta:1})
|
||||
// }
|
||||
// })
|
||||
this.$requst.post('/universal/api.order/evaluate_order',params).then(res=>{
|
||||
if(res.code) {
|
||||
uni.navigateBack({delta:1})
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 选择图片
|
||||
|
@ -87,16 +106,13 @@
|
|||
sourceType:['album','camera'],
|
||||
sizeType:['compressed'],
|
||||
success: (res) => {
|
||||
let params = {
|
||||
dir:'images',
|
||||
from:res.tempFilePaths[0]
|
||||
}
|
||||
console.log(params,95);
|
||||
this.$requst.post('/universal/api.upload/upload',params).then(res=>{
|
||||
|
||||
uploadImg({path:res.tempFilePaths[0]}).then(resImg=>{
|
||||
this.imgList[index].imgsrc = res.tempFilePaths[0];
|
||||
this.tempImgId[index] = resImg.data.id;
|
||||
})
|
||||
this.imgList[index].imgsrc = res.tempFilePaths[0];
|
||||
}
|
||||
},fail:(err)=> {
|
||||
this.$toolAll.tools.checkQx(err.code);
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseRate(arr){
|
||||
|
|
|
@ -3,13 +3,10 @@
|
|||
<status-nav navBarTitle="我的账户" returnColor="#c2c2c2"></status-nav>
|
||||
<container-subgroup>
|
||||
<view slot="content" style="margin: -30rpx;">
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<!-- #ifdef APP-PLUS || MP-WEIXIN -->
|
||||
<view class="disja tcenter bbot fon32 position-sticky pad-s30" :style="{top: newTop +'px'}" style="background-color: #F5F5F5;">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="disja tcenter bbot fon32 position-sticky pad-s30" style="background-color: #F5F5F5;">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="disja tcenter bbot fon32 position-sticky pad-s30" :style="{top: newTop +'px'}" style="background-color: #F5F5F5;">
|
||||
<!-- #endif -->
|
||||
<view @tap="switchStatus(true)" class="width50 pad-x30" :class="current ? 'account-active' : ''">我的账户</view>
|
||||
|
@ -55,37 +52,44 @@
|
|||
<view>{{item.way}}</view>
|
||||
<view class="clips1">{{item.date}}</view>
|
||||
</view>
|
||||
<view class="mar-s180">
|
||||
<pitera v-if="incomeExpensesList.length==0" textStr="暂无更多收支明细"></pitera>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 未结算工单 -->
|
||||
<view v-else class="mar-s30 pad-zy10">
|
||||
<view class="bacf pad-sx20 pad-zy30 radius10 mar-x10" v-for="(item,index) in unsettledList" :key="index">
|
||||
<view class="fon28 disjbac">
|
||||
<view class="col3">{{item.title}}</view>
|
||||
<view class="col9">{{item.name}}</view>
|
||||
</view>
|
||||
<view class="fon24 disjbac mar-sx10">
|
||||
<view class="col9">工单编号:{{item.number}}</view>
|
||||
<view style="color: #00a2e9;">维保类型:{{item.type}}</view>
|
||||
</view>
|
||||
<view class="fon24">
|
||||
<view class="col9 disac width100">
|
||||
<image src="/static/public/icon-account-time.png" mode="scaleToFill" style="width: 23rpx;height: 23rpx;" lazy-load class="pad-y10 flexs"></image>
|
||||
{{item.date}}
|
||||
<view v-else>
|
||||
<view class="pad-sx30 pad-zy10">
|
||||
<view class="bacf pad-sx20 pad-zy30 radius10 mar-x10 animated fadeIn" v-for="(item,index) in unsettledList" :key="index">
|
||||
<view class="fon28 disjbac">
|
||||
<view class="col3">{{item.title}}</view>
|
||||
<view class="col9">{{item.name}}</view>
|
||||
</view>
|
||||
<view class="fon24 disjbac mar-sx10">
|
||||
<view class="col9">工单编号:{{item.number}}</view>
|
||||
<view style="color: #00a2e9;">维保类型:{{item.type}}</view>
|
||||
</view>
|
||||
<view class="fon24">
|
||||
<view class="col9 disac width100">
|
||||
<image src="/static/public/icon-account-time.png" mode="scaleToFill" style="width: 23rpx;height: 23rpx;" lazy-load class="pad-y10 flexs"></image>
|
||||
{{item.date}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="fon26 disjbac mar-s10">
|
||||
<view class="" style="color: #ff0000;">{{item.status}}</view>
|
||||
<view class="fon36"><text style="font-size: 24rpx;">¥</text>{{item.priceo}}</view>
|
||||
</view>
|
||||
<view class="bbot" style="margin: 20rpx -30rpx;"></view>
|
||||
<view class="fon24 col9 disac">
|
||||
<image src="/static/public/icon-account-address.png" mode="scaleToFill" style="width: 19rpx;height: 25rpx;" class="flexs mar-y10"></image>
|
||||
{{item.address}}
|
||||
</view>
|
||||
<view class="dis fe">
|
||||
<view class="unsettled-btn" @tap="goSettlementEv(item.id)">去结算</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fon26 disjbac mar-s10">
|
||||
<view class="" style="color: #ff0000;">{{item.status}}</view>
|
||||
<view class="fon36"><text style="font-size: 24rpx;">¥</text>{{item.priceo}}</view>
|
||||
</view>
|
||||
<view class="bbot" style="margin: 20rpx -30rpx;"></view>
|
||||
<view class="fon24 col9 disac">
|
||||
<image src="/static/public/icon-account-address.png" mode="scaleToFill" style="width: 19rpx;height: 25rpx;" class="flexs mar-y10"></image>
|
||||
{{item.address}}
|
||||
</view>
|
||||
<view class="dis fe">
|
||||
<view class="unsettled-btn" @tap="goSettlementEv(item.id)">去结算</view>
|
||||
</view>
|
||||
<nothing-page v-if="!total && !ifLoading" content="暂无更多未结算工单数据"></nothing-page>
|
||||
<pitera v-if="total==unsettledList.length && unsettledList.length" textStr="暂无更多未结算工单数据"></pitera>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -94,7 +98,11 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import pitera from '@/components/nothing/pitera.vue';
|
||||
export default {
|
||||
components:{
|
||||
pitera
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
newTop: uni.getSystemInfoSync().statusBarHeight + 40,
|
||||
|
@ -107,34 +115,108 @@
|
|||
},
|
||||
// 收支明细列表
|
||||
incomeExpensesList:[
|
||||
{prices:'1088',workOrderNum:'GD20220112-1001',way:'现金',date:'2019-7-24'},
|
||||
// {prices:'1088',workOrderNum:'GD20220112-1001',way:'现金',date:'2019-7-24'},
|
||||
],
|
||||
unsettledList:[
|
||||
{id:1,title:'株洲市XXX项目名称',name:'林小雨',number:'GD20220112-1001',date:'2022-01-12 13:25:16',type:'模组维保',status:'维保已完成',address:'湖南省长沙市xx区1001栋6-12',priceo:'260.0'},
|
||||
{id:2,title:'株洲市XXX项目名称',name:'林小雨',number:'GD20220112-1001',date:'2022-01-12 13:25:16',type:'模组维保',status:'维保已完成',address:'湖南省长沙市xx区1001栋6-12',priceo:'260.0'},
|
||||
{id:3,title:'株洲市XXX项目名称',name:'林小雨',number:'GD20220112-1001',date:'2022-01-12 13:25:16',type:'模组维保',status:'维保已完成',address:'湖南省长沙市xx区1001栋6-12',priceo:'260.0'},
|
||||
{id:4,title:'株洲市XXX项目名称',name:'林小雨',number:'GD20220112-1001',date:'2022-01-12 13:25:16',type:'模组维保',status:'维保已完成',address:'湖南省长沙市xx区1001栋6-12',priceo:'260.0'},
|
||||
// {id:1,title:'株洲市XXX项目名称',name:'林小雨',number:'GD20220112-1001',date:'2022-01-12 13:25:16',type:'模组维保',status:'维保已完成',address:'湖南省长沙市xx区1001栋6-12',priceo:'260.0'},
|
||||
],
|
||||
ifDetail:false
|
||||
ifDetail:false,
|
||||
size:10,
|
||||
page:1,
|
||||
total:0,
|
||||
ifLoading:true
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if(!this.current) {
|
||||
if(this.total!=this.unsettledList.length) {
|
||||
this.page++;
|
||||
// 调用查询未结算工单列表事件
|
||||
this.workWordEv();
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(op) {
|
||||
op.index*1 ? this.current = false : this.current = true;
|
||||
if(this.current) {
|
||||
// 调用查询我的账户信息
|
||||
this.getMyAccountInfo();
|
||||
} else {
|
||||
// 查询未结算工单列表事件
|
||||
this.workWordEv();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 查询未结算工单列表事件
|
||||
workWordEv(){
|
||||
uni.showLoading({
|
||||
title:'加载中...',
|
||||
mask:true
|
||||
})
|
||||
this.$requst.get('/universal/api.account/not_order',{list_rows:this.size,page:this.page}).then(res=>{
|
||||
if(res.code) {
|
||||
this.total = res.data.total;
|
||||
if(this.page==1) this.unsettledList = [];
|
||||
if(res.data.data.length) {
|
||||
res.data.data.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.project_id,//项目id
|
||||
title:item.project_name,//项目名称
|
||||
name:item.username,//负责人
|
||||
number:item.order_number,//工单编号
|
||||
date:item.completion_time,//完工时间
|
||||
type:item.fault_type,//维保类型
|
||||
status:'维保已完成',
|
||||
address:item.address,//项目详细地址
|
||||
priceo:item.pay_price//实际支付金额
|
||||
}
|
||||
this.unsettledList.push(obj);
|
||||
})
|
||||
}
|
||||
}
|
||||
uni.hideLoading();
|
||||
this.ifLoading = false;
|
||||
})
|
||||
},
|
||||
// 去结算事件
|
||||
goSettlementEv(id) {
|
||||
uni.navigateTo({
|
||||
url:`/pagesA/workOrder/workOrderThree?id=${id}`
|
||||
})
|
||||
},
|
||||
// 查询我的账户信息
|
||||
getMyAccountInfo(){
|
||||
this.$requst.get('/universal/api.account/my_account').then(res=>{
|
||||
if(res.code) {
|
||||
this.capitalDetail.totalPrice = this.$toolAll.tools.addXiaoShu(res.data.total_amount) // 账户总额
|
||||
this.capitalDetail.workOrderCost = this.$toolAll.tools.addXiaoShu(res.data.order_price) // 工单费用
|
||||
this.capitalDetail.technicalCommission = this.$toolAll.tools.addXiaoShu(res.data.money) // 技术佣金
|
||||
// if(res.data.amount_record.length) {
|
||||
// res.data.amount_record.forEach(item=>{
|
||||
// let obj = {
|
||||
// prices:'1088',//金额
|
||||
// workOrderNum:'GD20220112-1001',//工单编号
|
||||
// way:'现金',//方式
|
||||
// date:'2019-7-24',//工单日期
|
||||
// }
|
||||
// this.incomeExpensesList.push(obj);
|
||||
// })
|
||||
// }
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 切换状态
|
||||
switchStatus(status){
|
||||
this.current = status;
|
||||
this.page = 1;
|
||||
this.size = 10;
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration:0
|
||||
})
|
||||
status ? this.getMyAccountInfo() : this.workWordEv();
|
||||
},
|
||||
// 查看明细事件
|
||||
checkDetailedEv(){
|
||||
|
|
|
@ -3,45 +3,86 @@
|
|||
<status-nav navBarTitle="新产品" returnColor="#c2c2c2"></status-nav>
|
||||
<container-subgroup>
|
||||
<view slot="content" style="margin: 0 -16rpx;" class="fon28">
|
||||
<view @tap="goDetail(index)" class="bacf radius10 pad-sx20 pad-zy10 disjbac mar-x20" style="box-shadow: 0rpx 3rpx 20rpx rgba(0,0,0,.3);" v-for="(item,index) in 20" :key="index">
|
||||
<image src="/static/del/img001.png" mode="aspectFill" lazy-load class="flexs" style="width: 240rpx;height: 184rpx;"></image>
|
||||
<view @tap="goDetail(index)" class="bacf radius10 pad-sx20 pad-zy10 disjbac mar-x20 animated fadeIn" style="box-shadow: 0rpx 3rpx 20rpx rgba(0,0,0,.3);" v-for="(item,index) in dataList" :key="index">
|
||||
<image :src="item.imgsrc" mode="aspectFill" lazy-load class="flexs" style="width: 240rpx;height: 184rpx;"></image>
|
||||
<view style="height: 184rpx;" class="width100 disjb fc pad-zy20 fon24">
|
||||
<view class=" clips2">智能会议平板交互电子白板会议一体机视 频会议多媒体教学培训</view>
|
||||
<view style="display: flex;align-items: center;font-size: 26rpx;">
|
||||
<view style="color: #00a2e9;border: 1rpx solid #00a2e9;border-radius: 6rpx;padding: 2rpx 10rpx;display: inline-flex;justify-content: center;align-items: center;font-size: 26rpx;">联系在线客服</view>
|
||||
<view class=" clips2">{{item.title}}</view>
|
||||
<view class="fon26 disac">
|
||||
<view class="contact-box" @tap.stop="contactEv">联系在线客服</view>
|
||||
</view>
|
||||
<view class="disjbac">
|
||||
<view class="col9">起订量:1台起批</view>
|
||||
<view style="color: #0ac9ea;">1135想采购</view>
|
||||
<view class="col9">起订量:{{item.num}}起批</view>
|
||||
<view style="color: #0ac9ea;">{{item.peopleNum}}想采购</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<pitera v-if="total==dataList.length && dataList.length" textStr="暂无更多新产品列表数据"></pitera>
|
||||
<nothing-page v-if="!dataList.length && !ifLoading" content="暂无更多新产品列表数据"></nothing-page>
|
||||
</view>
|
||||
</container-subgroup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pitera from '@/components/nothing/pitera.vue';
|
||||
export default {
|
||||
components:{
|
||||
pitera
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
dataList:[
|
||||
{id:1,imgsrc:'/static/del/img001.png',title:'智能会议平板交互电子白板会议一体机视 频会议多媒体教学培训',num:'1台',peopleNum:'1135'},
|
||||
],
|
||||
page:1,
|
||||
size:20,
|
||||
total:0,
|
||||
ifLoading:true
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.total!=this.dataList.length) {
|
||||
this.page++;
|
||||
// 调用获取新产品列表
|
||||
this.getProductEv();
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
// 调用获取新产品列表
|
||||
this.getProductEv();
|
||||
},
|
||||
methods: {
|
||||
// 获取新产品列表
|
||||
getProductEv(){
|
||||
uni.showLoading({
|
||||
title:'加载中...',
|
||||
mask:true
|
||||
})
|
||||
// this.$request.get('',{list_rows:this.size,page:this.page}).then(res=>{
|
||||
// if(res.code) {
|
||||
// this.total = res.data.total;
|
||||
// if(this.page==1) this.dataList = [];
|
||||
// } else {
|
||||
// this.$toolAll.tools.showToast(res.msg);
|
||||
// }
|
||||
uni.hideLoading();
|
||||
this.ifLoading = false;
|
||||
// })
|
||||
},
|
||||
// 去新产品详情
|
||||
goDetail(index){
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/plan-fault-product-detail/detail?index=2'
|
||||
})
|
||||
},
|
||||
// 联系客服
|
||||
contactEv(){
|
||||
this.$toolAll.tools.countCustomer('15616330510');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
.contact-box{color: #00a2e9;border: 1rpx solid #00a2e9;border-radius: 6rpx;padding: 2rpx 10rpx;display: inline-flex;justify-content: center;align-items: center;font-size: 26rpx;}
|
||||
</style>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<view class="bacf pad-sx30 pad-zy40 disac bbot">
|
||||
<view class="bold width30 flexs">联系电话</view>
|
||||
<view class="width100" style="color: #8b8b8b;">
|
||||
<input type="number" v-model="contact_number" placeholder="请输入联系电话" placeholder-style="font-size:28rpx;color:#8b8b8b;" />
|
||||
<input type="number" v-model="contact_number" maxlength="11" placeholder="请输入联系电话" placeholder-style="font-size:28rpx;color:#8b8b8b;" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="bacf pad-sx30 pad-zy40 disac bbot">
|
||||
|
@ -123,7 +123,7 @@
|
|||
// 姓名
|
||||
this.full_name=res.data.name;
|
||||
// res.data.sex ==> 2:男 1:女 0:未知
|
||||
res.data.sex != 1 ? this.genderNum = 1 : this.genderNum = 2;
|
||||
res.data.sex != 2 ? this.genderNum = 1 : this.genderNum = 2;
|
||||
// 联系电话
|
||||
this.contact_number=res.data.phone;
|
||||
// 电子邮箱
|
||||
|
@ -140,6 +140,7 @@
|
|||
this.imgList[3] = res.data.agreement_document;
|
||||
// 技能证书
|
||||
this.imgList[4] = res.data.skills_certificate;
|
||||
// this.temporaryImg = this.imgList[4];
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -205,7 +206,20 @@
|
|||
result = true;
|
||||
}
|
||||
} else {
|
||||
result = true;
|
||||
// 如果不是工程师
|
||||
if(this.contact_number || this.e_mail || this.id_card_no) {
|
||||
if(this.$toolAll.tools.isPhone(this.contact_number) && this.contact_number) {
|
||||
this.$toolAll.tools.showToast('请正确输入联系电话');
|
||||
} else if(this.$toolAll.tools.isEmail(this.e_mail) && this.e_mail) {
|
||||
this.$toolAll.tools.showToast('请正确输入电子邮箱');
|
||||
} else if(this.$toolAll.tools.isIdentity(this.id_card_no) && this.id_card_no) {
|
||||
this.$toolAll.tools.showToast('请正确输入身份证号码');
|
||||
} else {
|
||||
result = true;
|
||||
}
|
||||
} else {
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
@ -227,7 +241,9 @@
|
|||
this.temporaryImg[index] = res.data.id;
|
||||
}
|
||||
})
|
||||
}
|
||||
},fail:(err)=> {
|
||||
this.$toolAll.tools.checkQx(err.code);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 预览图片
|
||||
|
@ -238,13 +254,17 @@
|
|||
if(current==index) arr.push(item);
|
||||
})
|
||||
if(arr.length) {
|
||||
uni.previewImage({
|
||||
current:current,
|
||||
urls: arr,
|
||||
success() {}
|
||||
})
|
||||
if(arr[0]) {
|
||||
uni.previewImage({
|
||||
current:current,
|
||||
urls: arr,
|
||||
success() {}
|
||||
})
|
||||
} else {
|
||||
this.$toolAll.tools.showToast('请上传,再查看')
|
||||
}
|
||||
} else {
|
||||
this.$toolAll.tools.showToast('无内容...')
|
||||
this.$toolAll.tools.showToast('请上传,再查看')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,9 @@
|
|||
</view>
|
||||
<view class="disjbac col9">
|
||||
<view class="disac">
|
||||
热度:<rate :size="32" :gutter="10" :readonly="true" v-model="item.hot*1"></rate>
|
||||
热度:
|
||||
<!-- <rate :size="32" :gutter="10" :readonly="true" v-model="item.hot*1"></rate> -->
|
||||
<image src="/static/iocn/6.png" v-for="(item1,index1) in item.hot*1" :key="index1" class="mar-y10" style="width: 32rpx;height: 32rpx;" mode="widthFix"></image>
|
||||
</view>
|
||||
<view>{{item.reading}}人已查阅</view>
|
||||
</view>
|
||||
|
|
|
@ -23,31 +23,31 @@
|
|||
<view class="col9">{{cacheSize}}</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view class="bacf pad30 disjbac mar-s20 bbot">
|
||||
<view @tap="gopageEv(0)" class="bacf pad30 disjbac mar-s20 bbot">
|
||||
<view>上门服务条款</view>
|
||||
<view class="disac col9">
|
||||
V3.0<i class="icon icon-next col9 mar-z10" style="font-size: 26rpx;"></i>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bacf pad30 disjbac bbot">
|
||||
<view @tap="gopageEv(1)" class="bacf pad30 disjbac bbot">
|
||||
<view>用户服务协议</view>
|
||||
<view class="disac col9">
|
||||
V1.1<i class="icon icon-next col9 mar-z10" style="font-size: 26rpx;"></i>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bacf pad30 disjbac bbot">
|
||||
<view @tap="gopageEv(2)" class="bacf pad30 disjbac bbot">
|
||||
<view>飞猴云服务隐私政策</view>
|
||||
<view class="disac col9">
|
||||
V1.2<i class="icon icon-next col9 mar-z10" style="font-size: 26rpx;"></i>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bacf pad30 disjbac bbot">
|
||||
<view @tap="gopageEv(3)" class="bacf pad30 disjbac bbot">
|
||||
<view>技术服务合作协议</view>
|
||||
<view class="disac col9">
|
||||
V1.1<i class="icon icon-next col9 mar-z10" style="font-size: 26rpx;"></i>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bacf pad30 disjbac bbot">
|
||||
<view @tap="gopageEv(4)" class="bacf pad30 disjbac bbot">
|
||||
<view>关于飞猴云服务</view>
|
||||
<view class="disac col9">
|
||||
V1.1<i class="icon icon-next col9 mar-z10" style="font-size: 26rpx;"></i>
|
||||
|
@ -143,6 +143,12 @@
|
|||
// 检测版本事件
|
||||
checkEdition(){
|
||||
console.log('检测版本事件');
|
||||
},
|
||||
// 去服务协议、服务条款、隐私政策、合作协议、飞猴云服务页面
|
||||
gopageEv(index) {
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/agreement'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue