diff --git a/App.vue b/App.vue index 2111e88..1a5c86c 100644 --- a/App.vue +++ b/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() { diff --git a/commons/base.css b/commons/base.css index 424f536..398c926 100644 --- a/commons/base.css +++ b/commons/base.css @@ -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;} diff --git a/commons/flying-monkey.css b/commons/flying-monkey.css index 3033d70..647e997 100644 --- a/commons/flying-monkey.css +++ b/commons/flying-monkey.css @@ -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; diff --git a/components/foot-tabs/foot-tab-one.vue b/components/foot-tabs/foot-tab-one.vue index f409427..0c02730 100644 --- a/components/foot-tabs/foot-tab-one.vue +++ b/components/foot-tabs/foot-tab-one.vue @@ -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); + } }); }, // 获取文件地址函数 diff --git a/jsFile/tools.js b/jsFile/tools.js index 51c61c8..7d5fae3 100644 --- a/jsFile/tools.js +++ b/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 自动返回上一页事件 diff --git a/js_sdk/wa-permission/permission.js b/js_sdk/wa-permission/permission.js new file mode 100644 index 0000000..9981504 --- /dev/null +++ b/js_sdk/wa-permission/permission.js @@ -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 +} diff --git a/manifest.json b/manifest.json index 40e952c..b6c500b 100644 --- a/manifest.json +++ b/manifest.json @@ -32,10 +32,12 @@ "", "", "", + "", "", "", "", "", + "", "" ] }, diff --git a/pages/forget/forget.vue b/pages/forget/forget.vue index 2bfdd98..1d8929b 100644 --- a/pages/forget/forget.vue +++ b/pages/forget/forget.vue @@ -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); } diff --git a/pages/guide-page/guide-page.vue b/pages/guide-page/guide-page.vue index 81427ec..024d7e4 100644 --- a/pages/guide-page/guide-page.vue +++ b/pages/guide-page/guide-page.vue @@ -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) } } } diff --git a/pages/login/login.vue b/pages/login/login.vue index fbeaf3b..96b5692 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -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); } diff --git a/pages/tabbar/my/my.vue b/pages/tabbar/my/my.vue index 5e641c9..16aa31d 100644 --- a/pages/tabbar/my/my.vue +++ b/pages/tabbar/my/my.vue @@ -18,13 +18,11 @@ - - + @@ -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;"> - - + + + + {{item.title}} @@ -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%;} diff --git a/pages/tabbar/pagehome/pagehome.vue b/pages/tabbar/pagehome/pagehome.vue index 9f91770..06c5ddf 100644 --- a/pages/tabbar/pagehome/pagehome.vue +++ b/pages/tabbar/pagehome/pagehome.vue @@ -10,20 +10,14 @@ - - - - 拨打电话 - - - + 拨打电话 - + @@ -164,7 +158,7 @@ - + {{item.num}} {{item.title}} @@ -175,9 +169,11 @@ 其他 - + - + + + {{item.title}} @@ -478,7 +474,8 @@ }, // 拨打电话事件 callEv(){ - this.$toolAll.tools.countCustomer('15616330510'); + // this.$toolAll.tools.countCustomer('15616330510'); + this.$toolAll.tools.countCustomer('17366921088'); } } } diff --git a/pagesA/appreciationServe/appreciationServe.vue b/pagesA/appreciationServe/appreciationServe.vue index d7ea6d3..5ebb6ed 100644 --- a/pagesA/appreciationServe/appreciationServe.vue +++ b/pagesA/appreciationServe/appreciationServe.vue @@ -57,13 +57,13 @@ *联系电话 - + *预约时间 - @@ -97,6 +97,7 @@ @@ -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; diff --git a/pagesA/workOrder/workOrder.vue b/pagesA/workOrder/workOrder.vue index 3f4bb71..e237565 100644 --- a/pagesA/workOrder/workOrder.vue +++ b/pagesA/workOrder/workOrder.vue @@ -367,7 +367,9 @@ this.targetObj.faultImgList.push(imgsrc); } }) - } + },fail:(err)=> { + this.$toolAll.tools.checkQx(err.code); + } }) }, // 签到事件 diff --git a/pagesA/workOrder/workorderTwo.vue b/pagesA/workOrder/workorderTwo.vue index 8777462..005d84f 100644 --- a/pagesA/workOrder/workorderTwo.vue +++ b/pagesA/workOrder/workorderTwo.vue @@ -231,7 +231,9 @@ } }) }) - } + },fail:(err)=> { + this.$toolAll.tools.checkQx(err.code); + } }) }, // 删除维保图片 diff --git a/pagesB/electronic-certificate/electronic-certificate.vue b/pagesB/electronic-certificate/electronic-certificate.vue index 16b1dbb..cce3cec 100644 --- a/pagesB/electronic-certificate/electronic-certificate.vue +++ b/pagesB/electronic-certificate/electronic-certificate.vue @@ -6,15 +6,15 @@ - + ID:{{userId}} - + {{userName}} {{userContent}} - +86 {{userPhone}} + +86 {{userPhone}} {{userEmail}} {{website}} @@ -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 @@ diff --git a/pagesB/i-want-evaluate/i-want-evaluate.vue b/pagesB/i-want-evaluate/i-want-evaluate.vue index 4ea2f06..3e5a5f2 100644 --- a/pagesB/i-want-evaluate/i-want-evaluate.vue +++ b/pagesB/i-want-evaluate/i-want-evaluate.vue @@ -11,7 +11,7 @@ 服务时间:{{project_time}} -