作者 wumengyu

限制截止时间为整数,首页切换城市后传入探店列表中,添加答题之后的弹框,手机号加验证

... ... @@ -85,7 +85,12 @@ Page({
},
//输入截止时间
inputOverTime(e) {
this.setData({over_time:e.detail.value})
this.setData({over_time:e.detail.value});
if(this.data.over_time.indexOf('.') !== -1) {
wx.showToast({title:'截止时间为整数',icon:'none'});
this.setData({over_time:''});
}
console.log(this.data.over_time.indexOf('.') !== -1);
},
//获取分类
getType() {
... ...
... ... @@ -90,7 +90,7 @@
</view>
<view class="time-limit">
<text>时限 活动开始前</text>
<input type="number" bindinput="inputOverTime" value=""/>
<input type="number" bindinput="inputOverTime" value="{{over_time}}"/>
<text>小时 停止拼单</text>
</view>
</view>
... ...
... ... @@ -111,6 +111,7 @@ Page({
});
console.log('total_score', total_score);
this.setData({score: total_score});
wx.setStorageSync('score', total_score);
let url = '/portal/Send/answer';
let params = {
token: wx.getStorageSync('token'),
... ...
... ... @@ -28,6 +28,10 @@ Page({
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
//关闭金火柴勋章弹框
close() {
this.setData({show_gold_modal:false,show_normal_modal:false})
},
//获取城市列表
getCityList() {
const self = this;
... ... @@ -50,7 +54,7 @@ Page({
cityPickerChange(e) {
this.setData({
current_city: e.detail.value,
// is_sex_change: true
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];
... ... @@ -112,8 +116,16 @@ Page({
},
//查看更多
goMore() {
let city = null;
if(this.data.is_city_change) {
city = JSON.stringify({
name:this.data.cityList[this.data.current_city].title,
lat: this.data.lat,
lng: this.data.lng,
})
}
wx.navigateTo({
url: '/pages/index/tandian-list/tandian-list',
url: '/pages/index/tandian-list/tandian-list?city=' + city,
})
},
//进入拼餐详情
... ... @@ -288,7 +300,14 @@ Page({
});
// };
}
})
});
// wx.setStorageSync('score',30);
console.log('score',wx.getStorageSync('score'));
if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')>=80) {
self.setData({show_gold_modal:true})
}else if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')<80) {
self.setData({show_normal_modal:true})
}
},
//获取首页内容
getIndex(res) {
... ... @@ -377,4 +396,32 @@ Page({
this.setData({hidden_top: false})
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let self = this;
self.setData({show_gold_modal:false});
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
title: '火柴西路', // 默认是小程序的名称(可以写slogan等)
path: '', // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') {
}
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
}
}
},
});
... ...
... ... @@ -166,4 +166,28 @@
</view>
</view>
<view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
<!--分数>=80弹框-->
<view class="input-box score-box" wx:if="{{show_gold_modal}}" catchtouchmove="disableScroll">
<image class="sorry-img gold-img" src="../../images/gold@2x.png"></image>
<view class="title text">恭喜您</view>
<view class="title text">获得首批入场卷</view>
<view class="tips text">并得到一枚金火柴等级勋章</view>
<view class="tips share-text">将喜悦分享给好友</view>
<view class="share-box">
<view class="answer-btn close" catchtap="close">完成</view>
<button class="answer-btn share" open-type="share">去分享</button>
</view>
</view>
<view class="modal_box" wx:if="{{show_gold_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
<!--分数<80弹框-->
<view class="input-box score-box normal-box" wx:if="{{show_normal_modal}}" catchtouchmove="disableScroll">
<image class="sorry-img img" src="../../images/achieve-answer-img@2x.png"></image>
<view class="title text margin">恭喜您获得入场卷</view>
<view class="title text margin">等待开放权限</view>
<view class="answer-btn close close-btn" catchtap="close">随便看看</view>
</view>
<view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
</view>
... ...
... ... @@ -526,7 +526,7 @@ swiper {
top: 48%;
left: 50%;
transform: translate(-50%,-50%);
padding: 46rpx 88rpx;
padding: 46rpx 78rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
... ... @@ -592,3 +592,61 @@ swiper {
color: #ffffff;
font-size: 26rpx;
}
.score-box {
height:696rpx;
/* top:68%; */
background-image: url('http://pk86rwhci.bkt.clouddn.com/dsdfhgfhfdh@2x.png');
background-repeat: no-repeat;
-webkit-background-size: 100%;
background-size: 100%;
background-color: transparent;
border-radius: 0;
/* top:29%; */
}
.score-box .gold-img {
width: 212rpx;
height: 212rpx;
margin-top: -56rpx;
margin-bottom: 0;
}
.share-box {
display: flex;
align-items: center;
justify-content: space-between;
}
.share-box .close, .share-box .share {
width: 200rpx;
height: 66rpx;
margin-top: 0;
}
.share-box .close {
margin-right: 20rpx;
}
.share-box .share {
padding: 0;
}
.share-box .share::after {
border:0;
}
.score-box .share-text {
margin: 56rpx 0 26rpx 0;
}
.score-box .text {
margin-bottom: 10rpx;
font-size: 36rpx;
color:#343434;
}
.score-box .img {
width: 106rpx;
height: 106rpx;
}
.margin {
margin-top: 30rpx;
}
.normal-box {
height: 540rpx;
background-image: url('http://pk86rwhci.bkt.clouddn.com/safsfdsghk@2x.png');
}
.normal-box .close-btn {
margin-top: 52rpx;
}
\ No newline at end of file
... ...
... ... @@ -20,6 +20,7 @@ Page({
list: [],
page_number:1,
hasMore:true,
city_params:'',
},
goPostDetail(e) {
const id = +e.currentTarget.dataset.id;
... ... @@ -143,6 +144,12 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('options',options);
if(options.city !== 'null') {
this.setData({city_params:JSON.parse(options.city)});
console.log('load里的调用');
// this.getTypeList();
}
},
... ... @@ -158,9 +165,9 @@ Page({
console.log('city',self.data.city);
let url = '/portal/Index/meal';
let params = {
lat: self.data.latitude,
lng: self.data.longitude,
addr: self.data.city, // 浮点型 必填 - - 用户位置名称
lat: self.data.city_params !== ''?self.data.city_params.lat:self.data.latitude,
lng: self.data.city_params !== ''?self.data.city_params.lng:self.data.longitude,
addr: self.data.city_params !== ''?self.data.city_params.name:self.data.city, // 浮点型 必填 - - 用户位置名称
keyword: '', // 浮点型 非必填 - - 搜索关键字
score: self.data.score, // 浮点型 非必填 - - 排序(1智能排序,2最具人气,3距离最近)
startTime: self.data.start_time_date,// 浮点型 非必填 - - 筛选开始时间
... ... @@ -222,7 +229,10 @@ Page({
*/
onShow: function () {
const self = this;
// if(self.data.city !== 'null') {
// console.log('show里的调用');
self.getLocation();
// }
},
/**
... ...
... ... @@ -74,7 +74,11 @@ Page({
},
//输入截止时间
inputOverTime(e) {
this.setData({over_time:e.detail.value})
this.setData({over_time:e.detail.value});
if(this.data.over_time.indexOf('.') !== -1) {
wx.showToast({title:'截止时间为整数',icon:'none'});
this.setData({over_time:''});
}
},
//获取分类
getType() {
... ...
... ... @@ -89,7 +89,7 @@
</view>
<view class="time-limit">
<text class="limit-title">时限 开餐前</text>
<input type="number" bindinput="inputOverTime" value=""/>
<input type="number" bindinput="inputOverTime" value="{{over_time}}"/>
<text>小时 停止拼餐</text>
</view>
</view>
... ...
... ... @@ -16,6 +16,7 @@ Page({
phone_number:'',
phone_number_params:'',
introduce:'',
is_change:false,
},
//选择性别
sexPickerChange(e) {
... ... @@ -88,7 +89,18 @@ Page({
this.setData({
currentnum: len,
introduce: textcontent,
})
});
console.log('textcontent', textcontent);
if(this.data.current_sex !== undefined &&
this.data.country !== '' &&
this.data.city !== '' &&
this.data.phone_number !== '' &&
!this.data.is_wrong_phone &&
this.data.introduce !== '') {
this.setData({is_change:true});
}else {
this.setData({is_change:false});
}
}
},
//保存
... ...
... ... @@ -38,7 +38,7 @@
<view class='word_num'>{{currentnum}}/{{maxlength}}</view>
</view>
</view>
<view class="complete" bindtap="submit">
<view class="complete {{!is_change?'gray':''}}" bindtap="submit">
<view class="btn">完成</view>
</view>
</view>
... ...
... ... @@ -95,3 +95,7 @@
left:0;
bottom:0;
}
.gray {
background-color: #CCCCCC;
color: #ffffff;
}
\ No newline at end of file
... ...
<!--pages/my/my.wxml-->
<view class="head-box">
<view wx:if="{{isLogin}}" bindtap="EditUserInfo">
<view class="head"></view>
<view class="head" style="background-image: {{user.pic!==''?user.pic:''}}"></view>
<!--<image src="../../images/user-img@2x.png" class="user-img"></image>-->
<image src="{{user.pic}}" class="user-img"></image>
<view class="left">
... ...