You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
665 lines
28 KiB
665 lines
28 KiB
function t(t) {
|
|
r.util.request({
|
|
url: "entry/wxapp/initpage",
|
|
data: {
|
|
state:'aa',
|
|
voteid: t.data.voteid,
|
|
listlimit: t.data.index.limit,
|
|
uid: t.data.memberinfo.id
|
|
},
|
|
success: function(i) {
|
|
var e = i.data.data, o = t.data.index;
|
|
t.mall(e.voteid,e.uid)
|
|
wx.getSystemInfo({
|
|
success: function(t) {
|
|
o.width = t.windowWidth / 2.213903743315508;
|
|
}
|
|
}), o.title = e.title, o.picture = e.picture, o.picture2 = "" == e.picture2 ? "0" : e.picture2,
|
|
o.picture3 = "" == e.picture3 ? "0" : e.picture3, o.picture4 = "" == e.picture4 ? "0" : e.picture4,
|
|
o.picture5 = "" == e.picture5 ? "0" : e.picture5, o.joincount = e.joincount, o.votecount = e.votecount,
|
|
o.accesscount = e.accesscount, o.starttime = e.starttime, o.endtime = e.endtime,
|
|
o.strtime = e.strtime, o.ischeck = e.ischeck, o.ishbimg = e.ishbimg, o.adfixed = "" == e.adfixed ? "0" : e.adfixed,
|
|
o.advote = "" == e.advote ? "0" : e.advote, o.adjoin = "" == e.adjoin ? "0" : e.adjoin,
|
|
o.gifts = e.gifts, o.giftid = 1, o.newslist = e.newslist;
|
|
for (s = 0; s < e.newslist.length; s++) if (o.size.news.left <= o.size.news.right) {
|
|
o.newslist[s].int = 1;
|
|
n = o.newslist[s].size[1] * (o.width / o.newslist[s].size[0]);
|
|
o.size.news.left = Number(o.size.news.left) + Number(n);
|
|
} else {
|
|
o.newslist[s].int = 2;
|
|
n = o.newslist[s].size[1] * (o.width / o.newslist[s].size[0]);
|
|
o.size.news.right = Number(o.size.news.right) + Number(n);
|
|
}
|
|
o.hotlist = e.hotlist;
|
|
for (var s = 0; s < e.hotlist.length; s++) if (o.size.hot.left <= o.size.hot.right) {
|
|
o.hotlist[s].int = 1;
|
|
n = o.hotlist[s].size[1] * (o.width / o.hotlist[s].size[0]);
|
|
o.size.hot.left = Number(o.size.hot.left) + Number(n);
|
|
} else {
|
|
o.hotlist[s].int = 2;
|
|
var n = o.hotlist[s].size[1] * (o.width / o.hotlist[s].size[0]);
|
|
o.size.hot.right = Number(o.size.hot.right) + Number(n);
|
|
}
|
|
if ("0" != o.adfixed) try {
|
|
"" == wx.getStorageSync("0424") && (o.isadindex = !0, wx.setStorageSync("0424", "yes"));
|
|
} catch (t) {} else o.adfixed = o.advote, o.isadindex = !1;
|
|
"0" != o.adjoin && (o.isadjoin = !0);
|
|
var d = e.newslist.length;
|
|
o.start = d, d < o.limit && (o.pulluploading = !1), wx.setNavigationBarTitle({
|
|
// title: o.title
|
|
frontColor: "#ffffff"
|
|
// title: "中国深圳店长节评选"
|
|
}), wx.setNavigationBarColor({
|
|
frontColor: "#ffffff",
|
|
// backgroundColor: e.footbgcolor,
|
|
animation: {
|
|
duration: 400,
|
|
timingFunc: "easeIn"
|
|
}
|
|
}), l.wxParse("rule", "html", e.introduce, t, 5);
|
|
|
|
var r = t.data.rule.nodes, u = t.data.config;
|
|
u.footbgcolor = e.footbgcolor, u.footcolor = e.footcolor, u.footsearchbgcolor = e.footsearchbgcolor,
|
|
u.footsearchcolor = e.footsearchcolor, u.buttonbgcolor = e.buttonbgcolor, u.buttoncolor = e.buttoncolor,
|
|
u.isvotegiftpop = 1 == e.isvotegiftpop, u.wxappsharetitle = e.wxappsharetitle, u.wxappshareimage = e.wxappshareimage,
|
|
u.wxappdetailsharetitle = e.wxappdetailsharetitle, u.wxapptotext = e.wxapptotext,
|
|
u.wxapptoappid = e.wxapptoappid, u.wxapptopath = e.wxapptopath, u.wxapptoisindex = 1 == e.wxapptoisindex,
|
|
u.wxapptoisdetail = 1 == e.wxapptoisdetail, u.isjoin = 1 == e.isjoin, u.isshare = 1 == e.isshare,
|
|
u.isposter = 1 == e.isposter, u.isupdate = 1 == e.isupdate, u.isimgs = 1 == e.isimgs,
|
|
u.appid1 = e.imgappid, u.path1 = e.imgpath, u.appid2 = e.imgappid2, u.path2 = e.imgpath2,
|
|
u.appid3 = e.imgappid3, u.path3 = e.imgpath3, u.appid4 = e.imgappid4, u.path4 = e.imgpath4,
|
|
u.appid5 = e.imgappid5, u.path5 = e.imgpath5, u.ismusic = 1 == e.ismusic, u.isvideo = 1 == e.isvideo,
|
|
u.isgift = 1 == e.isgift, u.isre = 1 == e.isre, u.adunit = e.adunit, u.adfixedappid = e.adfixedappid,
|
|
u.adfixedpath = e.adfixedpath, u.advoteappid = e.advoteappid, u.advotepath = e.advotepath,
|
|
u.adjoinappid = e.adjoinappid, u.adjoinpath = e.adjoinpath, u.isgiftjoin = e.isgiftjoin,
|
|
console.log(e),
|
|
u.font = e.font.split("|"), console.log(3), t.setData({
|
|
voteid: e.voteid,
|
|
config: u,
|
|
index: o,
|
|
rule: r,
|
|
uid: e.uid,
|
|
showpage: 'mall'
|
|
}), "" != t.data.joinid && t.data.joinid > 0 && a(t, t.data.joinid) ;
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
function a(t, a) {
|
|
r.util.request({
|
|
url: "entry/wxapp/joininfo",
|
|
data: {
|
|
voteid: t.data.voteid,
|
|
joinid: a
|
|
},
|
|
success: function(a) {
|
|
if(a.data.data.images.length>1){
|
|
a.data.data.images.splice(-1,1);
|
|
}
|
|
console.log(a.data), e(t, a.data.data);
|
|
}
|
|
});
|
|
}
|
|
|
|
function i(a, e, o, s, n, d) {
|
|
var l = s[n];
|
|
if (n == s.length) return wx.hideLoading(), wx.hideNavigationBarLoading(), e.voteid = a.data.voteid,
|
|
e.ischeck = a.data.index.ischeck, e.images = JSON.stringify(d), a.data.config.isvideo ? e.video = a.data.join.video[0].url : e.video = "",
|
|
a.data.config.ismusic ? e.music = a.data.join.music[0].url : e.music = "", e.uid = a.data.memberinfo.id,
|
|
e.avatar = a.data.memberinfo.avatar, a.setData({
|
|
showpage: "joinok"
|
|
}),console.log(e), void r.util.request({
|
|
url: "entry/wxapp/join",
|
|
data: e,
|
|
success: function(i) {
|
|
console.log(1000)
|
|
var e = i.data.data, o = {
|
|
id: e.id,
|
|
checkstate: e.checkstate
|
|
};
|
|
a.setData({
|
|
joinok: o,
|
|
showpage: "joinok",
|
|
footerindex: 1
|
|
}), 2 == e.checkstate && t(a);
|
|
}
|
|
});
|
|
wx.uploadFile({
|
|
url: o,
|
|
filePath: l,
|
|
name: "image",
|
|
success: function(t) {
|
|
n += 1;
|
|
var r = JSON.parse(t.data);
|
|
d.push('https://xcx.zgzmdz.com/attachment/'+r.data), console.log("第" + n + "张:"), i(a, e, o, s, n, d);
|
|
},
|
|
fail: function(t) {
|
|
console.log("第" + n + "张:上传失败"), console.log(t);
|
|
n += 1;
|
|
d.push(l),i(a, e, o, s, n, d);
|
|
}
|
|
});
|
|
}
|
|
|
|
function e(t, a) {
|
|
var i = t.data.detail;
|
|
l.wxParse("detail.resume", "html", a.resume, t, 5), i.id = a.id, i.username = a.username,
|
|
i.images = a.images, i.telephone = a.telephone, i.pollcount = a.pollcount, i.gifts = a.gifts,
|
|
i.giftrecords = a.giftrecords, i.ranking = a.ranking, i.video = a.video, i.music = a.music, i.trust_count=a.trust_count
|
|
i.reply = a.reply, i.haibao = !1, i.isreply = !1, i.imgurl = "", i.imgbg = "0",
|
|
i.font = "给TA投票", i.topage = "1", t.setData({
|
|
detail: i,
|
|
showpage: "detail"
|
|
});
|
|
}
|
|
|
|
function o(t, a) {
|
|
var i = t.data.detail;
|
|
i.id = a.id, i.username = a.username, i.images = a.images, i.resume = a.resume,
|
|
i.telephone = a.telephone, i.pollcount = a.pollcount, i.gifts = a.gifts, i.giftrecords = a.giftrecords,
|
|
i.ranking = a.ranking, i.video = a.video, i.music = a.music, i.reply = a.reply,
|
|
i.haibao = !1, i.isreply = !1, i.imgurl = "", i.imgbg = "0", i.font = "修改信息", i.topage = "2",
|
|
t.setData({
|
|
detail: i,
|
|
showpage: "detail"
|
|
});
|
|
}
|
|
|
|
function s(t) {
|
|
return t = t.replace(/-/g, "/"), new Date(t);
|
|
}
|
|
|
|
function n(t) {
|
|
var a = new Date(), i = s(t.data.index.starttime), e = s(t.data.index.endtime);
|
|
return a < i ? -1 : a > e ? -2 : 0;
|
|
}
|
|
|
|
function d(t) {
|
|
var a = t.data.detail;
|
|
a.giftbox = !a.giftbox, t.setData({
|
|
detail: a
|
|
});
|
|
}
|
|
|
|
var r = getApp(), l = require("../../resource/wxParse/wxParse.js");
|
|
|
|
module.exports = {
|
|
initpage: t,
|
|
getjoininfo: a,
|
|
getlistmore:function(t){
|
|
wx.showLoading({
|
|
title: "加载中"
|
|
});
|
|
var a = t.data.index;
|
|
r.util.request({
|
|
url: "entry/wxapp/MallJoinList",
|
|
data: {
|
|
voteid: t.data.voteid,
|
|
mallid: t.data.nowMallId,
|
|
start: t.data.page,
|
|
limit: a.limit
|
|
},
|
|
success: function(i) {
|
|
wx.hideLoading();
|
|
t.setData({
|
|
'index.newslist': t.data.index.newslist.concat(i.data.data.newlist),
|
|
'index.hotlist': t.data.index.hotlist.concat(i.data.data.hotlist),
|
|
})
|
|
}
|
|
});
|
|
},
|
|
getlist: function(t) {
|
|
wx.showLoading({
|
|
title: "加载中"
|
|
});
|
|
var a = t.data.index;
|
|
r.util.request({
|
|
url: "entry/wxapp/list",
|
|
data: {
|
|
voteid: t.data.voteid,
|
|
start: a.start,
|
|
limit: a.limit
|
|
},
|
|
success: function(i) {
|
|
wx.hideLoading();
|
|
var e = i.data.data.newslist.length;
|
|
if (e < a.limit && (a.pulluploading = !1), e > 0) {
|
|
for (a.start = a.newslist.length + e, s = 0; s < e; s++) a.size.news.left <= a.size.news.right ? (i.data.data.newslist[s].int = 1,
|
|
o = i.data.data.newslist[s].size[1] * (a.width / i.data.data.newslist[s].size[0]),
|
|
a.size.news.left = Number(a.size.news.left) + Number(o)) : (i.data.data.newslist[s].int = 2,
|
|
o = i.data.data.newslist[s].size[1] * (a.width / i.data.data.newslist[s].size[0]),
|
|
a.size.news.right = Number(a.size.news.right) + Number(o));
|
|
for (s = 0; s < e; s++) if (a.size.hot.left <= a.size.hot.right) i.data.data.hotlist[s].int = 1,
|
|
o = i.data.data.hotlist[s].size[1] * (a.width / i.data.data.hotlist[s].size[0]),
|
|
a.size.hot.left = Number(a.size.hot.left) + Number(o); else {
|
|
i.data.data.hotlist[s].int = 2;
|
|
var o = i.data.data.hotlist[s].size[1] * (a.width / i.data.data.hotlist[s].size[0]);
|
|
a.size.hot.right = Number(a.size.hot.right) + Number(o);
|
|
}
|
|
for (var s = 0; s < e; s++) a.newslist.push(i.data.data.newslist[s]), a.hotlist.push(i.data.data.hotlist[s]);
|
|
}
|
|
a.ispulluploading = !1, t.setData({
|
|
index: a
|
|
});
|
|
}
|
|
});
|
|
},
|
|
search: function(t, a) {
|
|
var i = t.data.search;
|
|
"" != a.joinid ? r.util.request({
|
|
url: "entry/wxapp/search",
|
|
data: {
|
|
voteid: t.data.voteid,
|
|
joinid: a.joinid
|
|
},
|
|
success: function(a) {
|
|
e(t, a.data.data), i.show = !1, t.setData({
|
|
search: i
|
|
});
|
|
}
|
|
}) : r.util.message("作品编号不能为空", "", "error");
|
|
},
|
|
getrankings: function(t,type) {
|
|
r.util.request({
|
|
url: "entry/wxapp/rankings",
|
|
data: {
|
|
start: 0,
|
|
voteid: t.data.voteid,
|
|
type: type || 'renqi',
|
|
limit: t.data.ranking.limit
|
|
},
|
|
success: function(a) {
|
|
var i = t.data.ranking;
|
|
i.list = a.data.data, i.start = "20", t.setData({
|
|
ranking: i,
|
|
showpage: "ranking",
|
|
footerindex: 3
|
|
});
|
|
}
|
|
});
|
|
},
|
|
join: function(t, a) {
|
|
var e = n(t);
|
|
console.log(e)
|
|
if (-1 != e) if (-2 != e) {
|
|
for (var o = t.data.join, s = [], d = o.images, l = 0; l < d.length; l++) d[l].isadd && s.push(d[l].src);
|
|
var u = !0;
|
|
if ("" == a.username.trim() ? (o.validates.username = !0, u = !1) : o.validates.username = !1,
|
|
s.length <= 0 ? (o.validates.image = !0, u = !1) : o.validates.image = !1,
|
|
// "" == o.video[0].src && t.data.config.isvideo ? (o.validates.video = !0, u = !1) : o.validates.video = !1,
|
|
"" == o.music[0].src && t.data.config.ismusic ? (o.validates.music = !0, u = !1) : o.validates.music = !1,
|
|
"" == a.resume.trim() ? (o.validates.resume = !0, u = !1) : o.validates.resume = !1,
|
|
u) if (wx.showNavigationBarLoading(), r.util.showLoading(), t.data.config.ismusic) {
|
|
var c = r.util.getWe7urls("entry/wxapp/uploadmusic"), p = t.data.join.music[0].src;
|
|
wx.uploadFile({
|
|
url: c,
|
|
filePath: p,
|
|
name: "music",
|
|
formData: {
|
|
voteid: t.data.voteid
|
|
},
|
|
success: function(e) {
|
|
console.log(2213)
|
|
var o = JSON.parse(e.data), n = t.data.join;
|
|
if (n.music[0].url = o.data, t.setData({
|
|
join: n
|
|
}), t.data.config.isvideo) {
|
|
var d = r.util.getWe7urls("entry/wxapp/uploadvideo"), l = t.data.join.video[0].src;
|
|
wx.uploadFile({
|
|
url: d,
|
|
filePath: l,
|
|
name: "video",
|
|
formData: {
|
|
voteid: t.data.voteid
|
|
},
|
|
success: function(e) {
|
|
var o = JSON.parse(e.data), n = t.data.join;
|
|
n.video[0].url = o.data, t.setData({
|
|
join: n
|
|
});
|
|
var d = r.util.getWe7urls("entry/wxapp/uploadimage");
|
|
i(t, a, d, s, 0, []);
|
|
},
|
|
fail: function(a) {
|
|
console.log("上传失败"), console.log(a), console.log(t);
|
|
}
|
|
});
|
|
} else {
|
|
var u = r.util.getWe7urls("entry/wxapp/uploadimage");
|
|
i(t, a, u, s, 0, []);
|
|
}
|
|
},
|
|
fail: function(a) {
|
|
console.log("上传失败"), console.log(a), console.log(t);
|
|
}
|
|
});
|
|
} else if (t.data.join.video[0].isadd) {
|
|
console.log(321)
|
|
var g = r.util.getWe7urls("entry/wxapp/uploadvideo"), f = t.data.join.video[0].src;
|
|
wx.uploadFile({
|
|
url: g,
|
|
filePath: f,
|
|
name: "video",
|
|
formData: {
|
|
voteid: t.data.voteid
|
|
},
|
|
success: function(e) {
|
|
var o = JSON.parse(e.data), n = t.data.join;
|
|
n.video[0].url = o.data, t.setData({
|
|
join: n
|
|
});
|
|
var d = r.util.getWe7urls("entry/wxapp/uploadimage");
|
|
i(t, a, d, s, 0, []);
|
|
},
|
|
fail: function(a) {
|
|
console.log("上传失败"), console.log(a), console.log(t);
|
|
}
|
|
});
|
|
} else {
|
|
var m = r.util.getWe7urls("entry/wxapp/uploadimage");
|
|
i(t, a, m, s, 0, []);
|
|
console.log(123)
|
|
} else t.setData({
|
|
join: o
|
|
});
|
|
} else r.util.message("活动已经结束,不能报名", "error"); else r.util.message("活动还未开始,不能报名", "error");
|
|
},
|
|
vote: function(t, a) {
|
|
var i = n(t);
|
|
-1 != i ? -2 != i ? r.util.request({
|
|
url: "entry/wxapp/vote",
|
|
data: {
|
|
voteid: t.data.voteid,
|
|
joinid: a,
|
|
uid: t.data.memberinfo.id,
|
|
nickname: t.data.memberinfo.nickname,
|
|
avatar: t.data.memberinfo.avatar
|
|
},
|
|
success: function(i) {
|
|
console.info(i)
|
|
var e = t.data.index;
|
|
e.votecount = Number(e.votecount) + 1, "0" != e.advote && (e.isadindex = !0);
|
|
var o = e[e.showlist + "list"];
|
|
if (o.length > 0) for (var s = 0; s < o.length; s++) o[s].id == a && (o[s].pollcount = Number(o[s].pollcount) + 1);
|
|
var n = t.data.detail;
|
|
n.pollcount = Number(n.pollcount) + 1, t.data.config.isgift && t.data.config.isvotegiftpop , //&& d(t),
|
|
t.setData({
|
|
index: e,
|
|
detail: n,
|
|
}), r.util.message("投票成功", "", "success");
|
|
if(i.data.data.today_vote_count!=2){
|
|
t.setData({
|
|
showpage: 'luckDraw',
|
|
footerindex: 1
|
|
})
|
|
t.luckDrawLoad()
|
|
}
|
|
|
|
},
|
|
fail(error){
|
|
console.log(error)
|
|
if(error.data.errno == -1){
|
|
wx.showModal({
|
|
title: error.data.message,
|
|
showCancel: false
|
|
})
|
|
} else {
|
|
t.setData({
|
|
'config.userlogin': '1'
|
|
})
|
|
}
|
|
}
|
|
}) : r.util.message("活动已经结束", "error") : r.util.message("活动还未开始", "error");
|
|
},
|
|
sendgift: function(t, a, i) {
|
|
var e = t.data.voteid;
|
|
r.util.request({
|
|
url: "entry/wxapp/wxpay",
|
|
data: {
|
|
voteid: e,
|
|
joinid: a,
|
|
giftid: i,
|
|
uid: t.data.memberinfo.id,
|
|
op: "sendgift"
|
|
},
|
|
success: function(o) {
|
|
var s = o.data.data;
|
|
wx.requestPayment({
|
|
timeStamp: s.timeStamp,
|
|
nonceStr: s.nonceStr,
|
|
package: s.package,
|
|
signType: s.signType,
|
|
paySign: s.paySign,
|
|
success: function(o) {
|
|
o.data, r.util.request({
|
|
url: "entry/wxapp/wxpay",
|
|
data: {
|
|
voteid: e,
|
|
joinid: a,
|
|
giftid: i,
|
|
op: s.to,
|
|
uid: t.data.memberinfo.id,
|
|
nickname: t.data.memberinfo.nickname,
|
|
avatar: t.data.memberinfo.avatar
|
|
},
|
|
success: function(i) {
|
|
var e = t.data.detail;
|
|
e.giftrecords;
|
|
var o = i.data.data, s = {
|
|
avatar: o.avatar,
|
|
createtime: o.createtime,
|
|
giftimage: o.giftimage,
|
|
giftname: o.giftname,
|
|
giftprice: o.giftprice,
|
|
nickname: o.nickname,
|
|
pollcount: o.pollcount
|
|
};
|
|
e.giftrecords.push(s);
|
|
var n = t.data.index;
|
|
n.votecount = Number(n.votecount) + Number(o.pollcount);
|
|
var d = n[n.showlist + "list"];
|
|
if (d.length > 0) for (var l = 0; l < d.length; l++) d[l].id == a && (console.log("找到了"),
|
|
d[l].pollcount = Number(d[l].pollcount) + Number(o.pollcount));
|
|
e.pollcount = Number(e.pollcount) + Number(o.pollcount), t.setData({
|
|
index: n,
|
|
detail: e
|
|
}), r.util.message("赠送成功", "", "success");
|
|
}
|
|
});
|
|
},
|
|
fail: function(t) {
|
|
if (console.log("fail"), console.log(t), "requestPayment:fail cancel" != t.errMsg) {
|
|
var a = t.errMsg.replace("requestPayment:fail", "");
|
|
r.util.message(a, "error");
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
},
|
|
tojoinpage: function(t) {
|
|
var a = t.data.detail;
|
|
a.giftbox = !0, t.setData({
|
|
detail: a
|
|
}), r.util.request({
|
|
url: "entry/wxapp/myjoininfo",
|
|
data: {
|
|
voteid: t.data.voteid,
|
|
uid: t.data.memberinfo.id
|
|
},
|
|
success: function(a) {
|
|
var i = a.data.data, o = "join";
|
|
if (i != [] && 2 == i.checkstate) e(t, i), o = "detail"; else if (i != [] && 1 == i.checkstate) o = "checking"; else {
|
|
var s = t.data.join, d = n(t);
|
|
-1 == d ? (s.subbtn.isdisabled = !0, s.subbtn.text = "活动还未开始") : -2 == d ? (s.subbtn.isdisabled = !0,
|
|
s.subbtn.text = "活动已经结束") : (s.subbtn.isdisabled = !1, s.subbtn.text = "确认提交"),
|
|
0 == t.data.config.isjoin && (s.subbtn.isdisabled = !0, s.subbtn.text = "报名还未开启")
|
|
t.setData({
|
|
'join': s
|
|
});
|
|
}
|
|
t.setData({
|
|
showpage: o,
|
|
footerindex: 2
|
|
});
|
|
}
|
|
});
|
|
},
|
|
mytojoinpage: function(t) {
|
|
var a = t.data.detail;
|
|
a.giftbox = !0, t.setData({
|
|
detail: a
|
|
}), r.util.request({
|
|
url: "entry/wxapp/myjoininfo",
|
|
data: {
|
|
voteid: t.data.voteid,
|
|
uid: t.data.memberinfo.id
|
|
},
|
|
success: function(a) {
|
|
var i = a.data.data, e = "join";
|
|
if (i != [] && 2 == i.checkstate) console.log(i), o(t, i), e = "join"; else if (i != [] && 1 == i.checkstate) e = "checking"; else {
|
|
var s = t.data.join,d = n(t);
|
|
-1 == d ? (s.subbtn.isdisabled = !0, s.subbtn.text = "活动还未开始") : -2 == d ? (s.subbtn.isdisabled = !0,
|
|
s.subbtn.text = "活动已经结束") : (s.subbtn.isdisabled = !1, s.subbtn.text = "确认提交"),
|
|
0 == t.data.config.isjoin && (s.subbtn.isdisabled = !0, s.subbtn.text = "报名还未开启")
|
|
// t.setData({
|
|
// join: s
|
|
// });
|
|
}
|
|
console.log(i)
|
|
let joinInfo=t.data.join.joinInfo;
|
|
joinInfo.username =i.joininfo.username,joinInfo.telephone =i.joininfo.telephone,joinInfo.store_name =i.joininfo.store_name,joinInfo.store_Address =i.joininfo.address,
|
|
joinInfo.store_floor =i.joininfo.floor,joinInfo.MerchantCode =i.joininfo.mcode,joinInfo.MerchantNumber =i.joininfo.mterminal,joinInfo.store_area =i.joininfo.size,joinInfo.resume =i.joininfo.resume;
|
|
var mallName = null
|
|
var storeName = null
|
|
var typesName = null
|
|
var images = t.data.join.images;
|
|
if(i.joininfo){
|
|
images[4].isadd=true;
|
|
images[4].src=i.joininfo.image[i.joininfo.image.length-1]
|
|
}
|
|
|
|
|
|
let CheckItem=t.data.CheckItem;
|
|
let num=0;
|
|
if(i.joininfo){
|
|
num=i.joininfo.trust_count.length;
|
|
i.joininfo.trust_count.forEach(item=>{
|
|
CheckItem[item-1].checked=true;
|
|
})
|
|
}
|
|
|
|
// for( var w = 0; w < i.types.length; w++ ){
|
|
// if(i.types[w].id == i.mall_type ){
|
|
// typesName = i.types[w].name
|
|
// }
|
|
// }
|
|
// for( var l = 0; l < i.mall_list.length; l++ ){
|
|
// if(i.mall_list[l].id == i.mall_id ){
|
|
// mallName = i.mall_list[l].name
|
|
// }
|
|
// }
|
|
// for( var p = 0; p < i.store_types.length; p++ ){
|
|
// if( i.store_types[p].id == i.store_type ){
|
|
// storeName = i.store_types[p].name
|
|
// }
|
|
// }
|
|
if(i.joininfo){
|
|
for( var img = 0; img< i.joininfo.image.length-1; img++ ){
|
|
images[img].isadd = true;
|
|
images[img].src = i.joininfo.image[img]
|
|
}
|
|
}
|
|
|
|
t.setData({
|
|
showpage: e,
|
|
'join.joinInfo': joinInfo,
|
|
'join.mallId': i.joininfo.mall_id,
|
|
'join.mallName': i.joininfo.mall_name,
|
|
'join.storeId': i.joininfo.store_type,
|
|
'join.storeName': i.joininfo.store_type_name,
|
|
'join.typesId':i.mall_type,
|
|
'join.region': i.mall_area || [],
|
|
'join.typesName': typesName,
|
|
'join.images': images,
|
|
CheckItem:CheckItem,
|
|
'detail.trust_count':num,
|
|
footerindex: 2
|
|
});
|
|
}
|
|
});
|
|
},
|
|
escape2Html: function(t) {
|
|
console.log(t);
|
|
var a = {
|
|
"&": "&",
|
|
"<": "<",
|
|
">": ">",
|
|
""": '"',
|
|
"'": "'",
|
|
"/": "/"
|
|
};
|
|
return t.replace(/&(amp|lt|gt|quot|#39|#x2F);/gi, function(t, i) {
|
|
return a[i];
|
|
});
|
|
},
|
|
getranking: function(t,type) {
|
|
wx.showLoading({
|
|
title: "加载中"
|
|
}), r.util.request({
|
|
url: "entry/wxapp/rankings",
|
|
data: {
|
|
start: t.data.ranking.start,
|
|
voteid: t.data.voteid,
|
|
type: type || 'renqi',
|
|
limit: t.data.ranking.limit
|
|
},
|
|
success: function(a) {
|
|
for (var i = t.data.ranking, e = 0; e < a.data.data.length; e++) i.list.push(a.data.data[e]);
|
|
i.start = Number(i.start) + 20, i.ispulluploading = !1, t.setData({
|
|
ranking: i
|
|
});
|
|
}
|
|
});
|
|
},
|
|
giftbox: d,
|
|
haibao: function(t, a) {
|
|
var i = t.data.detail;
|
|
i.haibao ? (i.haibao = !1, t.setData({
|
|
detail: i
|
|
})) : r.util.request({
|
|
url: "entry/wxapp/CreatePoster",
|
|
data: {
|
|
voteid: t.data.voteid,
|
|
joinid: a
|
|
},
|
|
success: function(a) {
|
|
console.log(a.data.data), i.imgurl = a.data.data, i.haibao = !0, t.setData({
|
|
detail: i
|
|
});
|
|
}
|
|
});
|
|
},
|
|
reply: function(t, a, i) {
|
|
var e = t.data.voteid;
|
|
r.util.request({
|
|
url: "entry/wxapp/Reply",
|
|
data: {
|
|
voteid: e,
|
|
joinid: a,
|
|
content: i,
|
|
uid: t.data.memberinfo.id,
|
|
op: "add",
|
|
nickname: t.data.memberinfo.nickname,
|
|
avatar: t.data.memberinfo.avatar
|
|
},
|
|
success: function(a) {
|
|
var i = t.data.detail;
|
|
i.isreply = !1, i.reply.push(a.data.data), t.setData({
|
|
detail: i
|
|
});
|
|
}
|
|
});
|
|
}
|
|
};
|