Commit 3ce1a0e7 by TengFengLian

修复测试问题

parent 55a22dc5
...@@ -5,7 +5,7 @@ App({ ...@@ -5,7 +5,7 @@ App({
refreshToken: '', refreshToken: '',
userInfo: null, userInfo: null,
baseUrl: 'https://sm-web.meiqicloud.com',//测试 baseUrl: 'https://sm-web.meiqicloud.com',//测试
// baseUrl: 'https://zmj.zhengmao.net',//生产 // baseUrl: 'https://smbhyh-web.meiqicloud.com',//生产
debug: true, debug: true,
}, },
......
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--picker/picker.wxml-->
<view class="full-box {{isOpen?'cur':''}}">
<!--<view class="modal" bindtap="tapModal"></view>-->
<view class="picker">
<view class="picker-header" style="{{pickerHeaderStyle}}">
<view bindtap="cancle" >
<text style="{{cancelStyle}}">{{cancelText}}</text>
</view>
<text style="{{titleStyle}}">{{titleText}}</text>
<view bindtap="sure">
<text style="{{sureStyle}}">{{sureText}}</text>
</view>
</view>
<picker-view
value="{{value}}"
class="picker-content"
bindpickstart="_bindpickstart"
bindchange="_bindChange"
bindpickend="_bindpickend"
indicator-style="{{indicatorStyle}}"
mask-style="{{maskStyle}}"
>
<picker-view-column wx:for="{{columnsData}}" wx:key="{{index}}">
<view wx:for="{{item}}" wx:for-item="itemIn" class="picker-line" wx:key="{{index}}">
<text class="line1" style="{{chooseItemTextStyle}}">{{isUseKeywordOfShow?itemIn[keyWordsOfShow]:itemIn}}</text>
</view>
</picker-view-column>
</picker-view>
</view>
</view>
/* picker/picker.wxss */
.full-box{
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 9999;
opacity: 0;
background:rgba(0,0,0,.4);
transition:all .4s ease-in-out 0;
pointer-events:none;
}
.full-box.cur{
opacity:1;
pointer-events:auto
}
.modal{
position: absolute;
width: 100%;
height: 50%;
bottom:-50%;
left: 0;
background: transparent;
transition:all .4s ease-in-out 0;
}
.picker{
position: absolute;
width: 100%;
height: 235px;
bottom: -235px;
left: 0;
background: #fff;
display: flex;
flex-direction: column;
transition:all .4s ease-in-out 0;
}
.cur .picker{
bottom:0;
}
.cur .modal{
bottom:50%;
}
.picker-line{
display: flex;
justify-content: center;
align-items: center;
}
.picker-header {
height: 20%;
box-sizing: border-box;
padding: 0 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #eeeeee;
}
.picker-header view {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.picker-header view text{
font-size: 36rpx;
}
.picker-content {
flex-grow: 1;
}
.line1{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
lines:1
}
\ No newline at end of file
function _typeof(obj) {
return Object.prototype.toString.call(obj).slice(8, -1).toLowerCase();
}
function isString(obj) { //是否字符串
return _typeof(obj) === 'string'
}
function isPlainObject(obj) {
return _typeof(obj) === 'object';
}
module.exports = {
isString,
isPlainObject
}
...@@ -18,6 +18,10 @@ Page({ ...@@ -18,6 +18,10 @@ Page({
activityTimes: [{beginTime:'',endTime:'', date:''}],// 活动场次 activityTimes: [{beginTime:'',endTime:'', date:''}],// 活动场次
activityIndex: 0, activityIndex: 0,
isShow: false,
listData: [],
errorName: '', errorName: '',
errorPhone: '', errorPhone: '',
errorSession: '', errorSession: '',
...@@ -102,10 +106,15 @@ Page({ ...@@ -102,10 +106,15 @@ Page({
}, },
onSelectionDate: function (event) { showPicker() {
console.log(event) this.setData({
isShow: true
})
},
sureCallBack: function (event) {
this.setData({ this.setData({
activityIndex: event.detail.value*1 activityIndex: event.detail.choosedIndexArr,
isShow: false
}) })
// 切换报名场次更新重置报名人数 // 切换报名场次更新重置报名人数
this.setData({ this.setData({
...@@ -129,6 +138,11 @@ Page({ ...@@ -129,6 +138,11 @@ Page({
} }
}, },
cancleCallBack() {
this.setData({
isShow: false
})
},
onServic: function () { onServic: function () {
wx.makePhoneCall({ wx.makePhoneCall({
...@@ -213,13 +227,16 @@ Page({ ...@@ -213,13 +227,16 @@ Page({
var response = res.data var response = res.data
if (response.activityTimes.length > 0) { if (response.activityTimes.length > 0) {
var activityTimes = [] var activityTimes = []
var pickerList = []
response.activityTimes.forEach(item => { response.activityTimes.forEach(item => {
var obj = item var obj = item
obj.date = item.beginTime + ' - ' + item.endTime obj.date = item.beginTime + ' - ' + item.endTime
activityTimes.push(obj) activityTimes.push(obj)
pickerList.push(obj.date)
}) })
that.setData({ that.setData({
activityTimes: activityTimes, activityTimes: activityTimes,
listData: [pickerList],
}) })
} }
......
{ {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"usingComponents": {} "usingComponents": {
"picker":"../../component/picker/picker"
}
} }
\ No newline at end of file
...@@ -63,10 +63,13 @@ ...@@ -63,10 +63,13 @@
<!-- <picker class="input-picker" mode="date" value="{{date}}" start="{{appointmentDate}}" bindchange="onSelectionDate"> <!-- <picker class="input-picker" mode="date" value="{{date}}" start="{{appointmentDate}}" bindchange="onSelectionDate">
<view class="picker">{{formInto.date}}</view> <view class="picker">{{formInto.date}}</view>
</picker> --> </picker> -->
<picker class="input-picker" mode="selector" range-key="{{'date'}}" range="{{activityTimes}}" bindchange="onSelectionDate"> <!-- <picker class="input-picker" mode="selector" range-key="{{'date'}}" range="{{activityTimes}}" bindchange="onSelectionDate">
<!-- item.beginTime + ' - ' + item.endTime -->
<text class="picker">{{activityTimes[activityIndex].beginTime}}</text> <text class="picker">{{activityTimes[activityIndex].beginTime}}</text>
</picker> </picker>
<image class="input-icon" src="../../image/more.png"></image> -->
<view class="input-picker" bindtap="showPicker">
<text class="picker">{{activityTimes[activityIndex].beginTime}}</text>
</view>
<image class="input-icon" src="../../image/more.png"></image> <image class="input-icon" src="../../image/more.png"></image>
</view> </view>
</view> </view>
...@@ -74,6 +77,19 @@ ...@@ -74,6 +77,19 @@
<text hidden="{{errorSession ? false : true}}">{{errorSession}}</text> <text hidden="{{errorSession ? false : true}}">{{errorSession}}</text>
</view> </view>
<picker
isShowPicker="{{isShow}}"
bindsure="sureCallBack"
bindcancle="cancleCallBack"
scrollType="normal"
listData="{{listData}}"
indicatorStyle="height:47rpx"
titleText=""
sureStyle="color:#26AB28"
cancelStyle="color:#888888"
chooseItemTextStyle="font-size: 24rpx;"
></picker>
<view class="row align-c"> <view class="row align-c">
<view class="input-label row align-c"> <view class="input-label row align-c">
<text space="ensp">报名人数</text> <text space="ensp">报名人数</text>
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
</view> </view>
<view class="banner-notice row align-c"> <view class="banner-notice row align-c">
<image src="./image/inform.png"></image> <image src="./image/inform.png" bindtap="onNotice"></image>
<text>最新动态</text> <text bindtap="onNotice">最新动态</text>
<!-- <text>温泉公寓现已接受预定</text> --> <!-- <text>温泉公寓现已接受预定</text> -->
<l-notice-bar <l-notice-bar
show="{{true}}" show="{{true}}"
......

26.2 KB | W: | H:

3.47 KB | W: | H:

pages/mine/image/avatar.png
pages/mine/image/avatar.png
pages/mine/image/avatar.png
pages/mine/image/avatar.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -9,20 +9,14 @@ Page({ ...@@ -9,20 +9,14 @@ Page({
data: { data: {
mobile: '', mobile: '',
nickName: '', nickName: '',
avatarUrl: '', avatarUrl: '/pages/mine/image/avatar.png',
stateTest: '去认证',
mask:false, mask:false,
type:0, //判断是否是认证的了 type:0, //判断是否是认证的了
approveList:['园区门票优惠','餐厅价格优惠','SPA服务优惠','免费观看电影','无须预约入园','尽享多重特权'], approveList:['园区门票优惠','餐厅价格优惠','SPA服务优惠','免费观看电影','无须预约入园','尽享多重特权'],
activityList: [], activityList: [],
appointmentList: [], appointmentList: [],
tabIn: false, isRegister: false, // 是否注册
showIndex: 0,
},
//去认证
goApprove(){
wx.navigateTo({
url: '../ownerCertification/ownerCertification',
})
}, },
close(){ close(){
this.setData({ this.setData({
...@@ -51,10 +45,11 @@ Page({ ...@@ -51,10 +45,11 @@ Page({
let nickName = wx.getStorageSync('nickName') let nickName = wx.getStorageSync('nickName')
let avatarUrl = wx.getStorageSync('avatarUrl') let avatarUrl = wx.getStorageSync('avatarUrl')
if (mobile && nickName && avatarUrl) { if (mobile && nickName && avatarUrl) {
this.setData({ that.setData({
mobile: this.toHide(mobile), mobile: that.toHide(mobile),
nickName: nickName, nickName: nickName,
avatarUrl: avatarUrl, avatarUrl: avatarUrl,
isRegister: true,
}) })
app.login({ app.login({
...@@ -68,60 +63,60 @@ Page({ ...@@ -68,60 +63,60 @@ Page({
that.setData({ that.setData({
type: userType == 1 ? 1 : 0, type: userType == 1 ? 1 : 0,
}) })
} else if (this.data.showIndex == 0) { } else {
that.setData({ that.setData({
tabIn: false, isRegister: false,
showIndex: 1,
}) })
}
},
// 登录注册页
checkRegister() {
if (this.data.isRegister) {
return true
} else {
wx.navigateTo({ wx.navigateTo({
url: '../login/login', url: '../login/login',
}) })
} else if (this.data.showIndex == 1) { return false
that.setData({
tabIn: false,
showIndex: 0,
})
wx.switchTab({
url: '/pages/home/home',
})
} }
},
//去认证
goApprove(){
if (this.checkRegister()) {
wx.navigateTo({
url: '../ownerCertification/ownerCertification',
})
}
},
myActivity() {
if (this.checkRegister()) {
wx.navigateTo({
url: "../myActivity/myActivity",
})
}
},
myAppointment() {
if (this.checkRegister()) {
wx.navigateTo({
url: '../myAppointment/myAppointment',
})
}
}, },
/**
* 监听 TabBar 切换点击 customerService() {
*/ if (this.checkRegister()) {
onTabItemTap: function (item) { wx.navigateTo({
// console.log(item) url: "../customerService/customerService",
if (item.index == 3) { })
// 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',
// })
// }
// }
// })
} }
}, },
//我的活动详情
activityDetail(e){ activityDetail(e){
wx.navigateTo({ wx.navigateTo({
url: '../activityDetail/activityDetail?enrollid='+e.currentTarget.dataset.enrollid, url: '../activityDetail/activityDetail?enrollid='+e.currentTarget.dataset.enrollid,
...@@ -136,9 +131,11 @@ Page({ ...@@ -136,9 +131,11 @@ Page({
//点击前往修改页面 //点击前往修改页面
goMyInfo(){ goMyInfo(){
if (this.checkRegister()) {
wx.navigateTo({ wx.navigateTo({
url: '../myInfo/myInfo', url: '../myInfo/myInfo',
}) })
}
}, },
// 我的活动 // 我的活动
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
<view class="mine" wx:if="{{type == 0}}"> <view class="mine" wx:if="{{type == 0}}">
<image class="background-image" src="./image/mine.png"></image> <image class="background-image" src="./image/mine.png"></image>
<view class="row align-c"> <view class="row align-c">
<view class="mine-avatar"> <view class="mine-avatar" bindtap="checkRegister">
<l-avatar size="112" src="{{avatarUrl}}"/> <l-avatar size="112" src="{{avatarUrl}}"/>
</view> </view>
<view class="mine-info col">
<view wx:if="{{isRegister}}" class="mine-info col">
<view class="row align-c"> <view class="row align-c">
<text>{{nickName}}</text> <text>{{nickName}}</text>
<image src="./image/inform.png" bindtap="goMyInfo"></image> <image src="./image/inform.png" bindtap="goMyInfo"></image>
...@@ -16,6 +17,12 @@ ...@@ -16,6 +17,12 @@
<text>{{mobile}}</text> <text>{{mobile}}</text>
</view> </view>
</view> </view>
<view wx:else class="mine-info col">
<view class="row align-c" bindtap="checkRegister">
<text style="color:#333333;font-weight:500;">登录/注册</text>
</view>
</view>
</view> </view>
</view> </view>
...@@ -55,7 +62,7 @@ ...@@ -55,7 +62,7 @@
</view> </view>
<view class="menu"> <view class="menu">
<l-list url="../myActivity/myActivity" l-content-class="menu-title" title="我的活动"></l-list> <l-list l-content-class="menu-title" title="我的活动" bind:lintap="myActivity"></l-list>
<!-- 我的活动 --> <!-- 我的活动 -->
<view class="my-activities" wx:if="{{activityList.length > 0}}"> <view class="my-activities" wx:if="{{activityList.length > 0}}">
<view class="my-activities-item" data-enrollid="{{item.enrollId}}" wx:for="{{activityList}}" wx:for-index="index" wx:for-item="item" wx:key="index" bindtap="activityDetail"> <view class="my-activities-item" data-enrollid="{{item.enrollId}}" wx:for="{{activityList}}" wx:for-index="index" wx:for-item="item" wx:key="index" bindtap="activityDetail">
...@@ -69,7 +76,7 @@ ...@@ -69,7 +76,7 @@
</view> </view>
<view class="my-activities-item"></view> <view class="my-activities-item"></view>
</view> </view>
<l-list l-content-class="menu-title" title="我的预约" url="../myAppointment/myAppointment"></l-list> <l-list l-content-class="menu-title" title="我的预约" bind:lintap="myAppointment"></l-list>
<!-- 我的预约 --> <!-- 我的预约 -->
<view class="my-activities" wx:if="{{appointmentList.length > 0}}"> <view class="my-activities" wx:if="{{appointmentList.length > 0}}">
<view class="my-activities-item" wx:for="{{appointmentList}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <view class="my-activities-item" wx:for="{{appointmentList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
...@@ -86,7 +93,7 @@ ...@@ -86,7 +93,7 @@
</view> </view>
<view class="my-activities-item"></view> <view class="my-activities-item"></view>
</view> </view>
<l-list l-content-class="menu-title" title="客服中心" url="../customerService/customerService"></l-list> <l-list l-content-class="menu-title" title="客服中心" bind:lintap="customerService"></l-list>
</view> </view>
</view> </view>
......
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