Commit ea68e3f9 authored by Z's avatar Z

Merge branch 'master' of gitlabz:xulili/ybf

parents 4f1409fa 8b97b417
NdQI4DAtoC9jyfXm
\ No newline at end of file
ovlGwUtiSAgGUQLs
\ No newline at end of file
......@@ -48,14 +48,15 @@
</div>
</div>
<script>
getAgentAuth()
$(function () {
showQRInfo()
});
const showQRInfo = () => {
// let pageUri = `${nowUrl}&detailid=${voucherId}&actionid=${activeId}&unionid=${unionId}`;
let storecode = "181"
let pageUri = `pages/user/register/register?storeCode=
${storecode}`;
let pageUri = `pages/user/register/register?storeCode=${storecode}`;
let pageUrl = `http://139.155.48.151:8085/workWx/auth/oauth2/wxMiniQrCode?pageUri=${pageUri}`;
$.ajax({
......
......@@ -84,7 +84,7 @@ Vue.prototype.getAgentAuth = function () {
let config = res.data
wx.config({
beta: true,
debug: false, //调试的时候可以开启
debug: true, //调试的时候可以开启
appId: config.jsApiSignature.appId, // 必填,公众号的唯一标识
timestamp: config.jsApiSignature.timestamp, // 必填,生成签名的时间戳
nonceStr: config.jsApiSignature.nonceStr, // 必填,生成签名的随机串
......@@ -96,11 +96,11 @@ Vue.prototype.getAgentAuth = function () {
// alert(`--->zCommon.js: getJsSdkSignature: then: wx.config: end.`)
wx.ready(function () {
zlog('%c--->getAgentAuth: getJsSdkSignature: Ready.', 'color: red;')
// alert(`--->zCommon.js: getJsSdkSignature: then: wx.ready: IN.`)
alert(`--->zCommon.js: getJsSdkSignature: then: wx.ready: IN.`)
// JS-SDK配置信息验证失败时会进入此方法
wx.error(function (res) {
// alert("JS-SDK配置信息验证失败 \r\n" + JSON.stringify(res));
alert("JS-SDK配置信息验证失败 \r\n" + JSON.stringify(res));
})
// 配置成功后验证API接口在当前客户端是否支持:判断当前客户端版本是否支持指定JS接口
......@@ -109,7 +109,7 @@ Vue.prototype.getAgentAuth = function () {
jsApiList: ['agentConfig', 'sendChatMessage'],
success: function (res) {
if (res.errMsg != "checkJsApi:ok") {
// alert("JS-SDK接口检测失败:" + JSON.stringify(res));
alert("JS-SDK接口检测失败:" + JSON.stringify(res));
return false;
} else {
wxRequest('/workWx/auth/base/getAgentJsSdkSignature', qs.stringify(postData), header)
......@@ -135,7 +135,7 @@ Vue.prototype.getAgentAuth = function () {
// 回调
//1、发起申请申请时后,审批状态发生变化时
//2、发起申请申请时后,在“审批中”状态,有任意审批人进行审批操作时
// alert('wx.agentConfig 回调'+res.errMsg);
alert('wx.agentConfig 回调'+res.errMsg);
},
fail: function (res) {
// alert('回调失败:'+res.errMsg)
......@@ -144,7 +144,6 @@ Vue.prototype.getAgentAuth = function () {
}
}
})
}
})
.catch(err => {
......
......@@ -2,7 +2,7 @@
<div class="main">
<div class="lists">
<div v-for="(item, index) of list.main" :key="index">
<div class="list" @click="listClick(item.redirect)">
<div class="list" @click="listClick(item,item.redirect)">
<div>
<img class="list-logo" :src="item.logoUrl" alt/>
</div>
......@@ -12,6 +12,11 @@
</div>
</div>
</div>
<div>
<span>店员id</span>
<span>{{ zcache.userId }}</span>
<span>{{ info }}</span>
</div>
</div>
</div>
</template>
......@@ -63,12 +68,13 @@
logoUrl: "/mainSale/4.png"
}
]
}
};
},
info: ''
}
},
mounted() {
this.zReadyUserId();
this.zTestGetNowUrlInfo();
this.zTestGetNowUrlInfo()
},
created() {
},
......@@ -124,10 +130,11 @@
zlog("%c--->zTestPreAuthCode: Url =", "background: orange", url);
this.zcache.preAuthCodeUrl = url;
window.location.href = url;
// window.location.href = url;
},
// 测试-获取用户信息
zTestGetUserInfoByOldToken() {
alert('获取用户信息')
let postData = {
code: this.zcache.code,
};
......@@ -142,15 +149,24 @@
headers: headerData,
})
.then(res => {
console.log(res,'用户信息');
this.info = res.data + ''
alert('获取用户信息接口成功')
this.zcache.userInfoResNew = "RESOK:" + res.data.data.userId;
sessionStorage.setItem("userId", String(res.data.data.userId));
this.zcache.userId = String(res.data.data.userId);
alert(this.zcache.userId)
alert('获取到了用户信息')
})
.catch(err => {
this.zcache.userInfoResNew = "RESERR.";
});
},
listClick(inData) {
listClick(item,inData) {
console.log(item,'item');
console.log(inData,'inData');
this.$router.push({
name: inData,
params: {userId: this.zcache.userId}
......
......@@ -88,9 +88,9 @@ export default {
};
},
created() {
this.zcache.userId = this.$route.params.userId;
this.zReadyGetUserFromId();
this.getAgentAuth();
this.zcache.userId = this.$route.params.userId;
this.zReadyGetUserFromId()
},
mounted() {
},
......@@ -122,7 +122,7 @@ export default {
basicInfo.state +
basicInfo.tail;
zlog("%c--->zTestPreAuthCode: Url =", "background: orange", url);
// window.location.href = url
window.location.href = url
},
zReadyGetUserFromId() {
let postData = {
......
......@@ -11,10 +11,15 @@
</div>
<button class="button-send" @click="sendMessage">邀请</button>
</div>
<div>
<span>顾客id</span>
<span>{{ userId }}</span>
</div>
</div>
</div>
</template>
<script>
import { getUserInfoByUserId } from "@/api/sidebar/voucher";
export default {
name: 'register',
data() {
......@@ -25,16 +30,54 @@
dsc: "推荐完成注册,完成会员拉新",
logoUrl: "/mainSale/4.png"
}
]
],
storeId: '',
userId: ''
}
},
created() {
this.getAgentAuth();
this.zReadyGetUserFromId();
this.getCustomerId()
},
mounted(){
},
methods:{
// 获取客户Id
getCustomerId() {
alert('获取顾客信息')
wx.invoke('getCurExternalContact', {
}, function(res){
if(res.err_msg == "getCurExternalContact:ok"){
console.log(res,'顾客信息');
alert('成功获取顾客信息')
this.userId = res.userId ; //返回当前外部联系人userId
}else {
//错误处理
alert('获取用户信息失败')
}
})
},
// 获取店铺Id
zReadyGetUserFromId() {
alert('获取店铺信息')
let postData = {
param: this.$route.params.userId
// param: 'ZhouHeQiang'
};
// alert(`--->userInfoFromId: postData = ${JSON.stringify(postData)}`);
getUserInfoByUserId(postData)
.then(res => {
console.log(res,'店铺信息');
res = JSON.stringify(res)
alert(res)
})
.catch(err => {
alert('获取店铺信息失败')
});
},
sendMessage(){
wx.invoke(
"sendChatMessage",
......
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