user.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <view class="content">
  3. 我的
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. shopId: '',
  11. url:'',
  12. }
  13. },
  14. onLoad() {
  15. this.$common.getExtStoreId()
  16. var ext=this.$common.getExtStoreId();
  17. console.log(ext)
  18. this.shopId=ext.shopId;
  19. this.url=ext.url;
  20. this.uniLogin()
  21. },
  22. methods: {
  23. wxgologin(){
  24. var that=this;
  25. uni.getUserProfile({
  26. lang:'zh_CN',
  27. desc:'登录',
  28. success:(res)=>{
  29. console.log(res);
  30. that.wxdata=res;
  31. uni.setStorage({
  32. key: 'wxdata',
  33. data: res,
  34. success: function () {
  35. that.uniLogin()
  36. }
  37. });
  38. },
  39. fail:(res)=>{
  40. console.log(res)
  41. }
  42. });
  43. },
  44. uniLogin(){
  45. uni.login({
  46. provider: 'weixin',
  47. success: function (loginRes) {
  48. console.log(loginRes);
  49. }
  50. });
  51. }
  52. }
  53. }
  54. </script>
  55. <style>
  56. .logo {
  57. height: 200rpx;
  58. width: 200rpx;
  59. margin-top: 200rpx;
  60. margin-left: auto;
  61. margin-right: auto;
  62. margin-bottom: 50rpx;
  63. }
  64. </style>