Commit b4a1e9ea by 李嘉林

index页面接口修改

parent fbaba097
......@@ -32,6 +32,9 @@ console.log(process.env,'-----------------config------')
mini_certified(options) {
return requestPOST(`${process.env.OLSHOP_URL}wx/mini_certified`,options)
},
//获取openid
get_open_id_by_code(options){
return requestGET(`${process.env.OLSHOP_URL}/wx/get_open_id_by_code?code=${options.code}&channel=1`,)
},
}
\ No newline at end of file
......@@ -107,11 +107,12 @@ export default {
wx.login({
success: res => {
this.code = res.code;
login.miniLogin({ code: this.code}).then(res1 => {
console.log(this.code,'-----------------------------110---code')
login.get_open_id_by_code({ code: this.code}).then(res1 => {
if (res1.data.code == 200) {
wx.setStorage({
key: "openid",
data: res1.data.data.openid
data: res1.data.data
});
}
this.params += '&open_id='+wx.getStorageSync("openid");
......
......@@ -11,7 +11,7 @@
<div class="btn_info1">
<h1>绑定手机号</h1>
<p class="hint">绑定手机号,同步历史订单</p>
<button class="btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">微信授权一键绑定</button>
<button class="btn" v-if="showGetPhoneBtn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">微信授权一键绑定</button>
<div class="btn2" @click="handbindHandle">手动绑定手机号</div>
<div class="cancelLogin" @click="cancelLogin">暂不登录</div>
</div>
......@@ -85,6 +85,12 @@ export default {
queryOptions:{},
};
},
computed: {
showGetPhoneBtn() {
// 梵蜜琳隐藏一键获取手机号
return this.$store.state.mixid != 'sivrl5';
}
},
onShow() {
wx.checkSession({
success : () => {
......
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