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