|
@@ -20,7 +20,11 @@
|
|
|
</view>
|
|
|
<van-toast id="van-toast"/>
|
|
|
<van-dialog id="van-dialog"/>
|
|
|
- <!-- <official-account @load="official_success"></official-account>-->
|
|
|
+ <van-overlay :show="official_show" @click="onClickHide">
|
|
|
+ <div class="official_container">
|
|
|
+ <official-account @load="official_success"></official-account>
|
|
|
+ </div>
|
|
|
+ </van-overlay>
|
|
|
|
|
|
</div>
|
|
|
</template>
|
|
@@ -28,14 +32,15 @@
|
|
|
import Toast from '../../../static/vant/toast/toast';
|
|
|
import Dialog from '../../../static/vant/dialog/dialog';
|
|
|
import user_store from '@/store/index'
|
|
|
-import {userCheckInvite} from "../../requests/user";
|
|
|
+import {userCheckInvite, userCheckUnionid} from "../../requests/user";
|
|
|
|
|
|
var $this
|
|
|
export default {
|
|
|
name: "login_container",
|
|
|
data() {
|
|
|
return {
|
|
|
- is_scan: false
|
|
|
+ is_scan: false,
|
|
|
+ official_show: false
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -77,10 +82,24 @@ export default {
|
|
|
},
|
|
|
official_success($e) {
|
|
|
console.log('关注组件加载成功', $e)
|
|
|
+ },
|
|
|
+ onClickHide() {
|
|
|
+ $this.official_show = false
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log(1)
|
|
|
+ mpvue.login({
|
|
|
+ success($res) {
|
|
|
+ let $js_code = $res.code
|
|
|
+ user_store.setters.setJsCode($js_code)
|
|
|
+ //检验js_code
|
|
|
+ userCheckUnionid($js_code).then((res) => {
|
|
|
+ let $res = res.data;
|
|
|
+ let $data = $res.data;
|
|
|
+ $this.official_show = $data['have_unionid'] == 2
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
let $this = this
|
|
@@ -134,4 +153,10 @@ export default {
|
|
|
font-size: 11px;
|
|
|
padding: 8px 0px;
|
|
|
}
|
|
|
+
|
|
|
+.official_container {
|
|
|
+ width: 300px;
|
|
|
+ margin: auto;
|
|
|
+ margin-top: 300px;
|
|
|
+}
|
|
|
</style>
|