Commit b4a1e9ea by 李嘉林

index页面接口修改

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