时间:2018-12-29 流量:11494
朋友圈 from=timeline&isappinstalled=0
微信群 from=groupmessage&isappinstalled=0
好友分享 from=singlemessage&isappinstalled=0
在连接后加上?&再进行分享,分享成功
url中红色链接内容,是微信自动为分享链接添加的内容,目的是为了记录分享来源
//js获取url中参数值的方法function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = [removed].search.substr(1).match(reg);
if (r != null)
return unescape(r[2]);
return null;
}
//二次分享时,微信会自动在url后加上&from=singlemessage&isappinstalled=0
var from = getQueryString('from');
var appinstall = getQueryString('appinstall');
var sec = getQueryString('sec');
var timekey = getQueryString('timekey');
if(from || appinstall || sec || timekey)
{
var tender_id = getQueryString('id');
[removed].href = "/activity/share/index.html?id="+tender_id; </div> <div class="line number18 index17 alt1" style="border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> }
function goAppShare() {
if (userId === null || isApp === null) return;
var callBackUrl="/activity/share/"+userId;
$.ajax({
url: callBackUrl,
type: 'GET',
success: function(data){}
});
}
function goWXActivityShare()
{
//二次分享时,微信会自动在url后加上&from=singlemessage&isappinstalled=0
var from = getQueryString('from');
if(!from){
var acturl = '/activity/share/index.html?id=' + tender_id; </div> <div class="line number36 index35 alt1" style="border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> }else{ </div> <div class="line number37 index36 alt2" style="background:none #F4F4F4 !important;border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> var acturl = [removed].href; </div> <div class="line number38 index37 alt1" style="border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> } </div> <div class="line number39 index38 alt2" style="background:none #F4F4F4 !important;border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> var wechatUrl = "/wechat/jssdk/config"; </div> <div class="line number40 index39 alt1" style="border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> var callBackUrl="/activity/share/success/"+tender_id; </div> <div class="line number41 index40 alt2" style="background:none #F4F4F4 !important;border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> </div> <div class="line number42 index41 alt1" style="border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> $.ajax({ </div> <div class="line number43 index42 alt2" style="background:none #F4F4F4 !important;border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> url: wechatUrl, </div> <div class="line number44 index43 alt1" style="border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> type: "POST", </div> <div class="line number45 index44 alt2" style="background:none #F4F4F4 !important;border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> data: {acturl: encodeURI(acturl)}, </div> <div class="line number46 index45 alt1" style="border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> cache: false, </div> <div class="line number47 index46 alt2" style="background:none #F4F4F4 !important;border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> success: function (msg) { </div> <div class="line number48 index47 alt1" style="border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> </div> <div class="line number49 index48 alt2" style="background:none #F4F4F4 !important;border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> if (msg.code == '200') {
wx.config({
debug: false,
appId: msg.data.appId,
timestamp: msg.data.timestamp,
nonceStr: msg.data.nonceStr,
signature: msg.data.signature,
jsApiList: [
// 所有要调用的 API 都要加到这个列表中
'onMenuShareTimeline',
'onMenuShareAppMessage'
]
});
wx.ready(function () {
wx.onMenuShareTimeline({
title: wxShare.title, // 分享标题
desc: wxShare.msg, // 分享说明
link: wxShare.url, // 分享链接
imgUrl: wxShare.icon, // 分享图标
success: function (msg) {
$.ajax({
url: callBackUrl,
type: "get",
data: {},
cache: false,
success: function (data)
{
$('.guide-mask').hide();
$('.share-guide').hide();
[removed].href = "/activity/share/index.html?id="+tender_id; </div> <div class="line number79 index78 alt2" style="background:none #F4F4F4 !important;border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> [removed].reload();
}
});
console.log('@--------------');
console.log(msg);
console.log('@--------------');
}
});
wx.onMenuShareAppMessage({
title: wxShare.title, // 分享标题
desc: wxShare.msg, // 分享说明
link: wxShare.url, // 分享链接
imgUrl: wxShare.icon, // 分享图标
type: '', // 分享类型,music、video或link,不填默认为link
dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
success: function (msg) {
$.ajax({
url: callBackUrl,
type: "get",
data: {},
cache: false,
success: function (data)
{
$('.guide-mask').hide();
$('.share-guide').hide();
[removed].href = "/activity/share/index.html?id="+tender_id; </div> <div class="line number105 index104 alt2" style="background:none #F4F4F4 !important;border:0px !important;margin:0px !important;padding:0px 1em !important;vertical-align:baseline !important;"> [removed].reload();
}
&n
把cache_model.php 的setLang方法里面的show_404(); 方法注释掉。 注释 show_404()
复制 case 0 里面的那2行到case 1 和default里面就行了
时间:2024-07-14
时间:2024-07-09
时间:2023-10-20
时间:2019-08-24
时间:2019-08-24
福利:
1.企业改版,可享受元润建站基金扶持,最高优惠达5万元。
2.为支持残疾事业,建站优惠最高至全免。
3.为支持公益事业,建站优惠最高至全免。
4.为支持社会基层事业,建站优惠最高至全免。