Commit 17e45fbe by 严立

LL - 三期俱乐部静态

parent 6b873133
Showing with 1604 additions and 533 deletions
...@@ -178,6 +178,7 @@ App({ ...@@ -178,6 +178,7 @@ App({
'openId': funcResponse.openid, 'openId': funcResponse.openid,
'name': funcResponse.nickName, 'name': funcResponse.nickName,
'phone': funcResponse.mobile, 'phone': funcResponse.mobile,
'phoneHide': funcResponse.mobile.substring(0, 3) + '****' + funcResponse.mobile.substring(7),
'avatar': funcResponse.avatarUrl, 'avatar': funcResponse.avatarUrl,
'address': funcResponse.address, 'address': funcResponse.address,
'birthday': funcResponse.birthday, 'birthday': funcResponse.birthday,
...@@ -190,6 +191,8 @@ App({ ...@@ -190,6 +191,8 @@ App({
// 以返回信息中是否包含手机号码判断用户是否注册过 // 以返回信息中是否包含手机号码判断用户是否注册过
if (funcUserInfo.phone) { if (funcUserInfo.phone) {
funcUserInfo.isSignIn = true funcUserInfo.isSignIn = true
// 测试数据
// funcUserInfo.isSignIn = false
this.queryUserStatus() this.queryUserStatus()
} }
...@@ -275,7 +278,14 @@ App({ ...@@ -275,7 +278,14 @@ App({
funcUserInfo.userType = 0 funcUserInfo.userType = 0
break break
} }
wx.setStorageSync('userInfo', funcUserInfo) // // 测试数据 - 游客
// funcUserInfo.status = ''
// funcUserInfo.userType = 0
// // 测试数据 - 业主
// funcUserInfo.status = 1
// funcUserInfo.userType = 1
// wx.setStorageSync('userInfo', funcUserInfo)
// 如果用户身份有更新,则自动跳转到首页 // 如果用户身份有更新,则自动跳转到首页
if (funcStatus !== funcStatusRaw) { if (funcStatus !== funcStatusRaw) {
...@@ -434,4 +444,24 @@ App({ ...@@ -434,4 +444,24 @@ App({
clearTimeout(this.scrollTimestamp) clearTimeout(this.scrollTimestamp)
}, funcFrequency) }, funcFrequency)
}, },
setPriceType: function (funcCommodityData) {
let funcUserType = wx.getStorageSync('userInfo').userType
for (let i = 0, l = funcCommodityData.length; i < l; i++) {
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcCommodityData[i].priceDiscount || funcCommodityData[i].priceDiscount === 0) {
funcCommodityData[i].priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcCommodityData[i].price !== funcCommodityData[i].priceSpecial && funcUserType) {
funcCommodityData[i].priceType = 2
} else {
funcCommodityData[i].priceType = 3
}
}
}
return funcCommodityData
},
}) })
\ No newline at end of file
{ {
"pages": [ "pages": [
"pages/home/home/home", "pages/home/home/home",
"pages/home/dynamic/dynamic", "pages/home/dynamic/dynamic",
"pages/home/dynamic-detail/dynamic-detail", "pages/home/dynamic-detail/dynamic-detail",
...@@ -49,12 +50,21 @@ ...@@ -49,12 +50,21 @@
"pages/pay/coupon/coupon", "pages/pay/coupon/coupon",
"pages/pay/coupon-input/coupon-input", "pages/pay/coupon-input/coupon-input",
"pages/pay/coupon-detail/coupon-detail", "pages/pay/coupon-detail/coupon-detail",
"pages/club/home/home",
"pages/club/information/information",
"pages/club/member/member",
"pages/club/create/create",
"pages/club/enter/enter",
"pages/login/login" "pages/login/login"
], ],
"usingComponents": { "usingComponents": {
"m-button-bottom": "./component/m-button-bottom/m-button-bottom",
"m-dialog": "./component/m-dialog/m-dialog",
"m-nav": "./component/m-nav/m-nav", "m-nav": "./component/m-nav/m-nav",
"m-tab": "./component/m-tab/m-tab",
"m-toast": "./component/m-toast/m-toast", "m-toast": "./component/m-toast/m-toast",
"m-dialog": "./component/m-dialog/m-dialog",
"swiper-point": "./component/swiper-point/swiper-point", "swiper-point": "./component/swiper-point/swiper-point",
"l-avatar": "./miniprogram_npm/lin-ui/avatar/index", "l-avatar": "./miniprogram_npm/lin-ui/avatar/index",
......
...@@ -11,3 +11,28 @@ ...@@ -11,3 +11,28 @@
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
} }
.owner-mark {
height: 32rpx;
padding: 0 12rpx;
background: linear-gradient(180deg, #3F4357 0%, #252532 100%);
border-radius: 4px;
font-size: 18rpx;
font-weight: 500;
line-height: 30rpx;
color: #E8D0AF;
}
.tag-blue {
height: 32rpx;
padding: 0 8rpx;
border-radius: 4px;
border: 1px solid #86C5E1;
background: rgba(134, 197, 225, 0.1);
font-size: 18rpx;
font-weight: 500;
line-height: 24rpx;
color: #86C5E1;
}
\ No newline at end of file
Component({
options: {
styleIsolation: 'apply-shared'
},
properties: {
text: {
type: String,
value: '申请加入',
},
},
data: {
},
methods: {
onButton: function () {
this.triggerEvent('click')
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="m-button-bottom">
<view class="m-button-bottom-content">
<button class="row cc ac" bindtap="onButton">{{text}}</button>
</view>
<view class="m-button-bottom-occupy"></view>
</view>
\ No newline at end of file
.m-button-bottom-content {
position: fixed;
bottom: 0;
left: 0;
width: 750rpx;
height: 156rpx;
padding: 32rpx 40rpx;
border-top: 1px #E2E7EF solid;
}
.m-button-bottom-content {
background: #FFFFFF;
}
.m-button-bottom-content > button {
width: 670rpx;
height: 96rpx;
border-radius: 4px;
background: #86C5E1;
font-size: 30rpx;
font-weight: 500;
line-height: 42rpx;
color: #FFFFFF;
}
.m-button-bottom-occupy {
width: 750rpx;
height: 156rpx;
}
\ No newline at end of file
...@@ -301,11 +301,16 @@ Component({ ...@@ -301,11 +301,16 @@ Component({
// 导航栏拥有 logo 的场景,需要判断 logo 是否超出原有导航栏高度。 // 导航栏拥有 logo 的场景,需要判断 logo 是否超出原有导航栏高度。
let funcLogoFillTop = 0 let funcLogoFillTop = 0
let funcLogoFillHeight = 0 let funcLogoFillHeight = 0
let funcRegExp = this.data.logoFillCss.match(/(?<=top: )[0-9.]+/g)
if (funcRegExp) funcLogoFillTop = Number(funcRegExp[0])
funcRegExp = this.data.logoFillCss.match(/(?<=height: )[0-9.]+/g) // ios 正则兼容写法。
if (funcRegExp) funcLogoFillHeight = Number(funcRegExp[0]) // ios 不支持 ? 匹配规则,所以只能获取之后再将不需要的数据替换为空值。
let funcRegExp = new RegExp('top: [0-9.]+', 'g')
let funcResult = this.data.logoFillCss.match(funcRegExp)
if (funcResult) funcLogoFillTop = Number(funcResult[0].replace('top: ', ''))
funcRegExp = new RegExp('height: [0-9.]+', 'g')
funcResult = this.data.logoFillCss.match(funcRegExp)
if (funcResult) funcLogoFillHeight = Number(funcResult[0].replace('height: ', ''))
if (funcLogoFillTop === 0) { if (funcLogoFillTop === 0) {
wx.setStorageSync('navHeight', this.data.currentStyle.statusHeight + this.data.currentStyle.titleHeight) wx.setStorageSync('navHeight', this.data.currentStyle.statusHeight + this.data.currentStyle.titleHeight)
......
Component({
scrollStart: 0,
scrollTimer: 0,
scrollLock: false,
options: {
styleIsolation: 'apply-shared'
},
properties: {
// 导航栏是否固定在视图顶部
isFixed: {
type: Boolean,
value: true,
},
fixedTop: {
type: Number,
value: 0,
},
// 导航栏是否占用空间,仅在 isFixed 为 true 时有效。
isOccupy: {
type: Boolean,
value: true,
},
item: {
type: Array,
value: []
},
activeIndex: {
type: Number,
value: 0,
},
},
data: {
itemElementLeft: [],
scrollLeft: 0,
},
// 属性监听
observers: {
'item': function (funcValue) {
this.setItemElement()
},
},
methods: {
setItemElement: function () {
// 获取购物车高度
let funcQuery = this.createSelectorQuery()
funcQuery.selectAll('.m-item').boundingClientRect()
funcQuery.exec((funcResult) => {
let funcSelectionElement = funcResult[0]
this.scrollStart = funcSelectionElement[0].left
let funcList = [ 0 ]
for (let i = 1, l = funcSelectionElement.length; i < l; i++) {
funcList.push(funcSelectionElement[i].left - this.scrollStart)
}
this.setData({
itemElementLeft: funcList
})
})
},
onItem: function (funcEvent) {
let funcItem = funcEvent.currentTarget.dataset.item
let funcIndex = funcEvent.currentTarget.dataset.index
this.setData({
activeIndex: funcIndex
})
this.triggerEvent('tabChange', funcItem)
},
eventTabScroll: function (funcEvent) {
if (this.scrollLock) return
let funcScrollLeft = funcEvent.detail.scrollLeft
clearTimeout(this.scrollTimer)
this.scrollTimer = setTimeout(() => {
let funcItemElementLeft = this.data.itemElementLeft
for (let i = 0, l = funcItemElementLeft.length; i < l; i++) {
// funcScrollLeft - 20 是为了弥补滚动到首个 item 时无法准确定位在 0 数值上的问题。
if (funcScrollLeft - 20 < funcItemElementLeft[i]) {
this.scrollLock = true
this.setData({
scrollLeft: funcItemElementLeft[i]
})
clearTimeout(this.scrollTimer)
this.scrollTimer = setTimeout(() => {
this.scrollLock = false
clearTimeout(this.scrollTimer)
}, 500)
break
}
}
}, 200)
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="m-tab {{isFixed ? 'm-tab-fixed' : ''}}" style="{{'top: ' + fixedTop + 'px;'}}">
<scroll-view class="m-item-list row ac" scroll-x="true" scroll-left="{{scrollLeft}}" bindscroll="eventTabScroll">
<block wx:for="{{item}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view
class="m-item {{activeIndex === index ? 'm-item-active' : 'm-item-inactive'}}"
data-item="{{item}}"
data-index="{{index}}"
bindtap="onItem"
>
<text>{{item.text}}</text>
</view>
</block>
</scroll-view>
</view>
<!-- 导航栏占位元素 -->
<view wx:if="{{isOccupy && isFixed}}" class="m-tab-occupy"></view>
\ No newline at end of file
.m-tab {
z-index: 4;
width: 750rpx;
height: 72rpx;
padding: 0 0 0 40rpx;
border-bottom: 1px #E2E7EF solid;
background: #FFFFFF;
}
.m-tab-fixed {
position: fixed;
top: 0;
left: 0;
}
.m-item-list {
width: 710rpx;
white-space: nowrap;
}
.m-item-list::-webkit-scrollbar {
display: none;
}
.m-item {
display: inline-block;
margin-right: 80rpx;
padding-bottom: 26rpx;
font-size: 26rpx;
font-weight: 500;
color: #15191F;
}
.m-item-active {
border-bottom: 4rpx #15191F solid;
}
.m-item-inactive {
border-bottom: 4rpx rgba(0, 0, 0, 0) solid;
}
.m-tab-occupy {
height: 72rpx;
}
\ No newline at end of file
/* 层级说明 /* 层级说明
- - 背景 - : 整体背景
0 - 视图 0 : 视图
1 - 视图 1 : 视图
2 - 视图 2 : 视图
3 - 视图 3 : 视图
4 - 视图 4 : 视图
5 - 导航栏,占位元素 5 : 导航栏,占位元素
6 - 导航栏 6 : 导航栏
7 - 遮罩,弹窗,提示, 7 : 遮罩,弹窗,提示,
8 - 遮罩 8 : 遮罩
9 - 遮罩 9 : 遮罩
*/ */
.row { .row {
......

233 Bytes | W: | H:

2.08 KB | W: | H:

image/icon/arrow-r-3.png
image/icon/arrow-r-3.png
image/icon/arrow-r-3.png
image/icon/arrow-r-3.png
  • 2-up
  • Swipe
  • Onion skin

669 Bytes | W: | H:

669 Bytes | W: | H:

image/inform-w.png
image/icon/edit-4.png
image/inform-w.png
image/icon/edit-4.png
  • 2-up
  • Swipe
  • Onion skin
// pages/club/create/create.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/club/create/create.wxml-->
<text>pages/club/create/create.wxml</text>
/* pages/club/create/create.wxss */
\ No newline at end of file
// pages/club/enter/enter.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/club/enter/enter.wxml-->
<text>pages/club/enter/enter.wxml</text>
/* pages/club/enter/enter.wxss */
\ No newline at end of file
let App = getApp()
Page({
data: {
tabItem: [
{ 'text': '全部', 'value': '' },
{ 'text': '亲子教育', 'value': '' },
{ 'text': '健康', 'value': '' },
{ 'text': '理财经商', 'value': '' },
{ 'text': '家居美学', 'value': '' },
],
clubList: [],
},
onLoad: function (options) {
this.queryClub()
},
queryClub: function () {
let funcResponse = [
{
'id': '',
'logo': '',
'name': '马术俱乐部',
'describe': '俱乐部拥有进口纯血马20匹,国产马6匹,马匹每天清理一次,运动完洗澡烤电放松背部肌肉,是热爱马术人士的聚集地。',
'member': 1900,
}, {
'id': '',
'logo': '',
'name': '音乐剧话剧俱乐部',
'describe': '为广大音乐剧话剧爱好者提供了一个学习和讨论的平台,让大家感受到音乐剧话剧之美,参与其中学习表演,体会到音乐剧话剧的魅力所在。',
'member': 1700,
},
]
this.setData({
clubList: funcResponse
})
},
/**
* 页面滚动事件
* @function
* @param {object} - funcEvent
* @returns
*/
onPageScroll: function (funcEvent) {
App.pageScroll(funcEvent, this)
},
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<nav titleText="俱乐部" styleIndex="2" scrollHeight="{{navScroll}}" isOccupy="{{false}}"></nav>
<view class="container">
<!-- banner -->
<view class="banner">
<image></image>
</view>
<!-- tab -->
<view class="tab">
<m-tab item="{{tabItem}}"></m-tab>
</view>
<view class="club-list">
<block wx:for="{{clubList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="club-item row">
<view class="club-logo">
<image src="{{item.logo}}"></image>
</view>
<view class="club-info column">
<view class="club-info-name row ac">
<text>{{item.name}}</text>
<text class="owner-mark">业主专享</text>
</view>
<view class="club-info-describe row">
<text>{{item.describe}}</text>
</view>
<view class="club-info-other row cb ac">
<text>{{item.member + '成员'}}</text>
<button>申请加入</button>
</view>
</view>
</view>
</block>
</view>
</view>
\ No newline at end of file
.banner image {
width: 750rpx;
height: 998rpx;
background: #999999;
}
.tab {
margin-top: 64rpx;
}
.club-list {
padding-top: 80rpx;
}
.club-item {
margin-bottom: 64rpx;
}
.club-logo > image {
width: 168rpx;
height: 168rpx;
margin-right: 28rpx;
background: #999999;
}
.club-info-name > text:nth-child(1) {
height: 44rpx;
margin-right: 16rpx;
font-size: 34rpx;
font-weight: 800;
line-height: 44rpx;
color: #15191F;
}
.club-info-describe {
width: 474rpx;
margin-top: 16rpx;
font-size: 22rpx;
font-weight: 400;
line-height: 36rpx;
color: #959DA9;
}
.club-info-other {
margin-top: 18rpx;
}
.club-info-other > text {
font-size: 22rpx;
font-weight: 400;
line-height: 40rpx;
color: #959DA9;
}
.club-info-other > button {
width: 120rpx;
height: 56rpx;
border-radius: 4px;
background: #86C5E1;
font-size: 22rpx;
font-weight: 500;
line-height: 56rpx;
color: #FFFFFF;
}
\ No newline at end of file
let App = getApp()
Page({
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
detailActivity: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.queryActi()
},
queryActi: function () {
let funcList = [{
'cover': '',
'id': '',
'title': '活动名称',
'officeId': '',
'price': 123,
'priceText': App.modular.utils.formatAmount(123),
'priceSpecial': 123, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(123),
'tagIds': '',
'tagNames': 'tag',
'date': '2020-10-19 2020-10-20',
'priceType': 1,
}]
this.setData({
detailActivity: funcList
})
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="container">
<view class="banner">
<image src=""></image>
</view>
<view class="club-info row cc ac">
<image class="club-info-logo" src=""></image>
<view class="club-info-name column cc ac">
<text class="title">马术俱乐部</text>
<text class="owner-mark">业主专享</text>
<view class="club-info-member row cc ac">
<text>1877 成员</text>
<image class="arrow-more" src="{{imageBase + 'icon/arrow-r-2.png'}}"></image>
</view>
</view>
</view>
<view class="club-describe column">
<text class="title">俱乐部简介</text>
<text>俱乐部拥有进口纯血马20匹,国产马6匹,马匹每天清理一次,运动完洗澡烤电放松背部肌肉。有中外会员数百人,是热爱马术人士的聚集地。</text>
</view>
<!-- 近期活动 -->
<view class="card">
<view class="card-title row cb ac">
<text class="title">近期活动</text>
<text>查看全部</text>
</view>
<view class="card-list row">
<block wx:for="{{3}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="card-item column ac">
<image class="card-item-cover"></image>
<view class="card-item-info">
<view class="card-item-info-title row cb ac">
<text>八月银湖湾儿童马术节</text>
<text class="tag-blue">亲子教育</text>
</view>
<view class="card-item-info-time row ac">
<image class="arrow-more" src="{{imageBase + 'icon/clock-2.png'}}"></image>
<text>9.20-9.25 10:00-11:30</text>
</view>
<view class="card-item-other row cb ac">
<view class="card-item-price row">
<text class="owner-mark">业主价</text>
<text>免费</text>
<text>¥ 149</text>
</view>
<button class="row cc ac">报名</button>
</view>
</view>
</view>
</block>
<view class="card-item column ac" wx:if="{{true}}"></view>
</view>
</view>
<!-- 详情 -->
<view class="club-detail">
<view class="row cb ac">
<text class="club-detail-title title">俱乐部详情</text>
</view>
<view class="club-detail-content">
<image mode="widthFix" src="{{resourcesBase + 'club/information/club-detail.png'}}"></image>
</view>
</view>
<!-- 加入规则 -->
<view class="club-enter">
<view class="club-enter-title">
<text class="title">加入规则</text>
</view>
<image mode="widthFix" src="./image/enter-rule.png"></image>
</view>
</view>
<m-button-bottom></m-button-bottom>
\ No newline at end of file
.title {
height: 52rpx;
font-size: 38rpx;
font-weight: 800;
line-height: 52rpx;
color: #15191F;
}
.banner > image {
width: 750rpx;
height: 600rpx;
background: #999999;
}
/* 俱乐部名称 */
.club-info {
position: relative;
width: 750rpx;
}
.club-info > view {
margin-top: 116rpx;
}
.club-info-logo {
position: absolute;
top: -84rpx;
left: 291rpx;
width: 168rpx;
height: 168rpx;
background: #999999;
}
.club-info-name > text:nth-child(2) {
width: 96rpx;
margin-top: 16rpx;
}
.club-info-member {
height: 36rpx;
margin-top: 24rpx;
}
.club-info-member > text:nth-child(1) {
margin-right: 8rpx;
font-size: 26rpx;
font-weight: 400;
line-height: 36rpx;
color: #959DA9;
}
/* 俱乐部简介 */
.club-describe {
margin-top: 96rpx;
padding-bottom: 50rpx;
border-bottom: 1px #E2E7EF solid;
}
.club-describe > text:nth-child(2) {
width: 670rpx;
margin-top: 48rpx;
font-size: 30rpx;
font-weight: 300;
line-height: 50rpx;
color: #15191F;
}
/* 近期活动 */
.card {
margin-top: 80rpx;
}
.card-title {
width: 750rpx;
padding: 0 40rpx;
}
.card-title > text:nth-child(1) {
height: 52rpx;
font-size: 38rpx;
font-weight: 800;
line-height: 52rpx;
color: #15191F;
}
.card-title > text:nth-child(2) {
height: 36rpx;
font-size: 26rpx;
font-weight: 400;
line-height: 36rpx;
color: #959DA9;
}
.card-list {
width: 750rpx;
margin-top: 48rpx;
padding: 0 0 0 40rpx;
overflow-x: scroll;
}
.card-item {
display: inline-block;
width: 562rpx;
margin: 0 24rpx 0 0;
border-radius: 4px;
background: #F5F6F8;
}
.card-item:last-child {
width: 1rpx !important;
min-width: 1rpx !important;
}
.card-item-cover {
width: 562rpx;
height: 316rpx;
background: #999999;
}
.card-item-info {
padding: 32rpx;
}
.card-item-info-title > text:nth-child(1) {
height: 44rpx;
font-size: 30rpx;
font-weight: 400;
line-height: 44rpx;
color: #15191F;
}
.card-item-info-time {
margin-top: 8rpx;
height: 40rpx;
font-size: 26rpx;
font-weight: 400;
line-height: 40rpx;
color: #656E7B;
}
.card-item-other {
margin-top: 16rpx;
}
.card-item-other > button {
width: 132rpx;
height: 56rpx;
border-radius: 4px;
background: #86C5E1;
font-size: 26rpx;
font-weight: 500;
line-height: 36rpx;
color: #FFFFFF;
}
.card-item-price > text:nth-child(2) {
height: 36rpx;
margin: 0 12rpx;
font-size: 30rpx;
font-weight: 800;
line-height: 32rpx;
color: #15191F;
}
.card-item-price > text:nth-child(3) {
height: 36rpx;
font-size: 22rpx;
font-weight: 400;
line-height: 36rpx;
color: #C2C7CF;
}
/* 俱乐部详情 */
.club-detail {
margin-top: 80rpx;
}
.club-detail-title {
padding: 0 40rpx;
}
.club-detail-content > image {
margin-top: 80rpx;
width: 750rpx;
}
/* 加入规则 */
.club-enter {
margin: 90rpx 0 64rpx 0;
}
.club-enter-title {
padding: 0 40rpx;
}
.club-enter > image {
width: 750rpx;
margin-top: 48rpx;
}
\ No newline at end of file
// pages/club/member/member.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/club/member/member.wxml-->
<text>pages/club/member/member.wxml</text>
/* pages/club/member/member.wxss */
\ No newline at end of file
...@@ -115,7 +115,7 @@ Page({ ...@@ -115,7 +115,7 @@ Page({
let funcGreetingName = this.data.userInfo.name let funcGreetingName = this.data.userInfo.name
if (funcGreetingName.length > 5) funcGreetingName = funcGreetingName.substring(0, 5) + '...' if (funcGreetingName.length > 5) funcGreetingName = funcGreetingName.substring(0, 5) + '...'
if (funcGreetingName === '') funcGreetingName = 'Hello' if (funcGreetingName === '') funcGreetingName = 'Hello'
this.setData({ this.setData({
greetingName: funcGreetingName, greetingName: funcGreetingName,
......
...@@ -2,10 +2,39 @@ let App = getApp() ...@@ -2,10 +2,39 @@ let App = getApp()
Page({ Page({
data: { data: {
appStatus: App.globalData.appStatus, appStatus: App.globalData.appStatus,
isCheckPermission: false,
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
imageResourcesBase: App.globalData.appResourcesBase, resourcesBase: App.globalData.appResourcesBase,
orderCategory: [
{
icon: './image/order-1.png',
name: '门票',
quantity: 0,
type: 3,
}, {
icon: './image/order-2.png',
name: '餐饮',
quantity: 0,
type: 5,
}, {
icon: './image/order-3.png',
name: '影票',
quantity: 0,
type: -2,
}, {
icon: './image/order-4.png',
name: 'SPA',
quantity: 0,
type: 2,
}, {
icon: './image/order-5.png',
name: '文创',
quantity: 0,
type: 4,
}
],
isCouponPermissions: false,
orderType: 1, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影 orderType: 1, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
userInfo: { userInfo: {
...@@ -28,7 +57,6 @@ Page({ ...@@ -28,7 +57,6 @@ Page({
approveList: ['园区门票优惠', '餐厅价格优惠', 'SPA服务优惠', '免费观看电影', '无须预约入园', '尽享多重特权'], approveList: ['园区门票优惠', '餐厅价格优惠', 'SPA服务优惠', '免费观看电影', '无须预约入园', '尽享多重特权'],
activityList: [], activityList: [],
activityListBackup: [], activityListBackup: [],
isRegister: false, // 是否注册,
// 右上角消息 // 右上角消息
passBadge: 0, passBadge: 0,
...@@ -37,8 +65,8 @@ Page({ ...@@ -37,8 +65,8 @@ Page({
spaBadge: 0, spaBadge: 0,
artBadge: 101, artBadge: 101,
showMoreOrder: false, // 查看更多订单 isMoreOrder: false, // 查看更多订单
showMoreActivity: false, // 查看更多活动 isMoreActivity: false, // 查看更多活动
myOrder: { myOrder: {
passOrder: [], passOrder: [],
artOrder: { artOrder: {
...@@ -60,12 +88,61 @@ Page({ ...@@ -60,12 +88,61 @@ Page({
onShow: function () { onShow: function () {
this.setData({ this.setData({
showMoreOrder: false, isMoreOrder: false,
showMoreActivity: false, isMoreActivity: false,
}) })
this.setData({ appStatus: App.globalData.appStatus }) this.setData({ appStatus: App.globalData.appStatus })
this.setUserInfo() this.setUserInfo()
this.queryCouponPermissions()
},
/**
* 设置用户信息
* @function
* @param
* @returns
*/
setUserInfo: function () {
let funcUserInfo = wx.getStorageSync('userInfo')
// 已为登录状态
if (funcUserInfo.isSignIn) {
let funcStatusText = ''
switch (funcUserInfo.status) {
case '':
funcStatusText = '去认证'
break
case 0:
funcStatusText = '审核中'
break
case 1:
funcStatusText = '审核通过 '
break
case 2:
funcStatusText = '审核失败'
break
}
this.setData({
type: funcUserInfo.userType,
statusText: funcStatusText,
userInfo: funcUserInfo
})
App.login({
timeout: 0,
success: (result) => {
this.getMyActivityList()
this.getCardList()
this.getWillUseOrders()
this.getIntegral()
this.getCountByGoodType()
this.getCountEnrollSubscribe()
},
})
}
}, },
// 去活动预约列表 // 去活动预约列表
...@@ -97,8 +174,13 @@ Page({ ...@@ -97,8 +174,13 @@ Page({
}) })
}, },
// 查看积分明细 /**
goIntegralDetail(event) { * 跳转积分明细
* @function
* @param
* @returns
*/
onIntegralDetail: function (event) {
let integral = event.currentTarget.dataset.integral let integral = event.currentTarget.dataset.integral
wx.navigateTo({ wx.navigateTo({
url: '/pages/mine/accumulate/accumulate?integral=' + integral, url: '/pages/mine/accumulate/accumulate?integral=' + integral,
...@@ -110,38 +192,31 @@ Page({ ...@@ -110,38 +192,31 @@ Page({
url: '/pages/pay/coupon-input/coupon-input?authInfo=' + JSON.stringify(this.data.authInfo), url: '/pages/pay/coupon-input/coupon-input?authInfo=' + JSON.stringify(this.data.authInfo),
}) })
}, },
// 获取核销权限
getPermissions() { /**
let that = this * 查询用户核销权限
App.wxRequest({ * @function
url: '/api/v1/login/getPermissions', * @param
data: { * @returns
permission: 'sys:role:distinguish' */
}, queryCouponPermissions: function () {
success: function (res) { App.request({
let data = res.data url: 'v1/login/getPermissions',
let isPer = false params: {
let authInfo = { 'permission': ''
officeName: data.officeName,
roleName: data.roleNames[0],
}
if (data.permissions.length > 0) {
//有核销权限
isPer = true
} else {
// 无核销权限
isPer = false
} }
that.setData({ }).then((response) => {
isCheckPermission: isPer, let funcData = response.data
authInfo: authInfo this.setData({
isCouponPermissions: funcData.permissions.length > 0 ? true : false,
authInfo: { officeName: funcData.officeName, roleName: funcData.roleNames }
}) })
} }).catch((response) => {
console.log('resolve', response)
}) })
}, },
// 获取积分
// 获取积分
getIntegral() { getIntegral() {
let that = this let that = this
App.wxRequest({ App.wxRequest({
...@@ -157,6 +232,7 @@ Page({ ...@@ -157,6 +232,7 @@ Page({
} }
}) })
}, },
//获取待使用订单 //获取待使用订单
getWillUseOrders() { getWillUseOrders() {
let that = this let that = this
...@@ -286,62 +362,9 @@ Page({ ...@@ -286,62 +362,9 @@ Page({
}) })
}, },
setUserInfo: function () {
let funcUserInfo = wx.getStorageSync('userInfo')
console.log(funcUserInfo)
// 已为登录状态
if (funcUserInfo.isSignIn) {
funcUserInfo.phone = this.toHide(funcUserInfo.phone)
let funcStatusText = ''
switch (funcUserInfo.status) {
case '':
funcStatusText = '去认证'
break
case 0:
funcStatusText = '审核中'
break
case 1:
funcStatusText = '审核通过 '
break
case 2:
funcStatusText = '审核失败'
break
}
this.setData({
type: funcUserInfo.userType,
statusText: funcStatusText,
isRegister: true,
userInfo: funcUserInfo
})
App.login({
timeout: 0,
success: (result) => {
this.getMyActivityList()
this.getCardList()
this.getWillUseOrders()
this.getPermissions()
this.getIntegral()
this.getCountByGoodType()
this.getCountEnrollSubscribe()
// this.getList()
},
})
} else {
this.setData({
isRegister: false,
})
}
},
// 登录注册页 // 登录注册页
checkRegister() { onSignIn: function () {
if (this.data.isRegister) { if (this.data.userInfo.isSignIn) {
return true return true
} else { } else {
wx.navigateTo({ wx.navigateTo({
...@@ -353,7 +376,7 @@ Page({ ...@@ -353,7 +376,7 @@ Page({
//去认证 //去认证
goApprove() { goApprove() {
if (this.checkRegister()) { if (this.onSignIn()) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/mine/authentication-input/authentication-input', url: '/pages/mine/authentication-input/authentication-input',
}) })
...@@ -361,7 +384,7 @@ Page({ ...@@ -361,7 +384,7 @@ Page({
}, },
myActivity() { myActivity() {
if (this.checkRegister()) { if (this.onSignIn()) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/mine/appointment/appointment', url: '/pages/mine/appointment/appointment',
}) })
...@@ -369,7 +392,7 @@ Page({ ...@@ -369,7 +392,7 @@ Page({
}, },
myAppointment() { myAppointment() {
if (this.checkRegister()) { if (this.onSignIn()) {
wx.navigateTo({ wx.navigateTo({
url: '../myAppointment/myAppointment', url: '../myAppointment/myAppointment',
}) })
...@@ -377,7 +400,7 @@ Page({ ...@@ -377,7 +400,7 @@ Page({
}, },
customerService() { customerService() {
if (this.checkRegister()) { if (this.onSignIn()) {
wx.navigateTo({ wx.navigateTo({
url: "/pages/mine/question/question", url: "/pages/mine/question/question",
}) })
...@@ -404,8 +427,8 @@ Page({ ...@@ -404,8 +427,8 @@ Page({
}, },
//点击前往修改页面 //点击前往修改页面
goMyInfo() { onEditInfo: function () {
if (this.checkRegister()) { if (this.onSignIn()) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/mine/info/info', url: '/pages/mine/info/info',
}) })
...@@ -522,12 +545,18 @@ Page({ ...@@ -522,12 +545,18 @@ Page({
url: '/pages/mine/card/card' url: '/pages/mine/card/card'
}) })
}, },
//查看更多
onShowMoreOrder: function () { /**
let showMoreOrder = !this.data.showMoreOrder * 查看更多订单
* @function
* @param
* @returns
*/
onMoreOrder: function () {
let isMoreOrder = !this.data.isMoreOrder
let orderList = `myOrder.artOrder.orderList` let orderList = `myOrder.artOrder.orderList`
if (showMoreOrder) { if (isMoreOrder) {
// 展开 // 展开
this.setData({ this.setData({
[orderList]: JSON.parse(JSON.stringify(this.data.orderListBackup)), [orderList]: JSON.parse(JSON.stringify(this.data.orderListBackup)),
...@@ -541,17 +570,19 @@ Page({ ...@@ -541,17 +570,19 @@ Page({
}) })
} }
this.setData({ this.setData({
showMoreOrder, isMoreOrder,
}) })
}, },
// 我的预约 展开 收起
onShowMoreActivity: function () { /**
let showMoreActivity = !this.data.showMoreActivity * 查看更多预约
if (showMoreActivity) { * @function
* @param
* @returns
*/
onMoreActivity: function () {
let isMoreActivity = !this.data.isMoreActivity
if (isMoreActivity) {
//展开 //展开
this.setData({ this.setData({
...@@ -566,7 +597,7 @@ Page({ ...@@ -566,7 +597,7 @@ Page({
}) })
} }
this.setData({ this.setData({
showMoreActivity, isMoreActivity,
}) })
......
<m-nav titleText="我的" scrollHeight="{{navScroll}}" styleIndex="{{userInfo.userType === 0 ? 0 : 2}}" isOccupy="{{false}}" iconBack=""></m-nav> <m-nav titleText="我的" scrollHeight="{{navScroll}}" styleIndex="{{userInfo.userType === 0 ? 0 : 2}}" isOccupy="{{false}}" iconBack=""></m-nav>
<view class="container con-s"> <view class="container">
<view class="mine" wx:if="{{type !== 1}}"> <!-- 游客信息面板 -->
<image class="mine-bgi" src="./image/mine.png"></image> <block wx:if="{{userInfo.userType === 0}}">
<view class="row align-c"> <view class="info">
<view class="mine-avatar" bindtap="checkRegister"> <image class="info-bgi" src="./image/gbi-0.png"></image>
<view class="row ac">
<view class="info-avatar row ac" bindtap="onSignIn">
<image src="{{userInfo.avatar ? userInfo.avatar : './image/avatar.png'}}"></image> <image src="{{userInfo.avatar ? userInfo.avatar : './image/avatar.png'}}"></image>
</view> </view>
<view wx:if="{{isRegister}}" class="mine-info col"> <!-- 未登录状态 -->
<view class="row align-c" style="height:70rpx"> <view wx:if="{{!userInfo.isSignIn}}" class="info-sign-in row ac">
<text>{{userInfo.name}}</text> <text bindtap="onSignIn">登录/注册</text>
<image src="./image/inform.png" bindtap="goMyInfo"></image>
</view>
<view class="owner-tag">
<!-- <text>{{userInfo.phone}}</text> -->
<button class="user-type">游客</button>
</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 bindtap="goIntegralDetail" data-integral="{{integral}}" class="integral " style="position:relative;z-index:2; flex:1">
<view class="integral-num">{{integral}}</view>
<view class="integral-title">我的积分
<image class="arrow-r" src="{{imageResourcesBase+'mine/home/huise_arrow_right.png'}}"></image>
</view>
</view>
</view>
</view> </view>
<view class="mine" style="height:416rpx" wx:if="{{type == 1}}"> <!-- 登录状态 -->
<image class="background-image" style="height:416rpx;" src="{{imageResourcesBase + 'mine/home/ownerBg.png'}}"></image> <view wx:if="{{userInfo.isSignIn}}" class="info-edit col cc">
<view class="row align-c approve"> <view class="info-name row align-c">
<view class="mine-avatar mine-avatar-special"> <text>{{userInfo.name}}</text>
<image src="{{userInfo.avatar}}"></image> <image src="{{imageBase + 'icon/edit-1.png'}}" bindtap="onEditInfo"></image>
</view>
<view class="mine-info col">
<view class="row align-c" style="height:60rpx">
<text style="color:#F0DABB;font-weight:500;" class="padding-l-18">{{userInfo.name}}</text>
<image src="/image/inform-w.png" bindtap="goMyInfo"></image>
</view>
<view class="owner-tag">
<!-- <text>{{userInfo.phone}}</text> -->
<image mode="aspectFill" src="{{imageResourcesBase+'mine/home/ownerTag.png'}}"></image>
</view>
</view> </view>
<view bindtap="goIntegralDetail" data-integral="{{integral}}" class=" integral glod" style="position:relative;z-index:2; flex:1"> <view class="info-status-tourist row cc ac">
<view class="integral-num">{{integral}}</view> <text>游 客</text>
<view class="integral-title">我的积分
<image class="arrow-r" src="{{imageResourcesBase+'mine/home/glod_arrow_right.png'}}"></image>
</view> </view>
</view> </view>
<!-- 我的积分 -->
<view class="info-integral col cb" data-integral="{{integral}}" bindtap="onIntegralDetail">
<view class="info-integral-quantity row ce ac">
<text>{{integral}}</text>
</view> </view>
<view class="info-integral-title row ce ac">
<text>我的积分</text>
<image class="arrow-more" src="{{imageBase + 'icon/arrow-r-2.png'}}"></image>
</view> </view>
<view class="coupon row align-c" bindtap="goCouponInput" wx:if="{{isCheckPermission}}">
<view class="cpopon-info col">
<text>券码核销</text>
<text>所属门店:{{authInfo.officeName}}</text>
</view> </view>
<view class="">
<image src="{{imageBase + 'icon/arrow-r-2.png'}}"></image>
</view> </view>
</view> </view>
<view class="status row con-b align-c" wx:if="{{type !== 1}}"> <view class="status-authentication row cb ac">
<view class="status-symbol col"> <view class="status-symbol col">
<text>业主认证</text> <text>业主认证</text>
<text>享受业主尊贵特权,预定消费专属优惠</text> <text>享受业主尊贵特权,预定消费专属优惠</text>
</view> </view>
<view class="status-operation row con-c align-c" bindtap="goApprove"> <view class="status-operation row cc ac" bindtap="goApprove">
<image wx:if="{{statusText == '审核失败'}}" src="/image/fail-icon.png"></image> <image wx:if="{{statusText == '审核失败'}}" src="/image/fail-icon.png"></image>
<image wx:if="{{statusText == '审核中'}}" src="/image/sh-icon.png"></image> <image wx:if="{{statusText == '审核中'}}" src="/image/sh-icon.png"></image>
<text>{{statusText}}</text> <text>{{statusText}}</text>
</view> </view>
</view> </view>
</block>
<view class="menu"> <!-- 业主信息面板 -->
<block wx:if="{{appStatus}}"> <block wx:if="{{userInfo.userType === 1}}">
<!-- 订单 --> <view class="info">
<view class="order-activity"> <image class="info-bgi" src="./image/gbi-1.png"></image>
<view class="order-activity-title-wrapper row con-b align-c"> <view class="row ac">
<view class="order-activity-title row align-c"> <view class="info-avatar row ac" bindtap="onSignIn">
<text>我的订单</text> <image src="{{userInfo.avatar ? userInfo.avatar : './image/avatar.png'}}"></image>
</view> </view>
<view class="order-activity-all row align-c" bindtap="onOrder">
<text>查看全部</text> <!-- 登录状态 -->
<image class="all-order-icon" src="{{imageBase + 'icon/arrow-r-2.png'}}"></image> <view wx:if="{{userInfo.isSignIn}}" class="info-edit col cc">
<view class="info-name row align-c">
<text class="info-owner">{{userInfo.name}}</text>
<image src="{{imageBase + 'icon/edit-4.png'}}" bindtap="onEditInfo"></image>
</view> </view>
<view class="info-status-owner row ac">
<image src="./image/status-owner.png"></image>
</view> </view>
<!-- 订单分类icno -->
<view class="order-activity-icon-list row con-b">
<view class="order-activity-icon-wrapper col align-c" data-type="3" bindtap="goOrderByclass">
<view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/or_ticket.png'}}"></image>
<view class="order-activity-badge {{ goodTypeCountData['3'] > 9 ? 'badge-widen' : ''}}" wx:if="{{goodTypeCountData['3'] > 0}}">
{{goodTypeCountData['3'] > 99 ? '···' : goodTypeCountData['3']}}</view>
</view> </view>
<text>门票</text>
<!-- 我的积分 -->
<view class="info-integral col cb" data-integral="{{integral}}" bindtap="onIntegralDetail">
<view class="info-integral-quantity row ce ac">
<text class="info-owner">{{integral}}</text>
</view> </view>
<view class="order-activity-icon-wrapper col align-c" data-type="5" bindtap="goOrderByclass"> <view class="info-integral-title row ce ac">
<view class="order-activity-icon row con-c align-c"> <text class="info-owner">我的积分</text>
<image src="{{imageResourcesBase+'mine/home/or_food.png'}}"></image> <image class="arrow-more" src="{{imageBase + 'icon/arrow-r-4.png'}}"></image>
<view class="order-activity-badge {{ goodTypeCountData['5'] > 9 ? 'badge-widen' : ''}}" wx:if="{{goodTypeCountData['5'] > 0}}">
{{goodTypeCountData['5'] > 99 ? '···' : goodTypeCountData['5']}}</view>
</view> </view>
<text>餐饮</text>
</view> </view>
<view class="order-activity-icon-wrapper col align-c" data-type="-2" bindtap="goOrderByclass">
<view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/or_movie.png'}}"></image>
<view class="order-activity-badge {{ goodTypeCountData['-2'] > 9 ? 'badge-widen' : ''}}" wx:if="{{goodTypeCountData['-2'] > 0}}">
{{goodTypeCountData['-2'] > 99 ? '···' : goodTypeCountData['-2']}}</view>
</view> </view>
<text>影票</text>
</view> </view>
<view class="order-activity-icon-wrapper col align-c" data-type="2" bindtap="goOrderByclass"> </block>
<view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/or_spa.png'}}"></image> <!-- 券码核销 -->
<view class="order-activity-badge {{ goodTypeCountData['2'] > 9 ? 'badge-widen' : ''}}" wx:if="{{goodTypeCountData['2'] > 0}}"> <view class="coupon-permissions row align-c" bindtap="goCouponInput" wx:if="{{isCouponPermissions}}">
{{goodTypeCountData['2'] > 99 ? '···' : goodTypeCountData['2']}}</view> <view class="coupon-permissions-info col">
<text>券码核销</text>
<text>{{'所属门店:' + authInfo.officeName}}</text>
</view> </view>
<text>SPA</text> <image class="arrow-more" src="{{imageBase + 'icon/arrow-r-2.png'}}"></image>
</view> </view>
<view class="order-activity-icon-wrapper col align-c" data-type="4" bindtap="goOrderByclass">
<view class="order-activity-icon row con-c align-c"> <!-- 我的订单 -->
<image src="{{imageResourcesBase+'mine/home/or_art.png'}}"></image> <view wx:if="{{appStatus}}" class="list-order card">
<view class="order-activity-badge {{ goodTypeCountData['4'] > 9 ? 'badge-widen' : ''}}" wx:if="{{goodTypeCountData['4'] > 0}}"> <view class="card-title row cb ac">
{{goodTypeCountData['4'] > 99 ? '···' : goodTypeCountData['4']}}</view> <text>我的订单</text>
<text bindtap="onOrder">查看全部</text>
<image class="arrow-more" src="{{imageBase + 'icon/arrow-r-2.png'}}"></image>
</view>
<!-- 分类 tab -->
<view class="card-category row cb ac">
<block wx:for="{{orderCategory}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="card-item col cc ac" data-type="{{item.type}}" bindtap="goOrderByclass">
<view class="card-item-quantity row cc ac" hidden="{{item.quantity === 0 ? false : true}}">
<text>{{item.quantity < 99 ? item.quantity : '···'}}</text>
</view>
<view class="card-item-icon row cc ac">
<image src="{{item.icon}}"></image>
</view> </view>
<text>文创</text> <text>{{item.name}}</text>
</view> </view>
</block>
</view>
<!-- 订单展示 -->
<view class="card-list">
</view> </view>
<view class="more-wrapper" wx:if="{{myOrder}}}"> <view class="more-wrapper" wx:if="{{myOrder}}}">
<!-- 订单卡片 --> <!-- 订单卡片 -->
<!-- 年卡 --> <!-- 年卡 -->
<view class="pass-wrapper" wx:if="{{myOrder.passOrder&&myOrder.passOrder.length>0}}" bindtap="handleToCard"> <view class="pass-wrapper" wx:if="{{myOrder.passOrder&&myOrder.passOrder.length>0}}" bindtap="handleToCard">
<image wx:if="{{ myOrder.passOrder[0].cardType==1}}" class="card-bg year-bg" src="{{imageResourcesBase +'pay/order-input/card-1.png'}}"></image> <image wx:if="{{ myOrder.passOrder[0].cardType==1}}" class="card-bg year-bg" src="{{resourcesBase +'pay/order-input/card-1.png'}}"></image>
<image wx:elif="{{myOrder.passOrder[0].cardType==2}}" class="card-bg month-bg" src="{{imageResourcesBase +'pay/order-input/card-2.png'}}"></image> <image wx:elif="{{myOrder.passOrder[0].cardType==2}}" class="card-bg month-bg" src="{{resourcesBase +'pay/order-input/card-2.png'}}"></image>
<image wx:else class="card-bg month-bg" src="{{imageResourcesBase +'pay/order-input/card-3.png'}}"> <image wx:else class="card-bg month-bg" src="{{resourcesBase +'pay/order-input/card-3.png'}}">
</image> </image>
<view class="pass-bg-one {{myOrder.passOrder[0].cardType==1 ? '' : 'bg-one-month'}}" wx:if="{{myOrder.passOrder.length > 1}}"></view> <view class="pass-bg-one {{myOrder.passOrder[0].cardType==1 ? '' : 'bg-one-month'}}" wx:if="{{myOrder.passOrder.length > 1}}"></view>
<view class="pass-bg-two {{myOrder.passOrder[0].cardType==1 ? '' : 'bg-two-month'}}" wx:if="{{myOrder.passOrder.length > 1}}"></view> <view class="pass-bg-two {{myOrder.passOrder[0].cardType==1 ? '' : 'bg-two-month'}}" wx:if="{{myOrder.passOrder.length > 1}}"></view>
<view class="pass-logo-wrapper row align-c"> <view class="pass-logo-wrapper row align-c">
<view class="logo-box"> <view class="logo-box">
<image mode="aspectFit" src="{{imageResourcesBase+ myOrder.passOrder[0].logo}}"></image> <image mode="aspectFit" src="{{resourcesBase+ myOrder.passOrder[0].logo}}"></image>
</view> </view>
<text>{{myOrder.passOrder[0].officeName}}</text> <text>{{myOrder.passOrder[0].officeName}}</text>
...@@ -167,11 +156,11 @@ ...@@ -167,11 +156,11 @@
</view> </view>
<!-- 商品 --> <!-- 商品 -->
<block wx:if="myOrder.artOrder.orderList.length>0"> <block wx:if="myOrder.artOrder.orderList.length > 0">
<view class="goods-wrapper" wx:for="{{myOrder.artOrder.orderList}}" wx:key="{{index}}" wx:key="index" data-item="{{item}}" bindtap="onOrderDetail"> <view class="goods-wrapper" wx:for="{{myOrder.artOrder.orderList}}" wx:key="{{index}}" wx:key="index" data-item="{{item}}" bindtap="onOrderDetail">
<view class="goods-logo-wrapper row align-c"> <view class="goods-logo-wrapper row align-c">
<view class="logo-box"> <view class="logo-box">
<image mode="aspectFit" src="{{imageResourcesBase+ item.logo}}"></image> <image mode="aspectFit" src="{{resourcesBase+ item.logo}}"></image>
</view> </view>
<text>{{item.officeName}}</text> <text>{{item.officeName}}</text>
</view> </view>
...@@ -192,18 +181,18 @@ ...@@ -192,18 +181,18 @@
</view> </view>
</view> </view>
<!-- more --> <!-- more -->
<view class="more row align-c con-c" bindtap="onShowMoreOrder" wx:if="{{!isLoadingOrder&&orderListBackup.length>1}}"> <view class="more row align-c con-c" bindtap="onMoreOrder" wx:if="{{!isLoadingOrder&&orderListBackup.length>1}}">
<text wx:if="{{!showMoreOrder}}">展开更多</text> <text wx:if="{{!isMoreOrder}}">展开更多</text>
<text wx:else>收起</text> <text wx:else>收起</text>
<image wx:if="{{!showMoreOrder}}" src="{{imageBase + 'icon/arrow-b-2.png'}}"></image> <image wx:if="{{!isMoreOrder}}" src="{{imageBase + 'icon/arrow-b-2.png'}}"></image>
<image wx:else src="{{imageBase + 'up.png'}}"></image> <image wx:else src="{{imageBase + 'up.png'}}"></image>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
</block>
<!-- 预约 --> <!-- 我的预约 -->
<view class="list-activity">
<view class="order-activity"> <view class="order-activity">
<view class="order-activity-title-wrapper row con-b align-c"> <view class="order-activity-title-wrapper row con-b align-c">
<view class="order-activity-title row align-c"> <view class="order-activity-title row align-c">
...@@ -218,7 +207,7 @@ ...@@ -218,7 +207,7 @@
<view class="order-activity-icon-list row con-b"> <view class="order-activity-icon-list row con-b">
<view class="order-activity-icon-wrapper col align-c" data-type='0' bindtap="goAppointment"> <view class="order-activity-icon-wrapper col align-c" data-type='0' bindtap="goAppointment">
<view class="order-activity-icon row con-c align-c"> <view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/yy_theme.png'}}"></image> <image src="{{resourcesBase+'mine/home/yy_theme.png'}}"></image>
<view class="order-activity-badge {{ enrollSubscribeData.active > 9 ? 'badge-widen' : ''}}" wx:if="{{enrollSubscribeData.active}}"> <view class="order-activity-badge {{ enrollSubscribeData.active > 9 ? 'badge-widen' : ''}}" wx:if="{{enrollSubscribeData.active}}">
{{enrollSubscribeData.active}}</view> {{enrollSubscribeData.active}}</view>
</view> </view>
...@@ -226,7 +215,7 @@ ...@@ -226,7 +215,7 @@
</view> </view>
<view class="order-activity-icon-wrapper col align-c" data-type='1' bindtap="goAppointment"> <view class="order-activity-icon-wrapper col align-c" data-type='1' bindtap="goAppointment">
<view class="order-activity-icon row con-c align-c"> <view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/yy_night.png'}}"></image> <image src="{{resourcesBase+'mine/home/yy_night.png'}}"></image>
<view class="order-activity-badge {{ enrollSubscribeData.garden > 9 ? 'badge-widen' : ''}}" wx:if="{{enrollSubscribeData.garden}}"> <view class="order-activity-badge {{ enrollSubscribeData.garden > 9 ? 'badge-widen' : ''}}" wx:if="{{enrollSubscribeData.garden}}">
{{enrollSubscribeData.garden}}</view> {{enrollSubscribeData.garden}}</view>
</view> </view>
...@@ -234,7 +223,7 @@ ...@@ -234,7 +223,7 @@
</view> </view>
<view class="order-activity-icon-wrapper col align-c" data-type='2' bindtap="goAppointment"> <view class="order-activity-icon-wrapper col align-c" data-type='2' bindtap="goAppointment">
<view class="order-activity-icon row con-c align-c"> <view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/yy_house.png'}}"></image> <image src="{{resourcesBase+'mine/home/yy_house.png'}}"></image>
<view class="order-activity-badge {{ enrollSubscribeData.scanHouse > 9 ? 'badge-widen' : ''}}" wx:if="{{enrollSubscribeData.scanHouse}}"> <view class="order-activity-badge {{ enrollSubscribeData.scanHouse > 9 ? 'badge-widen' : ''}}" wx:if="{{enrollSubscribeData.scanHouse}}">
{{enrollSubscribeData.scanHouse}}</view> {{enrollSubscribeData.scanHouse}}</view>
</view> </view>
...@@ -262,19 +251,20 @@ ...@@ -262,19 +251,20 @@
</view> </view>
</view> </view>
<!-- more --> <!-- more -->
<view class="more row align-c con-c" bindtap="onShowMoreActivity" wx:if="{{activityListBackup.length>2}}"> <view class="more row align-c con-c" bindtap="onMoreActivity" wx:if="{{activityListBackup.length>2}}">
<text wx:if="{{!showMoreActivity}}">展开更多</text> <text wx:if="{{!isMoreActivity}}">展开更多</text>
<text wx:else>收起</text> <text wx:else>收起</text>
<image wx:if="{{!showMoreActivity}}" src="{{imageBase + 'icon/arrow-b-2.png'}}"></image> <image wx:if="{{!isMoreActivity}}" src="{{imageBase + 'icon/arrow-b-2.png'}}"></image>
<image wx:else src="{{imageBase + 'up.png'}}"></image> <image wx:else src="{{imageBase + 'up.png'}}"></image>
</view> </view>
</view> </view>
</view>
<!-- 客服中心 --> <!-- 客服中心 -->
<view class="service row con-b align-c" bindtap="goQuestion"> <view class="service row con-b align-c" bindtap="goQuestion">
<text>客服中心</text> <text>客服中心</text>
<image src="{{imageBase + 'icon/arrow-r-2.png'}}"></image> <image src="{{imageBase + 'icon/arrow-r-2.png'}}"></image>
</view> </view>
</view>
</view> </view>
<!-- 业主弹出层 --> <!-- 业主弹出层 -->
......
page {
background: #F3F4F6;
}
.container { .container {
min-height: 100vh; min-height: 100vh;
background: #f3f4f6;
} }
.background-image { /* 用户信息面板 */
z-index: 0; .info {
position: absolute; width: 750rpx;
top: 0; height: 416rpx;
left: 0; padding: 220rpx 40rpx 0 40rpx;
width: 100%;
height: 100%;
} }
.mine { .info-owner {
width: 750rpx; color: #F0DABB !important;
height: 380rpx;
padding: 220rpx 0 0 48rpx;
} }
.mine-bgi { .info-bgi {
z-index: -1;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 750rpx; width: 750rpx;
height: 500rpx; height: 416rpx;
}
.user-type {
width: 126rpx;
height: 40rpx;
font-weight: 500;
font-size: 22rpx;
color: #fff;
background-color: #6783ae;
text-align: center;
line-height: 40rpx;
border-radius: 4rpx;
letter-spacing: 10rpx;
margin-top: 8rpx;
} }
.owner-tag { .info-avatar {
height: 80rpx;
width: 142rpx;
/* margin-top: 8rpx!important; */
}
.mine-avatar {
z-index: 1; z-index: 1;
margin-right: 32rpx; margin-right: 30rpx;
width: 136rpx; width: 136rpx;
height: 136rpx; height: 136rpx;
} }
.mine-avatar-special { .info-avatar > image {
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
background-color: #f0dabb;
}
.mine-avatar > image {
width: 128rpx; width: 128rpx;
height: 128rpx; height: 128rpx;
border-radius: 50%; border-radius: 50%;
} }
.mine-info { .info-sign-in {
z-index: 1;
padding-top: 12rpx;
}
.mine-info view:nth-child(1) text {
max-width: 260rpx;
margin-right: 20rpx;
font-size: 42rpx; font-size: 42rpx;
font-weight: 500; font-weight: 500;
line-height: 58rpx;
overflow: hidden; color: #15191F;
white-space: nowrap;
text-overflow: ellipsis;
}
.padding-l-18 {
padding-left: 18rpx;
} }
/* 积分 */ .info-edit {
height: 120rpx;
.integral {
color: #0d0d0e;
text-align: right;
} }
.glod { .info-name {
color: #f0dabb; height: 58rpx;
} font-size: 42rpx;
font-weight: 500;
.integral-num { line-height: 58rpx;
font-size: 54rpx; color: #15191F;
line-height: 66rpx;
padding-right: 80rpx;
font-weight: 600;
}
.integral-title {
display: flex;
height: 52rpx;
align-items: center;
font-size: 26rpx;
line-height: 36rpx;
flex-direction: row;
justify-content: flex-end;
padding-right: 40rpx;
}
.arrow-r {
width: 32rpx;
height: 32rpx;
margin-left: 8rpx;
} }
.mine-info view:nth-child(1) image { .info-name > image {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
margin-top: 10rpx;
} }
.mine-info view:nth-child(2) { .info-integral {
margin-top: 0rpx; flex-grow: 1;
height: 120rpx;
text-align: right;
color: #0d0d0e;
} }
.mine-info view:nth-child(2) text { .info-integral-quantity {
font-size: 26rpx; height: 76rpx;
color: #959da9; margin-right: 40rpx;
font-size: 52rpx;
font-weight: 500;
line-height: 76rpx;
color: #0D0D0E;
} }
.coupon { .info-integral-title > text{
z-index: 7; height: 36rpx;
width: 670rpx; margin-right: 8rpx;
height: 176rpx; font-size: 26rpx;
padding: 41rpx 32rpx; font-weight: 400;
background-color: #fff; line-height: 36rpx;
border-radius: 4rpx; color: #15191F;
margin-top: 48rpx;
} }
.cpopon-info { .info-status-tourist {
flex: 1; width: 126rpx;
} height: 40rpx;
margin: 10rpx 0 2rpx 0;
border-radius: 4px;
background: #6783AE;
.cpopon-info text:nth-child(1) { font-size: 22rpx;
font-size: 34rpx; font-weight: 500;
font-weight: 600; line-height: 32rpx;
color: #15191f; color: #FFFFFF;
} }
.cpopon-info text:nth-child(2) { .info-status-owner > image {
margin-top: 12rpx; width: 106rpx;
font-size: 26rpx; height: 40rpx;
color: #161a1f; margin: 10rpx 0 2rpx 0;
border-radius: 4px;
} }
.coupon image { .info-avatar-special {
width: 32rpx; display: flex;
height: 32rpx; justify-content: center;
align-items: center;
border-radius: 50%;
background-color: #f0dabb;
} }
.status { /* 业主认证 */
z-index: 7; .status-authentication {
z-index: 2;
width: 670rpx; width: 670rpx;
height: 130rpx; height: 130rpx;
margin-top: 48rpx;
padding: 24rpx 32rpx 24rpx 40rpx; padding: 24rpx 32rpx 24rpx 40rpx;
border-radius: 4rpx; border-radius: 4rpx;
background: linear-gradient(180deg, rgba(63, 67, 87, 1) 0%, rgba(37, 37, 50, 1) 100%); background: linear-gradient(180deg, #3F4357 0%, #252532 100%);
} }
.status-symbol text:nth-child(1) { .status-symbol text:nth-child(1) {
font-size: 30rpx; font-size: 30rpx;
font-weight: bolder; font-weight: 800;
color: rgba(255, 227, 195, 1); color: #F1DBBD;
} }
.status-symbol text:nth-child(2) { .status-symbol text:nth-child(2) {
...@@ -195,9 +145,10 @@ ...@@ -195,9 +145,10 @@
height: 52rpx; height: 52rpx;
padding: 0 16rpx; padding: 0 16rpx;
border-radius: 4rpx; border-radius: 4rpx;
background: linear-gradient(180deg, rgba(255, 243, 227, 1) 0%, rgba(255, 227, 195, 1) 100%); background: linear-gradient(180deg, #FFF3E3 0%, #FFE3C3 100%);
color: #282836;
font-size: 26rpx; font-size: 26rpx;
color: #282836;
} }
.status-operation text { .status-operation text {
...@@ -212,6 +163,109 @@ ...@@ -212,6 +163,109 @@
margin-right: 8rpx; margin-right: 8rpx;
} }
/* 券码核销 */
.coupon-permissions {
z-index: 2;
width: 670rpx;
height: 176rpx;
margin-top: 48rpx;
padding: 40rpx 32rpx;
border-radius: 4px;
background: #FFFFFF;
}
.coupon-permissions-info {
flex-grow: 1;
}
.coupon-permissions-info > text:nth-child(1) {
font-size: 34rpx;
font-weight: 600;
color: #15191f;
}
.coupon-permissions-info > text:nth-child(2) {
margin-top: 12rpx;
font-size: 26rpx;
color: #161a1f;
}
/* 我的订单,我的预约 */
.card {
width: 670rpx;
min-height: 312rpx;
margin: 48rpx 40rpx 0 40rpx;
padding: 40rpx 32rpx;
border-radius: 4px;
background: #FFFFFF;
}
.card-title > text:nth-child(1) {
flex-grow: 1;
height: 34rpx;
font-size: 34rpx;
font-weight: 800;
line-height: 34rpx;
color: #15191F;
}
.card-title > text:nth-child(2) {
height: 26rpx;
margin-right: 8rpx;
font-size: 26rpx;
font-weight: 400;
line-height: 26rpx;
color: #15191F;
}
.card-category {
margin-top: 56rpx;
padding: 0 6rpx;
}
.card-item {
position: relative;
}
.card-item-quantity {
position: absolute;
top: -10rpx;
right: 0;
width: 32rpx;
height: 32rpx;
border-radius: 50%;
background: #E66060;
font-size: 22rpx;
line-height: 32rpx;
color: #FFFFFF;
}
.card-item > text {
height: 32rpx;
margin-top: 16rpx;
font-size: 22rpx;
font-weight: 400;
line-height: 32rpx;
color: #161A1F;
}
.card-item-icon {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background: #F5F6F8;
}
.card-item-icon > image {
width: 48rpx;
height: 48rpx;
}
.menu { .menu {
width: 750rpx; width: 750rpx;
/* margin-top: 16rpx; */ /* margin-top: 16rpx; */
......
<m-toast></m-toast> <m-toast></m-toast>
<m-dialog></m-dialog> <m-dialog></m-dialog>
<m-nav titleText="订单详情"></m-nav> <m-nav titleText="订单详情" bind:navBack="navBack"></m-nav>
<view class="container"> <view class="container">
<!-- 订单状态 --> <!-- 订单状态 -->
<view class="state row con-c"> <view class="state row con-c">
......
...@@ -350,8 +350,6 @@ Page({ ...@@ -350,8 +350,6 @@ Page({
if (funcShoppingCart[i].isActive) funcPayAmount = funcPayAmount + funcShoppingCart[i].priceUnit * funcShoppingCart[i].quantity if (funcShoppingCart[i].isActive) funcPayAmount = funcPayAmount + funcShoppingCart[i].priceUnit * funcShoppingCart[i].quantity
} }
this.setData({ this.setData({
shoppingCartList: funcShoppingCart, shoppingCartList: funcShoppingCart,
payAmount: App.modular.utils.formatAmount(funcPayAmount), payAmount: App.modular.utils.formatAmount(funcPayAmount),
...@@ -819,10 +817,6 @@ Page({ ...@@ -819,10 +817,6 @@ Page({
// 校验数组用户信息 // 校验数组用户信息
let funcRegisterInfo = this.data.registerInfo let funcRegisterInfo = this.data.registerInfo
console.log(funcRegisterInfo)
for (let i = 0, l = funcRegisterInfo.length; i < l; i++) { for (let i = 0, l = funcRegisterInfo.length; i < l; i++) {
if (funcRegisterInfo[i].name === '' || funcRegisterInfo[i].errorName !== '') { if (funcRegisterInfo[i].name === '' || funcRegisterInfo[i].errorName !== '') {
this.setUserInfo('name', funcRegisterInfo[i].name, i, App.modular.rule.item('name', funcRegisterInfo[i].name)) this.setUserInfo('name', funcRegisterInfo[i].name, i, App.modular.rule.item('name', funcRegisterInfo[i].name))
...@@ -1215,7 +1209,7 @@ Page({ ...@@ -1215,7 +1209,7 @@ Page({
default: default:
// 支付成功进入成功页面 // 支付成功进入成功页面
wx.reLaunch({ wx.reLaunch({
url: '/pages/pay/order-state/order-state?state=' + funcPayResult + '&amount=' + this.data.buyContentAmount + '&orderId=' + this.data.orderId url: '/pages/pay/order-state/order-state?state=' + funcPayResult + '&amount=' + this.data.payAmount + '&orderId=' + this.data.orderId
}) })
break break
} }
......
const App = getApp() let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({ Page({
data: { data: {
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
navScroll: 0,
navHeight: 0, tabItem: [{ text: '全部', value: 0}],
classHeight: 0, tabTop: wx.getStorageSync('navHeight'),
pageIndex: 1,
statusActive: 0,
statusList: [
{
id: '0',
name: '全部'
}
],
activity: [], activity: [],
selectedActivity: [], selectedActivity: [],
other: [], other: [],
...@@ -36,12 +24,85 @@ Page({ ...@@ -36,12 +24,85 @@ Page({
shopInfo: shopInfo shopInfo: shopInfo
}) })
} }
this.getActivityList(1)
this.getActivityList(0) this.queryActivityLately()
this.queryActivityExpire()
},
queryActivityLately: function () {
App.request({
url: 'v1/activity/getList',
params: {
'listType': 1,
'pageSize': 99,
'pageNo': 1,
}
}).then((response) => {
let funcData = response.data.list
let funcList = []
for (let i = 0, l = funcData.length; i < l; i++) {
let funcItem = {
'id': funcData[i].id,
'officeId': funcData[i].officeId,
'cover': funcData[i].cover,
'name': funcData[i].name,
'date': funcData[i].activeDate,
'describe': funcData[i].summary,
'beginDate': funcData[i].activeDate.split('-')[0],
'tagIds': funcData[i].tagIds,
'tagNames': funcData[i].tagNames,
'price': funcData[i].visitorPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcData[i].visitorPrice), // 普通价文本格式
'priceSpecial': funcData[i].ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcData[i].ownerPrice), // 业主价文本格式
'priceType': 1,
}
funcList.push(funcItem)
}
funcList = App.setPriceType(funcList)
this.setData({ this.setData({
navHeight: wx.getStorageSync('navStatusHeight') + wx.getStorageSync('navTitleHeight'), activity: funcList,
classHeight: 94 * wx.getStorageSync('unitProportion') selectedActivity: funcList,
}) })
}).catch((response) => {})
},
queryActivityExpire: function () {
App.request({
url: 'v1/activity/getList',
params: {
'listType': 0,
'pageSize': 10,
'pageNo': this.data.pageIndex,
}
}).then((response) => {
let funcData = response.data.list
let funcList = []
for (let i = 0, l = funcData.length; i < l; i++) {
let funcItem = {
'id': funcData[i].id,
'officeId': funcData[i].officeId,
'cover': funcData[i].cover,
'name': funcData[i].name,
'date': funcData[i].activeDate,
'describe': funcData[i].summary,
'beginDate': funcData[i].activeDate.split('-')[0],
'tagIds': funcData[i].tagIds,
'tagNames': funcData[i].tagNames,
'price': funcData[i].visitorPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcData[i].visitorPrice), // 普通价文本格式
'priceSpecial': funcData[i].ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcData[i].ownerPrice), // 业主价文本格式
'priceType': 1,
}
funcList.push(funcItem)
}
funcList = App.setPriceType(funcList)
this.setData({
other: this.data.other.concat(funcList),
selectedOther: this.data.selectedOther.concat(funcList),
})
}).catch((response) => {})
}, },
/** /**
...@@ -54,120 +115,6 @@ Page({ ...@@ -54,120 +115,6 @@ Page({
App.pageScroll(funcEvent, this) App.pageScroll(funcEvent, this)
}, },
//主题活动列表 type 1 近期 0 往期
getActivityList(type) {
let funcParam = {
listType: type,
pageSize: 20,
pageNo: 1,
}
if (this.data.shopInfo.id) funcParam.officeId = this.data.shopInfo.id
var that = this
App.wxRequest({
url: '/api/v1/activity/getList',
data: funcParam,
success: function (res) {
let tmpArr = [];
let funcData = res.data.list
funcData.forEach(item => {
let tmpItem = {
id: item.id,
officeId: item.officeId,
cover: item.cover,
name: item.name,
date: item.activeDate,//'6月30日-7月12日 10:00-12:00',
describe: item.summary,
beginDate: item.activeDate.split('-')[0],
tagIds: item.tagIds,
tagNames: item.tagNames,
price: item.visitorPrice, // 普通价
priceText: App.modular.utils.formatAmount(item.visitorPrice), // 普通价文本格式
priceSpecial: item.ownerPrice, // 业主价
priceSpecialText: App.modular.utils.formatAmount(item.ownerPrice), // 业主价文本格式
priceType: 1,
}
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (tmpItem.priceDiscount) {
tmpItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (tmpItem.price !== tmpItem.priceSpecial && funcUserType) {
tmpItem.priceType = 2
} else {
tmpItem.priceType = 3
}
}
tmpArr.push(tmpItem)
})
if (type == 1) {
that.setTabs(tmpArr)
that.setData({
activity: tmpArr,
selectedActivity: tmpArr
})
} else {
that.setData({
other: tmpArr,
selectedOther: tmpArr
})
}
}
})
},
// 设置标签
setTabs: function (tmpArr) {
let that = this
let statusList = this.data.statusList
let tagIds = []
let tagNames = []
tmpArr.forEach(item => {
tagIds = tagIds.concat(item.tagIds.split(','))
tagNames = tagNames.concat(item.tagNames)
})
tagIds = Array.from(new Set(tagIds))
tagNames = Array.from(new Set(tagNames))
for (let i=0, l=tagIds.length; i<l; i++) {
let status = {
id: tagIds[i],
name: tagNames[i]
}
statusList.push(status)
}
that.setData({
statusList
})
},
// 选择标签
onSelectionStatus: function (event) {
let index = event.currentTarget.dataset.index
let statusList = this.data.statusList
let selectedActivity = this.data.activity
let selectedOther = this.data.other
if (index !== 0) {
selectedActivity = selectedActivity.filter(item => {
item.tagNames = [].concat(statusList[index].name)
return item.tagIds.includes(statusList[index].id)
})
selectedOther = selectedOther.filter(item => {
return item.tagIds.includes(statusList[index].id)
})
}
this.setData({
selectedActivity,
selectedOther,
statusActive: index
})
wx.pageScrollTo({
scrollTop: 0,
duration: 0
})
},
// 活动报名 // 活动报名
onReport: function (event) { onReport: function (event) {
console.log(event) console.log(event)
...@@ -194,7 +141,7 @@ Page({ ...@@ -194,7 +141,7 @@ Page({
}) })
}, },
onActivityDetail: function (event) { onActivityLately: function (event) {
let index = event.currentTarget.dataset.index let index = event.currentTarget.dataset.index
let selectedActivity = this.data.selectedActivity let selectedActivity = this.data.selectedActivity
if (selectedActivity.length > 0) { if (selectedActivity.length > 0) {
...@@ -208,6 +155,20 @@ Page({ ...@@ -208,6 +155,20 @@ Page({
}) })
}, },
onActivityExpire: function (event) {
let index = event.currentTarget.dataset.index
let selectedOther = this.data.selectedOther
if (selectedOther.length > 0) {
selectedOther[index].quantity = 1
this.setShopInfo(selectedOther[index].officeId, 2)
}
wx.setStorageSync('shoppingCartBuffer', [selectedOther[index]])
wx.navigateTo({
url: '/pages/play/activity-detail/activity-detail?id=' + event.currentTarget.dataset.id
})
},
setShopInfo: function (funcShopId, funcShopType) { setShopInfo: function (funcShopId, funcShopType) {
for (let i = 0, l = App.globalData.shopId.length; i < l; i++) { for (let i = 0, l = App.globalData.shopId.length; i < l; i++) {
if (funcShopId === App.globalData.shopId[i].id) { if (funcShopId === App.globalData.shopId[i].id) {
...@@ -218,4 +179,13 @@ Page({ ...@@ -218,4 +179,13 @@ Page({
} }
} }
}, },
//开启下拉刷新
onReachBottom: function () {
console.log('onPullDownRefresh')
this.setData({
pageIndex: this.data.pageIndex + 1
})
this.queryActivityExpire()
},
}) })
\ No newline at end of file
{ {
"usingComponents": {} "usingComponents": {},
"enablePullDownRefresh": true
} }
\ No newline at end of file
<m-nav titleText="主题活动" scrollHeight="{{navScroll}}" styleIndex="{{1}}"></m-nav> <m-nav titleText="主题活动" scrollHeight="{{navScroll}}" styleIndex="{{1}}"></m-nav>
<m-tab item="{{tabItem}}" isFixed="{{true}}" fixedTop="{{tabTop}}"></m-tab>
<view class="status row align-c" style="{{'top: ' + navHeight + 'px'}}" wx:if="{{!options.fromPage}}"> <view class="container">
<block wx:for="{{statusList}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <!-- 近期活动 -->
<view class="status-item row con-c align-c" data-index="{{index}}" bindtap="onSelectionStatus">
<view class="row con-c align-c {{index === statusActive ? 'status-item-active' : ''}}">
<text>{{item.name}}</text>
</view>
</view>
</block>
</view>
<view class="container con-s" style="{{'margin-top: ' + classHeight + 'px;'}}">
<block wx:if="{{activity.length > 0}}"> <block wx:if="{{activity.length > 0}}">
<view class="list"> <view class="list">
<block wx:for="{{selectedActivity}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <block wx:for="{{activity}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="item" data-id="{{item.id}}" data-index="{{index}}" bindtap="onActivityDetail"> <view class="item" data-id="{{item.id}}" data-index="{{index}}" bindtap="onActivityLately">
<view class="item-cover" wx:if="{{item.cover !== ''}}"> <view class="item-cover" wx:if="{{item.cover !== ''}}">
<image src="{{item.cover}}" mode="aspectFill"></image> <image src="{{item.cover}}" mode="aspectFill"></image>
</view> </view>
...@@ -58,6 +50,7 @@ ...@@ -58,6 +50,7 @@
</view> </view>
</block> </block>
<!-- 往期活动 -->
<block wx:if="{{selectedOther.length > 0}}"> <block wx:if="{{selectedOther.length > 0}}">
<view class="title row"> <view class="title row">
<image src="./image/title-2.png"></image> <image src="./image/title-2.png"></image>
...@@ -68,7 +61,7 @@ ...@@ -68,7 +61,7 @@
<!-- 左侧列表 --> <!-- 左侧列表 -->
<view class="route-list-left"> <view class="route-list-left">
<block wx:for="{{selectedOther}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <block wx:for="{{selectedOther}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="route-item" wx:if="{{index % 2 === 0}}" data-id="{{item.id}}" data-index="{{index}}" bindtap="onActivityDetail"> <view class="route-item" wx:if="{{index % 2 === 0}}" data-id="{{item.id}}" data-index="{{index}}" bindtap="onActivityExpire">
<view class="row con-c align-c"> <view class="row con-c align-c">
<image src="{{item.cover}}" mode="aspectFill"></image> <image src="{{item.cover}}" mode="aspectFill"></image>
</view> </view>
...@@ -81,7 +74,7 @@ ...@@ -81,7 +74,7 @@
<!-- 右侧列表 --> <!-- 右侧列表 -->
<view class="route-list-right"> <view class="route-list-right">
<block wx:for="{{selectedOther}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <block wx:for="{{selectedOther}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="route-item" wx:if="{{index % 2 === 1}}" data-id="{{item.id}}" data-index="{{index}}" bindtap="onActivityDetail"> <view class="route-item" wx:if="{{index % 2 === 1}}" data-id="{{item.id}}" data-index="{{index}}" bindtap="onActivityExpire">
<view class="row con-c align-c"> <view class="row con-c align-c">
<image src="{{item.cover}}" mode="aspectFill"></image> <image src="{{item.cover}}" mode="aspectFill"></image>
</view> </view>
......
.tab {
position: fixed;
top: 0;
left: 0;
background: #FFFFFF;
}
.container { .container {
min-height: 100vh; min-height: 100vh;
padding-bottom: 100rpx; padding-bottom: 100rpx;
......
...@@ -406,6 +406,8 @@ Page({ ...@@ -406,6 +406,8 @@ Page({
winActivity: true, winActivity: true,
detailActivity: funcList detailActivity: funcList
}) })
console.log(JSON.stringify(this.data.detailActivity))
} }
}) })
}, },
......
...@@ -835,7 +835,7 @@ ...@@ -835,7 +835,7 @@
right: 0; right: 0;
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
margin: 0 0 10rpx 0; margin: 0 5rpx 10rpx 0;
border-radius: 4rpx; border-radius: 4rpx;
background: rgba(0, 0, 0, 0.4); background: rgba(0, 0, 0, 0.4);
} }
......
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
* onLoad: function () {}, * onLoad: function () {},
* 生命周期函数 * 生命周期函数
* *
* setXX: function () {},
* 初始,设置数据函数
*
* queryXX: function () {}, * queryXX: function () {},
* 数据查询函数 * 数据查询函数
* *
......
const output = { const output = {
// 测试环境 // 测试环境
baseUrl: 'https://sm-web.meiqicloud.com/api/', baseUrl: 'https://sm-web2.meiqicloud.com/api/',
// 正式环境 // 正式环境
// baseUrl: 'https://xsslc.cndrealty.com/', // baseUrl: 'https://xsslc.cndrealty.com/',
......
...@@ -10,6 +10,11 @@ let Output = { ...@@ -10,6 +10,11 @@ let Output = {
request: function (option) { request: function (option) {
let App = getApp() let App = getApp()
let funcToken = App.globalData.token
if (funcToken) {
option.header.token = funcToken
}
// 网络断开场景 // 网络断开场景
// if (!App.globalData.networkStatus) { // if (!App.globalData.networkStatus) {
// console.log('offline') // console.log('offline')
......
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