Commit 3c978cc1 by wjw

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

parents f3a4fb50 35dfa2ad
......@@ -17,23 +17,58 @@ Page({
shopRecommendB: [], // 顶部第二商店推荐
shopRecommendC: [], // 底部第一商店推荐
shopRecommendD: [], // 底部第二商店推荐
banner: [],
},
onLoad: function (option) {
// formPage=order&shopAppId=1&commodityType=5
this.setData({
option: option,
userInfo: wx.getStorageSync('userInfo')
})
this.setGreetingMessage()
// formPage=order&shopAppId=1&commodityType=5
this.queryShopCover()
},
onShow: function () {
this.queryRecommend()
},
queryShopCover: function () {
function shopCover(funcType, funcIndex) {
App.wxRequest({
url: '/api/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
......@@ -125,6 +160,8 @@ Page({
'officeId': funcShopInfo[0].shopId,
'genre': 5,
'tag': '202',
'pageNo': 1,
'pageSize': 4
},
success: (response) => {
let funcResponse = response.data
......@@ -152,6 +189,8 @@ Page({
'officeId': funcShopInfo[1].shopId,
'genre': 5,
'tag': '202',
'pageNo': 1,
'pageSize': 4
},
success: (response) => {
let funcResponse = response.data
......@@ -179,6 +218,8 @@ Page({
'officeId': funcShopInfo[2].shopId,
'genre': 4,
'tag': '202',
'pageNo': 1,
'pageSize': 4
},
success: (response) => {
let funcResponse = response.data
......@@ -206,6 +247,8 @@ Page({
'officeId': funcShopInfo[3].shopId,
'genre': 4,
'tag': '202',
'pageNo': 1,
'pageSize': 4
},
success: (response) => {
let funcResponse = response.data
......@@ -282,7 +325,6 @@ Page({
let funcShopAppId = event.currentTarget.dataset.id
let funcCommodityItem = event.currentTarget.dataset.item
console.log(funcCommodityItem)
this.setShopInfo(funcShopAppId, funcShopType)
wx.navigateTo({
url: '/pages/commodity/menu-food/menu-food?commodityId=' + funcCommodityItem.id + '&sideBarId=' + funcCommodityItem.sideBarId
......@@ -398,7 +440,6 @@ Page({
let funcShopAppId = event.currentTarget.dataset.id
let funcCommodityItem = event.currentTarget.dataset.item
console.log(funcCommodityItem)
this.setShopInfo(funcShopAppId, funcShopType)
wx.navigateTo({
url: '/pages/commodity/menu-food/menu-food?commodityId=' + funcCommodityItem.id + '&sideBarId=' + funcCommodityItem.sideBarId
......
......@@ -62,15 +62,15 @@
<view class="services-list col align-c">
<!-- 精灵鸟理想国 -->
<view class="services-list-item col align-c" data-id="{{3}}" bindtap="onBuyMembership">
<image src="{{resourcesBase + 'commodity/home/services-1.png'}}"></image>
<image src="{{banner[0]}}"></image>
</view>
<!-- 故宫海洋世界 -->
<view class="services-list-item col align-c" data-id="{{1}}" bindtap="onBuyPassCheck">
<image src="{{resourcesBase + 'commodity/home/services-2.png'}}"></image>
<image src="{{banner[1]}}"></image>
</view>
<!-- 元养水韵 -->
<view class="services-list-item col align-c" data-id="{{7}}" bindtap="onBuyService">
<image src="{{resourcesBase + 'commodity/home/services-3.png'}}"></image>
<image src="{{banner[2]}}"></image>
</view>
</view>
</view>
......@@ -86,11 +86,11 @@
</view>
<view class="reception-list col align-c">
<view class="reception-list-item col align-c" data-id="{{3}}" bindtap="onBuySupply">
<image src="{{resourcesBase + 'commodity/home/reception-1.png'}}"></image>
<image src="{{banner[3]}}"></image>
<text>儿童营地接待区</text>
</view>
<view class="reception-list-item col align-c" data-id="{{5}}" bindtap="onBuySupply">
<image src="{{resourcesBase + 'commodity/home/reception-2.png'}}"></image>
<image src="{{banner[4]}}"></image>
<text>拾光花坊</text>
</view>
</view>
......
......@@ -219,6 +219,7 @@ Page({
'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].genre, // 商品分类标识
'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识
'sideBarId': funcResponse[i].classifyId, // 商品标签
'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面
'price': funcResponse[i].sightseerPrice, // 普通价
......@@ -231,6 +232,7 @@ Page({
'describe': funcResponse[i].synopsis,
'describeDetail': '', // 商品描述详情,在点击详情时获得数据
'tags': funcResponse[i].tags,
'tagsText': '',
'notificationId': funcResponse[i].notificationId, // 下单须知
'quantityMin': 1,
......@@ -254,6 +256,11 @@ Page({
funcItem.priceType = 3
}
}
// 标签文本匹配
switch (funcItem) {
}
funcCommodityList.push(funcItem)
}
......
......@@ -166,8 +166,6 @@ Page({
winLoading: false,
commodityList: this.data.commodityList.concat(funcCommodityList),
})
console.log('1111', this.data.commodityList)
},
})
},
......@@ -277,13 +275,17 @@ Page({
winLoading: false,
commodityList: this.data.commodityList.concat(funcCommodityList),
})
console.log('2222', this.data.commodityList)
},
})
},
onBuy: function (event) {
/**
* 前往商品详情
* @function
* @param
* @returns
*/
onCommodityDetail: function (event) {
let funcCommodityInfo = event.currentTarget.dataset.item
// 补充必要参数
......@@ -293,18 +295,29 @@ Page({
funcCommodityInfo.isActive = true
wx.setStorageSync('shoppingCartBuffer', [funcCommodityInfo])
wx.navigateTo({
url: '/pages/play/service-sell/service-sell'
})
},
switch (wx.getStorageSync('shopInfoBuffer').appId) {
case 7:
wx.navigateTo({
url: '/pages/play/service-sell/service-sell'
})
break
/**
* 前往购买
* @function
* @param
* @returns
*/
onBuy: function (event) {
let funcCommodityInfo = event.currentTarget.dataset.item
default:
wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=' + funcCommodityInfo.typeId
})
}
// 补充必要参数
funcCommodityInfo.quantity = 1
funcCommodityInfo.quantityMin = 1
funcCommodityInfo.quantityMax = 1
funcCommodityInfo.isActive = true
wx.setStorageSync('shoppingCartBuffer', [funcCommodityInfo])
wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=' + funcCommodityInfo.typeId
})
},
})
\ No newline at end of file
......@@ -6,7 +6,7 @@
</view>
<block wx:for="{{commodityList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="project-wrapper col">
<view class="project-wrapper col" data-item="{{item}}" bindtap="onCommodityDetail">
<view class="project-cover">
<image src="{{item.cover}}"></image>
</view>
......@@ -64,7 +64,7 @@
</view>
</view>
<view class="project-btn" data-item="{{item}}" bindtap="onBuy">
<view class="project-btn" data-item="{{item}}" catchtap="onBuy">
<text>{{buyText}}</text>
</view>
</view>
......
......@@ -27,6 +27,11 @@
}
.project-name {
width: 606rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #15191F;
font-size: 34rpx;
font-weight: 600;
......
......@@ -28,10 +28,51 @@ Page({
onLoad: function (options) {
for (let i = 0, l = this.data.shopAppId.length; i < l; i++) {
this.queryBanner(this.data.shopAppId[i].appId, i)
this.queryPassCheck(this.data.shopAppId[i].appId, this.data.shopAppId[i].commodityType, i)
}
},
queryBanner: function (funcShopAppId, funcIndex) {
let funcType = ''
switch (funcShopAppId) {
case 1:
funcType = 3
break
case 3:
funcType = 2
if (funcIndex === 3) funcIndex = 2
break
case 7:
funcType = 4
break
}
App.wxRequest({
url: '/api/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
})
console.log(funcBanner)
}
})
},
queryPassCheck: function (funcShopAppId, funcCommodityType, funcIndex) {
let funcShopId = ''
for (let i = 0, l = App.globalData.shopId.length; i < l; i++) {
......@@ -143,6 +184,35 @@ Page({
this.setData({
shopCommodityData: funcShopCommodityData,
})
// 水养韵苑服务数据暂时固定
if (funcShopAppId === 7) {
let funcCommodityItem = funcCommodityList[0]
funcCommodityItem.cover = this.data.resourcesBase + 'shop/cover-7.png'
funcCommodityItem.name = 'SPA套餐'
funcCommodityItem.describe = ''
funcCommodityList = [funcCommodityItem]
App.wxRequest({
url: '/api/v1/commodity/getSpaPriceRange',
data: {
},
success: (response) => {
let funcResponse = response.data
funcCommodityItem.priceMin = App.modular.utils.formatAmount(funcResponse.sightseerPriceMin)
funcCommodityItem.priceMax = App.modular.utils.formatAmount(funcResponse.sightseerPriceMax)
funcCommodityItem.priceSpecialMin = App.modular.utils.formatAmount(funcResponse.ownerPriceMin)
funcCommodityItem.priceSpecialMax = App.modular.utils.formatAmount(funcResponse.ownerPriceMax)
let funcShopCommodityData = this.data.shopCommodityData
funcShopCommodityData[funcIndex] = funcCommodityList
this.setData({
shopCommodityData: funcShopCommodityData,
})
}
})
}
},
})
},
......@@ -170,6 +240,18 @@ Page({
},
/**
* 服务套餐
* @function
* @param {object} - event
* @returns
*/
onBuyService: function () {
wx.navigateTo({
url: '/pages/commodity/project-detail/project-detail'
})
},
/**
* banner 切换图片同步自定义标识组件
* @function
* @param {object} - funcEvent
......
......@@ -5,8 +5,7 @@
<swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="5000" duration="500" bindchange="eventSwiperChange">
<block wx:for="{{banner}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<swiper-item class="banner-swiper-item" data-item="{{item}}" bindtap="bannerClick">
{{item.id}}
<image class="banner-swiper-image" src="{{item.img}}"></image>
<image class="banner-swiper-image" src="{{item}}"></image>
</swiper-item>
</block>
</swiper>
......@@ -105,12 +104,20 @@
<block wx:if="{{item.priceType === 1}}">
<view >
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceDiscountText}}</text>
<text class="commodity-price-value">{{item.priceSpecialMin}}</text>
<text class="commodity-price-value">-</text>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceSpecialMax}}</text>
<text class="commodity-price-symbol">/人</text>
<text class="commodity-price-special">业主价</text>
</view>
<view class="commodity-price-through row con-e align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
<text>{{item.priceMin}}</text>
<text>-</text>
<text>¥</text>
<text>{{item.priceMax}}</text>
<text>/人</text>
</view>
</block>
......@@ -118,12 +125,20 @@
<block wx:if="{{item.priceType === 2}}">
<view>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceSpecialText}}</text>
<text class="commodity-price-value">{{item.priceSpecialMin}}</text>
<text class="commodity-price-value">-</text>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceSpecialMax}}</text>
<text class="commodity-price-symbol">/人</text>
<text class="commodity-price-special">业主价</text>
</view>
<view class="commodity-price-through row con-e align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
<text>{{item.priceMin}}</text>
<text>-</text>
<text>¥</text>
<text>{{item.priceMax}}</text>
<text>/人</text>
</view>
</block>
......@@ -131,7 +146,11 @@
<block wx:if="{{item.priceType === 3}}">
<view>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceText}}</text>
<text class="commodity-price-value">{{item.priceMin}}</text>
<text class="commodity-price-value">-</text>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceMax}}</text>
<text class="commodity-price-symbol">/人</text>
<text></text>
</view>
<view class="commodity-price-through row con-e align-c">
......@@ -141,7 +160,7 @@
</block>
<view class="commodity-price-operation row con-e align-c">
<button class="row con-c align-c" data-index="{{1}}" data-itemindex="{{index}}" bindtap="onBuy">查看服务</button>
<button class="row con-c align-c" data-index="{{1}}" data-itemindex="{{index}}" bindtap="onBuyService">查看服务</button>
</view>
</view>
</view>
......
......@@ -160,7 +160,7 @@ Page({
let funcShoppingCart = this.data.shoppingCart
if (funcShoppingCart[funcIndex].quantityMax <= funcShoppingCart[funcIndex].quantity) return
funcShoppingCart[funcIndex].quantity = funcShoppingCart[funcIndex].quantity + 1000
funcShoppingCart[funcIndex].quantity = funcShoppingCart[funcIndex].quantity + 1
this.setData({
shoppingCart: funcShoppingCart
})
......
......@@ -4,57 +4,129 @@ const App = getApp()
Page({
data: {
imageBase: App.globalData.appImageBase,
passListType: 1, // 0为单张卡 1为多张卡
passListType: 1, // 0为单张卡 1为多张卡
privateStatus: true,
swiperCurrent: 0,
passList: [
{
id: 0,
title: '精灵鸟理想国年卡',
name: '文碧海',
privateName: '文*海',
phone: '17633564488',
privatePhone: '176****4455',
idNum: '211222009900990090',
privateIdNum: '211222****0090',
codeNum: '2719 7092 0925',
codeImg: '',
useTime: '2019.09.30 - 2020.12.30'
}
]
shopConfig: App.globalData.shopId,
imageResourcesBase: App.globalData.appResourcesBase,
passList: []
},
onLoad: function (options) {
// if (options.type) options.type = Number(options.type)
// this.setData({
// passListType: options.type
// })
this.setView()
// this.setView()
App.login({
timeout: 0,
success: (result) => {
this.getCardList()
},
})
},
// 跳转订单详情
onOrderDetail: function (event) {
let orderId = event.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/pay/order-detail/order-detail?id=' + orderId,
})
},
// 多二维码 复制券码
setClipboard(e) {
const code = e.currentTarget.dataset.code
wx.setClipboardData({
data: code,
success(res) {
wx.showToast({
title: '复制成功',
})
}
})
},
//获取卡数据
getCardList() {
let that = this
wx.showLoading({
title: '加载中',
})
App.wxRequest({
url: '/api/v1/volume/getVolumeList',
data: {
status: "", //0已过期1待使用2已使用(""全部)
pageNo: 1,
pageSize: -1
},
success: function (res) {
wx.hideLoading({
success: (res) => {},
})
let list = res.data.map(item => {
let shopFilter = that.data.shopConfig.filter(k => {
return k.name.toLowerCase() == item.officeName.toLowerCase()
})
if (item.name.indexOf('年卡') != -1) {
item.cardType = 1
} else if (item.name.indexOf('月卡') != -1) {
item.cardType = 2
} else {
// 次票
item.cardType = 3
}
item.logo = shopFilter.length > 0 ? shopFilter[0].logo : ''
// 名字隐私
if (item.personName.length > 2) {
item.privateName = item.personName.substr(0, 1) + '*' + item.personName.substr(item.personName.length - 1)
} else {
item.privateName = item.personName.substr(0, 1) + '*'
}
// 手机号隐私
item.privatePhone = item.cellphone.substr(0, 3) + '****' + item.cellphone.substr(item.cellphone.length - 4)
// 身份证隐私
item.privateIdNum = item.identityCard.substr(0, 6) + '****' + item.identityCard.substr(item.identityCard.length - 4)
item.privateStatus = true
return item
})
let filterList = list.filter(item => {
return item.officeName == '儿童营地'
})
filterList.length = 1
that.setData({
passList: filterList
})
console.log(that.data.passList);
}
})
},
setView: function () {
switch (this.data.passListType) {
case 0:
this.setData({
passList: [
{
id: 0,
title: '精灵鸟理想国年卡',
name: '文碧海',
privateName: '文*海',
phone: '17633564488',
privatePhone: '176****4455',
idNum: '211222009900990090',
privateIdNum: '211222****0090',
codeNum: '2719 7092 0925',
codeImg: '',
useTime: '2019.09.30 - 2020.12.30'
}
]
passList: [{
id: 0,
title: '精灵鸟理想国年卡',
name: '文碧海',
privateName: '文*海',
phone: '17633564488',
privatePhone: '176****4455',
idNum: '211222009900990090',
privateIdNum: '211222****0090',
codeNum: '2719 7092 0925',
codeImg: '',
useTime: '2019.09.30 - 2020.12.30'
}]
})
break
case 1:
this.setData({
passList: [
{
passList: [{
id: 0,
title: '精灵鸟理想国年卡',
name: '文碧海',
......@@ -65,7 +137,8 @@ Page({
privateIdNum: '211222****0090',
codeNum: '2719 7092 0925',
codeImg: '',
useTime: '2019.09.30 - 2020.12.30'
useTime: '2019.09.30 - 2020.12.30',
cardType: 1
},
{
id: 0,
......@@ -78,7 +151,8 @@ Page({
privateIdNum: '211222****0090',
codeNum: '2719 7092 0925',
codeImg: '',
useTime: '2019.09.30 - 2020.12.30'
useTime: '2019.09.30 - 2020.12.30',
cardType: 2
},
{
id: 0,
......@@ -91,7 +165,8 @@ Page({
privateIdNum: '211222****0090',
codeNum: '2719 7092 0925',
codeImg: '',
useTime: '2019.09.30 - 2020.12.30'
useTime: '2019.09.30 - 2020.12.30',
cardType: 1
}
]
})
......@@ -99,18 +174,23 @@ Page({
}
},
// 滑动swiper
eventSwiperChange: function(e) {
eventSwiperChange: function (e) {
let swiperCurrent = e.detail.current
this.setData({
swiperCurrent
})
},
//点击信息是否加密
onShowPrivate: function () {
let privateStatus = !this.data.privateStatus
onShowPrivate: function (event) {
let index = event.currentTarget.dataset.index
let passList = `passList[${index}].privateStatus`
this.setData({
privateStatus
[passList]: !this.data.passList[index].privateStatus
})
}
})
\ No newline at end of file
......@@ -3,7 +3,12 @@
padding-top: 232rpx;
background: linear-gradient(180deg, #FFFCFC 0%, #F6DADA 100%);
}
.card-bg {
position: absolute;
left: 0;
top: 0;
z-index: -1;
}
.card-list {
width: 750rpx;
height: 1062rpx;
......@@ -24,8 +29,9 @@
height: 326rpx;
padding: 48rpx 32rpx;
color: #fff;
background: linear-gradient(137deg, #BEDAF9 0%, #7BB2F0 100%);
/* background: linear-gradient(137deg, #BEDAF9 0%, #7BB2F0 100%); */
border-radius: 4rpx;
z-index: 0;
}
.use-notice {
position: absolute;
......@@ -56,10 +62,10 @@
line-height: 52rpx;
}
.card-info-visible {
width: 36rpx;
height: 20rpx;
width: 40rpx;
height: 40rpx;
margin-left: 18rpx;
background-color: #ccc;
/* background-color: #ccc; */
}
.card-main {
......
......@@ -31,6 +31,7 @@ Page({
type: 0, //判断是否是认证的了
approveList: ['园区门票优惠', '餐厅价格优惠', 'SPA服务优惠', '免费观看电影', '无须预约入园', '尽享多重特权'],
activityList: [],
activityListBackup: [],
isRegister: false, // 是否注册,
// 右上角消息
......@@ -380,38 +381,23 @@ Page({
App.wxRequest({
url: '/api/v1/activity/getMyActivityList',
data: {
activeState: '0,1',
pageSize: 10,
pageNo: 1
activeState: '1',
pageSize: 2,
pageNo: 1,
type: 1
},
success: function (res) {
let list = res.data.list
let tmpArr = []
list.forEach(item => {
let state = item.activeState * 1
let type = 0
switch (state) {
case 0:
type = 1;
break;
case 1:
type = 0;
break;
case 2:
type = 2;
break;
}
let obj = {
time: item.enrollDate, //activeDate + ' ' + item.activeTime,
type: type,
content: item.address,
title: item.name,
enrollId: item.enrollId,
}
tmpArr.push(obj)
})
let sliceList = []
let activityListBackup = JSON.parse(JSON.stringify(list))
if (list.length > 2) {
sliceList = list.slice(0, 2)
} else {
sliceList = list
}
that.setData({
activityList: tmpArr
activityList: sliceList,
activityListBackup
})
}
})
......@@ -489,8 +475,6 @@ Page({
let showMoreOrder = !this.data.showMoreOrder
let orderList = `myOrder.artOrder.orderList`
console.log(JSON.parse(JSON.stringify(this.data.orderListBackup)));
if (showMoreOrder) {
// 展开
this.setData({
......@@ -512,10 +496,27 @@ Page({
},
// 我的预约 展开 收起
onShowMoreActivity: function () {
let showMoreActivity = !this.data.showMoreActivity
if (showMoreActivity) {
//展开
this.setData({
activityList: JSON.parse(JSON.stringify(this.data.activityListBackup))
})
} else {
// 收起
let list = JSON.parse(JSON.stringify(this.data.activityListBackup))
let sliceList = list.slice(0, 2)
this.setData({
activityList: sliceList
})
}
this.setData({
showMoreActivity
showMoreActivity,
})
}
})
\ No newline at end of file
......@@ -255,45 +255,30 @@
</view>
</view>
<!-- 预约卡片 -->
<view class="appintment" >
<view class="appintment">
<!-- 主题活动 -->
<view class="appointment-wrapper">
<view class="appointment-time">8月15日-7月15日 10:00-12:00</view>
<view class="appointment-wrapper" wx:for="{{activityList}}" wx:key="*this">
<view class="appointment-time">{{item.activeTime}}</view>
<view class="appointment-activity-content row">
<view class="appointment-activity-img">
<image src=""></image>
<image src="{{item.cover}}"></image>
</view>
<view class="appointment-activity-info col con-a">
<view class="appointment-activity-title">
<text>日落观光游船体验活动</text>
<text>{{item.name}}</text>
</view>
<view class="appointment-activity-num">
<text>报名人数 3人</text>
<text>报名人数 {{item.number}}人</text>
</view>
</view>
</view>
</view>
<view class="appointment-wrapper">
<view class="appointment-time">
<text>8月15日-7月15日 10:00-12:00</text>
</view>
<view class="appointment-activity-content row">
<view class="appointment-activity-img">
<image src=""></image>
</view>
<view class="appointment-activity-info col con-a">
<view class="appointment-activity-title">
<text>日落观光游船体验活动之船行碧波共赏美景</text>
</view>
<view class="appointment-activity-num">
<text>报名人数 3人</text>
</view>
</view>
</view>
</view>
<!-- 夜间入园预约 -->
<view class="appointment-wrapper">
<!-- <view class="appointment-wrapper">
<view class="appointment-time">
<text>7月15日 10:00-12:00</text>
</view>
......@@ -307,12 +292,12 @@
</view>
</view>
<view class="border-right"></view>
<!-- <view class="appointment-subscribe" data-item="{{item}}" bindtap="gohotelAccommodation">预约凭证
</view> -->
<view class="appointment-subscribe" data-item="{{item}}" bindtap="gohotelAccommodation">预约凭证
</view>
</view>
</view>
</view> -->
<!-- 看房预约 -->
<view class="appointment-wrapper">
<!-- <view class="appointment-wrapper">
<view class="appointment-time">
<text>7月15日 10:00-12:00</text>
</view>
......@@ -326,10 +311,11 @@
<view class="appointment-subscribe" data-item="{{item}}" bindtap="gohotelAccommodation">预约凭证
</view>
</view>
</view>
</view> -->
</view>
<!-- more -->
<view class="more row align-c con-c" bindtap="onShowMoreActivity" >
<view class="more row align-c con-c" bindtap="onShowMoreActivity" wx:if="{{activityList.length>1}}">
<text wx:if="{{!showMoreActivity}}">展开更多</text>
<text wx:else>收起</text>
<image wx:if="{{!showMoreActivity}}" src="{{imageBase + 'icon/arrow-b-2.png'}}"></image>
......
......@@ -506,11 +506,7 @@
height: 50rpx;
}
.pass-logo-wrapper image {
/* width: 64rpx;
height: 50rpx; */
/* background-color: #ccc; */
}
.pass-logo-wrapper text {
height: 50rpx;
......@@ -628,6 +624,7 @@
width: 140rpx;
height: 136rpx;
background-color: #ccc;
border-radius: 5px;
}
.appointment-activity-info {
......
......@@ -42,10 +42,14 @@ Page({
noticeText: '购买须知',
// 预约选择组件属性
entryDate: '',
entryStartDate: '',
entryEndDate: '',
// 预约时间选择组件
entryId: '',
entryDate: [], // 数据对象
entrySelection: '', // 当前选择
entryDateList: [], // 日期数组
entryTimeList: [], // 时间数组
entryDateIndex: 0, // 时间选择索引
// 数量选择组件属性
quantityTitle: '',
......@@ -85,6 +89,7 @@ Page({
stockList: [],
winStockTip: false,
},
onLoad: function (options) {
console.log(options)
if (options.type) options.type = Number(options.type)
......@@ -240,7 +245,7 @@ Page({
winButtonPay: true, // 立即支付
winButtonAppointment: false, // 确认预约
})
this.setStock()
this.setEntryTime()
break
case 7:
......@@ -308,7 +313,6 @@ Page({
setShoppingCartData: function () {
// 读取上级页面的购物车数据,默认选中所有。
let funcShoppingCart = wx.getStorageSync('shoppingCartBuffer')
console.log(JSON.stringify(funcShoppingCart))
// 设置商品单位价格
let funcPriceUnit = 0
......@@ -379,6 +383,99 @@ Page({
},
/**
* 设置活动场次时间
* @function
* @param
* @returns
*/
setEntryTime: function () {
let funcItem = wx.getStorageSync('shoppingCartBuffer')[0]
App.wxRequest({
url: '/api/v1/activity/getEnrollView',
data: {
'id': funcItem.id,
},
success: (response) => {
let funcResponse = response.data
console.log(funcResponse)
let funcTimetable = funcResponse.activityTimes
let funcDate = []
let funcDateList = []
let funcTimeList = []
let funcListIndex = -1
let funcActiveTime = ''
for (let i = 0, l = funcTimetable.length; i < l; i++) {
let funcDateString = App.modular.miment(funcTimetable[i].beginTime).format('YYYY-MM-DD')
let funcTimeString = App.modular.miment(funcTimetable[i].beginTime).format('hh:mm:ss')
if (funcActiveTime === funcDateString) {
// 渲染数组
funcTimeList[funcListIndex].push(funcTimeString)
// 映射数据
funcDate[funcListIndex].push(funcTimetable[i])
} else {
// 渲染数据
funcActiveTime = funcDateString
funcListIndex = funcListIndex + 1
funcDateList.push(funcDateString)
funcTimeList[funcListIndex] = [funcTimeString]
// 映射数据
funcDate[funcListIndex] = [funcTimetable[i]]
}
}
this.setData({
entryDate: funcDate,
entrySelection: funcDateList[0] + ' ' + funcTimeList[0][0],
entryDateList: [funcDateList, funcTimeList[0]],
entryTimeList: funcTimeList,
quantityTipNumber: funcDate[0][0].residue
})
}
})
},
/**
* 选择数值事件
* @function
* @param
* @returns
*/
onEntryTime: function (event) {
let funcIndex = event.detail.value
this.setData({
entrySelection: this.data.entryDateList[0][funcIndex[0]] + ' ' + this.data.entryTimeList[this.data.entryDateIndex][funcIndex[1]],
entryId: this.data.entryDate[funcIndex[0]][funcIndex[1]].id,
quantityTipNumber: this.data.entryDate[funcIndex[0]][funcIndex[1]].residue
})
},
/**
* 选择滚动事件
* @function
* @param
* @returns
*/
onEntryTimeChange: function (event) {
console.log(event.detail)
let funcColumn = event.detail.column
let funcIndex = event.detail.value
let funcDateList = this.data.entryDateList
funcDateList[1] = this.data.entryTimeList[funcIndex]
if (funcColumn === 0) {
this.setData({
entryDateList: funcDateList,
entryDateIndex: funcIndex,
})
}
},
/**
* 同步库存信息
* @function
* @param
......@@ -491,8 +588,6 @@ Page({
clearTimeout(funcTimer)
}, 100)
console.log(this.data.shoppingCartList)
App.wxRequest({
url: '/api/v1/commodity/getNotification',
data: {
......@@ -698,7 +793,7 @@ Page({
App.wxRequest({
url: '/api/v1/order/doOrder',
data: {
'isPayment': 2,
'isPayment': Number(this.data.payAmount) === 0 ? 0 : 2,
'totalMoney': Number(this.data.payAmount),
'office': { 'id': this.data.shopInfo.id },
'smOrderDetails': funcCommodity,
......@@ -708,6 +803,10 @@ Page({
'goodType': this.data.shopInfo.shopType,
},
success: (response) => {
console.log('------------------')
console.log(response)
if (/价格不一致/.test(response.data.msg)) {
wx.lin.showToast({
title: '价格已变更,请重新下单。',
......@@ -756,6 +855,11 @@ Page({
orderId: pagePayId
})
// 支付金额为零,默认支付成功
if (Number(this.data.payAmount) === 0) {
this.payStatus(true)
return
}
wx.requestPayment({
'timeStamp': funcResponse.timeStamp,
'nonceStr': funcResponse.nonceStr,
......@@ -782,6 +886,11 @@ Page({
// 开启支付状态轮询
// wx.showLoading({ title: '正在获取数据', mask: true })
this.queryPayStatus(pagePayId)
},
fail: (error) => {
this.setData({
isPaySubmit: true,
})
}
})
},
......
......@@ -167,8 +167,8 @@
<text>报名时间</text>
</view>
<view class="entry-input row con-b align-c">
<picker class="row con-b align-c" mode="date" value="{{entryDate}}" start="{{entryStartDate}}" end="{{entryEndDate}}" bindchange="onSelectionDate">
<text>{{'2020-20-20'}}</text>
<picker class="row con-b align-c" mode="multiSelector" value="{{entryDate}}" range="{{entryDateList}}" bindcolumnchange="onEntryTimeChange" bindchange="onEntryTime">
<text>{{entrySelection}}</text>
</picker>
<image class="input-icon" src="{{imageBase + 'more.png'}}"></image>
</view>
......@@ -312,7 +312,7 @@
<view class="stock-tip row con-c align-c">
<text>{{'抱歉,您本单商品有' + stockList.length + '件库存不足'}}</text>
</view>
<view class="stock-info col con-c align-c">
<view class="stock-info col align-c">
<block wx:for="{{stockList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="stock-item row align-c">
<image src="{{item.cover}}"></image>
......
......@@ -41,10 +41,72 @@ Page({
this.setData({
id: options.id
})
var that = this
App.login({
success: function () {
that.getActivityDetail()
this.queryActivityDetail()
},
//主题活动详情
queryActivityDetail: function () {
App.wxRequest({
url: '/api/v1/activity/getDetail',
data: { id: this.data.id },
success: (response) => {
let funcResponse = response.data
let funcItem = {
'id': funcResponse.id, // 商品标识
'typeId': '', // 商品分类标识
'inventoriesId': '', // 仓库标识
'dateValid': '', // 有效时间
'dateInvalid': '', // 失效时间
'name': funcResponse.name,
'cover': funcResponse.banners, // 商品封面
'price': funcResponse.visitorPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse.visitorPrice), // 普通价文本格式
'priceSpecial': funcResponse.ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcResponse.ownerPrice), // 业主价文本格式
'priceDiscount': funcResponse.price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcResponse.price), // 活动价文本格式
'priceType': 1,
'describe': funcResponse.summary,
'tags': '',
'notificationId': '', // 下单须知
// 补充必要参数
'quantity': 1,
'quantityMin': 1,
'quantityMax': 1,
'isActive': true,
'activityTimetable': funcResponse.activityTimes, // 场次库存信息
}
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcItem.priceDiscount) {
funcItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
funcItem.priceType = 2
} else {
funcItem.priceType = 3
}
}
wx.setStorageSync('shoppingCartBuffer', [funcItem])
this.setData({
banner: funcResponse.banners,
info: {
title: funcResponse.name,
date: funcResponse.activeDate + ' ' + funcResponse.activeTime,
address: funcResponse.address,
quota: funcResponse.enrollNum,
describe: funcResponse.content,
// contact: response.contact,
}
})
this.configActiveState(funcResponse.activeState * 1)
}
})
},
......@@ -69,30 +131,6 @@ Page({
})
},
//主题活动详情
getActivityDetail() {
var that = this
App.wxRequest({
url: '/api/v1/activity/getDetail',
data: { id: that.data.id },
success: function (res) {
var response = res.data
that.setData({
banner: response.banners,
info: {
title: response.name,
date: response.activeDate + ' ' + response.activeTime,
address: response.address,
quota: response.enrollNum,
describe: response.content,
// contact: response.contact,
}
})
that.configActiveState(response.activeState * 1)
}
})
},
configActiveState(state) {
var text = this.data.stateText
switch (state) {
......
......@@ -10,7 +10,6 @@ Page({
},
onLoad: function (options) {
console.log(options.fromPage)
if (options.fromPage === 'serviceDetail') this.setData({ shopInfo: wx.getStorageSync('shopInfoBuffer')})
this.getActivityList(1)
......@@ -18,7 +17,6 @@ Page({
},
onActivityDetail: function (funcItem) {
console.log('onActivityDetail')
wx.navigateTo({
url: '/pages/play/activity-detail/activity-detail?id=' + funcItem.currentTarget.dataset.id
})
......
......@@ -5,6 +5,7 @@
}
.container {
min-height: 100%;
margin-top: 120rpx;
background: linear-gradient(#ffffff, #F2F2F2);
}
......
......@@ -80,7 +80,6 @@ Page({
this.setData({
option: options,
})
console.log('shopId', Number(options.id))
this.queryDetail(Number(options.id))
......@@ -390,7 +389,6 @@ Page({
'officeId': this.data.shopInfo.id,
},
success: (response) => {
console.log(JSON.stringify(response))
this.setData({
winActivity: true
})
......@@ -418,7 +416,8 @@ Page({
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].genre, // 商品分类标识
'typeId': funcResponse[i].genre, // 商品类别标识
'sidebarId': funcResponse[i].classifyId, // 商品分类标识
'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面
'price': funcResponse[i].sightseerPrice, // 普通价
......
......@@ -4,32 +4,13 @@ Page({
data: {
bannerIndex: 0,
bannerStyle: 1,
banner: [
{
id: 0,
img: ''
},
{
id: 1,
img: ''
},
{
id: 2,
img: ''
}
],
serviceInfo: {
name: '竹子热油放松SPA',
time: '90 mins',
address: '元养水韵SPA',
content: '适合肌肉酸痛,容易疲乏、忧郁症、运动型等人群。竹子是生命能量的一种象征,此疗程是结合ADS舒压芳香精油特殊的气体对人体进行一种温暖放松的理疗,通过竹子在人体肌肉上的滚动,压按,深层反射肌肉,舒缓神经,有效改善睡眠,提高健康质量。',
priceSpecial: '880',
price: '890',
}
banner: [],
serviceInfo: {}
},
onLoad: function (options) {
this.queryCommodityDetail()
},
/**
* banner 切换图片同步自定义标识组件
* @function
......@@ -41,7 +22,8 @@ Page({
bannerIndex: funcEvent.detail.current
})
},
/**
/**
* 点击地址
* @function
* @param
......@@ -63,8 +45,50 @@ Page({
'genre': funcCommodity.typeId,
},
success: (response) => {
let funcResponse = response.data
let funcItem = {
'name': funcResponse.name,
'time': funcResponse.spaMins,
'address': '元养水韵SPA',
'content': funcResponse.particulars,
'price': funcResponse.sightseerPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse.sightseerPrice), // 普通价文本格式
'priceSpecial': funcResponse.ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcResponse.ownerPrice), // 业主价文本格式
'priceDiscount': funcResponse.price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcResponse.price), // 活动价文本格式
'priceType': 1,
}
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcItem.priceDiscount) {
funcItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
funcItem.priceType = 2
} else {
funcItem.priceType = 3
}
}
this.setData({
banner: funcResponse.imgs.replace(/\|$/, '').split('|'),
serviceInfo: funcItem
})
}
})
},
onBuy: function () {
let funcShopInfo = wx.getStorageSync('shopInfoBuffer')
wx.setStorageSync('shoppingCartBuffer', [this.data.serviceInfo])
wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=' + funcShopInfo.shopType
})
},
})
\ No newline at end of file
......@@ -5,8 +5,7 @@
<swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="5000" duration="500" bindchange="onSwiperChange">
<block wx:for="{{banner}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<swiper-item class="banner-swiper-item" data-item="{{item}}" bindtap="bannerClick">
{{item.id}}
<image class="banner-swiper-image" src="{{item.img}}"></image>
<image class="banner-swiper-image" src="{{item}}"></image>
</swiper-item>
</block>
</swiper>
......@@ -52,21 +51,55 @@
<text>{{serviceInfo.content}}</text>
</view>
<view class="footer-wrapper row align-c">
<view class="special-msg">
<text>业主价</text>
</view>
<view class="price-special">
<text class="price-special-symbol">¥</text>
<text>{{serviceInfo.priceSpecial}}</text>
</view>
<view class="price-special-unit">
<text>/人</text>
</view>
<view class="price-old">
<text>{{'¥' + serviceInfo.price}}</text>
<text class="price-old-unit">/人 </text>
</view>
<view class="footer-btn">
<!-- 活动价样式 -->
<block wx:if="{{serviceInfo.priceType === 1}}">
<view class="special-msg">
<text>活动价</text>
</view>
<view class="price-special">
<text class="price-special-symbol">¥</text>
<text>{{serviceInfo.priceDiscountText}}</text>
</view>
<view class="price-special-unit">
<text>/人</text>
</view>
<view class="price-old">
<text>{{'¥' + serviceInfo.priceText}}</text>
<text class="price-old-unit">/人 </text>
</view>
</block>
<!-- 业主价样式 -->
<block wx:if="{{serviceInfo.priceType === 2}}">
<view class="special-msg">
<text>业主价</text>
</view>
<view class="price-special">
<text class="price-special-symbol">¥</text>
<text>{{serviceInfo.priceSpecialText}}</text>
</view>
<view class="price-special-unit">
<text>/人</text>
</view>
<view class="price-old">
<text>{{'¥' + serviceInfo.priceText}}</text>
<text class="price-old-unit">/人 </text>
</view>
</block>
<!-- 普通价样式 -->
<block wx:if="{{serviceInfo.priceType === 3}}">
<view class="price-special">
<text class="price-special-symbol">¥</text>
<text>{{serviceInfo.priceText}}</text>
</view>
<view class="price-special-unit">
<text>/人</text>
</view>
</block>
<view class="footer-btn" bindtap="onBuy">
<text>立即购买</text>
</view>
</view>
......
......@@ -14,20 +14,20 @@
background-color: #ccc;
}
.banner-swiper,
.banner-swiper-item,
.banner-swiper-image {
.banner-swiper, .banner-swiper-item, .banner-swiper-image {
position: absolute;
top: 0 !important;
left: 0 !important;
width: 750rpx;
height: 800rpx;
}
.banner-swiper-point {
position: relative;
top: 702rpx;
left: 0;
}
.banner-wave {
position: absolute;
top: 754rpx;
......@@ -40,39 +40,46 @@
width: 670rpx;
margin-top: 50rpx;
padding-bottom: 36rpx;
border-bottom: 1px solid #E2E7EF;
border-bottom: 1px solid #e2e7ef;
}
.service-name {
height: 120rpx;
color: #15191F;
color: #15191f;
font-size: 54rpx;
font-weight: 600;
}
.time-address-wrapper {
height: 82rpx;
font-size: 30rpx;
}
.time-address-title {
margin-left: 8rpx;
color: #959DA9;
color: #959da9;
}
.time-address {
flex: 1;
margin-left: 25rpx;
color: #000000;
color: #000;
}
.service-icon {
width: 40rpx;
height: 40rpx;
}
.service-content {
width: 670rpx;
margin: 56rpx 0;
color: #15191F;
color: #15191f;
font-size: 30rpx;
line-height: 50rpx;
font-weight: 300;
}
.footer-wrapper {
position: fixed;
left: 0;
......@@ -81,40 +88,62 @@
height: 196rpx;
padding: 32rpx 40rpx 68rpx;
background-color: #fff;
border-top: 1px solid #E2E7EF;
border-top: 1px solid #e2e7ef;
}
/* 价格样式 */
.price-discount {
width: 78rpx;
height: 36rpx;
margin-right: 12rpx;
color: #EF4E4E;
font-size: 18rpx;
line-height: 36rpx;
text-align: center;
background: #FAEDEA;
border-radius: 4rpx;
}
.special-msg {
width: 78rpx;
height: 36rpx;
margin-right: 12rpx;
color: #E8D0AF;
color: #e8d0af;
font-size: 18rpx;
line-height: 36rpx;
text-align: center;
background: linear-gradient(180deg, #3F4357 0%, #252532 100%);
background: linear-gradient(180deg, #3f4357 0%, #252532 100%);
border-radius: 4rpx;
}
.price-special {
color: #15191F;
color: #15191f;
font-size: 38rpx;
}
.price-special-symbol {
font-size: 26rpx;
}
.price-special-unit {
margin-left: 4rpx;
color: #15191F;
color: #15191f;
font-size: 26rpx;
}
.price-old {
margin-left: 16rpx;
color: #C2C7CF;
color: #c2c7cf;
font-size: 30rpx;
text-decoration: line-through;
}
.price-old-unit {
font-size: 26rpx;
}
.footer-btn {
position: absolute;
right: 40rpx;
......@@ -124,11 +153,11 @@
font-size: 30rpx;
line-height: 96rpx;
text-align: center;
background-color: #86C5E1;
background-color: #86c5e1;
border-radius: 4rpx;
}
image {
width: 100%;
height: 100%;
}
\ No newline at end of file
}
const App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
const App = getApp()
Page({
data: {
// 导航栏相关属性
navigationStyle: {
normal: {
backIcon: '/image/back-w.png',
color: '#FFFFFF',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(255, 255, 255, 1)'
},
scroll: '750rpx',
},
navigationScroll: 0,
isNavigationWhite: false,
banner: [],
bannerIndex: 0,
title: '',
......@@ -133,6 +152,22 @@ Page({
}
},
onPageScroll: function (funcEvent) {
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 10)
},
/**
* banner 变换事件
* @function
......
<!-- 首页 - 游客攻略 -->
<navigation
class="navigation"
titleText="攻略详情"
color="{{isNavigationWhite ? '#000000' : '#ffffff'}}"
background="{{isNavigationWhite ? '#ffffff' : 'rgba(0, 0, 0, 0)'}}"
backIcon="{{isNavigationWhite ? '/image/back.png' : '/image/back-w.png'}}"
>
</navigation>
<navigation class="navigation" titleText="攻略详情" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<view class="container">
<view id="banner" class="banner">
......
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