Commit fde2768a by 张卓

登陆页面js,html

parent 2627491e
......@@ -19,6 +19,10 @@ console.log(process.env,'-----------------config------')
// sso登录
getSsoBcakUrl(options) {
return requestPOST(`${process.env.OLSHOP_URL}/common/getSsoCallbackUrl`,options)
}
},
//获取用户协议
getShopUserProtocol() {
return requestPOST(`${process.env.OLSHOP_URL}/getShopUserProtocol`)
},
}
\ No newline at end of file
......@@ -24,6 +24,23 @@
</div>
<div class="layer" @click="isShowPhone = false"></div>
</div>
<div class="readAgreement">
<van-checkbox :value="checked" @click="checked = !checked">我已阅读并同意</van-checkbox>
<span v-if="content" @click="contentShow = true">《用户协议》</span>
</div>
<van-popup
:show="contentShow"
custom-style="width:80vw;height:80vh;background:#fff;"
:close-on-click-overlay="true"
@close="closeDia"
>
<div class="posterWrap">
<div v-html="content"></div>
</div>
<div class="posterWrap_btn">
<div @click="conF">我已阅读并同意</div>
</div>
</van-popup>
</div>
</template>
......@@ -36,6 +53,9 @@ import indexApi from "@/api/index.js";
export default {
data() {
return {
checked: false,
contentShow: false,
content: '',
code: "",
session_key: "",
shopName: "",
......@@ -93,6 +113,12 @@ export default {
});
},
onLoad(options) {
login.getShopUserProtocol().then(res => {
console.log(res,777888999)
if(res.data.code == '200') {
this.content = res.data.data;
}
});
Object.assign(this.$data, this.$options.data()); //mpvue 的混合周期 使用小程序生命周期数据未初始化
options.scene && (this.scene = options.scene);
if (options.back) {
......@@ -107,6 +133,13 @@ export default {
this.getshop();
},
methods: {
conF() {
this.contentShow = false;
this.checked = true;
},
closeDia() {
this.contentShow = false;
},
getshop() {
this.shopName = wx.getStorageSync("shopName");
this.logoUrl = wx.getStorageSync("logoUrl");
......@@ -170,6 +203,17 @@ export default {
}
},
getUserProfile() {
if(this.content&&!this.checked) {
wx.showToast({
title: '您还未同意协议',
icon: "none"
});
return
}
wx.showLoading({
title: '登录中...',
mask: true
})
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({
......@@ -213,6 +257,9 @@ export default {
wx.showToast({ title: err, icon: "none" });
});
},
fail: (e) => {
wx.hideLoading()
}
});
},
checkLogin(e) {
......@@ -249,6 +296,7 @@ export default {
} else {
//不是会员需要绑定手机号
this.isShowPhone = true;
wx.hideLoading()
this.addRecord(true);
}
}
......@@ -261,6 +309,7 @@ export default {
wx.hideLoading();
//不是会员需要绑定手机号
this.isShowPhone = true;
wx.hideLoading()
this.addRecord(true);
}
}
......
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