Commit d7a67b44 by 严立

LL - 组件更新

parent 1f1dc1ea
Showing with 502 additions and 2278 deletions
...@@ -16,7 +16,6 @@ App({ ...@@ -16,7 +16,6 @@ App({
globalData: { globalData: {
appStatus: false, appStatus: false,
test:'999',
appImageBase: '../../../image/', appImageBase: '../../../image/',
appResourcesBase: 'https://sm-web.meiqicloud.com/userfiles/appResourcesS2/', appResourcesBase: 'https://sm-web.meiqicloud.com/userfiles/appResourcesS2/',
shopId: iEnvironmental.shopId, shopId: iEnvironmental.shopId,
...@@ -426,5 +425,7 @@ App({ ...@@ -426,5 +425,7 @@ App({
funcPage.setData({ funcPage.setData({
navScroll: funcEvent.scrollTop navScroll: funcEvent.scrollTop
}) })
if (funcPage.eventPageScroll) funcPage.eventPageScroll(funcEvent)
}, },
}) })
\ No newline at end of file
...@@ -24,9 +24,7 @@ ...@@ -24,9 +24,7 @@
"pages/commodity/shopping-cart/shopping-cart", "pages/commodity/shopping-cart/shopping-cart",
"pages/commodity/project/project", "pages/commodity/project/project",
"pages/commodity/project-detail/project-detail", "pages/commodity/project-detail/project-detail",
"pages/commodity/menu-art/menu-art",
"pages/commodity/menu-food/menu-food", "pages/commodity/menu-food/menu-food",
"pages/commodity/menu-snacks/menu-snacks",
"pages/commodity/room/room", "pages/commodity/room/room",
"pages/commodity/room-appointment/room-appointment", "pages/commodity/room-appointment/room-appointment",
......
...@@ -16,8 +16,8 @@ Component({ ...@@ -16,8 +16,8 @@ Component({
content: '这里是提示信息', content: '这里是提示信息',
cancel: '取消', cancel: '取消',
confirm: '确定', confirm: '确定',
success: function () {}, success: function () { },
fail: function () {}, fail: function () { },
winDialog: false, winDialog: false,
}, },
......
...@@ -14,6 +14,7 @@ function showToast (funcOption) { ...@@ -14,6 +14,7 @@ function showToast (funcOption) {
// 如果传参包含 duration 数值,使用该数值。 // 如果传参包含 duration 数值,使用该数值。
// 删除该属性是为了不污染 toast 组件中的默认值。 // 删除该属性是为了不污染 toast 组件中的默认值。
console.log(App.ui.toast.data)
let funcToastDuration = App.ui.toast.data.duration let funcToastDuration = App.ui.toast.data.duration
if (funcOption.duration) { if (funcOption.duration) {
funcToastDuration = funcOption.duration funcToastDuration = funcOption.duration
...@@ -22,12 +23,11 @@ function showToast (funcOption) { ...@@ -22,12 +23,11 @@ function showToast (funcOption) {
funcOption = Object.assign(App.ui.toast.data, funcOption) funcOption = Object.assign(App.ui.toast.data, funcOption)
funcOption.winToast = true funcOption.winToast = true
console.log('showToast', funcOption)
App.ui.toast.setData(funcOption) App.ui.toast.setData(funcOption)
// 设置 toast 关闭时间 // 设置 toast 关闭时间
App.ui.toastTimer = setTimeout(() => { App.ui.toastTimer = setTimeout(() => {
App.ui.toast.data.ending()
App.ui.hideToast() App.ui.hideToast()
}, funcToastDuration) }, funcToastDuration)
} }
...@@ -44,6 +44,7 @@ function hideToast () { ...@@ -44,6 +44,7 @@ function hideToast () {
iconType: '', iconType: '',
title: '', title: '',
background: 'rgba(0, 0, 0, 0)', background: 'rgba(0, 0, 0, 0)',
ending: function () {},
winIcon: true, winIcon: true,
winTitle: true, winTitle: true,
winToast: false, winToast: false,
......
...@@ -289,6 +289,7 @@ Component({ ...@@ -289,6 +289,7 @@ Component({
let funcPageLength = getCurrentPages().length let funcPageLength = getCurrentPages().length
if (funcPageLength > 1) wx.navigateBack({ delta: 1 }) if (funcPageLength > 1) wx.navigateBack({ delta: 1 })
this.triggerEvent('navBack', { back: 1 }) this.triggerEvent('navBack', { back: 1 })
console.log('onBack')
}, },
/** /**
......
// 增加新的标题样式请在数组末尾添加,避免影响其他页面显示。 // 增加新的标题样式请在数组末尾添加,避免影响其他页面显示。
let styleOption = [ let styleOption = [
{ {
// 黑字 - 透明背景 转换 黑字 - 白色背景 // 0 - 黑字 - 透明背景 转换 黑字 - 白色背景
'normal': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 0);', iconBack: './image/back-1.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } }, 'normal': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 0);', iconBack: './image/back-1.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } },
'scroll': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: './image/back-1.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } } 'scroll': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: './image/back-1.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } }
}, { }, {
// 黑字 - 白色背景 固定 // 1 - 黑字 - 白色背景 固定
'normal': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: './image/back-1.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } }, 'normal': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: './image/back-1.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } },
'scroll': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: './image/back-1.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } } 'scroll': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: './image/back-1.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } }
}, { }, {
// 白字 - 透明背景 转换 黑字 - 白色背景 // 2 - 白字 - 透明背景 转换 黑字 - 白色背景
'normal': { titleColor: '#FFFFFF;', bgColor: 'rgba(255, 255, 255, 0);', iconBack: './image/back-3.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } }, 'normal': { titleColor: '#FFFFFF;', bgColor: 'rgba(255, 255, 255, 0);', iconBack: './image/back-3.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } },
'scroll': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: './image/back-1.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } } 'scroll': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: './image/back-1.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } }
}, { }, {
// 白字 - 透明背景 固定 // 3 - 白字 - 透明背景 固定
'normal': { titleColor: '#FFFFFF;', bgColor: 'rgba(255, 255, 255, 0);', iconBack: './image/back-3.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } }, 'normal': { titleColor: '#FFFFFF;', bgColor: 'rgba(255, 255, 255, 0);', iconBack: './image/back-3.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } },
'scroll': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 0);', iconBack: './image/back-3.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } } 'scroll': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 0);', iconBack: './image/back-3.png', iconHome: '', logo: '', logoSize: { width: '', height: '' } }
}, { }, {
// pages/home/home/home // 4 - pages/home/home/home
'normal': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 0);', iconBack: '', iconHome: '', logo: './image/1-1.png', logoSize: { width: '200rpx', height: '60rpx' } }, 'normal': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 0);', iconBack: '', iconHome: '', logo: './image/1-1.png', logoSize: { width: '200rpx', height: '60rpx' } },
'scroll': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: '', iconHome: '', logo: './image/1-2.png', logoSize: { width: '200rpx', height: '60rpx' } }, 'scroll': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: '', iconHome: '', logo: './image/1-2.png', logoSize: { width: '200rpx', height: '60rpx' } },
}, { }, {
// pages/play/home/home // 5 - pages/play/home/home
'normal': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: '', iconHome: '', logo: './image/2-1.png', logoSize: { width: '130rpx', height: '126rpx' } }, 'normal': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: '', iconHome: '', logo: './image/2-1.png', logoSize: { width: '130rpx', height: '126rpx' } },
'scroll': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: '', iconHome: '', logo: './image/2-1.png', logoSize: { width: '130rpx', height: '126rpx' } }, 'scroll': { titleColor: '#000000;', bgColor: 'rgba(255, 255, 255, 1);', iconBack: '', iconHome: '', logo: './image/2-1.png', logoSize: { width: '130rpx', height: '126rpx' } },
}, { }, {
// 白字 - 透明背景 转换 白字 - 藏青背景 - 1 // 6 - 白字 - 透明背景 转换 白字 - 藏青背景
'normal': { titleColor: '#FFFFFF;', bgColor: 'rgba(39, 39, 52, 0);', iconBack: './image/back-3.png', iconHome: '', logo: '', logo: '', logoSize: { width: '', height: '' } }, 'normal': { titleColor: '#FFFFFF;', bgColor: 'rgba(39, 39, 52, 0);', iconBack: './image/back-3.png', iconHome: '', logo: '', logo: '', logoSize: { width: '', height: '' } },
'scroll': { titleColor: '#FFFFFF;', bgColor: 'rgba(39, 39, 52, 1);', iconBack: './image/back-3.png', iconHome: '', logo: '', logo: '', logoSize: { width: '', height: '' } }, 'scroll': { titleColor: '#FFFFFF;', bgColor: 'rgba(39, 39, 52, 1);', iconBack: './image/back-3.png', iconHome: '', logo: '', logo: '', logoSize: { width: '', height: '' } },
}, { }, {
// 白字 - 藏青背景 固定 // 7 - 白字 - 藏青背景 固定
'normal': { titleColor: '#FFFFFF;', bgColor: 'rgba(28, 28, 37, 1);', iconBack: './image/back-3.png', iconHome: '', logo: '', logo: '', logoSize: { width: '', height: '' } }, 'normal': { titleColor: '#FFFFFF;', bgColor: 'rgba(28, 28, 37, 1);', iconBack: './image/back-3.png', iconHome: '', logo: '', logo: '', logoSize: { width: '', height: '' } },
'scroll': { titleColor: '#FFFFFF;', bgColor: 'rgba(28, 28, 37, 1);', iconBack: './image/back-3.png', iconHome: '', logo: '', logo: '', logoSize: { width: '', height: '' } }, 'scroll': { titleColor: '#FFFFFF;', bgColor: 'rgba(28, 28, 37, 1);', iconBack: './image/back-3.png', iconHome: '', logo: '', logo: '', logoSize: { width: '', height: '' } },
}, { }, {
// 白字 - 透明背景 转换 白字 - 藏青背景 - 2 // 8 - 白字 - 透明背景 转换 白字 - 藏青背景
'normal': { titleColor: '#FFFFFF;', bgColor: 'rgba(28, 28, 37, 0);', iconBack: './image/back-3.png', iconHome: '', logo: '', logo: '', logoSize: { width: '', height: '' } }, 'normal': { titleColor: '#FFFFFF;', bgColor: 'rgba(28, 28, 37, 0);', iconBack: './image/back-3.png', iconHome: '', logo: '', logo: '', logoSize: { width: '', height: '' } },
'scroll': { titleColor: '#FFFFFF;', bgColor: 'rgba(28, 28, 37, 1);', iconBack: './image/back-3.png', iconHome: '', logo: '', logo: '', logoSize: { width: '', height: '' } }, 'scroll': { titleColor: '#FFFFFF;', bgColor: 'rgba(28, 28, 37, 1);', iconBack: './image/back-3.png', iconHome: '', logo: '', logo: '', logoSize: { width: '', height: '' } },
}, {
// 9 - pages/campsite/home/home
'normal': { titleColor: '#f6dada;', bgColor: 'rgba(246, 218, 218, 0);', iconBack: '', iconHome: '', logo: '', logoSize: { width: '', height: '' } },
'scroll': { titleColor: '#000000;', bgColor: 'rgba(246, 218, 218, 1);', iconBack: '', iconHome: '', logo: '', logoSize: { width: '', height: '' } }
}, },
] ]
......
...@@ -15,6 +15,7 @@ Component({ ...@@ -15,6 +15,7 @@ Component({
title: '', // 提示文本 title: '', // 提示文本
duration: 3000, // 提示的延迟时间 duration: 3000, // 提示的延迟时间
background: 'rgba(0, 0, 0, 0)', background: 'rgba(0, 0, 0, 0)',
ending: function () { },
winIcon: true, winIcon: true,
winTitle: true, winTitle: true,
winToast: false, winToast: false,
......
let App = getApp() let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({ Page({
data: { data: {
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
...@@ -129,14 +124,21 @@ Page({ ...@@ -129,14 +124,21 @@ Page({
* @returns * @returns
*/ */
onPageScroll: function (funcEvent) { onPageScroll: function (funcEvent) {
// 优化滚动事件触发频率 App.pageScroll(funcEvent, this)
if (logicData.pageScrollLock) return },
logicData.pageScrollLock = true
/**
* 页面滚动事件回调,是经过滚动优化的。
* 对于刷新频率低的滚动计算的代码可以写在此处。
* @function
* @param {object} - funcEvent
* @returns
*/
eventPageScroll: function (funcEvent) {
if (funcEvent.scrollTop >= this.data.sideHeight) { if (funcEvent.scrollTop >= this.data.sideHeight) {
if (this.data.winSide) { if (this.data.winSide) {
this.setData({ this.setData({
winSide: false, winSide: false
}) })
} }
...@@ -152,16 +154,8 @@ Page({ ...@@ -152,16 +154,8 @@ Page({
navigationAnimationShow: 0 navigationAnimationShow: 0
}) })
} }
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 40)
}, },
/** /**
* 缓存用户信息 * 缓存用户信息
* @function * @function
...@@ -247,19 +241,31 @@ Page({ ...@@ -247,19 +241,31 @@ Page({
wx.saveImageToPhotosAlbum({ wx.saveImageToPhotosAlbum({
filePath: result.tempFilePath, filePath: result.tempFilePath,
success: (result) => { success: (result) => {
App.ui.showToast({
'iconType': 'success',
'title': '图片已保存'
})
this.setData({ this.setData({
showPopup: false, showPopup: false,
winToastSuccess: true })
wx.showTabBar({
animation: true,
}) })
}, },
fail: (error) => { fail: (error) => {
this.setData({ App.ui.showToast({
winToastFail: true 'iconType': 'error',
'title': '图片保存失败'
}) })
} }
}) })
}, },
fail: (error) => { fail: (error) => {
App.ui.showToast({
'iconType': 'error',
'title': '图片保存失败'
})
this.setData({ this.setData({
winToastFail: true winToastFail: true
}) })
......
<!-- 此页面是为了让其他页面进行跳转的镜像页面 --> <!-- 此页面是为了让其他页面进行跳转的镜像页面 -->
<!-- 如果直接跳转 tabbar 的营地页面会导致路由错乱问题 --> <!-- 如果直接跳转 tabbar 的营地页面会导致路由错乱问题 -->
<navigation class="navigation" titleText="儿童营地" backIcon="/image/back.png" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation> <m-toast></m-toast>
<m-nav titleText="营地" scrollHeight="{{navScroll}}" styleIndex="{{9}}" isOccupy="{{false}}"></m-nav>
<view class="container"> <view class="container">
<!-- <view class="appointment"> <!-- <view class="appointment">
<l-button l-class="appointment-button" bind:lintap="onServic">电话预约</l-button> <l-button l-class="appointment-button" bind:lintap="onServic">电话预约</l-button>
...@@ -33,24 +35,6 @@ ...@@ -33,24 +35,6 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 下载图片反馈 -->
<l-toast
l-class="toast"
l-image-class="toast-icon"
show="{{winToastSuccess}}"
image="../../../image/icon/success-3.png"
title="图片已保存"
duration="3000"
></l-toast>
<!-- 下载图片反馈 -->
<l-toast
l-class="toast"
l-image-class="toast-icon"
show="{{winToastFail}}"
image="../../../image/icon/war-3.png"
title="图片保存失败"
duration="3000"
></l-toast>
<!-- 位置按钮 --> <!-- 位置按钮 -->
<view class="location col con-c align-c" bindtap="onLocation"> <view class="location col con-c align-c" bindtap="onLocation">
<image class="icon-location" src="/image/icon/location-3.png"></image> <image class="icon-location" src="/image/icon/location-3.png"></image>
......
let App = getApp() let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({ Page({
data: { data: {
appStatus: App.globalData.appStatus, appStatus: App.globalData.appStatus,
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
appResourcesBase: App.globalData.appResourcesBase, appResourcesBase: App.globalData.appResourcesBase,
// 导航栏相关属性
navigationStyle: {
normal: {
backIcon: '',
color: 'rgba(255, 255, 255, 0)',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '',
color: '#000000',
background: 'rgba(246, 218, 218, 1)'
},
scroll: '200rpx',
},
navigationScroll: 0,
showPopup: false, showPopup: false,
winSide: true, winSide: true,
sideHeight: 1250, sideHeight: 1250,
...@@ -133,10 +112,17 @@ Page({ ...@@ -133,10 +112,17 @@ Page({
* @returns * @returns
*/ */
onPageScroll: function (funcEvent) { onPageScroll: function (funcEvent) {
// 优化滚动事件触发频率 App.pageScroll(funcEvent, this)
if (logicData.pageScrollLock) return },
logicData.pageScrollLock = true
/**
* 页面滚动事件回调,是经过滚动优化的。
* 对于刷新频率低的滚动计算的代码可以写在此处。
* @function
* @param {object} - funcEvent
* @returns
*/
eventPageScroll: function (funcEvent) {
if (funcEvent.scrollTop >= this.data.sideHeight) { if (funcEvent.scrollTop >= this.data.sideHeight) {
if (this.data.winSide) { if (this.data.winSide) {
this.setData({ this.setData({
...@@ -156,17 +142,8 @@ Page({ ...@@ -156,17 +142,8 @@ Page({
navigationAnimationShow: 0 navigationAnimationShow: 0
}) })
} }
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 40)
}, },
/** /**
* 缓存用户信息 * 缓存用户信息
* @function * @function
...@@ -258,24 +235,30 @@ Page({ ...@@ -258,24 +235,30 @@ Page({
wx.saveImageToPhotosAlbum({ wx.saveImageToPhotosAlbum({
filePath: result.tempFilePath, filePath: result.tempFilePath,
success: (result) => { success: (result) => {
App.ui.showToast({
'iconType': 'success',
'title': '图片已保存'
})
this.setData({ this.setData({
showPopup: false, showPopup: false,
winToastSuccess: true
}) })
wx.showTabBar({ wx.showTabBar({
animation: true, animation: true,
}) })
}, },
fail: (error) => { fail: (error) => {
this.setData({ App.ui.showToast({
winToastFail: true 'iconType': 'error',
'title': '图片保存失败'
}) })
} }
}) })
}, },
fail: (error) => { fail: (error) => {
this.setData({ App.ui.showToast({
winToastFail: true 'iconType': 'error',
'title': '图片保存失败'
}) })
wx.showTabBar({ wx.showTabBar({
animation: true, animation: true,
......
<navigation class="navigation" titleText="营地" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation> <m-toast></m-toast>
<m-nav titleText="营地" scrollHeight="{{navScroll}}" styleIndex="{{9}}" isOccupy="{{false}}"></m-nav>
<view class="container"> <view class="container">
<!-- <view class="appointment"> <!-- <view class="appointment">
<l-button l-class="appointment-button" bind:lintap="onServic">电话预约</l-button> <l-button l-class="appointment-button" bind:lintap="onServic">电话预约</l-button>
...@@ -32,24 +32,6 @@ ...@@ -32,24 +32,6 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 下载图片反馈 -->
<l-toast
l-class="toast"
l-image-class="toast-icon"
show="{{winToastSuccess}}"
image="../../../image/icon/success-3.png"
title="图片已保存"
duration="3000"
></l-toast>
<!-- 下载图片反馈 -->
<l-toast
l-class="toast"
l-image-class="toast-icon"
show="{{winToastFail}}"
image="../../../image/icon/war-3.png"
title="图片保存失败"
duration="3000"
></l-toast>
<!-- 位置按钮 --> <!-- 位置按钮 -->
<view class="location col con-c align-c" bindtap="onLocation"> <view class="location col con-c align-c" bindtap="onLocation">
<image class="icon-location" src="/image/icon/location-3.png"></image> <image class="icon-location" src="/image/icon/location-3.png"></image>
......
{
"usingComponents": {}
}
\ No newline at end of file
<l-toast
l-image-class="toast-image"
l-class="toast-bg"
show="{{winToast}}"
image="/image/success.png"
title="添加购物车成功"
duration="400"
></l-toast>
<l-toast show="{{winToastNothing}}" icon="error" title="没有更多商品了" duration="400"></l-toast>
<l-toast
show="{{winLoading}}"
icon="loading"
title="加载中"
duration="20000"
mask="{{true}}"
></l-toast>
<navigation class="navigation" titleText="{{shopInfo.name}}" background="#FFFFFF;" backIcon="/image/back.png"></navigation>
<view class="row">
<!-- 侧边菜单 -->
<view class="side-bar">
<block wx:for="{{sideBar}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="menu-item {{currentIndex === index ? 'active' : ''}}" data-index="{{index}}" bindtap="onSelectionSideBar">
<text>{{item.tab}}</text>
</view>
</block>
</view>
<!-- 商品列表 -->
<view class="menu-list">
<view class="right-content-title">{{menuTitle}}</view>
<block wx:for="{{commodityList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="commodity-item row" data-item="{{item}}" bind:tap="onCommodityDetail">
<view class="item-img">
<image src="{{item.cover}}" mode="widthFix"></image>
</view>
<view class="item-info">
<view class="item-info-title">{{item.name}}</view>
<view class="item-info-text-wrap">
<view wx:if="{{item.describe}}">{{item.describe}}</view>
<view wx:else class="item-info-content"></view>
</view>
<view class="item-other row con-b">
<!-- 活动价样式 -->
<view wx:if="{{item.priceType === 1}}">
<view class="item-price row align-c">
<text>¥</text>
<text>{{item.priceDiscountText}}</text>
<text class="item-price-discount">活动价</text>
</view>
<view class="item-info-old-price row align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
</view>
</view>
<!-- 业主价样式 -->
<view wx:if="{{item.priceType === 2}}">
<view class="item-price row align-c">
<text>¥</text>
<text>{{item.priceSpecialText}}</text>
<text class="item-price-special">业主价</text>
</view>
<view class="item-info-old-price row align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
</view>
</view>
<!-- 普通价样式 -->
<view wx:if="{{item.priceType === 3}}">
<view class="item-price row align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
<text></text>
</view>
</view>
<view class="item-operation-add">
<button class="row con-c align-c" data-item="{{item}}" catchtap="onCommodityAdd">
<image mode="widthFix" src="{{imageBase + 'icon/cart-3.png'}}"></image>
</button>
</view>
</view>
</view>
</view>
</block>
<!-- 购物车按钮 -->
<view id="cart" class="cart row con-c align-c" bindtap="onShoppingCart">
<!-- 添加动画圆点 -->
<!-- <view class="cart-animation" wx:if="{{winAnimationPoint}}" animation="{{animationData}}"></view> -->
<view class="cart-num row con-c align-c">{{shoppingCartTotal}}</view>
<view class="cart-img-wrap">
<image src="../../../image/cart.png" mode="widthFix"></image>
</view>
</view>
</view>
</view>
<!-- 商品详情弹窗 -->
<l-popup show="{{winCommodityDetail}}" content-align="center" locked="{{true}}">
<view class="popup-wrap">
<view id="banner" class="banner">
<swiper autoplay circular class="banner-swiper" interval="5000" duration="500">
<block wx:for="{{commodityDetail.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>
</swiper-item>
</block>
</swiper>
<view class="banner-wave">
<image src="/image/ornament-1.png" mode="widthFix"></image>
</view>
</view>
<view class="popup-info-wrapper">
<view class="popuo-info-title">{{commodityDetail.name}}</view>
<view class="popup-info-text">{{commodityDetail.describeDetail}}</view>
</view>
<view class="popup-footer-wrapper">
<!-- 活动价样式 -->
<view class="popup-price-row row align-c" wx:if="{{commodityDetail.priceType === 1}}">
<view class="detail-price-discount row con-c align-c">
<text>活动价</text>
</view>
<view class="detail-price">
<text>¥</text>
<text>{{commodityDetail.priceDiscountText}}</text>
</view>
<view class="popup-price-old">
<text>¥</text>
<text>{{commodityDetail.priceText}}</text>
</view>
</view>
<!-- 业主价样式 -->
<view class="popup-price-row row align-c" wx:if="{{commodityDetail.priceType === 2}}">
<view class="detail-price-special row con-c align-c">
<text>业主价</text>
</view>
<view class="detail-price">
<text>¥</text>
<text>{{commodityDetail.priceSpecialText}}</text>
</view>
<view class="popup-price-old">
<text>¥</text>
<text>{{commodityDetail.priceText}}</text>
</view>
</view>
<!-- 普通价样式 -->
<view class="popup-price-row row align-c" wx:if="{{commodityDetail.priceType === 3}}">
<view class="popup-price-special row con-c align-c">
<text></text>
</view>
<view class="detail-price">
<text>¥</text>
<text>{{commodityDetail.priceText}}</text>
</view>
</view>
<view class="popup-footer-btn row con-c align-c" bindtap="onCommodityAdd">加入购物车</view>
</view>
</view>
<view class="popup-close-btn row con-c align-c" bindtap="onCommodityClose">
<view class="popup-close">
<image mode="widthFix" src="../../../image/icon_close.png"></image>
</view>
</view>
</l-popup>
\ No newline at end of file
page {
overflow: hidden;
}
.navigation {
z-index: 1100;
position: fixed;
top: 0;
left: 0;
width: 750rpx;
}
.side-bar {
width: 160rpx;
height: 100vh;
padding-top: 126rpx;
overflow-y: scroll;
background: #f2f3f5;
}
.side-bar::-webkit-scrollbar {
width: 0;
}
.menu-item {
height: 136rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 26rpx;
color: #656e7b;
}
.menu-item.active {
color: #5cb5dd;
font-weight: 600;
background: #fff;
border-left: 8rpx solid #86c5e1;
}
.menu-list {
width: 590rpx;
height: 100vh;
margin-top: 140rpx;
padding: 0 32rpx 200rpx 32rpx;
overflow-y: scroll;
background: #FFFFFF;
}
.right-content::-webkit-scrollbar {
width: 0;
}
.right-content-title {
height: 100rpx;
padding: 32rpx 0;
font-size: 26rpx;
color: #959da9;
}
.cart {
position: fixed;
right: 48rpx;
bottom: 160rpx;
width: 104rpx;
height: 104rpx;
border-radius: 50%;
background-color: #86c5e1;
}
.cart-num {
position: absolute;
top: 0;
right: 0;
height: 32rpx;
padding: 0 12rpx;
font-size: 22rpx;
line-height: 32rpx;
border: 1px solid #86c5e1;
border-radius: 17rpx;
color: #86c5e1;
background-color: #fff;
}
.cart-img-wrap {
width: 48rpx;
height: 48rpx;
}
.commodity-item {
width: 100%;
min-height: 250rpx;
padding-bottom: 56rpx;
box-sizing: border-box;
}
.item-img {
width: 160rpx;
height: 160rpx;
}
.item-info {
flex: 1;
margin-left: 28rpx;
}
.item-info-title {
font-size: 30rpx;
font-weight: 500;
line-height: 42rpx;
color: #15191F;
}
.item-info-text-wrap {
display: -webkit-box;
width: 342rpx;
height: 64rpx;
margin-top: 16rpx;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
font-size: 22rpx;
font-weight: 400;
line-height: 32rpx;
color: #959DA9;
}
.item-info-content {
height: 40rpx;
}
.item-other {
margin-top: 24rpx;
}
.item-operation {
margin-top: 24rpx;
font-size: 30rpx;
font-weight: 600;
color: #15191f;
}
.item-price text:nth-child(1) {
font-size: 22rpx;
}
.item-price text:nth-child(2) {
margin-right: 8rpx;
font-size: 30rpx;
}
.item-price-discount {
width: 78rpx;
height: 32rpx;
border-radius: 4rpx;
background: #FAEDEA;
text-align: center;
font-size: 18rpx;
font-weight: 500;
line-height: 32rpx;
color: #EF4E4E;
}
.item-price-special {
width: 78rpx;
height: 32rpx;
border-radius: 4rpx;
background: linear-gradient(180deg, #3F4357 0%, #252532 100%);
text-align: center;
font-size: 18rpx;
font-weight: 500;
line-height: 32rpx;
color: #E8D0AF;
}
.item-operation-add button {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
background: #86C5E1;
}
.item-operation-add image {
width: 24rpx;
height: 24rpx;
}
.item-operation-add-disable button {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
background: #999999;
}
.goods-add-btn-wrap {
flex: 1;
}
.l-btn-circle {
border-radius: 50% !important;
font-size: 24rpx;
}
.item-info-old-price {
margin-top: 4rpx;
font-size: 22rpx;
color: #959da9;
text-decoration: line-through;
}
.popup-wrap {
width: 606rpx;
margin-top: 100rpx;
background-color: #fff;
border-radius: 4rpx;
}
.popup-img-wrap {
width: 606rpx;
height: 382rpx;
}
.popup-info-wrapper {
padding: 48rpx 40rpx;
}
.popuo-info-title {
font-size: 34rpx;
color: #15191f;
}
.popup-info-text {
margin-top: 24rpx;
font-size: 22rpx;
line-height: 32rpx;
color: #959da9;
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
}
.popup-footer-wrapper {
margin: 0 40rpx;
padding: 40rpx 0;
border-top: 0.5px solid #e2e7ef;
}
.popup-price-row {
padding: 10rpx 0;
}
.popup-price-now {
color: #15191f;
}
.detail-price text:nth-child(1) {
height: 52rpx;
font-size: 30rpx;
font-weight: 500;
line-height: 52rpx;
color: #15191F;
}
.detail-price text:nth-child(2) {
height: 52rpx;
font-size: 38rpx;
font-weight: 500;
line-height: 52rpx;
color: #15191F;
}
.detail-price-discount {
width: 90rpx;
height: 36rpx;
margin-right: 16rpx;
border-radius: 4rpx;
background: #FAEDEA;
text-align: center;
font-size: 18rpx;
font-weight: 500;
line-height: 32rpx;
color: #EF4E4E;
}
.detail-price-special {
width: 90rpx;
height: 36rpx;
margin-right: 16rpx;
border-radius: 4rpx;
background: linear-gradient(180deg, #3F4357 0%, #252532 100%);
text-align: center;
font-size: 18rpx;
font-weight: 500;
line-height: 32rpx;
color: #E8D0AF;
}
.popup-price-old {
margin-left: 20rpx;
font-size: 26rpx;
color: #959da9;
text-decoration: line-through;
}
.popup-footer-btn {
width: 526rpx;
height: 80rpx;
margin-top: 30rpx;
font-size: 30rpx;
color: #fff;
background-color: #86c5e1;
border-radius: 4rpx;
}
.popup-close-btn {
width: 80rpx;
height: 80rpx;
margin: 48rpx auto 0;
background: rgba(254, 252, 249, 0.5);
border-radius: 50%;
}
.popup-close {
width: 40rpx;
height: 40rpx;
}
.toast-bg {
min-width: 262rpx !important;
min-height: 262prx !important;
}
.toast-image {
z-index: 1900;
}
image {
width: 100%;
height: 100%;
}
/* 商品详情样式 */
.banner {
position: relative;
width: 606rpx;
height: 382rpx;
border-radius: 4rpx;
background: #FFFFFF;
}
.banner-swiper,
.banner-swiper-item,
.banner-swiper-image {
position: absolute;
top: 0 !important;
left: 0 !important;
width: 606rpx;
height: 382rpx;
}
.banner-wave {
z-index: 1100;
position: absolute;
bottom: -2rpx;
left: 0;
width: 606rpx;
height: 50rpx;
}
.banner-wave image {
width: 606rpx;
height: 50rpx;
}
/* 购物车样式 */
.cart-animation {
position: fixed;
top: 0;
right: 48rpx;
width: 26rpx;
height: 26rpx;
border-radius: 50%;
background: #86c5e1;
}
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<l-toast
l-image-class="toast-image"
l-class="toast-bg"
show="{{winToast}}"
image="/image/success.png"
title="添加购物车成功"
duration="400"
></l-toast>
<l-toast show="{{winToastNothing}}" icon="error" title="没有更多商品了" duration="400"></l-toast>
<l-toast
show="{{winLoading}}"
icon="loading"
title="加载中"
duration="20000"
mask="{{true}}"
></l-toast>
<navigation class="navigation" titleText="{{shopInfo.name}}" background="#FFFFFF;" backIcon="/image/back.png"></navigation>
<view class="row">
<!-- 侧边菜单 -->
<view class="side-bar">
<block wx:for="{{sideBar}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="menu-item {{currentIndex === index ? 'active' : ''}}" data-index="{{index}}" bindtap="onSelectionSideBar">
<text>{{item.tab}}</text>
</view>
</block>
</view>
<!-- 商品列表 -->
<view class="menu-list">
<view class="right-content-title">{{menuTitle}}</view>
<block wx:for="{{commodityList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="commodity-item row" data-item="{{item}}" bind:tap="onCommodityDetail">
<view class="item-img">
<image src="{{item.cover}}" mode="widthFix"></image>
</view>
<view class="item-info">
<view class="item-info-title">{{item.name}}</view>
<view class="item-info-text-wrap">
<view wx:if="{{item.describe}}">{{item.describe}}</view>
<view wx:else class="item-info-content"></view>
</view>
<view class="item-other row con-b">
<!-- 活动价样式 -->
<view wx:if="{{item.priceType === 1}}">
<view class="item-price row align-c">
<text>¥</text>
<text>{{item.priceDiscountText}}</text>
<text class="item-price-discount">活动价</text>
</view>
<view class="item-info-old-price row align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
</view>
</view>
<!-- 业主价样式 -->
<view wx:if="{{item.priceType === 2}}">
<view class="item-price row align-c">
<text>¥</text>
<text>{{item.priceSpecialText}}</text>
<text class="item-price-special">业主价</text>
</view>
<view class="item-info-old-price row align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
</view>
</view>
<!-- 普通价样式 -->
<view wx:if="{{item.priceType === 3}}">
<view class="item-price row align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
<text></text>
</view>
</view>
<view class="item-operation-add">
<button class="row con-c align-c" data-item="{{item}}" catchtap="onCommodityAdd">
<image mode="widthFix" src="{{imageBase + 'icon/cart-3.png'}}"></image>
</button>
</view>
</view>
</view>
</view>
</block>
<!-- 购物车按钮 -->
<view id="cart" class="cart row con-c align-c" bindtap="onShoppingCart">
<!-- 添加动画圆点 -->
<!-- <view class="cart-animation" wx:if="{{winAnimationPoint}}" animation="{{animationData}}"></view> -->
<view class="cart-num row con-c align-c">{{shoppingCartTotal}}</view>
<view class="cart-img-wrap">
<image src="../../../image/cart.png" mode="widthFix"></image>
</view>
</view>
</view>
</view>
<!-- 商品详情弹窗 -->
<l-popup show="{{winCommodityDetail}}" content-align="center" locked="{{true}}">
<view class="popup-wrap">
<view id="banner" class="banner">
<swiper autoplay circular class="banner-swiper" interval="5000" duration="500">
<block wx:for="{{commodityDetail.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>
</swiper-item>
</block>
</swiper>
<view class="banner-wave">
<image src="/image/ornament-1.png" mode="widthFix"></image>
</view>
</view>
<view class="popup-info-wrapper">
<view class="popuo-info-title">{{commodityDetail.name}}</view>
<view class="popup-info-text">{{commodityDetail.describeDetail}}</view>
</view>
<view class="popup-footer-wrapper">
<!-- 活动价样式 -->
<view class="popup-price-row row align-c" wx:if="{{commodityDetail.priceType === 1}}">
<view class="detail-price-discount row con-c align-c">
<text>活动价</text>
</view>
<view class="detail-price">
<text>¥</text>
<text>{{commodityDetail.priceDiscountText}}</text>
</view>
<view class="popup-price-old">
<text>¥</text>
<text>{{commodityDetail.priceText}}</text>
</view>
</view>
<!-- 业主价样式 -->
<view class="popup-price-row row align-c" wx:if="{{commodityDetail.priceType === 2}}">
<view class="detail-price-special row con-c align-c">
<text>业主价</text>
</view>
<view class="detail-price">
<text>¥</text>
<text>{{commodityDetail.priceSpecialText}}</text>
</view>
<view class="popup-price-old">
<text>¥</text>
<text>{{commodityDetail.priceText}}</text>
</view>
</view>
<!-- 普通价样式 -->
<view class="popup-price-row row align-c" wx:if="{{commodityDetail.priceType === 3}}">
<view class="popup-price-special row con-c align-c">
<text></text>
</view>
<view class="detail-price">
<text>¥</text>
<text>{{commodityDetail.priceText}}</text>
</view>
</view>
<view class="popup-footer-btn row con-c align-c" bindtap="onCommodityAdd">加入购物车</view>
</view>
</view>
<view class="popup-close-btn row con-c align-c" bindtap="onCommodityClose">
<view class="popup-close">
<image mode="widthFix" src="../../../image/icon_close.png"></image>
</view>
</view>
</l-popup>
\ No newline at end of file
page {
overflow: hidden;
}
.navigation {
z-index: 1100;
position: fixed;
top: 0;
left: 0;
width: 750rpx;
}
.side-bar {
width: 160rpx;
height: 100vh;
padding-top: 126rpx;
overflow-y: scroll;
background: #f2f3f5;
}
.side-bar::-webkit-scrollbar {
width: 0;
}
.menu-item {
height: 136rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 26rpx;
color: #656e7b;
}
.menu-item.active {
color: #5cb5dd;
font-weight: 600;
background: #fff;
border-left: 8rpx solid #86c5e1;
}
.menu-list {
width: 590rpx;
height: 100vh;
margin-top: 140rpx;
padding: 0 32rpx 200rpx 32rpx;
overflow-y: scroll;
background: #FFFFFF;
}
.right-content::-webkit-scrollbar {
width: 0;
}
.right-content-title {
height: 100rpx;
padding: 32rpx 0;
font-size: 26rpx;
color: #959da9;
}
.cart {
position: fixed;
right: 48rpx;
bottom: 160rpx;
width: 104rpx;
height: 104rpx;
border-radius: 50%;
background-color: #86c5e1;
}
.cart-num {
position: absolute;
top: 0;
right: 0;
height: 32rpx;
padding: 0 12rpx;
font-size: 22rpx;
line-height: 32rpx;
border: 1px solid #86c5e1;
border-radius: 17rpx;
color: #86c5e1;
background-color: #fff;
}
.cart-img-wrap {
width: 48rpx;
height: 48rpx;
}
.commodity-item {
width: 100%;
min-height: 250rpx;
padding-bottom: 56rpx;
box-sizing: border-box;
}
.item-img {
width: 160rpx;
height: 160rpx;
}
.item-info {
flex: 1;
margin-left: 28rpx;
}
.item-info-title {
font-size: 30rpx;
font-weight: 500;
line-height: 42rpx;
color: #15191F;
}
.item-info-text-wrap {
display: -webkit-box;
width: 342rpx;
height: 64rpx;
margin-top: 16rpx;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
font-size: 22rpx;
font-weight: 400;
line-height: 32rpx;
color: #959DA9;
}
.item-info-content {
height: 40rpx;
}
.item-other {
margin-top: 24rpx;
}
.item-operation {
margin-top: 24rpx;
font-size: 30rpx;
font-weight: 600;
color: #15191f;
}
.item-price text:nth-child(1) {
font-size: 22rpx;
}
.item-price text:nth-child(2) {
margin-right: 8rpx;
font-size: 30rpx;
}
.item-price-discount {
width: 78rpx;
height: 32rpx;
border-radius: 4rpx;
background: #FAEDEA;
text-align: center;
font-size: 18rpx;
font-weight: 500;
line-height: 32rpx;
color: #EF4E4E;
}
.item-price-special {
width: 78rpx;
height: 32rpx;
border-radius: 4rpx;
background: linear-gradient(180deg, #3F4357 0%, #252532 100%);
text-align: center;
font-size: 18rpx;
font-weight: 500;
line-height: 32rpx;
color: #E8D0AF;
}
.item-operation-add button {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
background: #86C5E1;
}
.item-operation-add image {
width: 24rpx;
height: 24rpx;
}
.item-operation-add-disable button {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
background: #999999;
}
.goods-add-btn-wrap {
flex: 1;
}
.l-btn-circle {
border-radius: 50% !important;
font-size: 24rpx;
}
.item-info-old-price {
margin-top: 4rpx;
font-size: 22rpx;
color: #959da9;
text-decoration: line-through;
}
.popup-wrap {
width: 606rpx;
margin-top: 100rpx;
background-color: #fff;
border-radius: 4rpx;
}
.popup-img-wrap {
width: 606rpx;
height: 382rpx;
}
.popup-info-wrapper {
padding: 48rpx 40rpx;
}
.popuo-info-title {
font-size: 34rpx;
color: #15191f;
}
.popup-info-text {
margin-top: 24rpx;
font-size: 22rpx;
line-height: 32rpx;
color: #959da9;
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
}
.popup-footer-wrapper {
margin: 0 40rpx;
padding: 40rpx 0;
border-top: 0.5px solid #e2e7ef;
}
.popup-price-row {
padding: 10rpx 0;
}
.popup-price-now {
color: #15191f;
}
.detail-price text:nth-child(1) {
height: 52rpx;
font-size: 30rpx;
font-weight: 500;
line-height: 52rpx;
color: #15191F;
}
.detail-price text:nth-child(2) {
height: 52rpx;
font-size: 38rpx;
font-weight: 500;
line-height: 52rpx;
color: #15191F;
}
.detail-price-discount {
width: 90rpx;
height: 36rpx;
margin-right: 16rpx;
border-radius: 4rpx;
background: #FAEDEA;
text-align: center;
font-size: 18rpx;
font-weight: 500;
line-height: 32rpx;
color: #EF4E4E;
}
.detail-price-special {
width: 90rpx;
height: 36rpx;
margin-right: 16rpx;
border-radius: 4rpx;
background: linear-gradient(180deg, #3F4357 0%, #252532 100%);
text-align: center;
font-size: 18rpx;
font-weight: 500;
line-height: 32rpx;
color: #E8D0AF;
}
.popup-price-old {
margin-left: 20rpx;
font-size: 26rpx;
color: #959da9;
text-decoration: line-through;
}
.popup-footer-btn {
width: 526rpx;
height: 80rpx;
margin-top: 30rpx;
font-size: 30rpx;
color: #fff;
background-color: #86c5e1;
border-radius: 4rpx;
}
.popup-close-btn {
width: 80rpx;
height: 80rpx;
margin: 48rpx auto 0;
background: rgba(254, 252, 249, 0.5);
border-radius: 50%;
}
.popup-close {
width: 40rpx;
height: 40rpx;
}
.toast-bg {
min-width: 262rpx !important;
min-height: 262prx !important;
}
.toast-image {
z-index: 1900;
}
image {
width: 100%;
height: 100%;
}
/* 商品详情样式 */
.banner {
position: relative;
width: 606rpx;
height: 382rpx;
border-radius: 4rpx;
background: #FFFFFF;
}
.banner-swiper,
.banner-swiper-item,
.banner-swiper-image {
position: absolute;
top: 0 !important;
left: 0 !important;
width: 606rpx;
height: 382rpx;
}
.banner-wave {
z-index: 1100;
position: absolute;
bottom: -2rpx;
left: 0;
width: 606rpx;
height: 50rpx;
}
.banner-wave image {
width: 606rpx;
height: 50rpx;
}
/* 购物车样式 */
.cart-animation {
position: fixed;
top: 0;
right: 48rpx;
width: 26rpx;
height: 26rpx;
border-radius: 50%;
background: #86c5e1;
}
\ No newline at end of file
let App = getApp() let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({ Page({
data: { data: {
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase, resourcesBase: App.globalData.appResourcesBase,
// 导航栏相关属性 navTitle: '',
navigationStyle: {
normal: {
backIcon: '/image/back-w.png',
color: '#FFFFFF',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(255, 255, 255, 1)'
},
scroll: '200rpx',
},
navigationScroll: 0,
navbarTitle: '',
banner: '', banner: '',
bgColor: '', bgColor: '',
buyText: '', buyText: '',
...@@ -46,7 +25,7 @@ Page({ ...@@ -46,7 +25,7 @@ Page({
switch (this.data.shopInfo.appId) { switch (this.data.shopInfo.appId) {
case 1: case 1:
this.setData({ this.setData({
navbarTitle: '海错图购票', navTitle: '海错图购票',
banner: 'service/detail-banner-1.png', banner: 'service/detail-banner-1.png',
bgColor: '#F5ECD8', bgColor: '#F5ECD8',
buyText: '购买门票', buyText: '购买门票',
...@@ -57,7 +36,7 @@ Page({ ...@@ -57,7 +36,7 @@ Page({
case 3: case 3:
this.setData({ this.setData({
navbarTitle: '儿童营地入园购票', navTitle: '儿童营地入园购票',
banner: 'service/detail-banner-3.png', banner: 'service/detail-banner-3.png',
bgColor: '#F6DADA', bgColor: '#F6DADA',
buyText: '购买门票', buyText: '购买门票',
...@@ -68,7 +47,7 @@ Page({ ...@@ -68,7 +47,7 @@ Page({
case 7: case 7:
this.setData({ this.setData({
navbarTitle: '元养水韵SPA服务', navTitle: '元养水韵SPA服务',
banner: 'service/detail-banner-7.png', banner: 'service/detail-banner-7.png',
bgColor: '#8FC3CB', bgColor: '#8FC3CB',
buyText: '购买', buyText: '购买',
...@@ -355,19 +334,13 @@ Page({ ...@@ -355,19 +334,13 @@ Page({
}) })
}, },
/**
* 页面滚动事件
* @function
* @param {object} - funcEvent
* @returns
*/
onPageScroll: function (funcEvent) { onPageScroll: function (funcEvent) {
// 优化滚动事件触发频率 App.pageScroll(funcEvent, this)
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 10)
}, },
}) })
\ No newline at end of file
<navigation class="navigation" titleText="{{navbarTitle}}" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation> <m-nav titleText="{{navTitle}}" scrollHeight="{{navScroll}}" styleIndex="{{2}}" isOccupy="{{false}}"></m-nav>
<view class="container con-s" style="background: {{bgColor}}"> <view class="container con-s" style="background: {{bgColor}}">
<view class="background-img"> <view class="background-img">
...@@ -70,5 +70,4 @@ ...@@ -70,5 +70,4 @@
</view> </view>
</view> </view>
</block> </block>
</view> </view>
\ No newline at end of file
let App = getApp() let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({ Page({
data: { data: {
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase, resourcesBase: App.globalData.appResourcesBase,
// 导航栏相关属性
navigationStyle: {
normal: {
backIcon: '/image/back-w.png',
color: '#FFFFFF',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(255, 255, 255, 1)'
},
scroll: '600rpx',
},
navigationScroll: 0,
banner: [], banner: [],
bannerIndex: 0, bannerIndex: 0,
...@@ -376,20 +355,14 @@ Page({ ...@@ -376,20 +355,14 @@ Page({
}) })
}, },
/**
* 页面滚动事件
* @function
* @param {object} - funcEvent
* @returns
*/
onPageScroll: function (funcEvent) { onPageScroll: function (funcEvent) {
// 优化滚动事件触发频率 App.pageScroll(funcEvent, this)
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 10)
}, },
/** /**
......
<navigation class="navigation" titleText="所有门票服务" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation> <m-nav titleText="所有门票服务" scrollHeight="{{navScroll}}" styleIndex="{{2}}" isOccupy="{{false}}"></m-nav>
<view class="container"> <view class="container">
<view class="banner"> <view class="banner">
......
.navigation {
z-index: 1900;
}
.container { .container {
padding-bottom: 160rpx; padding-bottom: 160rpx;
background: linear-gradient(180deg, #FFFFFF 0%, #F3F4F6 100%, #F3F4F6 100%, #F3F4F6 100%); background: linear-gradient(180deg, #FFFFFF 0%, #F3F4F6 100%, #F3F4F6 100%, #F3F4F6 100%);
} }
.banner { .banner {
z-index: 9;
position: relative; position: relative;
width: 750rpx; width: 750rpx;
height: 800rpx; height: 800rpx;
......
const App = getApp() let App = getApp()
Page({ Page({
data: { data: {
...@@ -29,7 +29,7 @@ Page({ ...@@ -29,7 +29,7 @@ Page({
onLoad: function (options) { onLoad: function (options) {
this.setData({ this.setData({
frompage: options.frompage, frompage: options.frompage,
optionsTab:options.tab optionsTab: options.tab
}) })
this.setReset() this.setReset()
}, },
...@@ -191,12 +191,10 @@ Page({ ...@@ -191,12 +191,10 @@ Page({
return return
} }
wx.lin.showToast({ App.ui.showToast({
icon: 'loading', iconType: 'loading',
title: '提交中', title: '提交中',
show: true, duration: 60000,
mask: true,
duration: 1000 * 60,
}) })
App.wxRequest({ App.wxRequest({
...@@ -209,25 +207,23 @@ Page({ ...@@ -209,25 +207,23 @@ Page({
type: 1, type: 1,
}, },
success: (response) => { success: (response) => {
console.log(response)
let funcResponse = response let funcResponse = response
if (response.data && response.data.code === 500) { if (response.data && response.data.code === 500) {
wx.lin.hideToast() App.ui.showToast({
wx.lin.showToast({ iconType: 'error',
image: '/image/error.png',
title: response.data.msg, title: response.data.msg,
}) })
return return
} }
App.ui.hideToast()
this.setData({ this.setData({
appointmentComplete: true, appointmentComplete: true,
}) })
wx.lin.hideToast()
}, },
fail: (response) => { fail: (response) => {
wx.lin.showToast({ App.ui.showToast({
image: '/image/error.png', iconType: 'error',
title: response.msg, title: response.msg,
}) })
} }
...@@ -244,14 +240,9 @@ Page({ ...@@ -244,14 +240,9 @@ Page({
}, },
getNextDay(d, t) { getNextDay(d, t) {
console.log(d, t) //格式为---2019-02-13 3
d = new Date(d); d = new Date(d);
console.log(d) //格式为---Wed Feb 13 2019 08:00:00 GMT+0800 (中国标准时间)
d = +d + (1000 * 60 * 60 * 24) * t; d = +d + (1000 * 60 * 60 * 24) * t;
console.log(d) //格式为--时间戳1550275200000
d = new Date(d); d = new Date(d);
console.log(d) //格式为---Sat Feb 16 2019 08:00:00 GMT+0800 (中国标准时间)
return App.modular.miment(new Date(d)).format("YYYY-MM-DD") //格式为"2019-02-16 00:00:00" return App.modular.miment(new Date(d)).format("YYYY-MM-DD") //格式为"2019-02-16 00:00:00"
}, },
}) })
\ No newline at end of file
<l-toast l-image-class="toast-image"></l-toast> <m-toast></m-toast>
<!-- 首页 - 入园预约 / 房屋预约 --> <m-nav titleText="看房预约" styleIndex="{{2}}" isOccupy="{{false}}"></m-nav>
<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 row con-c align-c" wx:if="{{appointmentComplete}}">
<view class="appointment-complete-tip"> <view class="appointment-complete-tip">
......
<m-toast></m-toast> <m-toast></m-toast>
<m-nav titleText="购物车"></m-nav> <m-nav titleText="购物车"></m-nav>
<view class="container" wx:if="{{shoppingCart.length > 0}}" style="{{'margin-top: ' + sideBarTopPadding + 'px;'}}"> <view class="container" wx:if="{{shoppingCart.length > 0}}">
<view class="shop-info row con-b align-c"> <view class="shop-info row con-b align-c">
<image wx:if="{{shopLogo}}" src="{{resourcesBase + shopLogo}}" mode="widthFix"></image> <image wx:if="{{shopLogo}}" src="{{resourcesBase + shopLogo}}" mode="widthFix"></image>
<text bindtap="onClearn">清空</text> <text bindtap="onClearn">清空</text>
......
.navigation {
z-index: 1100;
position: fixed;
top: 0;
left: 0;
width: 750rpx;
}
.shop-info { .shop-info {
width: 750rpx; width: 750rpx;
height: 110rpx; height: 110rpx;
......
let App = getApp() let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({ Page({
data: { data: {
imageResourcesBase: App.globalData.appResourcesBase, imageResourcesBase: App.globalData.appResourcesBase,
...@@ -32,22 +26,6 @@ Page({ ...@@ -32,22 +26,6 @@ Page({
type: '', type: '',
accumulateListHeight: 0, accumulateListHeight: 0,
// 导航栏相关属性
navigationStyle: {
normal: {
backIcon: '/image/back-w.png',
color: '#FFFFFF',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(255, 255, 255, 1)'
},
scroll: '200rpx',
},
navigationScroll: 0,
}, },
onLoad: function(options) { onLoad: function(options) {
...@@ -132,20 +110,4 @@ Page({ ...@@ -132,20 +110,4 @@ Page({
this.onHideMenu() this.onHideMenu()
this.getAccumulate() this.getAccumulate()
}, },
onPageScroll: function(funcEvent) {
// console.log(funcEvent)
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function() {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 10)
},
}) })
\ No newline at end of file
<navigation class="navigation" titleText="我的积分" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation> <m-nav titleText="我的积分" styleIndex="{{2}}" isOccupy="{{false}}"></m-nav>
<view class="container con-s" bindtap="onHideMenu"> <view class="container con-s" bindtap="onHideMenu">
<!-- 积分背景图 --> <!-- 积分背景图 -->
......
...@@ -2,8 +2,6 @@ let App = getApp() ...@@ -2,8 +2,6 @@ let App = getApp()
Page({ Page({
data: { data: {
winToastText: '操作成功',
winToast: false,
isDoing: false, isDoing: false,
showNotice: false, showNotice: false,
swiperCurrent: 0, swiperCurrent: 0,
...@@ -132,23 +130,18 @@ Page({ ...@@ -132,23 +130,18 @@ Page({
onDelOrCancelOrder: function (event) { onDelOrCancelOrder: function (event) {
let funcItem = this.data.orderInfo let funcItem = this.data.orderInfo
console.log(funcItem)
let type = event.currentTarget.dataset.type let type = event.currentTarget.dataset.type
let that = this App.ui.showDialog({
let tip = type == 1 ? '删除订单' : '取消订单'
wx.lin.showDialog({
type: 'confirm', type: 'confirm',
title: '', title: type == 0 ? '是否确认取消报名' : '是否确认删除报名',
content: "是否确认" + tip, content: type == 0 ? '取消后无法恢复' : '删除后无法恢复',
success: (res) => { cancel: type == 0 ? '暂不取消' : '取消',
if (res.confirm) { confirm: type == 0 ? '确定取消' : '确定',
console.log('用户点击确定') success: () => {
wx.showLoading({ App.ui.showToast({
title: '处理中', 'iconType': 'loading',
mask: true 'title': '处理中',
'duration': 60000
}) })
this.setData({ this.setData({
isDoing: true, isDoing: true,
...@@ -160,12 +153,14 @@ Page({ ...@@ -160,12 +153,14 @@ Page({
'type': type, 'type': type,
}, },
success: (response) => { success: (response) => {
wx.hideLoading() App.ui.hideToast()
let winToastText = type == 1 ? '订单删除成功' : '订单取消成功' this.setData({
that.setData({
isDoing: false, isDoing: false,
winToast: true, })
winToastText: winToastText
App.ui.showToast({
'iconType': 'success',
'title': type == 1 ? '订单删除成功' : '订单取消成功'
}) })
setTimeout(function () { setTimeout(function () {
if (type == 1) { if (type == 1) {
...@@ -173,10 +168,12 @@ Page({ ...@@ -173,10 +168,12 @@ Page({
wx.navigateBack({ wx.navigateBack({
delta: 1 delta: 1
}) })
wx.setStorageSync('option-appointment', 'refresh')
} else { } else {
// 取消操作 // 取消操作
let state = `orderInfo.state` let state = `orderInfo.state`
that.setData({ this.setData({
isDoing: false, isDoing: false,
[state]: -1 [state]: -1
}) })
...@@ -184,14 +181,11 @@ Page({ ...@@ -184,14 +181,11 @@ Page({
}, 2000) }, 2000)
} }
}) })
},
} else if (res.cancel) { fail: () => {},
console.log('用户点击取消')
}
}
}) })
}, },
// 使用须知 // 使用须知
handleNotice() { handleNotice() {
let showNotice = true let showNotice = true
...@@ -242,7 +236,6 @@ Page({ ...@@ -242,7 +236,6 @@ Page({
* @returns * @returns
*/ */
queryOrderDetail: function () { queryOrderDetail: function () {
let that = this
App.wxRequest({ App.wxRequest({
url: '/api/v1/order/getOrderDetail', url: '/api/v1/order/getOrderDetail',
data: { data: {
...@@ -303,7 +296,7 @@ Page({ ...@@ -303,7 +296,7 @@ Page({
let residueStamp = endTime - now let residueStamp = endTime - now
let residuePayTime = App.modular.miment(residueStamp).format('mm:ss') let residuePayTime = App.modular.miment(residueStamp).format('mm:ss')
if (residueStamp > 0) { if (residueStamp > 0) {
that.setData({ this.setData({
residuePayTime: residuePayTime residuePayTime: residuePayTime
}) })
} else { } else {
...@@ -313,7 +306,7 @@ Page({ ...@@ -313,7 +306,7 @@ Page({
// that.queryOrderDetail() // that.queryOrderDetail()
let state = `orderInfo.state` let state = `orderInfo.state`
that.setData({ this.setData({
[state]: -1 [state]: -1
}) })
} }
...@@ -337,18 +330,21 @@ Page({ ...@@ -337,18 +330,21 @@ Page({
// 弹出单张二维码 // 弹出单张二维码
onCouponCode: function (event) { onCouponCode: function (event) {
let funcOrderInfo = event.currentTarget.dataset.item let funcOrderInfo = event.currentTarget.dataset.item
wx.showLoading({
title: '加载中', App.ui.showToast({
'iconType': 'loading',
'title': '加载中',
'duration': 60000
}) })
App.wxRequest({ App.wxRequest({
url: '/api/v1/volume/getVolume', url: '/api/v1/volume/getVolume',
data: { data: {
'volumeId': funcOrderInfo.codeId 'volumeId': funcOrderInfo.codeId
}, },
success: (response) => { success: (response) => {
wx.hideLoading({ App.ui.hideToast()
success: (res) => { },
})
let funcResponse = response.data let funcResponse = response.data
let funcCodeInfo = { let funcCodeInfo = {
'codeNo': funcResponse.serialNumber, 'codeNo': funcResponse.serialNumber,
...@@ -363,21 +359,10 @@ Page({ ...@@ -363,21 +359,10 @@ Page({
}) })
}, },
// 多二维码 复制券码 // 多二维码 复制券码
setClipboard(e) { setClipboard: function (event) {
const code = e.currentTarget.dataset.code const code = event.currentTarget.dataset.code
wx.setClipboardData({ wx.setClipboardData({
data: code, data: code,
success(res) {
wx.showToast({
title: '复制成功',
})
// wx.getClipboardData({
// success(res) {
// console.log(res.data) // data
// }
// })
}
}) })
}, },
// 单个二维码 复制券码 // 单个二维码 复制券码
...@@ -393,7 +378,7 @@ Page({ ...@@ -393,7 +378,7 @@ Page({
}) })
}, },
navBack: function () { onNavBack: function () {
if (this.data.fromPage) { if (this.data.fromPage) {
wx.switchTab({ wx.switchTab({
url: '/pages/mine/home/home', url: '/pages/mine/home/home',
......
<navigation class="navigation" titleText="订单详情" color="#000000" background="#FFFFFF" backIcon="/image/back.png" bind:navBack="navBack"></navigation> <m-toast></m-toast>
<m-dialog></m-dialog>
<m-nav titleText="订单详情" styleIndex="{{1}}" bind:navBack="onNavBack"></m-nav>
<view class="container padding-bottom-166"> <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}}">
...@@ -362,8 +364,3 @@ ...@@ -362,8 +364,3 @@
</scroll-view> </scroll-view>
</view> </view>
</l-popup> </l-popup>
\ No newline at end of file
<!-- 成功提示 -->
<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
/* 订单状态 */ .container {
margin-top: 60rpx;
}
.state { .state {
width: 750rpx; width: 750rpx;
} }
.container {
margin-top: 160rpx;
}
.state-content { .state-content {
width: 670rpx; width: 670rpx;
height: 240rpx; height: 240rpx;
...@@ -231,7 +229,7 @@ ...@@ -231,7 +229,7 @@
/* 订单提示 */ /* 订单提示 */
.tip { .tip {
margin: 74rpx 40rpx 70rpx 40rpx; margin: 74rpx 40rpx 160rpx 40rpx;
} }
.tip-pay { .tip-pay {
...@@ -794,10 +792,6 @@ ...@@ -794,10 +792,6 @@
line-height: 42rpx; line-height: 42rpx;
} }
.padding-bottom-166 {
padding-bottom: 166rpx;
}
.footer-btn { .footer-btn {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
......
const App = getApp() let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({ Page({
/**
* 页面的初始数据
*/
data: { data: {
phone: '13856782234', phone: '13856782234',
hotline: false, //客服热线 hotline: false, //客服热线
...@@ -20,24 +11,28 @@ Page({ ...@@ -20,24 +11,28 @@ Page({
tickerInfo: {}, tickerInfo: {},
isDoing: false, isDoing: false,
isShowCancel: false, isShowCancel: false,
// 导航栏相关属性
navigationStyle: {
normal: {
backIcon: '/image/back-w.png',
color: '#FFFFFF',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(255, 255, 255, 1)'
}, },
scroll: '100rpx',
},
navigationScroll: 0,
onLoad: function (options) {
console.log(options)
let detail = JSON.parse(options.detail);
let yyDate = detail.subscribeDate ? Date.parse(detail.subscribeDate.replace(/-/g, '/')) : 0
let nowStr = new Date().toLocaleString().substr(0, 10).replace(/-/g, '/') + " 00:00:00"
let now = Date.parse(nowStr)
let isShowCancel = now <= yyDate
this.setData({
tickerInfo: detail,
type: detail.type,
name: detail.name,
mobile: detail.mobile,
num: detail.num,
time: detail.time,
isShowCancel
})
}, },
showHotline() { showHotline() {
this.setData({ this.setData({
hotline: true hotline: true
...@@ -45,20 +40,21 @@ Page({ ...@@ -45,20 +40,21 @@ Page({
}, },
//取消预约 //取消预约
onCancel: function (event) { onCancel: function (event) {
let that = this
if (this.data.isDoing) return if (this.data.isDoing) return
wx.lin.showDialog({
type: "confirm",
title: "",
content: "是否确认取消预约",
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
wx.showLoading({ App.ui.showDialog({
title: '处理中', type: 'confirm',
mask: true title: this.data.type === 0 ? '是否确认取消夜间入园预约?' : '是否确认取消看房预约?',
content: '取消后无法恢复',
cancel: '暂不取消',
confirm: '确定取消',
success: () => {
App.ui.showToast({
'iconType': 'loading',
'title': '处理中',
'duration': 60000
}) })
this.setData({ this.setData({
isDoing: true isDoing: true
}) })
...@@ -66,29 +62,26 @@ Page({ ...@@ -66,29 +62,26 @@ Page({
App.wxRequest({ App.wxRequest({
url: '/api/v1/subscribe/cancelSubscribe', url: '/api/v1/subscribe/cancelSubscribe',
data: { data: {
'id': that.data.tickerInfo.id 'id': this.data.tickerInfo.id
}, },
success: (response) => { success: (response) => {
wx.hideLoading() App.ui.hideToast()
that.setData({ this.setData({
isDoing: false isDoing: false
}) })
if (response.data && response.data.code == 500) {
if (response.data&&response.data.code == 500) { App.ui.showToast({
wx.lin.showToast({ 'iconType': 'error',
image: '/image/error.png', 'title': response.data.msg,
title: response.data.msg,
}) })
} else { } else {
App.ui.showToast({
wx.lin.showToast({ 'iconType': 'success',
image: '/image/success.png', 'title': '取消成功'
title: '取消成功',
}) })
setTimeout(() => { setTimeout(() => {
let type = that.data.type let type = this.data.type
let tabType = 2 let tabType = 2
if (type == 0) { if (type == 0) {
//返回夜间入园预约列表 //返回夜间入园预约列表
...@@ -100,21 +93,13 @@ Page({ ...@@ -100,21 +93,13 @@ Page({
wx.redirectTo({ wx.redirectTo({
url: '/pages/mine/appointment/appointment?tab=' + tabType, url: '/pages/mine/appointment/appointment?tab=' + tabType,
}) })
}, 2000); }, 2000);
} }
} }
}) })
} else if (res.cancel) { },
console.log('用户点击取消') fail: () => {},
}
}
}) })
}, },
//客服热线拨打 //客服热线拨打
call() { call() {
...@@ -129,43 +114,14 @@ Page({ ...@@ -129,43 +114,14 @@ Page({
hotline: false, hotline: false,
}) })
}, },
/** /**
* 生命周期函数--监听页面加载 * 页面滚动事件
* @function
* @param {object} - funcEvent
* @returns
*/ */
onLoad: function (options) {
let detail = JSON.parse(options.detail);
let yyDate = detail.subscribeDate ? Date.parse(detail.subscribeDate.replace(/-/g, '/')) : 0
let nowStr = new Date().toLocaleString().substr(0, 10).replace(/-/g, '/') + " 00:00:00"
let now = Date.parse(nowStr)
let isShowCancel = now <= yyDate
this.setData({
tickerInfo: detail,
type: detail.type,
name: detail.name,
mobile: detail.mobile,
num: detail.num,
time: detail.time,
isShowCancel
})
},
// 滚动屏幕
onPageScroll: function (funcEvent) { onPageScroll: function (funcEvent) {
// 优化滚动事件触发频率 App.pageScroll(funcEvent, this)
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 10)
}, },
}) })
\ No newline at end of file
<navigation class="navigation" titleText="预约凭证" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"> <m-toast></m-toast>
</navigation> <m-dialog></m-dialog>
<m-nav titleText="预约凭证" scrollHeight="{{navScroll}}" styleIndex="{{2}}" isOccupy="{{false}}"></m-nav>
<view> <view>
<image class="Img" wx:if="{{type == 0}}" src="http://upload.miaomiao-bao.com/f6dfe202008192103225871.jpg"></image> <image class="Img" wx:if="{{type == 0}}" src="http://upload.miaomiao-bao.com/f6dfe202008192103225871.jpg"></image>
<image class="Img" wx:if="{{type == 1}}" src="http://upload.miaomiao-bao.com/8883f202008192105356616.jpg"></image> <image class="Img" wx:if="{{type == 1}}" src="http://upload.miaomiao-bao.com/8883f202008192105356616.jpg"></image>
...@@ -42,9 +44,6 @@ ...@@ -42,9 +44,6 @@
<view wx:else class="custom" bindtap="showHotline">客服咨询</view> <view wx:else class="custom" bindtap="showHotline">客服咨询</view>
</view> </view>
</view> </view>
<l-dialog />
<l-toast l-image-class="toast-image"></l-toast>
<!-- 客服热线 --> <!-- 客服热线 -->
<l-arc-popup show="{{hotline}}" arc-radius="30"> <l-arc-popup show="{{hotline}}" arc-radius="30">
......
const App = getApp() let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({ Page({
data: { data: {
isLoading: false, isLoading: false,
isFinished: false,
option: {}, option: {},
isDoing: false, isDoing: false,
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
// 导航栏相关属性
navigationStyle: {
normal: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(255, 255, 255, 1)'
},
scroll: '100rpx',
},
navigationScroll: 0,
navItem: [{ tabItem: [{
content: '主题活动', content: '主题活动',
type: '0' type: '0'
}, },
...@@ -47,24 +26,24 @@ Page({ ...@@ -47,24 +26,24 @@ Page({
activityList: [], activityList: [],
data: [], data: [],
active: 0, active: 0,
height: 0,
}, },
onLoad: function (options) { onLoad: function (options) {
let type = options.tab ? 1 * options.tab : 0 let type = options.tab ? 1 * options.tab : 0
this.setData({ this.setData({
option: options, option: options,
height: wx.getSystemInfoSync().windowHeight, //获取屏幕的高度
active: type active: type
}) })
type === 0 ? this.getActivity() : this.getList(type)
}, },
onShow: function () { onShow: function () {
let funcIsRefresh = wx.getStorageSync('option-appointment')
if (funcIsRefresh === 'refresh') {
this.setData({ this.setData({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
data: [], data: [],
isFinished: false,
activityList: [], activityList: [],
}) })
...@@ -74,6 +53,7 @@ Page({ ...@@ -74,6 +53,7 @@ Page({
} else { } else {
this.getList(type) this.getList(type)
} }
}
}, },
// 去使用 // 去使用
...@@ -96,19 +76,19 @@ Page({ ...@@ -96,19 +76,19 @@ Page({
// 跳转详情页面 // 跳转详情页面
onOrderDetail: function (event) { onOrderDetail: function (event) {
console.log('onOrderDetail')
let funcItem = event.currentTarget.dataset.item let funcItem = event.currentTarget.dataset.item
wx.navigateTo({ wx.navigateTo({
url: '/pages/mine/appointment-detail/appointment-detail?id=' + funcItem.orderId + '&activityId=' + funcItem.enrollId, url: '/pages/mine/appointment-detail/appointment-detail?id=' + funcItem.orderId + '&activityId=' + funcItem.enrollId,
}) })
}, },
// 点击导航切换,默认是全部的 // 点击导航切换,默认是全部的
chageNav(e) { onSelectionTab: function (event) {
let index = e.currentTarget.dataset.index let index = event.currentTarget.dataset.index
if (index === 0) { if (index === 0) {
this.setData({ this.setData({
pageNo: 1, pageNo: 1,
activityList: [], activityList: [],
isFinished: false
}) })
this.getActivity() this.getActivity()
} else { } else {
...@@ -175,36 +155,23 @@ Page({ ...@@ -175,36 +155,23 @@ Page({
}) })
}, },
// 页面滚动
onPageScroll: function (funcEvent) {
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 10)
},
// 删除,取消预约 // 删除,取消预约
doCancel: function (event) { doCancel: function (event) {
let that = this console.log('doCancel')
let type = event.currentTarget.dataset.type let type = event.currentTarget.dataset.type
wx.lin.showDialog({
type: "confirm",
title: "",
content: type == 0 ? "是否确认取消报名" : "是否确认删除报名",
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
wx.showLoading({ App.ui.showDialog({
title: '处理中', type: 'confirm',
mask: true title: type == 0 ? '是否确认取消报名' : '是否确认删除报名',
content: type == 0 ? '取消后无法恢复' : '删除后无法恢复',
cancel: type == 0 ? '暂不取消' : '取消',
confirm: type == 0 ? '确定取消' : '确定',
success: () => {
App.ui.showToast({
'iconType': 'loading',
'title': '处理中',
'duration': 60000,
}) })
this.setData({ this.setData({
isDoing: true isDoing: true
...@@ -217,46 +184,41 @@ Page({ ...@@ -217,46 +184,41 @@ Page({
'type': type, //0取消1删除 'type': type, //0取消1删除
}, },
success: (response) => { success: (response) => {
wx.hideLoading() App.ui.hideToast()
if (response.data && response.data.code == 500) { if (response.data && response.data.code == 500) {
wx.lin.showToast({ App.ui.showToast({
image: '/image/error.png', 'iconType': 'error',
title: response.data.msg, 'title': response.data.msg,
}) })
} else { } else {
App.ui.showToast({
'iconType': 'success',
wx.lin.showToast({ 'title': type == 0 ? '取消成功' : '删除成功',
image: '/image/success.png',
title: type == 0 ? '取消成功' : '删除成功',
}) })
setTimeout(() => { setTimeout(() => {
that.setData({ this.setData({
isDoing: false, 'isDoing': false,
'activityList': [], 'activityList': [],
'pageNo': 1, 'pageNo': 1,
isFinished: false
}) })
that.getActivity() this.getActivity()
}, 2000); }, 2000);
} }
} }
}) })
} else if (res.cancel) { },
console.log('用户点击取消') fail: () => {},
}
}
}) })
}, },
// 我的活动 // 我的活动
getActivity: function () { getActivity: function () {
if (this.data.isFinished) return wx.setStorageSync('option-appointment', '')
wx.showLoading({
title: '加载中', App.ui.showToast({
mask: true 'iconType': 'loading',
'title': '加载中',
'duration': 60000,
}) })
this.setData({ this.setData({
isLoading: true isLoading: true
...@@ -273,15 +235,8 @@ Page({ ...@@ -273,15 +235,8 @@ Page({
this.setData({ this.setData({
isLoading: false isLoading: false
}) })
wx.hideLoading({ App.ui.hideToast()
success: (res) => {},
})
let funcData = res.data.list let funcData = res.data.list
if (funcData.length < this.data.pageSize) {
this.setData({
isFinished: true
})
}
let tmpArr = [] let tmpArr = []
funcData.forEach(item => { funcData.forEach(item => {
let obj = { let obj = {
...@@ -307,7 +262,9 @@ Page({ ...@@ -307,7 +262,9 @@ Page({
}) })
}, },
// 预约列表/我的预约 // 预约列表/我的预约
getList(index) { getList: function (index) {
wx.setStorageSync('option-appointment', '')
index = index - 1 index = index - 1
let type = '' let type = ''
switch (index) { switch (index) {
...@@ -318,11 +275,13 @@ Page({ ...@@ -318,11 +275,13 @@ Page({
type = 1; type = 1;
break; break;
} }
let that = this
wx.showLoading({ App.ui.showToast({
title: '加载中', 'iconType': 'loading',
mask: true 'title': '处理中',
'duration': 60000,
}) })
this.setData({ this.setData({
isLoading: true isLoading: true
}) })
...@@ -333,9 +292,7 @@ Page({ ...@@ -333,9 +292,7 @@ Page({
type: type //0 入园预约 1 看房预约 全部 空字符 type: type //0 入园预约 1 看房预约 全部 空字符
}, },
success: (res) => { success: (res) => {
wx.hideLoading({ App.ui.hideToast()
success: (res) => {},
})
let tmpArr = [] let tmpArr = []
res.data.forEach(item => { res.data.forEach(item => {
let type = item.type * 1 let type = item.type * 1
...@@ -364,7 +321,7 @@ Page({ ...@@ -364,7 +321,7 @@ Page({
} }
tmpArr.push(obj) tmpArr.push(obj)
}) })
that.setData({ this.setData({
data: tmpArr, data: tmpArr,
isLoading: false isLoading: false
}) })
......
<!--pages/myAppointment/myAppointment.wxml--> <m-toast></m-toast>
<navigation class="navigation" titleText="我的预约" backIcon="/image/back.png" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}" bind:navBack="onNavBack"></navigation> <m-dialog></m-dialog>
<m-nav titleText="我的预约" styleIndex="{{1}}" bind:navBack="onNavBack"></m-nav>
<view class="tab row cb">
<block wx:for="{{tabItem}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="tab-item {{index == active? 'active':''}}" data-index="{{index}}" bindtap="onSelectionTab">{{item.content}}</view>
</block>
</view>
<view class="container all"> <view class="container all">
<view class="myActivity-container" style="min-height:{{height}}px;"> <view class="myActivity-container">
<view class="myAppointment-nav">
<!-- 遍历头部导航 -->
<view bindtap="chageNav" data-index="{{index}}" wx:for="{{navItem}}" wx:key="index" class="navItem {{index == active? 'active':''}}">{{item.content}}</view>
</view>
<!-- 主题活动 --> <!-- 主题活动 -->
<view class="myAppointment-body" wx:if="{{activityList.length > 0 && active === 0}}"> <view class="myAppointment-body" wx:if="{{activityList.length > 0 && active === 0}}">
<block wx:for="{{activityList}}" wx:for-item="activity" wx:for-index="indexActivity" wx:key="index"> <block wx:for="{{activityList}}" wx:for-item="activity" wx:for-index="indexActivity" wx:key="index">
...@@ -37,8 +41,7 @@ ...@@ -37,8 +41,7 @@
<text>{{activity.amount}}</text> <text>{{activity.amount}}</text>
</view> </view>
<view class="appointment-activity-btn row"> <view class="appointment-activity-btn row">
<view catchtap="doCancel" data-item="{{activity}}" data-type='0' class="cancel-btn">取消报名 <view catchtap="doCancel" data-item="{{activity}}" data-type='0' class="cancel-btn">取消报名</view>
</view>
<view catchtap="onOrderPay" data-item="{{activity}}" class="confirm-btn">去支付</view> <view catchtap="onOrderPay" data-item="{{activity}}" class="confirm-btn">去支付</view>
</view> </view>
</view> </view>
...@@ -169,8 +172,7 @@ ...@@ -169,8 +172,7 @@
<text>{{activity.amount}}</text> <text>{{activity.amount}}</text>
</view> </view>
<view class="appointment-activity-btn row"> <view class="appointment-activity-btn row">
<view style="position:relative;z-index:8" data-item="{{activity}}" data-type='1' catchtap="doCancel" class="cancel-btn ">删除报名 <view data-item="{{activity}}" data-type='1' catchtap="doCancel" class="cancel-btn">删除报名</view>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -238,10 +240,6 @@ ...@@ -238,10 +240,6 @@
<view class="noActive-botton" data-index="0" bindtap="goAppoint">去预约</view> <view class="noActive-botton" data-index="0" bindtap="goAppoint">去预约</view>
</view> </view>
</view> </view>
<!-- 确认框 -->
<l-dialog />
<l-toast l-image-class="toast-image"></l-toast>
<wxs module="m1"> <wxs module="m1">
var getDate = function(date, type) { var getDate = function(date, type) {
......
/* pages/myAppointment/myAppointment.wxss */ .tab {
z-index: 2;
.myAppointment-nav {
width: 750rpx; width: 750rpx;
padding-top: 150rpx; padding: 0 72rpx;
/* height: 95rpx; */ border-bottom: 1px solid #E2E7EF;
border-bottom: 0.5px solid rgb(238, 238, 238); background: linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251));
background: -webkit-linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251)); /* Safari 5.1 - 6.0 */ }
background: -o-linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251)); /* Opera 11.1 - 12.0 */
background: -moz-linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251)); /* Firefox 3.6 - 15 */ .tab-item {
background: linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251)); /* 标准的语法(必须放在最后) */ height: 96rpx;
display: flex; font-size: 26rpx;
justify-content: space-around; font-weight: 400;
line-height: 96rpx;
color: #959DA9;
} }
.all { .all {
background-color: rgba(243, 244, 246, 1); background-color: rgba(243, 244, 246, 1);
} }
.navItem { .container {
font-size: 26rpx; min-height: 100vh;
line-height: 95rpx;
color: rgb(156, 158, 163);
} }
.active { .active {
...@@ -233,6 +232,7 @@ ...@@ -233,6 +232,7 @@
font-weight: 600; font-weight: 600;
} }
.cancel-btn { .cancel-btn {
z-index: 4;
width: 120rpx; width: 120rpx;
height: 56rpx; height: 56rpx;
color: #656E7B; color: #656E7B;
...@@ -243,19 +243,13 @@ ...@@ -243,19 +243,13 @@
border-radius: 4rpx; border-radius: 4rpx;
border: 0.5px solid #C2C7CF; border: 0.5px solid #C2C7CF;
} }
.cancel-overtime {
position: absolute;
z-index: 11;
right: 32rpx;
bottom: 40rpx;
}
.cancel { .cancel {
position: absolute; position: absolute;
z-index: 11;
right: 172rpx; right: 172rpx;
bottom: 40rpx; bottom: 40rpx;
} }
.confirm-btn { .confirm-btn {
z-index: 4;
width: 120rpx; width: 120rpx;
height: 56rpx; height: 56rpx;
margin-left: 20rpx; margin-left: 20rpx;
...@@ -269,13 +263,12 @@ ...@@ -269,13 +263,12 @@
} }
.confirm-once { .confirm-once {
position: absolute; position: absolute;
z-index: 11;
right: 32rpx; right: 32rpx;
bottom: 40rpx; bottom: 40rpx;
} }
.mask-cancel { .mask-cancel {
position: absolute; position: absolute;
z-index: 1; z-index: 3;
left: 0; left: 0;
bottom: 0; bottom: 0;
width: 670rpx; width: 670rpx;
......
const App = getApp() let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({ Page({
data: { data: {
...@@ -17,38 +12,16 @@ Page({ ...@@ -17,38 +12,16 @@ Page({
imageResourcesBase: App.globalData.appResourcesBase, imageResourcesBase: App.globalData.appResourcesBase,
passList: [], passList: [],
paddingTop: 0,
marginTop: 0, marginTop: 0,
noticeDetail: '', noticeDetail: '',
winNoticeDetail: false, winNoticeDetail: false,
// 导航栏相关属性
navigationStyle: {
normal: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(255, 255, 255, 1)'
},
scroll: '100rpx',
},
navigationScroll: 0,
}, },
onLoad: function (options) { onLoad: function (options) {
this.animation = wx.createAnimation({ this.animation = wx.createAnimation({
duration: 700, duration: 700,
timingFunction: 'ease' timingFunction: 'ease'
}) })
let paddingTop = 28
paddingTop += wx.getStorageSync('navigationStatusHeight') + wx.getStorageSync('navigationCapsuleHeight')
this.setData({
paddingTop
})
this.getCardList() this.getCardList()
}, },
// 跳转订单详情 // 跳转订单详情
...@@ -60,23 +33,19 @@ Page({ ...@@ -60,23 +33,19 @@ Page({
}, },
// 多二维码 复制券码 // 多二维码 复制券码
setClipboard(e) { setClipboard: function (event) {
const code = e.currentTarget.dataset.code const code = event.currentTarget.dataset.code
wx.setClipboardData({ wx.setClipboardData({
data: code, data: code,
success(res) {
wx.showToast({
title: '复制成功',
})
}
}) })
}, },
//获取卡数据 //获取卡数据
getCardList: function () { getCardList: function () {
let that = this App.ui.showToast({
wx.showLoading({ 'iconType': 'loading',
title: '加载中', 'title': '加载中',
'duration': 60000
}) })
App.wxRequest({ App.wxRequest({
url: '/api/v1/volume/getVolumeList', url: '/api/v1/volume/getVolumeList',
...@@ -85,12 +54,10 @@ Page({ ...@@ -85,12 +54,10 @@ Page({
pageNo: 1, pageNo: 1,
pageSize: -1 pageSize: -1
}, },
success: function (res) { success: (res) => {
wx.hideLoading({ App.ui.hideToast()
success: (res) => {},
})
let list = res.data.map(item => { let list = res.data.map(item => {
let shopFilter = that.data.shopConfig.filter(k => { let shopFilter = this.data.shopConfig.filter(k => {
return k.name.toLowerCase() == item.officeName.toLowerCase() return k.name.toLowerCase() == item.officeName.toLowerCase()
}) })
item.expireTime = item.expireTime.replace(/-/g, '.') item.expireTime = item.expireTime.replace(/-/g, '.')
...@@ -123,12 +90,10 @@ Page({ ...@@ -123,12 +90,10 @@ Page({
}) })
let marginTop = filterList.length === 0 ? 84 : 12 let marginTop = filterList.length === 0 ? 84 : 12
that.setData({ this.setData({
passList: filterList, passList: filterList,
marginTop marginTop
}) })
} }
}) })
}, },
...@@ -268,20 +233,14 @@ Page({ ...@@ -268,20 +233,14 @@ Page({
winNoticeDetail: false winNoticeDetail: false
}) })
}, },
// 滚动屏幕
onPageScroll: function (funcEvent) {
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件 /**
logicData.pageScrollTimer = setTimeout(function () { * 页面滚动事件
logicData.pageScrollLock = false * @function
clearTimeout(logicData.pageScrollTimer) * @param {object} - funcEvent
}, 10) * @returns
*/
onPageScroll: function (funcEvent) {
App.pageScroll(funcEvent, this)
}, },
}) })
\ No newline at end of file
<navigation class="navigation" titleText="我的年卡/月卡" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation> <m-toast></m-toast>
<m-nav titleText="我的年卡/月卡" scrollHeight="{{navScroll}}"></m-nav>
<view class="container con-s" style="padding-top: {{paddingTop + 'px'}}"> <view class="container con-s" style="padding-top: {{paddingTop + 'px'}}">
<!-- 单张卡 --> <!-- 单张卡 -->
......
.container { .container {
position: relative; position: relative;
min-height: 100vh; min-height: 100vh;
margin-top: 60rpx;
background: linear-gradient(180deg, #fffcfc 0%, #f6dada 100%); background: linear-gradient(180deg, #fffcfc 0%, #f6dada 100%);
} }
......
const App = getApp() let App = getApp()
Page({ Page({
scrollLock: false,
scrollTimer: 0,
data: { data: {
// 导航栏相关属性
navigationStyle: {},
navigationScroll: 0,
appStatus: App.globalData.appStatus, appStatus: App.globalData.appStatus,
isCheckPermission: false, isCheckPermission: false,
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
...@@ -67,10 +59,6 @@ Page({ ...@@ -67,10 +59,6 @@ Page({
isLoadingOrder: true, isLoadingOrder: true,
}, },
onLoad: function (options) {
},
onShow: function () { onShow: function () {
this.setData({ this.setData({
showMoreOrder: false, showMoreOrder: false,
...@@ -79,7 +67,6 @@ Page({ ...@@ -79,7 +67,6 @@ Page({
this.setData({ appStatus: App.globalData.appStatus }) this.setData({ appStatus: App.globalData.appStatus })
this.setUserInfo() this.setUserInfo()
this.setNavigation()
}, },
// 去活动预约列表 // 去活动预约列表
...@@ -134,7 +121,6 @@ Page({ ...@@ -134,7 +121,6 @@ Page({
permission: 'sys:role:distinguish' permission: 'sys:role:distinguish'
}, },
success: function (res) { success: function (res) {
console.log(res, '核销');
let data = res.data let data = res.data
let isPer = false let isPer = false
let authInfo = { let authInfo = {
...@@ -148,9 +134,6 @@ Page({ ...@@ -148,9 +134,6 @@ Page({
// 无核销权限 // 无核销权限
isPer = false isPer = false
} }
that.setData({ that.setData({
isCheckPermission: isPer, isCheckPermission: isPer,
authInfo: authInfo authInfo: authInfo
...@@ -282,7 +265,6 @@ Page({ ...@@ -282,7 +265,6 @@ Page({
pageSize: -1 pageSize: -1
}, },
success: function (res) { success: function (res) {
console.log(res, '获取分类统计');
let data = res.data ? res.data : {} let data = res.data ? res.data : {}
that.setData({ that.setData({
goodTypeCountData: data goodTypeCountData: data
...@@ -297,7 +279,6 @@ Page({ ...@@ -297,7 +279,6 @@ Page({
url: '/api/v1/activity/getCountEnrollSubscribe', url: '/api/v1/activity/getCountEnrollSubscribe',
data: {}, data: {},
success: function (res) { success: function (res) {
console.log(res, '获取分类统计');
let data = res.data ? res.data : {} let data = res.data ? res.data : {}
that.setData({ that.setData({
enrollSubscribeData: data enrollSubscribeData: data
...@@ -357,26 +338,6 @@ Page({ ...@@ -357,26 +338,6 @@ Page({
} }
}, },
setNavigation: function () {
let funcUserInfo = wx.getStorageSync('userInfo')
let funcNavigation = {
normal: {
backIcon: '',
color: funcUserInfo.userType === 0 ? '#000000' : '#FFFFFF',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '',
color: '#000000',
background: 'rgba(255, 255, 255, 1)'
},
scroll: '200rpx',
}
this.setData({
navigationStyle: funcNavigation
})
},
// 登录注册页 // 登录注册页
checkRegister() { checkRegister() {
if (this.data.isRegister) { if (this.data.isRegister) {
...@@ -610,19 +571,13 @@ Page({ ...@@ -610,19 +571,13 @@ Page({
}, },
onPageScroll: function (event) { /**
// 优化滚动事件触发频率 * 页面滚动事件
if (this.scrollLock) return * @function
this.scrollLock = true * @param {object} - funcEvent
* @returns
this.setData({ */
navigationScroll: event.scrollTop onPageScroll: function (funcEvent) {
}) App.pageScroll(funcEvent, this)
// 恢复滚动事件
this.scrollTimer = setTimeout(() => {
this.scrollLock = false
clearTimeout(this.scrollTimer)
}, 10)
}, },
}) })
\ No newline at end of file
<navigation class="navigation" titleText="我的" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation> <m-nav wx:if="userInfo.userType === 0" titleText="我的" scrollHeight="{{navScroll}}" styleIndex="{{0}}" isOccupy="{{false}}" iconBack=""></m-nav>
<m-nav wx:if="userInfo.userType === 1" titleText="我的" scrollHeight="{{navScroll}}" styleIndex="{{2}}" isOccupy="{{false}}" iconBack=""></m-nav>
<view class="container con-s"> <view class="container con-s">
<view class="mine" wx:if="{{type !== 1}}"> <view class="mine" wx:if="{{type !== 1}}">
...@@ -67,7 +68,6 @@ ...@@ -67,7 +68,6 @@
</view> </view>
</view> </view>
<view class="status row con-b align-c" wx:if="{{type !== 1}}"> <view class="status row con-b align-c" wx:if="{{type !== 1}}">
<view class="status-symbol col"> <view class="status-symbol col">
<text>业主认证</text> <text>业主认证</text>
...@@ -261,45 +261,6 @@ ...@@ -261,45 +261,6 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 夜间入园预约 -->
<!-- <view class="appointment-wrapper">
<view class="appointment-time">
<text>7月15日 10:00-12:00</text>
</view>
<view class="appointment-activity-content row align-c con-b">
<view class="appointment-content col con-b">
<view class="appointment-activity-title">
<text>夜间入园预约</text>
</view>
<view class="appointment-activity-num">
<text>预约人数 3人</text>
</view>
</view>
<view class="border-right"></view>
<view class="appointment-subscribe" data-item="{{item}}" bindtap="gohotelAccommodation">预约凭证
</view>
</view>
</view> -->
<!-- 看房预约 -->
<!-- <view class="appointment-wrapper">
<view class="appointment-time">
<text>7月15日 10:00-12:00</text>
</view>
<view class="appointment-activity-content row align-c con-b">
<view class="appointment-content col con-c">
<view class="appointment-activity-title">
<text>看房预约</text>
</view>
</view>
<view class="border-right"></view>
<view class="appointment-subscribe" data-item="{{item}}" bindtap="gohotelAccommodation">预约凭证
</view>
</view>
</view> -->
</view> </view>
<!-- more --> <!-- more -->
<view class="more row align-c con-c" bindtap="onShowMoreActivity" wx:if="{{activityListBackup.length>2}}"> <view class="more row align-c con-c" bindtap="onShowMoreActivity" wx:if="{{activityListBackup.length>2}}">
......
...@@ -3,12 +3,8 @@ ...@@ -3,12 +3,8 @@
background: #f3f4f6; background: #f3f4f6;
} }
.navigation {
z-index: 1900;
}
.background-image { .background-image {
z-index: 1; z-index: 0;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
...@@ -51,7 +47,7 @@ ...@@ -51,7 +47,7 @@
} }
.mine-avatar { .mine-avatar {
z-index: 11; z-index: 1;
margin-right: 32rpx; margin-right: 32rpx;
width: 136rpx; width: 136rpx;
height: 136rpx; height: 136rpx;
...@@ -72,11 +68,11 @@ ...@@ -72,11 +68,11 @@
} }
.mine-info { .mine-info {
z-index: 1;
padding-top: 12rpx; padding-top: 12rpx;
} }
.mine-info view:nth-child(1) text { .mine-info view:nth-child(1) text {
z-index: 11;
max-width: 260rpx; max-width: 260rpx;
margin-right: 20rpx; margin-right: 20rpx;
font-size: 42rpx; font-size: 42rpx;
...@@ -127,24 +123,21 @@ ...@@ -127,24 +123,21 @@
} }
.mine-info view:nth-child(1) image { .mine-info view:nth-child(1) image {
z-index: 11;
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
} }
.mine-info view:nth-child(2) { .mine-info view:nth-child(2) {
z-index: 11;
margin-top: 0rpx; margin-top: 0rpx;
} }
.mine-info view:nth-child(2) text { .mine-info view:nth-child(2) text {
z-index: 11;
font-size: 26rpx; font-size: 26rpx;
color: #959da9; color: #959da9;
} }
.coupon { .coupon {
z-index: 9; z-index: 7;
width: 670rpx; width: 670rpx;
height: 176rpx; height: 176rpx;
padding: 41rpx 32rpx; padding: 41rpx 32rpx;
...@@ -175,7 +168,7 @@ ...@@ -175,7 +168,7 @@
} }
.status { .status {
z-index: 9; z-index: 7;
width: 670rpx; width: 670rpx;
height: 130rpx; height: 130rpx;
margin-top: 48rpx; margin-top: 48rpx;
...@@ -262,62 +255,6 @@ ...@@ -262,62 +255,6 @@
position: relative; position: relative;
} }
.my-activities-item:last-child {
width: 40rpx !important;
background-color: white;
}
.my-activities-top {
position: absolute;
top: 0;
/* width: 350rpx; */
height: 60rpx;
background-color: rgb(2, 0, 2);
color: white;
line-height: 60rpx;
z-index: 2;
border-radius: 3px;
text-align: center;
font-size: 30rpx;
}
.my-activities-bottom {
width: 100%;
height: 220rpx;
position: absolute;
bottom: 0;
background-color: rgb(239, 242, 250);
border-radius: 3px;
}
.my-activities-bottom-view {
display: flex;
flex-direction: column;
justify-content: center;
height: 110rpx;
margin-top: 70rpx;
}
.my-activities-title {
padding-left: 50rpx;
line-height: 2;
font-size: 30rpx;
font-weight: 500;
color: rgba(21, 25, 31, 1);
}
.my-activities-content {
font-size: 26rpx;
font-weight: 400;
color: rgba(101, 110, 123, 1);
padding-left: 50rpx;
line-height: 2;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
}
.subscribe { .subscribe {
width: 150rpx; width: 150rpx;
height: 70rpx; height: 70rpx;
...@@ -333,32 +270,6 @@ ...@@ -333,32 +270,6 @@
color: #15191f; color: #15191f;
} }
.fontImg {
width: 120rpx;
height: 30rpx;
}
.approve-icon {
width: 168rpx;
height: 103rpx;
}
.rule {
width: 148rpx;
height: 64rpx;
background: linear-gradient(180deg, rgba(252, 239, 224, 1) 0%, rgba(196, 174, 151, 1) 100%);
font-size: 26rpx;
line-height: 54rpx;
color: rgba(24, 26, 35, 1);
text-align: center;
margin-left: -60rpx;
z-index: -1;
border-radius: 4rpx;
border: 1px solid;
border-image: linear-gradient(180deg, rgba(255, 237, 215, 1), rgba(113, 95, 76, 1)) 2 2;
margin-top: 10rpx;
}
.mask-content { .mask-content {
width: 606rpx; width: 606rpx;
height: 974rpx; height: 974rpx;
...@@ -419,11 +330,6 @@ ...@@ -419,11 +330,6 @@
border-radius: 4rpx; border-radius: 4rpx;
} }
/* .order-activity image {
width: 32rpx;
height: 32rpx;
} */
.order-activity-title-wrapper { .order-activity-title-wrapper {
height: 48rpx; height: 48rpx;
} }
......
...@@ -112,9 +112,9 @@ Page({ ...@@ -112,9 +112,9 @@ Page({
*/ */
doUpdateInfo: function () { doUpdateInfo: function () {
if (this.data.userInfo.name == '') { if (this.data.userInfo.name == '') {
wx.lin.showToast({ App.ui.showToast({
image: '/image/error.png', 'iconType': 'error',
title: '请填写姓名', 'title': '请填写姓名',
}) })
return return
} }
......
<l-toast l-image-class="toast-image"></l-toast> <m-toast></m-toast>
<navigation class="navigation" titleText="个人资料" backIcon="/image/back.png"></navigation> <m-nav titleText="个人资料"></m-nav>
<view class="container"> <view class="container">
<view class="myInfo"> <view class="myInfo">
......
.myInfo { .myInfo {
width: 750rpx; width: 750rpx;
margin-top: 170rpx;
padding: 0 48rpx; padding: 0 48rpx;
} }
......
...@@ -70,10 +70,6 @@ Page({ ...@@ -70,10 +70,6 @@ Page({
this.setData({ this.setData({
isLoading: true isLoading: true
}) })
wx.showLoading({
title: '加载中',
mask: true
})
App.wxRequest({ App.wxRequest({
url: '/api/v1/order/getOrderList', url: '/api/v1/order/getOrderList',
data: { data: {
...@@ -155,8 +151,6 @@ Page({ ...@@ -155,8 +151,6 @@ Page({
that.setData({ that.setData({
isLoading: false isLoading: false
}) })
} }
}) })
}, },
...@@ -331,18 +325,17 @@ Page({ ...@@ -331,18 +325,17 @@ Page({
* @returns * @returns
*/ */
onOrderCancel: function (event) { onOrderCancel: function (event) {
let that = this App.ui.showDialog({
wx.lin.showDialog({ type: 'confirm',
type: "confirm", title: '是否确认取消订单',
title: "", content: '取消后无法恢复',
content: "是否确认取消订单", cancel: '暂不取消',
success: (res) => { confirm: '确定取消',
if (res.confirm) { success: () => {
console.log('用户点击确定') App.ui.showToast({
'iconType': 'loading',
wx.showLoading({ 'title': '处理中',
title: '处理中', 'duration': 60000
mask: true
}) })
this.setData({ this.setData({
isDoing: true isDoing: true
...@@ -355,25 +348,21 @@ Page({ ...@@ -355,25 +348,21 @@ Page({
'type': 0, 'type': 0,
}, },
success: (response) => { success: (response) => {
wx.hideLoading() App.ui.showToast({
that.setData({ 'iconType': 'success',
isDoing: false 'title': '取消成功'
}) })
this.setData({
that.setData({ 'isDoing': false,
'orderList': [], 'orderList': [],
'orderPages': 1, 'orderPages': 1,
}) })
that.queryOrder() this.queryOrder()
} }
}) })
} else if (res.cancel) { },
console.log('用户点击取消') fail: () => { },
}
}
}) })
}, },
/** /**
...@@ -383,18 +372,17 @@ Page({ ...@@ -383,18 +372,17 @@ Page({
* @returns * @returns
*/ */
onOrderRemove: function (event) { onOrderRemove: function (event) {
let that = this App.ui.showDialog({
wx.lin.showDialog({ type: 'confirm',
type: "confirm", title: '是否确认删除订单?',
title: "", content: '删除后无法恢复',
content: "是否确认删除订单", cancel: '取消',
success: (res) => { confirm: '确定',
if (res.confirm) { success: () => {
console.log('用户点击确定') App.ui.showToast({
'iconType': 'loading',
wx.showLoading({ 'title': '处理中',
title: '处理中', 'duration': 60000
mask: true
}) })
this.setData({ this.setData({
isDoing: true isDoing: true
...@@ -407,22 +395,21 @@ Page({ ...@@ -407,22 +395,21 @@ Page({
'type': 1, 'type': 1,
}, },
success: (response) => { success: (response) => {
wx.hideLoading() App.ui.showToast({
that.setData({ 'iconType': 'success',
isDoing: false, 'title': '删除成功'
})
this.setData({
'isDoing': false,
'orderList': [], 'orderList': [],
'orderPages': 1, 'orderPages': 1,
}) })
that.queryOrder() this.queryOrder()
console.log(response)
} }
}) })
} else if (res.cancel) { },
console.log('用户点击取消') fail: () => {},
}
}
}) })
}, },
/** /**
* 检验数据是否都通过 * 检验数据是否都通过
......
<m-toast></m-toast>
<m-dialog></m-dialog>
<!-- 订单分类选择 --> <!-- 订单分类选择 -->
<view class="navigation-order row con-b align-c"> <view class="navigation-order row con-b align-c">
<image src="{{imageBase + 'icon/arrow-l-1.png'}}" bindtap="onNavigationBack"></image> <image src="{{imageBase + 'icon/arrow-l-1.png'}}" bindtap="onNavigationBack"></image>
...@@ -142,5 +145,3 @@ ...@@ -142,5 +145,3 @@
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file
<!-- 确认框 -->
<l-dialog />
\ No newline at end of file
...@@ -4,14 +4,14 @@ page { ...@@ -4,14 +4,14 @@ page {
} }
.fixed-tab { .fixed-tab {
z-index: 3;
position: fixed; position: fixed;
background: #fff;
top: 176rpx; top: 176rpx;
z-index: 99; background: #fff;
} }
.navigation-order { .navigation-order {
z-index: 1700; z-index: 3;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
...@@ -45,7 +45,7 @@ page { ...@@ -45,7 +45,7 @@ page {
/* 订单类型选择 */ /* 订单类型选择 */
.order-type-selection { .order-type-selection {
z-index: 1700; z-index: 4;
position: fixed; position: fixed;
top: 176rpx; top: 176rpx;
left: 0; left: 0;
...@@ -107,7 +107,7 @@ page { ...@@ -107,7 +107,7 @@ page {
font-size: 26rpx; font-size: 26rpx;
font-weight: 400; font-weight: 400;
line-height: 36rpx; line-height: 36rpx;
border-bottom: 4px #fff solid; border-bottom: 4px rgba(0, 0, 0, 0) solid;
color: #959da9; color: #959da9;
} }
......
// pages/moreProblems/moreProblems.js let App = getApp()
const app = getApp()
Page({ Page({
/** /**
...@@ -19,63 +18,12 @@ Page({ ...@@ -19,63 +18,12 @@ Page({
console.log('66'); console.log('66');
console.log(e) console.log(e)
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) { onLoad: function(options) {
this.getCommonProblem(1) this.getCommonProblem(1)
this.getCommonProblem(2) this.getCommonProblem(2)
this.getCommonProblem(3) this.getCommonProblem(3)
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
},
checkInTranform(e) { checkInTranform(e) {
let flag = !e.currentTarget.dataset.flag let flag = !e.currentTarget.dataset.flag
let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
...@@ -98,31 +46,30 @@ Page({ ...@@ -98,31 +46,30 @@ Page({
}); });
}, },
// 常见问题 // 常见问题
getCommonProblem(type) { getCommonProblem: function (type) {
let that = this App.wxRequest({
app.wxRequest({
url: '/api/v1/smCommonProblem/getList', url: '/api/v1/smCommonProblem/getList',
data: { data: {
type: type, // 1 入住 2门票 3 服务 type: type, // 1 入住 2门票 3 服务
top: '', top: '',
}, },
success: function(res) { success: (res) => {
res.data.forEach(function(item) { res.data.forEach(function(item) {
item.flag = false; item.flag = false;
}) })
switch (type) { switch (type) {
case 1: case 1:
that.setData({ this.setData({
checkInProblems: res.data checkInProblems: res.data
}) })
break; break;
case 2: case 2:
that.setData({ this.setData({
ticketsProblems: res.data ticketsProblems: res.data
}) })
break; break;
case 3: case 3:
that.setData({ this.setData({
serviceProblems: res.data serviceProblems: res.data
}) })
break; break;
......
<navigation class="navigation" titleText="常见问题" backIcon="/image/back.png"></navigation> <m-nav titleText="常见问题"></m-nav>
<view class="container"> <view class="container">
<view class="body"> <view class="body">
<block wx:if="{{checkInProblems.length > 0}}"> <block wx:if="{{checkInProblems.length > 0}}">
...@@ -27,7 +26,6 @@ ...@@ -27,7 +26,6 @@
</l-collapse> </l-collapse>
</view> </view>
</view> </view>
</block> </block>
<block wx:if="{{ticketsProblems.length > 0}}"> <block wx:if="{{ticketsProblems.length > 0}}">
...@@ -81,7 +79,5 @@ ...@@ -81,7 +79,5 @@
</view> </view>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
\ No newline at end of file
/* pages/moreProblems/moreProblems.wxss */
.body { .body {
width: 670rpx; width: 670rpx;
padding-top: 200rpx; padding-top: 60rpx;
} }
.icon { .icon {
......
const App = getApp() let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({ Page({
data: { data: {
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
...@@ -34,23 +28,16 @@ Page({ ...@@ -34,23 +28,16 @@ Page({
focus: false, focus: false,
remark: '', remark: '',
isIphoneX: '', //判断是否为iphonex isIphoneX: '', //判断是否为iphonex
// 导航栏相关属性
navigationStyle: {
normal: {
backIcon: '/image/back-w.png',
color: '#FFFFFF',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '/image/icon/arrow-l-1.png',
color: '#000000',
background: 'rgba(255, 255, 255, 1)'
}, },
scroll: '200rpx',
}, onLoad: function (options) {
navigationScroll: 0, this.getCommonProblem();
this.setData({
height: wx.getSystemInfoSync().windowHeight, //获取屏幕的高度
isIphoneX: wx.getSystemInfoSync().model.indexOf("iPhone X")
})
}, },
//获取焦点的时候 //获取焦点的时候
linfocus(e) { linfocus(e) {
this.setData({ this.setData({
...@@ -174,16 +161,6 @@ Page({ ...@@ -174,16 +161,6 @@ Page({
}); });
console.log(this.data.commonProblems); console.log(this.data.commonProblems);
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getCommonProblem();
this.setData({
height: wx.getSystemInfoSync().windowHeight, //获取屏幕的高度
isIphoneX: wx.getSystemInfoSync().model.indexOf("iPhone X")
})
},
// 提交意见反馈 // 提交意见反馈
feedbackSubmit() { feedbackSubmit() {
...@@ -191,33 +168,32 @@ Page({ ...@@ -191,33 +168,32 @@ Page({
return return
} }
let that = this let that = this
wx.lin.showToast({
icon: 'loading', App.ui.showToast({
title: '提交中', 'iconType': 'loading',
show: true, 'title': '提交中',
mask: true, 'duration': 60000
duration: 1000 * 60,
}) })
App.wxRequest({ App.wxRequest({
url: '/api/v1/smFeedback/doFeedBack', url: '/api/v1/smFeedback/doFeedBack',
data: { data: {
content: that.data.remark content: that.data.remark
}, },
success: function(res) { success: (res) => {
wx.lin.showToast({ App.ui.showToast({
image: '/image/success.png', 'iconType': 'success',
title: '提交成功', 'title': '提交成功',
}) })
that.setData({ this.setData({
inputHidden: true, inputHidden: true,
title: '客服中心', title: '客服中心',
remark: '', remark: '',
}) })
}, },
fail: function(err) { fail: (err) => {
wx.lin.showToast({ App.ui.showToast({
image: '/image/error.png', 'iconType': 'error',
title: err.msg, 'title': err.msg,
}) })
} }
}) })
...@@ -242,20 +218,4 @@ Page({ ...@@ -242,20 +218,4 @@ Page({
} }
}) })
}, },
onPageScroll: function(funcEvent) {
// console.log(funcEvent)
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function() {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 10)
},
}) })
\ No newline at end of file
<l-toast l-image-class="toast-image"></l-toast> <m-toast></m-toast>
<navigation class="navigation" titleText="{{title}}" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation> <m-nav titleText="{{title}}" styleIndex="{{2}}" isOccupy="{{false}}"></m-nav>
<view style="height:{{height}}px;background-color:white;"> <view style="height:{{height}}px;background-color:white;">
<image class="banner-img" src="http://upload.miaomiao-bao.com/70161202008161703131621.jpg"></image> <image class="banner-img" src="http://upload.miaomiao-bao.com/70161202008161703131621.jpg"></image>
<view class="customer-body"> <view class="customer-body">
......
...@@ -2,8 +2,6 @@ let App = getApp() ...@@ -2,8 +2,6 @@ let App = getApp()
Page({ Page({
data: { data: {
winToastText: '操作成功',
winToast: false,
isDoing: false, isDoing: false,
showNotice: false, showNotice: false,
swiperCurrent: 0, swiperCurrent: 0,
...@@ -27,7 +25,6 @@ Page({ ...@@ -27,7 +25,6 @@ Page({
shopConfig: App.globalData.shopId, shopConfig: App.globalData.shopId,
shopAppId: "", shopAppId: "",
marginTop: 0, marginTop: 0,
}, },
onLoad: function (options) { onLoad: function (options) {
...@@ -102,7 +99,6 @@ Page({ ...@@ -102,7 +99,6 @@ Page({
// 去支付 // 去支付
onOrderPay: function (event) { onOrderPay: function (event) {
// 数据校验不通过 // 数据校验不通过
let that = this
let wxRequest = this.data.orderInfo.wxRequest let wxRequest = this.data.orderInfo.wxRequest
// 待支付返回的wx支付参数 // 待支付返回的wx支付参数
if (wxRequest) { if (wxRequest) {
...@@ -113,7 +109,7 @@ Page({ ...@@ -113,7 +109,7 @@ Page({
signType: wxRequest.signType, signType: wxRequest.signType,
paySign: wxRequest.paySign, paySign: wxRequest.paySign,
success(res) { success(res) {
that.queryOrderDetail() this.queryOrderDetail()
}, },
fail(res) {} fail(res) {}
}) })
...@@ -129,20 +125,18 @@ Page({ ...@@ -129,20 +125,18 @@ Page({
// 删除订单&取消订单 // 删除订单&取消订单
// type :1删除0取消 // type :1删除0取消
onDelOrCancelOrder: function (event) { onDelOrCancelOrder: function (event) {
let type = event.currentTarget.dataset.type let type = event.currentTarget.dataset.type
let that = this App.ui.showDialog({
let tip = type == 1 ? '删除订单' : '取消订单' type: 'confirm',
wx.lin.showDialog({ title: type == 0 ? '是否确认取消订单' : '是否确认删除订单',
type: "confirm", content: type == 0 ? '取消后无法恢复' : '删除后无法恢复',
title: "", cancel: type == 0 ? '暂不取消' : '取消',
content: "是否确认" + tip, confirm: type == 0 ? '确定取消' : '确定',
success: (res) => { success: () => {
if (res.confirm) { App.ui.showToast({
console.log('用户点击确定') iconType: 'loading',
wx.showLoading({
title: '处理中', title: '处理中',
mask: true duration: 60000,
}) })
this.setData({ this.setData({
isDoing: true, isDoing: true,
...@@ -154,14 +148,11 @@ Page({ ...@@ -154,14 +148,11 @@ Page({
'type': type, 'type': type,
}, },
success: (response) => { success: (response) => {
wx.hideLoading() App.ui.showToast({
let winToastText = type == 1 ? '订单删除成功' : '订单取消成功' iconType: 'success',
that.setData({ title: type == 1 ? '订单删除成功' : '订单取消成功',
isDoing: false, ending: function () {
winToast: true, console.log('ending')
winToastText: winToastText
})
setTimeout(function () {
if (type == 1) { if (type == 1) {
// 删除操作 // 删除操作
wx.navigateBack({ wx.navigateBack({
...@@ -170,21 +161,20 @@ Page({ ...@@ -170,21 +161,20 @@ Page({
} else { } else {
// 取消操作 // 取消操作
let state = `orderInfo.state` let state = `orderInfo.state`
that.setData({ this.setData({
isDoing: false, isDoing: false,
[state]: -1 [state]: -1
}) })
} }
}, 2000)
} }
}) })
this.setData({
} else if (res.cancel) { isDoing: false,
console.log('用户点击取消') })
} }
})
} }
}) })
}, },
// 使用须知 // 使用须知
handleNotice() { handleNotice() {
...@@ -195,11 +185,11 @@ Page({ ...@@ -195,11 +185,11 @@ Page({
}, },
// 一键扫码 // 一键扫码
onFastScan: function (event) { onFastScan: function (event) {
wx.showLoading({ App.ui.showToast({
iconType: 'loading',
title: '加载中', title: '加载中',
duration: 60000,
}) })
App.wxRequest({ App.wxRequest({
url: '/api/v1/order/getVolumesByOrderId', url: '/api/v1/order/getVolumesByOrderId',
...@@ -207,7 +197,7 @@ Page({ ...@@ -207,7 +197,7 @@ Page({
'orderId': this.data.orderInfo.id 'orderId': this.data.orderInfo.id
}, },
success: (response) => { success: (response) => {
wx.hideLoading() App.ui.hideToast()
let list = response.data let list = response.data
this.setData({ this.setData({
showCodePopup: true, showCodePopup: true,
...@@ -236,7 +226,6 @@ Page({ ...@@ -236,7 +226,6 @@ Page({
* @returns * @returns
*/ */
queryOrderDetail: function () { queryOrderDetail: function () {
let that = this
App.wxRequest({ App.wxRequest({
url: '/api/v1/order/getOrderDetail', url: '/api/v1/order/getOrderDetail',
data: { data: {
...@@ -272,8 +261,6 @@ Page({ ...@@ -272,8 +261,6 @@ Page({
funcOrderInfo.expireTime = App.modular.miment(funcDate).format('MM月DD日 ') + funcTime[0] + ' - ' + funcTime[1] funcOrderInfo.expireTime = App.modular.miment(funcDate).format('MM月DD日 ') + funcTime[0] + ' - ' + funcTime[1]
} }
// 设置印章 // 设置印章
let shopName = funcResponse.officeName; let shopName = funcResponse.officeName;
let shopFilter = this.data.shopConfig.filter( let shopFilter = this.data.shopConfig.filter(
...@@ -308,13 +295,13 @@ Page({ ...@@ -308,13 +295,13 @@ Page({
let residueStamp = endTime - now let residueStamp = endTime - now
let residuePayTime = App.modular.miment(residueStamp).format('mm:ss') let residuePayTime = App.modular.miment(residueStamp).format('mm:ss')
if (residueStamp > 0) { if (residueStamp > 0) {
that.setData({ this.setData({
residuePayTime: residuePayTime residuePayTime: residuePayTime
}) })
} else { } else {
clearInterval(timeInter) clearInterval(timeInter)
let state = `orderInfo.state` let state = `orderInfo.state`
that.setData({ this.setData({
[state]: -1 [state]: -1
}) })
} }
...@@ -337,8 +324,10 @@ Page({ ...@@ -337,8 +324,10 @@ Page({
// 弹出单张二维码 // 弹出单张二维码
onCouponCode: function (event) { onCouponCode: function (event) {
let funcOrderInfo = event.currentTarget.dataset.item let funcOrderInfo = event.currentTarget.dataset.item
wx.showLoading({ App.ui.showToast({
iconType: 'loading',
title: '加载中', title: '加载中',
duration: 60000,
}) })
App.wxRequest({ App.wxRequest({
url: '/api/v1/volume/getVolume', url: '/api/v1/volume/getVolume',
...@@ -346,9 +335,7 @@ Page({ ...@@ -346,9 +335,7 @@ Page({
'volumeId': funcOrderInfo.codeId 'volumeId': funcOrderInfo.codeId
}, },
success: (response) => { success: (response) => {
wx.hideLoading({ App.ui.hideToast()
success: (res) => {},
})
let funcResponse = response.data let funcResponse = response.data
let funcCodeInfo = { let funcCodeInfo = {
'codeNo': funcResponse.serialNumber, 'codeNo': funcResponse.serialNumber,
...@@ -363,21 +350,10 @@ Page({ ...@@ -363,21 +350,10 @@ Page({
}) })
}, },
// 多二维码 复制券码 // 多二维码 复制券码
setClipboard(e) { setClipboard: function (event) {
const code = e.currentTarget.dataset.code const code = event.currentTarget.dataset.code
wx.setClipboardData({ wx.setClipboardData({
data: code, data: code,
success(res) {
wx.showToast({
title: '复制成功',
})
// wx.getClipboardData({
// success(res) {
// console.log(res.data) // data
// }
// })
}
}) })
}, },
// 单个二维码 复制券码 // 单个二维码 复制券码
......
<navigation class="navigation" titleText="订单详情" color="#000000" background="#FFFFFF" backIcon="/image/back.png" bind:navBack="navBack"></navigation> <m-toast></m-toast>
<m-dialog></m-dialog>
<view class="container padding-bottom-166" style="margin-top: {{marginTop + 'px'}}"> <m-nav titleText="订单详情"></m-nav>
<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}}">
...@@ -363,8 +364,3 @@ ...@@ -363,8 +364,3 @@
</scroll-view> </scroll-view>
</view> </view>
</l-popup> </l-popup>
\ No newline at end of file
<!-- 成功提示 -->
<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
/* 订单状态 */
.state { .state {
width: 750rpx; width: 750rpx;
} }
.container { .container {
/* margin-top: 160rpx; */ margin-top: 60rpx;
} }
.state-content { .state-content {
...@@ -839,10 +837,6 @@ ...@@ -839,10 +837,6 @@
line-height: 42rpx; line-height: 42rpx;
} }
.padding-bottom-166 {
padding-bottom: 166rpx;
}
.footer-btn { .footer-btn {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
......
...@@ -961,10 +961,10 @@ Page({ ...@@ -961,10 +961,10 @@ Page({
success: (response) => { success: (response) => {
if (/ 商品不存在/.test(response.data.msg)) { if (/ 商品不存在/.test(response.data.msg)) {
wx.setStorageSync('shoppingCartBuffer', []) wx.setStorageSync('shoppingCartBuffer', [])
wx.lin.showToast({ App.ui.showToast({
iconType: 'error',
title: '商品已下架,请重新下单。', title: '商品已下架,请重新下单。',
icon: 'error', ending: () => {
success: () => {
wx.navigateBack({ wx.navigateBack({
delta: 2 delta: 2
}) })
...@@ -975,10 +975,10 @@ Page({ ...@@ -975,10 +975,10 @@ Page({
if (/价格不一致/.test(response.data.msg)) { if (/价格不一致/.test(response.data.msg)) {
wx.setStorageSync('shoppingCartBuffer', []) wx.setStorageSync('shoppingCartBuffer', [])
wx.lin.showToast({ App.ui.showToast({
iconType: 'error',
title: '价格已变更,请重新下单。', title: '价格已变更,请重新下单。',
icon: 'error', ending: () => {
success: () => {
wx.navigateBack({ wx.navigateBack({
delta: 2 delta: 2
}) })
...@@ -988,9 +988,9 @@ Page({ ...@@ -988,9 +988,9 @@ Page({
} }
if (/订单未支付/.test(response.data.msg)) { if (/订单未支付/.test(response.data.msg)) {
wx.lin.showToast({ App.ui.showToast({
iconType: 'error',
title: response.data.msg, title: response.data.msg,
icon: 'error',
}) })
this.setData({ this.setData({
isPaySubmit: false, isPaySubmit: false,
...@@ -1081,9 +1081,9 @@ Page({ ...@@ -1081,9 +1081,9 @@ Page({
}, },
success: (response) => { success: (response) => {
if (/请勿重复报名/.test(response.data.msg)) { if (/请勿重复报名/.test(response.data.msg)) {
wx.lin.showToast({ App.ui.showToast({
iconType: 'error',
title: response.data.msg, title: response.data.msg,
icon: 'error',
}) })
this.setData({ this.setData({
isPaySubmit: false, isPaySubmit: false,
...@@ -1092,9 +1092,9 @@ Page({ ...@@ -1092,9 +1092,9 @@ Page({
} }
if (/名额不足/.test(response.data.msg)) { if (/名额不足/.test(response.data.msg)) {
wx.lin.showToast({ App.ui.showToast({
iconType: 'error',
title: response.data.msg, title: response.data.msg,
icon: 'error',
}) })
this.setData({ this.setData({
isPaySubmit: false, isPaySubmit: false,
...@@ -1103,9 +1103,9 @@ Page({ ...@@ -1103,9 +1103,9 @@ Page({
} }
if (/总价格不能为空/.test(response.data.msg)) { if (/总价格不能为空/.test(response.data.msg)) {
wx.lin.showToast({ App.ui.showToast({
iconType: 'error',
title: response.data.msg, title: response.data.msg,
icon: 'error',
}) })
this.setData({ this.setData({
isPaySubmit: false, isPaySubmit: false,
...@@ -1114,9 +1114,9 @@ Page({ ...@@ -1114,9 +1114,9 @@ Page({
} }
if (/价格不一致/.test(response.data.msg)) { if (/价格不一致/.test(response.data.msg)) {
wx.lin.showToast({ App.ui.showToast({
iconType: 'error',
title: response.data.msg, title: response.data.msg,
icon: 'error',
}) })
return return
} }
...@@ -1173,7 +1173,6 @@ Page({ ...@@ -1173,7 +1173,6 @@ Page({
App.globalData.payStateTimer = setInterval(() => { App.globalData.payStateTimer = setInterval(() => {
if (!pagePayId) return if (!pagePayId) return
App.wxRequest({ App.wxRequest({
url: '/api/v1/order/getOrderStatus', url: '/api/v1/order/getOrderStatus',
data: { data: {
......
<l-toast></l-toast> <m-toast></m-toast>
<view class="container"> <view class="container">
<!-- winBuyContent --> <!-- winBuyContent -->
<view class="buy-content" wx:if="{{winBuyContent}}"> <view class="buy-content" wx:if="{{winBuyContent}}">
...@@ -244,7 +243,7 @@ ...@@ -244,7 +243,7 @@
<view class="contact" wx:if="{{winContact && !winNoticeDetail && !winStockTip}}"> <view class="contact" wx:if="{{winContact && !winNoticeDetail && !winStockTip}}">
<view class="contact-title col"> <view class="contact-title col">
<text>{{contactTitle}}</text> <text>{{contactTitle}}</text>
<text hidden>仅用于接收订单确认短信</text> <text>仅用于接收订单确认短信</text>
</view> </view>
<view class="contact-input col"> <view class="contact-input col">
<text class="contact-input-mark">姓名</text> <text class="contact-input-mark">姓名</text>
......
...@@ -16,4 +16,24 @@ ...@@ -16,4 +16,24 @@
* *
* js - 列表相关 * js - 列表相关
* 循环一定添加 key index * 循环一定添加 key index
*
* 页面代码结构:
* let App = getApp()
* Page({
* data: {},
* onLoad: function () {},
* 生命周期函数
*
* queryXX: function () {},
* 数据查询函数
*
* onXX: function () {},
* 交互事件函数,点击按钮,触发窗口等等
*
* XX: function () {},
* 其他自定义函数
*
* eventXX: function () {},
* 逻辑事件函数,所有不是用户触发的事件,比如 swiper 组件 bindchange 事件
* })
*/ */
\ No newline at end of file
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
.container { .container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center;
align-items: center; align-items: center;
} }
......
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