Commit a6ac5827 by 严立

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

# Conflicts:
#	app.js
#	pages/mine/home/home.js
#	pages/mine/home/home.wxml
#	pages/play/service-detail/service-detail.wxml
#	pages/play/service-detail/service-detail.wxss

Signed-off-by: 严立 <yanl@xmmakeit.com>
parent b8006dfd
......@@ -65,7 +65,7 @@
</block>
</swiper>
<view class="all_activity_nothing">
<view class="all_activity_nothing" wx:if="{{childActivity.length === 0}}">
<image src="{{resourcesBase + 'campsite/all-activities-nothing.png'}}"></image>
</view>
</view>
......
......@@ -182,6 +182,7 @@
.swiper {
width: 750rpx;
height: 1160rpx;
padding: 40rpx 0 0 0;
background-color: #FCF8F0;
}
......
......@@ -46,21 +46,21 @@
<!-- 活动价 - 暂无 -->
<block wx:if="{{item.priceType === 1}}">
<text class="discount-mark">活动价</text>
<text>{{'¥ ' + item.priceDiscountText}}</text>
<text>{{' + item.priceText}}</text>
<text>{{item.priceDiscountText === '0.00' ? '免费' : '¥ ' + item.priceDiscountText}}</text>
<text>{{item.priceText === '0.00' ? '免费' : '¥' + item.priceText}}</text>
</block>
<!-- 业主价 -->
<block wx:if="{{item.priceType === 2}}">
<text class="owner-mark">业主价</text>
<text>{{'¥' + item.priceSpecialText}}</text>
<text>{{'¥' + item.priceText}}</text>
<text>{{item.priceSpecialText === '0.00' ? '免费' : '¥' + item.priceSpecialText}}</text>
<text>{{item.priceText === '0.00' ? '免费' : '¥' + item.priceText}}</text>
</block>
<!-- 普通价 -->
<block wx:if="{{item.priceType === 3}}">
<text></text>
<text>{{item.priceText}}</text>
<text>{{item.priceText === '0.00' ? '免费' : '¥' + item.priceText}}</text>
<text></text>
</block>
</view>
......
......@@ -35,65 +35,35 @@ Page({
userInfo: wx.getStorageSync('userInfo'),
cssGreeting: wx.getStorageSync('navStatusHeight') + wx.getStorageSync('navTitleHeight') + 20 * wx.getStorageSync('unitProportion'),
})
this.setGreetingMessage()
this.setDefaultGreetingMessage()
this.queryFestivalGreeting()
this.queryShopCover()
this.queryRecommend()
this.queryIntegralMallGoods()
},
queryShopCover: function () {
function shopCover(funcType, funcIndex) {
App.wxRequest({
url: 'v1/banner/getOfficeByBanner',
data: {
'smColumnId': funcType,
},
success: (response) => {
let funcResponse = response.data
let funcBanner = This.data.banner
if (funcResponse.length) {
funcBanner[funcIndex] = funcResponse[0].img
} else {
funcBanner[funcIndex] = ''
}
This.setData({
banner: funcBanner
})
}
})
}
let This = this
// 0 首页,1 所有服务,2 儿童营地,3 海错图,4 元养水韵,5 儿童营地接待,6 拾光花坊, 7 商品
let funcShopList = [2, 3, 4, 5, 6]
for (let i = 0, l = funcShopList.length; i < l; i++) {
shopCover(funcShopList[i], i)
}
},
/**
* 问候消息
* @function
* @param {object} - funcEvent
* @returns
*/
setGreetingMessage: function () {
setDefaultGreetingMessage: function () {
let funcHour = Number(App.modular.miment().format('hh'))
let funcMinute = Number(App.modular.miment().format('mm'))
let funcTime = [{
'min': 0,
'max': 12,
'message': '上午好!'
'message': '上午好!'
}, {
'min': 12,
'max': 18,
'message': '下午好!'
'message': '下午好!'
}, {
'min': 18,
'max': 24,
'message': '晚上好!'
'message': '晚上好!'
}]
let funcIndex = 0
......@@ -110,16 +80,89 @@ Page({
}
}
let funcGreetingName = this.data.userInfo.name
if (funcGreetingName.length > 5) funcGreetingName = funcGreetingName.substring(0, 5) + '...'
if (funcGreetingName === '') funcGreetingName = 'Hello'
let funcUserName = this.data.userInfo.name ? this.data.userInfo.name : 'Hello'
let funcGreetingMessage = funcTime[funcIndex].message
let funcUserNameChar = App.modular.utils.countStringChar(funcUserName)
let funcGreetingMessageChar = App.modular.utils.countStringChar(funcGreetingMessage)
let funcUserNameSubstring = funcUserName
let funcUserNameSubstringChar = funcUserNameChar
if (funcUserNameChar + funcGreetingMessageChar > 60 && funcGreetingMessageChar < 40) {
while (funcUserNameSubstringChar + funcGreetingMessageChar > 60) {
funcUserNameSubstring = funcUserNameSubstring.substring(0, funcUserNameSubstring.length - 1)
funcUserNameSubstringChar = App.modular.utils.countStringChar(funcUserNameSubstring) + 3
}
funcUserNameSubstring = funcUserNameSubstring + '...'
}
this.setData({
greetingName: funcGreetingName,
greetingMessage: funcTime[funcIndex].message
greetingName: funcUserNameSubstring,
greetingMessage: funcGreetingMessage
})
},
queryFestivalGreeting: function () {
App.request({
url: 'v1/common/getGreet',
}).then((response) => {
let funcData = response.data
let funcDateNow = App.modular.miment().stamp()
if (funcData.startTime < funcDateNow && funcDateNow < funcData.endTime) {
let funcUserName = this.data.userInfo.name ? this.data.userInfo.name : 'Hello'
let funcGreetingMessage = ',' + funcData.content
let funcUserNameChar = App.modular.utils.countStringChar(funcUserName)
let funcGreetingMessageChar = App.modular.utils.countStringChar(funcGreetingMessage)
let funcUserNameSubstring = funcUserName
let funcUserNameSubstringChar = funcUserNameChar
if (funcUserNameChar + funcGreetingMessageChar > 60 && funcGreetingMessageChar < 40) {
while (funcUserNameSubstringChar + funcGreetingMessageChar > 60) {
funcUserNameSubstring = funcUserNameSubstring.substring(0, funcUserNameSubstring.length - 1)
funcUserNameSubstringChar = App.modular.utils.countStringChar(funcUserNameSubstring) + 3
}
funcUserNameSubstring = funcUserNameSubstring + '...'
}
this.setData({
greetingName: funcUserNameSubstring,
greetingMessage: funcGreetingMessage
})
}
})
},
queryShopCover: function () {
function shopCover(funcType, funcIndex) {
App.request({
url: 'v1/banner/getOfficeByBanner',
params: {
'smColumnId': funcType,
}
}).then((response) => {
let funcResponse = response.data
let funcBanner = This.data.banner
if (funcResponse.length) {
funcBanner[funcIndex] = funcResponse[0].img
} else {
funcBanner[funcIndex] = ''
}
This.setData({
banner: funcBanner
})
})
}
let This = this
// 0 首页,1 所有服务,2 儿童营地,3 海错图,4 元养水韵,5 儿童营地接待,6 拾光花坊, 7 商品
let funcShopList = [2, 3, 4, 5, 6]
for (let i = 0, l = funcShopList.length; i < l; i++) {
shopCover(funcShopList[i], i)
}
},
/**
* 查询推荐商品
* @function
......
......@@ -4,13 +4,13 @@
<block wx:if="{{!appStatus}}">
<!-- 问候订制 -->
<view class="greeting" style="{{'padding-bottom: 0; padding-top:' + cssGreeting + 'px;'}}">
<text>{{greetingName + ',' + greetingMessage}}</text>
<text>{{greetingName + greetingMessage}}</text>
</view>
</block>
<block wx:if="{{appStatus}}">
<!-- 问候订制 -->
<view class="greeting" style="{{'padding-top:' + cssGreeting + 'px;'}}">
<text>{{greetingName + ',' + greetingMessage}}</text>
<text>{{greetingName + greetingMessage}}</text>
</view>
<!-- 商店 -->
......
......@@ -398,6 +398,7 @@ Page({
* @returns
*/
setEntryTime: function (funcEntryId) {
console.log(funcEntryId)
let funcItem = wx.getStorageSync('shoppingCartBuffer')[0]
App.request({
url: 'v1/activity/getEnrollView',
......@@ -480,6 +481,8 @@ Page({
let funcTimeBegin = ''
let funcTimeEnd = ''
console.log('funcTimetable')
console.log(funcTimetable)
for (let i = 0, l = funcTimetable.length; i < l; i++) {
if (funcEntryId === funcTimetable[i].id) {
funcDateBegin = App.modular.miment(funcTimetable[i].beginTime).format('MM月DD日')
......@@ -487,7 +490,7 @@ Page({
funcTimeEnd = App.modular.miment(funcTimetable[i].endTime).format('hh:mm')
this.setData({
quantityTipNumber: funcDate[0][i].residue,
quantityTipNumber: funcTimetable[i].residue,
buyContentTime: funcDateBegin + ' ' + funcTimeBegin + ' - ' + funcTimeEnd
})
break
......
......@@ -13,7 +13,7 @@
top: 0 !important;
left: 0 !important;
width: 750rpx;
height: 800rpx;
height: 792rpx;
}
.banner-swiper-point {
......
......@@ -63,9 +63,8 @@ Page({
'cover': funcData[i].cover,
'banner': funcData[i].playImg,
'describe': funcData[i].summary,
'timeDateMM': [funcData[i].activeDate.match(/[0-9]+/g)[0], funcData[i].activeDate.match(/[0-9]+/g)[2]],
'timeDateDD': [funcData[i].activeDate.match(/[0-9]+/g)[1], funcData[i].activeDate.match(/[0-9]+/g)[3]],
'timePeriod': funcData[i].activeTime.replace(/-/, ' - '),
'timeDate': funcData[i].activeDate,
'timePeriod': funcData[i].activeTime,
'ownerPrice': funcData[i].ownerPrice,
'visitorPrice': funcData[i].visitorPrice,
'tagId': funcData[i].tagIds,
......@@ -300,9 +299,8 @@ Page({
},
onReachBottom: function () {
console.log('onReachBottom')
this.setData({
pageNo: this.data.pageNo + 1
touristRoutePageNo: this.data.touristRoutePageNo + 1
})
this.routeList()
......
......@@ -25,24 +25,15 @@
<view class="recent_activities_list row" wx:if="{{recentActivitiesList.length > 0}}" bindchange="swiperRecentChange">
<block wx:for="{{recentActivitiesList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="recent_activities_item" data-item="{{item}}" bindtap="onActivityDetail">
<view class="recent_activities_item_wrap column">
<view class="recent_activities_item_date row ac">
<text class="font_normal_42 color_regular">{{item.timeDateMM[0]}}</text>
<text class="font_normal_50 color_regular">/</text>
<text class="font_normal_42 color_regular">{{item.timeDateDD[0]}}</text>
</view>
<view class="recent_activities_item_date row ac">
<text class="font_normal_42 color_regular">{{item.timeDateMM[1]}}</text>
<text class="font_normal_50 color_regular">/</text>
<text class="font_normal_42 color_regular">{{item.timeDateDD[1]}}</text>
</view>
<view class="recent_activities_item_line"></view>
<text class="recent_activities_item_time font_bold_30 color_regular">{{item.timePeriod}}</text>
<view class="recent_activities_item_wrap">
<image class="recent_activities_item_cover" mode="aspectFill" src="{{item.banner}}"></image>
<view class="recent_activities_item_name row ac">
<text class="font_bold_54 color_regular overflow_point_2">{{item.name}}</text>
</view>
<view class="recent_activities_item_date row ac">
<text class="recent_activities_item_time font_normal_30 color_cancel">{{item.timeDate + item.timePeriod}}</text>
</view>
</view>
<image class="recent_activities_item_cover" mode="aspectFill" src="{{item.banner}}"></image>
</view>
</block>
<view class="recent_activities_item"></view>
......
......@@ -77,7 +77,7 @@
/* 近期活动 */
.recent_activities_list {
width: 750rpx;
margin: 80rpx 0 0 0;
margin: 90rpx 0 0 0;
padding: 0 0 0 40rpx;
overflow-x: scroll;
}
......@@ -85,8 +85,8 @@
.recent_activities_item {
display: inline-block;
position: relative;
width: 648rpx;
height: 720rpx;
width: 650rpx;
min-height: 720rpx;
margin: 0 24rpx 0 0;
padding: 48rpx 0 0 0;
}
......@@ -96,37 +96,28 @@
}
.recent_activities_item_wrap {
width: 648rpx;
height: 672rpx;
padding: 50rpx 0 0 50rpx;
width: 650rpx;
min-height: 672rpx;
padding: 0 40rpx;
border-radius: 2px;
background: #EEF3F9;
}
.recent_activities_item_date {
margin: 0 0 12rpx 0;
}
.recent_activities_item_line {
width: 1px;
height: 128rpx;
margin: 8rpx 0 22rpx 10rpx;
background: #000000;
.recent_activities_item_cover {
position: relative;
top: -48rpx;
left: 0;
width: 568rpx;
height: 464rpx;
border-radius: 2px;
}
.recent_activities_item_name {
width: 560rpx;
height: 168rpx;
margin: 60rpx 0 0 0;
margin: -6rpx 0 0 0;
}
.recent_activities_item_cover {
position: absolute;
top: 0;
left: 260rpx;
width: 340rpx;
height: 464rpx;
border-radius: 2px;
.recent_activities_item_date {
margin: 30rpx 0 0 0;
}
.item-nothing {
......
......@@ -32,7 +32,7 @@ Page({
isBlack: false,
cssTabContentTop: wx.getStorageSync('navHeight'),
cssTabContentTop: 0,
sideHeight: 550,
winSide: true,
......@@ -60,13 +60,24 @@ Page({
},
onLoad: function(options) {
console.log(options)
this.setData({
option: options,
cssTabContentTop: wx.getStorageSync('navHeight'),
})
this.setActivityTypeTag()
},
onShow: function() {
this.setData({
appStatus: App.globalData.appStatus
})
},
setViewContent: function () {
// 根据商店查询相关订制内容
switch (Number(options.id)) {
switch (Number(this.data.option.id)) {
case 1:
this.queryCommodity()
this.queryActivity()
......@@ -129,12 +140,6 @@ Page({
}
},
onShow: function() {
this.setData({
appStatus: App.globalData.appStatus
})
},
/**
* 设置电影类型标签
* @function
......@@ -159,7 +164,7 @@ Page({
this.setData({
activityTypeTag: funcList,
})
this.queryDetail(Number(this.data.options.id))
this.queryDetail(Number(this.data.option.id))
})
},
......@@ -327,7 +332,6 @@ Page({
App.request({
url: 'v1/park/getList',
}).then((response) => {
console.log(response)
let funcData = response.data
funcDetail.forEach(shop => {
funcData.forEach(item => {
......@@ -377,6 +381,7 @@ Page({
this.setData({
shopInfo: funcItem
})
this.setViewContent()
break
}
}
......@@ -389,6 +394,8 @@ Page({
* @returns
*/
queryActivity: function() {
console.log('this.data.shopInfo.id')
console.log(this.data.shopInfo.id)
App.wxRequest({
url: 'v1/activity/getList',
data: {
......@@ -411,11 +418,12 @@ Page({
'priceText': App.modular.utils.formatAmount(funcResponse[i].visitorPrice), // 普通价文本格式
'priceSpecial': funcResponse[i].ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcResponse[i].ownerPrice), // 业主价文本格式
'tagIds': funcResponse[i].tagIds,
'tagNames': this.ignoreActivityTypeTag([]),
'tagIds': funcResponse[i].tagIds.split(','),
'tagNames': [],
'date': funcResponse[i].activeDate + ' ' + funcResponse[i].activeTime, // 活动时间
'priceType': 1,
}
funcItem.tagNames = this.insertActivityTypeTag(funcItem.tagIds)
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
......@@ -437,8 +445,6 @@ Page({
winActivity: true,
detailActivity: funcList
})
console.log(JSON.stringify(this.data.detailActivity))
}
})
},
......@@ -956,16 +962,16 @@ Page({
},
/**
* 过滤活动标签
* 插入活动标签
* @function
* @param {array} - funcIgnoreTag
* @returns
*/
ignoreActivityTypeTag: function (funcIgnoreTag) {
insertActivityTypeTag: function (funcInsertTag) {
let funcRemainTag = []
let funcActivityTypeTag = this.data.activityTypeTag
for (let i = 0, l = funcActivityTypeTag.length; i < l; i++) {
if (!funcIgnoreTag.includes(funcActivityTypeTag[i].value)) funcRemainTag.push(funcActivityTypeTag[i].text)
if (funcInsertTag.includes(funcActivityTypeTag[i].value)) funcRemainTag.push(funcActivityTypeTag[i].text)
}
return funcRemainTag
},
......
......@@ -319,6 +319,7 @@
}
.commodity-card-item-title text:nth-child(1) {
flex-grow: 1;
font-size: 30rpx;
font-weight: 400;
line-height: 44rpx;
......@@ -328,16 +329,6 @@
white-space: nowrap;
}
.movie-card-item-title text:nth-child(1) {
font-size: 26rpx;
font-weight: 400;
line-height: 37rpx;
color: #fff;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.commodity-card-item-title text:nth-child(2) {
width: 96rpx;
height: 32rpx;
......@@ -351,6 +342,16 @@
color: #86c5e1;
}
.movie-card-item-title text:nth-child(1) {
font-size: 26rpx;
font-weight: 400;
line-height: 37rpx;
color: #fff;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.commodity-card-item-date {
width: 498rpx;
height: 40rpx;
......
......@@ -42,6 +42,22 @@ let output = {
}
},
countStringChar: function (funcCountString) {
let funcCountDoubleByte = funcCountString.match(/[\uff00-\uffff]/ig)
let funcCountSingleByte = funcCountString.match(/[\u0000-\u00ff]/ig)
let funcCountChinese = funcCountString.match(/[\u4e00-\u9fa5]/ig)
let funcCountEmoji = funcCountString.match(/[\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]|\uD83D[\uDE80-\uDEFF]|[\u2700-\u27BF]\uFE0F]/ig)
if (funcCountDoubleByte === null) funcCountDoubleByte = []
if (funcCountSingleByte === null) funcCountSingleByte = []
if (funcCountChinese === null) funcCountChinese = []
if (funcCountEmoji === null) funcCountEmoji = []
let funcCountStringChar = funcCountDoubleByte.length * 2 + funcCountSingleByte.length * 1 + funcCountChinese.length * 2 + funcCountEmoji.length * 1
console.log(funcCountStringChar)
return funcCountStringChar
},
}
export default output
\ No newline at end of file
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