Commit 4a58a1ab authored by geruidan's avatar geruidan

首页注册

parent 4e2f16d3
...@@ -4,15 +4,6 @@ ...@@ -4,15 +4,6 @@
"^mpShop-(.*)": "@/components/mpShop-$1/mpShop-$1.vue" "^mpShop-(.*)": "@/components/mpShop-$1/mpShop-$1.vue"
}, },
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path" : "pages/h5/bindPh",
"style" :
{
"navigationBarTitleText": "立即绑定",
"enablePullDownRefresh": false
}
},
{ {
"path" : "pages/index/defalutScreen", "path" : "pages/index/defalutScreen",
"style" : "style" :
...@@ -89,6 +80,15 @@ ...@@ -89,6 +80,15 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path" : "pages/h5/bindPh",
"style" :
{
"navigationBarTitleText": "立即绑定",
"enablePullDownRefresh": false
}
} }
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
"list": [ "list": [
{ {
"name": "pay", //模式名称 "name": "pay", //模式名称
"path": "/pages/h5/pay" //启动页面,必选 "path": "/pages/index/defalutScreen" //启动页面,必选
} }
] ]
}, },
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
mapGetters mapGetters
} from 'vuex' } from 'vuex'
import http from '@/shopro/request/index'; import http from '@/shopro/request/index';
import qs from 'qs';
export default { export default {
data() { data() {
return { return {
...@@ -76,7 +77,7 @@ ...@@ -76,7 +77,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.bindPh{ .bindPh{
margin: 0 auto; margin: 0 auto;
padding: 100rpx 0 ; padding: 300rpx 0 ;
width: 90%; width: 90%;
margin: 0 auto; margin: 0 auto;
// text-align: center; // text-align: center;
......
<template> <template>
<view class="screen-container"> <view class="screen-container">
<image class="bg" src="../../static/img/screen/screen-bg.png" mode="scaleToFill" /> <image class="bg" src="../../static/img/screen/screen-bg.png" mode="scaleToFill" />
<button v-if="unregistered" @click="changeTabBar" class="btn"> <button @click="enter" class="btn">
马上进入 马上进入
</button> </button>
<!-- open-type="getPhoneNumber" @getphonenumber="getInfoPhoneNumber" --> <!-- open-type="getPhoneNumber" @getphonenumber="getInfoPhoneNumber" -->
<button v-else class="btn" @click="getInfoPhoneNumber"> <!-- <button v-else class="btn" @click="getInfoPhoneNumber">
微信授权登录 微信授权登录
</button> </button> -->
</view> </view>
</template> </template>
<script> <script>
...@@ -29,28 +29,27 @@ ...@@ -29,28 +29,27 @@
}, },
methods: { methods: {
...mapActions(['getPhoneNumber', 'registerInfoFn', 'authCheck', 'getUserInfo']), ...mapActions(['getPhoneNumber', 'registerInfoFn', 'authCheck', 'getUserInfo']),
// 切换底部tab; // 马上进入
changeTabBar() { enter() {
if (this.unregistered) { if (this.unregistered) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/h5/index', url: '/pages/h5/index',
}) })
} }else{
}, this.getInfoPhoneNumber()
}},
// 获取手机号 // 获取手机号
async getInfoPhoneNumber(e) { async getInfoPhoneNumber(e) {
// let number = await this.getPhoneNumber(e); // let number = await this.getPhoneNumber(e);
let register = await this.registerInfoFn(); let register = await this.registerInfoFn();
if (register) { //注册成功 if (register) { //注册成功
this.unregistered = true; this.unregistered = true;
uni.showToast({ uni.navigateTo({
title: "授权成功,点击马上进入", url: '/pages/h5/index',
duration: 2000, })
icon:'none'
});
} }
}, },
async authAndWeRun() { async auth() {
let auth = await this.authCheck(); let auth = await this.authCheck();
console.log("调用authcheck的值"+auth) console.log("调用authcheck的值"+auth)
let that = this; let that = this;
...@@ -78,7 +77,7 @@ ...@@ -78,7 +77,7 @@
if (this.checkSessionStatus && token) { if (this.checkSessionStatus && token) {
let token = uni.getStorageSync('token'); let token = uni.getStorageSync('token');
console.log("token的值===================="+token) console.log("token的值===================="+token)
this.authAndWeRun(); this.auth();
} else { } else {
console.log("走吗1") console.log("走吗1")
// session 不存在,调用login。userInfo 。更新session // session 不存在,调用login。userInfo 。更新session
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment