@@ -69,7 +69,10 @@ | |||||
"pages/shareFriend/shareFriend", | "pages/shareFriend/shareFriend", | ||||
"components/dateLsit/dateLsit", | "components/dateLsit/dateLsit", | ||||
"pages/dateLsit/dateLsit", | "pages/dateLsit/dateLsit", | ||||
"pages/activityCalendar/activityCalendar" | |||||
"pages/activityCalendar/activityCalendar", | |||||
"pages/complaint/complaint", | |||||
"pages/questionnaire/questionnaire", | |||||
"pages/questionnaire/questionnaireLsit/questionnaireLsit" | |||||
], | ], | ||||
"subpackages": [ | "subpackages": [ | ||||
{ | { | ||||
@@ -37,7 +37,11 @@ Component({ | |||||
wx.navigateTo({ | wx.navigateTo({ | ||||
url: `/${e.currentTarget.dataset.data.pagePath}`, | url: `/${e.currentTarget.dataset.data.pagePath}`, | ||||
}) | }) | ||||
} else if (type == 'ra'){ | |||||
}else if(type == "wj"){ | |||||
wx.navigateTo({ | |||||
url: `/pages/questionnaire/questionnaire?id=${id}`, | |||||
}) | |||||
}else if (type == 'ra'){ | |||||
wx.navigateTo({ | wx.navigateTo({ | ||||
url: `/pages/radetail/index?id=${id}`, | url: `/pages/radetail/index?id=${id}`, | ||||
}) | }) | ||||
@@ -20,6 +20,14 @@ var config = { | |||||
* 微信消息推送获取模板id | * 微信消息推送获取模板id | ||||
*/ | */ | ||||
templateId: "/wxMsg/templateList", | templateId: "/wxMsg/templateList", | ||||
//问卷列表 | |||||
questionnaire :"/wxQuestionOneself/list", | |||||
//问卷详情 | |||||
questionnaireDetail:"/wxQuestionOneself/detailsById", | |||||
//提交问卷 | |||||
submitQuestin:"/wxQuestionOneself/userAdd", | |||||
//投诉建议add | |||||
suggest:"/wxOpinion/add", | |||||
/** | /** | ||||
* 接口用途:login | * 接口用途:login | ||||
*/ | */ | ||||
@@ -4,6 +4,5 @@ | |||||
"navbar": "../components/navbar/navbar" | "navbar": "../components/navbar/navbar" | ||||
}, | }, | ||||
"navigationBarBackgroundColor": "#FD832D", | "navigationBarBackgroundColor": "#FD832D", | ||||
"navigationBarTextStyle": "white", | |||||
"disableScroll": true | |||||
"navigationBarTextStyle": "white" | |||||
} | } |
@@ -123,6 +123,18 @@ | |||||
<view class="particulars_go">></view> | <view class="particulars_go">></view> | ||||
</view> | </view> | ||||
</navigator> | </navigator> | ||||
<navigator url="/pages/questionnaire/questionnaireLsit/questionnaireLsit" open-type="navigate"> | |||||
<view class="particulars_list"> | |||||
<view class="particulars_name">问券调查</view> | |||||
<view class="particulars_go">></view> | |||||
</view> | |||||
</navigator> | |||||
<navigator url="/pages/complaint/complaint" open-type="navigate"> | |||||
<view class="particulars_list"> | |||||
<view class="particulars_name">投诉建议</view> | |||||
<view class="particulars_go">></view> | |||||
</view> | |||||
</navigator> | |||||
<navigator url="/pages/mallInfo/mallInfo" open-type="navigate"> | <navigator url="/pages/mallInfo/mallInfo" open-type="navigate"> | ||||
<view class="particulars_list"> | <view class="particulars_list"> | ||||
<view class="particulars_name">关于我们</view> | <view class="particulars_name">关于我们</view> | ||||
@@ -0,0 +1,129 @@ | |||||
// pages/complaint/complaint.js | |||||
const Http = require("../../utils/HttpBasics"); | |||||
var config = require("../../config/config.js"); | |||||
var app = getApp(); | |||||
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' | |||||
Page({ | |||||
/** | |||||
* 页面的初始数据 | |||||
*/ | |||||
data: { | |||||
navigationBarHeight, | |||||
titleVale: "", //标题 | |||||
descrideVal: "", //描述 | |||||
}, | |||||
setDescrideVal(e) { //赋值标题 | |||||
let descrideVal = e.detail.value | |||||
this.setData({ | |||||
descrideVal: descrideVal | |||||
}) | |||||
}, | |||||
setTitVal(e) { //赋值描述 | |||||
let titleVale = e.detail.value | |||||
this.setData({ | |||||
titleVale: titleVale | |||||
}) | |||||
}, | |||||
save() { //提交 | |||||
if (!this.data.titleVale){ | |||||
wx.showToast({ | |||||
title: '请输入标题', | |||||
icon: "none", | |||||
duration: 2000 | |||||
}) | |||||
return | |||||
}else if(!this.data.descrideVal){ | |||||
wx.showToast({ | |||||
title: '请输入类容', | |||||
icon:"none", | |||||
duration:2000 | |||||
}) | |||||
return | |||||
} | |||||
let parameter = { | |||||
title: this.data.titleVale, | |||||
explains: this.data.descrideVal | |||||
} | |||||
Http.post({ | |||||
url: config.api.suggest, | |||||
data: parameter | |||||
}).then(item=>{ | |||||
wx.showToast({ | |||||
title: "提交成功!", | |||||
icon: 'none', | |||||
duration: 2000, | |||||
success: () => { | |||||
setTimeout(() => { | |||||
wx.switchTab({ | |||||
url: '/index/index' | |||||
}) | |||||
}, 2000) | |||||
} | |||||
}); | |||||
}).catch(err => { | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
// mask: false | |||||
}); | |||||
}) | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面加载 | |||||
*/ | |||||
onLoad: function(options) { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面初次渲染完成 | |||||
*/ | |||||
onReady: function() { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面显示 | |||||
*/ | |||||
onShow: function() { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面隐藏 | |||||
*/ | |||||
onHide: function() { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面卸载 | |||||
*/ | |||||
onUnload: function() { | |||||
}, | |||||
/** | |||||
* 页面相关事件处理函数--监听用户下拉动作 | |||||
*/ | |||||
onPullDownRefresh: function() { | |||||
}, | |||||
/** | |||||
* 页面上拉触底事件的处理函数 | |||||
*/ | |||||
onReachBottom: function() { | |||||
}, | |||||
/** | |||||
* 用户点击右上角分享 | |||||
*/ | |||||
onShareAppMessage: function() { | |||||
} | |||||
}) |
@@ -0,0 +1,8 @@ | |||||
{ | |||||
"usingComponents": { | |||||
"navbar": "../../components/navbar/navbar" | |||||
}, | |||||
"navigationBarTitleText": "", | |||||
"backgroundColor": "#f4f4f4", | |||||
"enablePullDownRefresh": true | |||||
} |
@@ -0,0 +1,17 @@ | |||||
<navbar back="{{true}}" home="{{true}}" text="投诉建议" background='#FD832D' color="white"></navbar> | |||||
<view style="height:{{navigationBarHeight}} "></view> | |||||
<view class="Box"> | |||||
<view class="titleBox"> | |||||
<view class="title">{{"标题:"}}</view> | |||||
<view class="titValueBox"> | |||||
<input class="titValue" placeholder="请填写投诉建议标题" bindinput="setTitVal"></input> | |||||
</view> | |||||
</view> | |||||
<view class="describeBox"> | |||||
<view class="describeTitle">详情描述:</view> | |||||
<view class="describeValueBox"> | |||||
<textarea class="describeValue" placeholder="请填写投诉建议内容,建议500字以内进行提交" maxlength="-1" bindinput="setDescrideVal" ></textarea> | |||||
</view> | |||||
<view class="submit" bindtap="save">提交</view> | |||||
</view> | |||||
</view> |
@@ -0,0 +1,62 @@ | |||||
.Box { | |||||
width: 90%; | |||||
/* height: 100vh; */ | |||||
margin: auto; | |||||
overflow: hidden; | |||||
} | |||||
.titleBox { | |||||
overflow: hidden; | |||||
margin: 20rpx 0; | |||||
} | |||||
.title { | |||||
height: 40rpx; | |||||
float: left; | |||||
padding: 20rpx 20rpx 20rpx 0; | |||||
} | |||||
.titValueBox { | |||||
width: 500rpx; | |||||
float: left; | |||||
border: 1px solid rgba(0, 0, 0, 0.1); | |||||
border-radius: 6rpx; | |||||
padding: 10rpx 10rpx 10rpx 0; | |||||
margin: 10rpx 10rpx 10rpx 0; | |||||
} | |||||
.titValue { | |||||
margin-left: 20rpx; | |||||
} | |||||
.describeBox { | |||||
padding: 20rpx 20rpx 20rpx 0; | |||||
} | |||||
.describeValueBox { | |||||
width: 80%; | |||||
margin-left: 108rpx; | |||||
margin-top: 40rpx; | |||||
border-radius: 6rpx; | |||||
border: 1px solid rgba(0, 0, 0, 0.1); | |||||
height: 600rpx; | |||||
} | |||||
.describeValue { | |||||
width: 92%; | |||||
height: 90%; | |||||
margin: 10rpx auto; | |||||
} | |||||
.submit{ | |||||
width: 600rpx; | |||||
height: 80rpx; | |||||
background-color: #FD832D; | |||||
color: #fff; | |||||
text-align: center; | |||||
line-height: 80rpx; | |||||
border-radius: 50rpx; | |||||
margin: 100rpx 0rpx 0 50rpx; | |||||
} |
@@ -108,6 +108,13 @@ Page({ | |||||
return; | return; | ||||
} | } | ||||
} | } | ||||
// 来着问卷 | |||||
if (that.data.path =="wj"){ | |||||
wx.redirectTo({ | |||||
url: `/pages/questionnaire/questionnaire?id=${that.data.wjId}` | |||||
}) | |||||
return; | |||||
} | |||||
/**a | /**a | ||||
* 来自我的 | * 来自我的 | ||||
*/ | */ | ||||
@@ -13,8 +13,10 @@ Page({ | |||||
couponOrderId: null, | couponOrderId: null, | ||||
optionData: null, | optionData: null, | ||||
fromflag: '', | fromflag: '', | ||||
couponChannelIdflag: '' | |||||
couponChannelIdflag: '', | |||||
wjId:"", | |||||
}, | }, | ||||
//是否授权手机号 | |||||
judgePhonelngo() { | judgePhonelngo() { | ||||
Http.get({ | Http.get({ | ||||
url: config.api.checkPhoneStatus, | url: config.api.checkPhoneStatus, | ||||
@@ -45,8 +47,6 @@ Page({ | |||||
}); | }); | ||||
}) | }) | ||||
}, | }, | ||||
onLoad: function(options) { | onLoad: function(options) { | ||||
console.log(app.globalData.skip, app.globalData.skipUrl, "跳转地址") | console.log(app.globalData.skip, app.globalData.skipUrl, "跳转地址") | ||||
var that = this; | var that = this; | ||||
@@ -57,15 +57,18 @@ Page({ | |||||
fromflag: options.fromflag | fromflag: options.fromflag | ||||
}) | }) | ||||
} | } | ||||
if (options && options.goFlaig){ | |||||
that.se | |||||
} | |||||
// 来自优惠券列表券详情页面的 couponChannelId | // 来自优惠券列表券详情页面的 couponChannelId | ||||
if (options && options.couponChannelIdflag) { | if (options && options.couponChannelIdflag) { | ||||
that.setData({ | that.setData({ | ||||
couponChannelIdflag: options.couponChannelIdflag | couponChannelIdflag: options.couponChannelIdflag | ||||
}) | }) | ||||
} | } | ||||
//调查问卷 | |||||
if (options && !options.wjId || options.wjId){ | |||||
this.setData({ | |||||
wjId: options.wjId | |||||
}) | |||||
} | |||||
if (options && options.spellGroup) { | if (options && options.spellGroup) { | ||||
that.setData({ | that.setData({ | ||||
spellGroup: options.spellGroup | spellGroup: options.spellGroup | ||||
@@ -155,6 +158,12 @@ Page({ | |||||
} | } | ||||
}).then( | }).then( | ||||
function(res) { | function(res) { | ||||
if(that.data.wjId){ | |||||
app.globalData.skipUrl =`/pages/questionnaire/questionnaire?id=${that.data.wjId}` | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
return; | |||||
} | |||||
if (that.data.fromflag == 'poster') { | if (that.data.fromflag == 'poster') { | ||||
app.globalData.skipUrl = `/pages/canvas/index?couponChannelId=${that.data.couponChannelId}` | app.globalData.skipUrl = `/pages/canvas/index?couponChannelId=${that.data.couponChannelId}` | ||||
app.globalData.skip = 'redirectTo' | app.globalData.skip = 'redirectTo' | ||||
@@ -71,6 +71,8 @@ Page({ | |||||
} else if (options.type == 'si') { | } else if (options.type == 'si') { | ||||
//活动签到 | //活动签到 | ||||
options.id = this.data.newArr[2]; | options.id = this.data.newArr[2]; | ||||
} else if (options.type == 'wj') { | |||||
options.id = this.data.newArr[2]; | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -197,6 +199,12 @@ Page({ | |||||
url: `/pages/acSignIn/index?id=${options.id}`, | url: `/pages/acSignIn/index?id=${options.id}`, | ||||
}) | }) | ||||
} | } | ||||
//答题问卷 | |||||
else if (options && options.id && app.globalData.type == 'wj') { | |||||
wx.redirectTo({ | |||||
url: `/pages/questionnaire/questionnaire?id=${options.id}`, | |||||
}) | |||||
} | |||||
// 宣传页详情 | // 宣传页详情 | ||||
else if (options && options.bt && options.id && app.globalData.type == 'bd') { | else if (options && options.bt && options.id && app.globalData.type == 'bd') { | ||||
if (options.bt == '2') { | if (options.bt == '2') { | ||||
@@ -400,6 +408,12 @@ Page({ | |||||
url: `/pages/getuserinfo/index?orderId=${options.orderId}&from='${"discount"}` | url: `/pages/getuserinfo/index?orderId=${options.orderId}&from='${"discount"}` | ||||
}) | }) | ||||
} | } | ||||
// 报名活动页面 | |||||
else if (options && options.id && app.globalData.type == 'ra') { | |||||
wx.redirectTo({ | |||||
url: `/pages/radetail/index?id=${options.id}`, | |||||
}) | |||||
} | |||||
// 通过分享进入的门店详情 | // 通过分享进入的门店详情 | ||||
else if (options && options.id && options.frommd == 'md') { | else if (options && options.id && options.frommd == 'md') { | ||||
wx.redirectTo({ | wx.redirectTo({ | ||||
@@ -13,7 +13,7 @@ Page({ | |||||
*/ | */ | ||||
onLoad: function(options) { | onLoad: function(options) { | ||||
let that = this; | let that = this; | ||||
console.log(options); | |||||
console.log(options,"跳转地址栏"); | |||||
wx.showToast({ | wx.showToast({ | ||||
title: '加载中', | title: '加载中', | ||||
icon: "loading", | icon: "loading", | ||||
@@ -72,6 +72,8 @@ Page({ | |||||
} else if (options.type == 'si') { | } else if (options.type == 'si') { | ||||
//活动签到 | //活动签到 | ||||
options.id = this.data.newArr[2]; | options.id = this.data.newArr[2]; | ||||
} else if (options.type == 'wj'){ | |||||
options.id = this.data.newArr[2]; | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -196,6 +198,12 @@ Page({ | |||||
url: `/pages/acSignIn/index?id=${options.id}`, | url: `/pages/acSignIn/index?id=${options.id}`, | ||||
}) | }) | ||||
} | } | ||||
//问卷答题 | |||||
else if (options && options.id && app.globalData.type == 'wj') { | |||||
wx.redirectTo({ | |||||
url: `/pages/questionnaire/questionnaire?id=${options.id}`, | |||||
}) | |||||
} | |||||
// 宣传页详情 | // 宣传页详情 | ||||
else if (options && options.bt && options.id && app.globalData.type == 'bd') { | else if (options && options.bt && options.id && app.globalData.type == 'bd') { | ||||
if (options.bt == '2') { | if (options.bt == '2') { | ||||
@@ -391,7 +399,20 @@ Page({ | |||||
wx.redirectTo({ | wx.redirectTo({ | ||||
url: `/pages/index/searchbar/detail/index?id=${options.id}` | url: `/pages/index/searchbar/detail/index?id=${options.id}` | ||||
}); | }); | ||||
} else if (app.globalData.type == 'uc') { | |||||
} | |||||
// 答题问卷 | |||||
else if (options && options.id && app.globalData.type == 'wj'){ | |||||
wx.redirectTo({ | |||||
url: `/pages/questionnaire/questionnaire?id=${options.id}`, | |||||
}) | |||||
} | |||||
// 报名活动页面 | |||||
else if (options && options.id && app.globalData.type == 'ra') { | |||||
wx.redirectTo({ | |||||
url: `/pages/radetail/index?id=${options.id}`, | |||||
}) | |||||
} | |||||
else if (app.globalData.type == 'uc') { | |||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/index/user' | url: '/index/user' | ||||
}); | }); | ||||
@@ -0,0 +1,252 @@ | |||||
// pages/questionnaire/questionnaire.js | |||||
const Http = require("../../utils/HttpBasics"); | |||||
var config = require("../../config/config.js"); | |||||
const util = require("../../utils/util.js"); | |||||
var app = getApp(); | |||||
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' | |||||
Page({ | |||||
/** | |||||
* 页面的初始数据 | |||||
*/ | |||||
data: { | |||||
navigationBarHeight, | |||||
id: "", | |||||
question: {}, | |||||
userDetails: "", | |||||
thenDate: "", | |||||
}, | |||||
//设置选中项 | |||||
setLsit(e) { | |||||
if (this.data.userDetails != "") { | |||||
return | |||||
} | |||||
let index1 = e.currentTarget.dataset.index1 | |||||
let index2 = e.currentTarget.dataset.index2 | |||||
let tempList = this.data.question | |||||
if (tempList.topicList[index1].type == 1) { | |||||
tempList.topicList[index1].answers.map(item => { | |||||
item.falg = false | |||||
}) | |||||
tempList.topicList[index1].answers[index2].falg = !tempList.topicList[index1].answers[index2].falg | |||||
} else { | |||||
tempList.topicList[index1].answers[index2].falg = !tempList.topicList[index1].answers[index2].falg | |||||
} | |||||
this.setData({ | |||||
question: tempList | |||||
}) | |||||
}, | |||||
//提交 | |||||
save() { | |||||
let falg = false | |||||
let logList = [] | |||||
let tmepData = this.data.question.topicList | |||||
tmepData.map(item => { | |||||
let tmepObj = {} | |||||
let tempArr = [] | |||||
tmepObj.topicId = item.id | |||||
item.answers.map(res => { | |||||
if (res.falg) { | |||||
tempArr.push(res.id) | |||||
item.complete = true | |||||
} | |||||
}) | |||||
tmepObj.answer = JSON.stringify(tempArr) | |||||
logList.push(tmepObj) | |||||
}) | |||||
tmepData.map(item => { | |||||
if (item.complete == null) { | |||||
falg = true | |||||
} | |||||
}) | |||||
if (falg) { | |||||
wx.showToast({ | |||||
title: "您还有未答的题目!", | |||||
icon: 'none', | |||||
duration: 2000, | |||||
// mask: false | |||||
}); | |||||
return true | |||||
} | |||||
let param = { | |||||
questionId: this.data.id, | |||||
logList: logList | |||||
} | |||||
console.log(tmepData) | |||||
console.log(param, "param") | |||||
Http.post({ | |||||
url: config.api.submitQuestin, | |||||
data: param | |||||
}).then(res => { | |||||
let str = "" | |||||
if (this.data.question.rewardCredit) { | |||||
str = `感谢您的参与, | |||||
${this.data.question.rewardCredit}积分已经到账啦` | |||||
} else { | |||||
str = `感谢您的参与!` | |||||
} | |||||
wx.showToast({ | |||||
title: str, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
success: () => { | |||||
setTimeout(() => { | |||||
wx.switchTab({ | |||||
url: '/index/index' | |||||
}) | |||||
}, 2000) | |||||
} | |||||
// mask: false | |||||
}); | |||||
}).catch(err => { | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
// mask: false | |||||
}); | |||||
}) | |||||
}, | |||||
//是否授权手机号 | |||||
ifPhoneInfo() { | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.checkPhoneStatus, | |||||
data: {} | |||||
}).then(res => { | |||||
return | |||||
}).catch(err => { | |||||
wx.navigateTo({ | |||||
url: `/pages/getuserinfo/index?path=wj&wjId=${this.data.id}`, | |||||
}) | |||||
}) | |||||
}, | |||||
/* 判断是否授权*/ | |||||
userAuthorization() { | |||||
Http.get({ | |||||
url: config.api.checkUserStatus, | |||||
data: { | |||||
token: app.globalData.token | |||||
} | |||||
}).then(res => { | |||||
this.ifPhoneInfo() | |||||
}).catch(err => { | |||||
wx.navigateTo({ | |||||
url: `/pages/getuserinfo/index?fromflag=wj&wjId=${this.data.id}`, | |||||
}) | |||||
}) | |||||
}, | |||||
//获取问卷详情 | |||||
getDetail() { | |||||
let param = { | |||||
id: this.data.id | |||||
} | |||||
Http.get({ | |||||
url: config.api.questionnaireDetail, | |||||
data: param | |||||
}).then(res => { | |||||
res.data.question.startDate_Sing = util.formatTime(res.data.question.startDate, "yyyy-MM-dd hh:mm") | |||||
res.data.question.endDate_Sing = util.formatTime(res.data.question.endDate, "yyyy-MM-dd hh:mm") | |||||
console.log(res.data.question) | |||||
if (res.data.userDetails) { | |||||
let temp = res.data.question.topicList | |||||
temp.map((item, index) => { | |||||
// res.data.userDetails | |||||
item.answers.map(item2 => { | |||||
let tempArr = JSON.parse(res.data.userDetails.logList[index].answer) | |||||
if (tempArr.indexOf(item2.id) != -1) { | |||||
item2.falg = true | |||||
} | |||||
}) | |||||
}) | |||||
this.setData({ | |||||
userDetails: res.data.userDetails | |||||
}) | |||||
} | |||||
this.setData({ | |||||
question: res.data.question | |||||
}) | |||||
}).catch(err => { | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
// mask: false | |||||
}); | |||||
}) | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面加载 | |||||
*/ | |||||
onLoad: function(options) { | |||||
this.setData({ | |||||
id: options.id, | |||||
}) | |||||
this.getDetail() | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面初次渲染完成 | |||||
*/ | |||||
onReady: function() { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面显示 | |||||
*/ | |||||
onShow: function() { | |||||
this.userAuthorization() | |||||
this.setData({ | |||||
thenDate: new Date().getTime() | |||||
}) | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面隐藏 | |||||
*/ | |||||
onHide: function() { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面卸载 | |||||
*/ | |||||
onUnload: function() { | |||||
}, | |||||
/** | |||||
* 页面相关事件处理函数--监听用户下拉动作 | |||||
*/ | |||||
onPullDownRefresh: function() { | |||||
}, | |||||
/** | |||||
* 页面上拉触底事件的处理函数 | |||||
*/ | |||||
onReachBottom: function() { | |||||
}, | |||||
/** | |||||
* 用户点击右上角分享 | |||||
*/ | |||||
onShareAppMessage: function() { | |||||
} | |||||
}) |
@@ -0,0 +1,8 @@ | |||||
{ | |||||
"usingComponents": { | |||||
"navbar": "../../components/navbar/navbar" | |||||
}, | |||||
"navigationBarBackgroundColor": "#FD832D", | |||||
"navigationBarTextStyle": "white" | |||||
} |
@@ -0,0 +1,25 @@ | |||||
<navbar back="{{true}}" home="{{true}}" text="问卷详情" background='#FD832D' color="white"></navbar> | |||||
<view style="height:{{navigationBarHeight}} "></view> | |||||
<view class="Box"> | |||||
<!-- <view class="hidBox"> | |||||
<view class="contcBox"></view> | |||||
</view> --> | |||||
<image class="imgBox" src="{{question.logo}}"></image> | |||||
<view class="titleBox"> | |||||
<view class="title">{{question.title}}</view> | |||||
<view class="time">{{'答题时间:'+question.startDate_Sing+'至'+question.endDate_Sing}}</view> | |||||
<text class="content">{{question.topDesc}}</text> | |||||
</view> | |||||
<view class="oneBox" wx:for="{{question.topicList}}"> | |||||
<view class="oneTitle">{{ item.type==2? index+1 +'、'+item.title+'(可多选)':index+1 +'、'+item.title}}</view> | |||||
<view class="{{item_2.falg?'item_show ':'item_hie'}}" wx:for="{{item.answers}}" wx:for-index="index_2" wx:for-item="item_2" bindtap="setLsit" data-index1="{{index}}" data-index2="{{index_2}}">{{item_2.name}}</view> | |||||
</view> | |||||
<view class="invalid" wx:if="{{thenDate<question.startDate}}">未开始</view> | |||||
<view class="invalid" wx:elif="{{thenDate>question.endDate}}">已过期</view> | |||||
<view class="submit" bindtap="save" wx:elif="{{question.userStatus<=0&&question.status!=1}}">提交</view> | |||||
<view class="invalid" wx:elif="{{question.userStatus>0}}">已参与</view> | |||||
<view class="invalid" wx:elif="{{question.status==1}}">已下线</view> | |||||
<view class="invalid" wx:elif="{{question.status!=1}}">已上线</view> | |||||
</view> |
@@ -0,0 +1,117 @@ | |||||
/* pages/questionnaire/questionnaire.wxss */ | |||||
page { | |||||
overflow-y: scroll !important; | |||||
} | |||||
.Box { | |||||
background-color: rgba(242, 242, 242, 1); | |||||
overflow: hidden; | |||||
} | |||||
.imgBox { | |||||
width: 96%; | |||||
height: 300rpx; | |||||
margin: 20rpx 15rpx; | |||||
border-radius: 6rpx; | |||||
/* background-color: aqua; */ | |||||
} | |||||
.titleBox { | |||||
width: 96%; | |||||
margin: auto; | |||||
} | |||||
.title { | |||||
font-size: 36rpx; | |||||
font-weight: 700; | |||||
color: #999; | |||||
margin-top: 10rpx; | |||||
} | |||||
.content { | |||||
padding: 20rpx 0; | |||||
color: #999; | |||||
font-size: 32rpx; | |||||
/* overflow: hidden; | |||||
text-overflow: ellipsis; | |||||
height: 70rpx; | |||||
display: -webkit-box; | |||||
-webkit-box-orient: vertical; | |||||
-webkit-line-clamp: 2; */ | |||||
} | |||||
.hidBox{ | |||||
width: 100%; | |||||
height: 100%; | |||||
position: fixed; | |||||
top: 0; | |||||
left: 0; | |||||
background-color: rgba(0, 0, 0, 0.2) | |||||
} | |||||
.contcBox{ | |||||
width: 80%; | |||||
height: 300rpx; | |||||
background-color: #fff; | |||||
} | |||||
.time{ | |||||
font-size: 32rpx; | |||||
padding: 10rpx 0; | |||||
color: #999; | |||||
} | |||||
.oneBox { | |||||
width: 96%; | |||||
margin: 20rpx auto; | |||||
background-color: #fff; | |||||
border-radius: 6rpx; | |||||
padding-bottom: 20rpx; | |||||
} | |||||
.moreBox { | |||||
width: 96%; | |||||
margin: 20rpx auto; | |||||
background-color: #fff; | |||||
border-radius: 6rpx; | |||||
padding-bottom: 20rpx; | |||||
} | |||||
.oneTitle { | |||||
font-weight: 700; | |||||
padding: 10rpx; | |||||
font-size: 36rpx; | |||||
margin: 10rpx auto; | |||||
} | |||||
.item_hie { | |||||
text-align: center; | |||||
line-height: 68rpx; | |||||
margin-top: 10rpx; | |||||
} | |||||
.item_show { | |||||
text-align: center; | |||||
line-height: 68rpx; | |||||
color: #fff; | |||||
background-color: rgba(243, 151, 56, 1); | |||||
margin-top: 10rpx; | |||||
} | |||||
.submit{ | |||||
width: 600rpx; | |||||
height: 80rpx; | |||||
background-color: rgba(0, 153, 255, 1); | |||||
color: #fff; | |||||
text-align: center; | |||||
line-height: 80rpx; | |||||
border-radius: 6rpx; | |||||
margin: 20rpx auto; | |||||
} | |||||
.invalid{ | |||||
width: 600rpx; | |||||
height: 80rpx; | |||||
background-color: rgba(0, 0, 0, 0.2); | |||||
color: #fff; | |||||
text-align: center; | |||||
line-height: 80rpx; | |||||
border-radius: 6rpx; | |||||
margin: 20rpx auto; | |||||
} |
@@ -0,0 +1,121 @@ | |||||
// pages/questionnaire/questionnaireLsit/questionnaireLsit.js | |||||
const Http = require("../../../utils/HttpBasics"); | |||||
var config = require("../../../config/config.js"); | |||||
var app = getApp(); | |||||
var app = getApp(); | |||||
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' | |||||
Page({ | |||||
/** | |||||
* 页面的初始数据 | |||||
*/ | |||||
data: { | |||||
navigationBarHeight, | |||||
list: [], | |||||
pageNum: 1, | |||||
pageSize: 4, | |||||
thenDate:"", | |||||
}, | |||||
goDetails(e){ | |||||
let id = e.currentTarget.dataset.id | |||||
console.log(id) | |||||
wx.navigateTo({ | |||||
url: `/pages/questionnaire/questionnaire?id=${id}`, | |||||
}) | |||||
}, | |||||
getQuest() { //查询问卷 | |||||
let param = { | |||||
pageNum: this.data.pageNum, | |||||
pageSize: this.data.pageSize | |||||
} | |||||
Http.get({ | |||||
url: config.api.questionnaire, | |||||
data: param | |||||
}).then(res => { | |||||
if(this.data.pageNum<=1){ | |||||
let temp = res.data.list | |||||
this.setData({ | |||||
list: temp | |||||
}) | |||||
}else{ | |||||
let temp = res.data.list | |||||
let formerLsit = this.data.list | |||||
formerLsit.push(...temp) | |||||
this.setData({ | |||||
list:formerLsit | |||||
}) | |||||
} | |||||
}).catch(err=>{ | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
// mask: false | |||||
}); | |||||
}) | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面加载 | |||||
*/ | |||||
onLoad: function (options) { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面初次渲染完成 | |||||
*/ | |||||
onReady: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面显示 | |||||
*/ | |||||
onShow: function () { | |||||
this.getQuest() | |||||
this.setData({ | |||||
thenDate: new Date().getTime() | |||||
}) | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面隐藏 | |||||
*/ | |||||
onHide: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面卸载 | |||||
*/ | |||||
onUnload: function () { | |||||
}, | |||||
/** | |||||
* 页面相关事件处理函数--监听用户下拉动作 | |||||
*/ | |||||
onPullDownRefresh: function () { | |||||
}, | |||||
/** | |||||
* 页面上拉触底事件的处理函数 | |||||
*/ | |||||
onReachBottom: function () { | |||||
console.log("我到底了!") | |||||
let pageNumFlge = this.data.pageNum+1 | |||||
this.setData({ | |||||
pageNum: pageNumFlge | |||||
}) | |||||
this.getQuest() | |||||
}, | |||||
/** | |||||
* 用户点击右上角分享 | |||||
*/ | |||||
onShareAppMessage: function () { | |||||
} | |||||
}) |
@@ -0,0 +1,7 @@ | |||||
{ | |||||
"usingComponents": { | |||||
"navbar": "../../components/navbar/navbar" | |||||
}, | |||||
"navigationBarBackgroundColor": "#FD832D", | |||||
"navigationBarTextStyle": "white" | |||||
} |
@@ -0,0 +1,18 @@ | |||||
<navbar back="{{true}}" home="{{true}}" text="问卷调查" background='#FD832D' color="white"></navbar> | |||||
<view style="height:{{navigationBarHeight}} "></view> | |||||
<view class="noData" wx:if="{{list.length==0}}"> 敬请期待!</view> | |||||
<view class="questionLsi" wx:for="{{list}}" bindtap="goDetails" data-id="{{item.id}}"> | |||||
<image class="img" src="{{item.logo}}"></image> | |||||
<view class="title">{{item.title}}</view> | |||||
<view class="conten">{{item.topDesc}}</view> | |||||
<view class="accomplish" wx:if="{{item.userStatus!=0}}" >已完成</view> | |||||
<view class="accomplish" wx:elif="{{thenDate<item.startDate}}" >未开始</view> | |||||
<view class="accomplish" wx:elif="{{thenDate>item.endDate||item.status==1}}" >已结束</view> | |||||
<view>{{thenDate}}</view> | |||||
<view>{{item.startDate}}</view> | |||||
<view>{{item.endDate}}</view> | |||||
</view> | |||||
@@ -0,0 +1,71 @@ | |||||
/* pages/questionnaire/questionnaireLsit/questionnaireLsit.wxss */ | |||||
page { | |||||
overflow-y: scroll !important; | |||||
} | |||||
.questionLsi { | |||||
background-color: #fff; | |||||
border-radius: 6rpx; | |||||
margin: 20rpx auto; | |||||
overflow: hidden; | |||||
width: 96%; | |||||
position: relative; | |||||
height: 520rpx; | |||||
} | |||||
.img { | |||||
width: 96%; | |||||
margin: 20rpx 16rpx; | |||||
/* background-color: aqua; */ | |||||
height: 300rpx; | |||||
} | |||||
.title { | |||||
width: 96%; | |||||
font-size: 36rpx; | |||||
font-weight: 700; | |||||
color: #999; | |||||
margin: auto; | |||||
} | |||||
.conten { | |||||
width: 96%; | |||||
padding: 20rpx 0; | |||||
color: #999; | |||||
font-size: 32rpx; | |||||
margin: 0 auto 20rpx auto; | |||||
overflow: hidden; | |||||
text-overflow: ellipsis; | |||||
height: 70rpx; | |||||
display: -webkit-box; | |||||
-webkit-box-orient: vertical; | |||||
-webkit-line-clamp: 2; | |||||
} | |||||
.accomplish { | |||||
position: absolute; | |||||
left: 0; | |||||
top: 0; | |||||
width: 100%; | |||||
height: 100%; | |||||
background-color: rgb(0, 0, 0, 0.2); | |||||
text-align: center; | |||||
line-height: 480rpx; | |||||
color: #fff; | |||||
font-size: 36rpx; | |||||
font-weight: 700; | |||||
} | |||||
.noData { | |||||
width: 100%; | |||||
z-index: 1000; | |||||
position: fixed; | |||||
top: 0; | |||||
left: 0; | |||||
text-align: center; | |||||
line-height: 100vh; | |||||
height: 100vh; | |||||
background-color: rgb(0, 0, 0, 0.2); | |||||
color: #fff; | |||||
} |
@@ -31,7 +31,7 @@ | |||||
"userConfirmedUseCompilerModuleSwitch": false | "userConfirmedUseCompilerModuleSwitch": false | ||||
}, | }, | ||||
"compileType": "miniprogram", | "compileType": "miniprogram", | ||||
"libVersion": "2.16.0", | |||||
"libVersion": "2.14.4", | |||||
"appid": "wxfa336cad86ed598d", | "appid": "wxfa336cad86ed598d", | ||||
"projectname": "oldC", | "projectname": "oldC", | ||||
"isGameTourist": false, | "isGameTourist": false, | ||||
@@ -109,6 +109,20 @@ | |||||
"pathName": "pages/dateLsit/dateLsit", | "pathName": "pages/dateLsit/dateLsit", | ||||
"query": "", | "query": "", | ||||
"scene": null | "scene": null | ||||
}, | |||||
{ | |||||
"id": -1, | |||||
"name": "投书建议", | |||||
"pathName": "pages/complaint/complaint", | |||||
"query": "", | |||||
"scene": null | |||||
}, | |||||
{ | |||||
"id": 8, | |||||
"name": "pages/questionnaire/questionnaireLsit/questionnaireLsit", | |||||
"pathName": "pages/questionnaire/questionnaireLsit/questionnaireLsit", | |||||
"query": "", | |||||
"scene": null | |||||
} | } | ||||
] | ] | ||||
} | } | ||||