Commit 7a45e84c by 严立

LL - 畅玩,订单详情

parent 3a64cb5f
...@@ -45,7 +45,7 @@ App({ ...@@ -45,7 +45,7 @@ App({
return funcCss return funcCss
}, },
wxRequest(obj) { wxRequest: function (obj) {
let that = this let that = this
var token = that.globalData.token var token = that.globalData.token
var param = obj.data ? JSON.stringify(obj.data) : "" var param = obj.data ? JSON.stringify(obj.data) : ""
...@@ -104,9 +104,8 @@ App({ ...@@ -104,9 +104,8 @@ App({
}); });
}, },
login(obj) { login: function (obj) {
let token = this.globalData.token let token = this.globalData.token
let that = this
if (token) { if (token) {
if (obj.success) { if (obj.success) {
obj.success(token) obj.success(token)
...@@ -119,10 +118,14 @@ App({ ...@@ -119,10 +118,14 @@ App({
url: '/api/v1/login/getSmallSession?code=' + res.code, url: '/api/v1/login/getSmallSession?code=' + res.code,
method: 'GET', method: 'GET',
success: (response) => { success: (response) => {
console.log(response)
let funcResponse = response.data let funcResponse = response.data
this.globalData.token = funcResponse.token this.globalData.token = funcResponse.token
this.globalData.refreshToken = funcResponse.refreshToken this.globalData.refreshToken = funcResponse.refreshToken
wx.setStorageSync('sessionKey', funcResponse.session_key)
let funcUserInfo = { let funcUserInfo = {
'openId': funcResponse.openid, 'openId': funcResponse.openid,
'name': funcResponse.nickName, 'name': funcResponse.nickName,
...@@ -143,9 +146,7 @@ App({ ...@@ -143,9 +146,7 @@ App({
}) })
} }
}) })
} }
}, },
registUserInfo(obj) { registUserInfo(obj) {
......
...@@ -274,7 +274,7 @@ Page({ ...@@ -274,7 +274,7 @@ Page({
*/ */
onBuySupply: function (event) { onBuySupply: function (event) {
// funcShopType 使用函数区分商品类型,所以每个函数里的数值是固定的 // funcShopType 使用函数区分商品类型,所以每个函数里的数值是固定的
let funcShopType = 2 let funcShopType = 5
let funcShopAppId = event.currentTarget.dataset.id let funcShopAppId = event.currentTarget.dataset.id
this.setShopInfo(funcShopAppId, funcShopType) this.setShopInfo(funcShopAppId, funcShopType)
......
...@@ -335,11 +335,6 @@ Page({ ...@@ -335,11 +335,6 @@ Page({
onTest2: function (event) { onTest2: function (event) {
}, },
onTest3: function (event) {
wx.navigateTo({
url: '/pages/pay/order-detail/order-detail?type=' + event.currentTarget.dataset.index
})
},
onTest6: function (event) { onTest6: function (event) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/pay/order-comment/order-comment', url: '/pages/pay/order-comment/order-comment',
......
...@@ -79,20 +79,6 @@ ...@@ -79,20 +79,6 @@
<l-water-flow column-gap="14rpx" generic:l-water-flow-item="strategy-item" bind:linitemtap="onStrategyDetail"></l-water-flow> <l-water-flow column-gap="14rpx" generic:l-water-flow-item="strategy-item" bind:linitemtap="onStrategyDetail"></l-water-flow>
</view> </view>
</block> --> </block> -->
<button class="test-button" data-index="{{1}}" bindtap="onTest">年卡月卡</button>
<button class="test-button" data-index="{{2}}" bindtap="onTest">次票</button>
<button class="test-button" data-index="{{3}}" bindtap="onTest">SPA</button>
<button class="test-button" data-index="{{4}}" bindtap="onTest">文创</button>
<button class="test-button" data-index="{{5}}" bindtap="onTest">餐品</button>
<button class="test-button" data-index="{{6}}" bindtap="onTest">活动</button>
<button class="test-button" data-index="{{7}}" bindtap="onTest">观影</button>
<button class="test-button" bindtap="onTest2">餐品列表</button>
<button class="test-button" data-index="{{0}}" bindtap="onTest3">订单 未使用</button>
<button class="test-button" data-index="{{1}}" bindtap="onTest3">订单 待评价</button>
<button class="test-button" data-index="{{2}}" bindtap="onTest3">订单 已过期</button>
<button class="test-button" data-index="{{3}}" bindtap="onTest3">订单 已取消</button>
<button class="test-button" data-index="{{4}}" bindtap="onTest3">订单 已评价</button>
<button class="test-button" data-index="{{5}}" bindtap="onTest3">订单 待付款</button>
<button class="test-button" bindtap="onTest4">券码核销</button> <button class="test-button" bindtap="onTest4">券码核销</button>
<button class="test-button" data-index="{{4}}" bindtap="onTest5">券码详情 普通</button> <button class="test-button" data-index="{{4}}" bindtap="onTest5">券码详情 普通</button>
<button class="test-button" data-index="{{5}}" bindtap="onTest5">券码详情 餐品</button> <button class="test-button" data-index="{{5}}" bindtap="onTest5">券码详情 餐品</button>
......
const app = getApp() const App = getApp()
Page({ Page({
data: { data: {
height: '', height: '',
islogin: false, islogin: false,
isphone: false, isphone: false,
userInfo: {},
}, },
onLoad: function (options) { onLoad: function (options) {
let mobile = wx.getStorageSync('mobile') let funcUserInfo = wx.getStorageSync('userInfo')
let nickName = wx.getStorageSync('nickName')
let avatarUrl = wx.getStorageSync('avatarUrl')
this.setData({ this.setData({
height: wx.getSystemInfoSync().windowHeight, //获取屏幕的高度 height: wx.getSystemInfoSync().windowHeight,
islogin: (nickName && avatarUrl) ? true : false, islogin: (funcUserInfo.name && funcUserInfo.avatar) ? true : false,
isphone: (mobile) ? true : false, isphone: (funcUserInfo.phone) ? true : false,
}) })
}, },
...@@ -37,32 +37,33 @@ Page({ ...@@ -37,32 +37,33 @@ Page({
* 获取用户信息 * 获取用户信息
*/ */
userInfoHandler: function (res) { userInfoHandler: function (res) {
let funcGetUserInfo = res.detail.userInfo
console.log('userInfo', res) console.log('userInfo', res)
if (!res.detail.userInfo) { if (!res.detail.userInfo) {
return return
} }
let avatarUrl = res.detail.userInfo.avatarUrl
let nickName = res.detail.userInfo.nickName let funcUserInfo = this.data.userInfo
// let gender = res.detail.userInfo.gender funcUserInfo.avatar = funcGetUserInfo.avatarUrl
let that = this funcUserInfo.name = funcGetUserInfo.nickName
funcUserInfo.sex = funcGetUserInfo.gender
this.registUserInfo({ this.registUserInfo({
param: { param: {
avatarUrl: avatarUrl, avatarUrl: funcUserInfo.avatar,
nickName: nickName, nickName: funcUserInfo.name,
// sex: gender,
sessionKey: '', sessionKey: '',
encryptedData: '', encryptedData: '',
iv: '', iv: '',
}, },
success: function(res) { success: (res) => {
wx.setStorageSync('avatarUrl', avatarUrl) console.log(res)
wx.setStorageSync('nickName', nickName) wx.setStorageSync('userInfo', funcUserInfo)
// wx.setStorageSync('sex', gender) this.setData({
that.setData({
islogin: true islogin: true
}) })
setTimeout(() => { setTimeout(() => {
that.checkFinish() this.checkFinish()
}, 1000) }, 1000)
} }
}) })
...@@ -72,27 +73,27 @@ Page({ ...@@ -72,27 +73,27 @@ Page({
* 绑定手机号 * 绑定手机号
*/ */
userPhoneHandler: function (res) { userPhoneHandler: function (res) {
console.log('userPhone', res)
if (!res.detail.encryptedData) { if (!res.detail.encryptedData) {
return return
} }
let sessionKey = wx.getStorageSync('session_key') let sessionKey = wx.getStorageSync('sessionKey')
let that = this let funcUserInfo = wx.getStorageSync('userInfo')
this.registUserInfo({ this.registUserInfo({
param: { param: {
avatarUrl: wx.getStorageSync('avatarUrl'), avatarUrl: funcUserInfo.avatar,
nickName: wx.getStorageSync('nickName'), nickName: funcUserInfo.name,
sessionKey: sessionKey, sessionKey: sessionKey,
encryptedData: res.detail.encryptedData, encryptedData: res.detail.encryptedData,
iv: res.detail.iv, iv: res.detail.iv,
}, },
success: function(res) { success: (res) => {
wx.setStorageSync('mobile', res.data.phoneNumber) funcUserInfo.phone = res.data.phoneNumber
that.setData({ wx.setStorageSync('userInfo', funcUserInfo)
this.setData({
isphone: true isphone: true
}) })
setTimeout(() => { setTimeout(() => {
that.checkFinish() this.checkFinish()
}, 1000) }, 1000)
} }
......
...@@ -9,6 +9,17 @@ Page({ ...@@ -9,6 +9,17 @@ Page({
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
orderType: 1, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影 orderType: 1, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
userInfo: {
'openId': '',
'name': '',
'phone': '',
'avatar': '',
'address': '',
'birthday': '',
'sex': '',
'userType': 0
},
mobile: '', mobile: '',
nickName: '', nickName: '',
...@@ -94,33 +105,37 @@ Page({ ...@@ -94,33 +105,37 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
}, },
onShow: function () { onShow: function () {
let that = this this.setUserInfo()
let mobile = wx.getStorageSync('mobile') },
let nickName = wx.getStorageSync('nickName')
let avatarUrl = wx.getStorageSync('avatarUrl') setUserInfo: function () {
if (mobile && nickName && avatarUrl) { let funcUserInfo = wx.getStorageSync('userInfo')
that.setData({
mobile: that.toHide(mobile), if (funcUserInfo.phone && funcUserInfo.name && funcUserInfo.avatar) {
nickName: nickName, funcUserInfo.phone = this.toHide(funcUserInfo.phone)
avatarUrl: avatarUrl,
this.setData({
isRegister: true, isRegister: true,
userInfo: funcUserInfo
}) })
App.login({ App.login({
success: function (token) { success: (token) => {
that.getMyActivityList() this.getMyActivityList()
that.getList() this.getList()
that.getAuth() this.getAuth()
} }
}) })
let userType = wx.getStorageSync('userType') let funcUserType = funcUserInfo.userType
that.setData({ this.setData({
type: userType == 1 ? 1 : 0, type: funcUserType === 1 ? 1 : 0,
}) })
} else { } else {
that.setData({ this.setData({
isRegister: false, isRegister: false,
}) })
} }
...@@ -274,11 +289,10 @@ Page({ ...@@ -274,11 +289,10 @@ Page({
// 获取业主认证信息 // 获取业主认证信息
getAuth() { getAuth() {
let that = this
App.wxRequest({ App.wxRequest({
url: '/api/v1/userAuth/getAuth', url: '/api/v1/userAuth/getAuth',
method: 'GET', method: 'GET',
success: function (res) { success: (res) => {
let state = res.data.state * 1 // 0 待审核 1 审核通过 2 不通过 let state = res.data.state * 1 // 0 待审核 1 审核通过 2 不通过
let stateTest = '去认证' let stateTest = '去认证'
switch (state) { switch (state) {
...@@ -286,11 +300,14 @@ Page({ ...@@ -286,11 +300,14 @@ Page({
case 1: stateTest = '审核通过 '; break; case 1: stateTest = '审核通过 '; break;
case 2: stateTest = '审核失败'; break; case 2: stateTest = '审核失败'; break;
} }
that.setData({ this.setData({
type: state == 1 ? 1 : 0, type: state == 1 ? 1 : 0,
stateTest: stateTest, stateTest: stateTest,
}) })
wx.setStorageSync('userType', state)
let funcUserInfo = wx.getStorageSync('userInfo')
funcUserInfo.userType = state
wx.setStorageSync('userInfo', funcUserInfo)
} }
}) })
}, },
......
...@@ -5,16 +5,16 @@ ...@@ -5,16 +5,16 @@
<image class="background-image" src="./image/mine.png"></image> <image class="background-image" src="./image/mine.png"></image>
<view class="row align-c"> <view class="row align-c">
<view class="mine-avatar" bindtap="checkRegister"> <view class="mine-avatar" bindtap="checkRegister">
<l-avatar size="112" src="{{avatarUrl}}"/> <l-avatar size="112" src="{{userInfo.avatar}}"/>
</view> </view>
<view wx:if="{{isRegister}}" class="mine-info col"> <view wx:if="{{isRegister}}" class="mine-info col">
<view class="row align-c"> <view class="row align-c">
<text>{{nickName}}</text> <text>{{userInfo.name}}</text>
<image src="./image/inform.png" bindtap="goMyInfo"></image> <image src="./image/inform.png" bindtap="goMyInfo"></image>
</view> </view>
<view> <view>
<text>{{mobile}}</text> <text>{{userInfo.phone}}</text>
</view> </view>
</view> </view>
<view wx:else class="mine-info col"> <view wx:else class="mine-info col">
...@@ -29,15 +29,15 @@ ...@@ -29,15 +29,15 @@
<image class="background-image" style="height:512rpx;" src="http://upload.miaomiao-bao.com/8f046202008201043321555.jpg"></image> <image class="background-image" style="height:512rpx;" src="http://upload.miaomiao-bao.com/8f046202008201043321555.jpg"></image>
<view class="row align-c approve"> <view class="row align-c approve">
<view class="mine-avatar"> <view class="mine-avatar">
<l-avatar size="112" src="{{avatarUrl}}"/> <l-avatar size="112" src="{{userInfo.avatar}}"/>
</view> </view>
<view class="mine-info col"> <view class="mine-info col">
<view class="row align-c"> <view class="row align-c">
<text style="color:#F0DABB;font-weight:500;">{{nickName}}</text> <text style="color:#F0DABB;font-weight:500;">{{userInfo.name}}</text>
<image src="/image/inform-w.png" bindtap="goMyInfo"></image> <image src="/image/inform-w.png" bindtap="goMyInfo"></image>
</view> </view>
<view> <view>
<text>{{mobile}}</text> <text>{{userInfo.phone}}</text>
</view> </view>
</view> </view>
<view bindtap="maskShow" class="align-c" style="positive:relative;margin-left:68rpx;display:flex;"> <view bindtap="maskShow" class="align-c" style="positive:relative;margin-left:68rpx;display:flex;">
......
...@@ -38,8 +38,6 @@ Page({ ...@@ -38,8 +38,6 @@ Page({
queryOrder: function () { queryOrder: function () {
let funcName = this.data.orderType[this.data.orderTypeActive].value let funcName = this.data.orderType[this.data.orderTypeActive].value
let funcValue = this.data.statusList[this.data.statusActive].value let funcValue = this.data.statusList[this.data.statusActive].value
console.log(this.data.orderType)
console.log(this.data.statusList)
App.wxRequest({ App.wxRequest({
url: '/api/v1/order/getOrderList', url: '/api/v1/order/getOrderList',
...@@ -55,8 +53,10 @@ Page({ ...@@ -55,8 +53,10 @@ Page({
for (let i = 0, l = funcResponse.length; i < l; i++) { for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = { let funcItem = {
'id': funcResponse[i].orderId, 'id': funcResponse[i].orderId,
'logo': '', 'shopId': '',
'name': funcResponse[i].officeName, 'shopAppId': '',
'shopName': funcResponse[i].officeName,
'shopLogo': '',
'total': 0, 'total': 0,
'status': Number(funcResponse[i].status), 'status': Number(funcResponse[i].status),
'amount': funcResponse[i].totalMoney, 'amount': funcResponse[i].totalMoney,
...@@ -80,39 +80,20 @@ Page({ ...@@ -80,39 +80,20 @@ Page({
// 映射门店信息 // 映射门店信息
for (let i = 0, l = App.globalData.shopId.length; i < l; i++) { for (let i = 0, l = App.globalData.shopId.length; i < l; i++) {
if (funcItem.name === App.globalData.shopId[i].name) { if (funcItem.shopName === App.globalData.shopId[i].name) {
funcItem.logo = App.globalData.shopId[i].logo funcItem.shopId = App.globalData.shopId[i].id
funcItem.shopAppId = App.globalData.shopId[i].appId
funcItem.shopLogo = App.globalData.shopId[i].logo
break break
} }
} }
// 映射显示状态与后台状态
switch (funcItem.status) {
case -2:
funcItem.status = 0
break
case -1:
funcItem.status = 1
break
case 0:
funcItem.status = 2
break
case 1:
funcItem.status = 3
break
case 2:
funcItem.status = 5
break
}
funcList.push(funcItem) funcList.push(funcItem)
} }
this.setData({ this.setData({
orderList: funcList orderList: this.data.orderList.concat(funcList)
}) })
console.log(this.data.orderList)
} }
}) })
}, },
...@@ -166,8 +147,6 @@ Page({ ...@@ -166,8 +147,6 @@ Page({
let funcItem = event.currentTarget.dataset.item let funcItem = event.currentTarget.dataset.item
let funcIndex = event.currentTarget.dataset.index let funcIndex = event.currentTarget.dataset.index
console.log(funcItem)
this.setData({ this.setData({
'orderTypeTitle': funcItem.name, 'orderTypeTitle': funcItem.name,
'orderTypeActive': funcIndex, 'orderTypeActive': funcIndex,
...@@ -206,6 +185,16 @@ Page({ ...@@ -206,6 +185,16 @@ Page({
*/ */
onOrderDetail: function (event) { onOrderDetail: function (event) {
let funcItem = event.currentTarget.dataset.item let funcItem = event.currentTarget.dataset.item
// 缓存当前订单所在商店信息
let funcShopInfo = {
'id': funcItem.shopId,
'appId': funcItem.shopAppId,
'name': funcItem.shopName,
'logo': funcItem.shopLogo,
'shopType': '',
}
wx.setStorageSync('shopInfoBuffer', funcShopInfo)
wx.navigateTo({ wx.navigateTo({
url: '/pages/pay/order-detail/order-detail?id=' + funcItem.id, url: '/pages/pay/order-detail/order-detail?id=' + funcItem.id,
}) })
...@@ -293,4 +282,17 @@ Page({ ...@@ -293,4 +282,17 @@ Page({
onOrderAgain: function (event) { onOrderAgain: function (event) {
}, },
/**
* 页面触底事件
* @function
* @param
* @returns
*/
onReachBottom: function () {
this.setData({
orderPages: this.data.orderPages + 1
})
this.queryOrder()
},
}) })
\ No newline at end of file
...@@ -65,16 +65,16 @@ ...@@ -65,16 +65,16 @@
<view class="order-list-item col align-c" data-item="{{item}}" bindtap="onOrderDetail"> <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="order-list-item-title row con-b align-c">
<view class="row align-c"> <view class="row align-c">
<image wx:if="{{item.logo}}" src="{{resourcesBase + 'commodity/' + item.logo}}"></image> <image wx:if="{{item.shopLogo}}" src="{{resourcesBase + 'commodity/' + item.shopLogo}}"></image>
<text>{{item.name}}</text> <text>{{item.name}}</text>
</view> </view>
<view> <view>
<text class="warning" wx:if="{{item.status === 0}}">待付款</text> <text class="warning" wx:if="{{item.status === 0}}">待付款</text>
<text class="warning" wx:if="{{item.status === 1}}">待使用</text> <text class="warning" wx:if="{{item.status === 2}}">待使用</text>
<text class="warning" wx:if="{{item.status === 2}}">待评价</text> <text class="warning" wx:if="{{item.status === 3}}">待评价</text>
<text class="message" wx:if="{{item.status === 3}}">已取消</text> <text class="message" wx:if="{{item.status === -1}}">已取消</text>
<text class="message" wx:if="{{item.status === 4}}">已过期</text> <text class="message" wx:if="{{item.status === 4}}">已过期</text>
<text class="message" wx:if="{{item.status === 5}}">已评价</text> <text class="message" wx:if="{{item.status === 3}}">已评价</text>
</view> </view>
</view> </view>
...@@ -100,11 +100,11 @@ ...@@ -100,11 +100,11 @@
</view> </view>
<view class="row align-c"> <view class="row align-c">
<button wx:if="{{item.status === 0}}" class="delete row con-c align-c" data-item="{{item}}" catchtap="onOrderCancel">取消订单</button> <button wx:if="{{item.status === 0}}" class="delete row con-c align-c" data-item="{{item}}" catchtap="onOrderCancel">取消订单</button>
<button wx:if="{{item.status >= 3}}" class="delete row con-c align-c" data-item="{{item}}" catchtap="onOrderRemove">删除订单</button> <button wx:if="{{item.status === -1 || item.status === 4}}" class="delete row con-c align-c" data-item="{{item}}" catchtap="onOrderRemove">删除订单</button>
<button wx:if="{{item.status === 0}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderPay">去支付</button> <button wx:if="{{item.status === 0}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderPay">去支付</button>
<button wx:if="{{item.status === 1}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderUse">去使用</button> <button wx:if="{{item.status === 2}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderUse">去使用</button>
<button wx:if="{{item.status === 2}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderEvaluate">去评价</button> <button wx:if="{{item.status === 3}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderEvaluate">去评价</button>
<button wx:if="{{item.status === 3}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderAgain">再次下单</button> <button wx:if="{{item.status === -1}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderAgain">再次下单</button>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -5,186 +5,23 @@ Page({ ...@@ -5,186 +5,23 @@ Page({
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase, resourcesBase: App.globalData.appResourcesBase,
orderType: 1, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影 shopInfo: {},
orderInfo: { orderType: 1, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
id: '', orderInfo: {},
no: '12345994500652',
price: '61.20',
time: '2020-09-30 12:00:00',
payTime: '2020-09-30 12:11:11',
score: 50,
commodity: [], // 购买商品列表
},
showNotice: false, winCode: false,
isFoodOrder: true,
orderBtnText: '去评价',
bottom: '0rpx',
swiperCurrent: 0,
showCodePopup: false,
statusTips: '',
ticketInfo: {
status: 2, // 0未使用 1待评价 2已过期 3已取消 4已评价 5待付款
ticketType: 's',
store: '拾光花坊插花分享会',
date: '8月24日 10:00 - 12:30',
// time: '10:00 - 12:30',
address: '拾光花坊2号厅',
name: '文碧海',
phone: '17612345222',
useNum:'1件商品可用',
useTime: '2019.09.30 - 2020.12.30',
sealImg: './image/seal2.png',
sealImg2: './image/seal2-1.png'
},
goodsInfo: {
titleImg: './image/goods_title.png',
title: '海错图展馆',
list: [
{
id: 0,
infoText: '拾光花坊国际花艺设计咖啡烘焙基础知识交流分享会',
img: './image/goods_item.png',
price: '30.60',
used: '查看券码'
},
{
id: 1,
infoText: '《海错图》展览单人门票',
img: './image/goods_item.png',
price: '30.60',
used: '已使用'
},
]
},
codeList: [
{
id: 0,
title: '《 阿凡达 》电影票',
img: './image/QRcode.png',
num: '2179 7092 0925'
},
{
id: 1,
title: '《 阿凡达 》电影票',
img: './image/QRcode.png',
num: '2179 7092 0925',
codeUsed: true
},
{
id: 2,
title: '《 阿凡达 》电影票',
img: './image/QRcode.png',
num: '2179 7092 0925'
}
]
}, },
onLoad: function (options) { onLoad: function (options) {
let funcOrderInfo = this.data.orderInfo let funcOrderInfo = this.data.orderInfo
funcOrderInfo.id = options.id funcOrderInfo.id = options.id
this.setData({ this.setData({
shopInfo: wx.getStorageSync('shopInfoBuffer'),
orderInfo: funcOrderInfo orderInfo: funcOrderInfo
}) })
this.queryOrderDetail() this.queryOrderDetail()
return
console.log(options)
if (options.type) options.type = Number(options.type)
let statusText = ''
let statusTips = ''
let ticketInfo = this.data.ticketInfo
let orderBtnText = this.data.orderBtnText
let bottom = ''
if (ticketInfo.ticketType === 'active') {
switch (options.type) {
case 0:
ticketInfo.status = 0
bottom = '-32rpx'
break
case 1:
ticketInfo.status = 1
statusText = '活动待评价',
statusTips = '评价本单获得10积分'
orderBtnText = '去评价'
break
case 2:
ticketInfo.status = 2
statusText = '活动已结束'
statusTips = '有效期2019.09.30 - 2020.12.30'
break
case 3:
ticketInfo.status = 3
statusText = '报名已取消'
statusTips = '报名后15分钟内未付款,自动取消报名'
orderBtnText = '再次报名'
break
case 4:
ticketInfo.status = 4
statusText = '活动已评价'
break
case 5:
ticketInfo.status = 5
statusText = '报名待付款'
statusTips = '请在14:59内付款,否则讲自动取消订单'
orderBtnText = '去支付'
break
}
} else {
console.log('food')
console.log(typeof options.type)
switch (options.type) {
case 0:
ticketInfo.status = 0
bottom = '-32rpx'
break
case 1:
ticketInfo.status = 1
statusText = '订单待评价',
orderBtnText = '去评价'
break
case 2:
console.log(2)
ticketInfo.status = 2
statusText = '订单已过期'
statusTips = '有效期2019.09.30 - 2020.12.30'
break
case 3:
ticketInfo.status = 3
statusText = '订单已取消'
statusTips = '下单后15分钟内未付款,自动取消订单'
orderBtnText = '再次下单'
break
case 4:
ticketInfo.status = 4
statusText = '订单已评价'
break
case 5:
ticketInfo.status = 5
statusText = '订单待付款'
statusTips = '请在14:59内付款,否则讲自动取消订单'
orderBtnText = '去支付'
break
}
}
this.setData({
statusText,
orderBtnText,
statusTips,
bottom,
ticketInfo
})
}, },
/** /**
...@@ -203,81 +40,55 @@ Page({ ...@@ -203,81 +40,55 @@ Page({
let funcResponse = response.data let funcResponse = response.data
let funcOrderInfo = { let funcOrderInfo = {
'id': this.data.orderInfo.id, 'id': this.data.orderInfo.id,
'logo': '',
'shopName': funcResponse.officeName, // 使用门店
'score': funcResponse.integral, // 积分 'score': funcResponse.integral, // 积分
'status': funcResponse.status, // 订单状态 'state': Number(funcResponse.status), // 订单状态
'amount': funcResponse.totalMoney, // 实付金额 'amount': funcResponse.totalMoney, // 实付金额
'contactName': funcResponse.name, // 联系人名称 'contactName': funcResponse.name, // 联系人名称
'contactPhone': funcResponse.mobilePhone, // 联系人电话 'contactPhone': funcResponse.mobilePhone, // 联系人电话
'commodityType': Number(funcResponse.goodType), // 商品类型
'commodity': [], 'commodity': [],
'tipOrderNo': funcResponse.orderSerialNumber, // 订单编号
'tipTimeSubmit': funcResponse.createDate,
'tipTimePay': App.modular.miment(funcResponse.paymentTime).format('YYYY-MM-DD hh:mm:ss'),
'tipIntegral': funcResponse.integral
} }
// 添加订单商品列表 // 添加订单商品列表
let funcCommodity = funcResponse.smOrderDetails let funcCommodity = funcResponse.smOrderDetails
for (let i = 0, l = funcCommodity.length; i < l; i++) { for (let i = 0, l = funcCommodity.length; i < l; i++) {
let funcCommodityItem = { let funcCommodityItem = {
'cover': '', 'cover': funcCommodity[i].imgUrl,
'name': funcCommodity[i].name, // 名称 'name': funcCommodity[i].name, // 名称
'quantity': funcCommodity[i].number, // 数量 'quantity': funcCommodity[i].number, // 数量
'amount': funcCommodity[i].totalPrices, // 总价 'amount': funcCommodity[i].totalPrices, // 总价
'status': funcCommodity[i].status, // 状态 'state': Number(funcCommodity[i].status), // 状态
'codeId': funcCommodity[i].volumeId, // 券码
} }
funcOrderInfo.commodity.push(funcCommodityItem) funcOrderInfo.commodity.push(funcCommodityItem)
} }
// 映射门店信息
for (let i = 0, l = App.globalData.shopId.length; i < l; i++) {
if (funcOrderInfo.name === App.globalData.shopId[i].name) {
funcOrderInfo.logo = App.globalData.shopId[i].logo
break
}
}
this.setData({ this.setData({
orderInfo: funcOrderInfo orderInfo: funcOrderInfo
}) })
console.log(JSON.stringify(funcOrderInfo)) console.log(JSON.stringify(funcOrderInfo))
console.log(this.data.shopInfo)
} }
}) })
}, },
handleQRcode() { onCouponCode: function (event) {
let showCodePopup = true let funcOrderInfo = event.currentTarget.dataset.item
this.setData({ App.wxRequest({
showCodePopup url: '/api/v1/volume/getVolume',
}) data: {
}, 'volumeId': funcOrderInfo.codeId
closeQRcode() { },
let showCodePopup = false success: (response) => {
this.setData({ let funcResponse = response.data
showCodePopup
})
},
handleNotice() {
let showNotice = true
this.setData({
showNotice
})
},
swiperChange(e) {
let swiperCurrent = e.detail.current
this.setData({
swiperCurrent
})
},
setClipboard(e) {
const index = e.currentTarget.dataset.index
const data = this.data.codeList[index].num
wx.setClipboardData({
data: data,
success (res) {
wx.getClipboardData({
success (res) {
console.log(res.data) // data
}
})
} }
}) })
} console.log(funcOrderInfo)
},
}) })
\ No newline at end of file
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
<view class="container"> <view class="container">
<!-- 订单状态 --> <!-- 订单状态 -->
<view class="state row con-c"> <view class="state row con-c">
<!-- <view class="state-content col con-c" wx:if="{{orderInfo.state === 0}}"> --> <view class="state-content col con-c" wx:if="{{orderInfo.state === 0}}">
<view class="state-content col con-c">
<view class="state-content-title row"> <view class="state-content-title row">
<text>订单待付款</text> <text>订单待付款</text>
</view> </view>
...@@ -47,7 +46,7 @@ ...@@ -47,7 +46,7 @@
<!-- 订单信息 --> <!-- 订单信息 -->
<view class="info"> <view class="info">
<!-- 年卡月卡 --> <!-- 年卡月卡 -->
<view class="info-content col con-c"> <view class="info-content col con-c" wx:if="{{orderInfo.commodityType === 1}}">
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label">使用门店</text> <text class="info-content-item-label">使用门店</text>
<text class="info-content-item-title">儿童营地</text> <text class="info-content-item-title">儿童营地</text>
...@@ -60,10 +59,10 @@ ...@@ -60,10 +59,10 @@
<!-- 普通商品 --> <!-- 普通商品 -->
<!-- 餐品 --> <!-- 餐品 -->
<view class="info-content col con-c"> <view class="info-content col con-c" wx:if="{{orderInfo.commodityType === 2}}">
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label">使用门店</text> <text class="info-content-item-label">使用门店</text>
<text class="info-content-item-title">儿童营地</text> <text class="info-content-item-title">{{orderInfo.shopName}}</text>
</view> </view>
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label"></text> <text class="info-content-item-label"></text>
...@@ -80,7 +79,7 @@ ...@@ -80,7 +79,7 @@
</view> </view>
<!-- 活动 --> <!-- 活动 -->
<view class="info-content col con-c"> <view class="info-content col con-c" wx:if="{{orderInfo.commodityType === -1}}">
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label">报名活动</text> <text class="info-content-item-label">报名活动</text>
<text class="info-content-item-title">儿童营地儿童营地儿童营地儿童营地儿童营地儿童营地</text> <text class="info-content-item-title">儿童营地儿童营地儿童营地儿童营地儿童营地儿童营地</text>
...@@ -104,7 +103,7 @@ ...@@ -104,7 +103,7 @@
</view> </view>
<!-- 观影 --> <!-- 观影 -->
<view class="info-content col con-c"> <view class="info-content col con-c" wx:if="{{orderInfo.commodityType === -2}}">
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label">电影</text> <text class="info-content-item-label">电影</text>
<text class="info-content-item-title">儿童营地</text> <text class="info-content-item-title">儿童营地</text>
...@@ -131,28 +130,45 @@ ...@@ -131,28 +130,45 @@
</view> </view>
<view class="commodity-list"> <view class="commodity-list">
<view class="commodity-shop-info row align-c"> <view class="commodity-shop-info row align-c">
<image></image> <image src="{{resourcesBase + 'commodity/' + shopInfo.logo}}"></image>
<text>商店名称</text> <text>{{shopInfo.name}}</text>
</view> </view>
<view class="commodity-item row align-c"> <block wx:for="{{orderInfo.commodity}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<image></image> <view class="commodity-item row align-c">
<view class="commodity-item-info col"> <image src="{{item.cover}}"></image>
<view> <view class="commodity-item-info col">
<text>儿童营地年卡</text> <view>
<text>{{item.name}}</text>
</view>
<view class="row">
<text>¥</text>
<text>{{item.amount}}</text>
</view>
</view> </view>
<view> <view class="commodity-item-operation">
<text>1680.00</text> <button class="row con-c align-c" data-item="{{item}}" bindtap="onCouponCode">查看券码</button>
</view> </view>
</view> </view>
<view class="commodity-item-operation"> </block>
<button class="row con-c align-c">查看券码</button>
</view>
</view>
</view> </view>
</view> </view>
<!-- 订单提示 --> <!-- 订单提示 -->
<view class="tip"> <view class="tip">
<view class="tip-pay row con-b align-c">
<view class="tip-pay-title">
<text>实付金额</text>
</view>
<view class="tip-pay-amount">
<text>¥</text>
<text>{{orderInfo.amount}}</text>
</view>
</view>
<view class="tip-describe col">
<text>{{'订单编号:' + orderInfo.tipOrderNo}}</text>
<text>{{'下单时间:' + orderInfo.tipTimeSubmit}}</text>
<text>{{'付款时间:' + orderInfo.tipTimePay}}</text>
<text>{{'获得积分:' + orderInfo.tipIntegral}}</text>
</view>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -36,6 +36,10 @@ ...@@ -36,6 +36,10 @@
} }
/* 订单信息 */ /* 订单信息 */
.info {
margin-top: 50rpx;
}
.info-content { .info-content {
width: 670rpx; width: 670rpx;
min-height: 206rpx; min-height: 206rpx;
...@@ -98,14 +102,14 @@ ...@@ -98,14 +102,14 @@
height: 48rpx; height: 48rpx;
font-size: 34rpx; font-size: 34rpx;
font-weight: 500; font-weight: 500;
line-height: 48px; line-height: 48rpx;
color: #15191F; color: #15191F;
} }
.commodity-list { .commodity-list {
width: 670rpx; width: 670rpx;
height: 676rpx; margin-top: 40rpx;
padding: 40rpx; padding: 40rpx 32rpx 0 32rpx;
border-radius: 4px; border-radius: 4px;
background: #F3F4F6; background: #F3F4F6;
} }
...@@ -132,10 +136,6 @@ ...@@ -132,10 +136,6 @@
.commodity-item-info { .commodity-item-info {
width: 290rpx; width: 290rpx;
}
.commodity-item-operation {
width: 290rpx;
margin-right: 32rpx; margin-right: 32rpx;
} }
...@@ -149,4 +149,51 @@ ...@@ -149,4 +149,51 @@
font-weight: 500; font-weight: 500;
line-height: 32rpx; line-height: 32rpx;
color: #FFFFFF; color: #FFFFFF;
}
.commodity-list .commodity-item:last-child {
border: none;
}
/* 订单提示 */
.tip {
margin: 74rpx 40rpx 70rpx 40rpx;
}
.tip-pay {
width: 670rpx;
}
.tip-pay-title text {
height: 48rpx;
font-size: 34rpx;
font-weight: 800;
line-height: 48rpx;
color: #15191F;
}
.tip-pay-amount text:nth-child(1) {
height: 58rpx;
font-size: 34rpx;
font-weight: 500;
line-height: 48rpx;
color: #5DB5DD;
}
.tip-pay-amount text:nth-child(2) {
height: 58rpx;
font-size: 42rpx;
font-weight: 500;
line-height: 48rpx;
color: #5DB5DD;
}
.tip-describe {
width: 670rpx;
height: 168rpx;
margin-top: 32rpx;
font-size: 22rpx;
font-weight: 400;
line-height: 42rpx;
color: #959DA9;
} }
\ No newline at end of file
...@@ -11,42 +11,6 @@ Page({ ...@@ -11,42 +11,6 @@ Page({
navigationLogoTop: 0, navigationLogoTop: 0,
navigationLogoMarginTop: 0, navigationLogoMarginTop: 0,
tabMarginTop: 0,
// banner: [],
// bannerIndex: 0,
tab: [
{
'text': '艺文',
'defaultImage': './image/literatue.png',
'activeImage': './image/literatue-s.png',
}, {
'text': '健康',
'defaultImage': './image/healthy.png',
'activeImage': './image/healthy-s.png',
}, {
'text': '美食',
'defaultImage': './image/food.png',
'activeImage': './image/food-s.png',
}, {
'text': '休闲',
'defaultImage': './image/relaxation.png',
'activeImage': './image/relaxation-s.png',
}, {
'text': '住宿',
'defaultImage': './image/hotel.png',
'activeImage': './image/hotel-s.png',
}
],
tabIndex: 0,
tabDetail: [],
navigationBackground: 'rgba(0, 0, 0, 0)',
navigationFixed: false,
navigationFixedBoundary: 212,
navigationCapsuleTop: wx.getMenuButtonBoundingClientRect().top,
recentList: [ recentList: [
{ {
...@@ -92,107 +56,37 @@ Page({ ...@@ -92,107 +56,37 @@ Page({
swiperMovieCurrent: 0 swiperMovieCurrent: 0
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) { onLoad: function (options) {
this.setData({
navigationFixedBoundary: 700 / 750 * wx.getSystemInfoSync().windowWidth
})
this.setNavigationLogo() this.setNavigationLogo()
this.queryDetail()
}, },
onShow: function () { onShow: function () {
this.getActivityList(1) this.getActivityList(1)
}, },
queryDetail: function () { /**
let response = [ * 设置标题高度
{ * @function
describe: [ * @param
App.globalData.appResourcesBase + 'play/detail/detail-1-1.png' * @returns
], */
shop: [{
id: 1,
name: '海错图展馆',
cover: App.globalData.appResourcesBase + 'play/detail/detail-1-2.png',
x: 108,
y: 212,
}, {
id: 2,
name: '拾光花坊',
cover: App.globalData.appResourcesBase + 'play/detail/detail-1-3.png',
x: 108,
y: 264,
}]
}, {
describe: [
App.globalData.appResourcesBase + 'play/detail/detail-2-1.png'
],
shop: [{
id: 3,
name: '水元养韵SPA',
cover: App.globalData.appResourcesBase + 'play/detail/detail-2-2.png',
x: 108,
y: 212,
}]
}, {
describe: [
App.globalData.appResourcesBase + 'play/detail/detail-3-1.png'
],
shop: [{
id: 4,
name: '原味舒食',
cover: App.globalData.appResourcesBase + 'play/detail/detail-3-2.png',
x: 108,
y: 212,
}, {
id: 5,
name: '原野MOJITO',
cover: App.globalData.appResourcesBase + 'play/detail/detail-3-3.png',
x: 108,
y: 212,
}]
}, {
describe: [
App.globalData.appResourcesBase + 'play/detail/detail-4-1.png'
],
shop: [{
id: 6,
name: '星空影院',
cover: App.globalData.appResourcesBase + 'play/detail/detail-4-2.png',
x: 108,
y: 212,
}]
}, {
describe: [
App.globalData.appResourcesBase + 'play/detail/detail-5-1.png'
],
shop: []
},
]
this.setData({
tabDetail: response
})
},
setNavigationLogo: function () { setNavigationLogo: function () {
let funcUnitProportion = wx.getStorageSync('unitProportion') let funcUnitProportion = wx.getStorageSync('unitProportion')
let funcLogoTop = App.modular.utils.navigationElementCenterMarginTop(50) let funcLogoTop = App.modular.utils.navigationElementCenterMarginTop(50)
let funcLogoMinorTop = funcLogoTop + 50 * funcUnitProportion + 20 * funcUnitProportion let funcLogoMinorTop = funcLogoTop + 50 * funcUnitProportion + 20 * funcUnitProportion
let funcTabMarginTop = funcLogoMinorTop + 20 * funcUnitProportion
this.setData({ this.setData({
navigationLogoTop: funcLogoTop, navigationLogoTop: funcLogoTop,
navigationLogoMarginTop: funcLogoMinorTop, navigationLogoMarginTop: funcLogoMinorTop,
tabMarginTop: funcTabMarginTop
}) })
}, },
/**
* 设置标题高度
* @function
* @param
* @returns
*/
onActivity: function () { onActivity: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/play/activity/activity' url: '/pages/play/activity/activity'
...@@ -206,68 +100,12 @@ Page({ ...@@ -206,68 +100,12 @@ Page({
}) })
}, },
onTabSelection: function (funcEvent) {
this.setData({
tabIndex: funcEvent.currentTarget.dataset.index
})
},
onPageScroll: function (funcEvent) {
// console.log(funcEvent)
// 优化滚动事件触发频率
// if (logicData.pageScrollLock) return
// logicData.pageScrollLock = true
this.setTab(funcEvent)
// 恢复滚动事件
// logicData.pageScrollTimer = setTimeout(function () {
// logicData.pageScrollLock = false
// clearTimeout(logicData.pageScrollTimer)
// }, 20)
},
setTab: function (funcEvent) {
// 判断标签吸顶边距
if (funcEvent.scrollTop - this.data.navigationFixedBoundary > -20 && !this.data.navigationFixed) {
this.setData({
navigationFixed: true
})
}
if (funcEvent.scrollTop - this.data.navigationFixedBoundary < -20 && this.data.navigationFixed) {
this.setData({
navigationFixed: false
})
}
if (funcEvent.scrollTop > 40 && this.data.navigationBackground !== 'rgba(255, 255, 255, 1)') {
this.setData({
navigationBackground: 'rgba(255, 255, 255, 1)'
})
}
if (funcEvent.scrollTop <= 40) {
this.setData({
navigationBackground: 'rgba(0, 0, 0, 0)'
})
}
},
onShopDetail: function (funcItem) { onShopDetail: function (funcItem) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/play/service-detail/service-detail?id=' + funcItem.currentTarget.dataset.id url: '/pages/play/service-detail/service-detail?id=' + funcItem.currentTarget.dataset.id
}) })
}, },
eventBannerChange: function (event) {
this.setData({
bannerIndex: event.detail.current
})
},
//主题活动列表 type 1 近期 0 往期 //主题活动列表 type 1 近期 0 往期
getActivityList(type) { getActivityList(type) {
var that = this var that = this
...@@ -313,23 +151,33 @@ Page({ ...@@ -313,23 +151,33 @@ Page({
//跳转到艺文 //跳转到艺文
onToArt: function () { onToArt: function () {
console.log('art') wx.navigateTo({
url: '/pages/play/service/service?type=0&title=文艺'
})
}, },
//跳转到健康 //跳转到健康
onToHealth: function () { onToHealth: function () {
console.log('Health') wx.navigateTo({
url: '/pages/play/service/service?type=1&title=健康'
})
}, },
//跳转到美食 //跳转到美食
onToFood: function () { onToFood: function () {
console.log('Food') wx.navigateTo({
url: '/pages/play/service/service?type=2&title=美食'
})
}, },
//跳转到休闲 //跳转到休闲
onToLeisure: function () { onToLeisure: function () {
console.log('Leisure') wx.navigateTo({
url: '/pages/play/service/service?type=3&title=休闲'
})
}, },
//跳转到住宿 //跳转到住宿
onToHotel: function () { onToHotel: function () {
console.log('Hotel') wx.navigateTo({
url: '/pages/play/service/service?type=4&title=住宿'
})
}, },
// 近期活动swiper // 近期活动swiper
...@@ -345,5 +193,14 @@ Page({ ...@@ -345,5 +193,14 @@ Page({
this.setData({ this.setData({
swiperMovieCurrent swiperMovieCurrent
}) })
} },
onAllRecent: function () {
wx.navigateTo({
url: '/pages/play/movie/movie'
})
},
}) })
\ No newline at end of file
<navigation class="navigation" background="{{navigationBackground}}"></navigation> <navigation class="navigation" background="#FFFFFF"></navigation>
<view class="container"> <view class="container">
<image class="logo" src="./image/title.png" style="{{'top: ' + navigationLogoTop + 'px'}}"></image> <image class="logo" src="./image/title.png" style="{{'top: ' + navigationLogoTop + 'px'}}"></image>
<view class="logo-minor row align-c" style="{{'top: ' + (navigationLogoMarginTop - 2) + 'px; background: ' + navigationBackground}}"> <view class="logo-minor row align-c" style="{{'top: ' + (navigationLogoMarginTop - 2) + 'px; background: #FFFFFF'}}">
<image src="./image/title-minor.png"></image> <image src="./image/title-minor.png"></image>
</view> </view>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<view class="title-wrapper row con-b align-c"> <view class="title-wrapper row con-b align-c">
<image class="title">近期活动</image> <image class="title">近期活动</image>
<image class="all" bindtap="onAllRecent">查看全部</image> <text bindtap="onAllRecent">查看全部</text>
</view> </view>
<swiper class="recent-swiper" next-margin="38rpx" bindchange="swiperRecentChange"> <swiper class="recent-swiper" next-margin="38rpx" bindchange="swiperRecentChange">
<block wx:for="{{recentList}}" wx:key="id"> <block wx:for="{{recentList}}" wx:key="id">
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<swiper class="movie-swiper" next-margin="38rpx" bindchange="swiperMovieChange"> <swiper class="movie-swiper" next-margin="38rpx" bindchange="swiperMovieChange">
<block wx:for="{{movieList}}" wx:key="id"> <block wx:for="{{movieList}}" wx:key="id">
<swiper-item class="movie-item col con-e"> <swiper-item class="movie-item col con-e">
<view class="movie-wrapper {{swiperMovieCurrent === index ? 'movie-item-left' : '' }} {{swiperMovieCurrent === movieList.length - 1 ? 'movie-item-center' : ''}}"> <view class="movie-wrapper {{swiperMovieCurrent === index ? 'movie-item-left' : '' }} {{swiperMovieCurrent === movieList.length - 1 ? 'movie-item-center' : ''}}">
<view class="movie-cover"> <view class="movie-cover">
<image src="{{item.img}}"></image> <image src="{{item.img}}"></image>
</view> </view>
...@@ -65,59 +65,8 @@ ...@@ -65,59 +65,8 @@
<text>报名观影</text> <text>报名观影</text>
</view> </view>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
<!-- <view class="banner">
<swiper autoplay circular interval="2000" next-margin="64rpx" bindchange="eventBannerChange">
<block wx:for="{{banner}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<swiper-item>
<image src="{{item.cover}}" class="{{bannerIndex !== index ? 'banner-content': 'banner-content-active'}}" data-id="{{item.id}}" bindtap="onActivityDetail"/>
</swiper-item>
</block>
</swiper>
</view> -->
<!-- 更多活动 -->
<!-- <view class="activity row con-e align-c" bindtap="onActivity">
<text>查看全部活动</text>
<image src="/image/more.png"></image>
</view> -->
<!-- <view class="ornament-wave">
<image src="/image/ornament-1.png"></image>
</view> -->
<!-- 板块标签 -->
<!-- <view class="tab row con-b align-c {{navigationFixed ? 'tab-fixed' : ''}}" style="{{navigationFixed ? 'top: ' + (tabMarginTop - 4) + 'px' : ''}}">
<block wx:for="{{tab}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="tab-item col con-c" data-index="{{index}}" bindtap="onTabSelection">
<view class="row con-c align-c {{tabIndex === index ? 'tab-item-active' : 'tab-item-inactive'}}">
<image src="{{tabIndex === index ? item.activeImage : item.defaultImage}}"></image>
</view>
<view class="row con-c align-c {{tabIndex === index ? 'tab-item-text-active' : 'tab-item-text-inactive'}}">
<text>{{item.text}}</text>
</view>
</view>
</block>
</view>
<view class="tab-blank" hidden="{{!navigationFixed}}"></view> -->
<!-- <view class="detail">
<block wx:for="{{tabDetail[tabIndex].describe}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<image mode="widthFix" src="{{item}}"></image>
</block>
</view> -->
<!-- <view class="shop">
<block wx:for="{{tabDetail[tabIndex].shop}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="shop-item">
<image src="{{item.cover}}"></image>
<button class="button row con-c align-c" style="{{'bottom: ' + item.y + 'rpx;left: ' + item.x + 'rpx;'}}" data-id="{{item.id}}" bindtap="onShopDetail">立即预定</button>
</view>
</block>
</view> -->
</view> </view>
\ No newline at end of file
let App = getApp()
Page({ Page({
data: { data: {
navTitle: '',
tabIndex: 0,
tabDetail: [],
}, },
onLoad: function (options) { onLoad: function (options) {
this.setData({
navTitle: options.title,
tabIndex: options.type,
})
this.queryDetail()
},
queryDetail: function () {
let response = [
{
describe: [
App.globalData.appResourcesBase + 'play/detail/detail-1-1.png'
],
shop: [{
appId: 1,
name: '海错图展馆',
cover: App.globalData.appResourcesBase + 'play/detail/detail-1-2.png',
x: 108,
y: 212,
}, {
appId: 5,
name: '拾光花坊',
cover: App.globalData.appResourcesBase + 'play/detail/detail-1-3.png',
x: 108,
y: 264,
}]
}, {
describe: [
App.globalData.appResourcesBase + 'play/detail/detail-2-1.png'
],
shop: [{
appId: 7,
name: '水元养韵SPA',
cover: App.globalData.appResourcesBase + 'play/detail/detail-2-2.png',
x: 108,
y: 212,
}]
}, {
describe: [
App.globalData.appResourcesBase + 'play/detail/detail-3-1.png'
],
shop: [{
appId: 6,
name: '原味舒食',
cover: App.globalData.appResourcesBase + 'play/detail/detail-3-2.png',
x: 108,
y: 212,
}, {
appId: 4,
name: '原野MOJITO',
cover: App.globalData.appResourcesBase + 'play/detail/detail-3-3.png',
x: 108,
y: 212,
}]
}, {
describe: [
App.globalData.appResourcesBase + 'play/detail/detail-4-1.png'
],
shop: [{
appId: 2,
name: '星空影院',
cover: App.globalData.appResourcesBase + 'play/detail/detail-4-2.png',
x: 108,
y: 212,
}]
}, {
describe: [
App.globalData.appResourcesBase + 'play/detail/detail-5-1.png'
],
shop: []
},
]
this.setData({
tabDetail: response
})
},
onShopDetail: function (funcItem) {
let funcShopAppId = funcItem.currentTarget.dataset.id
console.log('funcShopAppId', funcShopAppId)
wx.navigateTo({
url: '/pages/play/service-detail/service-detail?id=' + funcShopAppId
})
}, },
}) })
\ No newline at end of file
<!--pages/home/home/home.wxml--> <navigation class="navigation" titleText="{{navTitle}}" background="#FFFFFF" backIcon="/image/icon/arrow-l-1.png"></navigation>
<text>pages/home/home/home.wxml</text>
<view class="container">
<view class="detail">
<block wx:for="{{tabDetail[tabIndex].describe}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<image mode="widthFix" src="{{item}}"></image>
</block>
</view>
<view class="shop">
<block wx:for="{{tabDetail[tabIndex].shop}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="shop-item">
<image src="{{item.cover}}"></image>
<button
class="button row con-c align-c"
style="{{'bottom: ' + item.y + 'rpx;left: ' + item.x + 'rpx;'}}"
data-id="{{item.appId}}"
bindtap="onShopDetail"
>
<text>立即预定</text>
</button>
</view>
</block>
</view>
</view>
\ No newline at end of file
/* pages/home/home/home.wxss */ page {
\ No newline at end of file background: linear-gradient(182deg,#FFFFFF 0%,#EBEDF7 100%);
}
.navigation {
z-index: 1900;
}
.container {
margin-top: 60rpx;
}
/* 详情 */
.detail {
width: 750rpx;
min-height: 500rpx;
background: #fefefe;
}
.detail image {
display: block;
width: 100%;
height: 100%;
}
/* 商店详情 */
.shop-item {
position: relative;
width: 750rpx;
height: 1152rpx;
background: #f3f6fc;
}
.shop-item image {
display: block;
width: 750rpx;
height: 1152rpx;
font-size: 0;
}
.shop-item .button {
position: absolute;
width: 534rpx;
height: 96rpx;
background: #86C5E1;
border-radius: 2px;
overflow: hidden;
font-size: 30rpx;
font-weight: 500;
color: #ffffff;
line-height: 42rpx;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment