作者 吴孟雨

优化我的钱包背景图,添加倒计时结束调用的接口,发布和参与添加formid,添加城市切换

... ... @@ -106,7 +106,7 @@ App({
header: header,
success: function (res) {//返回取得的数据
// console.log('返回取得的数据res', res);
if(res.data.code == 1){
if(+res.data.code == 1){
resolve(res.data);
}else if (res.data.code == '20000') {
console.log('20000');
... ... @@ -127,50 +127,14 @@ App({
}
});
resolve(res.data.data);
} else if (res.data.data.code == '30000') {
resolve(res.data);
} else if (res.data.data.code == '40001') {//返回错误提示信息
console.log(555);
wx.showModal({
title: '提示',
content: res.data.data.msg,
showCancel: false,
success: function (res) {
if (res.confirm) {
// wx.removeStorageSync('token');
// wx.navigateTo({
// url: '/pages/start/start',
// })
}
}
});
resolve(res.data.msg);
} else if (res.data.code == '40000') {
console.log(333);
// wx.showModal({
// title: '提示',
// content: res.data.data.msg,
// showCancel: false,
// success: function (res) { }
// });
resolve(res.data.data);
} else if (res.data.data.code == '40106') {
console.log('重复绑定');
resolve(res.data.data);
} else if (res.data.data.code == '40107') {
console.log('手机号已注册');
resolve(res.data.data);
} else if (res.data.data.code == '40111') {
console.log('新旧密码不能相同');
resolve(res.data.data);
} else {
} else if(+res.data.code === 0){
console.log('code=0');
console.log(res.data);
wx.showModal({
title: '提示',
content: res.data.message,
showCancel: false,
})
});
resolve(res.data.data);
reject(res.data)
}
... ...
... ... @@ -20,6 +20,7 @@
"pages/my/suggest/suggest",
"pages/my/about/about",
"pages/meal/meal",
"pages/meal/detail/detail",
"pages/order/complain/complain",
"pages/order/order-detail/order-detail",
"pages/comment/comment"
... ...
... ... @@ -150,12 +150,12 @@ Page({
address: this.data.address_position,
latng: this.data.latng,
over_time:this.data.over_time,// 报名截止时间
// formId: e.detail.formId,
formId: e.detail.formId,
};
app.post(url, params, {}).then((res) => {
console.log('确定发布', res);
if(+res.code === 1 && res.message == '发布成功') {
this.setData({is_showRelease_modal:true,id:+res.data.id})
this.setData({is_showRelease_modal:true,id:+res.data.activeId})
}else {
wx.showToast({title:res.message,icon:'none'})
}
... ...
<!--pages/activity/activity.wxml-->
<!--<form bindsubmit="confirmRelease" bindreset="formReset" report-submit="true">-->
<view class="content">
<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"
... ... @@ -35,7 +35,8 @@
</view>
<view class="min-num">
<text class="title type-title">类别</text>
<picker bindchange="bindTypeChange" value="{{current_type}}" range="{{type_picker_list}}" class="picker">
<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>-->
... ... @@ -46,7 +47,8 @@
</view>
<view class="time-box">
<text class="time-title">时间</text>
<picker mode='date' bindchange="bindDateChange" value='{{date}}' start="{{start_time}}" end='2060-01-01'>
<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>
... ... @@ -61,8 +63,8 @@
</picker>
<picker mode="time"
value="{{time}}"
start="09:01"
end="21:01"
start="00:00"
end="24:00"
bindchange="bindTimeChange">
<view class='select'>
<view class="picker">{{hour}}
... ... @@ -93,18 +95,19 @@
</view>
</view>
<!--<button class="complete" form-type="submit">-->
<view class="complete" bindtap="confirmRelease">
<button class="complete" form-type="submit">
<!--<view class="complete" bindtap="confirmRelease">-->
<view class="btn">确定发布</view>
<!--</view>-->
</button>
</view>
<!--</button>-->
</view>
<!--发布成功弹框-->
<view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll">
<!--发布成功弹框-->
<view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll">
<image class="sorry-img" src="../../images/success@2x.png"></image>
<view class="title">恭喜您发布成功</view>
<view class="view-btn" catchtap="goMyRelease">查看我的发布</view>
<view class="complete-btn" catchtap="goBack">完成</view>
</view>
<view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
<!--</form>-->
</view>
<view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground"
catchtouchmove="disableScroll"></view>
</form>
... ...
... ... @@ -149,6 +149,10 @@
min-height: 38rpx;
border:1rpx solid #eee;
padding: 0 10rpx;
overflow : hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.icon-location {
color: #C7C7C7;
... ...
... ... @@ -194,7 +194,8 @@ Page({
min: '00',
sec: '00'
};
clearTimeout(t)
clearTimeout(t);
this.end()
}
countDownArr.push(obj);
// 渲染,然后每隔一秒执行一次倒计时函数
... ... @@ -204,21 +205,65 @@ Page({
});
// console.log('time',this.data.detail.time);
},
//倒计时结束
end() {
const self = this;
let url = '/portal/Active/activity';
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) {
// wx.showToast({title:'拼活动结束',icon:'success'})
}
})
},
//导航
getNavigate() {
const self = this;
const arr = self.data.detail.latng.split();
console.log('arr', arr[0], arr[1]);
const arr = self.data.detail.latng.split(',');
console.log('arr',arr,arr[0],arr[1]);
wx.openLocation({//​使用微信内置地图查看位置。
latitude: +arr[0],//要去的纬度-地址
longitude: +arr[1],//要去的经度-地址
latitude: +arr[1],//要去的纬度-地址
longitude: +arr[0],//要去的经度-地址
// lat:39.086437,
// lng:117.122583,
name: "",
name: self.data.detail.address,
address: self.data.detail.address
})
},
//确认拼活动
confirmJoin(e) {
const self = this;
let url = '/portal/Active/join';
let params = {
token: wx.getStorageSync('token'),
number: self.data.num,
activeId: self.data.detail_id,
formId: e.detail.formId,
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('确认拼餐', res);
if (+res.code === 1) {
wx.showToast({title:'拼餐成功',icon:'success'})
// self.setData({
// detail: res.data.active,
// end_time: res.data.active.time,
// over_hours:res.data.active.over_time,//几小时截止
// join_people: res.data.son,
// commenList:res.data.common
// });
// self.countDown();
}
})
},
/**
* 生命周期函数--监听页面加载
*/
... ...
<!--pages/activity/detail/detail.wxml-->
<view class="content">
<form bindsubmit="confirmJoin" bindreset="formReset" report-submit="true">
<view class="content">
<!--swiper-->
<view class="head">
<view class="position {{hidden_top?'hidden-active':'visible-active'}}">
... ... @@ -54,7 +55,8 @@
<view class="title">{{detail.title}}</view>
<view class="over-time">
<text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text>
后停止拼餐</view>
后停止拼餐
</view>
<!--<view>-->
<!--<text class=''>{{detail.time[0].hou}}</text>-->
<!--<text>:</text>-->
... ... @@ -83,7 +85,9 @@
<view class="join-num">已加入人员</view>
<view class="people-list" wx:if="{{join_people.length>0}}">
<view class="people" wx:for="{{join_people}}" wx:key="index">
<view class="bg"><image src="{{item.pic}}" class="people-img"></image></view>
<view class="bg">
<image src="{{item.pic}}" class="people-img"></image>
</view>
<view class="name">{{item.name}}</view>
</view>
</view>
... ... @@ -147,8 +151,9 @@
<view class='iconfont icon-jia1' bindtap='addCount'></view>
</view>
</view>
<view class="confirm-join-btn">
<button class="confirm-join-btn" form-type="submit">
<text>确认拼活动</text>
</button>
</view>
</view>
</view>
</form>
... ...
... ... @@ -257,7 +257,7 @@ swiper {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom: 100rpx;
padding-bottom: 100rpx;
}
.comment-box .title-box {
display: flex;
... ... @@ -296,6 +296,10 @@ swiper {
justify-content: space-between;
}
.top-left {
display: flex;
align-items: center;
}
.top-left .release-img{
width: 40rpx;
height: 40rpx;
... ... @@ -395,6 +399,12 @@ swiper {
color:#E1C8AF;
background-color: #323232;
font-size: 30rpx;
border-radius: 0;
margin: 0;
padding: 0;
}
.confirm-join-btn::after {
border:0;
}
.input_box {
display: flex;
... ...
... ... @@ -29,32 +29,62 @@ Page({
noticeList: [],
is_showAnswer: false,
is_showUserInfo: false,
is_showRelease:false,
is_write:2,//1:已填写,2:未填写
is_showRelease: false,
is_write: 2,//1:已填写,2:未填写
is_answer: false,
current_swiper: 0,
page_number: 1,
cityList: [],
addr:'', //切换地址
motto: 'Hello World',
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
//获取城市列表
getCityList() {
const self = this;
let url = '/portal/Index/cityList';
app.post(url, {}, {}).then((res) => {
console.log('获取城市列表', res);
if (+res.code === 1) {
const arr = [];
res.data.list.forEach((item) => {
arr.push(item.title)
});
self.setData({
city_picker_list: arr,
cityList:res.data.list,
});
}
})
},
//切换城市
cityPickerChange(e) {
this.setData({
current_city: e.detail.value,
// is_sex_change: true
});
const lat = this.data.cityList[e.detail.value].latng.split(',')[1];
const lng = this.data.cityList[e.detail.value].latng.split(',')[0];
this.setData({lat: lat, lng: lng,addr:this.data.cityList[e.detail.value].title});
// console.log('lat', 'lng',lat,lng);
this.getIndex();
},
swiperChange(e) {
// console.log(e);
this.setData({current_swiper: e.detail.current})
},
//发布拼活动
releaseActivity() {
this.setData({is_showRelease:false,});
this.setData({is_showRelease: false,});
wx.navigateTo({
url: '/pages/activity/activity',
});
},
//发布拼餐
releaseMeal() {
this.setData({is_showRelease:false,});
this.setData({is_showRelease: false,});
wx.navigateTo({
url: '/pages/meal/meal',
})
... ... @@ -77,13 +107,14 @@ Page({
},
handleBackground() {
console.log('dianji');
this.setData({is_showAnswer: false, is_showUserInfo: false,is_showRelease:false,})
this.setData({is_showAnswer: false, is_showUserInfo: false, is_showRelease: false,})
},
//进入分类详情
goTypeDetail(e) {
const id = +e.currentTarget.dataset.id;
const name = e.currentTarget.dataset.name;
wx.navigateTo({
url: '/pages/index/type-detail/type-detail?id=' + id,
url: '/pages/index/type-detail/type-detail?id=' + id + '&name=' + name,
})
},
//进入号外公告详情
... ... @@ -134,6 +165,7 @@ Page({
})
},
onLoad: function () {
this.getCityList();
this._doRefreshMasonry(this.data.items)
},
... ... @@ -193,21 +225,21 @@ Page({
release(e) {
console.log('发布');
const self = this;
if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2 ){ //没填写个人信息并且不可以发布 =>去填写
if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2) { //没填写个人信息并且不可以发布 =>去填写
self.setData({
is_showUserInfo: true //弹出 去填写个人信息弹框
});
} else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true //弹出 去答题弹框
});
}else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1){ //已填写且可以发布 =>去发布
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1) { //已填写且可以发布 =>去发布
self.setData({
is_showRelease: true //弹出 去答题弹框
});
}else {
wx.showToast({title:'等级不够,无法使用发布功能',icon:'none'})
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1) {
wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'})
}
},
//订单-导航
... ... @@ -257,7 +289,8 @@ Page({
// console.log('show-callback-res', res);
app.getLogin().then(function (res) {
console.log('res', res);
self.getIndex(res.token)//获取首页
self.getIndex(res.token);//获取首页
self.getIsWrite(); //判断是否已填写个人信息
});
// };
}
... ... @@ -273,6 +306,7 @@ Page({
lng: self.data.lng,
token: wx.getStorageSync('token'),
page: self.data.page_number,
addr: self.data.addr,
};
let header = {
"token": wx.getStorageSync('token')
... ... @@ -287,10 +321,10 @@ Page({
noticeList: res.data.extra,
meal_banner: res.data.meal,
items: res.data.active,
is_canSend:res.data.is_canSend,
is_canSend: res.data.is_canSend,
});
wx.setStorageSync('is_canSend',res.data.is_canSend);//1:可以发布2:不可以发布
wx.setStorageSync('is_answer',res.data.is_answer);//1:已答题2:未答题
wx.setStorageSync('is_canSend', res.data.is_canSend);//1:可以发布2:不可以发布
wx.setStorageSync('is_answer', res.data.is_answer);//1:已答题2:未答题
// is_answer
self._doRefreshMasonry(res.data.active);
// console.log(this.data.this_week_test_info);
... ... @@ -311,9 +345,9 @@ Page({
console.log('是否填写个人信息', res);
if (+res.code === 1) {
self.setData({
is_write:res.data.is_write,//1:已填写2:未填写
is_write: res.data.is_write,//1:已填写2:未填写
});
wx.setStorageSync('is_write',res.data.is_write);//1:已填写2:未填写
wx.setStorageSync('is_write', res.data.is_write);//1:已填写2:未填写
// console.log(this.data.this_week_test_info);
}
})
... ... @@ -334,7 +368,6 @@ Page({
// })
console.log('index-show');
console.log(app.globalData.userInfo);
this.getIsWrite();
},
onPageScroll(e) {
// console.log('页面滚动', e);
... ...
... ... @@ -3,11 +3,13 @@
<!--swiper-->
<view class="head">
<view class="position {{hidden_top?'hidden-active':'visible-active'}}">
<picker class="picker" bindchange="cityPickerChange" value="{{current_city}}" range="{{city_picker_list}}" class="picker">
<view class="left">
<view class="iconfont icon-location"></view>
<text>{{china_city}}</text>
<text>{{city_picker_list[current_city] || china_city}}</text>
<view class="iconfont icon-arrow-down"></view>
</view>
</picker>
<view class="right" bindtap="search">
<view class="input"></view>
<view class="iconfont icon-arrow-down"></view>
... ... @@ -34,7 +36,8 @@
<!--分类导航-->
<view class="padding-box">
<view class="navigator-box">
<view class="img-box" wx:for="{{cate}}" wx:key="index" bindtap="goTypeDetail" data-id="{{item.id}}">
<view class="img-box" wx:for="{{cate}}" wx:key="index"
bindtap="goTypeDetail" data-id="{{item.id}}" data-name="{{item.name}}">
<!--<image src="{{item.pic}}"></image>-->
<!--<view class="text">{{item.name}}</view>-->
<image src="{{item.pic}}"></image>
... ...
... ... @@ -419,7 +419,7 @@ swiper {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom:120rpx;
padding-bottom:130rpx;
}
... ...
... ... @@ -21,10 +21,19 @@ Page({
page_number:1,
hasMore:true,
},
goPostDetail() {
goPostDetail(e) {
const id = +e.currentTarget.dataset.id;
const type = +e.currentTarget.dataset.type;
console.log('type', type);
if(type === 1) { //1是活动,2是拼餐
wx.navigateTo({
url: '/pages/activity/detail/detail',
url: '/pages/activity/detail/detail?id=' + id,
})
}else {
wx.navigateTo({
url: '/pages/meal/detail/detail?id=' + id,
})
}
},
//搜索
search() {
... ...
... ... @@ -63,7 +63,7 @@
<view class='content_box'>
<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='goPostDetail' data-index="{{index}}">
bindtap='goPostDetail' data-id="{{item.id}}" data-type="{{item.type}}">
<!--<image src="http://pk86rwhci.bkt.clouddn.com/activity_img@2x.png"></image>-->
<image src="{{item.pic}}"></image>
<view class="title">
... ...
... ... @@ -144,7 +144,8 @@ Page({
*/
onLoad: function (options) {
console.log('options', options);
this.setData({select_id:+options.id?+options.id:''})
this.setData({select_id:+options.id?+options.id:''});
wx.setNavigationBarTitle({title:options.name})
},
/**
... ...
{
"navigationBarTitleText": "短途郊游"
"navigationBarTitleText": ""
}
\ No newline at end of file
... ...
... ... @@ -166,18 +166,19 @@ Page({
});
self.countDown();
}
wx.hideLoading()
// wx.hideLoading()
})
},
//确认拼餐
confirmJoin() {
confirmJoin(e) {
const self = this;
let url = '/portal/Active/join';
let params = {
token: wx.getStorageSync('token'),
number: self.data.num,
activeId: self.data.detail_id,
formId: e.detail.formId,
};
let header = {
"token": wx.getStorageSync('token')
... ... @@ -233,7 +234,8 @@ Page({
min: '00',
sec: '00'
};
clearTimeout(t)
clearTimeout(t);
this.end();
}
countDownArr.push(obj);
// 渲染,然后每隔一秒执行一次倒计时函数
... ... @@ -243,17 +245,35 @@ Page({
});
// console.log('time',this.data.detail.time);
},
//倒计时结束
end() {
const self = this;
let url = '/portal/Active/activity';
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) {
// wx.showToast({title:'拼活动结束',icon:'success'})
}
})
},
//导航
getNavigate() {
const self = this;
const arr = self.data.detail.latng.split();
console.log('arr', arr[0], arr[1]);
const arr = self.data.detail.latng.split(',');
console.log('arr',arr,arr[0],arr[1]);
wx.openLocation({//​使用微信内置地图查看位置。
latitude: +arr[0],//要去的纬度-地址
longitude: +arr[1],//要去的经度-地址
// lat:39.086437,
// lng:117.122583,
name: "",
name: self.data.detail.address,
address: self.data.detail.address
})
},
... ...
<!--pages/activity/detail/detail.wxml-->
<view class="content">
<form bindsubmit="confirmJoin" bindreset="formReset" report-submit="true">
<view class="content">
<!--swiper-->
<view class="head">
<view class="position {{hidden_top?'hidden-active':'visible-active'}}">
... ... @@ -54,7 +55,8 @@
<view class="title">{{detail.title}}</view>
<view class="over-time">
<text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text>
后停止拼餐</view>
后停止拼餐
</view>
<!--<view>-->
<!--<text class=''>{{detail.time[0].hou}}</text>-->
<!--<text>:</text>-->
... ... @@ -88,7 +90,9 @@
<view class="join-num">已加入人员</view>
<view class="people-list" wx:if="{{join_people.length>0}}">
<view class="people" wx:for="{{join_people}}" wx:key="index">
<view class="bg"><image src="{{item.pic}}" class="people-img"></image></view>
<view class="bg">
<image src="{{item.pic}}" class="people-img"></image>
</view>
<view class="name">{{item.name}}</view>
</view>
</view>
... ... @@ -153,8 +157,12 @@
<view class='iconfont icon-jia1' bindtap='addCount'></view>
</view>
</view>
<view class="confirm-join-btn" bindtap="confirmJoin">
<button class="confirm-join-btn" form-type="submit">
<text>确认拼餐</text>
</button>
<!--<view class="confirm-join-btn" bindtap="confirmJoin">-->
<!--<text>确认拼餐</text>-->
<!--</view>-->
</view>
</view>
</view>
</form>
... ...
... ... @@ -256,7 +256,7 @@ swiper {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom: 100rpx;
padding-bottom: 100rpx;
}
.comment-box .title-box {
display: flex;
... ... @@ -295,6 +295,10 @@ swiper {
justify-content: space-between;
}
.top-left {
display: flex;
align-items: center;
}
.top-left .release-img{
width: 40rpx;
height: 40rpx;
... ... @@ -394,6 +398,12 @@ swiper {
color:#E1C8AF;
background-color: #323232;
font-size: 30rpx;
border-radius: 0;
margin: 0;
padding: 0;
}
.confirm-join-btn::after {
border:0;
}
.input_box {
display: flex;
... ...
... ... @@ -136,13 +136,13 @@ Page({
address: this.data.address_position,
latng: this.data.latng,
over_time:this.data.over_time,// 报名截止时间
// formId: e.detail.formId,
formId: e.detail.formId,
};
var list = [];
app.post(url, params, {}).then((res) => {
console.log('确定发布', res);
if(+res.code === 1 && res.message == '发布成功') {
this.setData({is_showRelease_modal:true,order_id:+res.data.id})
this.setData({is_showRelease_modal:true,order_id:+res.data.activeId})
}else {
wx.showToast({title:res.message,icon:'none'})
}
... ...
<!--pages/activity/activity.wxml-->
<!--<form bindsubmit="confirmRelease" bindreset="formReset" report-submit="true">-->
<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"/>
... ... @@ -62,8 +62,8 @@
</picker>
<picker mode="time"
value="{{time}}"
start="09:01"
end="21:01"
start="00:00"
end="24:00"
bindchange="bindTimeChange">
<view class='select'>
<view class="picker">{{hour}}
... ... @@ -94,9 +94,11 @@
</view>
</view>
<view class="complete" bindtap="confirmRelease">
<button class="complete" form-type="submit">
<!--<view class="complete" bindtap="confirmRelease">-->
<view class="btn">确定发布</view>
</view>
<!--</view>-->
</button>
</view>
<!--发布成功弹框-->
<view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll">
... ... @@ -107,4 +109,4 @@
</view>
<view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground"
catchtouchmove="disableScroll"></view>
<!--</form>-->
\ No newline at end of file
</form>
\ No newline at end of file
... ...
// pages/my/about/about.js
var wxParse = require('../../../wxParse/wxParse.js');
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
data: {},
//
//关于火柴
getAbout() {
let url = '/portal/Member/about';
let params = {
token: wx.getStorageSync('token'),
};
app.post(url, {}, {}).then((res) => {
console.log('关于火柴', res);
if (+res.code === 1) {
wxParse.wxParse('content', 'html', res.data.content, this, 5);
this.setData({
// list: res.data.list,
});
// console.log(self.data.questionList);
}
});
},
/**
* 生命周期函数--监听页面加载
*/
... ... @@ -26,7 +43,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getAbout()
},
/**
... ...
... ... @@ -2,6 +2,8 @@
<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 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>-->
<import src="../../../wxParse/wxParse.wxml" />
<template is='wxParse' data='{{wxParseData:content.nodes}}' />
</view>
</view>
... ...
... ... @@ -12,6 +12,21 @@ Page({
{name:'旦巴',num:'13456895785'},
]
},
//导航
getNavigate() {
const self = this;
const arr = self.data.detail.latng.split(',');
// console.log('arr',arr,arr[0],arr[1]);
wx.openLocation({//​使用微信内置地图查看位置。
latitude: +arr[0],//要去的纬度-地址
longitude: +arr[1],//要去的经度-地址
// lat:39.086437,
// lng:117.122583,
name: self.data.detail.address,
address: self.data.detail.address
})
},
getScreenHeight() {
console.log('获取屏幕', wx.getSystemInfoSync());
this.setData({screenHeight:wx.getSystemInfoSync().windowHeight})
... ... @@ -27,7 +42,8 @@ Page({
console.log('获取我的钱包详情', res);
if (+res.code === 1) {
this.setData({
// collectList: this.data.collectList.concat(res.data),
detail: res.data.list,
join:res.data.join,
});
// console.log(self.data.questionList);
}
... ... @@ -37,7 +53,8 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('options', options);
this.setData({id:+options.id?+options.id:''})
},
/**
... ...
... ... @@ -4,30 +4,33 @@
<view class="detail">
<view class="bg">
<view class="head">
<image src="../../../../images/avatar@2x.png"></image>
<text class="name">蚂蚁</text>
<!--<image src="../../../../images/avatar@2x.png"></image>-->
<image src="{{detail.userPic}}"></image>
<text class="name">{{detail.userName}}</text>
<text class="phone">手机号: 13026256485</text>
<text class="num">1人</text>
<text class="num">{{detail.number}}人</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>
<text class="title">{{detail.title}}</text>
<text class="restaurant-name">{{detail.address}}</text>
<text class="date">{{detail.time}}</text>
<!--<text class="time">15:30</text>-->
<view class="address" bindtap="getNavigate">
<text>地址:{{detail.address}}</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>
<scroll-view class="scroll" scroll-y>
<view wx:for="{{join}}" wx:key="index" class="list">
<image src="{{item.pic}}"></image>
<view class="people-name">{{item.name}}</view>
<view class="people-phone">手机号: {{item.num}}</view>
<view class="people-phone">手机号: {{item.tel}}</view>
</view>
</scroll-view>
</view>
</view>
... ...
... ... @@ -53,6 +53,7 @@
display: flex;
flex-direction: column;
justify-content: flex-start;
margin-top:30rpx;
}
.area .title {
font-size: 34rpx;
... ... @@ -144,3 +145,11 @@
height: 10rpx;
border-bottom: 16rpx dotted #fff;
}
.scroll {
height: 300rpx;
/*overflow-y: scroll;*/
/*display: -webkit-box;*/
/*-webkit-overflow-scrolling: touch;*/
display: flex;
flex-direction: column;
}
\ No newline at end of file
... ...
... ... @@ -12,8 +12,9 @@ Page({
{area:'意大利维多餐厅',user:'旦巴',date:'时间:2018.5.24',time:'08:24',address:'地址:北京朝阳望京',type:'饭票'},
]
},
goDetail() {
wx.navigateTo({url:'/pages/my/my-wallet/detail/detail'})
goDetail(e) {
const id = e.currentTarget.dataset.id;
wx.navigateTo({url:'/pages/my/my-wallet/detail/detail?id=' + id})
},
//获取我的钱包
getMyWallet() {
... ... @@ -25,7 +26,7 @@ Page({
console.log('获取我的钱包', res);
if (+res.code === 1) {
this.setData({
// collectList: this.data.collectList.concat(res.data),
list: res.data.list,
});
// console.log(self.data.questionList);
}
... ...
<!--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="bg">
<!--(0全部,2待处理,4已拼成,5已取消,6已完成)-->
<view class="no-data" wx:if="{{list.length===0}}">钱包是空的~</view>
<view class="list-item {{item.type === 1?'change-bg':''}} {{item.status === 6?'change-bg-end':''}}"
wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="goDetail">
<image src="../../../images/end-flag@2x.png" wx:if="{{item.status === 6}}" class="flag-img"></image>
<view class="detail {{item.status === 6?'change-color':''}}">
<view class="area">
<text>{{item.area}}</text>
<text>{{item.user}}</text>
<text class="addr">{{item.addr}}</text>
<text>{{item.userName}}</text>
</view>
<view class="time">
<text>{{item.date}}</text>
<text>{{item.time}}</text>
<text>时间:{{item.time}}</text>
</view>
<view class="address">
<text>{{item.address}}</text>
<text>1人</text>
<text class="addr">地址:{{item.address}}</text>
<text>{{item.number}}人</text>
</view>
</view>
<view class="code"></view>
<view class="name">{{item.type}}</view>
<view class="name">{{item.type === 1?'活动票':'饭票'}}</view>
</view>
</view>
</view>
</view>
... ...
/* pages/my/my-wallet/my-wallet.wxss */
@import "/wxParse/wxParse.wxss";
.no-data {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
color: #cccccc;
margin-top: 300rpx;
}
.bg {
/* background: pink; */
/* border-radius:4rpx; */
... ... @@ -24,6 +34,12 @@
padding:20rpx 24rpx;
position: relative;
}
.change-bg {
background-image: url('http://pk86rwhci.bkt.clouddn.com/huodongpuao@2x.png');
}
.change-bg-end {
background-image: url('http://pk86rwhci.bkt.clouddn.com/yiwancheng@2x.png');
}
.detail {
width:390rpx;
display: flex;
... ... @@ -39,12 +55,15 @@
margin-bottom: 20rpx;
}
.area {
font-size: 28rpx;
font-size: 24rpx;
color: #323232;
}
.area .addr,.address .addr {
flex:1;
}
.address {
font-size: 26rpx;
color: #cccccc;
font-size: 20rpx;
color: #666666;
margin: 10rpx 0;
}
.time {
... ... @@ -52,8 +71,8 @@
align-items:center;
padding-bottom: 20rpx;
border-bottom: 1rpx solid #f3f3f3;
font-size: 26rpx;
color: #cccccc;
font-size: 22rpx;
color: #333333;
}
.code {
width: 130rpx;
... ... @@ -68,3 +87,13 @@
color:#ffffff;
font-weight: bold;
}
.change-color text{
color: #999999;
}
.flag-img {
width: 176rpx;
height: 154rpx;
position: absolute;
bottom:0;
left:229rpx;
}
\ No newline at end of file
... ...
... ... @@ -76,11 +76,12 @@ Page({
avatar: e.detail.userInfo.avatarUrl
}, {}).then((ret) => {
console.log('获取token', ret);
wx.setStorageSync('token', ret.token);
wx.setStorageSync('token', ret.data.token);
wx.showToast({title:'登录成功',icon:'success'});
app.globalData.userInfo = e.detail.userInfo;
app.globalData.isLogin = true;
self.setData({isLogin: app.globalData.isLogin})
self.setData({isLogin: app.globalData.isLogin});
self.getIndex();
// setTimeout(function () {
// wx.navigateBack({delta:1})
// },200)
... ... @@ -180,6 +181,8 @@ Page({
self.setData({
is_showRelease: true //弹出 去答题弹框
});
}else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1){
wx.showToast({title:'等级不够,无法使用发布功能',icon:'none'})
}
},
//取消发布弹窗
... ... @@ -225,6 +228,7 @@ Page({
},
//获取首页内容
getIndex(res) {
if(app.globalData.isLogin) {
let url = '/portal/Member/index';
let params = {
// lat: res.latitude,
... ... @@ -241,6 +245,7 @@ Page({
})
// console.log(this.data.this_week_test_info);
})
}
},
/**
* 生命周期函数--监听页面加载
... ...
... ... @@ -15,6 +15,21 @@ Page({
+ '&order_detail=' + order_detail
})
},
//活动详情
goDetail() {
const id = +this.data.detail.id;
const type = +this.data.detail.type;
console.log('type-id', type,id);
if(type === 1) { //1是活动,2是拼餐
wx.navigateTo({
url: '/pages/activity/detail/detail?id=' + id,
})
}else {
wx.navigateTo({
url: '/pages/meal/detail/detail?id=' + id,
})
}
},
//订单详情
getOrderDetail() {
const self = this;
... ...
... ... @@ -11,9 +11,9 @@
<text>已拍下</text>
</view>
<view class="state2">
<view class="circle {{detail.status === 4 ||detail.status === 5 ?'change':''}}"></view>
<view class="circle {{detail.status === 4 ||detail.status === 5 || detail.status === 6?'change':''}}"></view>
<text wx:if="{{detail.status === 5}}">已取消</text>
<text wx:if="{{detail.status === 4}}">已拼成</text>
<text wx:if="{{detail.status === 4 || detail.status === 6}}">已拼成</text>
<text wx:if="{{detail.status === 2}}" class="{{detail.status === 2?'change-text':''}}">待拼成</text>
</view>
<view class="state3">
... ... @@ -23,7 +23,7 @@
</view>
</view>
<view class="order-info">
<view class="order-info" bindtap="goDetail">
<view class="top">
<!--<image src="../../../images/avatar@2x.png"></image>-->
<image src="{{detail.userPic}}"></image>
... ...
... ... @@ -14,6 +14,50 @@ Page({
is_answer: true,
is_write: 0,//1:已填写,2:未填写
},
//删除
cancel(e) {
const self = this;
const id = e.currentTarget.dataset.id;
let url = '/portal/Order/del';
let params = {
token: wx.getStorageSync('token'),
orderId: id,
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('删除', res);
if (+res.code === 1) {
wx.showToast({title:res.message,icon:'none'});
self.getOrderList();
}else {
wx.showToast({title:res.message,icon:'none'})
}
})
},
//完成
complete(e) {
const self = this;
const id = e.currentTarget.dataset.id;
let url = '/portal/Order/sure';
let params = {
token: wx.getStorageSync('token'),
orderId: id,
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('完成', res);
if (+res.code === 1) {
wx.showToast({title:res.message,icon:'none'});
self.getOrderList();
}else {
wx.showToast({title:res.message,icon:'none'})
}
})
},
//是否填写个人信息
getIsWrite() {
const self = this;
... ... @@ -137,6 +181,8 @@ Page({
self.setData({
is_showRelease: true //弹出 去答题弹框
});
}else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1){
wx.showToast({title:'等级不够,无法使用发布功能',icon:'none'})
}
},
//取消发布弹窗
... ...
... ... @@ -18,10 +18,10 @@
<view class="lish-right">
<view class="title-box">
<view class="title">{{item.title}}</view>
<text wx:if="{{item.state === 1}}" class="state">待拼成</text>
<text wx:if="{{item.state === 2}}" class="state">已拼成</text>
<text wx:if="{{item.state === 3}}" class="state">已取消</text>
<text wx:if="{{item.state === 4}}" class="state">已完成</text>
<text wx:if="{{item.status === 2}}" class="state">待拼成</text>
<text wx:if="{{item.status === 4}}" class="state">已拼成</text>
<text wx:if="{{item.status === 5}}" class="state">已取消</text>
<text wx:if="{{item.status === 6}}" class="state">已完成</text>
</view>
<view class="time">{{item.time}}</view>
<view class="name-box">
... ... @@ -31,8 +31,8 @@
<text>{{item.userName}} 在{{item.addr}}</text>
</view>
<view class="btn">
<text wx:if="{{item.state === 4 || item.state === 3}}">删除</text>
<text wx:if="{{item.state === 2}}">完成</text>
<text wx:if="{{item.status === 5 || item.status === 6}}" catchtap="cancel" data-id="{{item.id}}">删除</text>
<text wx:if="{{item.status === 4}}" catchtap="complete" data-id="{{item.id}}">完成</text>
</view>
</view>
</view>
... ...
... ... @@ -98,8 +98,10 @@
display: flex;
align-items: center;
justify-content: flex-start;
flex:1;
}
.lish-right .name-box .btn {
/* width:28%; */
color:#E2C8B1;
font-size: 24rpx;
}
... ...
... ... @@ -42,6 +42,38 @@ Page({
is_showUserInfo:false,
is_answer: false,
is_write:2,//1:已填写,2:未填写
cityList:[],
addr:'', //切换地址
},
//获取城市列表
getCityList() {
const self = this;
let url = '/portal/Index/cityList';
app.post(url, {}, {}).then((res) => {
console.log('获取城市列表', res);
if (+res.code === 1) {
const arr = [];
res.data.list.forEach((item) => {
arr.push(item.title)
});
self.setData({
city_picker_list: arr,
cityList:res.data.list,
});
}
})
},
//切换城市
cityPickerChange(e) {
this.setData({
current_city: e.detail.value,
is_city_change: true
});
const lat = this.data.cityList[e.detail.value].latng.split(',')[1];
const lng = this.data.cityList[e.detail.value].latng.split(',')[0];
this.setData({latitude: lat, longitude: lng,addr:this.data.cityList[e.detail.value].title});
this.getTypeList();
},
//是否填写个人信息
getIsWrite() {
... ... @@ -270,6 +302,8 @@ Page({
self.setData({
is_showRelease: true //弹出 去答题弹框
});
}else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1){
wx.showToast({title:'等级不够,无法使用发布功能',icon:'none'})
}
},
//取消发布弹窗
... ... @@ -328,7 +362,7 @@ Page({
let params = {
lat: self.data.latitude,
lng: self.data.longitude,
addr: self.data.city, // 浮点型 必填 - - 用户位置名称
addr: self.data.is_city_change?self.data.addr:self.data.city, // 浮点型 必填 - - 用户位置名称
keyword: '', // 浮点型 非必填 - - 搜索关键字
score: self.data.score, // 浮点型 非必填 - - 排序(1智能排序,2最具人气,3距离最近)
startTime: self.data.start_time_date,// 浮点型 非必填 - - 筛选开始时间
... ... @@ -405,6 +439,7 @@ Page({
const self = this;
self.getLocation();
self.getIsWrite();
self.getCityList();
},
/**
... ...
... ... @@ -2,11 +2,13 @@
<view class="fix-box">
<view class="head">
<view class="position">
<picker class="picker" bindchange="cityPickerChange" value="{{current_city}}" range="{{city_picker_list}}" class="picker">
<view class="left">
<view class="iconfont icon-location"></view>
<text>北京</text>
<text>{{city_picker_list[current_city] || city}}</text>
<view class="iconfont icon-arrow-down"></view>
</view>
</picker>
<view class="right" bindtap="search">
<view class="input"></view>
<image src="../../images/search@2x.png"></image>
... ...