index.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. export default {
  2. data() {
  3. return {
  4. user:{},
  5. pic:'static/img/user.png',
  6. show:true,
  7. }
  8. },
  9. onLoad() {
  10. },
  11. methods: {
  12. gotoUrl(url,bl){
  13. if(this.user||bl){
  14. uni.navigateTo({
  15. url:url
  16. })
  17. }else{
  18. this.$refs.common.alert('请登录后操作!')
  19. }
  20. },
  21. makePhoneCall(tel){
  22. uni.makePhoneCall({
  23. phoneNumber: tel //仅为示例
  24. });
  25. },
  26. showphone(phone){
  27. if(!phone){
  28. return "";
  29. }
  30. if(phone.length!=11){
  31. return "";
  32. }
  33. return phone.substring(0,3)+'****'+phone.substring(8);
  34. },
  35. signOut(){
  36. this.$refs.common.setFnc(()=>{
  37. this.carhelp.signOut()
  38. uni.redirectTo({
  39. url: '/pages/car/login'
  40. })
  41. })
  42. this.$refs.common.confirm('确认是否退出账号?')
  43. }
  44. },onReady(){
  45. this.user=this.carhelp.getPersonInfo();
  46. if(this.user.faceImage){
  47. this.pic=this.user.faceImage;
  48. }
  49. },onShow(){
  50. this.user=this.carhelp.getPersonInfo();
  51. if(this.user.faceImage){
  52. this.pic=this.user.faceImage;
  53. }
  54. }
  55. }