Commit b17c5786 by TengFengLian

update

parent 124ee481
App({
globalData: {
token: '',
refreshToken: '',
userInfo: null,
baseUrl: 'https://sm-web.meiqicloud.com',//测试
// baseUrl: 'https://zmj.zhengmao.net',//生产
......@@ -29,7 +31,7 @@ App({
wxRequest(obj) {
let that = this
var token = wx.getStorageSync('token')
var token = that.globalData.token
var param = obj.data ? JSON.stringify(obj.data) : ""
var header = obj.header ? obj.header : { 'token': token || '', }
......@@ -87,7 +89,8 @@ App({
},
login(obj) {
var token = wx.getStorageSync('token')
let token = this.globalData.token
let that = this
if (token) {
if (obj.success) {
obj.success(token)
......@@ -101,10 +104,10 @@ App({
url: '/api/v1/login/getSmallSession?code='+res.code,
method: 'GET',
success: function (res) {
that.globalData.token = res.data.token
that.globalData.refreshToken = res.data.refreshToken
wx.setStorageSync('expires_in', res.data.expires_in)
wx.setStorageSync('openid', res.data.openid)
wx.setStorageSync('token', res.data.token)
wx.setStorageSync('refreshToken', res.data.refreshToken)
wx.setStorageSync('session_key', res.data.session_key)
wx.setStorageSync('mobile', res.data.mobile)
wx.setStorageSync('nickName', res.data.nickName)
......@@ -144,18 +147,19 @@ App({
},
refreshToken(obj) {
let that = this
this.wxRequest({
url: '/api/v1/login/refreshToken',
header: {
token: wx.getStorageSync('token'),
refreshToken: wx.getStorageSync('refreshToken')
token: this.globalData.token,
refreshToken: this.globalData.refreshToken
},
success: function(res) {
let token = res.data.token
let refreshToken = res.data.refreshToken
wx.setStorageSync('token', token)
wx.setStorageSync('refreshToken', refreshToken)
that.globalData.token = token
that.globalData.refreshToken = refreshToken
if (obj.success) {
obj.success()
......
......@@ -47,7 +47,8 @@
"l-arc-popup":"../miniprogram_npm/lin-ui/arc-popup/index",
"l-collapse":"../miniprogram_npm/lin-ui/collapse/index",
"l-collapse-item":"../miniprogram_npm/lin-ui/collapse-item/index",
"l-textarea":"../miniprogram_npm/lin-ui/textarea/index"
"l-textarea":"../miniprogram_npm/lin-ui/textarea/index",
"l-notice-bar":"../miniprogram_npm/lin-ui/notice-bar/index"
},
"window": {
"navigationStyle": "custom",
......
......@@ -12,10 +12,10 @@ Page({
quantity: 0,
// date: '',
},
activityImage: './image/entry-1.png',
activityImage: '',
activityName: '',
activeTime: '',
activityTimes: [{beginTime:'',endTime:''}],// 活动场次
activityTimes: [{beginTime:'',endTime:'', date:''}],// 活动场次
activityIndex: 0,
errorName: '',
......@@ -70,9 +70,14 @@ Page({
},
onQuantityAdd: function () {
let funcFormInto = this.data.formInto
let activityTime = this.data.activityTimes[this.data.activityIndex]
if (activityTime.date == '') {
this.setData({
errorQuantity: '暂无活动场次',
})
return
}
if (1 == activityTime.enroll*1) {
this.setData({
errorQuantity: '该场次已报名过,请选择其他场次',
......@@ -110,6 +115,17 @@ Page({
['formInto.quantity']: 0
})
let activityTime = this.data.activityTimes[this.data.activityIndex]
if (1 == activityTime.enroll*1) {
this.setData({
errorQuantity: '该场次已报名过,请选择其他场次',
})
} else {
this.setData({
errorQuantity: '',
})
}
this.inspectForm()
},
......@@ -158,6 +174,7 @@ Page({
data: { id: that.data.id },
success: function(res) {
var response = res.data
if (response.activityTimes.length > 0) {
var activityTimes = []
response.activityTimes.forEach(item => {
var obj = item
......@@ -165,10 +182,14 @@ Page({
activityTimes.push(obj)
})
that.setData({
activityTimes: activityTimes,
})
}
that.setData({
activityImage: response.cover,
activityName: response.name,
activeTime: response.activeDate + ' ' + response.activeTime,
activityTimes: activityTimes,
})
}
})
......
......@@ -65,7 +65,7 @@
</picker> -->
<picker class="input-picker" mode="selector" range-key="{{'date'}}" range="{{activityTimes}}" bindchange="onSelectionDate">
<!-- item.beginTime + ' - ' + item.endTime -->
<text class="picker">{{activityTimes[activityIndex].beginTime + '\n' + activityTimes[activityIndex].endTime}}</text>
<text class="picker">{{activityTimes[activityIndex].beginTime}}</text>
</picker>
<image class="input-icon" src="../../image/more.png"></image>
</view>
......
......@@ -100,7 +100,7 @@ Page({
id: item.id,
cover: item.cover,
title: item.name,
date: item.activeDate + ' ' + item.activeTime,//'6月30日-7月12日 10:00-12:00',
date: item.activeDate,//'6月30日-7月12日 10:00-12:00',
describe: item.summary,
beginDate: item.activeDate.split('-')[0],
}
......
......@@ -64,6 +64,13 @@
font-size: 26rpx;
color: #959DA9;
line-height: 36rpx;
display: -webkit-box;
overflow: hidden;
white-space: normal;
text-overflow: ellipsis;
word-wrap: break-word;
-webkit-line-clamp:2;
-webkit-box-orient: vertical;
}
.item-cover image {
......
......@@ -16,6 +16,7 @@ Page({
mobile: '',
enrollDate: '',
enrollNum: '',
activityId: '',
// 接口参数
enrollId: '',
......@@ -89,6 +90,12 @@ Page({
},
activityDetail() {
wx.navigateTo({
url: '/pages/activity-detail/activity-detail?id='+this.data.activityId
})
},
// 我的活动详情
getMyActivityDetail() {
let that = this
......@@ -112,10 +119,11 @@ Page({
case 2: type = 2;break;
}
that.setData({
activityId: res.data.activityId,
type: type,
cover: res.data.cover,
activityName: res.data.activityName,
activeDate: res.data.activeDate + ' ' + res.data.activeTime,
activeDate: res.data.activeDate,
name: res.data.name,
mobile: res.data.mobile,
enrollDate: res.data.enrollDate,
......
......@@ -13,7 +13,7 @@
<view class="body">
<view class="activityBody">
<view class="title">报名活动</view>
<view class="item">
<view class="item" bindtap="activityDetail">
<image class="activity-contanier-img" src="{{cover}}"></image>
<view class="my-activities-content">
<view class="my-activities-title clamp-ellipsis">{{activityName}}</view>
......
......@@ -164,13 +164,13 @@
border-bottom: 1px solid rgb(247, 246, 247);
}
.circle{
/* .circle{
width: 10rpx;
height: 10rpx;
border-radius: 50%;
background-color: black;
margin-right: 20rpx;
}
} */
.item-title{
width: 100%;
display: flex;
......
......@@ -21,6 +21,7 @@ Page({
// notice 列表数据
notice: [],
noticeTitles: [],
// strategy 列表数据
strategyFirstItem: {
......@@ -254,6 +255,13 @@ Page({
}
},
noticClick(e) {
let notic = this.data.notice[e.detail.index]
wx.navigateTo({
url: '/pages/notice-detail/notice-detail?id='+notic.id
})
},
getBanner() {
var that = this
app.wxRequest({
......@@ -354,22 +362,19 @@ Page({
data: { pageSize: 5, pageNo: 1, orderBy: " a.release_time desc "},
success: function(res) {
var tmpArr = [];
var tmpArr1 = [];
res.data.list.forEach(item => {
var content = item.content.replace(/<img/gi, '<img style="max-width:100%;height:auto;display:block" ')
.replace(/<section/g, '<div')
.replace(/\/section>/g, '\div>');
var tmpItem = {
id: item.id,
cover: item.imgs.length > 0 ? item.imgs[0] : '',
title: item.title,
date: item.releaseTime,
describe: content,
}
tmpArr.push(tmpItem)
tmpArr1.push(item.title);
})
if (that.data.pageNo == 1) {
that.setData({
notice: tmpArr
notice: tmpArr,
noticeTitles: tmpArr1,
})
}
......
......@@ -21,11 +21,20 @@
<image src="/image/ornament-0.png" mode="widthFix"></image>
</view>
<view class="banner-notice row align-c" bindtap="onNotice">
<view class="banner-notice row align-c">
<image src="./image/inform.png"></image>
<text>最新动态</text>
<text>温泉公寓现已接受预定</text>
<image src="../../image/more-g.png"></image>
<!-- <text>温泉公寓现已接受预定</text> -->
<l-notice-bar
show="{{true}}"
type="swip"
swip-arr="{{noticeTitles}}"
speed="2000"
l-class="notice-bar"
bind:lintap="noticClick">
</l-notice-bar>
<image class="banner-image" src="../../image/more-g.png" bindtap="onNotice"></image>
</view>
</view>
......
......@@ -266,3 +266,28 @@
font-weight: 800;
color: #ffffff;
}
.notice-bar {
width: 330rpx !important;
line-height: 72rpx;
font-size: 28rpx;
color: #333 !important;
background-color: #ffffff !important;
overflow: hidden;
box-shadow: 0 0 0 0 #ffffff !important;
border-radius: 0 0 0 0 !important;
}
/* .notice-bar .l-noticebar {
} */
.notice-bar swiper-item {
background-color: #ffffff;
}
.banner-image {
width: 54rpx;
height: 32rpx;
}
\ No newline at end of file
......@@ -9,7 +9,7 @@ Page({
data: {
mobile: '',
nickName: '',
avatarUrl: '/pages/mine/image/avatar.png',
avatarUrl: '',
mask:false,
type:1, //判断是否是认证的了
approveList:['园区门票优惠','餐厅价格优惠','SPA服务优惠','免费观看电影','无须预约入园','尽享多重特权'],
......@@ -58,6 +58,14 @@ Page({
this.setData({
type: userType == 1 ? 1 : 0,
})
let that = this
app.login({
success: function(token) {
that.getMyActivityList()
that.getList()
that.getAuth()
}
})
},
/**
* 监听 TabBar 切换点击
......@@ -68,9 +76,6 @@ Page({
let that = this
app.login({
success: function(token) {
that.getMyActivityList()
that.getList()
that.getAuth()
let mobile = wx.getStorageSync('mobile')
let nickName = wx.getStorageSync('nickName')
let avatarUrl = wx.getStorageSync('avatarUrl')
......@@ -129,7 +134,7 @@ Page({
case 2: type = 2;break;
}
let obj = {
time: item.activeDate + ' ' + item.activeTime,
time: item.enrollDate,//activeDate + ' ' + item.activeTime,
type: type,
content: item.address,
title: item.name,
......
......@@ -115,7 +115,7 @@ Page({
case 2: type = 2;break;
}
let obj = {
time: item.activeDate + ' ' + item.activeTime,
time: item.enrollDate,//item.activeDate + ' ' + item.activeTime,
type: type,
content: item.address,
title: item.name,
......
......@@ -47,6 +47,7 @@ Page({
data: { id: that.data.id },
success: function (res) {
var content = res.data.content.replace(/<img/gi, '<img style="max-width:100%;height:auto;display:block" ')
.replace(/<table/gi, '<table style="max-width:100%;height:auto;display:block" ')
.replace(/<section/g, '<div')
.replace(/\/section>/g, '\div>');
var response = {
......
......@@ -69,6 +69,7 @@ Page({
var tmpArr = [];
res.data.list.forEach(item => {
var content = item.summary.replace(/<img/gi, '<img style="max-width:100%;height:auto;display:block" ')
.replace(/<table/gi, '<table style="max-width:100%;height:auto;display:block" ')
.replace(/<section/g, '<div')
.replace(/\/section>/g, '\div>');
var tmpItem = {
......@@ -88,7 +89,7 @@ Page({
} else {
that.setData({
moreData: (tmpArr.length + count >= Number(res.data.count)) ? false : true,
notice: that.data.notice.concat(tempArray)
notice: that.data.notice.concat(tmpArr)
})
}
......
......@@ -26,7 +26,7 @@
.notice-item {
margin-top: 50rpx;
padding: 0 40rpx 50rpx 40rpx;
border-bottom: 1rpx #2C3035 solid;
border-bottom: 1rpx #575759 solid;
}
.notice-title text {
......
......@@ -7,10 +7,10 @@ Page({
*/
data: {
type: 1, //判断页面显示的类型 1.填写表单 2.认证中 3.认证失败
nameErr:false,//姓名错误提示
phoneErr:false,
idCardErr:false,
roomErr:false,
nameErr:'',// 请输入姓名
phoneErr:'',//请输入正确的手机号
idCardErr:'',//请输入正确的身份证号,
roomErr:'',//请输入房号
room:'',
name:'',
phone:'',
......@@ -28,11 +28,11 @@ Page({
let val = e.detail.value;
if(!val){
this.setData({
roomErr:true
roomErr:'请输入房号'
})
}else{
this.setData({
roomErr:false
roomErr:''
})
}
},
......@@ -44,13 +44,13 @@ Page({
},
idCardBlur(e){
let val = e.detail.value;
if(!val || !(/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/).test(val)){
if(!val || (val.length != 18)){
this.setData({
idCardErr:true
idCardErr:'请输入正确的身份证号'
})
}else{
this.setData({
idCardErr:false
idCardErr:''
})
}
},
......@@ -66,11 +66,11 @@ Page({
console.log(val)
if(!val){
this.setData({
nameErr:true
nameErr:'请输入姓名'
})
}else{
this.setData({
nameErr:false
nameErr:''
})
}
},
......@@ -84,13 +84,13 @@ Page({
//手机号验证
phoneBlur(e){
let val = e.detail.value;
if(!val || !(/^1[34578]\d{9}$/.test(val))){
if(!val || (val.length != 11)){
this.setData({
phoneErr:true
phoneErr:'请输入正确的手机号'
})
}else{
this.setData({
phoneErr:false
phoneErr:''
})
}
},
......@@ -197,12 +197,12 @@ Page({
let name = this.data.name
let idCard = this.data.idCard
this.setData({
phoneErr: phone == '' ? true : false,
roomErr: room == '' ? true : false,
nameErr: name == '' ? true : false,
idCardErr: idCard == '' ? true : false,
phoneErr: phone.length != 11 ? '请输入正确的手机号' : '',
roomErr: room == '' ? '请输入房号' : '',
nameErr: name == '' ? '请输入姓名' : '',
idCardErr: idCard.length != 18 ? '请输入正确的身份证号' : '',
})
if (phone == '' || room == '' || name == '' || idCard == '') {
if (phone.length != 11 || room == '' || name == '' || idCard.length != 18) {
return
}
wx.lin.showToast({
......
......@@ -25,32 +25,32 @@
<view class="marginB">
<view class="form-item">
<view class="form-item-nav">姓名</view>
<input class="{{nameErr ? 'form-input-error' : 'form-input'}}" bindinput="inputName" bindblur="nameBlur" placeholder="请输入姓名" value="{{name}}"></input>
<input maxlength="10" class="{{nameErr.length>0 ? 'form-input-error' : 'form-input'}}" bindinput="inputName" bindblur="nameBlur" placeholder="请输入姓名" value="{{name}}"></input>
</view>
<view class="error" hidden="{{!nameErr}}">请输入姓名</view>
<view class="error" hidden="{{!nameErr.length>0}}">{{nameErr}}</view>
</view>
<view class="marginB">
<view class="form-item">
<view class="form-item-nav">手机号</view>
<input class="{{phoneErr ? 'form-input-error' : 'form-input'}}" bindinput="inputPhone" bindblur="phoneBlur" placeholder="请输入手机号" value="{{phone}}"></input>
<input maxlength="11" type="number" class="{{phoneErr.length>0 ? 'form-input-error' : 'form-input'}}" bindinput="inputPhone" bindblur="phoneBlur" placeholder="请输入手机号" value="{{phone}}"></input>
</view>
<view class="error" hidden="{{!phoneErr}}">请输入正确的手机号</view>
<view class="error" hidden="{{!(phoneErr.length>0)}}">{{phoneErr}}</view>
</view>
<view class="marginB">
<view class="form-item">
<view class="form-item-nav">身份证号</view>
<input class="{{idCardErr ? 'form-input-error' : 'form-input'}}" bindinput="inputIdCard" bindblur="idCardBlur" placeholder="请输入身份证号" value="{{idCard}}"></input>
<input maxlength="18" type="idcard" class="{{idCardErr.length>0 ? 'form-input-error' : 'form-input'}}" bindinput="inputIdCard" bindblur="idCardBlur" placeholder="请输入身份证号" value="{{idCard}}"></input>
</view>
<view class="error" hidden="{{!idCardErr}}">请输入正确的身份证号</view>
<view class="error" hidden="{{!idCardErr.length>0}}">{{idCardErr}}</view>
</view>
<view class="marginB">
<view class="form-item">
<view class="form-item-nav">房号</view>
<input class="{{roomErr ? 'form-input-error' : 'form-input'}}"bindinput="inputRoom" bindblur="roomBlur" placeholder="请输入房号" value="{{room}}"></input>
<input maxlength="10" class="{{roomErr.length>0 ? 'form-input-error' : 'form-input'}}"bindinput="inputRoom" bindblur="roomBlur" placeholder="请输入房号" value="{{room}}"></input>
</view>
<view class="error" hidden="{{!roomErr}}">请输入房号</view>
<view class="error" hidden="{{!roomErr.length>0}}">{{roomErr}}</view>
</view>
</view>
<view class="prompt">※预计在7个工作日内完成审核,请您耐心等待</view>
......
......@@ -138,6 +138,7 @@ Page({
* display:block --- 此代码,可以去掉图片之间的空白间隔,个人觉得好用
*/
var content = res.data.content.replace(/<img/gi, '<img style="max-width:100%;height:auto;display:block" ')
.replace(/<table/gi, '<table style="max-width:100%;height:auto;display:block" ')
.replace(/<section/g, '<div')
.replace(/\/section>/g, '\div>');
......
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