作者 niufei

三期问题处理

... ... @@ -12,6 +12,13 @@
height: 16rpx;
background: #F0F0F0;
}
.wxParse-span{
overflow: hidden;
padding: 0;
display: flex;
justify-content: center;
}
.wxParse-img{
width: 100% !important;
}
... ...
... ... @@ -9,7 +9,21 @@ Page({
page: 0,
datalist: [],
pageNum: 10,
cover_type: false
cover_type: false,
input_bottom:0
},
// 获取到焦点
focus: function (e) {
this.setData({
input_bottom: 100
})
},
// 失去焦点
no_focus: function (e) {
this.setData({
input_bottom: 0
})
},
// 输入信息
get_word(e) {
... ... @@ -19,7 +33,7 @@ Page({
},
// 改变弹窗状态
change_cover(e) {
if (e.currentTarget.dataset.index){
if (e.currentTarget.dataset.id){
this.setData({
index: e.currentTarget.dataset.index,
id: e.currentTarget.dataset.id
... ...
... ... @@ -6,8 +6,8 @@
<image src='{{item.photo?item.photo:"https://volunteer.cnpu.org/imgs/wode_02@2x.png"}}' mode="aspectFill"></image>
</view>
<view class='admin_txt'>
<view class='admin_txttitle'>{{item.nane}}</view>
<view>{{item.duty}}</view>
<view class='admin_txttitle'>{{item.name}}</view>
<view>{{item.province}}</view>
</view>
</navigator>
<view class='admin_rigth' wx:if="{{type == 1}}">
... ... @@ -20,11 +20,11 @@
</block>
<view class="cover_box" catchtouchmove="true" wx:if="{{cover_type}}">
<view class="cover_box" catchtouchmove="true" wx:if="{{cover_type}}" style=" bottom: {{input_bottom}}px;">
<view class="show_box">
<view class="s_title">{{type>1?'请输入工时':'请输入未通过理由'}}</view>
<textarea placeholder="请输入..." class="word_area {{type>1?'active':''}}" value="{{word}}" bindinput="get_word" wx:if="{{type==1}}"/>
<input placeholder="请输入..." class="word_area active" value="{{word}}" bindinput="get_word" type="number" wx:if="{{type==2}}"/>
<textarea placeholder="请输入..." class="word_area {{type>1?'active':''}}" value="{{word}}" bindinput="get_word" wx:if="{{type==1}}" adjust-position='{{false}}' bindfocus="focus" bindblur='no_focus'/>
<input placeholder="请输入..." class="word_area active" value="{{word}}" bindinput="get_word" type="number" wx:if="{{type==2}}" adjust-position='{{false}}' bindfocus="focus" bindblur='no_focus'/>
<view class="submit" catchtap="{{type>1?'add_time':'reject'}}">确认</view>
<image src="/imgs/close.png" class="close" catchtap="change_cover"/>
</view>
... ...
... ... @@ -85,11 +85,11 @@ page {
height: 100%;
position: fixed;
left: 0;
top: 0;
display: flex;
justify-content: center;
align-items: center;
background: rgba(0, 0, 0, 0.3);
z-index: 3;
}
.show_box {
... ... @@ -123,7 +123,7 @@ page {
box-sizing: border-box;
}
.show_box .active{
height: 85rpx !important;
height: auto !important;
}
.show_box .submit {
width: 495rpx;
... ...
... ... @@ -676,6 +676,7 @@ Page({
name: res.name,
nation: res.nation,
photo: res.photo,
fixed_phone: res.fixed_phone,
politics: res.politics,
postcode: res.postcode,
province: res.province,
... ...
... ... @@ -5,12 +5,13 @@ Page({
* 页面的初始数据
*/
data: {
input_bottom: 0,
enroll_arr: ['线上', '线下', '线上及线下'],
check_arr: [
"摄影(设备自带",
"摄像(设备自带",
"摄影(设备自带)",
"摄像(设备自带)",
"爱心车队",
"现场服务(签到、指引、礼仪等",
"现场服务(签到、指引、礼仪等)",
"线上答疑",
"门诊服务"
],
... ... @@ -20,12 +21,6 @@ Page({
eat_arr: [
'午餐', '晚餐'
],
date_arr: [
"2019-07-21",
"2019-07-22",
"2019-07-23",
"2019-07-24"
],
t_arr: [{ //选择日期数组
date: '',
time: ''
... ... @@ -44,10 +39,23 @@ Page({
],
t_type: false,
z_type: false,
e_type: false,
z_type: true,
e_type: true,
cover_type: false
},
// 获取到焦点
focus: function (e) {
this.setData({
input_bottom: 100
})
},
// 失去焦点
no_focus: function (e) {
this.setData({
input_bottom: 0
})
},
// 审核用户信息是否通过
examine(e){
let that = this
... ... @@ -57,7 +65,7 @@ Page({
'XX-Token': wx.getStorageSync('token')
}
let params = {
id: that.data.user_id,
id: that.data.info.id,
status: id
}
app.post(url, params, head).then((res) => {
... ... @@ -173,12 +181,20 @@ Page({
that.setData({
z_type: true
})
} else {
that.setData({
z_type: false
})
}
} else if (type == 3) {
if (that.data.e_arr[index].date != "" && that.data.e_arr[index].time != "") {
that.setData({
e_type: true
})
} else {
that.setData({
e_type: false
})
}
}
},
... ... @@ -208,7 +224,29 @@ Page({
})
this.judge_status(2, index)
},
//删除日期,入住,用餐
del(e){
let status = Number(e.currentTarget.dataset.status)
let index = e.currentTarget.dataset.index
let arr = status > 1 ? (status > 2 ? this.data.e_arr : this.data.z_arr) : this.data.t_arr
arr.splice(index, 1)
if (status == 1){
this.setData({
t_arr: arr,
t_type: true
})
} else if(status == 2){
this.setData({
z_arr: arr,
z_type: true
})
} else if (status == 3) {
this.setData({
e_arr: arr,
e_type: true
})
}
},
// 添加日期,入住,用餐
add_item(e) {
let id = e.currentTarget.dataset.id
... ... @@ -231,7 +269,7 @@ Page({
t_type: false
})
} else if (id == 2) {
if (this.data.z_type == false) {
if (this.data.z_arr[this.data.z_arr.length - 1].date == "" && this.data.z_arr[this.data.z_arr.length - 1].idcard == "") {
wx.showToast({
title: '请先完善申请入住信息',
icon: 'none'
... ... @@ -248,7 +286,7 @@ Page({
z_type: false
})
} else if (id == 3) {
if (this.data.e_type == false) {
if (this.data.e_arr[this.data.e_arr.length - 1].date == "" && this.data.e_arr[this.data.e_arr.length - 1].time == "") {
wx.showToast({
title: '请先完善申请用餐信息',
icon: 'none'
... ... @@ -288,12 +326,16 @@ Page({
let params = {
id: id
}
if (this.data.status){
params.user_id = this.data.user_id
}
let header = {
'XX-Token': wx.getStorageSync('token')
}
app.post(url, params, header).then((res) => {
this.setData({
info: res,
date_arr: res.time, //活动日期
type_id: res.work_type ? res.work_type: null,
type: res.work_type ? this.data.enroll_arr[Number(res.work_type) - 1]:null,
check_id: res.work_content ? res.work_content : null,
... ... @@ -301,9 +343,7 @@ Page({
t_arr: res.select_time ? res.select_time : this.data.t_arr,
z_arr: res.apply_stay ? res.apply_stay : this.data.z_arr,
e_arr: res.apply_food ? res.apply_food : this.data.e_arr,
t_type: res.select_time?true:false,
z_type: res.apply_stay ? true : false,
e_type: res.apply_food ? true : false
t_type: res.select_time?true:false
})
})
... ... @@ -368,7 +408,7 @@ Page({
}
app.post(url, params, header).then((res) => {
wx.showToast({
title: '报名成功,请等待审核',
title: '报名成功',
duration: 1000,
success: ()=>{
setTimeout(()=>{
... ... @@ -388,8 +428,6 @@ Page({
if (options.type){
this.setData({
t_type: true,
z_type: true,
e_type: true,
page_type: options.type
})
}
... ...
... ... @@ -40,7 +40,9 @@
</view>
<view class="info_box" wx:for="{{t_arr}}" wx:key="index">
<view class="tilte">选择日期</view>
<view class="tilte">选择日期
<image class="del" src="/imgs/del.png" wx:if="{{t_arr.length>1 && index == t_arr.length-1}}" data-index="{{index}}" data-status="1" catchtap="del"/>
</view>
<view class="item">
<view class="left">
<image src="/imgs/must.png" /> 参加日期
... ... @@ -67,8 +69,9 @@
</view>
<view class="info_box" wx:for="{{z_arr}}" wx:key="index">
<view class="tilte">申请入住
<text>*仅限工作人员本人</text>
<view class="tilte">
<view> 申请入住<text>*仅限工作人员本人</text></view>
<image class="del" src="/imgs/del.png" wx:if="{{z_arr.length>1 && index == z_arr.length-1}}" data-index="{{index}}" data-status="2" catchtap="del"/>
</view>
<view class="item">
<view class="left">
... ... @@ -89,7 +92,9 @@
</view>
<view class="info_box" wx:for="{{e_arr}}" wx:key="index">
<view class="tilte">申请用餐</view>
<view class="tilte">申请用餐
<image class="del" src="/imgs/del.png" wx:if="{{e_arr.length>1 && index == e_arr.length-1}}" data-index="{{index}}" data-status="3" catchtap="del"/>
</view>
<view class="item">
<view class="left">
<image src="/imgs/must.png" /> 用餐日期
... ... @@ -128,10 +133,10 @@
</view>
<view class="line" wx:if="{{!status}}"/>
<view class="cover_box" catchtouchmove="true" wx:if="{{cover_type}}">
<view class="cover_box" catchtouchmove="true" wx:if="{{cover_type}}" style=" bottom: {{input_bottom}}px;">
<view class="show_box">
<view class="s_title">请输入工时</view>
<input placeholder="请输入..." class="word_area active" value="{{word}}" bindinput="get_word" type="number" />
<input placeholder="请输入..." class="word_area active" value="{{word}}" bindinput="get_word" type="number" adjust-position='{{false}}' bindfocus="focus" bindblur='no_focus'/>
<view class="submit" catchtap="add_time">确认</view>
<image src="/imgs/close.png" class="close" catchtap="change_cover" />
</view>
... ...
... ... @@ -75,8 +75,14 @@ page {
font-weight: bold;
color: rgba(51, 51, 51, 1);
margin-top: 50rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.tilte .del{
width: 40rpx;
height: 40rpx;
}
.tilte text {
font-size: 24rpx;
font-family: PingFang SC;
... ... @@ -117,11 +123,11 @@ page {
height: 100%;
position: fixed;
left: 0;
top: 0;
display: flex;
justify-content: center;
align-items: center;
background: rgba(0, 0, 0, 0.3);
z-index: 3;
}
.show_box {
... ... @@ -156,7 +162,7 @@ page {
}
.show_box .active {
height: 85rpx !important;
height: auto !important;
}
.show_box .submit {
... ...
... ... @@ -176,7 +176,7 @@ Page({
//判断是否登陆
get_token() {
let that = this;
let that = this
wx.login({
success: function (s) {
let url = 'wxapp/public/getSessionKey';
... ... @@ -195,8 +195,8 @@ Page({
wx.setStorageSync('token', res.data)
that.getdatalist()
} else {
wx.redirectTo({
url: '/pages/start/start'
wx.navigateTo({
url: '/pages/start/start',
})
}
}).catch((err) => {
... ... @@ -222,10 +222,12 @@ Page({
status: 1,
id: options.scene
})
if (wx.getStorageSync('token')) {
that.getdatalist()
if (wx.getStorageSync('token')){
that.getdatalist();
} else {
that.get_token()
wx.reLaunch({
url: '/pages/start/start?id=' + options.scene + '&type=1',
})
}
} else {
if (options.type == 1) {
... ...
... ... @@ -28,10 +28,12 @@
<navigator url='/pages/result/result' class='foot' wx:if='{{datalist.button_status == 6}}' hover-class="none">成为志愿者</navigator>
</view>
<view class="btn_box">
<view class="btn_box" wx:if="{{status == 1}}">
<navigator class="btn-item" style="background: url('https://volunteer.cnpu.org/static/images/index.png') no-repeat center;background-size: cover;" url="/pages/index/index" open-type="switchTab">首页</navigator>
<view class="btn-item" style="background: url('{{datalist.button_status == 2?'/imgs/edit.png':'https://volunteer.cnpu.org/static/images/edit@.png'}}') no-repeat center;background-size: cover;" bindtap="{{datalist.button_status == 2?'edit_info':''}}" wx:if="{{1< datalist.button_status && datalist.button_status<6 && datalist.admin !=1}}">编辑</view>
<view class="btn-item" style="background: url('{{datalist.button_status == 5?'https://volunteer.cnpu.org/static/images/out@.png':'https://volunteer.cnpu.org/static/images/out.png'}}') no-repeat center;background-size: cover;" wx:if="{{2<datalist.button_status && datalist.button_status<6 && datalist.admin !=1}}" bindtap="change_cover" data-id="1">退出</view>
<view class="btn-item" style="background: url('{{datalist.button_status == 2?'https://volunteer.cnpu.org/static/images/edit.png':'https://volunteer.cnpu.org/static/images/edit@.png'}}') no-repeat center;background-size: cover;" bindtap="{{datalist.button_status == 2?'edit_info':''}}"
wx:if="{{1< datalist.button_status && datalist.button_status<6 && datalist.admin !=1}}">编辑</view>
<view class="btn-item" style="background: url('{{datalist.button_status == 5 || datalist.button_status == 4?'https://volunteer.cnpu.org/static/images/out@.png':'https://volunteer.cnpu.org/static/images/out.png'}}') no-repeat center;background-size: cover;"
wx:if="{{2<datalist.button_status && datalist.button_status<6 && datalist.admin !=1}}" bindtap="{{datalist.button_status == 5 || datalist.button_status == 4 ?'':'change_cover'}}" data-id="1">退出</view>
<view class="btn-item" style="background: url('https://volunteer.cnpu.org/static/images/share.png') no-repeat center;background-size: cover;" bindtap="change_cover" data-id="2">分享</view>
</view>
... ... @@ -54,11 +56,10 @@
<view class="c_item" wx:for="{{join_info}}" wx:key="index">
<view class="c_title">{{item.title}}</view>
<view class="c_box">
<view class="i_info {{item.arr.length>3 && zindex<item.arr.length-1?'line':''}}" wx:for="{{item.arr}}" wx:for-item="zitem" wx:for-index="zindex" wx:key="zindex" data-status="{{zitem.status}}" data-user_id="{{zitem.id}}" bindtap="look_more">
<view class="i_info {{item.arr.length>3 && zindex<item.arr.length-1?'line':''}}" wx:for="{{item.arr}}" wx:for-item="zitem" wx:for-index="zindex" wx:key="zindex" data-status="{{zitem.status}}" data-user_id="{{zitem.user_id}}" bindtap="look_more">
<image src="{{zitem.photo}}" mode="aspectFill" />
<view class="name">{{zitem.name}}</view>
<view class="status {{zitem.status>1?(zitem.status == 2?'bgb':'bga'):'bgc'}}">{{zitem.status>1?(zitem.status == 2?'未通过':'已通过'):'待审核'}}</view>
<view class="status {{zitem.status>1?(zitem.status == 2?'bgb':'bga'):'bgc'}}">{{zitem.status>0?(zitem.status == 2?'未通过':'已通过'):'待审核'}}</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
page {
padding-bottom: 110rpx;
box-sizing: border-box;
}
.main {
... ... @@ -23,6 +24,7 @@ page {
font-size: 32rpx;
font-weight: bold;
padding: 24rpx 0 10rpx 0;
box-sizing: border-box;
}
.text_content {
... ...
// pages/start/start.js
const app=getApp();
const app = getApp();
Page({
/**
... ... @@ -8,14 +8,14 @@ Page({
data: {
},
start(e){
start(e) {
let that = this;
app.globalData.userInfo = e.detail.userInfo;
// wx.switchTab({
// url: '/pages/index/index'
// })
wx.login({
success: function (s) {
success: function(s) {
let url = 'wxapp/public/getSessionKey';
if (s.code) {
var code = s.code;
... ... @@ -42,9 +42,16 @@ Page({
let url = 'wxapp/public/login';
app.post(url, param).then((res) => {
wx.setStorageSync('token', res.token);
if(that.data.type){
wx.reLaunch({
url: "/pages/img_txt/img_txt?id=" + this.data.id + '&status=1',
})
} else {
wx.switchTab({
url: '/pages/index/index',
})
}
}).catch((errMsg) => {
})
... ... @@ -53,56 +60,61 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
if (options.type){
this.setData({
type: true,
id: options.id
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
... ... @@ -5,28 +5,38 @@ Page({
* 页面的初始数据
*/
data: {
imgarr: [],
myimgurl:[]
},
//图片添加
upimg: function () {
let that = this
let imgarr = [], myimgurl = []
let myimgurl = that.data.myimgurl
let imgarr = that.data.imgarr
if (imgarr.length >= 6) {
wx.showToast({
title: '最多添加6张图片',
icon: 'none',
duration: 1000
})
return
}
wx.chooseImage({
count: 5,
count: 1,
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
imgarr = res.tempFilePaths
imgarr.push(res.tempFilePaths[0])
that.setData({
imgarr: res.tempFilePaths
imgarr: imgarr
})
let header = {
'XX-Token': wx.getStorageSync('token'),
'XX-Device-Type': ''
}
for (let i = 0; i < res.tempFilePaths.length; i++) {
wx.uploadFile({
url: "https://volunteer.cnpu.org/api/user/upload/one", //上传图片接口
filePath: imgarr[i],
filePath: res.tempFilePaths[0],
name: 'file',
header: header,
formData: {
... ... @@ -45,7 +55,6 @@ Page({
}
})
}
},
})
},
... ...