作者 wumengyu

添加发布逻辑(未登录去登陆),优化筛选可清空时间,修改评论不跳转页面,直接弹出键盘,优化点赞,添加参与人数限制,

添加参与成功弹框,添加订单列表消息数,投诉按钮置灰逻辑,
... ... @@ -9,8 +9,9 @@ App({
if (res.authSetting['scope.userInfo']) {
console.log('授权过到首页');
self.globalData.isLogin = true;
wx.setStorageSync('isLogin',true)
// wx.redirectTo({
// url: '/pages/index/index', //跳转到授权页面
// url: '/pages/index/index', //跳转到授权页面
// });
} else {
console.log('授权失效到授权页');
... ... @@ -35,7 +36,7 @@ App({
getLogin() {
const self = this;
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
wx.getUserInfo({
success: function (user) {
// console.log(user);
... ... @@ -43,7 +44,7 @@ App({
let url = '/portal/Login/getToken';
wx.login({
success: function (res) {
if(self.loginCallback) {
if (self.loginCallback) {
console.log('onlaunch-callback');
self.loginCallback(user)
}
... ... @@ -57,9 +58,9 @@ App({
wx.setStorageSync('token', ret.data.token);
self.globalData.userInfo = user.userInfo;
resolve(ret.data);
setTimeout(function () {
wx.navigateBack({delta:1})
},200)
// setTimeout(function () {
// wx.navigateBack({delta: 1})
// }, 200)
})
},
fail: function (res) {
... ... @@ -106,9 +107,9 @@ App({
header: header,
success: function (res) {//返回取得的数据
// console.log('返回取得的数据res', res);
if(+res.data.code == 1){
if (+res.data.code == 1) {
resolve(res.data);
}else if (res.data.code == '20000') {
} else if (res.data.code == '20000') {
console.log('20000');
resolve(res.data.data);
} else if (res.data.data.code == '10001') { //未获取授权
... ... @@ -127,7 +128,7 @@ App({
}
});
resolve(res.data.data);
} else if(+res.data.code === 0){
} else if (+res.data.code === 0) {
console.log('code=0');
console.log(res.data);
wx.showModal({
... ... @@ -168,7 +169,7 @@ App({
return time;
},
//获取截止时间的前几个小时
nextTime(over_time,hour_num) {
nextTime(over_time, hour_num) {
let over = new Date(over_time); //转成标准时间
let month = over.getMonth() + 1;
let day = over.getDate();
... ... @@ -178,12 +179,44 @@ App({
let H = (hours > 9 ? hours - hour_num : ('0' + hours - hour_num)) + ':' + (minutes > 9 ? minutes : ('0' + minutes));
let time = [];
// console.log('Y,H,month', Y, H,month);
time.push(Y,H);
time.push(Y, H);
let new_time = time.join(' ');
return new_time;
},
timeFormat(param) { //小于10的格式化函数
return param < 10 ? '0' + param : param;
},
//秒数转成时分秒
initTime(value) {
let secondTime = value;// 秒
let minuteTime = 0;// 分
let hourTime = 0;// 小时
if (secondTime > 60) {//如果秒数大于60,将秒数转换成整数
//获取分钟,除以60取整数,得到整数分钟
minuteTime = parseInt(secondTime / 60);
//获取秒数,秒数取佘,得到整数秒数
secondTime = parseInt(secondTime % 60);
//如果分钟大于60,将分钟转换成小时
if (minuteTime > 60) {
//获取小时,获取分钟除以60,得到整数小时
hourTime = parseInt(minuteTime / 60);
//获取小时后取佘的分,获取分钟除以60取佘的分
minuteTime = parseInt(minuteTime % 60);
}
}
let result = [];
let obj = null;
obj = {
hou: this.timeFormat(hourTime),
min: this.timeFormat(minuteTime),
sec: this.timeFormat(secondTime)
};
result.push(obj);
// console.log('result', result);
return result;
},
globalData: {
userInfo: null,
isLogin:null
isLogin: null
}
});
\ No newline at end of file
... ...
... ... @@ -8,28 +8,99 @@ Page({
* 页面的初始数据
*/
data: {
current_swiper:0,
current_swiper: 0,
slide: [],
peopleList: [],
num:1,
num: 1,
actEndTimeList: [],
is_zan:false,
is_zan: false,
display:false,
content:'',
is_ask:false,
is_reply:false,
placeholder:'输入您的留言',
is_showRelease_modal:false,
},
//查看我的订单
goMyOrder() {
wx.redirectTo({url:'/pages/order/order-detail/order-detail?id=' + this.data.order_id})
},
//完成按钮
goBack() {
wx.redirectTo({url:'/pages/spell-list/spell-list?current=' + 1})
},
disableScroll() {
},
handleBackground() {
console.log('dianji');
this.setData({is_showRelease_modal:false,})
},
// 问一问
ask(e) {
wx.navigateTo({url:'/pages/comment/comment?activity_id=' + this.data.detail_id
+ '&common_id=' + 0
})
console.log('前问一问-display', this.data.display);
this.setData({
display: !this.data.display,
is_ask:true,is_reply:false,
content:'' ,
placeholder:'输入您的留言',
});
console.log('后问一问-display', this.data.display);
// wx.navigateTo({
// url: '/pages/comment/comment?activity_id=' + this.data.detail_id
// + '&common_id=' + 0
// })
// console.log('问',e.detail.value);
// this.setData({focus:true})
},
//输入评论内容
inputComment(e) {
this.setData({ content: e.detail.value });
},
//发送评论/回复
clickComment() {
this.setData({ display: false });
if(this.data.content === '' ) {
wx.showToast({title:'请输入内容',icon:'none'})
}else {
let url = '/portal/Active/common';
let params = {
token:wx.getStorageSync('token'),
activeId:this.data.detail_id,
commonId: this.data.is_ask?0:this.data.commet_id,
content:this.data.content,
};
app.post(url,params,{}).then((res)=>{
console.log('提交评论',res);
if(+res.code === 1) {
wx.showToast({title:this.data.is_ask?'留言成功':'回复成功',icon:'none',});
this.getDetail();
}
})
}
},
//评论input失去焦点
blur() {
this.setData({ display: false });
},
//点击键盘上的完成
confirm() {
this.setData({ display: false });
this.clickComment();
},
//回复
reply(e) {
const id = e.currentTarget.dataset.id;
wx.navigateTo({url:'/pages/comment/comment?is_reply=' + true
+ '&activity_id=' + this.data.detail_id + '&common_id=' + id
})
this.setData({
display: !this.data.display,
is_ask:false,is_reply:true,
commet_id:id,content:'' ,
placeholder:'输入您的回复'
});
// wx.navigateTo({
// url: '/pages/comment/comment?is_reply=' + true
// + '&activity_id=' + this.data.detail_id + '&common_id=' + id
// })
},
//收藏/取消收藏
collect() {
... ... @@ -44,21 +115,21 @@ Page({
token: wx.getStorageSync('token'),
activeId: self.data.detail_id,
};
if(self.data.is_collect) {
if (self.data.is_collect) {
app.post(url_del, params, header).then((res) => {
console.log('取消收藏',res);
if(+res.code === 1) {
wx.showToast({title:res.message,icon:'none'});
console.log('取消收藏', res);
if (+res.code === 1) {
wx.showToast({title: res.message, icon: 'none'});
self.setData({
is_collect: 0
});
}
})
}else {
} else {
app.post(url, params, header).then((res) => {
console.log('收藏',res);
if(+res.code === 1) {
wx.showToast({title:res.message,icon:'none'});
console.log('收藏', res);
if (+res.code === 1) {
wx.showToast({title: res.message, icon: 'none'});
self.setData({
is_collect: 1
});
... ... @@ -83,10 +154,10 @@ Page({
app.post(url, params, {}).then((res) => {
console.log('点赞', res);
if (+res.code === 1) { //
wx.showToast({title:res.message,icon:'none'});
wx.showToast({title: res.message, icon: 'none'});
self.setData({
[`commentList[${index}].is_prefect`]: true,
[`commentList[${index}].prefect`]: +self.data.commentList[index].prefect +1,
[`commentList[${index}].prefect`]: res.message == '该评论已赞'?+self.data.commentList[index].prefect:+self.data.commentList[index].prefect + 1,
});
// console.log('paise_user', paise_user);
}
... ... @@ -98,10 +169,10 @@ Page({
},
onPageScroll(e) {
// console.log('页面滚动', e);
if(e.scrollTop > 140) {
this.setData({hidden_top:true})
}else if(e.scrollTop <=140){
this.setData({hidden_top:false})
if (e.scrollTop > 140) {
this.setData({hidden_top: true})
} else if (e.scrollTop <= 140) {
this.setData({hidden_top: false})
}
},
// 增加数量
... ... @@ -112,7 +183,7 @@ Page({
// let num = cartslist[k].children[t].num;
// let product_id = cartslist[k].children[t].product_id;
let num = this.data.num;
num ++;
num++;
this.setData({
num: num
});
... ... @@ -123,7 +194,7 @@ Page({
if (num <= 1) {
return false;
}
num --;
num--;
this.setData({
num: num
});
... ... @@ -131,33 +202,34 @@ Page({
//获取详情
getDetail() {
const self = this;
console.log('city',self.data.city);
console.log('city', self.data.city);
let url = '/portal/Active/activeDetail';
let params = {
activeId: self.data.detail_id,
token:wx.getStorageSync('token'),
token: wx.getStorageSync('token'),
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('获取详情', res);
console.log('获取详情', res, app.initTime(res.data.active.surplus));
if (+res.code === 1) {
self.setData({
detail: res.data.active,
'detail.time': app.initTime(res.data.active.surplus),
end_time: res.data.active.time,
over_hours:res.data.active.over_time,//几小时截止
over_hours: res.data.active.over_time,//几小时截止
join_people: res.data.son,
commentList:res.data.common,
is_collect:res.data.is_collect,
count:res.data.count, // 留言板
commentList: res.data.common,
is_collect: res.data.is_collect,
count: res.data.count, // 留言板
});
// (0全部,2待处理,4已拼成,5已取消,6已完成
// (0全部,2待处理,4已拼成,5已取消,6已完成
const status = res.data.active.status;
if(status ===2 || status ===4 || status ===6 || status ===7) {
if (status === 2 || status === 4 || status === 6 || status === 7) {
console.log('调用倒计时');
self.countDown();
}else {
} else {
console.log('不调用倒计时');
let countDownArr = [];
let obj = null;
... ... @@ -180,43 +252,41 @@ Page({
timeFormat(param) { //小于10的格式化函数
return param < 10 ? '0' + param : param;
},
time() {
const self = this;
self.data.detail.surplus--;
//定時器,每秒重新計算
// setTimeout(function () {
// self.time();
// },1000)
},
countDown() { //倒计时函数
// 获取当前时间,同时得到活动结束时间数组
t = setTimeout(this.countDown, 1000);
let newTime = new Date().getTime();//当前时间戳
let end_time = app.nextTime(this.data.end_time, this.data.over_hours);//截止时间
let endTime = new Date(end_time).getTime(); //截止时间戳
let countDownArr = [];
// 对结束时间进行处理渲染到页面
let obj = null;
// 如果活动未结束,对时间进行处理
if (endTime - newTime > 0) {
let time = (endTime - newTime) / 1000;
// 获取天、时、分、秒
let day = parseInt(time / (60 * 60 * 24));
let hou = parseInt(time % (60 * 60 * 24) / 3600);
let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
obj = {
day: this.timeFormat(day),
hou: this.timeFormat(hou),
min: this.timeFormat(min),
sec: this.timeFormat(sec)
};
t;
} else { //活动已结束,全部设置为'00'
obj = {
day: '00',
hou: '00',
min: '00',
sec: '00'
};
clearTimeout(t);
this.end()
}
countDownArr.push(obj);
let obj = null;
if (this.data.detail.surplus > 0) { //未结束
this.time();
// console.log('surplus', this.data.detail.surplus);
// t = setTimeout(this.countDown, 1000);
const time = app.initTime(this.data.detail.surplus);
// console.log('time', time);
obj = {
hou: time[0].hou,
min: time[0].min,
sec: time[0].sec
};
t;
} else {
obj = {
day: '00',
hou: '00',
min: '00',
sec: '00'
};
clearTimeout(t);
this.end();
}
countDownArr.push(obj);
// 渲染,然后每隔一秒执行一次倒计时函数
this.setData({
// countDownList: countDownArr,
... ... @@ -245,7 +315,7 @@ Page({
getNavigate() {
const self = this;
const arr = self.data.detail.latng.split(',');
console.log('arr',arr,arr[0],arr[1]);
console.log('arr', arr, arr[0], arr[1]);
wx.openLocation({//​使用微信内置地图查看位置。
latitude: +arr[1],//要去的纬度-地址
longitude: +arr[0],//要去的经度-地址
... ... @@ -258,37 +328,38 @@ Page({
//确认拼活动
confirmJoin(e) {
const self = this;
let url = '/portal/Active/join';
let params = {
token: wx.getStorageSync('token'),
number: self.data.num,
activeId: self.data.detail_id,
formId: e.detail.formId,
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('确认拼餐', res);
if (+res.code === 1) {
wx.showToast({title:'拼餐成功',icon:'success'})
// self.setData({
// detail: res.data.active,
// end_time: res.data.active.time,
// over_hours:res.data.active.over_time,//几小时截止
// join_people: res.data.son,
// commenList:res.data.common
// });
// self.countDown();
}
})
console.log('已参与人数',self.data.join_people.length);
if(self.data.join_people.length + self.data.num > self.data.detail.max) {
wx.showToast({title:'参加人数已超过剩余名额',icon:'none'})
}else if(self.data.join_people.length + self.data.num == self.data.detail.max){
wx.showToast({title:'名额已满',icon:'none'})
} else {
let url = '/portal/Active/join';
let params = {
token: wx.getStorageSync('token'),
number: self.data.num,
activeId: self.data.detail_id,
formId: e.detail.formId,
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('确认拼餐', res);
if (+res.code === 1) {
// wx.showToast({title: '拼餐成功', icon: 'success'});
self.setData({is_showRelease_modal:true,order_id:+res.data.orderId});
self.getDetail();
}
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('详情options', options);
this.setData({detail_id:+options.id?+options.id:''});
this.setData({detail_id: +options.id ? +options.id : ''});
},
/**
... ... @@ -336,17 +407,18 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
onShareAppMessage: function () {
let self = this;
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
title: '火柴西路', // 默认是小程序的名称(可以写slogan等)
path: '', // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function(res) {
if (res.errMsg == 'shareAppMessage:ok') {}
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') {
}
},
fail: function() {
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
... ... @@ -354,7 +426,7 @@ Page({
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function() {
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
}
}
... ...
... ... @@ -36,7 +36,7 @@
<block wx:for="{{detail.banner}}" wx:key="index">
<navigator url="{{item}}" hover-class="navigator-hover">
<swiper-item>
<image src="{{item}}" class="slide-image"/>
<image src="{{item}}" class="slide-image" mode="aspectFill"/>
<!--<image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"></image>-->
</swiper-item>
</navigator>
... ... @@ -72,13 +72,13 @@
<!--详细时间-->
<view class="detail-box">
<text>类别:{{detail.selectName}}</text>
<text>时间:{{end_time}}</text>
<text>餐厅:{{detail.name}}</text>
<text>地点:{{detail.name}}</text>
<view class="position" bindtap="getNavigate">
<text class="address">地址:{{detail.address}}</text>
<text class="iconfont icon-location"></text>
</view>
<text>类别:{{detail.selectName}}</text>
</view>
<!--已加入人员-->
... ... @@ -102,6 +102,26 @@
</view>
</view>
<!--评论框-->
<view wx:if="{{display}}" class="comment {{display?'t-active':''}}">
<input
auto-focus="{{display}}"
focus="{{display}}"
value="{{content}}"
cursor-spacing="50"
maxlength="300"
bindblur="blur"
bindinput="inputComment"
bindconfirm="confirm"
show-confirm-bar="{{false}}"
placeholder="{{placeholder}}"/>
<view class="send-box">
<text class="send" bindtap="clickComment">发送</text>
</view>
</view>
<!--评论-->
<view class="comment-list-box">
<view class="comment-item" wx:for="{{commentList}}" wx:key="index" wx:for-item="comment">
... ... @@ -143,7 +163,7 @@
</view>
<!--底部btn-->
<view class="bottom-btn">
<view class="bottom-btn" wx:if="{{!display}}">
<view class="add-btn">
<view class="input_box">
<view class="iconfont icon-jian {{num==1?'disable':''}}" bindtap='minusCount'></view>
... ... @@ -155,5 +175,15 @@
<text>确认拼活动</text>
</button>
</view>
<!--参与成功弹框-->
<view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll">
<image class="sorry-img" src="../../../images/success@2x.png"></image>
<view class="title">恭喜您拼活动成功</view>
<view class="view-btn" catchtap="goMyOrder">查看我的订单</view>
<view class="complete-btn" catchtap="goBack">完成</view>
</view>
<view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground"
catchtouchmove="disableScroll"></view>
</view>
</form>
... ...
... ... @@ -432,4 +432,118 @@ swiper {
background-color: #F2F2F2;
text-align: center;
line-height: 40rpx;
}
.comment {
position: fixed;
bottom:0;
left:0;
z-index:20;
}
.comment input {
border-radius: 50rpx;
width: 83.5%;
height: 60rpx;
/*height: 400rpx;*/
display: flex;
align-items: center;
text-align: left;
background-color: #f2f2f2;
font-size: 26rpx;
padding-left: 32rpx;
color: #666;
}
.t-active {
border-radius: 4rpx;
width: 91.5%;
/*height: 300rpx;*/
/*background-color: #f2f2f2;*/
font-size: 26rpx;
padding: 20rpx 32rpx;
display: flex;
justify-content: right;
align-items: right;
}
.send-box .send {
width: 100rpx;
height: 60rpx;
line-height: 60rpx;
color:#E1C8AF;
font-size: 30rpx;
background-color: #323232;
border-right: 4rpx;
border-radius: 8rpx;
text-align: center;
}
.send-box {
height: 60rpx;
display: flex;
justify-content: flex-end;
margin-left: 10rpx;
}
.modal {
width: 73%;
/* height: 1100rpx; */
background: #ffffff;
display: flex;
align-items: center;
flex-direction: column;
z-index:999;
position: fixed;
top: 48%;
left: 50%;
transform: translate(-50%,-50%);
padding: 46rpx 0rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-radius: 40rpx;
}
.modal image {
width: 110rpx;
height: 110rpx;
border-radius: 50%;
margin-bottom: 34rpx;
}
.modal .title {
color: #333333;
font-size: 36rpx;
margin-bottom: 46rpx;
}
.modal .tips {
color: #333333;
font-size: 24rpx;
margin-bottom: 26rpx;
}
.modal .view-btn {
height: 66rpx;
width: 364rpx;
border:1rpx solid #323232;
border-radius: 6rpx;
color:#323232;
text-align: center;
line-height: 66rpx;
font-size: 30rpx;
}
.modal .complete-btn {
width: 364rpx;
height: 66rpx;
background-color: #323232;
border-radius: 6rpx;
color:#E2C8B1;
font-size: 30rpx;
text-align: center;
line-height: 66rpx;
margin-top: 26rpx;
}
/*弹框样式*/
.modal_box {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 10;
background: rgba(0,0,0,0.3);
}
\ No newline at end of file
... ...
... ... @@ -91,7 +91,7 @@ Page({
})
},
//提交
submit() {
submit(e) {
this.data.questionList.forEach((item) => {
if (item.choose === false) {
wx.showToast({title: '请答完所有的题', icon: 'none'});
... ... @@ -115,17 +115,24 @@ Page({
let params = {
token: wx.getStorageSync('token'),
score: this.data.score,
formId:e.detail.formId
};
app.post(url, params, {}).then((res) => {
console.log('提交答案', res);
if (+res.code === 1) {
wx.showToast({title:'提交成功',icon:'success',
success:function () {
setTimeout(function () {
wx.navigateBack({delta:1})
},500)
}
});
// self.setData({
// questionList: res.data.list,
// });
// console.log(self.data.questionList);
}
});
console.log('111')
}
},
... ...
<!--pages/index/answer-question/answer-question.wxml-->
<view class="content">
<view class="title">加入会员答题卡</view>
<view class="tips">
我们将按照测试结果,对用户进行加入会员批次的分
类,更便利于大家结交到相似属性的伙伴。测试只能提
交一次,请按实际情况回答就好。
</view>
<view class="questions-box">
<view class="question-list">
<view class="question-item" wx:for="{{questionList}}" wx:key="index" wx:for-index="idx" data-pindex="{{idx}}" bindtap="clickQuestion" data-choose="{{item.choose}}">
<view class="question">{{idx+1}}. {{item.title}}</view>
<!--<view wx:for="{{item.content}}" wx:key="index" bindtap="chooseAnswer" data-score="{{item.score}}" data-sindex="{{index}}">-->
<form bindsubmit="submit" bindreset="formReset" report-submit="true">
<view class="content">
<view class="title">加入会员答题卡</view>
<view class="tips">
我们将按照测试结果,对用户进行加入会员批次的分
类,更便利于大家结交到相似属性的伙伴。测试只能提
交一次,请按实际情况回答就好。
</view>
<view class="questions-box">
<view class="question-list">
<view class="question-item" wx:for="{{questionList}}" wx:key="index" wx:for-index="idx"
data-pindex="{{idx}}" bindtap="clickQuestion" data-choose="{{item.choose}}">
<view class="question">{{idx+1}}. {{item.title}}</view>
<!--<view wx:for="{{item.content}}" wx:key="index" bindtap="chooseAnswer" data-score="{{item.score}}" data-sindex="{{index}}">-->
<!--<view class="section">-->
<!--<text class="{{current_que===idx&&current_ans===index?'active':''}}">{{index+1 === 1?'A':index+1 === 2?'B':index+1 === 3?'C':'D'}}. {{item.answer}}</text>-->
<!--<image src="../../../images/choose@2x.png" wx:if="{{current_que===idx&&current_ans===index}}" class="img"></image>-->
<radio-group class="section" bindchange="radioChange" data-pindex="{{idx}}">
<label class="radio" wx:for="{{item.content}}" wx:key="index" bindtap="chooseAnswer" data-score="{{item.score}}" data-sindex="{{index}}" data-pindex="{{idx}}">
<text class="{{item.checked?'active':''}}">{{index+1 === 1?'A':index+1 === 2?'B':index+1 === 3?'C':'D'}}. {{item.answer}}{{item.checked}}</text>
<radio value="{{index}}" checked="{{item.checked}}" color='#fff'/>
</label>
</radio-group>
<!--<checkbox-group class="section" bindchange="radioChange">-->
<!--<label class="radio" wx:for="{{item.content}}" wx:key="index" bindtap="chooseAnswer"-->
<!--data-score="{{item.score}}" data-sindex="{{index}}">-->
<!--<text class="{{item.checked?'active':''}}">{{index+1 === 1?'A':index+1 === 2?'B':index+1 ===-->
<!--3?'C':'D'}}. {{item.answer}}{{item.checked}}-->
<!--</text>-->
<!--<checkbox value="{{index}}" checked="{{item.checked}}" color='#fff'/>-->
<!--</label>-->
<!--</checkbox-group>-->
<!--</view>-->
<!--</view>-->
<!--<view class="section" bindtap="chooseAnswer" data-index="1">-->
<!--<text class="{{current===1?'active':''}}">B. 户外郊游或运动</text>-->
<!--<image src="../../../images/choose@2x.png" wx:if="{{current===1}}" class="img"></image>-->
<!--</view>-->
<!--<view class="section" bindtap="chooseAnswer" data-index="2">-->
<!--<text class="{{current===2?'active':''}}">C. 朋友小聚,聚餐嗨皮</text>-->
<!--<image src="../../../images/choose@2x.png" wx:if="{{current===2}}" class="img"></image>-->
<!--</view>-->
<!--<view class="section" bindtap="chooseAnswer" data-index="3">-->
<!--<text class="{{current===3?'active':''}}">D. 看展看演出/上课进修自我提升/参加活动认识新朋友</text>-->
<!--<image src="../../../images/choose@2x.png" wx:if="{{current===3}}" class="img"></image>-->
<!--</view>-->
<!--<text class="{{current_que===idx&&current_ans===index?'active':''}}">{{index+1 === 1?'A':index+1 === 2?'B':index+1 === 3?'C':'D'}}. {{item.answer}}</text>-->
<!--<image src="../../../images/choose@2x.png" wx:if="{{current_que===idx&&current_ans===index}}" class="img"></image>-->
<radio-group class="section" bindchange="radioChange" data-pindex="{{idx}}">
<label class="radio" wx:for="{{item.content}}" wx:key="index" bindtap="chooseAnswer"
data-score="{{item.score}}" data-sindex="{{index}}" data-pindex="{{idx}}">
<text class="{{item.checked?'active':''}}">{{index+1 === 1?'A':index+1 === 2?'B':index+1 ===
3?'C':'D'}}. {{item.answer}}{{item.checked}}
</text>
<radio value="{{index}}" checked="{{item.checked}}" color='#fff'/>
</label>
</radio-group>
</view>
</view>
<!--<view class="question-item">-->
<!--<view class="question">1. 周末更乐意选择哪种休闲方式?</view>-->
<!--<view class="section" bindtap="chooseAnswer" data-index="0">-->
<!--<text class="{{current===0?'active':''}}">A. 宅家补觉,看书看片</text>-->
<!--<image src="../../../images/choose@2x.png" wx:if="{{current===0}}" class="img"></image>-->
<!--</view>-->
<!--<view class="section" bindtap="chooseAnswer" data-index="1">-->
<!--<text class="{{current===1?'active':''}}">B. 户外郊游或运动</text>-->
<!--<image src="../../../images/choose@2x.png" wx:if="{{current===1}}" class="img"></image>-->
<!--</view>-->
<!--<view class="section" bindtap="chooseAnswer" data-index="2">-->
<!--<text class="{{current===2?'active':''}}">C. 朋友小聚,聚餐嗨皮</text>-->
<!--<image src="../../../images/choose@2x.png" wx:if="{{current===2}}" class="img"></image>-->
<!--</view>-->
<!--<view class="section" bindtap="chooseAnswer" data-index="3">-->
<!--<text class="{{current===3?'active':''}}">D. 看展看演出/上课进修自我提升/参加活动认识新朋友</text>-->
<!--<image src="../../../images/choose@2x.png" wx:if="{{current===3}}" class="img"></image>-->
<!--</view>-->
<!--</view>-->
</view>
</view>
<view class="btn" bindtap="submit">
<text>提交</text>
<button class="btn" form-type="submit">
<text>提交</text>
</button>
</view>
</view>
</form>
... ...
... ... @@ -63,6 +63,11 @@
font-size: 30rpx;
border-radius: 6rpx;
text-align: center;
margin: 0;
padding: 0;
}
.btn::after {
border:0;
}
.btn text {
height: 66rpx;
... ...
... ... @@ -7,23 +7,9 @@ import mock from './mock.js'//拿到的数据
Page({
data: {
items: [],
slide: [{image: 'http://pk86rwhci.bkt.clouddn.com/banner.png'}, {image: 'http://pk86rwhci.bkt.clouddn.com/banner.png'}],
cate: [{pic: '../../images/duantu@2x.png', name: '短途郊游'},
{pic: '../../images/changtu@2x.png', name: '长途旅游'},
{pic: '../../images/finecanting@2x.png', name: 'Fine Dining 餐厅'},
{pic: '../../images/huwai@2x.png', name: '户外运动'},
{pic: '../../images/juhui@2x.png', name: '聚会'},
{pic: '../../images/yinyuejie@2x.png', name: '音乐节'},
{pic: '../../images/dianying@2x.png', name: '电影'},
{pic: '../../images/qingshe@2x.png', name: '轻奢餐厅'},
{pic: '../../images/zhanlan@2x.png', name: '展览'},
{pic: '../../images/wutaiju@2x.png', name: '舞台剧'},
],
meal_banner: [
{pic: 'http://pk86rwhci.bkt.clouddn.com/banner.png', address: 'Opera Bombana', time: '2018.4.28'},
{pic: 'http://pk86rwhci.bkt.clouddn.com/b1@2x%20%281%29.png', address: 'Opera Bombana', time: '2018.4.28'},
{pic: 'http://pk86rwhci.bkt.clouddn.com/b1@2x%20%281%29.png', address: 'Opera Bombana', time: '2018.4.28'},
{pic: 'http://pk86rwhci.bkt.clouddn.com/banner.png', address: 'Opera Bombana', time: '2018.4.28'}],
slide: [],
cate: [],
meal_banner: [],
currentBannerIndex: 0,
tabcurrent: {tab: 0, bubble: ''},
noticeList: [],
... ... @@ -164,10 +150,6 @@ Page({
url: '../logs/logs'
})
},
onLoad: function () {
this.getCityList();
this._doRefreshMasonry(this.data.items)
},
onReachBottom: function () {
// this._doAppendMasonry(this.data.items)
... ... @@ -190,10 +172,12 @@ Page({
//首页-导航
service(e) {
var tindex = e.currentTarget.dataset.tindex;
var tabcurrent = this.data.tabcurrent;
var tabcurrent = this.data.tabcurrent.tab;
if (tabcurrent == tindex) {
console.log('点击本页');
return false
} else {
console.log('其他页');
this.setData({
tabcurrent: tindex
})
... ... @@ -205,7 +189,7 @@ Page({
//拼单-导航
consult(e) {
var tindex = e.currentTarget.dataset.tindex
var tabcurrent = this.data.tabcurrent
var tabcurrent = this.data.tabcurrent.tab
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -223,29 +207,39 @@ Page({
},
//发布按钮
release(e) {
console.log('发布');
console.log('发布',app.globalData.isLogin);
const self = this;
if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2) { //没填写个人信息并且不可以发布 =>去填写
self.setData({
is_showUserInfo: true //弹出 去填写个人信息弹框
if(!app.globalData.isLogin) {
wx.showToast({title: '还没登录,先去登录吧~', icon: 'none',
success:function () {
setTimeout(function () {
wx.redirectTo({url:'/pages/my/my'})
},500)
}
});
}else {
if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2) { //没填写个人信息并且不可以发布 =>去填写
self.setData({
is_showUserInfo: true //弹出 去填写个人信息弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true //弹出 去答题弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1) { //已填写且可以发布 =>去发布
self.setData({
is_showRelease: true //弹出 发布弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1) {
wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'})
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true //弹出 去答题弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1) { //已填写且可以发布 =>去发布
self.setData({
is_showRelease: true //弹出 发布弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1) {
wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'})
}
}
},
//订单-导航
wish(e) {
var tindex = e.currentTarget.dataset.tindex
var tabcurrent = this.data.tabcurrent
var tabcurrent = this.data.tabcurrent.tab
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -264,7 +258,7 @@ Page({
//我的-导航
my(e) {
var tindex = e.currentTarget.dataset.tindex
var tabcurrent = this.data.tabcurrent
var tabcurrent = this.data.tabcurrent.tab
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -352,8 +346,14 @@ Page({
}
})
},
onLoad: function () {
this.getCityList();
this._doRefreshMasonry(this.data.items)
},
onShow() {
this.getLat();//获取经纬度
if(wx.getStorageSync('isLogin') === true) {
this.getLat();//获取经纬度
}
// wx.chooseLocation({
// success(res) {
// console.log(res);
... ... @@ -366,8 +366,8 @@ Page({
// name: "",
// address: ""
// })
console.log('index-show');
console.log(app.globalData.userInfo);
console.log('index-show-isLogin',wx.getStorageSync('isLogin'));
// console.log(app.globalData.userInfo);
},
onPageScroll(e) {
// console.log('页面滚动', e);
... ...
... ... @@ -12,7 +12,8 @@
</picker>
<view class="right" bindtap="search">
<view class="input"></view>
<view class="iconfont icon-arrow-down"></view>
<image src="../../images/search@2x.png" class="search-icon"></image>
<!--<view class="iconfont icon-arrow-down"></view>-->
</view>
</view>
<swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange"
... ... @@ -20,8 +21,8 @@
<block wx:for="{{slide}}" wx:key="index">
<navigator url="{{item.link}}" hover-class="navigator-hover">
<swiper-item>
<!--<image src="{{item.pic}}" class="slide-image"/>-->
<image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"/>
<image src="{{item.pic}}" class="slide-image"/>
<!--<image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"/>-->
</swiper-item>
</navigator>
</block>
... ...
... ... @@ -63,6 +63,10 @@
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.search-icon {
width: 34rpx;
height: 34rpx;
}
.position .input {
color: #ffffff;
padding-left: 20rpx;
... ...
... ... @@ -156,7 +156,7 @@ Page({
getTypeList() {
const self = this;
console.log('city',self.data.city);
let url = '/portal/Index/cate';
let url = '/portal/Index/meal';
let params = {
lat: self.data.latitude,
lng: self.data.longitude,
... ... @@ -176,6 +176,8 @@ Page({
self.setData({
list: res.data.active,
cate: res.data.cate,
start_time_date:'', //清空开始时间
end_time_date:'', //清空结束时间
});
}
wx.hideLoading()
... ...
... ... @@ -67,7 +67,7 @@
<!--<image src="http://pk86rwhci.bkt.clouddn.com/activity_img@2x.png"></image>-->
<image src="{{item.pic}}"></image>
<view class="title">
<text class="area">{{item.addr}} {{item.time}}</text>
<text class="area">{{item.address}} {{item.time}}</text>
<text class="num">还差{{item.people}}人</text>
</view>
<view class="user">
... ...
... ... @@ -148,7 +148,7 @@ Page({
},
//选择全部分类
chooseAll() {
this.setData({is_all: true, is_showSelect: false, current_type: null,score:'',});
this.setData({is_all: true, is_showSelect: false, current_type: null,select_id:'',});
this.initList();
this.getTypeList();
},
... ... @@ -210,6 +210,8 @@ Page({
self.setData({
list: res.data.active,
cate: res.data.cate,
start_time_date:'', //清空开始时间
end_time_date:'', //清空结束时间
});
}
wx.hideLoading()
... ...
... ... @@ -9,39 +9,90 @@ Page({
*/
data: {
current_swiper:0,
slide: [{image: 'http://pk86rwhci.bkt.clouddn.com/banner.png'}, {image: 'http://pk86rwhci.bkt.clouddn.com/banner.png'}],
peopleList: [
{img:'../../../images/avatar@2x.png',name:'张丹'},
{img:'../../../images/avatar@2x.png',name:'Jony'},
{img:'../../../images/avatar@2x.png',name:'Beautiful life'},
{img:'../../../images/avatar@2x.png',name:'Beautiful life'},
{img:'../../../images/avatar@2x.png',name:'Beautiful life'},
{img:'../../../images/avatar@2x.png',name:'Beautiful life'},
{img:'../../../images/avatar@2x.png',name:'Beautiful life'},
{img:'../../../images/avatar@2x.png',name:'Beautiful life'},
{img:'../../../images/avatar@2x.png',name:'Beautiful life'},
{img:'../../../images/avatar@2x.png',name:'Beautiful life'},
{img:'../../../images/avatar@2x.png',name:'Beautiful life'},
{img:'../../../images/avatar@2x.png',name:'Beautiful life'},
],
slide: [],
peopleList: [],
num:1,
actEndTimeList: [],
is_zan:false,
display:false,
content:'',
is_ask:false,
is_reply:false,
placeholder:'输入您的留言'
},
//查看我的订单
goMyRelease() {
wx.redirectTo({url:'/pages/order/order-detail/order-detail?id=' + this.data.order_id})
},
//完成按钮
goBack() {
wx.redirectTo({url:'/pages/spell-list/spell-list?current=' + 0})
},
// 问一问
ask(e) {
wx.navigateTo({url:'/pages/comment/comment?activity_id=' + this.data.detail_id
+ '&common_id=' + 0
})
console.log('前问一问-display', this.data.display);
this.setData({
display: !this.data.display,
is_ask:true,is_reply:false,
content:'' ,
placeholder:'输入您的留言',
});
console.log('后问一问-display', this.data.display);
// wx.navigateTo({
// url: '/pages/comment/comment?activity_id=' + this.data.detail_id
// + '&common_id=' + 0
// })
// console.log('问',e.detail.value);
// this.setData({focus:true})
},
//输入评论内容
inputComment(e) {
this.setData({ content: e.detail.value });
},
//发送评论/回复
clickComment() {
this.setData({ display: false });
if(this.data.content === '' ) {
wx.showToast({title:'请输入内容',icon:'none'})
}else {
let url = '/portal/Active/common';
let params = {
token:wx.getStorageSync('token'),
activeId:this.data.detail_id,
commonId: this.data.is_ask?0:this.data.commet_id,
content:this.data.content,
};
app.post(url,params,{}).then((res)=>{
console.log('提交评论',res);
if(+res.code === 1) {
wx.showToast({title:this.data.is_ask?'留言成功':'回复成功',icon:'none',});
this.getDetail();
}
})
}
},
//评论input失去焦点
blur() {
this.setData({ display: false });
},
//点击键盘上的完成
confirm() {
this.setData({ display: false });
this.clickComment();
},
//回复
reply(e) {
const id = e.currentTarget.dataset.id;
wx.navigateTo({url:'/pages/comment/comment?is_reply=' + true
+ '&activity_id=' + this.data.detail_id + '&common_id=' + id
})
this.setData({
display: !this.data.display,
is_ask:false,is_reply:true,
commet_id:id,content:'' ,
placeholder:'输入您的回复'
});
// wx.navigateTo({
// url: '/pages/comment/comment?is_reply=' + true
// + '&activity_id=' + this.data.detail_id + '&common_id=' + id
// })
},
//收藏/取消收藏
collect() {
... ... @@ -98,7 +149,7 @@ Page({
wx.showToast({title:res.message,icon:'none'});
self.setData({
[`commentList[${index}].is_prefect`]: true,
[`commentList[${index}].prefect`]: +self.data.commentList[index].prefect +1,
[`commentList[${index}].prefect`]: res.message == '该评论已赞'?+self.data.commentList[index].prefect:+self.data.commentList[index].prefect + 1,
});
// console.log('paise_user', paise_user);
}
... ... @@ -157,6 +208,7 @@ Page({
if (+res.code === 1) {
self.setData({
detail: res.data.active,
'detail.time': app.initTime(res.data.active.surplus),
end_time: res.data.active.time,
over_hours:res.data.active.over_time,//几小时截止
join_people: res.data.son,
... ... @@ -212,40 +264,41 @@ Page({
app.post(url, params, {}).then((res) => {
console.log('确认拼餐', res);
if (+res.code === 1) {
wx.showToast({title:'拼餐成功',icon:'success'})
// wx.showToast({title:'拼餐成功',icon:'success'});
self.setData({is_showRelease_modal:true,order_id:+res.data.orderId});
self.getDetail();
}
})
},
timeFormat(param) { //小于10的格式化函数
return param < 10 ? '0' + param : param;
},
time() {
const self = this;
self.data.detail.surplus--;
//定時器,每秒重新計算
// setTimeout(function () {
// self.time();
// },1000)
},
countDown() { //倒计时函数
t = setTimeout(this.countDown, 1000);
let newTime = new Date().getTime();//当前时间戳
let end_time = app.nextTime(this.data.end_time, this.data.over_hours);//截止时间
let endTime = new Date(end_time).getTime(); //截止时间戳
let countDownArr = [];
// 对结束时间进行处理渲染到页面
let obj = null;
// 如果活动未结束,对时间进行处理
if (endTime - newTime > 0) {
let time = (endTime - newTime) / 1000;
// 获取天、时、分、秒
let day = parseInt(time / (60 * 60 * 24));
let hou = parseInt(time % (60 * 60 * 24) / 3600);
let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
if (this.data.detail.surplus > 0) { //未结束
this.time();
// console.log('surplus', this.data.detail.surplus);
// t = setTimeout(this.countDown, 1000);
const time = app.initTime(this.data.detail.surplus);
// console.log('time', time);
obj = {
day: this.timeFormat(day),
hou: this.timeFormat(hou),
min: this.timeFormat(min),
sec: this.timeFormat(sec)
hou: time[0].hou,
min: time[0].min,
sec: time[0].sec
};
t;
console.log('活动未结束');
} else { //活动已结束,全部设置为'00'
console.log('活动已结束');
// this.setData({'detail.time': app.initTime(this.data.detail.surplus),})
} else {
obj = {
day: '00',
hou: '00',
... ...
... ... @@ -108,6 +108,26 @@
</view>
</view>
<!--评论框-->
<view wx:if="{{display}}" class="comment {{display?'t-active':''}}">
<input
auto-focus="{{display}}"
focus="{{display}}"
value="{{content}}"
cursor-spacing="50"
maxlength="300"
bindblur="blur"
bindinput="inputComment"
bindconfirm="confirm"
show-confirm-bar="{{false}}"
placeholder="{{placeholder}}"/>
<view class="send-box">
<text class="send" bindtap="clickComment">发送</text>
</view>
</view>
<!--评论-->
<view class="comment-list-box">
<view class="comment-item" wx:for="{{commentList}}" wx:key="index" wx:for-item="comment">
... ... @@ -149,7 +169,7 @@
</view>
<!--底部btn-->
<view class="bottom-btn">
<view class="bottom-btn" wx:if="{{!display}}">
<view class="add-btn">
<view class="input_box">
<view class="iconfont icon-jian {{num==1?'disable':''}}" bindtap='minusCount'></view>
... ... @@ -164,5 +184,15 @@
<!--<text>确认拼餐</text>-->
<!--</view>-->
</view>
<!--发布成功弹框-->
<view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll">
<image class="sorry-img" src="../../../images/success@2x.png"></image>
<view class="title">恭喜您拼餐成功</view>
<view class="view-btn" catchtap="goMyRelease">查看我的订单</view>
<view class="complete-btn" catchtap="goBack">完成</view>
</view>
<view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground"
catchtouchmove="disableScroll"></view>
</view>
</form>
... ...
... ... @@ -436,4 +436,117 @@ swiper {
position: absolute;
top: -4000rpx;
left: -4000rpx;
}
.comment {
position: fixed;
bottom:0;
left:0;
z-index:20;
}
.comment input {
border-radius: 50rpx;
width: 83.5%;
height: 60rpx;
/*height: 400rpx;*/
display: flex;
align-items: center;
text-align: left;
background-color: #f2f2f2;
font-size: 26rpx;
padding-left: 32rpx;
color: #666;
}
.t-active {
border-radius: 4rpx;
width: 91.5%;
/*height: 300rpx;*/
/*background-color: #f2f2f2;*/
font-size: 26rpx;
padding: 20rpx 32rpx;
display: flex;
justify-content: right;
align-items: right;
}
.send-box .send {
width: 100rpx;
height: 60rpx;
line-height: 60rpx;
color:#E1C8AF;
font-size: 30rpx;
background-color: #323232;
border-right: 4rpx;
border-radius: 8rpx;
text-align: center;
}
.send-box {
height: 60rpx;
display: flex;
justify-content: flex-end;
margin-left: 10rpx;
}
.modal {
width: 73%;
/* height: 1100rpx; */
background: #ffffff;
display: flex;
align-items: center;
flex-direction: column;
z-index:999;
position: fixed;
top: 48%;
left: 50%;
transform: translate(-50%,-50%);
padding: 46rpx 0rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-radius: 40rpx;
}
.modal image {
width: 110rpx;
height: 110rpx;
border-radius: 50%;
margin-bottom: 34rpx;
}
.modal .title {
color: #333333;
font-size: 36rpx;
margin-bottom: 46rpx;
}
.modal .tips {
color: #333333;
font-size: 24rpx;
margin-bottom: 26rpx;
}
.modal .view-btn {
height: 66rpx;
width: 364rpx;
border:1rpx solid #323232;
border-radius: 6rpx;
color:#323232;
text-align: center;
line-height: 66rpx;
font-size: 30rpx;
}
.modal .complete-btn {
width: 364rpx;
height: 66rpx;
background-color: #323232;
border-radius: 6rpx;
color:#E2C8B1;
font-size: 30rpx;
text-align: center;
line-height: 66rpx;
margin-top: 26rpx;
}
/*弹框样式*/
.modal_box {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 10;
background: rgba(0,0,0,0.3);
}
\ No newline at end of file
... ...
... ... @@ -142,7 +142,7 @@ Page({
app.post(url, params, {}).then((res) => {
console.log('确定发布', res);
if(+res.code === 1 && res.message == '发布成功') {
this.setData({is_showRelease_modal:true,order_id:+res.data.activeId})
this.setData({is_showRelease_modal:true,order_id:+res.data.id})
}else {
wx.showToast({title:res.message,icon:'none'})
}
... ...
... ... @@ -103,7 +103,7 @@
<!--发布成功弹框-->
<view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll">
<image class="sorry-img" src="../../images/success@2x.png"></image>
<view class="title">恭喜您拼餐成功</view>
<view class="title">恭喜您发布成功</view>
<view class="view-btn" catchtap="goMyRelease">查看我的订单</view>
<view class="complete-btn" catchtap="goBack">完成</view>
</view>
... ...
... ... @@ -14,6 +14,7 @@ Page({
country:'',
city:'',
phone_number:'',
phone_number_params:'',
introduce:'',
},
//选择性别
... ... @@ -28,7 +29,30 @@ Page({
inputPhone(e) {
this.setData({
phone_number: e.detail.value,
})
});
if(this.data.phone_number.length>=11) {
if(!(/^1[0-9]{10}$/.test(this.data.phone_number))){
wx.showToast({title:'手机号格式错误',icon:'none'});
this.setData({is_wrong_phone:true,phone_number_params:''});
console.log('params', this.data.phone_number_params);
}else {
this.setData({
phone_number_params: this.data.phone_number,
is_wrong_phone:false,
});
console.log('params', this.data.phone_number_params);
}
}
},
//失去焦点
blur() {
// if(this.data.phone_number.length>=11) {
if(!(/^1[0-9]{10}$/.test(this.data.phone_number))){
wx.showToast({title:'手机号格式错误',icon:'none'});
this.setData({is_wrong_phone:true,phone_number_params:''});
console.log('params', this.data.phone_number_params);
}
// }
},
//自动获取手机号
getPhoneNumber(e) {
... ... @@ -69,6 +93,7 @@ Page({
},
//保存
submit() {
console.log('this.data.phone_number.length', this.data.phone_number.length);
if(this.data.current_sex === undefined) {
wx.showToast({title:'请选择性别',icon:'none'})
}else if(this.data.country === '') {
... ... @@ -77,6 +102,8 @@ Page({
wx.showToast({title:'请填写城市',icon:'none'})
}else if (this.data.phone_number === '') {
wx.showToast({title:'请填写手机号',icon:'none'})
}else if(this.data.is_wrong_phone){
wx.showToast({title:'手机号格式错误',icon:'none'})
}else if(this.data.introduce === '') {
wx.showToast({title:'请填写简介',icon:'none'})
}else {
... ...
... ... @@ -27,7 +27,7 @@
<view class="flex-box">
<view class="title">手机号:</view>
<view class="phone-box">
<input type="text" bindinput="inputCountry" bindinput="inputPhone"/>
<input type="number" bindinput="inputPhone" bindblur="blur"/>
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="phone-btn">自动填写</button>
</view>
</view>
... ...
... ... @@ -77,6 +77,7 @@ Page({
}, {}).then((ret) => {
console.log('获取token', ret);
wx.setStorageSync('token', ret.data.token);
wx.setStorageSync('isLogin',true);
wx.showToast({title:'登录成功',icon:'success'});
app.globalData.userInfo = e.detail.userInfo;
app.globalData.isLogin = true;
... ... @@ -131,7 +132,7 @@ Page({
//首页-导航
service(e) {
var tindex = e.currentTarget.dataset.tindex;
var tabcurrent = this.data.tabcurrent;
var tabcurrent = this.data.tabcurrent.tab;
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -148,7 +149,7 @@ Page({
//拼单-导航
consult(e) {
var tindex = e.currentTarget.dataset.tindex
var tabcurrent = this.data.tabcurrent
var tabcurrent = this.data.tabcurrent.tab
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -168,21 +169,31 @@ Page({
release(e) {
console.log('发布');
const self = this;
if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2 ){ //没填写个人信息并且不可以发布 =>去填写
self.setData({
is_showUserInfo: true //弹出 去填写个人信息弹框
if(!app.globalData.isLogin) {
wx.showToast({title: '还没登录,先去登录吧~', icon: 'none',
success:function () {
setTimeout(function () {
wx.redirectTo({url:'/pages/my/my'})
},500)
}
});
}else {
if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2) { //没填写个人信息并且不可以发布 =>去填写
self.setData({
is_showUserInfo: true //弹出 去填写个人信息弹框
});
} else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true //弹出 去答题弹框
});
}else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1){ //已填写且可以发布 =>去发布
self.setData({
is_showRelease: true //弹出 去答题弹框
});
}else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1){
wx.showToast({title:'等级不够,无法使用发布功能',icon:'none'})
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true //弹出 去答题弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1) { //已填写且可以发布 =>去发布
self.setData({
is_showRelease: true //弹出 去答题弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1) {
wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'})
}
}
},
//取消发布弹窗
... ... @@ -195,7 +206,7 @@ Page({
//订单-导航
wish(e) {
var tindex = e.currentTarget.dataset.tindex
var tabcurrent = this.data.tabcurrent
var tabcurrent = this.data.tabcurrent.tab
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -214,7 +225,7 @@ Page({
//我的-导航
my(e) {
var tindex = e.currentTarget.dataset.tindex
var tabcurrent = this.data.tabcurrent
var tabcurrent = this.data.tabcurrent.tab
if (tabcurrent == tindex) {
return false
} else {
... ...
... ... @@ -55,7 +55,7 @@
</view>
<view class="bottom" bindtap="submit">
<text class="confirm-btn">提交投诉</text>
<text class="confirm-btn {{content===''?'gray':''}}">提交投诉</text>
</view>
</view>
... ...
... ... @@ -81,4 +81,8 @@ textarea {
.placeholder {
font-size: 20rpx;
color: #999999;
}
.bottom .gray {
background-color: #CCCCCC;
color: #ffffff;
}
\ No newline at end of file
... ...
... ... @@ -17,7 +17,7 @@ Page({
},
//活动详情
goDetail() {
const id = +this.data.detail.id;
const id = +this.data.detail.activeId;
const type = +this.data.detail.type;
console.log('type-id', type,id);
if(type === 1) { //1是活动,2是拼餐
... ...
... ... @@ -131,7 +131,7 @@ Page({
//首页-导航
service(e) {
var tindex = e.currentTarget.dataset.tindex;
var tabcurrent = this.data.tabcurrent;
var tabcurrent = this.data.tabcurrent.tab;
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -148,7 +148,7 @@ Page({
//拼单-导航
consult(e) {
var tindex = e.currentTarget.dataset.tindex
var tabcurrent = this.data.tabcurrent
var tabcurrent = this.data.tabcurrent.tab
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -168,21 +168,31 @@ Page({
release(e) {
console.log('发布');
const self = this;
if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2) { //没填写个人信息并且不可以发布 =>去填写
self.setData({
is_showUserInfo: true //弹出 去填写个人信息弹框
if(!app.globalData.isLogin) {
wx.showToast({title: '还没登录,先去登录吧~', icon: 'none',
success:function () {
setTimeout(function () {
wx.redirectTo({url:'/pages/my/my'})
},500)
}
});
}else {
if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2) { //没填写个人信息并且不可以发布 =>去填写
self.setData({
is_showUserInfo: true //弹出 去填写个人信息弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true //弹出 去答题弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1) { //已填写且可以发布 =>去发布
self.setData({
is_showRelease: true //弹出 去答题弹框
});
}else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1){
wx.showToast({title:'等级不够,无法使用发布功能',icon:'none'})
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true //弹出 去答题弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1) { //已填写且可以发布 =>去发布
self.setData({
is_showRelease: true //弹出 去答题弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1) {
wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'})
}
}
},
//取消发布弹窗
... ... @@ -195,7 +205,7 @@ Page({
//订单-导航
wish(e) {
var tindex = e.currentTarget.dataset.tindex
var tabcurrent = this.data.tabcurrent
var tabcurrent = this.data.tabcurrent.tab
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -214,7 +224,7 @@ Page({
//我的-导航
my(e) {
var tindex = e.currentTarget.dataset.tindex
var tabcurrent = this.data.tabcurrent
var tabcurrent = this.data.tabcurrent.tab
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -242,7 +252,8 @@ Page({
console.log('获取订单列表', res);
if (+res.code === 1) {
self.setData({
orderList: res.data,
orderList: res.data.list,
message_num: res.data.two,
// cate: res.data.cate,
});
}
... ...
... ... @@ -6,6 +6,7 @@
<view class="tab_item {{current==4?'active':''}}" data-current='4' bindtap='chargeTab'>已拼成</view>
<view class="tab_item {{current==6?'active':''}}" data-current='6' bindtap='chargeTab'>已完成</view>
<view class="tab_item {{current==5?'active':''}}" data-current='5' bindtap='chargeTab'>已取消</view>
<view class="message">{{message_num}}</view>
</view>
<!--订单列表-->
... ... @@ -28,7 +29,7 @@
<view class="name-left">
<!--<image src="../../images/avatar@2x.png" class="avatar"></image>-->
<image src="{{item.userPic}}" class="avatar"></image>
<text>{{item.userName}} 在{{item.name}}</text>
<text>{{item.userName}} 在{{item.address}}</text>
</view>
<view class="btn">
<text wx:if="{{item.status === 5 || item.status === 6}}" catchtap="cancel" data-id="{{item.id}}">删除</text>
... ...
/* pages/order/order.wxss */
@import "../../templates/templates.wxss";
@import "../../pages/css/modal.wxss";
.message {
width: 30rpx;
height: 30rpx;
line-height: 30rpx;
text-align: center;
background-color: #EA5D27;
color: #ffffff;
font-size: 19rpx;
border-radius: 50%;
position: absolute;
top:20%;
left:34%;
}
.tab_box {
height: 90rpx;
line-height: 90rpx;
... ... @@ -100,6 +113,9 @@
justify-content: flex-start;
flex:1;
}
.name-left text{
flex:1;
}
.lish-right .name-box .btn {
/* width:28%; */
color:#E2C8B1;
... ...
... ... @@ -180,6 +180,7 @@ Page({
// showrent_mask: false,
is_showSort: false,
is_showSelect: false,
});
wx.showLoading({
title: '加载中',
... ... @@ -228,7 +229,7 @@ Page({
},
//选择全部分类
chooseAll() {
this.setData({is_all: true, is_showSelect: false, current_type: null,score:''});
this.setData({is_all: true, is_showSelect: false, current_type: null,select_id:''});
this.initList();
this.getTypeList();
},
... ... @@ -254,7 +255,7 @@ Page({
//首页-导航
service(e) {
var tindex = e.currentTarget.dataset.tindex;
var tabcurrent = this.data.tabcurrent;
var tabcurrent = this.data.tabcurrent.tab;
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -269,7 +270,7 @@ Page({
//拼单-导航
consult(e) {
var tindex = e.currentTarget.dataset.tindex
var tabcurrent = this.data.tabcurrent
var tabcurrent = this.data.tabcurrent.tab
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -289,21 +290,31 @@ Page({
release(e) {
console.log('发布');
const self = this;
if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2 ){ //没填写个人信息并且不可以发布 =>去填写
self.setData({
is_showUserInfo: true //弹出 去填写个人信息弹框
if(!app.globalData.isLogin) {
wx.showToast({title: '还没登录,先去登录吧~', icon: 'none',
success:function () {
setTimeout(function () {
wx.redirectTo({url:'/pages/my/my'})
},500)
}
});
}else {
if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2) { //没填写个人信息并且不可以发布 =>去填写
self.setData({
is_showUserInfo: true //弹出 去填写个人信息弹框
});
} else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true //弹出 去答题弹框
});
}else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1){ //已填写且可以发布 =>去发布
self.setData({
is_showRelease: true //弹出 去答题弹框
});
}else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1){
wx.showToast({title:'等级不够,无法使用发布功能',icon:'none'})
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true //弹出 去答题弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1) { //已填写且可以发布 =>去发布
self.setData({
is_showRelease: true //弹出 去答题弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1) {
wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'})
}
}
},
//取消发布弹窗
... ... @@ -316,7 +327,7 @@ Page({
//订单-导航
wish(e) {
var tindex = e.currentTarget.dataset.tindex
var tabcurrent = this.data.tabcurrent
var tabcurrent = this.data.tabcurrent.tab
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -335,7 +346,7 @@ Page({
//我的-导航
my(e) {
var tindex = e.currentTarget.dataset.tindex
var tabcurrent = this.data.tabcurrent
var tabcurrent = this.data.tabcurrent.tab
if (tabcurrent == tindex) {
return false
} else {
... ... @@ -378,6 +389,8 @@ Page({
self.setData({
list: res.data.active,
cate: res.data.cate,
start_time_date:'', //清空开始时间
end_time_date:'', //清空结束时间
});
}
wx.hideLoading()
... ...
... ... @@ -91,7 +91,7 @@
<!--<image src="http://pk86rwhci.bkt.clouddn.com/activity_img@2x.png"></image>-->
<image src="{{item.pic}}" mode="aspectFill"></image>
<view class="title">
<text class="area">{{item.address}}</text>
<text class="area">{{item.address}} {{item.time}}</text>
<text class="num">还差{{item.people}}人</text>
</view>
<view class="user">
... ... @@ -109,7 +109,7 @@
<!--<image src="http://pk86rwhci.bkt.clouddn.com/b1@2x%20%281%29.png"></image>-->
<image src="{{item.pic}}" mode="aspectFill"></image>
<view class="title">
<text class="area">{{item.address}}</text>
<text class="area">{{item.address}} {{item.time}}</text>
<text class="num">还差{{item.people}}人</text>
</view>
<view class="user">
... ...
... ... @@ -260,6 +260,7 @@
margin-top: 10rpx;
}
.content_item .title .area {
flex:1;
color: #333333;
font-size: 24rpx;
}
... ...