Commit aa1f8ba7 by 李嘉林

抖音兼容

parent 654db285
...@@ -2,9 +2,15 @@ ...@@ -2,9 +2,15 @@
export default { export default {
created () { created () {
// NODE_ENV // NODE_ENV
let extConfig = wx.getExtConfigSync? wx.getExtConfigSync(): {} let extConfig = {};
if (process.env.NODE_ENV=="development") { if (process.env.NODE_ENV=="development") {
extConfig={mixid:'antgood'} extConfig={mixid:'antgood'}
} else{
if(MINI_ENV=='tt'){
extConfig={mixid:'ant'}
}else{
extConfig=wx.getExtConfigSync? wx.getExtConfigSync(): {}
}
} }
this.$store.commit("setExtConfig", extConfig.mixid); this.$store.commit("setExtConfig", extConfig.mixid);
......
import { requestPOST, requestGET } from "@/utils/request.js";
// wx
export default {
//登录
orderDetail(options) {
return requestGET(`${process.env.OLSHOP_URL}/order/detail`, options);
}
};
...@@ -4,6 +4,9 @@ export default { ...@@ -4,6 +4,9 @@ export default {
to_wx_pay(options) { to_wx_pay(options) {
return requestPOST1(`${process.env.OLSHOP_URL}/pay/to_wx_pay`, options); return requestPOST1(`${process.env.OLSHOP_URL}/pay/to_wx_pay`, options);
}, },
to_tt_pay(options) {
return requestPOST1(`${process.env.OLSHOP_URL}/pay/to_tt_pay`, options);
},
cancelPayment(options) { cancelPayment(options) {
return requestPOST1( return requestPOST1(
`${process.env.OLSHOP_URL}/pay/payment_cancel?orderSn=${options}` `${process.env.OLSHOP_URL}/pay/payment_cancel?orderSn=${options}`
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<p class="shopName" v-if="shopName">{{shopName}}</p> <p class="shopName" v-if="shopName">{{shopName}}</p>
<div class="btn_info"> <div class="btn_info">
<button class="btn" lang="zh_CN" open-type="getUserInfo" @getuserinfo="getUserInfo" @click="clickLogin">一键登录</button> <button class="btn" lang="zh_CN" open-type="getUserInfo" @getuserinfo="getUserInfo" @click="clickLogin">一键登录</button>
<!-- <div class="codeLogin">短信验证码登录</div> -->
</div> </div>
<!-- <div>{{testd}}</div> <!-- <div>{{testd}}</div>
...@@ -17,7 +18,7 @@ ...@@ -17,7 +18,7 @@
<div class="btn_info1"> <div class="btn_info1">
<h1>绑定手机号</h1> <h1>绑定手机号</h1>
<span class="hint">检测到您的账号还未绑定手机号,请绑定手机号</span> <span class="hint">检测到您的账号还未绑定手机号,请绑定手机号</span>
<button class="btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">绑定手机号一键绑定</button> <button class="btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="!isTT">绑定手机号一键绑定</button>
<div class="btn2" @click="handbindHandle">手动绑定手机号</div> <div class="btn2" @click="handbindHandle">手动绑定手机号</div>
</div> </div>
<div class="layer" @click="isShowPhone=false"></div> <div class="layer" @click="isShowPhone=false"></div>
...@@ -64,6 +65,11 @@ export default { ...@@ -64,6 +65,11 @@ export default {
test_isHaveUnion: "", test_isHaveUnion: "",
test_unionId: "", test_unionId: "",
fromType:'',//来源类型 mini:小程序跳转到当前登录页 fromType:'',//来源类型 mini:小程序跳转到当前登录页
ttData:{
iv:"",
encryptedData:"",
},
isTT:MINI_ENV=='tt',
}; };
}, },
created() {}, created() {},
...@@ -238,6 +244,9 @@ export default { ...@@ -238,6 +244,9 @@ export default {
e.target={ e.target={
rawData:e.rawData rawData:e.rawData
}; };
this.ttData.iv= e.mp.detail.iv;
this.ttData.encryptedData=e.mp.detail.encryptedData;
console.log(this.ttData,'------------------------247')
} }
console.log(e,e.mp,e.target.rawData,'-----------------------229') console.log(e,e.mp,e.target.rawData,'-----------------------229')
if (this.isHaveUnion) { if (this.isHaveUnion) {
...@@ -271,7 +280,10 @@ export default { ...@@ -271,7 +280,10 @@ export default {
this.userInfo = JSON.parse(e.target.rawData); this.userInfo = JSON.parse(e.target.rawData);
console.log(this.userInfo, "this.userInfo"); console.log(this.userInfo, "this.userInfo");
this.$store.commit('setUserInfo',this.userInfo) this.$store.commit('setUserInfo',this.userInfo)
// if(MINI_ENV=='tt'){
// this.bindUser();
// return;
// }
if (this.unionId) { if (this.unionId) {
login login
.checkUnionid({ unionId: this.unionId, openId: this.openid },MINI_ENV) .checkUnionid({ unionId: this.unionId, openId: this.openid },MINI_ENV)
...@@ -378,6 +390,11 @@ export default { ...@@ -378,6 +390,11 @@ export default {
city: this.userInfo.city, city: this.userInfo.city,
otherPhone: 0 otherPhone: 0
}; };
if(MINI_ENV=='tt'){
query.iv=this.ttData.iv;
query.encryptedData=this.ttData.encryptedData;
query.sessionKey=this.session_key;
}
if (this.$store.state.spokesmanGroupId != "") { if (this.$store.state.spokesmanGroupId != "") {
query.spokesmanRelId = this.$store.state.spokesmanRelId; query.spokesmanRelId = this.$store.state.spokesmanRelId;
query.spokesmanGroupId = this.$store.state.spokesmanGroupId; query.spokesmanGroupId = this.$store.state.spokesmanGroupId;
...@@ -388,6 +405,7 @@ export default { ...@@ -388,6 +405,7 @@ export default {
login login
.bindUser(query,MINI_ENV) .bindUser(query,MINI_ENV)
.then(res => { .then(res => {
wx.hideLoading();
//绑定成功 //绑定成功
if (res.data.code == 200) { if (res.data.code == 200) {
this.NEED_CERTIFIED = res.data.data.NEED_CERTIFIED; this.NEED_CERTIFIED = res.data.data.NEED_CERTIFIED;
...@@ -405,6 +423,8 @@ export default { ...@@ -405,6 +423,8 @@ export default {
// this.backPath // this.backPath
// }&params=${encodeURIComponent(this.backParams)}` // }&params=${encodeURIComponent(this.backParams)}`
// }); // });
}else{
wx.showToast({ title: res.data.msg, icon: "none" });
} }
}) })
.catch(err => { .catch(err => {
...@@ -482,6 +502,16 @@ export default { ...@@ -482,6 +502,16 @@ export default {
width: 200px; width: 200px;
border-radius: 5px; border-radius: 5px;
} }
.codeLogin{
background-color: #e5e5e5;
color: #fff;
height: 45px;
width: 200px;
border-radius: 5px;
text-align: center;
line-height: 45px;
margin-top: 20px;
}
} }
.enterpriseLogin { .enterpriseLogin {
position: absolute; position: absolute;
......
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