作者 吴孟雨

首页接口,拼单列表接口,筛选,排序

正在显示 69 个修改的文件 包含 3944 行增加190 行删除

要显示太多修改。

为保证性能只显示 69 of 69+ 个文件。

<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="CssUnknownProperty" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myCustomPropertiesEnabled" value="true" />
<option name="myIgnoreVendorSpecificProperties" value="false" />
<option name="myCustomPropertiesList">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="line-clamp" />
</list>
</value>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
... ...
... ... @@ -2,18 +2,21 @@
App({
onShow() {
console.log('app-onshow');
const self = this;
// 查看是否授权
wx.getSetting({
success(res) {
if (res.authSetting['scope.userInfo']) {
console.log('授权过到首页');
wx.navigateTo({
url: '/pages/index/index', //跳转到授权页面
});
self.globalData.isLogin = true;
// wx.redirectTo({
// url: '/pages/index/index', //跳转到授权页面
// });
} else {
console.log('授权失效到授权页');
self.globalData.isLogin = false;
wx.navigateTo({
url: '/pages/get-user-info/get-user-info', //跳转到授权页面
url: '/pages/my/my', //跳转到授权页面
})
}
}
... ... @@ -25,7 +28,14 @@ App({
// var logs = wx.getStorageSync('logs') || []
// logs.unshift(Date.now())
// wx.setStorageSync('logs', logs)
// 获取用户信息
},
getLogin() {
const self = this;
return new Promise(function(resolve, reject) {
wx.getUserInfo({
success: function (user) {
// console.log(user);
... ... @@ -33,6 +43,10 @@ App({
let url = '/portal/Login/getToken';
wx.login({
success: function (res) {
if(self.loginCallback) {
console.log('onlaunch-callback');
self.loginCallback(user)
}
console.log('获取code', res);
self.post(url, {
code: res.code,
... ... @@ -42,6 +56,7 @@ App({
console.log('获取token', ret);
wx.setStorageSync('token', ret.data.token);
self.globalData.userInfo = user.userInfo;
resolve(ret.data);
setTimeout(function () {
wx.navigateBack({delta:1})
},200)
... ... @@ -55,7 +70,7 @@ App({
}
});
// 获取用户信息
})
},
post: function (url, data, headerParams) {
/**
... ... @@ -90,8 +105,8 @@ App({
method: 'POST',
header: header,
success: function (res) {//返回取得的数据
console.log('返回取得的数据res', res);
if(res.data.code === 1){
// console.log('返回取得的数据res', res);
if(res.data.code == 1){
resolve(res.data);
}else if (res.data.code == '20000') {
console.log('20000');
... ... @@ -149,13 +164,14 @@ App({
console.log('新旧密码不能相同');
resolve(res.data.data);
} else {
console.log('222');
console.log('code=0');
console.log(res.data);
wx.showModal({
title: '提示',
content: res.data.data.msg,
content: res.data.message,
showCancel: false,
})
resolve(res.data.data);
reject(res.data)
}
setTimeout(function () {
... ... @@ -187,7 +203,23 @@ App({
// let new_time = time.join(' ');
return time;
},
//获取截止时间的前几个小时
nextTime(over_time,hour_num) {
let over = new Date(over_time); //转成标准时间
let month = over.getMonth() + 1;
let day = over.getDate();
let hours = over.getHours();//获取截止时间的小时
let minutes = over.getMinutes();
let Y = over.getFullYear() + '.' + (month > 9 ? month : ('0' + month)) + '.' + (day > 9 ? day : ('0' + day));
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);
let new_time = time.join(' ');
return new_time;
},
globalData: {
userInfo: null
userInfo: null,
isLogin:null
}
})
\ No newline at end of file
});
\ No newline at end of file
... ...
{
"pages": [
"pages/index/index",
"pages/activity/detail/detail",
"pages/activity/activity",
"pages/index/answer-question/answer-question",
"pages/my/my",
"pages/order/order",
"pages/spell-list/spell-list",
"pages/index/index",
"pages/logs/logs",
"pages/search/search",
"pages/index/type-detail/type-detail",
"pages/index/tandian-list/tandian-list",
"pages/index/notice-detail/notice-detail",
"pages/my/edit-info/edit-info",
"pages/get-user-info/get-user-info"
"pages/get-user-info/get-user-info",
"pages/my/my-collect/my-collect",
"pages/my/my-wallet/my-wallet",
"pages/my/my-wallet/detail/detail",
"pages/my/suggest/suggest",
"pages/my/about/about",
"pages/meal/meal",
"pages/order/complain/complain",
"pages/order/order-detail/order-detail"
],
"window": {
"backgroundTextStyle": "light",
... ...
@font-face {font-family: "iconfont";
src: url('//at.alicdn.com/t/font_961048_caegm9j8598.eot?t=1545649309238'); /* IE9*/
src: url('//at.alicdn.com/t/font_961048_caegm9j8598.eot?t=1545649309238#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff;charset=utf-8;base64,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') format('woff'),
url('//at.alicdn.com/t/font_961048_caegm9j8598.ttf?t=1545649309238') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('//at.alicdn.com/t/font_961048_caegm9j8598.svg?t=1545649309238#iconfont') format('svg'); /* iOS 4.1- */
src: url('//at.alicdn.com/t/font_961048_fflo66h0q25.eot?t=1545961536104'); /* IE9*/
src: url('//at.alicdn.com/t/font_961048_fflo66h0q25.eot?t=1545961536104#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff;charset=utf-8;base64,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') format('woff'),
url('//at.alicdn.com/t/font_961048_fflo66h0q25.ttf?t=1545961536104') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('//at.alicdn.com/t/font_961048_fflo66h0q25.svg?t=1545961536104#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
... ... @@ -15,10 +15,30 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-jia:before { content: "\e6a9"; }
.icon-fenxiang2:before { content: "\e61e"; }
.icon-arrow-down:before { content: "\e63d"; }
.icon-xiangxia:before { content: "\e614"; }
.icon-zan:before { content: "\e870"; }
.icon-bianji:before { content: "\e67f"; }
.icon-shanchu1:before { content: "\e674"; }
.icon-location:before { content: "\e600"; }
.icon-shanchu:before { content: "\e60f"; }
.icon-dingweiweizhizuobiaoxianxing:before { content: "\e61f"; }
.icon-shoucang:before { content: "\e613"; }
.icon-jia1:before { content: "\e62c"; }
.icon-jian:before { content: "\e62d"; }
.icon-jian1:before { content: "\e6d4"; }
... ...
// pages/activity/activity.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
images: [],
images_params:[],
type_picker_list:[],
start_time:app.nowDate()
},
//输入标题
inputTitle(e) {
this.setData({title:e.detail.value})
},
//输入内容
inputContent(e) {
this.setData({content:e.detail.value})
},
//输入最低人数
inputMinNum(e) {
this.setData({min_num:e.detail.value})
},
//输入最高人数
inputMaxNum(e) {
this.setData({max_num:e.detail.value})
},
//输入地点
inputAddress(e) {
this.setData({address:e.detail.value})
},
//获取地址
choosePosition() {
//选择当前地址,经纬度
const self = this;
wx.chooseLocation({
success(res) {
console.log(res);
self.setData({address_position: res.address,latng:res.latitude + ',' + res.longitude})
},
})
//打开地图导航
// wx.getLocation({ //获取当前经纬度
// type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
// success: function (res) {
// console.log('获取当前经纬度', res);
// wx.openLocation({//​使用微信内置地图查看位置。
// latitude: res.latitude,//要去的纬度-地址
// longitude: res.longitude,//要去的经度-地址
// name: "",
// address: ""
// })
// }
// })
},
//输入截止时间
inputOverTime(e) {
this.setData({over_time:e.detail.value})
},
//获取分类
getType() {
let url = '/portal/Send/select';
const list = [];
app.post(url, {}, {}).then((res) => {
console.log('获取分类', res);
res.data.active.forEach((item) => {
list.push(item.name)
});
this.setData({type_picker_list: list,type_list: res.data.active})
})
},
//确定发布
confirmRelease(e) {
console.log('e', e,e.detail.formId);
this.data.type_list.forEach((item,index) => {
if(this.data.current_type === index) {
// console.log('index', index, item.id);
this.setData({type_id:item.id})
}
});
const images_params = this.data.images_params.join(',');
console.log('发布-images_params', images_params);
let url = '/portal/Send/sendActivity';
let header = {
"XX-token": wx.getStorageSync('token')
};
let params = {
token: wx.getStorageSync('token'),
title: this.data.title,
content:this.data.content,
pic: images_params,
min:this.data.min_num,
max:this.data.max_num,
select_id: this.data.type_id,//类别
time: this.data.date + ' ' + this.data.time,
addr: this.data.address,
address: this.data.address_position,
latng: this.data.latng,
over_time:this.data.over_time,// 报名截止时间
formId: e.detail.formId,
};
var list = [];
app.post(url, params, {}).then((res) => {
console.log('确定发布', res);
// res.list.forEach((item) => {
// list.push(item.name)
// });
// console.log('list', list);
// this.setData({picker_list: list, student_list: res.list})
})
},
//上传图片
choose(e) { //这里是选取图片的方法
let that = this;
wx.chooseImage({
count: 6, //最多可以选择的图片总数
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function(res) {
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
let tempFilePaths = res.tempFilePaths;
//启动上传等待中...
wx.showToast({
title: '正在上传...',
icon: 'loading',
mask: true,
duration: 10000
})
// console.log('tempFilePaths', tempFilePaths);
let token = wx.getStorageSync('token');
let uploadImgCount = 0;
for (let i = 0, h = tempFilePaths.length; i < h; i++) {
wx.uploadFile({
url: 'http://wmatchrd.com/portal/Index/upload',
filePath: tempFilePaths[i],
name: 'file',
formData: {
'imgIndex': i
},
header: {
'content-type': 'application/x-www-form-urlencoded',
'XX-Token': token,
'XX-Device-Type': 'wxapp',
},
success: function(res) {
uploadImgCount++;
let data = JSON.parse(res.data);
console.log('data',data);
if (+data.code == 1) {
wx.hideToast();
//服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" }
let images = that.data.images;
let images_params = that.data.images_params;
images.push(data.data.preview_url);
images_params.push(data.data.filepath);
that.setData({
images: images,
images_params:images_params,
});
console.log('images---images_params',images,images_params)
//如果是最后一张,则隐藏等待中
// if (uploadImgCount == tempFilePaths.length) {
// wx.hideToast();
// }
} else {
wx.hideToast();
wx.showModal({
title: '提示',
content: data.msg,
showCancel: false
})
}
},
fail: function(res) {
wx.hideToast();
wx.showModal({
title: '错误提示',
content: '上传图片失败',
showCancel: false,
success: function(res) {}
})
}
});
}
}
});
},
// 删除图片
deleteImg(e) {
var imgs = this.data.images;
var images_params = this.data.images_params;
var index = e.currentTarget.dataset.index;
imgs.splice(index, 1);
images_params.splice(index, 1);
this.setData({
images: imgs,
images_params:images_params,
});
},
// 预览图片
previewImg: function (e) {
//获取当前图片的下标
var index = e.currentTarget.dataset.index;
//所有图片
var imgs = this.data.images;
wx.previewImage({
//当前显示图片
current: imgs[index],
//所有图片
urls: imgs
})
},
//选择分类
bindTypeChange(e) {
this.setData({current_type: +e.detail.value})
},
//选择时间
bindTimeChange(e) {
this.setData({time:e.detail.value,hour:e.detail.value.split(':')[0],minute: e.detail.value.split(':')[1]})
console.log(e.detail.value.split(':'),e.detail.value.split(':')[0],e.detail.value.split(':')[1]);
},
//选择日期
bindDateChange(e) {
this.setData({date:e.detail.value,month:e.detail.value.split('-')[1],day: e.detail.value.split('-')[2]})
console.log(e.detail.value.split('-'),e.detail.value.split('-')[1],e.detail.value.split('-')[2]);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getType();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "发布拼活动",
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pages/activity/activity.wxml-->
<form bindsubmit="confirmRelease" bindreset="formReset" report-submit="true">
<view class="content">
<view class="input-box">
<input type="text" placeholder="标题" bindinput="inputTitle" maxlength="15" placeholder-class="placeholder"/>
<textarea maxlength="-1" type="text" placeholder="发布描述..." bindinput="inputContent"
placeholder-class="placeholder"></textarea>
</view>
<view class='upload_box'>
<block wx:for="{{images}}" wx:for-item="image" wx:key="index">
<view class='upload_img'>
<view class='icon_box' catchtap="deleteImg" data-index="{{index}}">
<view class='iconfont icon-shanchu1'></view>
</view>
<image src='{{image}}' data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image>
</view>
</block>
<view class='upload_img' bindtap="choose">
<view class='iconfont icon-jia'></view>
<text>添加照片</text>
</view>
</view>
<view class="set-box">
<view class="min-num">
<text class="title">最低人数</text>
<input type="number" bindinput="inputMinNum" class="input"/>
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<view class="min-num">
<text class="title">最高人数</text>
<input type="number" bindinput="inputMaxNum" class="input"/>
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<view class="min-num">
<text class="title type-title">类别</text>
<picker bindchange="bindTypeChange" value="{{current_type}}" range="{{type_picker_list}}" class="picker">
<view class="input">
<text class="variety-text">{{type_picker_list[current_type]}}</text>
<!--<text class="variety-text" wx:else>{{pet_info.sex===2?'MM':'GG'}}</text>-->
<!-- <view class="iconfont icon-arrow-down"></view> -->
</view>
</picker>
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<view class="time-box">
<text class="time-title">时间</text>
<picker mode='date' bindchange="bindDateChange" value='{{date}}' start="{{start_time}}" end='2060-01-01'>
<view class='select'>
<view class="picker">{{month}}
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<text class="margin">月</text>
<view class="picker">{{day}}
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<text class="margin">日</text>
<!--<view class='select_right' style='color:rgba(51,51,51,1)'>{{date}}</view>-->
</view>
</picker>
<picker mode="time"
value="{{time}}"
start="09:01"
end="21:01"
bindchange="bindTimeChange">
<view class='select'>
<view class="picker">{{hour}}
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<text class="margin">时</text>
<view class="picker">{{minute}}
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<text class="margin">分</text>
</view>
</picker>
</view>
<view class="address-box">
<text class="address-title">地点</text>
<input type="text" bindinput="inputAddress" class="input"/>
</view>
<view class="address-box" bindtap="choosePosition">
<text class="address-title">地址</text>
<text class="input">{{address_position}}</text>
<!--<input type="text" bindinput="inputPosition" value="" class="input"/>-->
<text class="iconfont icon-location"></text>
</view>
<view class="time-limit">
<text>时限 活动开始前</text>
<input type="number" bindinput="inputOverTime" value=""/>
<text>小时 停止拼单</text>
</view>
</view>
<button class="complete" form-type="submit">
<view class="btn">确定发布</view>
</button>
</view>
</form>
... ...
/* pages/activity/activity.wxss */
.input-box {
border-top: 22rpx solid #eee;
padding: 40rpx 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.input-box input {
font-size: 24rpx;
color: #666666;
border-bottom: 1rpx solid #f2f2f2;
}
.input-box textarea {
font-size: 24rpx;
color: #666666;
margin-top: 20rpx;
height: 200rpx;
}
.placeholder {
font-size: 24rpx;
color:#C7C7C7;
}
.upload_box {
display: flex;
flex-wrap: wrap;
align-items: center;
padding: 0 32rpx;
}
.upload_img {
width: 184rpx;
height: 184rpx;
background: rgba(250, 250, 250, 1);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
margin-right: 20rpx;
margin-bottom: 20rpx;
}
.upload_img text {
color:#999;
font-size: 20rpx;
}
.upload_img:nth-child(5), .upload_img:nth-child(10){
margin-right: 0;
}
.upload_img image {
width: 100%;
height: 100%;
}
.icon_box {
display: block;
align-items: center;
justify-content: center;
border-radius: 50%;
width: 2rpx;
height: 2rpx;
background-color: #fff;
position: absolute;
left: -12rpx;
top: -12rpx;
}
.icon-jia {
font-size: 60rpx;
color:#999;
}
.icon-shanchu1 {
display: block;
font-size: 44rpx;
color: rgba(0,0,0,0.4);
}
.set-box {
display: flex;
flex-direction: column;
justify-content: flex-start;
padding: 20rpx;
margin-bottom:200rpx;
}
.min-num {
width: 50%;
display: flex;
align-items: center;
font-size: 24rpx;
color: #333333;
position: relative;
margin-bottom: 20rpx;
}
.min-num .title {
margin-right: 16rpx;
}
.time-title, .type-title, .address-title {
margin-right:16rpx;
width:96rpx;
text-align:right;
}
.min-num .input {
width: 160rpx;
height: 38rpx;
line-height: 38rpx;
border:1rpx solid #eee;
text-align: center;
padding: 0 4rpx;
min-height: 38rpx;
}
.min-num .min-icon {
font-size: 24rpx;
position: absolute;
right:86rpx;
top:50%;
transform: translate(0,-50%);
}
.time-box, .address-box {
display: flex;
align-items: center;
font-size: 24rpx;
color: #333333;
margin-bottom: 20rpx;
}
.time-box .select {
display: flex;
align-items: center;
}
.time-box .select .picker {
width: 80rpx;
height: 38rpx;
line-height: 38rpx;
border: 1rpx solid #eee;
position: relative;
padding-left: 10rpx;
}
.time-box .select .picker .min-icon {
font-size: 24rpx;
position: absolute;
right:10rpx;
top:50%;
transform: translate(0,-50%);
}
.margin {
margin: 0 10rpx;
}
.address-box .input {
width: 507rpx;
height: 38rpx;
min-height: 38rpx;
border:1rpx solid #eee;
padding: 0 10rpx;
}
.icon-location {
color: #C7C7C7;
margin-left: 10rpx;
}
.time-limit {
display: flex;
align-items: center;
font-size: 24rpx;
color: #333333;
}
.time-limit input {
padding: 0 10rpx;
text-align: center;
width: 60rpx;
height: 38rpx;
line-height: 38rpx;
min-height: 38rpx;
border:1rpx solid #eee;
margin: 0 14rpx;
}
.complete {
width: 100%;
height: 90rpx;
line-height: 90rpx;
display: flex;
align-items: center;
justify-content: center;
background-color: #323232;
color:#E1C8AF;
font-size: 30rpx;
position: fixed;
left:0;
bottom:0;
margin: 0;
padding: 0;
border-radius: 0;
}
.complete::after {
border:0;
}
\ No newline at end of file
... ...
// pages/activity/detail/detail.js
const app = getApp();
var t = null;
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'},
],
num:1,
actEndTimeList: [],
},
collect() {
console.log('收藏');
},
swiperChange(e) {
// console.log(e);
this.setData({current_swiper: e.detail.current})
},
onPageScroll(e) {
console.log('页面滚动', e);
if(e.scrollTop > 140) {
this.setData({hidden_top:true})
}else if(e.scrollTop <=140){
this.setData({hidden_top:false})
}
},
// 增加数量
addCount(e) {
// let k = e.currentTarget.dataset.idx;
// let t = e.currentTarget.dataset.children_idx;
// let cartslist = this.data.cartslist;
// let num = cartslist[k].children[t].num;
// let product_id = cartslist[k].children[t].product_id;
let num = this.data.num;
num ++;
this.setData({
num: num
});
},
// 减少数量
minusCount(e) {
let num = this.data.num;
if (num <= 1) {
return false;
}
num --;
this.setData({
num: num
});
},
//获取详情
getDetail() {
const self = this;
console.log('city',self.data.city);
let url = '/portal/Active/activeDetail';
let params = {
activeId: self.data.detail_id,
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('获取详情', res);
if (+res.code === 1) {
self.setData({
detail: res.data.active,
end_time: res.data.active.time,
over_hours:res.data.active.over_time,//几小时截止
});
self.countDown();
}
wx.hideLoading()
})
},
timeFormat(param) { //小于10的格式化函数
return param < 10 ? '0' + param : param;
},
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)
}
countDownArr.push(obj);
// 渲染,然后每隔一秒执行一次倒计时函数
this.setData({
// countDownList: countDownArr,
'detail.time': countDownArr,
});
console.log('time',this.data.detail.time);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('详情options', options);
this.setData({detail_id:+options.id?+options.id:''});
this.getDetail();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
clearTimeout(t)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "拼活动详情",
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pages/activity/detail/detail.wxml-->
<view class="content">
<!--swiper-->
<view class="head">
<view class="position {{hidden_top?'hidden-active':'visible-active'}}">
<view class="left">
<!--<image src="../../../images/avatar@2x.png" class="user-avatar"></image>-->
<image src="{{detail.userPic}}" class="user-avatar"></image>
<text>{{detail.userName}}</text>
</view>
<view class="right">
<view class="collect" bindtap="collect">
<view class="iconfont icon-shoucang"></view>
<text>收藏</text>
</view>
<view class="share" bindtap="share">
<view class="iconfont icon-fenxiang2"></view>
<text>分享</text>
</view>
</view>
</view>
<swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange"
autoplay="{{true}}" interval="3000" duration="1000">
<block wx:for="{{detail.banner}}" wx:key="index">
<navigator url="{{item}}" hover-class="navigator-hover">
<swiper-item>
<image src="{{item}}" class="slide-image"/>
</swiper-item>
</navigator>
</block>
</swiper>
<view class="dots">
<block wx:for="{{detail.banner}}" wx:key="index" wx:for-index="idx">
<view class="dot{{idx == current_swiper ? ' active' : ''}}"></view>
</block>
</view>
</view>
<!--地点-->
<view class="area-box">
<view class="title-box">
<view class="title">{{detail.address}}</view>
<view class="over-time">
<text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text>
后停止拼餐</view>
<!--<view>-->
<!--<text class=''>{{detail.time[0].hou}}</text>-->
<!--<text>:</text>-->
<!--<text class=''>{{detail.time[0].min}}</text>-->
<!--<text>:</text>-->
<!--<text class=' '>{{detail.time[0].sec}}</text>-->
<!--</view>-->
</view>
<view class="area-content">
<text>云峰山风景区坐落于密云水库北不老屯镇,燕落村北三公里,处于
密云区东西两大风景区之间,东靠密云古北口 ──司马台长城──
雾灵山风景区。</text>
</view>
</view>
<!--详细时间-->
<view class="detail-box">
<text>时间:2018.04.08 17:30</text>
<text>餐厅:Opera Bombana</text>
<view class="position">
<text class="address">地址:侨福芳草地B2 OPERA BOMBANA</text>
<text class="iconfont icon-location"></text>
</view>
<text>菜系:意大利菜</text>
</view>
<!--已加入人员-->
<view class="join-num">已加入人员</view>
<view class="people-list" wx:if="{{peopleList.length>0}}">
<view class="people" wx:for="{{peopleList}}" wx:key="index" bindtap="goPetDetail" data-id="{{item.id}}">
<view class="bg"><image src="{{item.img}}" class="people-img"></image></view>
<view class="name">{{item.name}}</view>
</view>
</view>
<!--留言板 问一问-->
<view class="comment-box">
<view class="title-box">
<text class="comment-num">留言板 (28)</text>
<view class="ask-btn">
<text class="iconfont icon-bianji"></text>
<text>问一问</text>
</view>
</view>
<!--评论-->
<view class="comment-list-box">
<view class="comment-item">
<view class="top-content">
<view class="top-left">
<image src="../../../images/avatar@2x.png" class="release-img"></image>
<text>旦巴 2018-08-09</text>
</view>
<view class="top-right">
<text>20</text>
<text class="iconfont icon-zan"></text>
</view>
</view>
<view class="comment-detail">
<view class="user-release">
<view class="release-comment">第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无 聊,但是没想到拼友和餐厅都非常好!绝对不会有无聊的时候。 整个旅途非常开心!</view>
<text class="reply-btn">回复</text>
</view>
<view class="user-reply">
<view class='triangle'></view>
<view class="comment">
<text class="reply-name">蚂蚁: </text>
<text>第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>
</view>
<view class="reply">
<text class="reply-name">旦巴</text>
<text>回复</text>
<text class="reply-name">蚂蚁:</text>
<text>第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>
</view>
</view>
</view>
</view>
</view>
</view>
<!--底部btn-->
<view class="bottom-btn">
<view class="add-btn">
<view class="input_box">
<view class="iconfont icon-jian {{num==1?'disable':''}}" bindtap='minusCount'></view>
<view class='item_cart_num'>{{num}}</view>
<view class='iconfont icon-jia1' bindtap='addCount'></view>
</view>
</view>
<view class="confirm-join-btn">
<text>确认拼活动</text>
</view>
</view>
</view>
... ...
/* pages/activity/detail/detail.wxss */
.head {
position: relative;
}
.head .position {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
position: fixed;
top: 0;
left: 0;
z-index: 10;
padding: 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.head .position .left {
display: flex;
align-items: center;
}
.head .position .left .user-avatar{
width: 50rpx;
height: 50rpx;
border-radius: 50%;
margin-right: 10rpx;
}
.head .position .left text {
font-size: 24rpx;
color:#ffffff;
}
.head .position .left .icon-location {
font-size: 44rpx;
color: #ffffff;
margin-right: 14rpx;
}
.head .position .left .icon-arrow-down {
font-size: 36rpx;
color: #ffffff;
margin-left: 18rpx;
}
/* .position text {
color: #ffffff;
font-size: 28rpx;
} */
.head .position .right {
/*width: 478rpx;*/
height: 52rpx;
/*background-color: rgba(255,255,255,0.35);*/
display: flex;
align-items: center;
justify-content: space-between;
/*border-radius: 10rpx;*/
padding: 0 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.head .position .right text {
font-size: 22rpx;
color:#ffffff;
}
.head .position .right .collect, .head .position .right .share {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.head .position .right .collect {
margin-right: 42rpx;
}
.icon-shoucang {
font-size: 30rpx;
color: #ffffff;
}
.icon-fenxiang2 {
font-size: 30rpx;
color: #ffffff;
}
swiper {
width: 100%;
height: 376rpx;
/*margin-top: 20rpx;*/
}
.slide-image {
width: 100%;
height: 100%;
}
/*用来包裹所有的小圆点 */
.dots {
/* width: 156rpx; */
height: 36rpx;
display: flex;
align-items: center;
position: absolute;
left: 50%;
bottom: 20rpx;
transform: translate(-50%);
z-index: 10;
}
/*未选中时的小圆点样式 */
.dot {
width: 10rpx;
height: 10rpx;
border-radius: 50%;
margin-right: 10rpx;
background-color: #ffffff;
opacity: 0.6;
}
/*选中以后的小圆点样式 */
.active {
opacity: 1;
background-color: #DB4E2A;
}
.area-box {
padding: 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: flex;
flex-direction: column;
border-bottom: 20rpx solid #f2f2f2;
}
.area-box .title-box {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 26rpx;
}
.area-box .title-box .title {
color: #333333;
font-size: 28rpx;
}
.area-box .title-box .over-time {
color: #999999;
font-size: 22rpx;
}
.area-box .title-box .over-time text {
color:#DA4F2A;
font-size: 24rpx;
margin-right: 18rpx;
}
.area-content {
color: #666666;
font-size: 24rpx;
}
.detail-box {
padding: 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: flex-start;
border-bottom: 20rpx solid #f2f2f2;
font-size: 24rpx;
color: #666666;
}
.detail-box text {
margin-bottom: 18rpx;
}
.detail-box .position {
display: flex;
align-items: center;
}
.detail-box .position .address {
margin-right: 12rpx;
}
.detail-box .position .icon-location {
font-size: 30rpx;
color: #666666;
}
.join-num {
font-size: 24rpx;
color: #333333;
font-weight: bold;
padding: 40rpx 20rpx 0 20rpx;
}
.people-list {
padding: 32rpx 50rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: flex-start;
overflow-x: scroll;
/* display: -webkit-box; */
-webkit-overflow-scrolling: touch;
border-bottom: 20rpx solid #f2f2f2;
}
.people {
display: flex;
flex-direction: column;
align-items: center;
margin-right: 60rpx;
}
.people:nth-last-child(1){
margin-right: 0;
padding-right: 36rpx;
}
.people-img {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
}
.bg {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background-color: #FD8779;
margin-bottom: 10rpx;
}
.people .name {
width:100rpx;
text-align: center;
/* margin-right: 10rpx; */
color: #333333;
font-size: 22rpx;
/* display: flex; */
/* align-items: center; */
overflow : hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.comment-box {
padding: 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom: 100rpx;
}
.comment-box .title-box {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx;
color: #333333;
}
.comment-num {
font-weight: bold;
}
.ask-btn {
display: flex;
align-items: center;
font-size: 22rpx;
color:#DC4E48;
}
.icon-bianji {
font-size: 30rpx;
color:#DC4E48;
margin-right: 10rpx;
}
.comment-list-box {
padding: 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.comment-item {
display: flex;
flex-direction: column;
}
.top-content {
display: flex;
align-items: center;
justify-content: space-between;
}
.top-left .release-img{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
margin-right: 10rpx;
}
.top-left text {
color: #666666;
font-size: 22rpx;
}
.top-right {
color: #999999;
font-size: 22rpx;
}
.icon-zan {
color: #999999;
}
.comment-detail {
padding: 10rpx 0rpx 20rpx 50rpx;
}
.user-release {
display: flex;
align-items: center;
justify-content: space-between;
}
.release-comment {
color: #666666;
font-size: 24rpx;
}
.reply-btn {
font-size: 22rpx;
color: #333333;
width: 138rpx;
margin-left: 30rpx;
}
.user-reply {
padding: 20rpx 14rpx;
background-color: #F4F4F4;
font-size: 24rpx;
color: #666666;
display: flex;
flex-direction: column;
margin-top: 40rpx;
position: relative;
border-radius:6rpx;
}
.user-reply .comment {
margin-bottom: 24rpx;
}
.reply-name {
font-size: 24rpx;
color: #333333;
font-weight: bold;
}
@keyframes hidden-active {
0% { opacity: 1; }
100% { opacity: 0; }
}
@keyframes visible-active {
0% { opacity: 0; }
100% { opacity: 1; }
}
.hidden-active {
animation: hidden-active 0.5s both;
}
.visible-active {
animation: visible-active 0.5s both;
}
.triangle {
width: 0;
height: 0;
border-bottom: 18rpx solid #F4F4F4;
border-left: 18rpx solid transparent;
border-right: 18rpx solid transparent;
position: absolute;
top: -14rpx;
left: 20rpx;
}
.bottom-btn {
display: flex;
align-items: center;
justify-content: space-between;
border-top: 1rpx solid #f2f2f2;
position: fixed;
bottom:0;
left:0;
background-color: #fff;
width: 100%;
}
.confirm-join-btn {
display: flex;
align-items: center;
justify-content: center;
width: 206rpx;
height: 98rpx;
color:#E1C8AF;
background-color: #323232;
font-size: 30rpx;
}
.input_box {
display: flex;
align-items: center;
height: 50rpx;
font-size: 30rpx;
padding: 10rpx;
color: #3f4040;
}
.input_box .iconfont {
font-size: 38rpx;
color: #999999;
padding:5rpx 10rpx;
}
.input_box .disable{
color: #CCCCCC;
}
.item_cart_num {
width: 40rpx;
height: 40rpx;
border-radius: 3rpx;
background-color: #F2F2F2;
text-align: center;
line-height: 40rpx;
}
\ No newline at end of file
... ...
<view class="img-box">
<view class="img-box" data-index="{{index}}">
<view class="img-border">
<image src="{{item.images_list[0].url}}"></image>
<image src="{{item.pic}}"></image>
<view class="area">
<text class="name">{{item.name}}</text>
<text class="num">还差1人</text>
<text class="name">{{item.address}}</text>
<text class="num">还差{{item.people}}人</text>
</view>
<text>2018.4.28—4.30</text>
<!--<text>2018.4.28—4.30</text>-->
<text>{{item.time}}</text>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -13,6 +13,10 @@ Component({
stopMasonry: false
},
methods: {
goDetail(e) {
console.log('e', e);
this.triggerEvent('go-detail',e.currentTarget.dataset)
},
/**
* 批量添加元素
*
... ...
<view class="masonry-list">
<view class="masonry-list-left" style="{{ 'margin-right:' + intervalWidth }}">
<view id="left-col-inner">
<block wx:for="{{items}}" wx:key="{{item.id}}">
<view wx:for="{{items}}" wx:key="{{item.id}}" bindtap="goDetail" data-activity_id="{{item.id}}">
<masonry-item wx:if="{{item.columnPosition === 'left'}}" item="{{item}}" class="masonry-item1"></masonry-item>
</block>
</view>
</view>
</view>
<view class="masonry-list-right">
<view id="right-col-inner">
<block wx:for="{{items}}" wx:key="{{item.id}}">
<view wx:for="{{items}}" wx:key="{{item.id}}" bindtap="goDetail" data-activity_id="{{item.id}}">
<masonry-item wx:if="{{item.columnPosition === 'right'}}" item="{{item}}" class="masonry-item2"></masonry-item>
</block>
</view>
</view>
</view>
</view>
... ...
// pages/index/answer-question/answer-question.js
Page({
/**
* 页面的初始数据
*/
data: {},
//选择答案
chooseAnswer(e) {
const current = +e.currentTarget.dataset.index;
console.log(current);
this.setData({current:current})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "答题"
}
\ No newline at end of file
... ...
<!--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">
<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 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>
... ...
/* pages/index/answer-question/answer-question.wxss */
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 52rpx 40rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-top: 1rpx solid #f2f2f2;
}
.title {
font-size: 34rpx;
color: #333333;
}
.tips {
font-size: 28rpx;
color: #333333;
margin-top: 56rpx;
font-weight: bold;
}
.questions-box {
width: 100%;
margin-top: 38rpx;
}
.question-item {
padding: 28rpx;
box-shadow: 4rpx 8rpx 60rpx rgba(51, 51, 51, 0.1);
display: flex;
flex-direction: column;
justify-content: flex-start;
margin-bottom: 60rpx;
}
.question-item .question {
font-size: 30rpx;
color: #333333;
font-weight: bold;
}
.question-item .section {
display: flex;
align-items: center;
justify-content: flex-start;
}
.question-item .section text {
font-size: 26rpx;
color: #333333;
margin-top: 10rpx;
margin-right: 10rpx;
}
.question-item .section .img {
width: 34rpx;
height: 20rpx;
}
.question-item .section .active {
color:#E2C8B1;
}
\ No newline at end of file
... ...
//index.js
//获取应用实例
const app = getApp()
const app = getApp();
import mock from './mock.js'//拿到的数据
Page({
data: {
items: mock,
slide: [{image: '../../images/banner.png'}, {image: '../../images/banner.png'}],
images: [{src: '../../images/duantu@2x.png', text: '短途郊游'},
{src: '../../images/changtu@2x.png', text: '长途旅游'},
{src: '../../images/finecanting@2x.png', text: 'Fine Dining 餐厅'},
{src: '../../images/huwai@2x.png', text: '户外运动'},
{src: '../../images/juhui@2x.png', text: '聚会'},
{src: '../../images/yinyuejie@2x.png', text: '音乐节'},
{src: '../../images/dianying@2x.png', text: '电影'},
{src: '../../images/qingshe@2x.png', text: '轻奢餐厅'},
{src: '../../images/zhanlan@2x.png', text: '展览'},
{src: '../../images/wutaiju@2x.png', text: '舞台剧'},
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: '舞台剧'},
],
banner: [{image: '../../images/banner.png'}, {image: '../../images/b1@2x (1).png'}, {image: '../../images/b1@2x (2).png'}, {image: '../../images/banner.png'}],
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'}],
currentBannerIndex: 0,
tabcurrent: {tab: 0, bubble: ''},
noticeList: [{url: '', name: 'https://github.com/wux-weapp/wux-weapp'},
{url: '', name: '北京首展11奥拉维尔·埃利亚松北京首展北京首展11奥拉维尔·埃利亚松北京首展'},
{url: '', name: 'https://github.com/wux-weapp/wux-weapphttps://github.com/wux-weapp/wux-weapp'},
{url: '', name: '奥拉维尔'},
{url: '', name: '奥拉维尔https://github.com/wux-weapp/wux-weapp'},
{url: '', name: '奥拉维尔·埃利亚松北京首展https://github.com/wux-weapp/wux-weapp'},
],
noticeList: [],
is_showAnswer: false,
is_showUserInfo: false,
is_answer: true,
current_swiper:0,
page_number:1,
motto: 'Hello World',
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
swiperChange(e) {
// console.log(e);
this.setData({current_swiper: e.detail.current})
},
//发布拼活动
releaseActivity() {
wx.navigateTo({
url: '/pages/activity/activity',
})
},
//发布拼餐
releaseMeal() {
wx.navigateTo({
url: '/pages/meal/meal',
})
},
//完善个人信息
goUserInfo() {
wx.navigateTo({
url: '/pages/my/edit-info/edit-info',
})
},
//去答题
goAnswer() {
wx.navigateTo({
url: '/pages/index/answer-question/answer-question',
})
},
disableScroll() {
},
handleBackground() {
... ... @@ -50,10 +79,11 @@ Page({
url: '/pages/index/type-detail/type-detail',
})
},
//进入公告详情
goNotice() {
//进入号外公告详情
goNotice(e) {
const id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/index/notice-detail/notice-detail',
url: '/pages/index/notice-detail/notice-detail?id=' + id,
})
},
//查看更多
... ... @@ -63,9 +93,19 @@ Page({
})
},
//进入拼餐详情
goSpellDetail() {
goMealDetail(e) {
console.log('拼餐详情e',e);
const id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/meal/detail/detail?id=' + id,
})
},
//进入拼活动详情
goActivityDetail(e) {
console.log('活动详情e',e);
const id = e.detail.activity_id;
wx.navigateTo({
url: '/pages/index/spell-detail/spell-detail',
url: '/pages/activity/detail/detail?id=' + id,
})
},
//搜索
... ... @@ -91,7 +131,7 @@ Page({
},
onReachBottom: function () {
this._doAppendMasonry(this.data.items)
// this._doAppendMasonry(this.data.items)
},
_doRefreshMasonry(items) {
... ... @@ -102,7 +142,7 @@ Page({
},
_doAppendMasonry(items) {
this.masonryListComponent = this.selectComponent('#masonry')
this.masonryListComponent = this.selectComponent('#masonry');
// 获取接口数据后使用瀑布流组件append方法,当append完成后调用then,是否可触底价在的标志位可以在这里处理
this.masonryListComponent.append(items).then(() => {
console.log('refresh completed,加载更多')
... ... @@ -123,8 +163,6 @@ Page({
})
}
},
//拼单-导航
consult(e) {
var tindex = e.currentTarget.dataset.tindex
... ... @@ -192,8 +230,78 @@ Page({
})
}
},
//获取经纬度
getLat() {
const self = this;
wx.getLocation({ //获取当前经纬度
type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
success: function (res) {
console.log('获取当前经纬度', res);
self.setData({lat: res.latitude,lng:res.longitude});
// app.loginCallback();
// app.loginCallback = res => {
// console.log('show-callback-res', res);
app.getLogin().then(function (res) {
console.log('res', res);
self.getIndex(res.token)//获取首页
});
// };
}
})
},
//获取首页内容
getIndex(res) {
console.log('token', res,wx.getStorageSync('token'));
const self = this;
let url = '/portal/Index/index';
let params = {
lat: self.data.lat,
lng: self.data.lng,
token: wx.getStorageSync('token'),
page: self.data.page_number,
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('获取首页', res);
if(+res.code === 1) {
self.setData({
slide: res.data.banner,
cate:res.data.cate,
china_city: res.data.city,
noticeList:res.data.extra,
meal_banner:res.data.meal,
items:res.data.active,
});
self._doRefreshMasonry(res.data.active);
// console.log(this.data.this_week_test_info);
}
})
},
onShow() {
this.getLat();//获取经纬度
// wx.chooseLocation({
// success(res) {
// console.log(res);
// self.setData({address_position: res.address,lat:res.latitude,lng:res.longitude})
// },
// })
// wx.openLocation({//​使用微信内置地图查看位置。
// latitude: 39.02934,//要去的纬度-地址
// longitude: 117.0212,//要去的经度-地址
// name: "",
// address: ""
// })
console.log('index-show');
console.log(app.globalData.userInfo);
},
onPageScroll(e) {
// console.log('页面滚动', e);
if(e.scrollTop > 140) {
this.setData({hidden_top:true})
}else if(e.scrollTop <=140){
this.setData({hidden_top:false})
}
},
});
... ...
... ... @@ -2,10 +2,10 @@
<view class="container">
<!--swiper-->
<view class="head">
<view class="position">
<view class="position {{hidden_top?'hidden-active':'visible-active'}}">
<view class="left">
<view class="iconfont icon-location"></view>
<text>北京</text>
<text>天津</text>
<view class="iconfont icon-arrow-down"></view>
</view>
<view class="right" bindtap="search">
... ... @@ -13,28 +13,38 @@
<view class="iconfont icon-arrow-down"></view>
</view>
</view>
<swiper indicator-dots="{{true}}"
<swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange"
autoplay="{{true}}" interval="3000" duration="1000">
<block wx:for="{{slide}}" wx:key="index">
<navigator url="{{item.url}}" hover-class="navigator-hover">
<navigator url="{{item.link}}" hover-class="navigator-hover">
<swiper-item>
<image src="{{item.image}}" 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>
</swiper>
<view class="dots">
<block wx:for="{{slide}}" wx:key="index" wx:for-index="idx">
<view class="dot-item {{idx == current_swiper ? ' active' : ''}}"></view>
</block>
</view>
</view>
<!--分类导航-->
<view class="padding-box">
<view class="navigator-box">
<view class="img-box" wx:for="{{images}}" wx:key="index" bindtap="goTypeDetail" data-index="{{index}}">
<image src="{{item.src}}"></image>
<view class="text">{{item.text}}</view>
<view class="img-box" wx:for="{{cate}}" wx:key="index" bindtap="goTypeDetail" data-index="{{index}}">
<!--<image src="{{item.pic}}"></image>-->
<!--<view class="text">{{item.name}}</view>-->
<image src="{{item.pic}}"></image>
<view class="text">{{item.name}}</view>
</view>
</view>
</view>
<!--火柴号外公告-->
<view class="area-box">
<image src="../../images/haowai@2x.png"></image>
<!--<text>奥拉维尔·埃利亚松北京首展</text>-->
... ... @@ -47,8 +57,8 @@
<view class="right-item">
<block wx:for-index="idx" wx:for='{{noticeList}}' wx:key="index" >
<swiper-item>
<view class='content-item' bindtap="goNotice">
<text>{{item.name}}</text>
<view class='content-item' bindtap="goNotice" data-id="{{item.id}}">
<text>{{item.title}}</text>
</view>
</swiper-item>
</block>
... ... @@ -81,20 +91,20 @@
<!--</scroll-view>-->
<swiper class="bannerBox" autoplay="true" interval="3000" duration="2000"
previous-margin="50rpx" next-margin="50rpx" bindchange="bannerChange" current="{{index}}">
<block wx:for="{{banner}}" wx:key="index">
<block wx:for="{{meal_banner}}" wx:key="index">
<swiper-item>
<div class="fix pl5 pr5 box_bb" bindtap="goSpellDetail">
<view class="fix pl5 pr5 box_bb" bindtap="goMealDetail" data-id="{{item.id}}">
<!--<navigator url="">-->
<image class="banner mt10 {{currentBannerIndex==index?'active':''}}" src="{{item.image}}" mode="aspectFill" />
<text>Opera Bombana 2018.4.28</text>
<image class="banner mt10 {{currentBannerIndex==index?'active':''}}" src="{{item.pic}}" mode="aspectFill" />
<text>{{item.address}} {{item.time}}</text>
<!--</navigator>-->
</div>
</view>
</swiper-item>
</block>
</swiper>
<div class="bannerDots flex_c abs">
<div class="dot {{currentBannerIndex==index?'active':''}}" wx:for="{{banner}}" wx:key="index"></div>
</div>
<view class="bannerDots flex_c abs">
<view class="dot {{currentBannerIndex==index?'active':''}}" wx:for="{{banner}}" wx:key="index"></view>
</view>
</view>
<!--足迹-->
... ... @@ -105,7 +115,7 @@
<!--瀑布流-->
<view class="masonry-box">
<masonry generic:masonry-item="img-box" id="masonry" interval-width="20rpx"></masonry>
<masonry bind:go-detail="goActivityDetail" generic:masonry-item="img-box" id="masonry" interval-width="20rpx"></masonry>
</view>
<!--底部tab-->
... ... @@ -130,7 +140,7 @@
<view class="title">目前只对</view>
<view class="title">首批会员开放发布功能</view>
<view class="tips">答题后可能获得第一批次入场卷</view>
<view class="answer-btn">答题</view>
<view class="answer-btn" catchtap="goAnswer">答题</view>
</view>
<view class="modal_box" wx:if="{{is_showAnswer}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
<!--去完善个人信息弹框-->
... ... @@ -138,14 +148,14 @@
<image class="sorry-img" src="../../images/user_info@2x.png"></image>
<view class="title">为了更好的体验</view>
<view class="title">请先完善个人信息</view>
<view class="answer-btn">完成</view>
<view class="answer-btn" bindtap="goUserInfo">完成</view>
</view>
<view class="release-btn-box" wx:if="{{is_showUserInfo}}">
<view class="left-btn">
<view class="left-btn" bindtap="releaseMeal">
<image src="../../images/pincan@2x.png"></image>
<view class="text">发布拼餐</view>
</view>
<view class="right-btn">
<view class="right-btn" bindtap="releaseActivity">
<image src="../../images/pinhuodong@2x.png"></image>
<view class="text">发布拼活动</view>
</view>
... ...
/**index.wxss**/
@import "../../templates/templates.wxss";
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
}
.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
@keyframes hidden-active {
0% { opacity: 1; }
100% { opacity: 0; }
}
.userinfo-nickname {
color: #aaa;
@keyframes visible-active {
0% { opacity: 0; }
100% { opacity: 1; }
}
.usermotto {
margin-top: 200px;
.hidden-active {
animation: hidden-active 0.5s both;
}
.visible-active {
animation: visible-active 0.5s both;
}
.head {
position:relative;
}
.position {
width: 100%;
display: flex;
... ... @@ -79,6 +73,37 @@ swiper {
height: 360rpx;
/*margin-top: 20rpx;*/
}
/*用来包裹所有的小圆点 */
.dots {
/* width: 156rpx; */
height: 36rpx;
display: flex;
align-items: center;
position: absolute;
left: 50%;
bottom: 30rpx;
transform: translate(-50%);
z-index: 10;
}
/*未选中时的小圆点样式 */
.dot-item {
width: 12rpx;
height: 12rpx;
border-radius: 50%;
margin-right: 10rpx;
background-color: #ffffff;
opacity: 0.6;
}
/*选中以后的小圆点样式 */
.active {
opacity: 1;
background-color: #FEE2BB;
}
.slide-image {
width: 100%;
height: 100%;
... ... @@ -103,7 +128,7 @@ swiper {
align-content:stretch;
background-color: #fff;
border-radius: 10rpx;
padding: 20rpx 46rpx;
padding: 20rpx 26rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
... ... @@ -149,7 +174,7 @@ swiper {
margin-bottom: 10rpx;
}
.img-box .text {
font-size: 18rpx;
font-size: 20rpx;
color: #333333;
}
.area-box {
... ... @@ -304,12 +329,12 @@ swiper {
width: 100%;
left: 0;
bottom: 100rpx;
height: 6px;
height: 12rpx;
}
.dot{
width: 8px;
height: 8px;
margin: 0 3px;
width: 14rpx;
height: 14rpx;
margin: 0 6rpx;
border-radius: 50%;
background: rgba(255,255,255,.3);
opacity: 0.3;
... ... @@ -394,6 +419,7 @@ swiper {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom:120rpx;
}
... ...
// pages/index/notice-detail/notice-detail.js
const app = getApp();
var wxParse = require('../../../wxParse/wxParse.js');
Page({
/**
* 页面的初始数据
*/
data: {
data: {},
//获取号外详情
getNoticeDetail() {
const self = this;
let url = '/portal/Index/extraDetail';
let params = {
extraId: self.data.notice_id,
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('获取号外详情', res);
if(+res.code === 1) {
wxParse.wxParse('content', 'html', res.data.extra.content, self, 5);
self.setData({
detail:res.data.extra,
// slide: res.data.banner,
// cate:res.data.cate,
// china_city: res.data.city,
// noticeList:res.data.extra,
// meal_banner:res.data.meal,
// items:res.data.active,
});
// self._doRefreshMasonry(res.data.active);
// // console.log(this.data.this_week_test_info);
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('号外详情options', options);
this.setData({notice_id: +options.id?+options.id:''})
this.getNoticeDetail();
},
/**
... ...
<!--pages/index/notice-detail/notice-detail.wxml-->
<view class="title">
奥拉维尔·埃利亚松北京首展
</view>
<view class="content">
这是昨日看的海,可我依然感觉自己就站在那,就在那个海边,所以,我让此刻面对着电脑敲打文字的自己变成昨日的我,对着海边,诉说着这么一个故事。
  白天的海与晚上的海不同,早些的海与现在的海不同,梦里的海或是想象中的海与现实中的海也不同。沙子不一样,海水不一样,天空不一样,连看海的人也不一样。这是来自中午的海。
<view class="content-box">
<view class="title">
{{detail.title}}
</view>
<view class="content">
<import src="../../../wxParse/wxParse.wxml" />
<template is='wxParse' data='{{wxParseData:content.nodes}}' />
</view>
</view>
\ No newline at end of file
... ...
/* pages/index/notice-detail/notice-detail.wxss */
@import "/wxParse/wxParse.wxss";
.content-box {
display: flex;
flex-direction: column;
align-items: center;
}
.content-box .title {
font-size: 32rpx;
color: #333333;
font-weight: bold;
margin-bottom: 20rpx;
}
.content-box .content {
font-size: 28rpx;
color: #666666;
}
\ No newline at end of file
... ...
// pages/index/type-detail/type-detail.js
const app = getApp();
Page({
... ... @@ -7,22 +8,29 @@ Page({
data: {
is_showSort: false,
is_showSelect: false,
currentSort: 0,
currentSort: null,//默认是智能排序
currentSelect: 0,
start_time_date: app.nowDate(),
end_time_date: app.nowDate(),
type:[
{name:'粤菜',id:1},{name:'川菜',id:2},{name:'其他中餐',id:3},{name:'粤菜',id:4},{name:'粤菜',id:5},{name:'粤菜',id:6},{name:'粤菜',id:7},
{name:'粤菜',id:8},{name:'川菜',id:9},{name:'其他中餐',id:10},{name:'粤菜',id:11},{name:'粤菜',id:12},{name:'粤菜',id:13},{name:'粤菜',id:14},
],
sort: [{id: 0, name: '最具人气'}, {id: 1, name: '距离最近'}],
sort_id: 0,//选择的排序id,默认是0
start_time_date: '',//app.nowDate(),
end_time_date: '',//app.nowDate(),
cate: [],
score: 1,//(1智能排序,2最具人气,3距离最近)
sort: [{id: 2, name: '最具人气'}, {id: 3, name: '距离最近'}],//(1智能排序,2最具人气,3距离最近)
select_id: '',//分类id
is_all: true,
list:[
{area:'Opera Bombana 2018.4.28',num:1,name:'巴旦 出发地朝阳区'},
{area:'Opera Bombana 2018.4.28',num:1,name:'巴旦 出发地朝阳区'},
{area:'Opera Bombana 2018.4.28',num:1,name:'巴旦 出发地朝阳区'},
]
list: [],
page_number:1,
hasMore:true,
},
goPostDetail() {
wx.navigateTo({
url: '/pages/activity/detail/detail',
})
},
//搜索
search() {
wx.navigateTo({
url: '/pages/search/search',
})
},
//点击智能排序按钮
clickSort() {
... ... @@ -44,33 +52,43 @@ Page({
// showrent_mask: false
})
},
//关闭排序列表
//点击蒙层关闭排序和筛选框
closeMask() {
let that = this;
that.setData({
// showrent_mask: false,
is_showSort: false,
is_showSelect: false,
})
});
wx.showLoading({
title: '加载中',
});
that.initList();
that.getTypeList();
},
//保持筛选列表开启
openMask() {
this.setData({is_showSelect: true,})
},
//点击默认/热度排序
//点击最具人气/距离最近
chooseSort(e) {
const current = e.currentTarget.dataset.index;
this.setData({
sort_id: this.data.sort[current].id,
// sort_id: this.data.sort[current].id,
currentSort: current,
is_showSort: false,
score: this.data.sort[current].id,//参数
// down: !this.data.down,
});
this.initPortalPost();
this.getuser_recommend()
// this.initPortalPost();
wx.showLoading({
title: '加载中',
});
this.initList();
this.getTypeList()
},
//选择开始时间
changeStartTime: function(e) {
changeStartTime: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
start_time_date: e.detail.value,
... ... @@ -79,7 +97,7 @@ Page({
})
},
//选择结束时间
changeEndTime: function(e) {
changeEndTime: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
end_time_date: e.detail.value,
... ... @@ -89,12 +107,28 @@ Page({
},
//选择全部分类
chooseAll() {
this.setData({is_all: true,is_showSelect:false,current_type:null})
this.setData({is_all: true, is_showSelect: false, current_type: null,score:''});
this.initList();
this.getTypeList();
},
//选择分类
chooseType(e) {
const current = e.currentTarget.dataset.index;
this.setData({current_type: current,is_all:false,is_showSelect:false,is_showSort: false,})
const id = e.currentTarget.dataset.id;
console.log('select_id', id);
this.setData({current_type: current, is_all: false, is_showSelect: false, is_showSort: false,select_id:id});
wx.showLoading({
title: '加载中',
});
this.initList();
this.getTypeList();
},
initList() {
this.setData({
list: [],
page_number:1,
hasMore:true,
})
},
/**
* 生命周期函数--监听页面加载
... ... @@ -109,12 +143,75 @@ Page({
onReady: function () {
},
//获取首页分类列表
getTypeList() {
const self = this;
console.log('city',self.data.city);
let url = '/portal/Index/cate';
let params = {
lat: self.data.latitude,
lng: self.data.longitude,
addr: self.data.city, // 浮点型 必填 - - 用户位置名称
keyword: '', // 浮点型 非必填 - - 搜索关键字
score: self.data.score, // 浮点型 非必填 - - 排序(1智能排序,2最具人气,3距离最近)
startTime: self.data.start_time_date,// 浮点型 非必填 - - 筛选开始时间
endTime: self.data.end_time_date, // 浮点型 非必填 - - 筛选结束时间
type: self.data.select_id, // 浮点型 非必填 - - 筛选类型
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('获取分类列表', res);
if (+res.code === 1) {
self.setData({
list: res.data.active,
cate: res.data.cate,
});
}
wx.hideLoading()
})
},
getCity() {
const self = this;
let url = '/portal/Index/findCity';
let params = {
lat: self.data.latitude,
lng: self.data.longitude,
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('获取城市', res);
if (+res.code === 1) {
self.setData({
city: res.data.city.city,
});
self.getTypeList();
}
})
},
//获取地理位置
getLocation() {
const self = this;
wx.getLocation({
type: 'wgs84',
altitude: 'true',
success(res) {
console.log('获取地理位', res);
self.setData({latitude: res.latitude, longitude: res.longitude});
self.getCity();
}
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
const self = this;
self.getLocation();
},
/**
... ...
... ... @@ -47,12 +47,12 @@
</view>
</picker>
</view>
<text class="title">菜系:</text>
<text class="title">类别:</text>
<view class="type">
<text catchtap="chooseAll" class="{{is_all?'change-color':''}}">全部</text>
<text class="{{current_type === index?'change-color':''}}"
wx:for="{{type}}" wx:key="index" catchtap="chooseType"
data-index="{{index}}">{{item.name}}
wx:for="{{cate}}" wx:key="index" catchtap="chooseType"
data-index="{{index}}" data-id="{{item.id}}">{{item.name}}
</text>
</view>
<!--<view class="rent_item {{currentSelect===index?'active':''}}" wx:for="{{select}}" wx:key="index"-->
... ... @@ -61,17 +61,19 @@
</view>
</view>
<view class='content_box'>
<view class="no-data" wx:if="{{list.length === 0}}">暂无拼餐活动</view>
<view class="no-data" wx:if="{{list.length === 0}}">暂无活动</view>
<view class='content_item' wx:for='{{list}}' wx:key="index" wx:if="{{list.length>0}}"
bindtap='gouserrecommend_detail' data-index="{{index}}">
<image src="../../../images/b1@2x (1).png"></image>
bindtap='goPostDetail' data-index="{{index}}">
<!--<image src="http://pk86rwhci.bkt.clouddn.com/activity_img@2x.png"></image>-->
<image src="{{item.pic}}"></image>
<view class="title">
<text class="area">{{item.area}}</text>
<text class="num">还差{{item.num}}人</text>
<text class="area">{{item.addr}} {{item.time}}</text>
<text class="num">还差{{item.people}}人</text>
</view>
<view class="user">
<image src="../../images/avatar@2x.png" class="avatar"></image>
<text>{{item.name}}</text>
<!--<image src="../../../images/avatar@2x.png" class="avatar"></image>-->
<image src="{{item.userPic}}" mode="aspectFill"></image>
<text>{{item.userName}} {{item.title}}</text>
</view>
</view>
</view>
... ...
... ... @@ -6,3 +6,15 @@
.content_box {
margin-top: 100rpx;
}
.rent_mask {
top:98rpx;
}
.no-data {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-top: 200rpx;
font-size: 28rpx;
color: #cccccc;
}
\ No newline at end of file
... ...
... ... @@ -8,22 +8,23 @@ Page({
data: {
is_showSort: false,
is_showSelect: false,
currentSort: 0,
currentSort: null,
currentSelect: 0,
start_time_date: app.nowDate(),
end_time_date: app.nowDate(),
type:[
{name:'粤菜',id:1},{name:'川菜',id:2},{name:'其他中餐',id:3},{name:'粤菜',id:4},{name:'粤菜',id:5},{name:'粤菜',id:6},{name:'粤菜',id:7},
{name:'粤菜',id:8},{name:'川菜',id:9},{name:'其他中餐',id:10},{name:'粤菜',id:11},{name:'粤菜',id:12},{name:'粤菜',id:13},{name:'粤菜',id:14},
],
sort: [{id: 0, name: '最具人气'}, {id: 1, name: '距离最近'}],
sort_id: 0,//选择的排序id,默认是0
start_time_date: '',//app.nowDate(),
end_time_date: '',//app.nowDate(),
cate: [],
score: 1,//(1智能排序,2最具人气,3距离最近)
sort: [{id: 2, name: '最具人气'}, {id: 3, name: '距离最近'}],//(1智能排序,2最具人气,3距离最近)
select_id: '',//分类id
is_all: true,
list:[
{area:'Opera Bombana 2018.4.28',num:1,name:'巴旦 出发地朝阳区'},
{area:'Opera Bombana 2018.4.28',num:1,name:'巴旦 出发地朝阳区'},
{area:'Opera Bombana 2018.4.28',num:1,name:'巴旦 出发地朝阳区'},
]
list: [],
page_number:1,
hasMore:true,
},
goPostDetail() {
wx.navigateTo({
url: '/pages/activity/detail/detail',
})
},
//搜索
search() {
... ... @@ -51,33 +52,43 @@ Page({
// showrent_mask: false
})
},
//关闭排序列表
//点击蒙层关闭排序和筛选框
closeMask() {
let that = this;
that.setData({
// showrent_mask: false,
is_showSort: false,
is_showSelect: false,
})
});
wx.showLoading({
title: '加载中',
});
that.initList();
that.getTypeList();
},
//保持筛选列表开启
openMask() {
this.setData({is_showSelect: true,})
},
//点击默认/热度排序
//点击最具人气/距离最近
chooseSort(e) {
const current = e.currentTarget.dataset.index;
this.setData({
sort_id: this.data.sort[current].id,
// sort_id: this.data.sort[current].id,
currentSort: current,
is_showSort: false,
score: this.data.sort[current].id,//参数
// down: !this.data.down,
});
this.initPortalPost();
this.getuser_recommend()
// this.initPortalPost();
wx.showLoading({
title: '加载中',
});
this.initList();
this.getTypeList()
},
//选择开始时间
changeStartTime: function(e) {
changeStartTime: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
start_time_date: e.detail.value,
... ... @@ -86,7 +97,7 @@ Page({
})
},
//选择结束时间
changeEndTime: function(e) {
changeEndTime: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
end_time_date: e.detail.value,
... ... @@ -96,12 +107,28 @@ Page({
},
//选择全部分类
chooseAll() {
this.setData({is_all: true,is_showSelect:false,current_type:null})
this.setData({is_all: true, is_showSelect: false, current_type: null,score:'',});
this.initList();
this.getTypeList();
},
//选择分类
chooseType(e) {
const current = e.currentTarget.dataset.index;
this.setData({current_type: current,is_all:false,is_showSelect:false,is_showSort: false,})
const id = e.currentTarget.dataset.id;
console.log('select_id', id);
this.setData({current_type: current, is_all: false, is_showSelect: false, is_showSort: false,select_id:id});
wx.showLoading({
title: '加载中',
});
this.initList();
this.getTypeList();
},
initList() {
this.setData({
list: [],
page_number:1,
hasMore:true,
})
},
/**
* 生命周期函数--监听页面加载
... ... @@ -116,12 +143,75 @@ Page({
onReady: function () {
},
//获取首页分类列表
getTypeList() {
const self = this;
console.log('city',self.data.city);
let url = '/portal/Index/cate';
let params = {
lat: self.data.latitude,
lng: self.data.longitude,
addr: self.data.city, // 浮点型 必填 - - 用户位置名称
keyword: '', // 浮点型 非必填 - - 搜索关键字
score: self.data.score, // 浮点型 非必填 - - 排序(1智能排序,2最具人气,3距离最近)
startTime: self.data.start_time_date,// 浮点型 非必填 - - 筛选开始时间
endTime: self.data.end_time_date, // 浮点型 非必填 - - 筛选结束时间
type: self.data.select_id, // 浮点型 非必填 - - 筛选类型
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('获取分类列表', res);
if (+res.code === 1) {
self.setData({
list: res.data.active,
cate: res.data.cate,
});
}
wx.hideLoading()
})
},
getCity() {
const self = this;
let url = '/portal/Index/findCity';
let params = {
lat: self.data.latitude,
lng: self.data.longitude,
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('获取城市', res);
if (+res.code === 1) {
self.setData({
city: res.data.city.city,
});
self.getTypeList();
}
})
},
//获取地理位置
getLocation() {
const self = this;
wx.getLocation({
type: 'wgs84',
altitude: 'true',
success(res) {
console.log('获取地理位', res);
self.setData({latitude: res.latitude, longitude: res.longitude});
self.getCity();
}
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
const self = this;
self.getLocation();
},
/**
... ...
... ... @@ -4,7 +4,7 @@
<view class="position">
<view class="left">
<view class="iconfont icon-location"></view>
<text>北京</text>
<text>{{city}}</text>
<view class="iconfont icon-arrow-down"></view>
</view>
<view class="right" bindtap="search">
... ... @@ -62,12 +62,12 @@
</view>
</picker>
</view>
<text class="title">菜系:</text>
<text class="title">类别:</text>
<view class="type">
<text catchtap="chooseAll" class="{{is_all?'change-color':''}}">全部</text>
<text class="{{current_type === index?'change-color':''}}"
wx:for="{{type}}" wx:key="index" catchtap="chooseType"
data-index="{{index}}">{{item.name}}
wx:for="{{cate}}" wx:key="index" catchtap="chooseType"
data-index="{{index}}" data-id="{{item.id}}">{{item.name}}
</text>
</view>
<!--<view class="rent_item {{currentSelect===index?'active':''}}" wx:for="{{select}}" wx:key="index"-->
... ... @@ -76,17 +76,19 @@
</view>
</view>
<view class='content_box'>
<view class="no-data" wx:if="{{list.length === 0}}">暂无拼餐活动</view>
<view class="no-data" wx:if="{{list.length === 0}}">暂无活动</view>
<view class='content_item' wx:for='{{list}}' wx:key="index" wx:if="{{list.length>0}}"
bindtap='gouserrecommend_detail' data-index="{{index}}">
<image src="../../../images/activity_img@2x.png"></image>
bindtap='goPostDetail' data-index="{{index}}">
<!--<image src="http://pk86rwhci.bkt.clouddn.com/activity_img@2x.png"></image>-->
<image src="{{item.pic}}"></image>
<view class="title">
<text class="area">{{item.area}}</text>
<text class="num">还差{{item.num}}人</text>
<text class="area">{{item.addr}} {{item.time}}</text>
<text class="num">还差{{item.people}}人</text>
</view>
<view class="user">
<image src="../../images/avatar@2x.png" class="avatar"></image>
<text>{{item.name}}</text>
<!--<image src="../../../images/avatar@2x.png" class="avatar"></image>-->
<image src="{{item.userPic}}" mode="aspectFill"></image>
<text>{{item.userName}} {{item.title}}</text>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -9,3 +9,12 @@
.content_box {
margin-top: 197rpx;
}
.no-data {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-top: 200rpx;
font-size: 28rpx;
color: #cccccc;
}
\ No newline at end of file
... ...
// pages/activity/detail/detail.js
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'},
],
num:1,
},
collect() {
console.log('收藏');
},
swiperChange(e) {
// console.log(e);
this.setData({current_swiper: e.detail.current})
},
onPageScroll(e) {
console.log('页面滚动', e);
if(e.scrollTop > 140) {
this.setData({hidden_top:true})
}else if(e.scrollTop <=140){
this.setData({hidden_top:false})
}
},
// 增加数量
addCount(e) {
// let k = e.currentTarget.dataset.idx;
// let t = e.currentTarget.dataset.children_idx;
// let cartslist = this.data.cartslist;
// let num = cartslist[k].children[t].num;
// let product_id = cartslist[k].children[t].product_id;
let num = this.data.num;
num ++;
this.setData({
num: num
});
},
// 减少数量
minusCount(e) {
let num = this.data.num;
if (num <= 1) {
return false;
}
num --;
this.setData({
num: num
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "拼餐详情",
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pages/activity/detail/detail.wxml-->
<view class="content">
<!--swiper-->
<view class="head">
<view class="position {{hidden_top?'hidden-active':'visible-active'}}">
<view class="left">
<image src="../../../images/avatar@2x.png" class="user-avatar"></image>
<text>旦巴</text>
</view>
<view class="right">
<view class="collect" bindtap="collect">
<view class="iconfont icon-shoucang"></view>
<text>收藏</text>
</view>
<view class="share" bindtap="share">
<view class="iconfont icon-fenxiang2"></view>
<text>分享</text>
</view>
</view>
</view>
<swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange"
autoplay="{{true}}" interval="3000" duration="1000">
<block wx:for="{{slide}}" wx:key="index">
<navigator url="{{item.url}}" hover-class="navigator-hover">
<swiper-item>
<image src="{{item.image}}" class="slide-image"/>
</swiper-item>
</navigator>
</block>
</swiper>
<view class="dots">
<block wx:for="{{slide}}" wx:key="index" wx:for-index="idx">
<view class="dot{{idx == current_swiper ? ' active' : ''}}"></view>
</block>
</view>
</view>
<!--地点-->
<view class="area-box">
<view class="title-box">
<view class="title">北京密云云峰山</view>
<view class="over-time"><text>23:54:26</text> 后停止拼餐</view>
</view>
<view class="area-content">
<text>云峰山风景区坐落于密云水库北不老屯镇,燕落村北三公里,处于
密云区东西两大风景区之间,东靠密云古北口 ──司马台长城──
雾灵山风景区。</text>
</view>
</view>
<!--详细时间-->
<view class="detail-box">
<text>时间:2018.04.08 17:30</text>
<text>餐厅:Opera Bombana</text>
<view class="position">
<text class="address">地址:侨福芳草地B2 OPERA BOMBANA</text>
<text class="iconfont icon-location"></text>
</view>
<text>菜系:意大利菜</text>
</view>
<!--已加入人员-->
<view class="join-num">已加入人员</view>
<view class="people-list" wx:if="{{peopleList.length>0}}">
<view class="people" wx:for="{{peopleList}}" wx:key="index" bindtap="goPetDetail" data-id="{{item.id}}">
<view class="bg"><image src="{{item.img}}" class="people-img"></image></view>
<view class="name">{{item.name}}</view>
</view>
</view>
<!--留言板 问一问-->
<view class="comment-box">
<view class="title-box">
<text class="comment-num">留言板 (28)</text>
<view class="ask-btn">
<text class="iconfont icon-bianji"></text>
<text>问一问</text>
</view>
</view>
<!--评论-->
<view class="comment-list-box">
<view class="comment-item">
<view class="top-content">
<view class="top-left">
<image src="../../../images/avatar@2x.png" class="release-img"></image>
<text>旦巴 2018-08-09</text>
</view>
<view class="top-right">
<text>20</text>
<text class="iconfont icon-zan"></text>
</view>
</view>
<view class="comment-detail">
<view class="user-release">
<view class="release-comment">第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无 聊,但是没想到拼友和餐厅都非常好!绝对不会有无聊的时候。 整个旅途非常开心!</view>
<text class="reply-btn">回复</text>
</view>
<view class="user-reply">
<view class='triangle'></view>
<view class="comment">
<text class="reply-name">蚂蚁: </text>
<text>第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>
</view>
<view class="reply">
<text class="reply-name">旦巴</text>
<text>回复</text>
<text class="reply-name">蚂蚁:</text>
<text>第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>
</view>
</view>
</view>
</view>
</view>
</view>
<!--底部btn-->
<view class="bottom-btn">
<view class="add-btn">
<view class="input_box">
<view class="iconfont icon-jian {{num==1?'disable':''}}" bindtap='minusCount'></view>
<view class='item_cart_num'>{{num}}</view>
<view class='iconfont icon-jia1' bindtap='addCount'></view>
</view>
</view>
<view class="confirm-join-btn">
<text>确认拼餐</text>
</view>
</view>
</view>
... ...
/* pages/activity/detail/detail.wxss */
.head {
position: relative;
}
.head .position {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
position: fixed;
top: 0;
left: 0;
z-index: 10;
padding: 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.head .position .left {
display: flex;
align-items: center;
}
.head .position .left .user-avatar{
width: 50rpx;
height: 50rpx;
border-radius: 50%;
margin-right: 10rpx;
}
.head .position .left text {
font-size: 24rpx;
color:#ffffff;
}
.head .position .left .icon-location {
font-size: 44rpx;
color: #ffffff;
margin-right: 14rpx;
}
.head .position .left .icon-arrow-down {
font-size: 36rpx;
color: #ffffff;
margin-left: 18rpx;
}
/* .position text {
color: #ffffff;
font-size: 28rpx;
} */
.head .position .right {
/*width: 478rpx;*/
height: 52rpx;
/*background-color: rgba(255,255,255,0.35);*/
display: flex;
align-items: center;
justify-content: space-between;
/*border-radius: 10rpx;*/
padding: 0 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.head .position .right text {
font-size: 22rpx;
color:#ffffff;
}
.head .position .right .collect, .head .position .right .share {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.head .position .right .collect {
margin-right: 42rpx;
}
.icon-shoucang {
font-size: 30rpx;
color: #ffffff;
}
.icon-fenxiang2 {
font-size: 30rpx;
color: #ffffff;
}
swiper {
width: 100%;
height: 376rpx;
/*margin-top: 20rpx;*/
}
.slide-image {
width: 100%;
height: 100%;
}
/*用来包裹所有的小圆点 */
.dots {
/* width: 156rpx; */
height: 36rpx;
display: flex;
align-items: center;
position: absolute;
left: 50%;
bottom: 20rpx;
transform: translate(-50%);
z-index: 10;
}
/*未选中时的小圆点样式 */
.dot {
width: 10rpx;
height: 10rpx;
border-radius: 50%;
margin-right: 10rpx;
background-color: #ffffff;
opacity: 0.6;
}
/*选中以后的小圆点样式 */
.active {
opacity: 1;
background-color: #DB4E2A;
}
.area-box {
padding: 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: flex;
flex-direction: column;
border-bottom: 20rpx solid #f2f2f2;
}
.area-box .title-box {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 26rpx;
}
.area-box .title-box .title {
color: #333333;
font-size: 28rpx;
}
.area-box .title-box .over-time {
color: #999999;
font-size: 22rpx;
}
.area-box .title-box .over-time text {
color:#DA4F2A;
font-size: 24rpx;
margin-right: 18rpx;
}
.area-content {
color: #666666;
font-size: 24rpx;
}
.detail-box {
padding: 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: flex-start;
border-bottom: 20rpx solid #f2f2f2;
font-size: 24rpx;
color: #666666;
}
.detail-box text {
margin-bottom: 18rpx;
}
.detail-box .position {
display: flex;
align-items: center;
}
.detail-box .position .address {
margin-right: 12rpx;
}
.detail-box .position .icon-location {
font-size: 30rpx;
color: #666666;
}
.join-num {
font-size: 24rpx;
color: #333333;
font-weight: bold;
padding: 40rpx 20rpx 0 20rpx;
}
.people-list {
padding: 32rpx 50rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: flex-start;
overflow-x: scroll;
/* display: -webkit-box; */
-webkit-overflow-scrolling: touch;
border-bottom: 20rpx solid #f2f2f2;
}
.people {
display: flex;
flex-direction: column;
align-items: center;
margin-right: 60rpx;
}
.people:nth-last-child(1){
margin-right: 0;
padding-right: 36rpx;
}
.people-img {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
}
.bg {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background-color: #FD8779;
margin-bottom: 10rpx;
}
.people .name {
width:100rpx;
text-align: center;
/* margin-right: 10rpx; */
color: #333333;
font-size: 22rpx;
/* display: flex; */
/* align-items: center; */
overflow : hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.comment-box {
padding: 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom: 100rpx;
}
.comment-box .title-box {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx;
color: #333333;
}
.comment-num {
font-weight: bold;
}
.ask-btn {
display: flex;
align-items: center;
font-size: 22rpx;
color:#DC4E48;
}
.icon-bianji {
font-size: 30rpx;
color:#DC4E48;
margin-right: 10rpx;
}
.comment-list-box {
padding: 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.comment-item {
display: flex;
flex-direction: column;
}
.top-content {
display: flex;
align-items: center;
justify-content: space-between;
}
.top-left .release-img{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
margin-right: 10rpx;
}
.top-left text {
color: #666666;
font-size: 22rpx;
}
.top-right {
color: #999999;
font-size: 22rpx;
}
.icon-zan {
color: #999999;
}
.comment-detail {
padding: 10rpx 0rpx 20rpx 50rpx;
}
.user-release {
display: flex;
align-items: center;
justify-content: space-between;
}
.release-comment {
color: #666666;
font-size: 24rpx;
}
.reply-btn {
font-size: 22rpx;
color: #333333;
width: 138rpx;
margin-left: 30rpx;
}
.user-reply {
padding: 20rpx 14rpx;
background-color: #F4F4F4;
font-size: 24rpx;
color: #666666;
display: flex;
flex-direction: column;
margin-top: 40rpx;
position: relative;
border-radius:6rpx;
}
.user-reply .comment {
margin-bottom: 24rpx;
}
.reply-name {
font-size: 24rpx;
color: #333333;
font-weight: bold;
}
@keyframes hidden-active {
0% { opacity: 1; }
100% { opacity: 0; }
}
@keyframes visible-active {
0% { opacity: 0; }
100% { opacity: 1; }
}
.hidden-active {
animation: hidden-active 0.5s both;
}
.visible-active {
animation: visible-active 0.5s both;
}
.triangle {
width: 0;
height: 0;
border-bottom: 18rpx solid #F4F4F4;
border-left: 18rpx solid transparent;
border-right: 18rpx solid transparent;
position: absolute;
top: -14rpx;
left: 20rpx;
}
.bottom-btn {
display: flex;
align-items: center;
justify-content: space-between;
border-top: 1rpx solid #f2f2f2;
position: fixed;
bottom:0;
left:0;
background-color: #fff;
width: 100%;
}
.confirm-join-btn {
display: flex;
align-items: center;
justify-content: center;
width: 206rpx;
height: 98rpx;
color:#E1C8AF;
background-color: #323232;
font-size: 30rpx;
}
.input_box {
display: flex;
align-items: center;
height: 50rpx;
font-size: 30rpx;
padding: 10rpx;
color: #3f4040;
}
.input_box .iconfont {
font-size: 38rpx;
color: #999999;
padding:5rpx 10rpx;
}
.input_box .disable{
color: #CCCCCC;
}
.item_cart_num {
width: 40rpx;
height: 40rpx;
border-radius: 3rpx;
background-color: #F2F2F2;
text-align: center;
line-height: 40rpx;
}
\ No newline at end of file
... ...
// pages/activity/activity.js
Page({
/**
* 页面的初始数据
*/
data: {
images: [],
typeList: ['川菜', '粤菜', '湖北菜'],
},
//上传图片
choose(e) { //这里是选取图片的方法
let that = this;
wx.chooseImage({
count: 6, //最多可以选择的图片总数
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
let tempFilePaths = res.tempFilePaths;
//启动上传等待中...
wx.showToast({
title: '正在上传...',
icon: 'loading',
mask: true,
duration: 10000
})
// console.log('tempFilePaths', tempFilePaths);
let token = wx.getStorageSync('token');
let uploadImgCount = 0;
for (let i = 0, h = tempFilePaths.length; i < h; i++) {
wx.uploadFile({
url: 'https://www.magipocket.com/api/home/home/upload',
filePath: tempFilePaths[i],
name: 'file',
formData: {
'imgIndex': i
},
header: {
'content-type': 'application/x-www-form-urlencoded',
'XX-Token': token,
'XX-Device-Type': 'wxapp',
},
success: function (res) {
uploadImgCount++;
let data = JSON.parse(res.data);
// console.log('data',data);
if (data.code == 20000) {
//服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" }
let images = that.data.images;
images.push(data.msg);
that.setData({
images: images
});
// console.log(images)
//如果是最后一张,则隐藏等待中
if (uploadImgCount == tempFilePaths.length) {
wx.hideToast();
}
} else {
wx.hideToast();
wx.showModal({
title: '提示',
content: data.msg,
showCancel: false
})
}
},
fail: function (res) {
wx.hideToast();
wx.showModal({
title: '错误提示',
content: '上传图片失败',
showCancel: false,
success: function (res) {
}
})
}
});
}
}
});
},
// 删除图片
deleteImg(e) {
var imgs = this.data.images;
var index = e.currentTarget.dataset.index;
imgs.splice(index, 1);
this.setData({
images: imgs
});
},
// 预览图片
previewImg: function (e) {
//获取当前图片的下标
var index = e.currentTarget.dataset.index;
//所有图片
var imgs = this.data.images;
wx.previewImage({
//当前显示图片
current: imgs[index],
//所有图片
urls: imgs
})
},
//选择分类
bindTypeChange(e) {
this.setData({current_sex: e.detail.value})
},
//选择时间
bindTimeChange(e) {
this.setData({time: e.detail.value, hour: e.detail.value.split(':')[0], minute: e.detail.value.split(':')[1]})
console.log(e.detail.value.split(':'), e.detail.value.split(':')[0], e.detail.value.split(':')[1]);
},
//选择日期
bindDateChange(e) {
this.setData({date: e.detail.value, month: e.detail.value.split('-')[1], day: e.detail.value.split('-')[2]})
console.log(e.detail.value.split('-'), e.detail.value.split('-')[1], e.detail.value.split('-')[2]);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "发布拼餐",
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pages/activity/activity.wxml-->
<view class="content">
<view class="input-box">
<input type="text" placeholder="标题" bindinput="inputTitle" maxlength="15" placeholder-class="placeholder"/>
<textarea maxlength="-1" type="text" placeholder="发布描述..." bindinput="inputTitle" placeholder-class="placeholder"></textarea>
</view>
<view class='upload_box'>
<block wx:for="{{images}}" wx:for-item="image" wx:key="index">
<view class='upload_img'>
<view class='icon_box' catchtap="deleteImg" data-index="{{index}}">
<view class='iconfont icon-shanchu1'></view>
</view>
<image src='{{image}}' data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image>
</view>
</block>
<view class='upload_img' bindtap="choose">
<view class='iconfont icon-jia'></view>
<text>添加照片</text>
</view>
</view>
<view class="set-box">
<view class="min-num num-box">
<text class="title num-title">人数</text>
<input type="number" bindinput="inputMinNum" class="input"/>
<text class="iconfont icon-xiangxia min-icon icon-min"></text>
<text class="tips">注:最低拼单人数</text>
</view>
<!--<view class="min-num">-->
<!--<text class="title">最高人数</text>-->
<!--<input type="number" bindinput="inputMaxNum" class="input"/>-->
<!--<text class="iconfont icon-xiangxia min-icon"></text>-->
<!--</view>-->
<view class="min-num">
<text class="title type-title">菜系</text>
<picker bindchange="bindTypeChange" value="{{current_sex}}" range="{{typeList}}" class="picker">
<view class="input">
<text class="variety-text">{{typeList[current_sex]}}</text>
<!--<text class="variety-text" wx:else>{{pet_info.sex===2?'MM':'GG'}}</text>-->
<!-- <view class="iconfont icon-arrow-down"></view> -->
</view>
</picker>
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<view class="time-box">
<text class="time-title">时间</text>
<picker mode='date' bindchange="bindDateChange" value='{{date}}' end='{{today}}'>
<view class='select'>
<view class="picker">{{month}}
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<text class="margin">月</text>
<view class="picker">{{day}}
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<text class="margin">日</text>
<!--<view class='select_right' style='color:rgba(51,51,51,1)'>{{date}}</view>-->
</view>
</picker>
<picker mode="time"
value="{{time}}"
start="09:01"
end="21:01"
bindchange="bindTimeChange">
<view class='select'>
<view class="picker">{{hour}}
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<text class="margin">时</text>
<view class="picker">{{minute}}
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<text class="margin">分</text>
</view>
</picker>
</view>
<view class="address-box">
<text class="address-title">餐厅</text>
<input type="text" bindinput="inputAddress" class="input"/>
</view>
<view class="address-box">
<text class="address-title">地址</text>
<input type="text" bindinput="inputPosition" value="" class="input"/>
<text class="iconfont icon-location"></text>
</view>
<view class="time-limit">
<text class="limit-title">时限 开餐前</text>
<input type="number" bindinput="inputPosition" value=""/>
<text>小时 停止拼餐</text>
</view>
</view>
<view class="complete">
<view class="btn">确定发布</view>
</view>
</view>
... ...
/* pages/meal/meal.wxss */
@import '../activity/activity.wxss';
.tips {
font-size: 18rpx;
color: #999999;
margin-left: 10rpx;
}
.num-box {
width:100%;
}
.num-title {
width:96rpx;
text-align: right;
}
.icon-min {
position: absolute;
left:248rpx;
right:0;
}
.time-limit .limit-title {
width:173rpx;
text-align: right;
}
\ No newline at end of file
... ...
// pages/my/about/about.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "关于火柴一盒"
}
\ No newline at end of file
... ...
<!--pages/my/about/about.wxml-->
<view class="content">
<view class="main">
<view class="title">关于火柴一盒</view>
<view class="detail">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores debitis, fuga nisi officia quae soluta sunt vero. Debitis dolorem ea eos est laudantium, modi non reiciendis sapiente ut, vero voluptate?</view>
</view>
</view>
... ...
/* pages/my/about/about.wxss */
page {
width: 100%;
height: 100%;
background-color: #f2f2f2;
}
.content {
width: 100%;
height: 100%;
padding: 68rpx 30rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.main {
padding: 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background-color: #fff;
border-radius: 16rpx;
display: flex;
align-items: center;
flex-direction: column;
}
.main .title {
font-size: 30rpx;
color:#323232;
font-weight: bold;
}
.main .detail {
font-size: 28rpx;
color: #666666;
}
\ No newline at end of file
... ...
... ... @@ -38,4 +38,7 @@
<view class='word_num'>{{currentnum}}/{{maxlength}}</view>
</view>
</view>
<view class="complete">
<view class="btn">完成</view>
</view>
</view>
... ...
... ... @@ -81,3 +81,17 @@
font-size: 28rpx;
color: #c3c3c3;
}
.complete {
width: 100%;
height: 90rpx;
line-height: 90rpx;
display: flex;
align-items: center;
justify-content: center;
background-color: #323232;
color:#E1C8AF;
font-size: 30rpx;
position: fixed;
left:0;
bottom:0;
}
\ No newline at end of file
... ...
// pages/my/my-collect/my-collect.js
Page({
/**
* 页面的初始数据
*/
data: {
postList:
[
{title:'温哥华+翡翠岛+路易斯湖五日游',time:'2018.4.28',name:'旦巴 在多伦多',state:1,},
{title:'温哥华+翡翠岛+路易斯湖五日游',time:'2018.4.28',name:'旦巴 在多伦多',state:2,},
{title:'温哥华+翡翠岛+路易斯湖五日游',time:'2018.4.28',name:'旦巴 在多伦多',state:3,},
{title:'温哥华+翡翠岛+路易斯湖五日游',time:'2018.4.28',name:'旦巴 在多伦多',state:4,},
],
},
goPostDetail() {
wx.navigateTo({
url: '/pages/activity/detail/detail',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "我的收藏"
}
\ No newline at end of file
... ...
<!--pages/my/my-collect/my-collect.wxml-->
<!--文章内容-->
<view class='content_box post_box' wx:if="{{postList.length > 0}}">
<view class='content_item' wx:for="{{postList}}" wx:key="index" bindtap='goPostDetail' data-index="{{index}}">
<image src="../../../images/lishi@2x.png" class="thumb"></image>
<view class="lish-right">
<view class="title">{{item.title}}</view>
<view class="time">{{item.time}}</view>
<view class="name-box">
<image src="../../../images/avatar@2x.png" class="avatar"></image>
<text>{{item.name}}</text>
</view>
</view>
</view>
</view>
... ...
/* pages/my/my-collect/my-collect.wxss */
.content_box {
padding: 10rpx 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-top: 1rpx solid #eeeeee;
}
.post_box {
/* margin-top: 100rpx; */
}
.content_item {
display: flex;
align-items: center;
justify-content: flex-start;
padding: 30rpx 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-bottom: 1rpx solid #eeeeee;
}
.content_item .thumb {
width: 170rpx;
height: 170rpx;
margin-right: 26rpx;
}
.lish-right {
height: 166rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.lish-right .title, .lish-right .time{
font-size: 24rpx;
color: #333333;
}
.lish-right .name-box {
display: flex;
align-items: center;
color: #666666;
font-size: 22rpx;
}
.lish-right .name-box .avatar{
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
\ No newline at end of file
... ...
// pages/my/my-wallet/detail/detail.js
Page({
/**
* 页面的初始数据
*/
data: {
peopleList:[
{name:'旦巴',num:'13456895785'},
{name:'旦巴',num:'13456895785'},
{name:'旦巴',num:'13456895785'},
]
},
getScreenHeight() {
console.log('获取屏幕', wx.getSystemInfoSync());
this.setData({screenHeight:wx.getSystemInfoSync().windowHeight})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getScreenHeight();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "饭票"
}
\ No newline at end of file
... ...
<!--pages/my/my-wallet/detail/detail.wxml-->
<view class="content">
<view class="section" style="height:{{screenHeight}}px">
<view class="detail">
<view class="bg">
<view class="head">
<image src="../../../../images/avatar@2x.png"></image>
<text class="name">蚂蚁</text>
<text class="phone">手机号: 13026256485</text>
<text class="num">1人</text>
</view>
<view class="area">
<text class="title">Opera Bomb</text>
<text class="restaurant-name">Opera Bomb</text>
<text class="date">2018.12.26</text>
<text class="time">15:30</text>
<view class="address">
<text>地址:北京市朝阳区东北部一号地国际艺术区</text>
<view class="iconfont icon-location"></view>
</view>
</view>
<view class="people">
<view class="title">成员:</view>
<view wx:for="{{peopleList}}" wx:key="index" class="list">
<image src="../../../../images/avatar@2x.png"></image>
<view class="people-name">{{item.name}}</view>
<view class="people-phone">手机号: {{item.num}}</view>
</view>
</view>
</view>
<view class="code">
<view class="code-num"></view>
</view>
</view>
<!--<view class="line"></view>-->
</view>
</view>
... ...
/* pages/my/my-wallet/detail/detail.wxss */
.content {
padding: 30rpx 10rpx 0 10rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.section {
/* padding: 0 30rpx 30rpx 30rpx; */
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background-image: url('http://pk86rwhci.bkt.clouddn.com/pink-bg.png');
-webkit-background-size: 100%;
background-size: 100%;
background-repeat: no-repeat;
/*background-size: 100%;*/
}
.detail {
height: 100%;
padding:60rpx 40rpx 20rpx 40rpx;
position: relative;
}
.head {
display: flex;
flex-direction: column;
align-items: center;
justify-content:center;
border-bottom: 1rpx solid #f2f2f2;
}
.head image {
width: 96rpx;
height: 96rpx;
border-radius: 50%;
}
.head .name {
font-size: 28rpx;
color: #333333;
margin: 10rpx 0;
}
.head .phone {
font-size: 26rpx;
color: #666666;
margin-bottom: 10rpx;
}
.head .num {
font-size: 24rpx;
color: #999999;
margin-bottom:30rpx;
}
.area {
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.area .title {
font-size: 34rpx;
color: #333333;
margin-bottom: 12rpx;
}
.restaurant-name {
font-size: 24rpx;
color: #333333;
margin-bottom: 10rpx;
}
.date {
font-size: 24rpx;
color: #333333;
font-weight: bold;
margin-bottom: 10rpx;
}
.area .time {
color: #666666;
font-size: 24rpx;
margin-bottom: 20rpx;
}
.area .address {
display: flex;
align-items: center;
color: #333333;
font-size: 24rpx;
}
.area .address text {
margin-right: 10rpx;
}
.icon-location {
font-size: 32rpx;
color: #cccccc;
}
.people .title {
color: #333333;
font-size: 24rpx;
font-weight: bold;
margin: 20rpx 0;
}
.people .list {
display: flex;
justify-content: flex-start;
margin-bottom: 30rpx;
}
.people .list image {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
margin-right: 30rpx;
}
.people-name {
color: #666666;
font-size: 22rpx;
margin-right: 42rpx;
}
.people-phone {
color: #666666;
font-size: 20rpx;
}
.bg {
background-color: #fff;
border-radius: 10rpx;
padding: 28rpx 40rpx 20rpx 40rpx;
}
.detail .code {
width: 100%;
/*margin-top: 54rpx;*/
display: flex;
align-items: center;
justify-content: center;
position: absolute;
bottom: 160rpx;
left:50%;
transform: translate(-50%);
border-bottom: 20rpx circle #fff;
}
.detail .code .code-num {
width: 70%;
height: 136rpx;
border:1rpx solid #f2f2f2;
}
.line {
width: 100%;
height: 10rpx;
border-bottom: 16rpx dotted #fff;
}
\ No newline at end of file
... ...
// pages/my/my-wallet/my-wallet.js
Page({
/**
* 页面的初始数据
*/
data: {
list:[
{area:'意大利维多餐厅',user:'旦巴',date:'时间:2018.5.24',time:'08:24',address:'地址:北京朝阳望京',type:'饭票'},
{area:'意大利维多餐厅',user:'旦巴',date:'时间:2018.5.24',time:'08:24',address:'地址:北京朝阳望京',type:'饭票'},
{area:'意大利维多餐厅',user:'旦巴',date:'时间:2018.5.24',time:'08:24',address:'地址:北京朝阳望京',type:'饭票'},
]
},
goDetail() {
wx.navigateTo({url:'/pages/my/my-wallet/detail/detail'})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "我的钱包"
}
\ No newline at end of file
... ...
<!--pages/my/my-wallet/my-wallet.wxml-->
<view class="list-box">
<view class="bg">
<view class="list-item" wx:for="{{list}}" wx:key="index" data-current="{{index}}" bindtap="goDetail">
<view class="detail">
<view class="area">
<text>{{item.area}}</text>
<text>{{item.user}}</text>
</view>
<view class="time">
<text>{{item.date}}</text>
<text>{{item.time}}</text>
</view>
<view class="address">
<text>{{item.address}}</text>
<text>1人</text>
</view>
</view>
<view class="code"></view>
<view class="name">{{item.type}}</view>
</view>
</view>
</view>
... ...
/* pages/my/my-wallet/my-wallet.wxss */
.bg {
/* background: pink; */
/* border-radius:4rpx; */
}
.list-box {
padding: 30rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: flex;
flex-direction: column;
}
.list-item {
display: flex;
align-items: center;
justify-content: space-between;
/*background: pink;*/
background-image: url('http://pk86rwhci.bkt.clouddn.com/fanpiao@2x.png');
-webkit-background-size: 100%;
/* background-size: 100%; */
border-radius:4rpx;
margin-bottom:20rpx;
padding:20rpx 24rpx;
position: relative;
}
.detail {
width:390rpx;
display: flex;
flex-direction: column;
background: #ffffff;
border-radius:8rpx;
padding: 10rpx;
}
.area, .address {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
}
.area {
font-size: 28rpx;
color: #323232;
}
.address {
font-size: 26rpx;
color: #cccccc;
margin: 10rpx 0;
}
.time {
display: flex;
align-items:center;
padding-bottom: 20rpx;
border-bottom: 1rpx solid #f3f3f3;
font-size: 26rpx;
color: #cccccc;
}
.code {
width: 130rpx;
height: 180rpx;
border:1rpx solid #ccc;
margin-right: 24rpx;
}
.name {
width:36rpx;
font-size: 32rpx;
text-align: center;
color:#ffffff;
font-weight: bold;
}
\ No newline at end of file
... ...
// pages/my/my.js
const app = getApp();
Page({
/**
... ... @@ -8,8 +9,63 @@ Page({
tabcurrent: {tab: 4,bubble: ''},
is_showAnswer: false,
is_showUserInfo:false,
is_answer: true,
is_answer: false,
is_class:1,
isLogin: null,
},
//发布拼活动
releaseActivity() {
wx.navigateTo({
url: '/pages/activity/activity',
})
},
//发布拼餐
releaseMeal() {
wx.navigateTo({
url: '/pages/meal/meal',
})
},
// //完善个人信息
// goUserInfo() {
// wx.navigateTo({
// url: '/pages/my/edit-info/edit-info',
// })
// },
//去答题
goAnswer() {
wx.navigateTo({
url: '/pages/index/answer-question/answer-question',
})
},
//获取授权
login(e) {
console.log('e', e);
const self = this;
let url = '/portal/Login/getToken';
wx.login({
success: function (res) {
console.log('获取code', res);
app.post(url, {
code: res.code,
user_nickname: e.detail.userInfo.nickName,
avatar: e.detail.userInfo.avatarUrl
}, {}).then((ret) => {
console.log('获取token', ret);
wx.setStorageSync('token', ret.token);
wx.showToast({title:'登录成功',icon:'success'});
app.globalData.userInfo = e.detail.userInfo;
app.globalData.isLogin = true;
self.setData({isLogin: app.globalData.isLogin})
// setTimeout(function () {
// wx.navigateBack({delta:1})
// },200)
})
},
fail: function (res) {
},
complete: function (res) {
},
});
},
//编辑个人信息
goUserInfo() {
... ... @@ -17,6 +73,30 @@ Page({
url: '/pages/my/edit-info/edit-info',
})
},
//我的收藏
goMyCollect() {
wx.navigateTo({
url: '/pages/my/my-collect/my-collect',
})
},
//我的钱包
goMyWallet() {
wx.navigateTo({
url: '/pages/my/my-wallet/my-wallet',
})
},
//意见反馈
goSuggest() {
wx.navigateTo({
url: '/pages/my/suggest/suggest',
})
},
//关于火柴
goAbout() {
wx.navigateTo({
url: '/pages/my/about/about',
})
},
disableScroll() {},
handleBackground() {
console.log('dianji');
... ... @@ -113,6 +193,23 @@ Page({
})
}
},
//获取首页内容
getIndex(res) {
let url = '/portal/Member/index';
// let params = {
// lat: res.latitude,
// lng: res.longitude,
// };
let header = {
"XX-token": wx.getStorageSync('token')
};
app.post(url, {}, header).then((res) => {
console.log('获取首页', res);
// this.setData({
// })
// console.log(this.data.this_week_test_info);
})
},
/**
* 生命周期函数--监听页面加载
*/
... ... @@ -131,7 +228,8 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({isLogin: app.globalData.isLogin});
this.getIndex();
},
/**
... ...