123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <template>
- <view class="content">
- <image class="logo" src="/static/logo.png" @click="wxgologin"></image>
-
- <view >shopId:{{shopId}}</view>
- <view>
- url:{{url}}
- </view>
-
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- shopId: '',
- url:'',
- }
- },
- onLoad() {
- this.$common.getExtStoreId()
- var ext=this.$common.getExtStoreId();
- console.log(ext)
- this.shopId=ext.shopId;
- this.url=ext.url;
- this.uniLogin()
- },
- methods: {
- wxgologin(){
- var that=this;
- uni.getUserProfile({
- lang:'zh_CN',
- desc:'登录',
- success:(res)=>{
- console.log(res);
- that.wxdata=res;
- uni.setStorage({
- key: 'wxdata',
- data: res,
- success: function () {
- that.uniLogin()
-
- }
- });
- },
- fail:(res)=>{
- console.log(res)
- }
- });
- },
- uniLogin(){
- var that=this;
- uni.login({
- provider: 'weixin',
- success: function (loginRes) {
- console.log(loginRes);
- that.getWxOpenID(loginRes)
- }
- });
- },
- getWxOpenID(e){
- this.$http('miniApp2/sys/getWxOpenID', {
- code:e.code,
- shopId:'E37BB296-5A08-4534-859D-B351BA611AF9'
- },'GET').then(res => {
-
- })
- },
-
- }
- }
- </script>
- <style>
-
- .logo {
- height: 200rpx;
- width: 200rpx;
- margin-top: 200rpx;
- margin-left: auto;
- margin-right: auto;
- margin-bottom: 50rpx;
- }
- </style>
|