球星卡微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.0 KiB

  1. <script>
  2. export default {
  3. globalData: {
  4. wxlogin: () => {}, // 登录方法
  5. },
  6. onLaunch: function() {
  7. console.log('App Launch');
  8. this.globalData.wxlogin = this.wxlogin;
  9. },
  10. onShow: function() {
  11. console.log('App Show')
  12. },
  13. onHide: function() {
  14. console.log('App Hide')
  15. },
  16. methods: {
  17. wxlogin(){
  18. return new Promise((resolve, rejecj) => {
  19. uni.login({
  20. complete: result => {
  21. if(result.errMsg == 'login:ok'){
  22. let code = result.code;
  23. console.log("login.code", code);
  24. // this.$http(this.API.API_WXLOGIN, { code }).then(res => {
  25. // console.log("获得用户信息", res);
  26. // uni.setStorageSync('userinfo', res.data);
  27. // resolve(res.data);
  28. // })
  29. }
  30. }
  31. })
  32. })
  33. },
  34. }
  35. }
  36. </script>
  37. <style>
  38. @import url("styles/common.css");
  39. @import url("styles/lanhu.css");
  40. @import url("styles/iconFont.css");
  41. /*每个页面公共css */
  42. page{
  43. background-color: #F6F6F6;
  44. }
  45. .splitLine{
  46. background-color: rgba(0,0,0,0.06);
  47. height: 1rpx;
  48. }
  49. </style>