var t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t;
} : function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, a = require("../../../config/config.js"), e = require("../../../config/define.js"), i = require("../../../utils/util.js");
Page({
data: {
count: 10,
page: 1,
mark: e.mark,
valid: a.define.valid,
imgMode: e.imgMode,
compName: [],
compList: [],
component: [],
attrInfo: {
footer_info: ""
},
tid: "",
id: "",
type: "",
autoHeight: false,
userid_limit_num: 0,
is_ip: 0,
ip_limit_num: 0,
is_login: 0,
save_loading: "",
tip: {
message: "",
tipType: ""
},
pageShow: false,
add: false,
userIndex: 0,
IPIndex: 0,
limitList: e.limitList,
info: {},
times: 0
},
onLoad: function(t) {
this.setData({
id: t.id,
tid: t.tid,
type: t.type
});
var a = i.storage.get(e.curStorage);
a && this.handleData(a.data);
},
onReady: function(t) {
if (this.getComponet(), !this.data.id) return this.getPreset(), false;
this.getDetail();
},
handleData: function(t) {
var a = this, e = i.formatTime();
if (this.data.startDate = e.split(" ")[0], a.data.afterSetting) for (var r in a.data.afterSetting) a.data.afterName.push(a.data.afterSetting[r].key);
if (t) {
if (t.userid_limit_num) for (var o in a.data.limitList) a.data.limitList[o] == t.userid_limit_num && (a.data.userIndex = o); else a.data.userIndex = 0;
if (parseInt(t.result_page) && 4 != parseInt(t.result_page) || (t.result_page = 3),
t.result_page = parseInt(t.result_page), t.ip_limit_num) for (var s in a.data.limitList) a.data.limitList[s] == t.ip_limit_num && (a.data.IPIndex = s); else a.data.IPIndex = 0;
if (t.scope_limit && 2 == t.scope_limit && (a.data.authCheck = 1), !t.start_time) {
var n = i.formatTime("", "yyyy-mm-dd");
t.start_time = n;
}
if (!t.end_time) {
var d = Date.parse(new Date()) + 6048e5;
d = i.formatTime(d, "yyyy-mm-dd"), t.end_time = d;
}
t.share_link = t.share_link || "", t.other_page = t.other_page || "", this.setData({
info: t,
IPIndex: a.data.IPIndex,
userIndex: a.data.userIndex,
authCheck: a.data.authCheck,
afterName: a.data.afterName
});
}
},
changeSet: function(t) {
if (t.target.dataset.type && t.detail.value) {
var a = t.target.dataset.type;
switch (a) {
case "userid_limit_num":
this.data.info[a] = this.data.limitList[t.detail.value], this.setData({
userIndex: t.detail.value
}), 0 !== parseInt(t.detail.value) ? this.setData({
userid_limit_num: t.detail.value,
is_login: 1
}) : this.setData({
userid_limit_num: "0",
is_login: 0
});
break;
case "ip_limit_num":
this.data.info[a] = this.data.limitList[t.detail.value], this.setData({
IPIndex: t.detail.value
}), 0 !== parseInt(t.detail.value) ? this.setData({
ip_limit_num: t.detail.value,
is_ip: 1
}) : this.setData({
ip_limit_num: "0",
is_ip: 0
});
break;
case "result_page":
this.data.info[a] = this.data.afterSetting[t.detail.value].value, this.setData({
afterIndex: t.detail.value,
info: this.data.info
});
}
}
},
onShow: function() {
var t = i.storage.get(e.curStorage);
return !!t && ("component" == t.type && this.data.component ? (!t.data.index && 0 != t.data.index || "edit" != t.set ? this.data.component.push(t.data) : (this.data.component[t.data.index] = t.data,
delete this.data.component[t.data.index].index), this.setData({
component: this.data.component
}), i.storage.remove(e.curStorage), false) : void ("attrInfo" == t.type && this.data.attrInfo && (this.setData({
attrInfo: t.data
}), i.storage.remove(e.curStorage))));
},
onFocus: function() {
this.setData({
autoHeight: true
});
},
getPreset: function() {
var t = this;
wx.showToast({
icon: "loading",
title: "加载中",
duration: 400
});
var e = [ a.define.plat, this.data.mark, "preset", this.data.tid ].join("_"), r = i.storage.get(e);
if (r && t.data.tid) t.setData({
attrInfo: r.preset,
component: r.component
}), setTimeout(function() {
t.setData({
pageShow: true
});
}, 200), wx.hideToast(); else if ("154" === t.data.tid) {
var o = [ {
form_type: "radio",
place: "单选题",
node: "survey",
type: "standard",
options: []
}, {
form_type: "checkbox",
node: "survey",
place: "多选题",
type: "standard",
options: []
}, {
form_type: "input",
node: "survey",
place: "填空题",
type: "standard",
options: []
}, {
form_type: "textarea",
node: "survey",
place: "问答题",
type: "standard",
options: []
} ], s = {
brief: "",
title: "",
footer_info: "",
node: "survey"
};
t.setData({
attrInfo: s,
component: o
}), wx.hideToast();
}
i.http(a.getUrl("template_preset", "public"), {
template_id: t.data.tid,
mark: t.data.mark,
is_app: 1
}, {
success: function(a) {
if (wx.hideToast(), 200 == a.statusCode) {
var r = a.data;
(r.ErrorText || r.ErrorCode) && t.toptip(r.ErrorText, "error"), r && r.preset && (r.preset.imgSrc = i.createImgsrc(r.preset.indexpic, {
width: 750
}), "154" === r.preset.tid && r.component && !r.component[0] && (r.component = t.data.component),
r.preset.footer_info = r.preset.footer_info || "", t.setData({
attrInfo: r.preset,
component: r.component
}), setTimeout(function() {
t.setData({
pageShow: true
});
}, 200), i.storage.set(e, r, t.data.valid));
}
}
});
},
getDetail: function() {
var t = this;
wx.showToast({
icon: "loading",
title: "加载中",
duration: 400
}), i.http(a.getUrl("detail", "form"), {
id: this.data.id,
mark: this.data.mark,
is_app: 1
}, {
success: function(a) {
if (200 == a.statusCode) {
var e = a.data;
(e.ErrorText || e.ErrorCode) && (t.topt
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
多模板多功能问卷调查小程序 (309个子文件)
header.jpg 47KB
public@2x.jpg 24KB
header-icon.jpg 12KB
index.js 17KB
index.js 17KB
mine.js 16KB
generate.js 12KB
result.js 7KB
result.js 5KB
checkbox.js 5KB
util.js 4KB
app.js 4KB
radio.js 3KB
setting.js 3KB
wxResult.js 3KB
square.js 3KB
define.js 3KB
detail.js 3KB
preview.js 2KB
config.js 2KB
program.js 2KB
answer.js 2KB
textarea.js 2KB
input.js 2KB
more.js 1KB
qrcode.js 1KB
other.js 373B
app.json 822B
project.config.json 639B
square.json 118B
preview.json 118B
mine.json 118B
more.json 89B
program.json 86B
wxResult.json 48B
result.json 48B
index.json 48B
setting.json 48B
detail.json 48B
other.json 48B
answer.json 48B
result.json 48B
input.json 45B
qrcode.json 45B
radio.json 45B
textarea.json 45B
checkbox.json 45B
index.json 42B
generate.json 36B
Computer@3x.png 161KB
bottom-erweima@3x.png 102KB
Computer@2x.png 89KB
bottom-erweima@2x.png 59KB
photo@3x.png 41KB
Computer.png 34KB
square_bg.png 31KB
bottom-erweima.png 25KB
public@3x.png 21KB
photo@2x.png 20KB
wave@3x.png 20KB
bottom-logo@3x.png 20KB
no_data@3x.png 18KB
online@3x.png 16KB
fabu_red-3x.png 15KB
erweima_red-3x.png 15KB
fabu_red.png 15KB
erweima_red.png 15KB
tongji_red-3x.png 15KB
tongji_red.png 15KB
zanting_red-3x.png 14KB
zanting_red.png 14KB
partake@3x.png 14KB
tour@3x.png 13KB
photo.png 12KB
Submit@3x.png 12KB
logo@3x.png 12KB
business@3x.png 11KB
no_data@2x.png 11KB
satisfy@3x.png 11KB
sign@3x.png 10KB
wave@2x.png 10KB
logo-2x.png 10KB
public@2x.png 9KB
teach@3x.png 9KB
digital@3x.png 8KB
research@3x.png 8KB
activity@3x.png 8KB
Submit@2x.png 8KB
health@3x.png 7KB
online@2x.png 7KB
food@3x.png 7KB
bottom-logo@2x.png 7KB
partake@2x.png 6KB
no_data@1x.png 6KB
tour@2x.png 5KB
max_default-2x.png 5KB
logo.png 5KB
business@2x.png 5KB
satisfy@2x.png 5KB
logo@2x.png 5KB
共 309 条
- 1
- 2
- 3
- 4
资源评论
- ps喾左耳2020-08-18看不到效果,只能去看代码学习了
- 唯一5212020-07-01太贵了,没什么用,还我积分
- laohu08142020-01-06还可以,有大部分页面在
- ZXF_T2019-05-14没有后台的么沉默的小猴子2019-05-16没有后台代码,后台就是个投票管理网站
- FF07092019-03-16有一点点用,学习沉默的小猴子2019-03-16模板里面的接口是不完整的,但是基本是能全部用到
沉默的小猴子
- 粉丝: 256
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功