App.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <script>
  2. import { getStatusBar } from '@/utils/index';
  3. export default {
  4. onLaunch: function() {
  5. console.log('App Launch')
  6. getStatusBar();
  7. },
  8. onShow: function() {
  9. console.log('App Show')
  10. },
  11. onHide: function() {
  12. console.log('App Hide')
  13. },
  14. getPhoneNumber: function({ params, success, fail }) {
  15. console.log("获取手机号码",params,success,fail)
  16. const { iv, encryptedData } = params;
  17. // ...
  18. // 开发者服务端解密 encryptedData,得到手机号
  19. // ...
  20. const result = {
  21. phoneNumber: '13580006666',
  22. }
  23. // 回调前端模板
  24. success(result)
  25. },
  26. }
  27. </script>
  28. <style>
  29. .skeleton-line{
  30. background: linear-gradient(90deg, #f1f2f4 25%, #e6e6e6 37%, #f1f2f4 50%);
  31. background-size: 400% 100%;
  32. border-radius: 3px;
  33. height: 30upx;
  34. width: 100%;
  35. margin-top: 20upx;
  36. }
  37. .skeleton-line.short{
  38. width: 60%;
  39. }
  40. .skeleton-line.max{
  41. height: 80upx;
  42. }
  43. .animate {
  44. animation: skeleton 1.8s ease infinite
  45. }
  46. @keyframes skeleton {
  47. 0% {
  48. background-position: 100% 50%
  49. }
  50. 100% {
  51. background-position: 0 50%
  52. }
  53. }
  54. </style>