Commit 97d594c4 by 严立

Merge branch 'master' of http://120.77.182.185/yanl/mini-shimao

parents b58fec69 398defbc
......@@ -22,8 +22,8 @@ Page({
errorPhone: '',
errorSession: '',
errorQuantity: '',
canSubmit: false,
isSubmit: false,
// 接口参数
id: '',
},
......@@ -66,7 +66,6 @@ Page({
this.setData({
formInto: funcFormInto
})
this.inspectForm()
},
onQuantityAdd: function () {
......@@ -101,8 +100,6 @@ Page({
formInto: funcFormInto
})
this.inspectForm()
},
onSelectionDate: function (event) {
......@@ -116,18 +113,21 @@ Page({
})
let activityTime = this.data.activityTimes[this.data.activityIndex]
if (1 == activityTime.enroll*1) {
this.setData({
errorQuantity: '该场次已报名过,请选择其他场次',
})
} else if (0 == activityTime.residue*1) {
this.setData({
errorQuantity: '该场次人数已满,请选择其他场次',
})
} else {
this.setData({
errorQuantity: '',
})
}
this.inspectForm()
},
onServic: function () {
......@@ -155,6 +155,7 @@ Page({
},
bindNameInput: function (e) {
console.log(e.detail.value)
this.setData({
['formInto.name']: e.detail.value
})
......@@ -166,6 +167,42 @@ Page({
})
},
onInputBlur: function (e) {
let type = e.target.dataset.type
let value = e.detail.value
if (type == 'name') {
if (value === '') {
this.setData({
canSubmit: false,
errorName: '请输入姓名'
})
return false
} else {
this.setData({
errorName: ''
})
}
} else if (type == 'phone') {
if (value === '') {
this.setData({
canSubmit: false,
errorPhone: '请输入手机号码'
})
complete = false
} else if (value.length != 11) {
this.setData({
canSubmit: false,
errorPhone: '请输入11位手机号码'
})
complete = false
} else {
this.setData({
errorPhone: ''
})
}
}
},
//活动报名页
getEnrollView(){
var that = this
......@@ -196,28 +233,14 @@ Page({
},
inspectForm: function () {
let activityTime = this.data.activityTimes[this.data.activityIndex]
if (activityTime.residue*1 == 0) {
this.setData({
isSubmit: false,
errorSession: '',
})
return false
} else {
this.setData({
errorSession: '',
})
}
let complete = true
let formInto = this.data.formInto
if (formInto.name === '') {
this.setData({
isSubmit: false,
errorName: '请输入姓名'
})
return false
complete = false
} else {
this.setData({
errorName: ''
......@@ -226,44 +249,60 @@ Page({
if (formInto.phone === '') {
this.setData({
isSubmit: false,
errorPhone: '请输入手机号码'
})
return false
complete = false
} else if (formInto.phone.length != 11) {
this.setData({
isSubmit: false,
errorPhone: '请输入11位手机号码'
})
return false
complete = false
} else {
this.setData({
errorPhone: ''
})
}
if (formInto.quantity === 0) {
let activityTime = this.data.activityTimes[this.data.activityIndex]
if (1 == activityTime.enroll*1) {
this.setData({
errorQuantity: '该场次已报名过,请选择其他场次',
})
complete = false
} else if (0 == activityTime.residue*1) {
this.setData({
errorQuantity: '该场次人数已满,请选择其他场次',
})
complete = false
} else if (formInto.quantity === 0) {
this.setData({
isSubmit: false,
errorQuantity: '请设置报名人数'
})
return false
}
complete = false
} else {
this.setData({
errorQuantity: ''
})
}
this.setData({
isSubmit: true
canSubmit: complete
})
return true
return complete
},
// 活动报名
doActivityEnroll() {
if (!this.inspectForm()) {
if (!this.inspectForm() || this.data.isSubmit) {
return
}
this.setData({
isSubmit: true,
})
var activityTime = this.data.activityTimes[this.data.activityIndex]
let formInto = this.data.formInto
wx.lin.showToast({
......@@ -283,11 +322,15 @@ Page({
},
success: function(res) {
that.setData({
entryComplete: true
entryComplete: true,
isSubmit: false,
})
wx.lin.hideToast()
},
fail: function(err) {
that.setData({
isSubmit: false,
})
wx.lin.showToast({
icon: 'error',
title: err.msg,
......
......@@ -34,7 +34,7 @@
<text space="ensp">姓 名</text>
</view>
<view class="input-wrap row align-c">
<input maxlength="16" class="weui-input" placeholder-class="input-tip" placeholder="请输入名字" bindinput="bindNameInput"></input>
<input maxlength="16" class="weui-input" placeholder-class="input-tip" placeholder="请输入名字" data-type="name" bindblur="onInputBlur" bindinput="bindNameInput"></input>
</view>
</view>
<view class="form-error row align-c">
......@@ -47,7 +47,7 @@
<text space="ensp">手 机 号</text>
</view>
<view class="input-wrap row align-c">
<input maxlength="11" type="number" class="weui-input" placeholder-class="input-tip" placeholder="请输入手机号" bindinput="bindPhoneInput"></input>
<input maxlength="11" type="number" class="weui-input" placeholder-class="input-tip" placeholder="请输入手机号" data-type="phone" bindblur="onInputBlur" bindinput="bindPhoneInput"></input>
</view>
</view>
<view class="form-error row align-c">
......@@ -95,6 +95,6 @@
</view>
<view class="entry-operation">
<button class="{{isSubmit ? 'button' : 'button-disable'}} button row con-c align-c" bindtap="onSubmit">确认报名</button>
<button class="{{canSubmit ? 'button' : 'button-disable'}} button row con-c align-c" bindtap="onSubmit">确认报名</button>
</view>
</view>
\ No newline at end of file
......@@ -63,11 +63,18 @@
.entry-tip-title {
width: 434rpx;
height: 42rpx;
/* height: 42rpx; */
font-size: 30rpx;
font-weight: bold;
color: #15191F;
line-height: 42rpx;
display: -webkit-box;
overflow: hidden;
white-space: normal;
text-overflow: ellipsis;
word-wrap: break-word;
-webkit-line-clamp:2;
-webkit-box-orient: vertical;
}
.entry-tip-date {
......
......@@ -46,6 +46,13 @@
font-weight: bold;
color: #15191F;
line-height: 48rpx;
display: -webkit-box;
overflow: hidden;
white-space: normal;
text-overflow: ellipsis;
word-wrap: break-word;
-webkit-line-clamp:1;
-webkit-box-orient: vertical;
}
.item-date {
......
......@@ -17,8 +17,9 @@ Page({
errorPhone: '',
errorQuantity: '',
isSubmit: false,
canSubmit: false,
winQuota: false,
isSubmit: false,
// 预约入园剩余名额
total: 0,
......@@ -119,7 +120,7 @@ Page({
inspectForm: function () {
if (this.data.formName === '') {
this.setData({
isSubmit: false,
canSubmit: false,
errorName: '请输入姓名'
})
return
......@@ -131,13 +132,13 @@ Page({
if (this.data.formPhone === '') {
this.setData({
isSubmit: false,
canSubmit: false,
errorPhone: '请输入手机号码'
})
return
} else if (this.data.formPhone.length != 11) {
this.setData({
isSubmit: false,
canSubmit: false,
errorPhone: '请输入11位手机号码'
})
return
......@@ -149,7 +150,7 @@ Page({
if (this.data.formQuantity === 0) {
this.setData({
isSubmit: false,
canSubmit: false,
errorQuantity: '预约人数不能为 0'
})
return
......@@ -160,7 +161,7 @@ Page({
}
this.setData({
isSubmit: true
canSubmit: true
})
},
......@@ -170,10 +171,14 @@ Page({
app.login({
success: function() {
if (!that.data.isSubmit) {
that.inspectForm()
if (!that.data.canSubmit || that.data.isSubmit) {
// that.inspectForm()
return
}
that.setData({
isSubmit: true
})
wx.lin.showToast({
icon: 'loading',
......@@ -191,7 +196,8 @@ Page({
},
success: function(res) {
that.setData({
appointmentComplete: true
appointmentComplete: true,
isSubmit: false
})
wx.lin.hideToast()
},
......@@ -200,6 +206,9 @@ Page({
icon: 'error',
title: err.msg,
})
that.setData({
isSubmit: false
})
}
})
......
......@@ -95,7 +95,7 @@
</view>
<view class="appointment-operation">
<button class="{{isSubmit ? 'button' : 'button-disable'}} row con-c align-c" bindtap="onSubmit">确认预约</button>
<button class="{{canSubmit ? 'button' : 'button-disable'}} row con-c align-c" bindtap="onSubmit">确认预约</button>
<button class="button-plain row con-c align-c" bindtap="onServic">电话咨询</button>
</view>
</view>
......@@ -159,6 +159,6 @@
</view>
<view class="appointment-operation">
<button class="{{isSubmit ? 'button' : 'button-disable'}} row con-c align-c" bindtap="onSubmit">确认预约</button>
<button class="{{canSubmit ? 'button' : 'button-disable'}} row con-c align-c" bindtap="onSubmit">确认预约</button>
</view>
</view>
\ No newline at end of file
......@@ -25,11 +25,11 @@ Page({
// strategy 列表数据
strategyFirstItem: {
id: '1',
id: '',
index: 0,
image: 'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/home/strategy/strategy-00.jpg',
title: '凉爽一夏,在银湖湾听海踏浪',
date: '2020-07-10'
image: '',
title: '',
date: ''
},
strategy: [],
strategyList: [],
......
......@@ -87,17 +87,20 @@
</view>
<!-- 游客攻略 -->
<view class="strategy detail-item" bindtap="onFirstStrategyDetail">
<image src="./image/title-strategy.png"></image>
<view class="strategy-content">
<image class="background-image" src="{{strategyFirstItem.image}}" mode="aspectFit"></image>
<view class="operation col">
<text>{{strategyFirstItem.title}}</text>
<block wx:if="{{strategyOriginList.length > 0}}">
<view class="strategy detail-item" bindtap="onFirstStrategyDetail">
<image src="./image/title-strategy.png"></image>
<view class="strategy-content">
<image class="background-image" src="{{strategyFirstItem.image}}" mode="aspectFit"></image>
<view class="operation col">
<text>{{strategyFirstItem.title}}</text>
</view>
</view>
</view>
</view>
<view style="margin-bottom:10px">
<l-water-flow column-gap="14rpx" generic:l-water-flow-item="strategy-item" bind:linitemtap="onStrategyDetail"></l-water-flow>
</view>
<view style="margin-bottom:10px">
<l-water-flow column-gap="14rpx" generic:l-water-flow-item="strategy-item" bind:linitemtap="onStrategyDetail"></l-water-flow>
</view>
</block>
</view>
</view>
\ No newline at end of file
......@@ -85,9 +85,13 @@ Page({
if (this.data.islogin && this.data.isphone) {
console.log('授权及绑定成功')
} else {
wx.switchTab({
url: '../home/home',
})
console.log('back home')
// setTimeout(()=>{
// wx.switchTab({
// url: '/pages/home/home',
// })
// },300)
}
},
......
......@@ -11,10 +11,12 @@ Page({
nickName: '',
avatarUrl: '',
mask:false,
type:1, //判断是否是认证的了
type:0, //判断是否是认证的了
approveList:['园区门票优惠','餐厅价格优惠','SPA服务优惠','免费观看电影','无须预约入园','尽享多重特权'],
activityList: [],
appointmentList: [],
tabIn: false,
showIndex: 0,
},
//去认证
goApprove(){
......@@ -44,6 +46,7 @@ Page({
onLoad: function (options) {
},
onShow: function () {
let that = this
let mobile = wx.getStorageSync('mobile')
let nickName = wx.getStorageSync('nickName')
let avatarUrl = wx.getStorageSync('avatarUrl')
......@@ -53,19 +56,38 @@ Page({
nickName: nickName,
avatarUrl: avatarUrl,
})
app.login({
success: function(token) {
that.getMyActivityList()
that.getList()
that.getAuth()
}
})
let userType = wx.getStorageSync('userType')
that.setData({
type: userType == 1 ? 1 : 0,
})
} if (this.data.showIndex == 0) {
that.setData({
tabIn: false,
showIndex: 1,
})
wx.navigateTo({
url: '../login/login',
})
} else if (this.data.showIndex == 1) {
that.setData({
tabIn: false,
showIndex: 0,
})
wx.switchTab({
url: '/pages/home/home',
})
}
let userType = wx.getStorageSync('userType')
this.setData({
type: userType == 1 ? 1 : 0,
})
let that = this
app.login({
success: function(token) {
that.getMyActivityList()
that.getList()
that.getAuth()
}
})
},
/**
* 监听 TabBar 切换点击
......@@ -73,27 +95,30 @@ Page({
onTabItemTap: function (item) {
// console.log(item)
if (item.index == 3) {
let that = this
app.login({
success: function(token) {
let mobile = wx.getStorageSync('mobile')
let nickName = wx.getStorageSync('nickName')
let avatarUrl = wx.getStorageSync('avatarUrl')
let userType = wx.getStorageSync('userType')
if (mobile && nickName && avatarUrl) {
that.setData({
mobile: that.toHide(mobile),
nickName: nickName,
avatarUrl: avatarUrl,
type: userType == 1 ? 1 : 0,
})
} else {
wx.navigateTo({
url: '../login/login',
})
}
}
})
// this.setData({
// tabIn: true,
// })
// let that = this
// app.login({
// success: function(token) {
// let mobile = wx.getStorageSync('mobile')
// let nickName = wx.getStorageSync('nickName')
// let avatarUrl = wx.getStorageSync('avatarUrl')
// let userType = wx.getStorageSync('userType')
// if (mobile && nickName && avatarUrl) {
// that.setData({
// mobile: that.toHide(mobile),
// nickName: nickName,
// avatarUrl: avatarUrl,
// type: userType == 1 ? 1 : 0,
// })
// } else {
// wx.navigateTo({
// url: '../login/login',
// })
// }
// }
// })
}
},
......
......@@ -16,13 +16,18 @@ Page({
height:0,
data:[],
active:0,
pageNo: 1,
pageSize: 10,
loading: false,
moreData: true,
},
chageNav(e){
let index = e.currentTarget.dataset.index
this.setData({
active: index
active: index,
pageNo: 1,
})
this.getMyActivityList(index)
this.getMyActivityList()
},
activityDetail(e){
wx.navigateTo({
......@@ -36,7 +41,7 @@ Page({
this.setData({
height: wx.getSystemInfoSync().windowHeight, //获取屏幕的高度
})
this.getMyActivityList(this.data.active)
this.getMyActivityList()
},
/**
......@@ -89,9 +94,9 @@ Page({
},
// 我的活动
getMyActivityList(index) {
getMyActivityList() {
let state = ''
switch (index) {
switch (Number(this.data.active)) {
case 0: state = ''; break;
case 1: state = 0; break;
case 2: state = 1; break;
......@@ -100,9 +105,12 @@ Page({
var that = this
app.login({
success: function() {
that.setData({
loading: true
})
app.wxRequest({
url: '/api/v1/activity/getMyActivityList',
data: { activeState: state, pageSize: 10, pageNo: 1 },
data: { activeState: state, pageSize: that.data.pageSize, pageNo: that.data.pageNo },
success: function(res) {
let list = res.data.list
let tmpArr = []
......@@ -124,13 +132,33 @@ Page({
}
tmpArr.push(obj)
})
if (that.data.pageNo != 1) {
tmpArr = that.data.data.concat(tmpArr)
}
that.setData({
data: tmpArr,
loading: false,
})
that.setData({
data: tmpArr
moreData: (that.data.data.length >= res.data.count*1) ? false: true
})
},
fail: function(err) {
that.setData({
loading: false
})
}
})
}
})
},
},
onReachBottom: function() {
if (this.data.loading || !this.data.moreData) {
return
}
this.data.pageNo += 1
this.getMyActivityList()
},
})
\ No newline at end of file
......@@ -11,7 +11,7 @@
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="姓名" is-link="{{false}}">
<view slot="right-section">
<input style="text-align:right;" placeholder="请填写姓名" placeholder-class="phone" value="{{nickName}}" data-type="name" bindblur="onInputBlur"/>
<input maxlength="10" style="text-align:right;" placeholder="请填写姓名" placeholder-class="phone" value="{{nickName}}" data-type="name" bindblur="onInputBlur"/>
</view>
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="性别" is-link="{{false}}">
......@@ -32,7 +32,7 @@
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="地址" is-link="{{false}}">
<view slot="right-section">
<input style="text-align:right;" placeholder="请填写地址" placeholder-class="phone" value="{{address}}" data-type="address" bindblur="onInputBlur"/>
<input maxlength="30" style="text-align:right;" placeholder="请填写地址" placeholder-class="phone" value="{{address}}" data-type="address" bindblur="onInputBlur"/>
</view>
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="手机号" is-link="{{false}}">
......
......@@ -240,9 +240,9 @@ Page({
url: '/api/v1/activity/getList',
data: {
listType: type,
pageSize: 20,
pageSize: 10,
pageNo: 1,
tagId: '3c95ab1afb3a4d899ac25242c3d089ea',
tagId: '101',
},
success: function(res) {
var tmpArr = [];
......
......@@ -106,6 +106,44 @@ Page({
})
},
shopDetail(e) {
let datasetId = e.currentTarget.dataset.id
let id = ''
if (datasetId == '21a0cbbd39604380bc46fba38ac5fb63') {
// 海错图展馆
id = 1
} else if (datasetId == 'b8f04379bf164b7f8bca69be14146a17') {
// 拾光花坊
id = 2
} else if (datasetId == 'd8922a8f759245d4949b62693099edb5') {
// 元养水韵SPA馆
id = 3
} else if (datasetId == 'd0e5ff414f794e15bc33c4e11f5356a8') {
// 原味舒食
id = 4
} else if (datasetId == '81078c007c034d46b7dfe59935d84f7a') {
// 原野MOJITO
id = 5
} else if (datasetId == '29e79743f0f94e5eb726e0ebdfe64248') {
// 星空影院
id = 6
} else if (datasetId == '559d980e9eaf4459883fb3a556d24347') {
// 儿童营地信息
wx.navigateTo({
url: '/pages/campsite-mirror/campsite-mirror',
})
} else if (datasetId == 'c0a2d795a7a54dcd9459dd1b969c1771') {
// 住宿信息
}
if (id != '') {
wx.navigateTo({
url: '/pages/shop-detail/shop-detail?id=' + id
})
}
},
// 攻略详情文中提及
getParksByParkIds(parkIds) {
if (!parkIds) {
......
......@@ -32,23 +32,22 @@
<text>{{date}}</text>
</view>
</view>
<view class="relation" wx:if="{{relation.length>0}}">
<view class="relation-title">
<text>文中提及</text>
</view>
<block wx:for="{{relation}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="relation-item row con-b">
<image mode="widthFix" src="{{item.cover}}"></image>
<view class="relation-item-info col">
<text>{{item.title}}</text>
<text>{{item.time}}</text>
<text>{{item.price}}</text>
</view>
<view class="relation-item-more row align-c">
<image src="/image/more.png"></image>
</view>
<view class="relation" wx:if="{{relation.length>0}}">
<view class="relation-title">
<text>文中提及</text>
</view>
</block>
<block wx:for="{{relation}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="relation-item row con-b" data-id="{{item.id}}" bindtap="shopDetail">
<image mode="widthFix" src="{{item.cover}}"></image>
<view class="relation-item-info col">
<text>{{item.title}}</text>
<text>{{item.time}}</text>
<text>{{item.price}}</text>
</view>
<view class="relation-item-more row align-c">
<image src="/image/more.png"></image>
</view>
</view>
</block>
</view>
</view>
......@@ -44,7 +44,7 @@
}
.detail-date {
width: 152rpx;
/* width: 152rpx; */
height: 40rpx;
margin: 64rpx 0 32rpx 0;
font-size: 26rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment