Commit 2bc6d220 authored by xd's avatar xd

安卓无法上传问题git commit -m 安卓无法上传问题

parent 4af8a81c
......@@ -7,7 +7,7 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>亿百分</title>
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
</head>
<body>
<noscript>
......@@ -15,6 +15,6 @@
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<!-- <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> -->
</body>
</html>
......@@ -7,7 +7,7 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>亿百分</title>
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!-- <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> -->
</head>
<body>
<noscript>
......
......@@ -55,7 +55,6 @@ function isIosOrAndroid() {
Vue.prototype.getAgentAuth = function () {
zlog('%c--->IN: getAgentAuth: location.href =', 'color: orange;', location.href)
// alert(`--->zCommon.js: IN.`)
let postData = {
// businessId: sessionStorage.getItem('businessId'),
// pageUrl: encodeURIComponent(this.isIosOrAndroid() === 'android' ? location.href.split('#')[0] : window.initUrl)
......@@ -90,7 +89,11 @@ Vue.prototype.getAgentAuth = function () {
nonceStr: config.jsApiSignature.nonceStr, // 必填,生成签名的随机串
signature: config.jsApiSignature.signature, // 必填,签名
// 根据自己的需求,填写 jsapilist 内容
jsApiList: ['agentConfig']
jsApiList: ['agentConfig', 'sendChatMessage'],
success: function(res) {
},
fail: function(err) {
}
})
// alert(`--->zCommon.js: getJsSdkSignature: then: wx.config: end.`)
......@@ -100,16 +103,15 @@ Vue.prototype.getAgentAuth = function () {
// JS-SDK配置信息验证失败时会进入此方法
wx.error(function (res) {
// alert("JS-SDK配置信息验证失败 \r\n" + JSON.stringify(res));
})
// 配置成功后验证API接口在当前客户端是否支持:判断当前客户端版本是否支持指定JS接口
wx.checkJsApi(
{
jsApiList: ['agentConfig', 'sendChatMessage'],
jsApiList: ['config', '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)
......@@ -128,6 +130,7 @@ Vue.prototype.getAgentAuth = function () {
signature: agentConfig.agentJsApiSignature.signature,// 必填,签名,agentConfig所以为应用签名
jsApiList: ['sendChatMessage'], //必填
success: function (res) {
alert('agentConfigSuccess')
// alert(`!-->zCommon.js: getJsSdkSignature: then: wx.ready: wx.checkJsApi: getAgentJsSdkSignature: wx.agentConfig: res.`)
// alert(`!-->zCommon.js: getJsSdkSignature: then: wx.ready: wx.checkJsApi: getAgentJsSdkSignature: wx.agentConfig: res =${JSON.stringify(res)}`)
// alert('agentConfig:ok')
......@@ -138,6 +141,7 @@ Vue.prototype.getAgentAuth = function () {
// alert('wx.agentConfig 回调'+res.errMsg);
},
fail: function (res) {
alert('agentConfigFailed')
// alert('回调失败:'+res.errMsg)
if (res.errMsg.indexOf('is not a function') > -1) {
alert('<i class="weui-icon-warn">版本过低请升级</i>')
......
......@@ -91,6 +91,7 @@ export default {
this.zcache.userId = this.$route.params.userId;
this.zReadyGetUserFromId();
this.getAgentAuth();
this.zReadySetVoucherList()
},
mounted() {
},
......@@ -128,8 +129,7 @@ export default {
let postData = {
param: this.zcache.userId
// param: 'ZhouHeQiang'
};
// alert(`--->userInfoFromId: postData = ${JSON.stringify(postData)}`);
}
getUserInfoByUserId(postData)
.then(res => {
// alert(`--->userInfoFromId: res = ${JSON.stringify(res.data[0])}`);
......@@ -139,37 +139,33 @@ export default {
// this.zcache.storeId = Number(res.data[0].stall);
this.zReadySetVoucherList();
})
.catch(err => {});
.catch(err => {})
},
// 获取优惠券列表
zReadySetVoucherList() {
alert('获取优惠券')
this.zReadyDelVoucherList();
const postData = {
appCode: "0696", // j接口编码
mdid: this.zcache.storeId
};
// alert(`--->PostToEA: postData = ${JSON.stringify(postData)}`);
zlog("%c--->VoucherList: PD =", "background: orange;", postData);
getVoucherList(postData)
.then(res => {
zlog("%c--->VoucherList: RD =", "background: limegreen;", res);
// alert(`--->PostToEA: Res = ${JSON.stringify(res)}`);
this.zVoucherSet(res.result.coupons);
// mdid: this.zcache.storeId
mdid: 1
}
alert('准备进入请求优惠券列表')
getVoucherList(postData).then(res => {
alert('getVoucherList')
zlog("%c--->VoucherList: RD =", "background: limegreen;", res);
this.zVoucherSet(res.result.coupons);
})
.catch(err => {
// alert(`--->PostToEA: err = ${JSON.stringify(err)}`);
});
},
zReadyDelVoucherList() {
this.zVoucherDel();
this.zVoucherUrlDel();
},
zVoucherPick(inActiveId, inVoucherId) {
alert('推送')
this.zcache.now.activeId = String(inActiveId)
this.zcache.now.voucherId = String(inVoucherId)
......@@ -184,15 +180,12 @@ export default {
zlog("%c--->VoucherWxUrl: PD =", "background: red;", postData);
getVoucherWxUrl(postData).then(res => {
zlog("%c--->VoucherWxUrl: RD =", "background: green;", res);
this.zVoucherUrlSet(res.result.link);
this.zVoucherUrlSet(res.result.link)
alert('获取列表成功')
});
},
zpick(inMsgType, inUrl) {
// alert(`--->discount.vue: zpick: IN.`);
switch (inMsgType) {
case "text":
......@@ -206,23 +199,21 @@ export default {
},
function(res) {
if (res.err_msg == "sendChatMessage:ok") {
// alert("--->discount.vue: zpick: text 分享成功!");
alert("--->discount.vue: zpick: text 分享成功!")
} else if (res.err_msg != "sendChatMessage:ok") {
// alert(
// `--->discount.vue: zpick: text 分享失败: res =${res.err_msg}`
// );
alert('分享失败')
}
}
);
break;
case "h5":
// alert(`--->discount.vue: zpick: H5: IN.`);
alert('zpick')
wx.invoke(
"sendChatMessage",
{
msgtype: "text", //消息类型,必填
news: {
msgtype: "news", //消息类型,必填
news: {
link: `http://qywx2.100smartdata.com/qrCode?Url=${inUrl}&activeId=${this.zcache.now.activeId}&voucherId=${this.zcache.now.voucherId}&unionId=1234`, //H5消息页面url 必填
title: "领取优惠券", //H5消息标题
desc: inUrl, //H5消息摘要
......@@ -230,10 +221,11 @@ export default {
}
},
function(res) {
alert('sendChatMessage')
if (res.err_msg == "sendChatMessage:ok") {
// alert("--->discount.vue: zpick: h5 分享成功!");
alert("--->discount.vue: zpick: h5 分享成功!")
} else if (res.err_msg != "sendChatMessage:ok") {
// alert(`--->discount.vue: zpick: h5 分享失败.`);
alert(`--->discount.vue: zpick: h5 分享失败.`)
// alert(
// `--->discount.vue: zpick: h5 分享失败: res =${res.err_msg}`
// );
......@@ -241,21 +233,12 @@ export default {
}
);
break;
default:
break;
}
// zlog(
// "%c--->Click: Url =",
// "background: orange;",
// String(this.zlist.voucherUrl)
// );
// window.wx.miniProgram.navigateTo({
// url: this.zlist.voucherUrl
// });
},
zVoucherSet(inArray) {
alert('zVoucherSet')
this.zlist.voucher = inArray;
},
......
......@@ -36,21 +36,32 @@
},
methods:{
sendMessage(){
const url = 'http://www.baidu.com'
wx.invoke(
"sendChatMessage",
{
msgtype: "text", //消息类型,必填
msgtype: "news", //消息类型,必填
news: {
link: `http://qywx2.100smartdata.com/register`, //H5消息页面url 必填
link: "http://qywx2.100smartdata.com/register", //H5消息页面url 必填
title: "会员拉新", //H5消息标题
desc: '注册成为欧亚会员', //H5消息摘要
desc: "注册成为欧亚会员", //H5消息摘要
imgUrl: "" //H5消息封面图片URL
}
/* news:
{
link: url, //H5消息页面url 必填
title: "", //H5消息标题
desc: "", //H5消息摘要
imgUrl: "", //H5消息封面图片URL
} */
},
function(res) {
alert('sendChatMessage')
if (res.err_msg == "sendChatMessage:ok") {
alert('发送成功')
// alert("--->register.vue: zpick: h5 分享成功!");
} else if (res.err_msg != "sendChatMessage:ok") {
alert('发送失败')
// alert(`--->register.vue: zpick: h5 分享失败.`);
}
}
......
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