Commit c40da588 by wjw

观影

parents 2e7654c7 01a66768
Showing with 775 additions and 1215 deletions
......@@ -32,7 +32,7 @@ App({
onLaunch: function () {
this.setUnitProportion()
// this.login()
this.login()
},
setUnitProportion: function () {
......@@ -72,11 +72,7 @@ App({
obj.success(res.data)
}
} else if (402 == code) {
this.refreshToken({
success: () => {
this.wxRequest(obj)
}
})
this.refreshToken(obj)
} else if (500 === code) {
if (obj.success) {
obj.success(res)
......@@ -164,7 +160,7 @@ App({
wx.setStorageSync('userInfo', funcUserInfo)
if (obj.success) {
if (obj && obj.success) {
obj.success(funcResponse.token)
}
},
......@@ -244,16 +240,6 @@ App({
},
/**
* 令牌有效性判断
* @function
* @param
* @returns
*/
tokenInspect: function () {
let funcToken = wx.getStorageSync()
},
/**
* 刷新令牌
* @function
* @param
......@@ -266,20 +252,31 @@ App({
token: this.globalData.token,
refreshToken: this.globalData.refreshToken
},
success: (res) => {
// { "msg": "登录失效", "code": 402, "success": true }
success: (response) => {
let funcResponse = response.data
switch (Number(funcResponse.code)) {
case 200:
this.globalData.token = funcResponse.token
this.globalData.refreshToken = funcResponse.refreshToken
wx.setStorageSync('token', funcResponse.token)
wx.setStorageSync('tokenRefresh', funcResponse.refreshToken)
let token = res.data.token
let refreshToken = res.data.refreshToken
this.wxRequest(obj)
break
this.globalData.token = token
this.globalData.refreshToken = refreshToken
case 402:
this.globalData.token = ''
this.globalData.refreshToken = ''
if (obj.success) {
obj.success()
// 记录原始请求参数
let funcCallBackFunction = {
success: () => {
this.wxRequest(obj)
}
}
this.login(funcCallBackFunction)
break
}
}
})
......
{
"pages": [
"pages/home/home/home",
"pages/home/dynamic/dynamic",
"pages/home/dynamic-detail/dynamic-detail",
......
......@@ -273,6 +273,10 @@ Page({
}
}
}
// 查询之后参数失效,避免返回页面时继续查询
this.setData({
option: {}
})
this.onCommodityDetail(funcEvent)
break
}
......
......@@ -18,6 +18,9 @@ Page({
}, {
'appId': 3,
'commodityType': 1,
}, {
'appId': 3,
'commodityType': 3,
}
],
shopCommodityData: [],
......
......@@ -153,7 +153,7 @@
<view class="shop-item">
<view class="shop-name row align-c">
<image src="{{resourcesBase + 'shop/logo-3.png'}}" style="width: 64rpx; height: 50rpx;"></image>
<text>元养水韵SPA</text>
<text>儿童营地</text>
</view>
<view class="commodity-list">
<block wx:for="{{shopCommodityData[2]}}" wx:for-index="index" wx:for-item="item" wx:key="index">
......@@ -212,6 +212,63 @@
</view>
</view>
</block>
<block wx:for="{{shopCommodityData[3]}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="commodity-item row">
<view class="commodity-cover">
<image src="{{item.cover}}"></image>
</view>
<view class="commodity-describe">
<text>{{item.name}}</text>
<text>{{item.describe}}</text>
</view>
<view class="commodity-price">
<!-- 活动价样式 -->
<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-special">业主价</text>
</view>
<view class="commodity-price-through row con-e align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
</view>
</block>
<!-- 业主价样式 -->
<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-special">业主价</text>
</view>
<view class="commodity-price-through row con-e align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
</view>
</block>
<!-- 普通价样式 -->
<block wx:if="{{item.priceType === 3}}">
<view>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceText}}</text>
<text></text>
</view>
<view class="commodity-price-through row con-e align-c">
<text></text>
<text></text>
</view>
</block>
<view class="commodity-price-operation row con-e align-c">
<button class="row con-c align-c" data-index="{{3}}" data-itemindex="{{index}}" bindtap="onBuy">购买门票</button>
</view>
</view>
</view>
</block>
</view>
</view>
</view>
......
......@@ -5,9 +5,6 @@ Page({
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
navigationTitle: '123213231',
formType: 1,
appointmentDate: '',
appointmentEndDate: '',
appointmentComplete: false,
......@@ -22,19 +19,12 @@ Page({
errorQuantity: '',
canSubmit: false,
winQuota: false,
// 预约入园剩余名额
total: 0,
},
onLoad: function (options) {
this.setData({
formType: Number(options.type),
navigationTitle: Number(options.type) === 1 ? '夜间入园预约' : '看房预约'
})
console.log(options.type)
this.setReset()
},
......@@ -44,14 +34,11 @@ Page({
this.setData({
formName: '',
formPhone: '',
formQuantity: this.data.formType === 1 ? 0 : 1,
formQuantity: 1,
formDate: funcDate,
appointmentDate: funcDate,
appointmentEndDate: endDate,
})
if (this.data.formType === 1) { // 入园预约
this.getResidue()
}
},
onServic: function () {
......@@ -117,35 +104,10 @@ Page({
this.updateSubmitButtonStatus()
},
onQuantityAdd: function () {
if (this.data.total * 1 == 0) {
this.setData({
errorQuantity: '所选日期预约名额已满'
})
} else if (this.data.formQuantity >= this.data.total * 1) {
this.setData({
errorQuantity: '所选日期预约的名额仅剩' + activityTime.residue + '人'
})
} else if (this.data.formQuantity >= 5) {
this.setData({
errorQuantity: '每个账号最多预约5人'
})
} else {
this.setData({
formQuantity: this.data.formQuantity + 1,
errorQuantity: '',
})
}
this.updateSubmitButtonStatus()
},
onSelectionDate: function (event) {
this.setData({
formDate: event.detail.value,
})
if (this.data.formType === 1) { // 入园预约
this.getResidue()
}
},
inspectForm: function () {
......@@ -231,6 +193,7 @@ Page({
mask: true,
duration: 1000 * 60,
})
App.wxRequest({
url: '/api/v1/subscribe/doSubscribe',
data: {
......@@ -238,7 +201,7 @@ Page({
subscribeNum: this.data.formQuantity,
subscribeDate: this.data.formDate + ' 00:00:00',
name: this.data.formName,
type: this.data.formType === 1 ? 0 : 1,
type: 1,
},
success: (res) => {
this.setData({
......@@ -264,31 +227,6 @@ Page({
})
},
// 预约入园查询返回剩余名额
getResidue() {
App.login({
success: function () {
App.wxRequest({
url: '/api/v1/subscribe/getResidue',
data: {
subscribeDate: this.data.formDate + ' 00:00:00',
type: 0,
},
success: (res) => {
this.setData({
total: res.data.total,
winQuota: true,
formQuantity: 0,
})
this.updateSubmitButtonStatus()
}
})
}
})
},
getNextDay(d, t) {
console.log(d, t)//格式为---2019-02-13 3
d = new Date(d);
......
<l-toast l-image-class="toast-image"></l-toast>
<!-- 首页 - 入园预约 / 房屋预约 -->
<navigation class="navigation" titleText="{{navigationTitle}}" color="#FFFFFF" backIcon="{{'../../image/icon/arrow-l-2.png'}}"></navigation>
<navigation class="navigation" titleText="看房预约" color="#FFFFFF" backIcon="{{'../../image/icon/arrow-l-2.png'}}"></navigation>
<view class="appointment-complete row con-c align-c" wx:if="{{appointmentComplete}}">
<view class="appointment-complete-tip">
<image wx:if="{{formType === 1}}" src="./image/tip-1.png"></image>
<image wx:if="{{formType === 2}}" src="./image/tip-2.png"></image>
<image src="{{resourcesBase + 'commodity/room-appointment/tip.png'}}"></image>
<l-button l-class="button" plain="{{true}}" bind:lintap="onAppointmentComplete">我知道了</l-button>
</view>
</view>
<!-- 入园预约 -->
<view wx:if="{{formType === 1}}" class="container">
<view class="container">
<view class="appointment-tip">
<image class="background-image" src="./image/banner-1.png"></image>
<image class="ornament-wave" src="/image/ornament-2.png" mode="widthFix"></image>
</view>
<view class="form-title row con-s align-c">
<text>填写预约信息</text>
</view>
<view class="form">
<!-- 名字输入 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>姓</text>
<text>名</text>
</view>
<view class="input-wrap row align-c">
<input maxlength="16" class="text" placeholder-class="input-tip" placeholder="请输入名字" data-type="name" bindblur="onInputBlur"></input>
</view>
</view>
<view class="form-error row align-c">
<text hidden="{{errorName ? false : true}}">{{errorName}}</text>
</view>
<!-- 手机输入 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>手</text>
<text>机</text>
<text>号</text>
</view>
<view class="input-wrap row align-c">
<input maxlength="11" type="number" class="text" placeholder-class="input-tip" placeholder="请输入手机号" data-type="phone" bindblur="onInputBlur"></input>
</view>
</view>
<view class="form-error row align-c">
<text hidden="{{errorPhone ? false : true}}">{{errorPhone}}</text>
</view>
<!-- 预约人数 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>预</text>
<text>约</text>
<text>人</text>
<text>数</text>
</view>
<view class="input-wrap row con-b align-c" style="padding: 0">
<l-button special="{{true}}" bind:lintap="onQuantityCut">
<image class="input-icon" src="{{imageBase + 'icon/cut-1.png'}}"></image>
</l-button>
<text class="text" style="{{formQuantity === 0 ? 'color: #C2C7CF' : 'color: #15191F'}}">{{formQuantity}}</text>
<l-button special="{{true}}" bind:lintap="onQuantityAdd">
<image class="input-icon" src="{{imageBase + 'icon/add-1.png'}}"></image>
</l-button>
</view>
</view>
<view class="form-error row align-c">
<text hidden="{{errorQuantity ? false : true}}">{{errorQuantity}}</text>
</view>
<!-- 预约日期 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>预</text>
<text>约</text>
<text>日</text>
<text>期</text>
</view>
<view class="input-wrap row con-b align-c" style="padding: 0 0 0 24rpx">
<picker class="input-picker" mode="date" value="{{date}}" start="{{appointmentDate}}" end="{{appointmentEndDate}}" bindchange="onSelectionDate">
<view class="picker text" style="display: inline-block;width:400rpx">{{formDate}}</view>
<image class="input-icon" style="float: right;" src="{{imageBase + 'icon/arrow-r-1.png'}}"></image>
</picker>
</view>
</view>
<view class="quota row con-e align-c" hidden="{{!winQuota}}">
<text>剩余名额:</text>
<text>{{total}}人</text>
</view>
</view>
<view class="appointment-operation">
<button class="{{canSubmit ? 'button' : 'button-disable'}} row con-c align-c" bindtap="onSubmit">确认预约</button>
<button class="button-plain row con-c align-c" bindtap="onServic">电话咨询</button>
</view>
</view>
<!-- 看房预约 -->
<view wx:if="{{formType === 2}}" class="container">
<view class="appointment-tip">
<image class="background-image" src="./image/banner-2.png"></image>
<image class="background-image" src="{{resourcesBase + 'commodity/room-appointment/banner.png'}}"></image>
<image class="ornament-wave" src="/image/ornament-2.png" mode="widthFix"></image>
</view>
......
......@@ -5,7 +5,7 @@ Page({
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
shopInfo: {},
shopId: '',
shopLogo: '',
shoppingCart: [], // 购物车列表
......@@ -100,7 +100,8 @@ Page({
let funcShopInfo = wx.getStorageSync('shopInfoBuffer')
this.setData({
shopId: funcShopInfo.id,
shopLogo: funcShopInfo.commodityLogo
shopLogo: funcShopInfo.commodityLogo,
shopInfo: funcShopInfo
})
console.log(this.data.shopLogo)
......@@ -325,7 +326,7 @@ Page({
// 在此之前需要校验用户是否登录,以及商品库存是否充足
wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=5'
url: '/pages/pay/order-input/order-input?type=' + this.data.shopInfo.shopType
})
},
......
......@@ -134,7 +134,7 @@
</view>
<view class="empty col con-c align-c" wx:else>
<image class="empty-cart" src=""></image>
<image src="{{imageBase + 'icon/cart-4.png'}}"></image>
<view class="empty-title">
<text>购物车还没有商品哦</text>
</view>
......
......@@ -313,10 +313,9 @@
height: 100vh;
}
.empty-cart {
.empty > image {
width: 176rpx;
height: 176rpx;
background-color: #ccc;
}
.empty-title {
......
......@@ -188,14 +188,13 @@ Page({
},
onPointDetail: function () {
console.log('onPointDetail')
// 当从景点详情进入屏蔽该功能
if (logicData.option.id) return
let funcPointInfo = this.data.pointInfo
for (let i = 0, l = funcPointInfo.length; i < l; i++) {
if (funcPointInfo[i].isActive) {
console.log(funcPointInfo[i].detail)
console.log('point', funcPointInfo[i].detail)
wx.navigateTo({
url: funcPointInfo[i].detail
......
......@@ -29,47 +29,47 @@ let output = [
}, {
x: 1300,
y: 220,
id: 4,
id: 6,
name: '原味舒食',
icon: './image/icon/04.png',
card: 'guide/card/04.png',
detail: '/pages/play/service-detail/service-detail?id=4',
detail: '/pages/play/service-detail/service-detail?id=6',
isActive: false,
}, {
x: 666,
y: 280,
id: 6,
id: 2,
name: '星空影院',
icon: './image/icon/05.png',
card: 'guide/card/05.png',
detail: '/pages/play/service-detail/service-detail?id=6',
detail: '/pages/play/service-detail/service-detail?id=2',
isActive: false,
}, {
x: 1120,
y: 276,
id: 3,
id: 7,
name: '元养水韵SPA',
icon: './image/icon/06.png',
card: 'guide/card/06.png',
detail: '/pages/play/service-detail/service-detail?id=3',
detail: '/pages/play/service-detail/service-detail?id=7',
isActive: false,
}, {
x: 1370,
y: 284,
id: 5,
id: 4,
name: '原野MOJITO',
icon: './image/icon/07.png',
card: 'guide/card/07.png',
detail: '/pages/play/service-detail/service-detail?id=5',
detail: '/pages/play/service-detail/service-detail?id=4',
isActive: false,
}, {
x: 1708,
y: 306,
id: 2,
id: 5,
name: '拾光花坊',
icon: './image/icon/08.png',
card: 'guide/card/08.png',
detail: '/pages/play/service-detail/service-detail?id=2',
detail: '/pages/play/service-detail/service-detail?id=5',
isActive: false,
}, {
x: 1016,
......
......@@ -54,12 +54,11 @@ Page({
})
},
getBrands: function (index) {
let that = this
App.wxRequest({
url: '/api/v1/common/getBrands',
success: function(res) {
let history = res.data[index]
that.setData({
success: (response) => {
let history = response.data[index]
this.setData({
history
})
}
......
Component({
/**
* 组件的属性列表
*/
properties: {
data: Object
},
/**
* 组件的初始数据
*/
data: {
},
lifetimes: {
attached: function () {
// console.log(this.data.data)
},
detached: function () {
// 在组件实例被从页面节点树移除时执行
},
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!-- demo.wxml -->
<view class="component-strategy-item">
<image wx:if="{{data.index === 1}}" class="short" src="{{data.image}}" mode="aspectFill"></image>
<image wx:else src="{{data.image}}" mode="widthFix"></image>
<text class="component-strategy-item-title">{{data.title}}</text>
<text class="component-strategy-item-content">{{data.date}}</text>
</view>
\ No newline at end of file
.component-strategy-item {
display: flex;
flex-direction: column;
margin-top: 16rpx;
border-radius: 4rpx;
overflow: hidden;
background: #ffffff;
}
.component-strategy-item image {
width: 328rpx;
}
.component-strategy-item .short {
width: 328rpx;
height: 354rpx;
}
.component-strategy-item-title {
display: -webkit-box;
margin: 24rpx 20rpx;
font-size: 26rpx;
font-weight: bolder;
color: #000000;
overflow: hidden;
text-overflow: ellipsis;
line-clamp: 2;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.component-strategy-item-content {
margin: 0 24rpx 24rpx 24rpx;
font-size: 22rpx;
color: #959DA9;
}
\ No newline at end of file
......@@ -47,7 +47,6 @@ Page({
},
strategy: [],
strategyList: [],
strategyOriginList: [],
loading: false,
moreData: true,
......@@ -242,83 +241,6 @@ Page({
},
// // 游客攻略列表
// loadVisiterPlanList() {
// this.data.loading = true
// var that = this
// App.wxRequest({
// url: '/api/v1/strategy/getList',
// data: { pageSize: that.data.pageSize+'', pageNo: that.data.pageNo+''},
// success: function (res) {
// console.log(res)
// that.setData({
// loading: false
// })
// if (res.data.list.length > 0) {
// let count = that.data.strategyOriginList.length
// if (that.data.pageNo == 1) {
// count = 0
// }
// let tempArray = []
// for(let i = 0; i < res.data.list.length; i++) {
// let item = res.data.list[i]
// let strategy = {
// id: item.id,
// image: (count == 0 && i == 0) ? item.topImg : item.cover,
// title: item.title,
// date: item.updateDate,
// index: count + i - 1,
// }
// tempArray.push(strategy)
// }
// if (that.data.pageNo == 1) {
// var newArr = tempArray.slice(1)
// var firstItem = tempArray[0]
// that.setData({
// moreData: (tempArray.length >= Number(res.data.count)) ? false : true,
// ['strategyFirstItem.id']: firstItem.id,
// ['strategyFirstItem.image']: firstItem.image,
// ['strategyFirstItem.title']: firstItem.title,
// ['strategyFirstItem.date']: firstItem.date,
// strategyList: newArr,
// strategyOriginList: tempArray,
// })
// } else {
// that.setData({
// moreData: (count + tempArray.length >= Number(res.data.count)) ? false : true,
// strategyOriginList: that.data.strategyOriginList.concat(tempArray),
// strategyList: tempArray,
// })
// }
// // 游客攻略瀑布列表
// // wx.lin.renderWaterFlow(that.data.strategyList, that.data.pageNo == 1 ? true : false, () => {})
// } else {
// }
// },
// fail: function(err) {
// that.setData({
// loading: false
// })
// }
// })
// },
// onReachBottom: function() {
// // console.log('触底啦')
// if (this.data.loading || !this.data.moreData) {
// return
// }
// this.data.pageNo += 1
// this.loadVisiterPlanList()
// },
// 最新动态列表
getNoticeList() {
var that = this
......
{
"usingComponents": {
"strategy-item": "./component/strategy-item/strategy-item"
}
"usingComponents": {}
}
\ No newline at end of file
......@@ -77,22 +77,6 @@
</view>
</view>
</view>
<!-- 游客攻略 -->
<!-- <block wx:if="{{strategyOriginList.length > 0}}">
<view class="strategy detail-item" bindtap="onFirstStrategyDetail">
<image src="./image/title-strategy.png"></image>
<view class="strategy-content">
<image class="background-image" src="{{strategyFirstItem.image}}" mode="aspectFit"></image>
<view class="operation col">
<text>{{strategyFirstItem.title}}</text>
</view>
</view>
</view>
<view style="margin-bottom:10px">
<l-water-flow column-gap="14rpx" generic:l-water-flow-item="strategy-item" bind:linitemtap="onStrategyDetail"></l-water-flow>
</view>
</block> -->
</view>
<view class="footer">
......
......@@ -322,6 +322,7 @@
margin-top: 88rpx;
}
.footer image {
display: block;
width: 750rpx;
height: 1148rpx;
margin-bottom: 40rpx;
......
......@@ -3,10 +3,8 @@ const App = getApp()
Page({
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
navigationTitle: '123213231',
formType: 1,
appointmentDate: '',
appointmentEndDate: '',
appointmentComplete: false,
......@@ -28,28 +26,29 @@ Page({
},
onLoad: function (options) {
this.setData({
formType: Number(options.type),
navigationTitle: Number(options.type) === 1 ? '夜间入园预约' : '看房预约'
})
this.setReset()
},
setReset: function () {
let funcDate = App.modular.miment(new Date().getTime()).format('YYYY-MM-DD')
let funcDate = App.modular.miment().format('YYYY-MM-DD')
console.log(funcDate)
let endDate = this.getNextDay(funcDate, 3)
console.log('endDate', endDate)
this.setData({
formName: '',
formPhone: '',
formQuantity: this.data.formType === 1 ? 0 : 1,
formQuantity: 0,
formDate: funcDate,
appointmentDate: funcDate,
appointmentEndDate: endDate,
})
if (this.data.formType === 1) { // 入园预约
this.getResidue()
}
console.log(this.data.formDate)
console.log(this.data.appointmentDate)
console.log(this.data.appointmentEndDate)
this.queryQuota()
},
onServic: function () {
......@@ -138,12 +137,13 @@ Page({
},
onSelectionDate: function (event) {
console.log(event.detail.value)
this.setData({
formDate: event.detail.value,
})
if (this.data.formType === 1) { // 入园预约
this.getResidue()
}
this.queryQuota()
},
inspectForm: function () {
......@@ -218,11 +218,7 @@ Page({
},
onSubmit: function () {
var that = this
App.login({
success: function () {
if (!that.inspectForm()) {
if (!this.inspectForm()) {
return
}
......@@ -236,31 +232,25 @@ Page({
App.wxRequest({
url: '/api/v1/subscribe/doSubscribe',
data: {
mobile: that.data.formPhone,
subscribeNum: that.data.formQuantity,
subscribeDate: that.data.formDate + ' 00:00:00',
name: that.data.formName,
type: that.data.formType === 1 ? 0 : 1,
mobile: this.data.formPhone,
subscribeNum: this.data.formQuantity,
subscribeDate: this.data.formDate + ' 00:00:00',
name: this.data.formName,
type: 0,
},
success: function (res) {
that.setData({
success: (res) => {
this.setData({
appointmentComplete: true,
})
wx.lin.hideToast()
},
fail: function (err) {
fail: (err) => {
wx.lin.showToast({
image: '/image/error.png',
title: err.msg,
})
}
})
}
})
},
onAppointmentComplete: function () {
......@@ -273,30 +263,22 @@ Page({
},
// 预约入园查询返回剩余名额
getResidue() {
var that = this
App.login({
success: function () {
queryQuota: function () {
App.wxRequest({
url: '/api/v1/subscribe/getResidue',
data: {
subscribeDate: that.data.formDate + ' 00:00:00',
subscribeDate: this.data.formDate + ' 00:00:00',
type: 0,
},
success: function (res) {
that.setData({
success: (res) => {
this.setData({
total: res.data.total,
winQuota: true,
formQuantity: 0,
})
that.updateSubmitButtonStatus()
}
})
this.updateSubmitButtonStatus()
}
})
},
getNextDay(d, t) {
......
<l-toast l-image-class="toast-image"></l-toast>
<!-- 首页 - 入园预约 / 房屋预约 -->
<navigation class="navigation" titleText="{{navigationTitle}}" color="#FFFFFF" backIcon="/image/back-w.png"></navigation>
<navigation class="navigation" titleText="夜间入园预约" color="#FFFFFF" backIcon="{{'../../image/icon/arrow-l-2.png'}}"></navigation>
<view class="appointment-complete row con-c align-c" wx:if="{{appointmentComplete}}">
<view class="appointment-complete-tip">
<image wx:if="{{formType === 1}}" src="./image/tip-1.png"></image>
<image wx:if="{{formType === 2}}" src="./image/tip-2.png"></image>
<image src="{{resourcesBase + 'home/night-appointment/tip.png'}}"></image>
<l-button l-class="button" plain="{{true}}" bind:lintap="onAppointmentComplete">我知道了</l-button>
</view>
</view>
<!-- 入园预约 -->
<view wx:if="{{formType === 1}}" class="container">
<view class="container">
<view class="appointment-tip">
<image class="background-image" src="./image/banner-1.png"></image>
<image class="background-image" src="{{resourcesBase + 'home/night-appointment/banner.png'}}"></image>
<image class="ornament-wave" src="/image/ornament-2.png" mode="widthFix"></image>
</view>
......@@ -61,11 +60,11 @@
</view>
<view class="input-wrap row con-b align-c" style="padding: 0">
<l-button special="{{true}}" bind:lintap="onQuantityCut">
<image class="input-icon" src="{{imageBase + 'cut.png'}}"></image>
<image class="input-icon" src="{{imageBase + 'icon/cut-1.png'}}"></image>
</l-button>
<text class="text" style="{{formQuantity === 0 ? 'color: #C2C7CF' : 'color: #15191F'}}">{{formQuantity}}</text>
<l-button special="{{true}}" bind:lintap="onQuantityAdd">
<image class="input-icon" src="{{imageBase + 'add.png'}}"></image>
<image class="input-icon" src="{{imageBase + 'icon/add-1.png'}}"></image>
</l-button>
</view>
</view>
......@@ -84,7 +83,7 @@
<view class="input-wrap row con-b align-c" style="padding: 0 0 0 24rpx">
<picker class="input-picker" mode="date" value="{{date}}" start="{{appointmentDate}}" end="{{appointmentEndDate}}" bindchange="onSelectionDate">
<view class="picker text" style="display: inline-block;width:400rpx">{{formDate}}</view>
<image class="input-icon" style="float: right;" src="{{imageBase + 'more.png'}}"></image>
<image class="input-icon" style="float: right;" src="{{imageBase + 'icon/arrow-r-1.png'}}"></image>
</picker>
</view>
</view>
......@@ -99,66 +98,3 @@
<button class="button-plain row con-c align-c" bindtap="onServic">电话咨询</button>
</view>
</view>
\ No newline at end of file
<!-- 看房预约 -->
<view wx:if="{{formType === 2}}" class="container">
<view class="appointment-tip">
<image class="background-image" src="./image/banner-2.png"></image>
<image class="ornament-wave" src="/image/ornament-2.png" mode="widthFix"></image>
</view>
<view class="form-title row con-s align-c">
<text>填写预约信息</text>
</view>
<view class="form">
<!-- 名字输入 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>姓</text>
<text>名</text>
</view>
<view class="input-wrap row align-c">
<input maxlength="16" class="text" placeholder-class="input-tip" placeholder="请输入名字" data-type="name" bindblur="onInputBlur"></input>
</view>
</view>
<view class="form-error row align-c">
<text hidden="{{errorName ? false : true}}">{{errorName}}</text>
</view>
<!-- 手机输入 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>手</text>
<text>机</text>
<text>号</text>
</view>
<view class="input-wrap row align-c">
<input maxlength="11" type="number" class="text" placeholder-class="input-tip" placeholder="请输入手机号" data-type="phone" bindblur="onInputBlur"></input>
</view>
</view>
<view class="form-error row align-c">
<text hidden="{{errorPhone ? false : true}}">{{errorPhone}}</text>
</view>
<!-- 预约日期 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>看</text>
<text>房</text>
<text>日</text>
<text>期</text>
</view>
<view class="input-wrap row align-c" style="padding: 0 0 0 24rpx">
<picker class="input-picker" mode="date" value="{{date}}" start="{{appointmentDate}}" bindchange="onSelectionDate">
<view class="picker text" style="display: inline-block;width:400rpx">{{formDate}}</view>
<image class="input-icon" style="float: right;" src="{{imageBase + 'more.png'}}"></image>
</picker>
</view>
</view>
</view>
<view class="appointment-operation">
<button class="{{canSubmit ? 'button' : 'button-disable'}} row con-c align-c" bindtap="onSubmit">确认预约</button>
</view>
</view>
\ No newline at end of file
......@@ -6,6 +6,7 @@ Page({
* 页面的初始数据
*/
data: {
isCheckPermission: false,
imageBase: App.globalData.appImageBase,
orderType: 1, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
......@@ -113,6 +114,35 @@ Page({
url: '/pages/pay/coupon-input/coupon-input',
})
},
// 获取核销权限
// api/v1/login/getPermissions权限更上去了
getPermissions() {
let that = this
App.wxRequest({
url: '/api/v1/login/getPermissions',
data: {
permission: 'sys:role:distinguish'
},
success: function (res) {
console.log(res, '核销');
let data = res.data
let isPer = false
if (data.length > 0) {
//有核销权限
isPer = true
} else {
// 无核销权限
isPer = false
}
that.setData({
isCheckPermission: isPer
})
}
})
},
//获取待使用订单
getWillUseOrders() {
let that = this
......@@ -200,6 +230,7 @@ Page({
this.getMyActivityList()
this.getCardList()
this.getWillUseOrders()
this.getPermissions()
} else {
this.setData({
isRegister: false,
......
......@@ -47,7 +47,7 @@
</view>
</view>
<view class="coupon row align-c" bindtap="goCouponInput">
<view class="coupon row align-c" bindtap="goCouponInput" wx:if="{{isCheckPermission}}">
<view class="cpopon-info col">
<text>券码核销</text>
<text>所属门店:拾光花坊</text>
......
......@@ -2,87 +2,116 @@ const App = getApp()
Page({
data: {
birthdayEnd: App.modular.miment(new Date().getTime()).format('YYYY-MM-DD'),
mobile: '',
nickName: '',
avatarUrl: '',
genderArray: [
birthdayLimit: App.modular.miment().format('YYYY-MM-DD'),
sexList: [
{ id: 1, name: '男' },
{ id: 2, name: '女' },
],
genderIndex: 0,
birthday: '',
sexActive: 0,
userInfo: {
name: '',
phone: '',
avatar: '',
address: '',
birthday: '',
sex: '',
userType: '',
status: '',
isSignIn: false,
}
},
onLoad: function (options) {
let funcUserInfo = wx.getStorageSync('userInfo')
funcUserInfo.phone = this.phoneEncryption(funcUserInfo.phone)
if (!funcUserInfo.birthday) funcUserInfo.birthday = birthdayLimit
let mobile = funcUserInfo.phone
let nickName = funcUserInfo.name
let avatarUrl = funcUserInfo.avatar
let sex = funcUserInfo.sex
let birthday = funcUserInfo.birthday
let address = birthday.address
this.setData({
mobile: this.toHide(mobile),
nickName: nickName,
avatarUrl: avatarUrl,
genderIndex: sex == 2 ? 1 : 0,
birthday: birthday ? birthday : this.data.birthdayEnd,
address: address,
userInfo: funcUserInfo
})
},
toHide: function (array) {
var mphone = array.substring(0, 3) + '****' + array.substring(7);
return mphone;
/**
* 加密号码
* @function
* @param {object} - funcEvent
* @returns
*/
phoneEncryption: function (funcPhone) {
return funcPhone = funcPhone.substring(0, 3) + '****' + funcPhone.substring(7)
},
/**
* 加密号码
* @function
* @param {object} - funcEvent
* @returns
*/
onInputBlur: function (event) {
let funcType = event.target.dataset.type
let funcValue = event.detail.value
let funcUserInfo = wx.getStorageSync('userInfo')
switch (funcType) {
case 'name':
this.setData({
nickName: funcValue
})
funcUserInfo.name = funcValue
break
case 'address':
this.setData({
address: funcValue
})
funcUserInfo.address = funcValue
break
}
this.setData({
userInfo: funcUserInfo
})
this.doUpdateInfo()
},
// 性别选择
onSelectionGender(e) {
/**
* 性别选择
* @function
* @param {object} - funcEvent
* @returns
*/
onSelectionGender(event) {
// console.log(event)
this.setData({
sexActive: Number(event.detail.value)
})
let funcUserInfo = wx.getStorageSync('userInfo')
funcUserInfo.sex = this.data.sexList[this.data.sexActive].id
this.setData({
genderIndex: e.detail.value
userInfo: funcUserInfo
})
this.doUpdateInfo()
},
// 生日选择
/**
* 生日选择
* @function
* @param {object} - funcEvent
* @returns
*/
onSelectionDate: function (event) {
let funcUserInfo = wx.getStorageSync('userInfo')
funcUserInfo.birthday = event.detail.value
this.setData({
birthday: event.detail.value,
userInfo: funcUserInfo
})
this.doUpdateInfo()
},
doUpdateInfo() {
let nickName = this.data.nickName
let sex = this.data.genderArray[this.data.genderIndex].id
let birthday = this.data.birthday
let address = this.data.address
if (nickName == '') {
/**
* 更新信息
* @function
* @param {object} - funcEvent
* @returns
*/
doUpdateInfo: function () {
if (this.data.userInfo.name == '') {
wx.lin.showToast({
image: '/image/error.png',
title: '请填写姓名',
......@@ -91,22 +120,20 @@ Page({
}
let param = {
sex: sex,
name: nickName,
address: address,
birthday: birthday,
sex: this.data.userInfo.sex,
name: this.data.userInfo.name,
address: this.data.userInfo.address,
birthday: this.data.userInfo.birthday,
}
console.log(param)
App.wxRequest({
url: '/api/v1/smUser/doUpdateInfo',
data: param,
success: function (res) {
wx.setStorageSync('nickName', nickName)
wx.setStorageSync('sex', sex)
wx.setStorageSync('birthday', birthday)
wx.setStorageSync('address', address)
let funcUserInfo = wx.getStorageSync('userInfo')
Object.assign(funcUserInfo, param)
wx.setStorageSync('userInfo', funcUserInfo)
}
})
}
})
\ No newline at end of file
<!--pages/myInfo/myInfo.wxml-->
<l-toast l-image-class="toast-image"></l-toast>
<navigation class="navigation" titleText="个人资料" backIcon="/image/back.png"></navigation>
......@@ -6,32 +5,32 @@
<view class="myInfo">
<l-list is-hover="{{false}}" l-content-class="menu-title" title="头像" is-link="{{false}}">
<view style="margin-bottom:30rpx;" slot="right-section">
<l-avatar size="100" src="{{avatarUrl}}" />
<l-avatar size="100" src="{{userInfo.avatar}}" />
</view>
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="姓名" is-link="{{false}}">
<view slot="right-section">
<input maxlength="10" style="text-align:right;" placeholder="请填写姓名" placeholder-class="phone" value="{{nickName}}" data-type="name" bindblur="onInputBlur" />
<input maxlength="10" style="text-align:right;" placeholder="请填写姓名" placeholder-class="phone" value="{{userInfo.name}}" data-type="name" bindblur="onInputBlur" />
</view>
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="性别" is-link="{{false}}">
<picker slot="right-section" class="input-picker" mode="selector" value="{{genderIndex}}" range-key="{{'name'}}" range="{{genderArray}}" bindchange="onSelectionGender">
<view class="picker">{{genderArray[genderIndex].name}}</view>
<picker slot="right-section" class="input-picker" mode="selector" value="{{sexActive}}" range-key="{{'name'}}" range="{{sexList}}" bindchange="onSelectionGender">
<view class="picker">{{sexList[sexActive].name}}</view>
</picker>
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="生日" is-link="{{false}}">
<picker slot="right-section" class="input-picker" mode="date" value="{{birthday}}" end="{{birthdayEnd}}" bindchange="onSelectionDate">
<view class="picker">{{birthday}}</view>
<picker slot="right-section" class="input-picker" mode="date" value="{{userInfo.birthday}}" end="{{birthdayLimit}}" bindchange="onSelectionDate">
<view class="picker">{{userInfo.birthday}}</view>
</picker>
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="地址" is-link="{{false}}">
<view slot="right-section">
<input maxlength="30" style="text-align:right;" placeholder="请填写地址" placeholder-class="phone" value="{{address}}" data-type="address" bindblur="onInputBlur" />
<input maxlength="30" style="text-align:right;" placeholder="请填写地址" placeholder-class="phone" value="{{userInfo.address}}" data-type="address" bindblur="onInputBlur" />
</view>
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="手机号" is-link="{{false}}">
<view slot="right-section">
<view class="phone">{{mobile}}</view>
<view class="phone">{{userInfo.phone}}</view>
</view>
</l-list>
</view>
......
......@@ -100,13 +100,18 @@ Page({
'status': Number(funcResponse[i].status),
'amount': funcResponse[i].totalMoney,
'commodity': [],
'commodityBackup': [],
'commoditySlice3': [],
'commodityType': Number(funcResponse[i].goodType),
'wxRequest': funcResponse[i].wxRequest
'wxRequest': funcResponse[i].wxRequest,
'total': funcResponse[i].smOrderDetails.length
}
// 添加订单商品列表
let funcTotal = 0
let funcCommodity = funcResponse[i].smOrderDetails
let commodityBackup = []
for (let ii = 0, ll = funcCommodity.length; ii < ll; ii++) {
let funcCommodityItem = {
'cover': funcCommodity[ii].imgUrl,
......@@ -116,7 +121,13 @@ Page({
}
funcTotal = funcTotal + funcCommodityItem.quantity
funcItem.commodity.push(funcCommodityItem)
funcItem.commodityBackup.push(funcCommodityItem)
}
// 处理大于三条数据的问题
if (funcItem.commodity.length > 3) {
funcItem.commoditySlice3 = funcItem.commodityBackup.slice(0, 3)
}
funcItem.total = funcTotal
// 映射门店信息
......@@ -275,6 +286,14 @@ Page({
*/
onOrderCancel: function (event) {
let that = this
wx.lin.showDialog({
type: "confirm",
title: "",
content: "是否确认取消订单",
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
wx.showLoading({
title: '处理中',
mask: true
......@@ -283,12 +302,6 @@ Page({
isDoing: true
})
let funcItem = event.target.dataset.item
// let index = event.target.dataset.index
// // 无刷新更新数据
// let status = `orderList[${index}].status`
// this.setData({
// [status]:-1
// })
App.wxRequest({
url: '/api/v1/order/cancelOrder',
data: {
......@@ -308,6 +321,12 @@ Page({
that.queryOrder()
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
......@@ -319,6 +338,14 @@ Page({
*/
onOrderRemove: function (event) {
let that = this
wx.lin.showDialog({
type: "confirm",
title: "",
content: "是否确认删除订单",
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
wx.showLoading({
title: '处理中',
mask: true
......@@ -344,6 +371,11 @@ Page({
console.log(response)
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
/**
......
......@@ -13,21 +13,27 @@
<view>
<view class="order-type-row row con-b align-c">
<block wx:for="{{orderType}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view wx:if="{{index < 3}}" class="order-type-item row con-c align-c {{orderTypeActive === index ? 'order-type-item-active' : ''}}" data-item="{{item}}" data-index="{{index}}" bindtap="onOrderTypeSelection">
<view wx:if="{{index < 3}}"
class="order-type-item row con-c align-c {{orderTypeActive === index ? 'order-type-item-active' : ''}}"
data-item="{{item}}" data-index="{{index}}" bindtap="onOrderTypeSelection">
<text>{{item.name}}</text>
</view>
</block>
</view>
<view class="order-type-row row con-b align-c">
<block wx:for="{{orderType}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view wx:if="{{3 <= index && index < 6}}" class="order-type-item row con-c align-c {{orderTypeActive === index ? 'order-type-item-active' : ''}}" data-item="{{item}}" data-index="{{index}}" bindtap="onOrderTypeSelection">
<view wx:if="{{3 <= index && index < 6}}"
class="order-type-item row con-c align-c {{orderTypeActive === index ? 'order-type-item-active' : ''}}"
data-item="{{item}}" data-index="{{index}}" bindtap="onOrderTypeSelection">
<text>{{item.name}}</text>
</view>
</block>
</view>
<view class="order-type-row row con-b align-c">
<block wx:for="{{orderType}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view wx:if="{{6 <= index && index < 9}}" class="order-type-item row con-c align-c {{orderTypeActive === index ? 'order-type-item-active' : ''}}" data-item="{{item}}" data-index="{{index}}" bindtap="onOrderTypeSelection">
<view wx:if="{{6 <= index && index < 9}}"
class="order-type-item row con-c align-c {{orderTypeActive === index ? 'order-type-item-active' : ''}}"
data-item="{{item}}" data-index="{{index}}" bindtap="onOrderTypeSelection">
<text>{{item.name}}</text>
</view>
</block>
......@@ -39,7 +45,8 @@
<view class="container-order">
<view class="status row con-b align-c fixed-tab">
<block wx:for="{{statusList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="status-item row con-c align-c {{index === statusActive ? 'status-item-active' : ''}}" data-type="{{index}}" bindtap="onSelectionStatus">
<view class="status-item row con-c align-c {{index === statusActive ? 'status-item-active' : ''}}"
data-type="{{index}}" bindtap="onSelectionStatus">
<text>{{item.name}}</text>
</view>
</block>
......@@ -50,8 +57,10 @@
<view class="order-list-item col align-c" data-item="{{item}}" bindtap="onOrderDetail">
<view class="order-list-item-title row con-b align-c">
<view class="row align-c">
<image wx:if="{{item.shopLogo}}" src="{{resourcesBase + item.shopLogo}}" mode="heightFix"></image>
<text>{{item.name}}</text>
<view class="logo-box">
<image wx:if="{{item.shopLogo}}" src="{{resourcesBase + item.shopLogo}}" mode="aspectFit"></image>
</view>
<text>{{item.shopName}}</text>
</view>
<view>
<text class="warning" wx:if="{{item.status === 0}}">待付款</text>
......@@ -71,24 +80,39 @@
</view>
<!-- 商品数量样式二 -->
<view class="order-list-item-service row con-b align-c" wx:if="{{item.commodity.length >= 2}}">
<block wx:for="{{item.commodity}}" wx:for-index="commodityIndex" wx:for-item="commodityItem" wx:key="commodityIndex">
<block wx:if="{{item.commodity.length>3}}">
<block wx:for="{{item.commoditySlice3}}" wx:for-index="commodityIndex" wx:for-item="commodityItem"
wx:key="commodityIndex">
<image class="cover" src="{{commodityItem.cover}}"></image>
</block>
<text class="total">{{'共 ' + item.commodity.length + ' 件'}}</text>
</view>
</block>
<block wx:else>
<block wx:for="{{item.commodity}}" wx:for-index="commodityIndex" wx:for-item="commodityItem"
wx:key="commodityIndex">
<image class="cover" src="{{commodityItem.cover}}"></image>
</block>
</block>
<text class="total">{{'共 ' + item.commodityBackup.length + ' 件'}}</text>
</view>
<view class="order-list-item-operation row con-b align-c">
<view class="row align-c">
<text class="amount">实付:</text>
<text class="amount">¥{{item.amount}}</text>
</view>
<view class="row align-c">
<button wx:if="{{item.status === 0}}" class="delete row con-c align-c" data-index="{{index}}" data-item="{{item}}" catchtap="onOrderCancel" disabled="{{isDoing}}">取消订单</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === -1 || item.status === 4}}" class="delete row con-c align-c" data-item="{{item}}" catchtap="onOrderRemove">删除订单</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === 0}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderPay">去支付</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === 2}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderUse">去使用</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === 3}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderEvaluate">去评价</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === -1}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderAgain">再次下单</button>
<button wx:if="{{item.status === 0}}" class="delete row con-c align-c" data-index="{{index}}"
data-item="{{item}}" catchtap="onOrderCancel" disabled="{{isDoing}}">取消订单</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === -1 || item.status === 4}}"
class="delete row con-c align-c" data-item="{{item}}" catchtap="onOrderRemove">删除订单</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === 0}}" class="again row con-c align-c"
data-item="{{item}}" catchtap="onOrderPay">去支付</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === 2}}" class="again row con-c align-c"
data-item="{{item}}" catchtap="onOrderUse">去使用</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === 3}}" class="again row con-c align-c"
data-item="{{item}}" catchtap="onOrderEvaluate">去评价</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === -1}}" class="again row con-c align-c"
data-item="{{item}}" catchtap="onOrderAgain">再次下单</button>
</view>
</view>
</view>
......@@ -133,3 +157,5 @@
</view>
</view>
</view>
<!-- 确认框 -->
<l-dialog />
\ No newline at end of file
......@@ -149,10 +149,10 @@ page {
}
.order-list-item-title image {
display: block;
/* display: block;
max-width: 100rpx;
height: 60rpx;
margin-right: 20rpx;
margin-right: 20rpx; */
}
.order-list-item-service {
......@@ -338,3 +338,16 @@ page {
background: #86C5E1;
border-radius: 4rpx;
}
.logo-box {
width: 100rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
}
.logo-box image {
max-width: 100%!important;
max-height: 100%!important;
}
\ No newline at end of file
......@@ -25,7 +25,7 @@ Page({
sealSrc: '',
shopConfig: App.globalData.shopId,
imgBasehost: App.globalData.appResourcesBase
},
......@@ -48,9 +48,8 @@ Page({
},
// 再次下单
onOrderAgain: function (event) {
let commodityType = this.data.orderInfo.commodityType
let shopAppId = wx.getStorageSync('shopInfoBuffer') ? wx.getStorageSync('shopInfoBuffer').appId : ""
let shopAppId = this.data.orderInfo.shopInfo.appId //wx.getStorageSync('shopInfoBuffer') ? wx.getStorageSync('shopInfoBuffer').appId : ""
wx.navigateTo({
url: `/pages/commodity/menu-food/menu-food?formPage=order&shopAppId=${shopAppId}&commodityType=${commodityType}`,
})
......@@ -87,24 +86,19 @@ Page({
})
},
// 删除订单&取消订单
// type :1删除0取消
onDelOrCancelOrder: function (event) {
// wx.lin.showDialog({
// type: "confirm",
// title: "",
// content: "是否确认核销券码",
// success: (res) => {
// if (res.confirm) {
// console.log('用户点击确定')
// that.doVolume()
// } else if (res.cancel) {
// console.log('用户点击取消')
// }
// }
// })
let type = event.currentTarget.dataset.type
let that = this
let tip = type == 1 ? '删除订单' : '取消订单'
wx.lin.showDialog({
type: "confirm",
title: "",
content: "是否确认" + tip,
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
wx.showLoading({
title: '处理中',
mask: true
......@@ -138,7 +132,6 @@ Page({
that.setData({
isDoing: false,
[state]: -1
})
}
......@@ -146,6 +139,13 @@ Page({
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
// 使用须知
handleNotice() {
......@@ -219,22 +219,20 @@ Page({
'tipTimePay': App.modular.miment(funcResponse.paymentTime).format('YYYY-MM-DD hh:mm:ss'),
'tipIntegral': funcResponse.integral,
'officeName': funcResponse.officeName,
'wxRequest': funcResponse.wxRequest
'wxRequest': funcResponse.wxRequest,
'businessTime': funcResponse.businessTime, //营业时间
'expireTime': funcResponse.expireTime, //订单有效期
}
// 设置印章
let shopName = funcResponse.officeName;
let shopFilter = this.data.shopConfig.filter(
item => {
return item.name.toLowerCase() == shopName.toLowerCase()
}
)
funcOrderInfo.shopInfo = shopFilter[0]
console.log(shopFilter[0], '-----------shopFilter[0]------');
// 添加订单商品列表
let funcCommodity = funcResponse.smOrderDetails
for (let i = 0, l = funcCommodity.length; i < l; i++) {
......
......@@ -55,14 +55,12 @@
</view>
<view class="info-content-item row">
<text class="info-content-item-label"></text>
<text class="info-content-item-describe">周一至周日 10:00 - 20:00</text>
<text class="info-content-item-describe">{{orderInfo.businessTime}}</text>
</view>
<image class="seal-shot" src="{{imgBasehost+orderInfo.shopInfo.print}}"></image>
<image class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}"></image>
</view>
</block>
<!-- 普通商品 -->
<block wx:if="{{orderInfo.commodityType === 2}}">
<view class="info-content col con-c">
<view class="info-content-item row">
......@@ -71,7 +69,7 @@
</view>
<view class="info-content-item row">
<text class="info-content-item-label"></text>
<text class="info-content-item-describe">周一至周日 10:00 - 20:00</text>
<text class="info-content-item-describe">{{orderInfo.businessTime}}</text>
</view>
<view class="info-content-item row">
......@@ -82,19 +80,19 @@
<text class="info-content-item-label"></text>
<text class="info-content-item-tip">{{orderInfo.contactPhone}}</text>
</view>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{imgBasehost+orderInfo.shopInfo.print}}"></image>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}"></image>
</view>
<block wx:if="{{orderInfo.state===2}}">
<view class="info-line row con-b align-c">
<view class="info-line-point-left"></view>
<view class="info-line-line"></view>
<view class="info-line-point-right"></view>
<image class="seal-long" src="{{imgBasehost+orderInfo.shopInfo.printUse}}"></image>
<image class="seal-long" src="{{resourcesBase+orderInfo.shopInfo.printUse}}"></image>
</view>
<view class="info-code col con-c align-c">
<text>{{'件商品可用'}}</text>
<button bindtap="onFastScan" class="row con-c align-c">一键扫码</button>
<text>{{'2019.09.30 - 2020.12.30'}}</text>
<text>{{orderInfo.expireTime}}</text>
</view>
</block>
</block>
......@@ -107,7 +105,7 @@
</view>
<view class="info-content-item row">
<text class="info-content-item-label"></text>
<text class="info-content-item-describe">周一至周日 10:00 - 20:00</text>
<text class="info-content-item-describe">{{orderInfo.businessTime}}</text>
</view>
<view class="info-content-item row">
<text class="info-content-item-label">订单信息</text>
......@@ -117,21 +115,21 @@
<text class="info-content-item-label"></text>
<text class="info-content-item-tip">{{orderInfo.contactPhone}}</text>
</view>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{imgBasehost+orderInfo.shopInfo.print}}"></image>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}"></image>
</view>
<block wx:if="{{orderInfo.state===2}}">
<view class="info-line row con-b align-c">
<view class="info-line-point-left"></view>
<view class="info-line-line"></view>
<view class="info-line-point-right"></view>
<image class="seal-long" src="{{imgBasehost+orderInfo.shopInfo.printUse}}"></image>
<image class="seal-long" src="{{resourcesBase+orderInfo.shopInfo.printUse}}"></image>
</view>
<view class="info-code col con-c align-c">
<text wx:if="{{orderInfo.commodityType === 5}}">{{'1件餐品可用'}}</text>
<text wx:if="{{orderInfo.commodityType === 4}}">{{'1件商品可用'}}</text>
<text wx:if="{{orderInfo.commodityType === 3}}">{{orderInfo.commodity.length}}张门票可用</text>
<button bindtap="onFastScan" class="row con-c align-c">一键扫码</button>
<text>{{'2019.09.30 - 2020.12.30'}}</text>
<text>{{orderInfo.expireTime}}</text>
</view>
</block>
</block>
......@@ -146,7 +144,7 @@
</view>
<view class="info-content-item row">
<text class="info-content-item-label">活动时间</text>
<text class="info-content-item-describe">周一至周日 10:00 - 20:00</text>
<text class="info-content-item-describe">{{orderInfo.businessTime}}</text>
</view>
<view class="info-content-item row">
<text class="info-content-item-label">活动地点</text>
......@@ -160,19 +158,19 @@
<text class="info-content-item-label"></text>
<text class="info-content-item-tip">18030303030</text>
</view>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{imgBasehost+orderInfo.shopInfo.print}}"></image>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}"></image>
</view>
<block wx:if="{{orderInfo.state===2}}">
<view class="info-line row con-b align-c">
<view class="info-line-point-left"></view>
<view class="info-line-line"></view>
<view class="info-line-point-right"></view>
<image class="seal-long" src="{{imgBasehost+orderInfo.shopInfo.printUse}}"></image>
<image class="seal-long" src="{{resourcesBase+orderInfo.shopInfo.printUse}}"></image>
</view>
<view class="info-code col con-c align-c">
<text>{{'张门票可用'}}</text>
<button bindtap="onFastScan" class="row con-c align-c">一键扫码</button>
<text>{{'2019.09.30 - 2020.12.30'}}</text>
<text>{{orderInfo.expireTime}}</text>
</view>
</block>
......@@ -188,7 +186,7 @@
</view>
<view class="info-content-item row">
<text class="info-content-item-label">场次</text>
<text class="info-content-item-describe">周一至周日 10:00 - 20:00</text>
<text class="info-content-item-describe">{{orderInfo.businessTime}}</text>
</view>
<view class="info-content-item row">
<text class="info-content-item-label">订单信息</text>
......@@ -198,19 +196,19 @@
<text class="info-content-item-label"></text>
<text class="info-content-item-tip">18030303030</text>
</view>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{imgBasehost+orderInfo.shopInfo.print}}"></image>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}"></image>
</view>
<block wx:if="{{orderInfo.state===2}}">
<view class="info-line row con-b align-c">
<view class="info-line-point-left"></view>
<view class="info-line-line"></view>
<view class="info-line-point-right"></view>
<image class="seal-long" src="{{imgBasehost+orderInfo.shopInfo.printUse}}"></image>
<image class="seal-long" src="{{resourcesBase+orderInfo.shopInfo.printUse}}"></image>
</view>
<view class="info-code col con-c align-c">
<text>{{'张电影票可用'}}</text>
<button bindtap="onFastScan" class="row con-c align-c">一键扫码</button>
<text>{{'2019.09.30 - 2020.12.30'}}</text>
<text>{{orderInfo.expireTime}}</text>
</view>
</block>
......@@ -231,7 +229,10 @@
</view>
<view class="commodity-list">
<view class="commodity-shop-info row align-c">
<image src="{{resourcesBase + shopInfo.logo}}"></image>
<view class="logo-box">
<image src="{{resourcesBase + orderInfo.shopInfo.logo}}" mode="aspectFit"></image>
</view>
<text>{{orderInfo.officeName}}</text>
</view>
<block wx:for="{{orderInfo.commodity}}" wx:for-index="index" wx:for-item="item" wx:key="index">
......@@ -295,13 +296,13 @@
<image mode="widthFix" src="{{'data:image/jpg;base64,'+item.qrcode}}"></image>
</view>
<view class="code-num-wrapper row align-c con-a">
<view class="code-num-title {{codeUsed ? 'code-used' : ''}}">券码{{index+1}}:</view>
<view class="code-num {{codeUsed ? 'code-used' : ''}}">{{item.serialNumber}}</view>
<view class="num-copy" wx:if="{{!codeUsed}}" bindtap="setClipboard" data-code="{{item.serialNumber}}"
<view class="code-num-title {{item.status==2 ? 'code-used' : ''}}">券码{{index+1}}:</view>
<view class="code-num {{item.status==2 ? 'code-used' : ''}}">{{item.serialNumber}}</view>
<view class="num-copy" wx:if="{{item.status!=2}}" bindtap="setClipboard" data-code="{{item.serialNumber}}"
data-index="{{index}}">复制</view>
</view>
<view class="code-used-seal" wx:if="{{codeUsed}}">
<image mode="widthFix" src="./image/used.png"></image>
<view class="code-used-seal" wx:if="{{item.status==2}}">
<image mode="widthFix" src="{{resourcesBase+'mine/server/codeUsed.png'}}"></image>
</view>
</view>
</swiper-item>
......@@ -365,3 +366,5 @@
<!-- 成功提示 -->
<l-toast l-image-class="toast-image" l-class="toast-bg" show="{{winToast}}" image="/image/success.png"
title="{{winToastText}}" duration="2000"></l-toast>
<!-- 确认框 -->
<l-dialog />
\ No newline at end of file
......@@ -219,6 +219,7 @@
line-height: 32rpx;
color: #FFFFFF;
}
.commodity-item-operation>button.btn-disabled {
background: #C8E1EC;
color: #FFFFFF;
......@@ -821,3 +822,15 @@ image {
width: 100%;
height: 100%;
}
.logo-box {
width: 100rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
}
.logo-box image {
max-width: 100%;
max-height: 100%;
}
\ No newline at end of file
......@@ -135,10 +135,11 @@ Page({
case 2:
this.setData({
orderType: logicData.option.type,
buyContent: this.data.shoppingCartList[0].cover,
buyContentTitle: this.data.shopInfo.name,
buyContentAmount: '360.00',
quantityTitle: '选择购买数量',
quantityTipText: '剩余库存',
contactTitle: '填写购人信息',
contactTitle: '填写购人信息',
winBuyContent: true, // 购买内容
winShoppingCart: false, // 购买清单
......@@ -151,18 +152,16 @@ Page({
winButtonPay: true, // 立即支付
winButtonAppointment: false, // 确认预约
})
this.setStock()
break
case 3:
this.setData({
orderType: logicData.option.type,
buyContentTitle: this.data.shopInfo.name,
buyContentAmount: '360.00',
buyContent: this.data.shoppingCartList[0].cover,
quantityTitle: '选择购买数量',
quantityTipText: '剩余库存',
contactTitle: '填写取货人信息',
contactTitle: '填写购票人信息',
winBuyContent: true, // 购买内容
winShoppingCart: false, // 购买清单
......@@ -175,6 +174,7 @@ Page({
winButtonPay: true, // 立即支付
winButtonAppointment: false, // 确认预约
})
this.setStock()
break
......
......@@ -3,15 +3,13 @@
<view class="container">
<!-- winBuyContent -->
<view class="buy-content" wx:if="{{winBuyContent}}">
<!-- 年卡月卡 -->
<view class="buy-content-pass" wx:if="{{orderType === 1}}">
<image src="{{buyContent}}"></image>
</view>
<view class="buy-content-pass" wx:if="{{orderType === 2}}">
<image src="{{buyContent}}"></image>
</view>
<view class="buy-content-service row align-c" wx:if="{{orderType === 3}}">
<!-- 普通商品 -->
<view class="buy-content-service row align-c" wx:if="{{orderType === 2}}">
<view class="row con-c align-c">
<image src="{{resourcesBase + shopInfo.cover}}"></image>
</view>
......@@ -21,6 +19,12 @@
</view>
</view>
<!-- 次票 -->
<view class="buy-content-pass" wx:if="{{orderType === 3}}">
<image src="{{buyContent}}"></image>
</view>
<!-- 文创商品 -->
<view class="buy-content-art" wx:if="{{orderType === 4}}">
<view class="buy-content-art-title">
<text>取货门店</text>
......@@ -36,6 +40,7 @@
</view>
</view>
<!-- 餐品 -->
<view class="buy-content-art" wx:if="{{orderType === 5}}">
<view class="buy-content-art-title">
<text>取货门店</text>
......@@ -55,6 +60,7 @@
</view>
</view>
<!-- 活动 -->
<view class="buy-content-activity row align-c" wx:if="{{orderType === 6}}">
<image src="{{resourcesBase + shopInfo.cover}}"></image>
<view class="buy-content-activity-info col con-b">
......@@ -70,6 +76,7 @@
</view>
</view>
<!-- 电影 -->
<view class="buy-content-activity row align-c" wx:if="{{orderType === 7}}">
<image src="{{resourcesBase + shopInfo.cover}}"></image>
<view class="buy-content-activity-info col con-b">
......
......@@ -2,7 +2,9 @@ const App = getApp()
Page({
data: {
bannerImg: App.globalData.appResourcesBase + 'play/home/type.png',
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
navigationLogoTop: 0,
navigationLogoMarginTop: 0,
......@@ -12,25 +14,31 @@ Page({
strategyOriginList: [],
//接口参数
pageNo: 1,
pageSize: 3,
pageSize: 10,
loading: false,
moreData: true,
activity: [],
swiperActivityCurrent: 0,
activityList: [],
swiperRecentCurrent: 0,
movieList: [],
swiperMovieCurrent: 0,
touristRouteList: [],
},
onLoad: function (options) {
this.setNavigationLogo()
this.loadVisiterPlanList()
},
onShow: function () {
this.queryActivity()
this.queryMovie()
this.routeList()
},
/**
......@@ -57,7 +65,6 @@ Page({
* @returns
*/
queryActivity: function () {
var that = this
App.wxRequest({
url: '/api/v1/activity/getList',
data: {
......@@ -81,7 +88,7 @@ Page({
})
this.setData({
activity: tmpArr
activityList: tmpArr
})
}
})
......@@ -122,7 +129,7 @@ Page({
'priceSpecialText': App.modular.utils.formatAmount(funcResponse[i].ownerPrice), // 业主价文本格式
'priceType': 1,
'tagsId': funcResponse[i].tagIds,
'tags': funcResponse[i].tags.replace(/( )?热映影片( )?/, ' ').split(' '),
'tags': funcResponse[i].tags.split(' '),
}
if (funcItem.tagsId.includes('102')) {
funcList.push(funcItem)
......@@ -148,9 +155,8 @@ Page({
},
onActivityDetail: function (funcItem) {
console.log(funcItem)
wx.navigateTo({
url: '/pages/play/activity-detail/activity-detail?id=' + funcItem.currentTarget.dataset.id
url: '/pages/play/activity-detail/activity-detail?id=' + funcItem.currentTarget.dataset.item.id
})
},
......@@ -191,10 +197,10 @@ Page({
},
// 近期活动swiper
swiperActivityChange: function (e) {
let swiperActivityCurrent = e.detail.current
swiperRecentChange: function (e) {
let swiperRecentCurrent = e.detail.current
this.setData({
swiperActivityCurrent
swiperRecentCurrent
})
},
// 热门电影swiper
......@@ -223,84 +229,56 @@ Page({
url: '/pages/play/movie-detail/movie-detail?id=' + id
})
},
// 游客攻略列表
loadVisiterPlanList() {
this.data.loading = true
var that = this
/**
* 查询游客攻略
* @function
* @param
* @returns
*/
routeList: function () {
App.wxRequest({
url: '/api/v1/strategy/getList',
data: { pageSize: that.data.pageSize+'', pageNo: that.data.pageNo+''},
success: function (res) {
that.setData({
loading: false
})
if (res.data.list.length > 0) {
let count = that.data.strategyOriginList.length
if (that.data.pageNo == 1) {
count = 0
}
let tempArray = []
for(let i = 0; i < res.data.list.length; i++) {
let item = res.data.list[i]
let strategy = {
id: item.id,
image: (count == 0 && i == 0) ? item.topImg : item.cover,
title: item.title,
date: item.updateDate,
index: count + i - 1,
tags: item.tags.split('#')
}
tempArray.push(strategy)
}
// console.log('tempArray', tempArray)
if (that.data.pageNo == 1) {
var newArr = tempArray.slice(1)
var firstItem = tempArray[0]
// console.log('firstItem', firstItem)
that.setData({
moreData: (tempArray.length >= Number(res.data.count)) ? false : true,
['strategyFirstItem.id']: firstItem.id,
['strategyFirstItem.image']: firstItem.image,
['strategyFirstItem.title']: firstItem.title,
['strategyFirstItem.date']: firstItem.date,
strategyList: newArr,
strategyOriginList: tempArray,
})
} else {
that.setData({
moreData: (count + tempArray.length >= Number(res.data.count)) ? false : true,
strategyOriginList: that.data.strategyOriginList.concat(tempArray),
strategyList: tempArray,
})
data: { pageSize: this.data.pageSize + '', pageNo: this.data.pageNo + '' },
success: (response) => {
let funcResponse = response.data
let funcList = []
for (let i = 0, l = funcResponse.list.length; i < l; i++) {
let funcItem = {
'id': funcResponse.list[i].id,
'cover': funcResponse.list[i].cover,
'title': funcResponse.list[i].title,
'content': funcResponse.list[i].content,
'date': funcResponse.list[i].updateDate,
'tags': funcResponse.list[i].tags.split('#'),
// 'isTop': Number(funcResponse.list[i].top) === 1 ? true : false,
// 'topCover': '',
}
// 游客攻略瀑布列表
wx.lin.renderWaterFlow(that.data.strategyList, that.data.pageNo == 1 ? true : false, () => {})
} else {
// if (funcItem) funcItem.topCover = funcResponse.list[i].topImg
funcList.push(funcItem)
}
},
fail: function(err) {
that.setData({
loading: false
})
}
this.setData({
touristRouteList: funcList
})
},
fail: (err) => {
onReachBottom: function() {
console.log('触底啦')
if (this.data.loading || !this.data.moreData) {
return
}
this.data.pageNo += 1
this.loadVisiterPlanList()
})
},
// 游客攻略详情
onStrategyDetail: function (funcItem) {
console.log(funcItem)
/**
* 游客攻略详情
* @function
* @param
* @returns
*/
onTouristRouteDetail: function (event) {
let funcItem = event.currentTarget.dataset.item
wx.navigateTo({
url: '/pages/play/strategy-detail/strategy-detail?id=' + funcItem.detail.item.id
url: '/pages/play/strategy-detail/strategy-detail?id=' + funcItem.id
})
},
})
\ No newline at end of file
......@@ -6,8 +6,9 @@
<image src="./image/title-minor.png"></image>
</view>
<!-- 畅玩分类 -->
<view class="banner">
<image src="{{bannerImg}}"></image>
<image src="{{resourcesBase + 'play/home/type.png'}}"></image>
<button class="art-button" bindtap="onToArt"></button>
<button class="health-button" bindtap="onToHealth"></button>
<button class="food-button" bindtap="onToFood"></button>
......@@ -15,24 +16,26 @@
<button class="hotel-button" bindtap="onToHotel"></button>
</view>
<!-- 近期活动 -->
<view class="title row con-b align-c">
<image src="./image/title-activity.png">近期活动</image>
<text bindtap="onAllActivity" bindtap="onAllActivity">查看全部</text>
<image src="./image/title-activity.png"></image>
<text bindtap="onAllRecent" bindtap="onAllActivity">查看全部</text>
</view>
<swiper class="activity-swiper" next-margin="38rpx" bindchange="swiperActivityChange">
<block wx:for="{{activity}}" wx:key="id">
<swiper-item class="activity-item" bindtap="onActivityDetail" data-id="{{item.id}}">
<image class="{{swiperActivityCurrent === index ? 'activity-item-left' : '' }} {{swiperActivityCurrent === activity.length - 1 ? 'activity-item-center' : ''}}" src="{{item.cover}}"></image>
<swiper class="activity-swiper" next-margin="38rpx" bindchange="swiperRecentChange">
<block wx:for="{{activityList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<swiper-item class="activity-item" data-item="{{item}}" bindtap="onActivityDetail">
<image class="{{swiperRecentCurrent === index ? 'activity-item-left' : '' }} {{swiperRecentCurrent === banner.length - 1 ? 'activity-item-center' : ''}}" src="{{item.cover}}"></image>
</swiper-item>
</block>
</swiper>
<!-- 热映影片 -->
<view class="title row con-b align-c">
<image src="./image/title-movie.png">热映影片</image>
<image src="./image/title-movie.png"></image>
<text bindtap="onAllMovie">查看全部</text>
</view>
<swiper class="movie-swiper" next-margin="38rpx" bindchange="swiperMovieChange">
<block wx:for="{{movieList}}" wx:key="id">
<block wx:for="{{movieList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<swiper-item class="movie-item col con-e">
<view class="movie-wrapper {{swiperMovieCurrent === index ? 'movie-item-left' : '' }} {{swiperMovieCurrent === movieList.length - 1 ? 'movie-item-center' : ''}}" bindtap="onMovieDetail" data-id="{{item.name}}">
<view class="movie-cover">
......@@ -44,7 +47,7 @@
<text>{{item.movieName}}</text>
</view>
<view class="movie-tags row">
<block wx:for="{{item.tags}}" wx:for-item="tags" wx:key="index">
<block wx:for="{{item.tags}}" wx:for-index="index" wx:for-item="tags" wx:key="index">
<text>{{tags}}</text>
</block>
</view>
......@@ -76,11 +79,47 @@
<!-- 游客攻略 -->
<view class="route">
<block wx:if="{{touristRouteList.length > 0}}">
<view class="title row align-c">
<image src="./image/title-route.png">游客攻略</image>
<image src="./image/title-route.png"></image>
</view>
<view class="route-list row con-b">
<!-- 左侧列表 -->
<view class="route-list-left">
<block wx:for="{{touristRouteList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="route-item" wx:if="{{index % 2 === 0}}" data-item="{{item}}" bindtap="onTouristRouteDetail">
<view class="row con-c align-c">
<image src="{{item.cover}}" mode="aspectFill"></image>
</view>
<view class="route-item-tags row align-c">
<block wx:for="{{item.tags}}" wx:for-index="indexTags" wx:for-item="itemTags" wx:key="indexTags">
<text>{{'# ' + itemTags}}</text>
</block>
</view>
<text class="route-item-title">{{item.title}}</text>
<text class="route-item-content">{{item.date}}</text>
</view>
</block>
</view>
<view style="margin-top: 50rpx">
<l-water-flow column-gap="15rpx" generic:l-water-flow-item="strategy-item" bind:linitemtap="onStrategyDetail"></l-water-flow>
<!-- 右侧列表 -->
<view class="route-list-right">
<block wx:for="{{touristRouteList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="route-item" wx:if="{{index % 2 === 1}}" data-item="{{item}}" bindtap="onTouristRouteDetail">
<view class="row con-c align-c">
<image src="{{item.cover}}" mode="aspectFill"></image>
</view>
<view class="route-item-tags row align-c">
<block wx:for="{{item.tags}}" wx:for-index="indexTags" wx:for-item="itemTags" wx:key="indexTags">
<text>{{'# ' + itemTags}}</text>
</block>
</view>
<text class="route-item-title">{{item.title}}</text>
<text class="route-item-content">{{item.date}}</text>
</view>
</block>
</view>
</view>
</block>
</view>
</view>
\ No newline at end of file
/* page {
background: linear-gradient(180deg, #FFFFFF 0%, #F2F2F2 100%);
} */
.title {
width: 670rpx;
margin-top: 30rpx;
}
.navigation {
z-index: 1900;
.title > image {
width: 184rpx;
height: 44rpx;
}
/* 顶部标题 */
.logo {
z-index: 1900;
position: fixed;
......@@ -30,6 +33,7 @@
height: 20rpx;
}
/* 畅玩分类 */
.banner {
position: relative;
margin-top: 200rpx;
......@@ -37,6 +41,11 @@
height: 1200rpx;
}
.banner > image {
width: 750rpx;
height: 1200rpx;
}
.art-button {
position: absolute;
top: 40rpx;
......@@ -82,14 +91,7 @@
background: transparent;
}
.all {
width: 104rpx;
height: 36rpx;
background-color: #ccc;
}
/* 近期活动 */
.activity-swiper {
width: 750rpx;
height: 721rpx;
......@@ -114,6 +116,7 @@
margin-left: 51rpx;
}
/* 热映影片 */
.movie-swiper {
width: 750rpx;
height: 366rpx;
......@@ -121,6 +124,11 @@
padding-bottom: 50rpx;
}
.movie-swiper image {
width: 100%;
height: 100%;
}
.movie-item {
width: 712rpx;
}
......@@ -214,209 +222,80 @@
border-radius: 4rpx;
}
/* .banner,
swiper {
position: relative;
width: 100%;
min-height: 480rpx;
margin-top: 100rpx;
} */
/*
swiper-item {
position: relative;
left: 56rpx;
width: 638rpx !important;
height: 480rpx !important;
} */
.banner-content {
width: 638rpx;
height: 408rpx;
margin-top: 36rpx;
padding: 0 24rpx;
border-radius: 2px;
overflow: hidden;
}
.banner-content-active {
width: 638rpx;
height: 480rpx;
border-radius: 2px;
overflow: hidden;
transition: all 0.2s ease-in 0s;
}
/* 更多活动 */
.activity {
width: 100%;
height: 34rpx;
margin-top: 32rpx;
padding: 0 56rpx;
font-size: 26rpx;
font-weight: bolder;
color: #1e2025;
}
.activity image {
width: 32rpx;
height: 32rpx;
}
/* 装饰波浪 */
.ornament-wave {
width: 750rpx;
height: 60rpx;
margin-top: 20rpx;
}
.ornament-wave image {
width: 750rpx;
height: 60rpx;
}
/* 标签选择 */
.tab {
width: 100%;
padding: 40rpx 40rpx 0 40rpx;
background: #fff;
}
.tab-fixed {
z-index: 1700;
position: fixed;
top: 68px;
left: 0;
padding: 40rpx;
}
.tab-blank {
/* 游客攻略 */
.route {
width: 750rpx;
height: 190rpx;
background: #fff;
}
.tab .tab-item-active {
width: 100rpx;
height: 100rpx;
margin-bottom: 16rpx;
border-radius: 50%;
background: #e3eeff;
}
.tab .tab-item-inactive {
width: 100rpx;
height: 100rpx;
margin-bottom: 16rpx;
border-radius: 50%;
background: #f5f6f8;
}
.tab .tab-item-text-active {
color: #15191f;
}
.tab .tab-item-text-inactive {
color: #959da9;
padding: 0 40rpx 100rpx 40rpx;
background: linear-gradient(180deg, #FFFFFF 0%, #F2F2F2 100%);
}
.tab-item text {
font-size: 24rpx;
text-align: center;
.route-list {
margin-top: 50rpx;
}
.tab-item image {
width: 52rpx;
height: 52rpx;
.route-list-left,
.route-list-right {
width: 328rpx;
}
/* 标签详情 */
.detail {
width: 750rpx;
min-height: 500rpx;
background: #fefefe;
.route-item {
display: flex;
flex-direction: column;
max-width: 328rpx;
margin-top: 16rpx;
border-radius: 4rpx;
overflow: hidden;
background: #ffffff;
}
.detail image {
display: block;
width: 100%;
height: 100%;
.route-item image {
height: 468rpx;
}
/* 商店详情 */
.shop-item {
position: relative;
width: 750rpx;
height: 1152rpx;
background: #f3f6fc;
.route-list-right .route-item:first-child image {
height: 354rpx;
}
.shop-item image {
display: block;
width: 750rpx;
height: 1152rpx;
font-size: 0;
}
.route-item-title {
display: -webkit-box;
margin: 24rpx 20rpx;
font-size: 26rpx;
font-weight: bolder;
color: #000000;
.shop-item .button {
position: absolute;
width: 534rpx;
height: 96rpx;
background: #86c5e1;
border-radius: 2px;
overflow: hidden;
font-size: 30rpx;
font-weight: 500;
color: #fff;
line-height: 42rpx;
}
image {
width: 100%;
height: 100%;
text-overflow: ellipsis;
line-clamp: 2;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
/* 游客攻略 */
.route {
padding: 0 40rpx;
background: linear-gradient(180deg, #FFFFFF 0%, #F2F2F2 100%);
}
.title {
width: 670rpx;
margin-top: 30rpx;
}
.title > image {
width: 184rpx;
height: 44rpx;
}
.strategy-content {
z-index: 3;
position: relative;
width: 670rpx;
height: 320rpx;
margin-top: 32rpx;
border-radius: 2px;
.route-item-tags {
flex-wrap: wrap;
height: 32rpx;
margin-top: 24rpx;
padding: 0 24rpx;
overflow: hidden;
word-wrap: break-word;
}
.strategy-content .operation {
position: absolute;
bottom: 32rpx;
margin: 0 40rpx;
}
.route-item-tags text {
display: inline-block;
height: 32rpx;
margin-right: 16rpx;
padding: 0 12rpx;
border-radius: 4px;
background: #15191F;
.strategy-content .operation text {
/* height: 40rpx; */
font-size: 38rpx;
font-weight: 800;
color: #ffffff;
white-space: nowrap;
font-size: 18rpx;
font-weight: 500;
line-height: 32rpx;
color: #FFFFFF;
}
.detail-item {
margin-top: 58rpx;
.route-item-content {
margin: 0 24rpx 24rpx 24rpx;
font-size: 22rpx;
color: #959DA9;
}
\ No newline at end of file
......@@ -17,8 +17,7 @@ Page({
this.setData({
bannerHeight: wx.getSystemInfoSync().windowHeight
})
// this.queryDetail(Number(options.id))
this.queryDetail(1)
this.queryDetail(Number(options.id))
},
/**
......
......@@ -72,7 +72,7 @@ Page({
this.setData({
option: options
})
console.log(this.data.option)
this.queryDetail(Number(options.id))
if (Number(options.id) === 2) {
this.queryDetailMovie()
......@@ -225,7 +225,7 @@ Page({
],
shareImage: App.globalData.appResourcesBase + 'share/share-13.png',
name: '原野MOJITO',
title: '原味舒食',
title: '原野MOJITO',
date: '周一至周日 10:00 - 凌晨02:00',
describe: [
App.globalData.appResourcesBase + 'shop/detail/detail-3-2-1.png',
......@@ -292,12 +292,10 @@ Page({
break
}
}
console.log(funcIndex)
// 缓存当前商店信息
for (let i = 0, l = App.globalData.shopId.length; i < l; i++) {
if (funcAppId === App.globalData.shopId[i].appId) {
console.log(funcAppId)
let funcItem = {
'id': App.globalData.shopId[i].id,
'appId': App.globalData.shopId[i].appId,
......@@ -343,7 +341,6 @@ Page({
let shopInfo = wx.getStorageSync('shopInfoBuffer')
let officeId = shopInfo.id
let genre = shopInfo.shopType
console.log(shopInfo)
App.wxRequest({
url: '/api/v1/commodity/recommend',
data: {
......@@ -353,7 +350,6 @@ Page({
},
success: function(res) {
let funcResponse = res.data
console.log(funcResponse)
let funcList = []
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
......@@ -457,7 +453,6 @@ Page({
},
onPageScroll: function (funcEvent) {
// console.log(funcEvent)
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
......@@ -577,7 +572,6 @@ Page({
})
},
onToBuy: function (event) {
console.log(event.currentTarget.dataset)
let id = event.currentTarget.dataset.id
let classifyId = event.currentTarget.dataset.classid
wx.navigateTo({
......
......@@ -3,7 +3,7 @@ let logicData = {
pageScrollTimer: 0,
}
const app = getApp()
const App = getApp()
Page({
data: {
......@@ -16,39 +16,148 @@ Page({
detailImage: [],
detailImageUrl: [],
detailIndex: 0,
relation: [],
date: '',
//接口参数
id: '',
relation: [], // 文中提及列表
},
onLoad: function (options) {
this.setData({
id: options.id,
})
var that = this
app.login({
success: function() {
that.loadStrategyDetail()
this.queryTouristRouteDetail()
},
/**
* 游客攻略详情
* @function
* @param
* @returns
*/
queryTouristRouteDetail() {
App.wxRequest({
url: '/api/v1/strategy/getDetail',
data: { id: this.data.id },
success: (res) => {
// 此代码段处理目的为,匹配富文本代码中的 <img> 标签,并将其图片的宽度修改为适应屏幕
// width:100% --- 图片宽度加以限制,避免超出屏幕
// height:auto --- 高度自适应
// display:block --- 此代码,可以去掉图片之间的空白间隔,个人觉得好用
let content = res.data.content
.replace(/<img/gi, '<img style="width:100%;height:auto;display:block" ')
.replace(/<table/gi, '<table style="max-width:100%;height:auto;display:block" ')
.replace(/<section/g, '<div')
.replace(/\/section>/g, '\div>');
this.setData({
banner: res.data.banners,
content: content,
date: res.data.updateDate,
title: res.data.title
})
this.queryRelation(res.data.smParkIds)
},
})
},
/**
* 文中提及列表
* @function
* @param
* @returns
*/
queryRelation: function (parkIds) {
if (!parkIds) {
return
}
App.wxRequest({
url: '/api/v1/park/getParksByParkIds',
data: { smParkIds: parkIds },
success: (response) => {
let funcResponse = response.data
let funcList = []
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].id,
'cover': funcResponse[i].cardImg,
'title': funcResponse[i].name,
'time': '营业时间 ' + funcResponse[i].businessTime,
'price': funcResponse[i].chargeStandard,
'describe': '',
}
funcList.push(funcItem)
}
this.setData({
relation: funcList
})
}
})
},
/**
* 文中提及跳转
* @function
* @param
* @returns
*/
onRelation: function (event) {
let funcShopId = event.currentTarget.dataset.id
let funcShopAppId = ''
for (let i = 0, l = App.globalData.pointInfo.length; i < l; i++) {
if (funcShopId === App.globalData.pointInfo[i].id) {
funcShopAppId = App.globalData.pointInfo[i].appId
break
}
}
if (funcShopAppId && funcShopAppId !== 3) {
wx.navigateTo({
url: '/pages/play/service-detail/service-detail?id=' + funcShopAppId
})
return
}
if (funcShopAppId && funcShopAppId === 3) {
wx.navigateTo({
url: '/pages/campsite/home-mirror/home-mirror'
})
return
}
},
onSwiperChange: function (funcEvent) {
/**
* banner 变换事件
* @function
* @param
* @returns
*/
eventSwiperChange: function (event) {
this.setData({
bannerIndex: funcEvent.detail.current
bannerIndex: event.detail.current
})
},
onPageScroll: function(funcEvent) {
/**
* 页面滚动事件
* @function
* @param
* @returns
*/
eventPageScroll: function (event) {
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
if (funcEvent.scrollTop > 40 && !this.data.isNavigationWhite) {
if (event.scrollTop > 40 && !this.data.isNavigationWhite) {
this.setData({
isNavigationWhite: true
})
......@@ -58,7 +167,7 @@ Page({
})
}
if (funcEvent.scrollTop <= 40) {
if (event.scrollTop <= 40) {
this.setData({
isNavigationWhite: false
})
......@@ -74,102 +183,4 @@ Page({
clearTimeout(logicData.pageScrollTimer)
}, 40)
},
// 攻略详情
loadStrategyDetail() {
var that = this
app.wxRequest({
url: '/api/v1/strategy/getDetail',
data: { id: that.data.id },
success: function(res) {
/**
* 此代码段处理目的为,匹配富文本代码中的 <img> 标签,并将其图片的宽度修改为适应屏幕
* width:100% --- 图片宽度加以限制,避免超出屏幕
* height:auto --- 高度自适应
* display:block --- 此代码,可以去掉图片之间的空白间隔,个人觉得好用
*/
var content = res.data.content.replace(/<img/gi, '<img style="width:100%;height:auto;display:block" ')
.replace(/<table/gi, '<table style="max-width:100%;height:auto;display:block" ')
.replace(/<section/g, '<div')
.replace(/\/section>/g, '\div>');
that.setData({
banner: res.data.banners,
content: content,
date: res.data.updateDate,
title: res.data.title
})
that.getParksByParkIds(res.data.smParkIds)
},
})
},
shopDetail(e) {
let datasetId = e.currentTarget.dataset.id
let id = ''
if (datasetId == '21a0cbbd39604380bc46fba38ac5fb63') {
// 海错图展馆
id = 1
} else if (datasetId == 'b8f04379bf164b7f8bca69be14146a17') {
// 拾光花坊
id = 2
} else if (datasetId == 'd8922a8f759245d4949b62693099edb5') {
// 元养水韵SPA馆
id = 3
} else if (datasetId == 'd0e5ff414f794e15bc33c4e11f5356a8') {
// 原味舒食
id = 4
} else if (datasetId == '81078c007c034d46b7dfe59935d84f7a') {
// 原野MOJITO
id = 5
} else if (datasetId == '29e79743f0f94e5eb726e0ebdfe64248') {
// 星空影院
id = 6
} else if (datasetId == '559d980e9eaf4459883fb3a556d24347') {
// 儿童营地信息
wx.navigateTo({
url: '/pages/campsite-mirror/campsite-mirror',
})
} else if (datasetId == 'c0a2d795a7a54dcd9459dd1b969c1771') {
// 住宿信息
}
if (id != '') {
wx.navigateTo({
url: '/pages/shop-detail/shop-detail?id=' + id
})
}
},
// 攻略详情文中提及
getParksByParkIds(parkIds) {
if (!parkIds) {
return
}
var that = this
app.wxRequest({
url: '/api/v1/park/getParksByParkIds',
data: { smParkIds: parkIds },
success: function(res) {
var tmpArr = [];
res.data.forEach(item => {
var tmpItem = {
'id': item.id,
'cover': item.guideImg,
'title': item.name,
'time': '营业时间 ' + item.businessTime,
'price': item.chargeStandard,
'describe': '',
}
tmpArr.push(tmpItem)
})
that.setData({
relation: tmpArr
})
}
})
}
})
\ No newline at end of file
{
"usingComponents": {
"parser":"../../component/parser.min/parser"
"parser": "../../component/parser.min/parser"
}
}
\ No newline at end of file
......@@ -10,7 +10,7 @@
<view class="container">
<view id="banner" class="banner">
<swiper class="banner-swiper" autoplay circular interval="2000" duration="500" indicator-color="rgba(0, 0, 0, 0)" indicator-active-color="rgba(0, 0, 0, 0)" bindchange="onSwiperChange">
<swiper class="banner-swiper" autoplay circular interval="2000" duration="500" indicator-color="rgba(0, 0, 0, 0)" indicator-active-color="rgba(0, 0, 0, 0)" bindchange="eventPageScroll">
<block wx:for="{{banner}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<swiper-item class="banner-swiper-item">
<image class="banner-swiper-image" src="{{item}}"></image>
......@@ -37,7 +37,7 @@
<text>文中提及</text>
</view>
<block wx:for="{{relation}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="relation-item row con-b align-c" data-id="{{item.id}}" bindtap="shopDetail">
<view class="relation-item row con-b align-c" data-id="{{item.id}}" bindtap="onRelation">
<image mode="widthFix" src="{{item.cover}}"></image>
<view class="relation-item-info col">
<text>{{item.title}}</text>
......
......@@ -131,137 +131,4 @@ rich-text {
.relation-item-more image {
width: 32rpx;
height: 32rpx;
}.navigation {
z-index: 1900;
position: fixed;
top: 0;
left: 0;
width: 750rpx;
}
.banner {
position: relative;
width: 750rpx;
height: 870rpx;
background: #ffffff;
}
.banner-swiper,
.banner-swiper-item,
.banner-swiper-image {
position: absolute;
top: 0 !important;
left: 0 !important;
width: 750rpx;
height: 870rpx;
}
.banner-swiper-point {
position: relative;
top: 760rpx;
left: 0;
}
.detail {
width: 750rpx;
padding: 6px 32rpx;
}
.detail-title {
width: 670rpx;
margin: 80rpx 0 64rpx 0;
font-size: 38rpx;
font-weight: 800;
color:#15191F;
line-height: 52rpx;
}
.detail-date {
/* width: 152rpx; */
height: 40rpx;
margin: 64rpx 0 32rpx 0;
font-size: 26rpx;
font-weight: 400;
color: #959DA9;
line-height: 40rpx;
}
.detail > image {
min-width: 100%;
}
rich-text {
margin-bottom: 52rpx;
font-size: 30rpx;
font-weight: 300;
color: #15191F;
line-height: 52rpx;
}
/* 攻略相关 */
.relation-title {
margin: 0 40rpx 90rpx 40rpx;
padding-top: 64rpx;
border-top: 1px #E2E7EF solid;
}
.relation-title text {
width: 120rpx;
height: 42rpx;
margin-top: 40rpx;
font-size: 30rpx;
font-weight: bold;
color:rgba(21,25,31,1);
}
.relation-item {
position: relative;
width: 670rpx;
height: 238rpx;
margin: 0 40rpx 104rpx 40rpx;
background:rgba(245, 246, 248, 1);
border-radius: 2px;
}
.relation-item > image {
position: absolute;
top: -24rpx;
left: 24rpx;
width: 176rpx;
height: 214rpx;
border-radius: 2px;
overflow: hidden;
}
.relation-item {
padding: 32rpx 32rpx 48rpx 230rpx;
}
.relation-item-info text:nth-child(1) {
font-size: 30rpx;
font-weight: bold;
line-height: 42rpx;
color:rgba(21, 25, 31, 1);
}
.relation-item-info text:nth-child(2) {
margin-top: 30rpx;
font-size: 26rpx;
line-height: 36rpx;
color: #656E7B;
}
.relation-item-info text:nth-child(3) {
margin-top: 12rpx;
font-size: 26rpx;
line-height: 36rpx;
color: #656E7B;
}
.relation-item-more {
height: 100%;
}
.relation-item-more image {
width: 32rpx;
height: 32rpx;
}
\ No newline at end of file
......@@ -21,16 +21,16 @@
"checkSiteMap": false,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": true,
"useCompilerModule": false,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"packNpmManually": false,
"packNpmRelationList": [],
"enableEngineNative": false
......@@ -215,13 +215,6 @@
"pathName": "pages/mine/order/order",
"query": "",
"scene": null
},
{
"id": 21,
"name": "pages/play/service-detail/service-detail",
"pathName": "pages/play/service-detail/service-detail",
"query": "id=1&type=4",
"scene": null
}
]
}
......
......@@ -4,6 +4,7 @@
top: 0;
left: 0;
width: 750rpx;
z-index: 9;
}
.container {
......
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