Commit d7a67b44 by 严立

LL - 组件更新

parent 1f1dc1ea
Showing with 653 additions and 3222 deletions
......@@ -16,7 +16,6 @@ App({
globalData: {
appStatus: false,
test:'999',
appImageBase: '../../../image/',
appResourcesBase: 'https://sm-web.meiqicloud.com/userfiles/appResourcesS2/',
shopId: iEnvironmental.shopId,
......@@ -426,5 +425,7 @@ App({
funcPage.setData({
navScroll: funcEvent.scrollTop
})
if (funcPage.eventPageScroll) funcPage.eventPageScroll(funcEvent)
},
})
\ No newline at end of file
......@@ -24,9 +24,7 @@
"pages/commodity/shopping-cart/shopping-cart",
"pages/commodity/project/project",
"pages/commodity/project-detail/project-detail",
"pages/commodity/menu-art/menu-art",
"pages/commodity/menu-food/menu-food",
"pages/commodity/menu-snacks/menu-snacks",
"pages/commodity/room/room",
"pages/commodity/room-appointment/room-appointment",
......
......@@ -16,8 +16,8 @@ Component({
content: '这里是提示信息',
cancel: '取消',
confirm: '确定',
success: function () {},
fail: function () {},
success: function () { },
fail: function () { },
winDialog: false,
},
......
......@@ -14,6 +14,7 @@ function showToast (funcOption) {
// 如果传参包含 duration 数值,使用该数值。
// 删除该属性是为了不污染 toast 组件中的默认值。
console.log(App.ui.toast.data)
let funcToastDuration = App.ui.toast.data.duration
if (funcOption.duration) {
funcToastDuration = funcOption.duration
......@@ -22,12 +23,11 @@ function showToast (funcOption) {
funcOption = Object.assign(App.ui.toast.data, funcOption)
funcOption.winToast = true
console.log('showToast', funcOption)
App.ui.toast.setData(funcOption)
// 设置 toast 关闭时间
App.ui.toastTimer = setTimeout(() => {
App.ui.toast.data.ending()
App.ui.hideToast()
}, funcToastDuration)
}
......@@ -44,6 +44,7 @@ function hideToast () {
iconType: '',
title: '',
background: 'rgba(0, 0, 0, 0)',
ending: function () {},
winIcon: true,
winTitle: true,
winToast: false,
......
......@@ -289,6 +289,7 @@ Component({
let funcPageLength = getCurrentPages().length
if (funcPageLength > 1) wx.navigateBack({ delta: 1 })
this.triggerEvent('navBack', { back: 1 })
console.log('onBack')
},
/**
......
// 增加新的标题样式请在数组末尾添加,避免影响其他页面显示。
let styleOption = [
{
// 黑字 - 透明背景 转换 黑字 - 白色背景
// 0 - 黑字 - 透明背景 转换 黑字 - 白色背景
'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: '' } }
}, {
// 黑字 - 白色背景 固定
// 1 - 黑字 - 白色背景 固定
'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: '' } }
}, {
// 白字 - 透明背景 转换 黑字 - 白色背景
// 2 - 白字 - 透明背景 转换 黑字 - 白色背景
'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: '' } }
}, {
// 白字 - 透明背景 固定
// 3 - 白字 - 透明背景 固定
'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: '' } }
}, {
// 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' } },
'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' } },
'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: '' } },
'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: '' } },
'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: '' } },
'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: '' } }
},
]
let output = function () {
......
......@@ -15,6 +15,7 @@ Component({
title: '', // 提示文本
duration: 3000, // 提示的延迟时间
background: 'rgba(0, 0, 0, 0)',
ending: function () { },
winIcon: true,
winTitle: true,
winToast: false,
......
let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({
data: {
imageBase: App.globalData.appImageBase,
......@@ -129,14 +124,21 @@ Page({
* @returns
*/
onPageScroll: function (funcEvent) {
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
App.pageScroll(funcEvent, this)
},
/**
* 页面滚动事件回调,是经过滚动优化的。
* 对于刷新频率低的滚动计算的代码可以写在此处。
* @function
* @param {object} - funcEvent
* @returns
*/
eventPageScroll: function (funcEvent) {
if (funcEvent.scrollTop >= this.data.sideHeight) {
if (this.data.winSide) {
this.setData({
winSide: false,
winSide: false
})
}
......@@ -152,16 +154,8 @@ Page({
navigationAnimationShow: 0
})
}
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 40)
},
/**
* 缓存用户信息
* @function
......@@ -247,19 +241,31 @@ Page({
wx.saveImageToPhotosAlbum({
filePath: result.tempFilePath,
success: (result) => {
App.ui.showToast({
'iconType': 'success',
'title': '图片已保存'
})
this.setData({
showPopup: false,
winToastSuccess: true
})
wx.showTabBar({
animation: true,
})
},
fail: (error) => {
this.setData({
winToastFail: true
App.ui.showToast({
'iconType': 'error',
'title': '图片保存失败'
})
}
})
},
fail: (error) => {
App.ui.showToast({
'iconType': 'error',
'title': '图片保存失败'
})
this.setData({
winToastFail: true
})
......
<!-- 此页面是为了让其他页面进行跳转的镜像页面 -->
<!-- 如果直接跳转 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="appointment">
<l-button l-class="appointment-button" bind:lintap="onServic">电话预约</l-button>
......@@ -33,24 +35,6 @@
</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">
<image class="icon-location" src="/image/icon/location-3.png"></image>
......
let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({
data: {
appStatus: App.globalData.appStatus,
imageBase: App.globalData.appImageBase,
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,
winSide: true,
......@@ -133,10 +112,17 @@ Page({
* @returns
*/
onPageScroll: function (funcEvent) {
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
App.pageScroll(funcEvent, this)
},
/**
* 页面滚动事件回调,是经过滚动优化的。
* 对于刷新频率低的滚动计算的代码可以写在此处。
* @function
* @param {object} - funcEvent
* @returns
*/
eventPageScroll: function (funcEvent) {
if (funcEvent.scrollTop >= this.data.sideHeight) {
if (this.data.winSide) {
this.setData({
......@@ -156,17 +142,8 @@ Page({
navigationAnimationShow: 0
})
}
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 40)
},
/**
* 缓存用户信息
* @function
......@@ -258,24 +235,30 @@ Page({
wx.saveImageToPhotosAlbum({
filePath: result.tempFilePath,
success: (result) => {
App.ui.showToast({
'iconType': 'success',
'title': '图片已保存'
})
this.setData({
showPopup: false,
winToastSuccess: true
})
wx.showTabBar({
animation: true,
})
})
},
fail: (error) => {
this.setData({
winToastFail: true
App.ui.showToast({
'iconType': 'error',
'title': '图片保存失败'
})
}
})
},
fail: (error) => {
this.setData({
winToastFail: true
App.ui.showToast({
'iconType': 'error',
'title': '图片保存失败'
})
wx.showTabBar({
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="appointment">
<l-button l-class="appointment-button" bind:lintap="onServic">电话预约</l-button>
......@@ -32,24 +32,6 @@
</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">
<image class="icon-location" src="/image/icon/location-3.png"></image>
......
let App = getApp()
Page({
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
option: {},
animationData: {},
animationPointHeight: 0,
animationPointOrigin: 0,
winAnimationPoint: false,
shopInfo: {},
sideBar: [], // 侧边菜单
menuTitle: '', // 商品列表标题
commodityList: [], // 商品列表
commodityDetail: {}, // 商品详情
shoppingCart: [], // 购物车列表
shoppingCartTotal: 0, // 购物车总数
currentIndex: 0,
scrollTop: 0,
winToast: false,
winLoading: false,
winCommodityDetail: false,
},
onLoad: function (option) {
this.setData({
option: option
})
this.resetShoppingCart()
this.setCartAnimation()
this.setShopInfo()
this.querySideBar()
},
onShow: function () {
if (wx.getStorageSync('shoppingCartBuffer').length === 0) {
this.resetShoppingCart()
}
},
/**
* 添加动画初始
* @function
* @param
* @returns
*/
setCartAnimation: function () {
// 购物车添加动画
this.animation = wx.createAnimation({
duration: 500,
timingFunction: 'ease'
})
// 获取购物车高度
const funcQuery = wx.createSelectorQuery()
funcQuery.select('#cart').boundingClientRect()
funcQuery.exec((result) => {
this.setData({
animationPointOrigin: result[0].top + 4
})
})
},
/**
* 添加动画显示
* @function
* @param
* @returns
*/
setCartAnimationExport: function (funcPointHeight) {
// 定位点击元素位置
this.animation.translate(0, funcPointHeight).step()
this.setData({
animationData: this.animation.export(),
winAnimationPoint: false,
})
// 执行下滑动画
this.setData({
winAnimationPoint: true,
})
let funcTimer = setTimeout(() => {
this.animation.translate(0, this.data.animationPointOrigin).step()
this.setData({
animationData: this.animation.export(),
// winAnimationPoint: false,
})
clearTimeout(funcTimer)
}, 100)
},
setShopInfo: function () {
let funcShopInfo = wx.getStorageSync('shopInfoBuffer')
this.setData({
shopInfo: funcShopInfo
})
},
resetShoppingCart: function () {
this.setData({
shoppingCart: [],
shoppingCartTotal: 0,
})
wx.setStorageSync('shoppingCartBuffer', [])
},
/**
* 查询分类
* @function
* @param
* @returns
*/
querySideBar: function () {
App.wxRequest({
url: '/api/v1/commodity/getClassifys',
data: {
'officeId': this.data.shopInfo.id,
'genre': this.data.shopInfo.shopType,
},
success: (response) => {
let funcSideBar = []
let funcResponse = response.data
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].id,
'tab': funcResponse[i].name,
}
funcSideBar.push(funcItem)
}
// 判断是否从推荐菜单进入
if (this.data.option.sideBarId) {
for (let i = 0, l = funcSideBar.length; i < l; i++) {
if (funcSideBar[i].id === this.data.option.sideBarId) {
this.setData({
currentIndex: i
})
break
}
}
}
this.setData({
sideBar: funcSideBar,
menuTitle: funcSideBar[0].tab
})
this.queryCommodity()
}
})
},
/**
* 查询分类商品
* @function
* @param
* @returns
*/
queryCommodity: function () {
this.setData({
winLoading: true
})
App.wxRequest({
url: '/api/v1/commodity/getCommoditys',
data: {
'officeId': this.data.shopInfo.id,
'classifyId': this.data.sideBar[this.data.currentIndex].id,
'genre': this.data.shopInfo.shopType,
},
success: (response) => {
let funcCommodityList = []
let funcResponse = response.data
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].genre, // 商品分类标识
'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识
'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面
'price': funcResponse[i].sightseerPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse[i].sightseerPrice), // 普通价文本格式
'priceSpecial': funcResponse[i].ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcResponse[i].ownerPrice), // 业主价文本格式
'priceDiscount': funcResponse[i].price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcResponse[i].price), // 活动价文本格式
'priceType': 1,
'describe': funcResponse[i].synopsis,
'describeDetail': '', // 商品描述详情,在点击详情时获得数据
'tags': funcResponse[i].tags,
'notificationId': funcResponse[i].notificationId, // 下单须知
'quantityMin': 1,
'quantityMax': funcResponse[i].number < 20 ? funcResponse[i].number : 20, // 最大上限 20 件
'isActive': true,
}
// 没有库存了
if (funcItem.quantityMax === 0) funcItem.isStockMax = true
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcItem.priceDiscount || funcItem.priceDiscount === 0) {
funcItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
funcItem.priceType = 2
} else {
funcItem.priceType = 3
}
}
funcCommodityList.push(funcItem)
}
this.setData({
winLoading: false,
commodityList: funcCommodityList,
})
// 判断是否从推荐菜单进入,主动查询商品详情
if (this.data.option.commodityId) {
for (let i = 0, l = funcCommodityList.length; i < l; i++) {
if (funcCommodityList[i].id === this.data.option.commodityId) {
let funcEvent = {
currentTarget: {
dataset: {
item: funcCommodityList[i]
}
}
}
this.onCommodityDetail(funcEvent)
break
}
}
}
},
})
},
/**
* 侧边菜单选择事件
* @function
* @param {object} - event
* @returns
*/
onSelectionSideBar: function (event) {
let funcIndex = event.currentTarget.dataset.index
let funcMenuTitle = this.data.sideBar[funcIndex].tab
this.setData({
currentIndex: funcIndex,
menuTitle: funcMenuTitle,
scrollTop: 0
})
this.queryCommodity()
},
/**
* 查询商品详情
* @function
* @param {object} - event
* @returns
*/
onCommodityDetail: function (event) {
let funcItem = event.currentTarget.dataset.item
App.wxRequest({
url: '/api/v1/commodity/getCommodityParticulars',
data: {
'commodityId': funcItem.id,
'classifyId': funcItem.typeId,
'genre': this.data.shopInfo.shopType,
},
success: (response) => {
let funcResponse = response.data
funcItem.banner = funcResponse.imgs.split('|')
funcItem.banner.pop()
funcItem.describeDetail = funcResponse.particulars
this.setData({
commodityDetail: funcItem,
winCommodityDetail: true
})
}
})
},
/**
* 关闭商品详情
* @function
* @param
* @returns
*/
onCommodityClose: function () {
this.setData({
winCommodityDetail: false
})
},
/**
* 添加商品
* @function
* @param {object} - event
* @returns
*/
onCommodityAdd: function (event) {
// 获取点击高度
let funcAnimationPointHeight = event.detail.y
this.setCartAnimationExport(funcAnimationPointHeight)
let funcShoppingCart = this.data.shoppingCart
let funcWinToastNothing = false
// 详情加入购物车按钮商品数据不会存在于 event 对象中,所以要区分
let funcWinToast = true
let funcItem = event.currentTarget.dataset.item
if (!funcItem) {
funcWinToast = true
funcItem = this.data.commodityDetail
}
console.log(funcItem)
// 判断购物车中是否存在同类商品
// 修改相应的商品数量
if (funcShoppingCart.length !== 0) {
for (let i = 0, l = funcShoppingCart.length; i < l; i++) {
if (funcItem.id === funcShoppingCart[i].id) {
if (funcShoppingCart[i].quantity < funcShoppingCart[i].quantityMax) {
funcShoppingCart[i].quantity = funcShoppingCart[i].quantity + 1
} else {
funcWinToastNothing = true
funcWinToast = false
}
break
}
// 当前添加商品不在购物车里的场景
if (i === funcShoppingCart.length - 1) {
if (funcItem.quantityMax > 0) {
funcItem.quantity = 1
funcShoppingCart.push(funcItem)
}
}
}
} else {
// 库存要大于零才能添加
if (funcItem.quantityMax > 0) {
funcItem.quantity = 1
funcShoppingCart.push(funcItem)
}
}
// 重新计算购物车总数
let funcShoppingCartTotal = 0
for (let i = 0, l = funcShoppingCart.length; i < l; i++) {
funcShoppingCartTotal = funcShoppingCartTotal + funcShoppingCart[i].quantity
}
this.setData({
shoppingCart: funcShoppingCart,
shoppingCartTotal: funcShoppingCartTotal,
winToast: funcWinToast,
winToastNothing: funcWinToastNothing,
winCommodityDetail: false,
})
console.log(funcShoppingCart)
},
/**
* 跳转购物车页面
* @function
* @param
* @returns
*/
onShoppingCart: function () {
wx.setStorageSync('shoppingCartBuffer', this.data.shoppingCart)
wx.navigateTo({
url: '/pages/commodity/shopping-cart/shopping-cart',
})
},
})
\ 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()
Page({
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
option: {},
animationData: {},
animationPointHeight: 0,
animationPointOrigin: 0,
winAnimationPoint: false,
shopInfo: {},
sideBar: [], // 侧边菜单
menuTitle: '', // 商品列表标题
commodityList: [], // 商品列表
commodityDetail: {}, // 商品详情
shoppingCart: [], // 购物车列表
shoppingCartTotal: 0, // 购物车总数
currentIndex: 0,
scrollTop: 0,
winToast: false,
winLoading: false,
winCommodityDetail: false,
},
onLoad: function (option) {
this.setData({
option: option
})
this.resetShoppingCart()
this.setCartAnimation()
this.setShopInfo()
this.querySideBar()
},
onShow: function () {
if (wx.getStorageSync('shoppingCartBuffer').length === 0) {
this.resetShoppingCart()
}
},
/**
* 添加动画初始
* @function
* @param
* @returns
*/
setCartAnimation: function () {
// 购物车添加动画
this.animation = wx.createAnimation({
duration: 500,
timingFunction: 'ease'
})
// 获取购物车高度
const funcQuery = wx.createSelectorQuery()
funcQuery.select('#cart').boundingClientRect()
funcQuery.exec((result) => {
this.setData({
animationPointOrigin: result[0].top + 4
})
})
},
/**
* 添加动画显示
* @function
* @param
* @returns
*/
setCartAnimationExport: function (funcPointHeight) {
// 定位点击元素位置
this.animation.translate(0, funcPointHeight).step()
this.setData({
animationData: this.animation.export(),
winAnimationPoint: false,
})
// 执行下滑动画
this.setData({
winAnimationPoint: true,
})
let funcTimer = setTimeout(() => {
this.animation.translate(0, this.data.animationPointOrigin).step()
this.setData({
animationData: this.animation.export(),
// winAnimationPoint: false,
})
clearTimeout(funcTimer)
}, 100)
},
setShopInfo: function () {
let funcShopInfo = wx.getStorageSync('shopInfoBuffer')
this.setData({
shopInfo: funcShopInfo
})
},
resetShoppingCart: function () {
this.setData({
shoppingCart: [],
shoppingCartTotal: 0,
})
wx.setStorageSync('shoppingCartBuffer', [])
},
/**
* 查询分类
* @function
* @param
* @returns
*/
querySideBar: function () {
App.wxRequest({
url: '/api/v1/commodity/getClassifys',
data: {
'officeId': this.data.shopInfo.id,
'genre': this.data.shopInfo.shopType,
},
success: (response) => {
let funcSideBar = []
let funcResponse = response.data
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].id,
'tab': funcResponse[i].name,
}
funcSideBar.push(funcItem)
}
// 判断是否从推荐菜单进入
if (this.data.option.sideBarId) {
for (let i = 0, l = funcSideBar.length; i < l; i++) {
if (funcSideBar[i].id === this.data.option.sideBarId) {
this.setData({
currentIndex: i
})
break
}
}
}
this.setData({
sideBar: funcSideBar,
menuTitle: funcSideBar[0].tab
})
this.queryCommodity()
}
})
},
/**
* 查询分类商品
* @function
* @param
* @returns
*/
queryCommodity: function () {
this.setData({
winLoading: true
})
App.wxRequest({
url: '/api/v1/commodity/getCommoditys',
data: {
'officeId': this.data.shopInfo.id,
'classifyId': this.data.sideBar[this.data.currentIndex].id,
'genre': this.data.shopInfo.shopType,
},
success: (response) => {
let funcCommodityList = []
let funcResponse = response.data
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].genre, // 商品分类标识
'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识
'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面
'price': funcResponse[i].sightseerPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse[i].sightseerPrice), // 普通价文本格式
'priceSpecial': funcResponse[i].ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcResponse[i].ownerPrice), // 业主价文本格式
'priceDiscount': funcResponse[i].price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcResponse[i].price), // 活动价文本格式
'priceType': 1,
'describe': funcResponse[i].synopsis,
'describeDetail': '', // 商品描述详情,在点击详情时获得数据
'tags': funcResponse[i].tags,
'notificationId': funcResponse[i].notificationId, // 下单须知
'quantityMin': 1,
'quantityMax': funcResponse[i].number < 20 ? funcResponse[i].number : 20, // 最大上限 20 件
'isActive': true,
}
// 没有库存了
if (funcItem.quantityMax === 0) funcItem.isStockMax = true
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcItem.priceDiscount || funcItem.priceDiscount === 0) {
funcItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
funcItem.priceType = 2
} else {
funcItem.priceType = 3
}
}
funcCommodityList.push(funcItem)
}
this.setData({
winLoading: false,
commodityList: funcCommodityList,
})
// 判断是否从推荐菜单进入,主动查询商品详情
if (this.data.option.commodityId) {
for (let i = 0, l = funcCommodityList.length; i < l; i++) {
if (funcCommodityList[i].id === this.data.option.commodityId) {
let funcEvent = {
currentTarget: {
dataset: {
item: funcCommodityList[i]
}
}
}
this.onCommodityDetail(funcEvent)
break
}
}
}
},
})
},
/**
* 侧边菜单选择事件
* @function
* @param {object} - event
* @returns
*/
onSelectionSideBar: function (event) {
let funcIndex = event.currentTarget.dataset.index
let funcMenuTitle = this.data.sideBar[funcIndex].tab
this.setData({
currentIndex: funcIndex,
menuTitle: funcMenuTitle,
scrollTop: 0
})
this.queryCommodity()
},
/**
* 查询商品详情
* @function
* @param {object} - event
* @returns
*/
onCommodityDetail: function (event) {
let funcItem = event.currentTarget.dataset.item
App.wxRequest({
url: '/api/v1/commodity/getCommodityParticulars',
data: {
'commodityId': funcItem.id,
'classifyId': funcItem.typeId,
'genre': this.data.shopInfo.shopType,
},
success: (response) => {
let funcResponse = response.data
funcItem.banner = funcResponse.imgs.split('|')
funcItem.banner.pop()
funcItem.describeDetail = funcResponse.particulars
this.setData({
commodityDetail: funcItem,
winCommodityDetail: true
})
}
})
},
/**
* 关闭商品详情
* @function
* @param
* @returns
*/
onCommodityClose: function () {
this.setData({
winCommodityDetail: false
})
},
/**
* 添加商品
* @function
* @param {object} - event
* @returns
*/
onCommodityAdd: function (event) {
// 获取点击高度
let funcAnimationPointHeight = event.detail.y
this.setCartAnimationExport(funcAnimationPointHeight)
let funcShoppingCart = this.data.shoppingCart
let funcWinToastNothing = false
// 详情加入购物车按钮商品数据不会存在于 event 对象中,所以要区分
let funcWinToast = true
let funcItem = event.currentTarget.dataset.item
if (!funcItem) {
funcWinToast = true
funcItem = this.data.commodityDetail
}
console.log(funcItem)
// 判断购物车中是否存在同类商品
// 修改相应的商品数量
if (funcShoppingCart.length !== 0) {
for (let i = 0, l = funcShoppingCart.length; i < l; i++) {
if (funcItem.id === funcShoppingCart[i].id) {
if (funcShoppingCart[i].quantity < funcShoppingCart[i].quantityMax) {
funcShoppingCart[i].quantity = funcShoppingCart[i].quantity + 1
} else {
funcWinToastNothing = true
funcWinToast = false
}
break
}
// 当前添加商品不在购物车里的场景
if (i === funcShoppingCart.length - 1) {
if (funcItem.quantityMax > 0) {
funcItem.quantity = 1
funcShoppingCart.push(funcItem)
}
}
}
} else {
// 库存要大于零才能添加
if (funcItem.quantityMax > 0) {
funcItem.quantity = 1
funcShoppingCart.push(funcItem)
}
}
// 重新计算购物车总数
let funcShoppingCartTotal = 0
for (let i = 0, l = funcShoppingCart.length; i < l; i++) {
funcShoppingCartTotal = funcShoppingCartTotal + funcShoppingCart[i].quantity
}
this.setData({
shoppingCart: funcShoppingCart,
shoppingCartTotal: funcShoppingCartTotal,
winToast: funcWinToast,
winToastNothing: funcWinToastNothing,
winCommodityDetail: false,
})
console.log(funcShoppingCart)
},
/**
* 跳转购物车页面
* @function
* @param
* @returns
*/
onShoppingCart: function () {
wx.setStorageSync('shoppingCartBuffer', this.data.shoppingCart)
wx.navigateTo({
url: '/pages/commodity/shopping-cart/shopping-cart',
})
},
})
\ 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 logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({
data: {
imageBase: App.globalData.appImageBase,
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: '200rpx',
},
navigationScroll: 0,
navbarTitle: '',
navTitle: '',
banner: '',
bgColor: '',
buyText: '',
......@@ -46,7 +25,7 @@ Page({
switch (this.data.shopInfo.appId) {
case 1:
this.setData({
navbarTitle: '海错图购票',
navTitle: '海错图购票',
banner: 'service/detail-banner-1.png',
bgColor: '#F5ECD8',
buyText: '购买门票',
......@@ -57,7 +36,7 @@ Page({
case 3:
this.setData({
navbarTitle: '儿童营地入园购票',
navTitle: '儿童营地入园购票',
banner: 'service/detail-banner-3.png',
bgColor: '#F6DADA',
buyText: '购买门票',
......@@ -68,7 +47,7 @@ Page({
case 7:
this.setData({
navbarTitle: '元养水韵SPA服务',
navTitle: '元养水韵SPA服务',
banner: 'service/detail-banner-7.png',
bgColor: '#8FC3CB',
buyText: '购买',
......@@ -355,19 +334,13 @@ Page({
})
},
/**
* 页面滚动事件
* @function
* @param {object} - funcEvent
* @returns
*/
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)
App.pageScroll(funcEvent, this)
},
})
\ 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="background-img">
......@@ -70,5 +70,4 @@
</view>
</view>
</block>
</view>
\ No newline at end of file
let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({
data: {
imageBase: App.globalData.appImageBase,
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: [],
bannerIndex: 0,
......@@ -376,20 +355,14 @@ Page({
})
},
/**
* 页面滚动事件
* @function
* @param {object} - funcEvent
* @returns
*/
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)
App.pageScroll(funcEvent, this)
},
/**
......
<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="banner">
......
.navigation {
z-index: 1900;
}
.container {
padding-bottom: 160rpx;
background: linear-gradient(180deg, #FFFFFF 0%, #F3F4F6 100%, #F3F4F6 100%, #F3F4F6 100%);
}
.banner {
z-index: 9;
position: relative;
width: 750rpx;
height: 800rpx;
......
const App = getApp()
let App = getApp()
Page({
data: {
......@@ -29,7 +29,7 @@ Page({
onLoad: function (options) {
this.setData({
frompage: options.frompage,
optionsTab:options.tab
optionsTab: options.tab
})
this.setReset()
},
......@@ -191,12 +191,10 @@ Page({
return
}
wx.lin.showToast({
icon: 'loading',
App.ui.showToast({
iconType: 'loading',
title: '提交中',
show: true,
mask: true,
duration: 1000 * 60,
duration: 60000,
})
App.wxRequest({
......@@ -209,25 +207,23 @@ Page({
type: 1,
},
success: (response) => {
console.log(response)
let funcResponse = response
if (response.data && response.data.code === 500) {
wx.lin.hideToast()
wx.lin.showToast({
image: '/image/error.png',
App.ui.showToast({
iconType: 'error',
title: response.data.msg,
})
return
}
App.ui.hideToast()
this.setData({
appointmentComplete: true,
})
wx.lin.hideToast()
},
fail: (response) => {
wx.lin.showToast({
image: '/image/error.png',
App.ui.showToast({
iconType: 'error',
title: response.msg,
})
}
......@@ -244,14 +240,9 @@ Page({
},
getNextDay(d, t) {
console.log(d, t) //格式为---2019-02-13 3
d = new Date(d);
console.log(d) //格式为---Wed Feb 13 2019 08:00:00 GMT+0800 (中国标准时间)
d = +d + (1000 * 60 * 60 * 24) * t;
console.log(d) //格式为--时间戳1550275200000
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"
},
})
\ No newline at end of file
<l-toast l-image-class="toast-image"></l-toast>
<!-- 首页 - 入园预约 / 房屋预约 -->
<navigation class="navigation" titleText="看房预约" color="#FFFFFF" backIcon="{{'../../image/icon/arrow-l-2.png'}}"></navigation>
<m-toast></m-toast>
<m-nav titleText="看房预约" styleIndex="{{2}}" isOccupy="{{false}}"></m-nav>
<view class="appointment-complete row con-c align-c" wx:if="{{appointmentComplete}}">
<view class="appointment-complete-tip">
......
<m-toast></m-toast>
<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">
<image wx:if="{{shopLogo}}" src="{{resourcesBase + shopLogo}}" mode="widthFix"></image>
<text bindtap="onClearn">清空</text>
......
.navigation {
z-index: 1100;
position: fixed;
top: 0;
left: 0;
width: 750rpx;
}
.shop-info {
width: 750rpx;
height: 110rpx;
......
let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({
data: {
imageResourcesBase: App.globalData.appResourcesBase,
......@@ -32,22 +26,6 @@ Page({
type: '',
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) {
......@@ -132,20 +110,4 @@ Page({
this.onHideMenu()
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">
<!-- 积分背景图 -->
......
......@@ -2,8 +2,6 @@ let App = getApp()
Page({
data: {
winToastText: '操作成功',
winToast: false,
isDoing: false,
showNotice: false,
swiperCurrent: 0,
......@@ -132,66 +130,62 @@ Page({
onDelOrCancelOrder: function (event) {
let funcItem = this.data.orderInfo
console.log(funcItem)
let type = event.currentTarget.dataset.type
let that = this
let tip = type == 1 ? '删除订单' : '取消订单'
wx.lin.showDialog({
let type = event.currentTarget.dataset.type
App.ui.showDialog({
type: 'confirm',
title: '',
content: "是否确认" + tip,
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
wx.showLoading({
title: '处理中',
mask: true
})
this.setData({
isDoing: true,
})
App.wxRequest({
url: '/api/v1/activity/doCancel',
data: {
'enrollId': this.data.activityId,
'type': type,
},
success: (response) => {
wx.hideLoading()
let winToastText = type == 1 ? '订单删除成功' : '订单取消成功'
that.setData({
isDoing: false,
winToast: true,
winToastText: winToastText
})
setTimeout(function () {
if (type == 1) {
// 删除操作
wx.navigateBack({
delta: 1
})
} else {
// 取消操作
let state = `orderInfo.state`
that.setData({
isDoing: false,
[state]: -1
})
}
}, 2000)
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
title: type == 0 ? '是否确认取消报名' : '是否确认删除报名',
content: type == 0 ? '取消后无法恢复' : '删除后无法恢复',
cancel: type == 0 ? '暂不取消' : '取消',
confirm: type == 0 ? '确定取消' : '确定',
success: () => {
App.ui.showToast({
'iconType': 'loading',
'title': '处理中',
'duration': 60000
})
this.setData({
isDoing: true,
})
App.wxRequest({
url: '/api/v1/activity/doCancel',
data: {
'enrollId': this.data.activityId,
'type': type,
},
success: (response) => {
App.ui.hideToast()
this.setData({
isDoing: false,
})
App.ui.showToast({
'iconType': 'success',
'title': type == 1 ? '订单删除成功' : '订单取消成功'
})
setTimeout(function () {
if (type == 1) {
// 删除操作
wx.navigateBack({
delta: 1
})
wx.setStorageSync('option-appointment', 'refresh')
} else {
// 取消操作
let state = `orderInfo.state`
this.setData({
isDoing: false,
[state]: -1
})
}
}, 2000)
}
})
},
fail: () => {},
})
},
// 使用须知
handleNotice() {
let showNotice = true
......@@ -242,7 +236,6 @@ Page({
* @returns
*/
queryOrderDetail: function () {
let that = this
App.wxRequest({
url: '/api/v1/order/getOrderDetail',
data: {
......@@ -303,7 +296,7 @@ Page({
let residueStamp = endTime - now
let residuePayTime = App.modular.miment(residueStamp).format('mm:ss')
if (residueStamp > 0) {
that.setData({
this.setData({
residuePayTime: residuePayTime
})
} else {
......@@ -313,7 +306,7 @@ Page({
// that.queryOrderDetail()
let state = `orderInfo.state`
that.setData({
this.setData({
[state]: -1
})
}
......@@ -337,18 +330,21 @@ Page({
// 弹出单张二维码
onCouponCode: function (event) {
let funcOrderInfo = event.currentTarget.dataset.item
wx.showLoading({
title: '加载中',
App.ui.showToast({
'iconType': 'loading',
'title': '加载中',
'duration': 60000
})
App.wxRequest({
url: '/api/v1/volume/getVolume',
data: {
'volumeId': funcOrderInfo.codeId
},
success: (response) => {
wx.hideLoading({
success: (res) => { },
})
App.ui.hideToast()
let funcResponse = response.data
let funcCodeInfo = {
'codeNo': funcResponse.serialNumber,
......@@ -363,21 +359,10 @@ Page({
})
},
// 多二维码 复制券码
setClipboard(e) {
const code = e.currentTarget.dataset.code
setClipboard: function (event) {
const code = event.currentTarget.dataset.code
wx.setClipboardData({
data: code,
success(res) {
wx.showToast({
title: '复制成功',
})
// wx.getClipboardData({
// success(res) {
// console.log(res.data) // data
// }
// })
}
})
},
// 单个二维码 复制券码
......@@ -393,7 +378,7 @@ Page({
})
},
navBack: function () {
onNavBack: function () {
if (this.data.fromPage) {
wx.switchTab({
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-content col con-c" wx:if="{{orderInfo.state === 0}}">
......@@ -361,9 +363,4 @@
</view>
</scroll-view>
</view>
</l-popup>
<!-- 成功提示 -->
<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
</l-popup>
\ No newline at end of file
/* 订单状态 */
.container {
margin-top: 60rpx;
}
.state {
width: 750rpx;
}
.container {
margin-top: 160rpx;
}
.state-content {
width: 670rpx;
height: 240rpx;
......@@ -231,7 +229,7 @@
/* 订单提示 */
.tip {
margin: 74rpx 40rpx 70rpx 40rpx;
margin: 74rpx 40rpx 160rpx 40rpx;
}
.tip-pay {
......@@ -794,10 +792,6 @@
line-height: 42rpx;
}
.padding-bottom-166 {
padding-bottom: 166rpx;
}
.footer-btn {
position: fixed;
bottom: 0;
......
const App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
let App = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
phone: '13856782234',
hotline: false, //客服热线
......@@ -20,24 +11,28 @@ Page({
tickerInfo: {},
isDoing: 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() {
this.setData({
hotline: true
......@@ -45,76 +40,66 @@ Page({
},
//取消预约
onCancel: function (event) {
let that = this
if (this.data.isDoing) return
wx.lin.showDialog({
type: "confirm",
title: "",
content: "是否确认取消预约",
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
wx.showLoading({
title: '处理中',
mask: true
})
this.setData({
isDoing: true
})
App.wxRequest({
url: '/api/v1/subscribe/cancelSubscribe',
data: {
'id': that.data.tickerInfo.id
},
success: (response) => {
wx.hideLoading()
that.setData({
isDoing: false
App.ui.showDialog({
type: 'confirm',
title: this.data.type === 0 ? '是否确认取消夜间入园预约?' : '是否确认取消看房预约?',
content: '取消后无法恢复',
cancel: '暂不取消',
confirm: '确定取消',
success: () => {
App.ui.showToast({
'iconType': 'loading',
'title': '处理中',
'duration': 60000
})
this.setData({
isDoing: true
})
App.wxRequest({
url: '/api/v1/subscribe/cancelSubscribe',
data: {
'id': this.data.tickerInfo.id
},
success: (response) => {
App.ui.hideToast()
this.setData({
isDoing: false
})
if (response.data && response.data.code == 500) {
App.ui.showToast({
'iconType': 'error',
'title': response.data.msg,
})
if (response.data&&response.data.code == 500) {
wx.lin.showToast({
image: '/image/error.png',
title: response.data.msg,
})
} else {
wx.lin.showToast({
image: '/image/success.png',
title: '取消成功',
} else {
App.ui.showToast({
'iconType': 'success',
'title': '取消成功'
})
setTimeout(() => {
let type = this.data.type
let tabType = 2
if (type == 0) {
//返回夜间入园预约列表
tabType = 1
} else {
// 返回看房预约
tabType = 2
}
wx.redirectTo({
url: '/pages/mine/appointment/appointment?tab=' + tabType,
})
setTimeout(() => {
let type = that.data.type
let tabType = 2
if (type == 0) {
//返回夜间入园预约列表
tabType = 1
} else {
// 返回看房预约
tabType = 2
}
wx.redirectTo({
url: '/pages/mine/appointment/appointment?tab=' + tabType,
})
}, 2000);
}
}, 2000);
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
}
})
},
fail: () => {},
})
},
//客服热线拨打
call() {
......@@ -129,43 +114,14 @@ Page({
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) {
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 10)
App.pageScroll(funcEvent, this)
},
})
\ No newline at end of file
<navigation class="navigation" titleText="预约凭证" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}">
</navigation>
<m-toast></m-toast>
<m-dialog></m-dialog>
<m-nav titleText="预约凭证" scrollHeight="{{navScroll}}" styleIndex="{{2}}" isOccupy="{{false}}"></m-nav>
<view>
<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>
......@@ -42,9 +44,6 @@
<view wx:else class="custom" bindtap="showHotline">客服咨询</view>
</view>
</view>
<l-dialog />
<l-toast l-image-class="toast-image"></l-toast>
<!-- 客服热线 -->
<l-arc-popup show="{{hotline}}" arc-radius="30">
......
const App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
let App = getApp()
Page({
data: {
isLoading: false,
isFinished: false,
option: {},
isDoing: false,
pageNo: 1,
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: '主题活动',
type: '0'
},
......@@ -47,32 +26,33 @@ Page({
activityList: [],
data: [],
active: 0,
height: 0,
},
onLoad: function (options) {
let type = options.tab ? 1 * options.tab : 0
this.setData({
option: options,
height: wx.getSystemInfoSync().windowHeight, //获取屏幕的高度
active: type
})
type === 0 ? this.getActivity() : this.getList(type)
},
onShow: function () {
this.setData({
pageNo: 1,
pageSize: 10,
data: [],
isFinished: false,
activityList: [],
})
let funcIsRefresh = wx.getStorageSync('option-appointment')
if (funcIsRefresh === 'refresh') {
this.setData({
pageNo: 1,
pageSize: 10,
data: [],
activityList: [],
})
let type = this.data.option.tab ? 1 * this.data.option.tab : 0
if (type === 0) {
this.getActivity()
} else {
this.getList(type)
let type = this.data.option.tab ? 1 * this.data.option.tab : 0
if (type === 0) {
this.getActivity()
} else {
this.getList(type)
}
}
},
......@@ -96,19 +76,19 @@ Page({
// 跳转详情页面
onOrderDetail: function (event) {
console.log('onOrderDetail')
let funcItem = event.currentTarget.dataset.item
wx.navigateTo({
url: '/pages/mine/appointment-detail/appointment-detail?id=' + funcItem.orderId + '&activityId=' + funcItem.enrollId,
})
},
// 点击导航切换,默认是全部的
chageNav(e) {
let index = e.currentTarget.dataset.index
onSelectionTab: function (event) {
let index = event.currentTarget.dataset.index
if (index === 0) {
this.setData({
pageNo: 1,
activityList: [],
isFinished: false
})
this.getActivity()
} else {
......@@ -175,88 +155,70 @@ 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) {
let that = this
let type = event.currentTarget.dataset.type
wx.lin.showDialog({
type: "confirm",
title: "",
content: type == 0 ? "是否确认取消报名" : "是否确认删除报名",
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
wx.showLoading({
title: '处理中',
mask: true
})
this.setData({
isDoing: true
})
let funcItem = event.target.dataset.item
App.wxRequest({
url: '/api/v1/activity/doCancel',
data: {
'enrollId': funcItem.enrollId,
'type': type, //0取消1删除
},
success: (response) => {
wx.hideLoading()
if (response.data && response.data.code == 500) {
wx.lin.showToast({
image: '/image/error.png',
title: response.data.msg,
})
} else {
console.log('doCancel')
let type = event.currentTarget.dataset.type
wx.lin.showToast({
image: '/image/success.png',
title: type == 0 ? '取消成功' : '删除成功',
App.ui.showDialog({
type: 'confirm',
title: type == 0 ? '是否确认取消报名' : '是否确认删除报名',
content: type == 0 ? '取消后无法恢复' : '删除后无法恢复',
cancel: type == 0 ? '暂不取消' : '取消',
confirm: type == 0 ? '确定取消' : '确定',
success: () => {
App.ui.showToast({
'iconType': 'loading',
'title': '处理中',
'duration': 60000,
})
this.setData({
isDoing: true
})
let funcItem = event.target.dataset.item
App.wxRequest({
url: '/api/v1/activity/doCancel',
data: {
'enrollId': funcItem.enrollId,
'type': type, //0取消1删除
},
success: (response) => {
App.ui.hideToast()
if (response.data && response.data.code == 500) {
App.ui.showToast({
'iconType': 'error',
'title': response.data.msg,
})
} else {
App.ui.showToast({
'iconType': 'success',
'title': type == 0 ? '取消成功' : '删除成功',
})
setTimeout(() => {
this.setData({
'isDoing': false,
'activityList': [],
'pageNo': 1,
})
setTimeout(() => {
that.setData({
isDoing: false,
'activityList': [],
'pageNo': 1,
isFinished: false
})
that.getActivity()
}, 2000);
}
this.getActivity()
}, 2000);
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
}
})
},
fail: () => {},
})
},
// 我的活动
getActivity: function () {
if (this.data.isFinished) return
wx.showLoading({
title: '加载中',
mask: true
wx.setStorageSync('option-appointment', '')
App.ui.showToast({
'iconType': 'loading',
'title': '加载中',
'duration': 60000,
})
this.setData({
isLoading: true
......@@ -273,15 +235,8 @@ Page({
this.setData({
isLoading: false
})
wx.hideLoading({
success: (res) => {},
})
App.ui.hideToast()
let funcData = res.data.list
if (funcData.length < this.data.pageSize) {
this.setData({
isFinished: true
})
}
let tmpArr = []
funcData.forEach(item => {
let obj = {
......@@ -307,7 +262,9 @@ Page({
})
},
// 预约列表/我的预约
getList(index) {
getList: function (index) {
wx.setStorageSync('option-appointment', '')
index = index - 1
let type = ''
switch (index) {
......@@ -318,11 +275,13 @@ Page({
type = 1;
break;
}
let that = this
wx.showLoading({
title: '加载中',
mask: true
App.ui.showToast({
'iconType': 'loading',
'title': '处理中',
'duration': 60000,
})
this.setData({
isLoading: true
})
......@@ -333,9 +292,7 @@ Page({
type: type //0 入园预约 1 看房预约 全部 空字符
},
success: (res) => {
wx.hideLoading({
success: (res) => {},
})
App.ui.hideToast()
let tmpArr = []
res.data.forEach(item => {
let type = item.type * 1
......@@ -364,7 +321,7 @@ Page({
}
tmpArr.push(obj)
})
that.setData({
this.setData({
data: tmpArr,
isLoading: false
})
......
<!--pages/myAppointment/myAppointment.wxml-->
<navigation class="navigation" titleText="我的预约" backIcon="/image/back.png" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}" bind:navBack="onNavBack"></navigation>
<m-toast></m-toast>
<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="myActivity-container" style="min-height:{{height}}px;">
<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="myActivity-container">
<!-- 主题活动 -->
<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">
......@@ -37,8 +41,7 @@
<text>{{activity.amount}}</text>
</view>
<view class="appointment-activity-btn row">
<view catchtap="doCancel" data-item="{{activity}}" data-type='0' class="cancel-btn">取消报名
</view>
<view catchtap="doCancel" data-item="{{activity}}" data-type='0' class="cancel-btn">取消报名</view>
<view catchtap="onOrderPay" data-item="{{activity}}" class="confirm-btn">去支付</view>
</view>
</view>
......@@ -169,8 +172,7 @@
<text>{{activity.amount}}</text>
</view>
<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>
<view data-item="{{activity}}" data-type='1' catchtap="doCancel" class="cancel-btn">删除报名</view>
</view>
</view>
</view>
......@@ -238,10 +240,6 @@
<view class="noActive-botton" data-index="0" bindtap="goAppoint">去预约</view>
</view>
</view>
<!-- 确认框 -->
<l-dialog />
<l-toast l-image-class="toast-image"></l-toast>
<wxs module="m1">
var getDate = function(date, type) {
......
/* pages/myAppointment/myAppointment.wxss */
.myAppointment-nav {
.tab {
z-index: 2;
width: 750rpx;
padding-top: 150rpx;
/* height: 95rpx; */
border-bottom: 0.5px solid rgb(238, 238, 238);
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 */
background: linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251)); /* 标准的语法(必须放在最后) */
display: flex;
justify-content: space-around;
padding: 0 72rpx;
border-bottom: 1px solid #E2E7EF;
background: linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251));
}
.tab-item {
height: 96rpx;
font-size: 26rpx;
font-weight: 400;
line-height: 96rpx;
color: #959DA9;
}
.all {
background-color: rgba(243, 244, 246, 1);
}
.navItem {
font-size: 26rpx;
line-height: 95rpx;
color: rgb(156, 158, 163);
.container {
min-height: 100vh;
}
.active {
......@@ -233,6 +232,7 @@
font-weight: 600;
}
.cancel-btn {
z-index: 4;
width: 120rpx;
height: 56rpx;
color: #656E7B;
......@@ -243,19 +243,13 @@
border-radius: 4rpx;
border: 0.5px solid #C2C7CF;
}
.cancel-overtime {
position: absolute;
z-index: 11;
right: 32rpx;
bottom: 40rpx;
}
.cancel {
position: absolute;
z-index: 11;
right: 172rpx;
bottom: 40rpx;
}
.confirm-btn {
z-index: 4;
width: 120rpx;
height: 56rpx;
margin-left: 20rpx;
......@@ -269,13 +263,12 @@
}
.confirm-once {
position: absolute;
z-index: 11;
right: 32rpx;
bottom: 40rpx;
}
.mask-cancel {
position: absolute;
z-index: 1;
z-index: 3;
left: 0;
bottom: 0;
width: 670rpx;
......@@ -308,4 +301,4 @@
background: rgba(255, 255, 255, 0.53);
border-radius: 3px;
font-size: 28rpx;
}
}
\ No newline at end of file
const App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
let App = getApp()
Page({
data: {
......@@ -17,38 +12,16 @@ Page({
imageResourcesBase: App.globalData.appResourcesBase,
passList: [],
paddingTop: 0,
marginTop: 0,
noticeDetail: '',
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) {
this.animation = wx.createAnimation({
duration: 700,
timingFunction: 'ease'
})
let paddingTop = 28
paddingTop += wx.getStorageSync('navigationStatusHeight') + wx.getStorageSync('navigationCapsuleHeight')
this.setData({
paddingTop
})
this.getCardList()
},
// 跳转订单详情
......@@ -60,23 +33,19 @@ Page({
},
// 多二维码 复制券码
setClipboard(e) {
const code = e.currentTarget.dataset.code
setClipboard: function (event) {
const code = event.currentTarget.dataset.code
wx.setClipboardData({
data: code,
success(res) {
wx.showToast({
title: '复制成功',
})
}
})
},
//获取卡数据
getCardList: function () {
let that = this
wx.showLoading({
title: '加载中',
App.ui.showToast({
'iconType': 'loading',
'title': '加载中',
'duration': 60000
})
App.wxRequest({
url: '/api/v1/volume/getVolumeList',
......@@ -85,12 +54,10 @@ Page({
pageNo: 1,
pageSize: -1
},
success: function (res) {
wx.hideLoading({
success: (res) => {},
})
success: (res) => {
App.ui.hideToast()
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()
})
item.expireTime = item.expireTime.replace(/-/g, '.')
......@@ -123,12 +90,10 @@ Page({
})
let marginTop = filterList.length === 0 ? 84 : 12
that.setData({
this.setData({
passList: filterList,
marginTop
})
}
})
},
......@@ -268,20 +233,14 @@ Page({
winNoticeDetail: false
})
},
// 滚动屏幕
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)
/**
* 页面滚动事件
* @function
* @param {object} - funcEvent
* @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'}}">
<!-- 单张卡 -->
......
.container {
position: relative;
min-height: 100vh;
margin-top: 60rpx;
background: linear-gradient(180deg, #fffcfc 0%, #f6dada 100%);
}
......
const App = getApp()
let App = getApp()
Page({
scrollLock: false,
scrollTimer: 0,
data: {
// 导航栏相关属性
navigationStyle: {},
navigationScroll: 0,
appStatus: App.globalData.appStatus,
isCheckPermission: false,
imageBase: App.globalData.appImageBase,
......@@ -67,10 +59,6 @@ Page({
isLoadingOrder: true,
},
onLoad: function (options) {
},
onShow: function () {
this.setData({
showMoreOrder: false,
......@@ -79,7 +67,6 @@ Page({
this.setData({ appStatus: App.globalData.appStatus })
this.setUserInfo()
this.setNavigation()
},
// 去活动预约列表
......@@ -134,7 +121,6 @@ Page({
permission: 'sys:role:distinguish'
},
success: function (res) {
console.log(res, '核销');
let data = res.data
let isPer = false
let authInfo = {
......@@ -148,9 +134,6 @@ Page({
// 无核销权限
isPer = false
}
that.setData({
isCheckPermission: isPer,
authInfo: authInfo
......@@ -282,7 +265,6 @@ Page({
pageSize: -1
},
success: function (res) {
console.log(res, '获取分类统计');
let data = res.data ? res.data : {}
that.setData({
goodTypeCountData: data
......@@ -297,7 +279,6 @@ Page({
url: '/api/v1/activity/getCountEnrollSubscribe',
data: {},
success: function (res) {
console.log(res, '获取分类统计');
let data = res.data ? res.data : {}
that.setData({
enrollSubscribeData: data
......@@ -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() {
if (this.data.isRegister) {
......@@ -610,19 +571,13 @@ Page({
},
onPageScroll: function (event) {
// 优化滚动事件触发频率
if (this.scrollLock) return
this.scrollLock = true
this.setData({
navigationScroll: event.scrollTop
})
// 恢复滚动事件
this.scrollTimer = setTimeout(() => {
this.scrollLock = false
clearTimeout(this.scrollTimer)
}, 10)
/**
* 页面滚动事件
* @function
* @param {object} - funcEvent
* @returns
*/
onPageScroll: function (funcEvent) {
App.pageScroll(funcEvent, this)
},
})
\ 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="mine" wx:if="{{type !== 1}}">
......@@ -67,7 +68,6 @@
</view>
</view>
<view class="status row con-b align-c" wx:if="{{type !== 1}}">
<view class="status-symbol col">
<text>业主认证</text>
......@@ -261,45 +261,6 @@
</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>
<!-- more -->
<view class="more row align-c con-c" bindtap="onShowMoreActivity" wx:if="{{activityListBackup.length>2}}">
......
......@@ -3,12 +3,8 @@
background: #f3f4f6;
}
.navigation {
z-index: 1900;
}
.background-image {
z-index: 1;
z-index: 0;
position: absolute;
top: 0;
left: 0;
......@@ -51,7 +47,7 @@
}
.mine-avatar {
z-index: 11;
z-index: 1;
margin-right: 32rpx;
width: 136rpx;
height: 136rpx;
......@@ -72,11 +68,11 @@
}
.mine-info {
z-index: 1;
padding-top: 12rpx;
}
.mine-info view:nth-child(1) text {
z-index: 11;
max-width: 260rpx;
margin-right: 20rpx;
font-size: 42rpx;
......@@ -127,24 +123,21 @@
}
.mine-info view:nth-child(1) image {
z-index: 11;
width: 40rpx;
height: 40rpx;
}
.mine-info view:nth-child(2) {
z-index: 11;
margin-top: 0rpx;
}
.mine-info view:nth-child(2) text {
z-index: 11;
font-size: 26rpx;
color: #959da9;
}
.coupon {
z-index: 9;
z-index: 7;
width: 670rpx;
height: 176rpx;
padding: 41rpx 32rpx;
......@@ -175,7 +168,7 @@
}
.status {
z-index: 9;
z-index: 7;
width: 670rpx;
height: 130rpx;
margin-top: 48rpx;
......@@ -262,62 +255,6 @@
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 {
width: 150rpx;
height: 70rpx;
......@@ -333,32 +270,6 @@
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 {
width: 606rpx;
height: 974rpx;
......@@ -419,11 +330,6 @@
border-radius: 4rpx;
}
/* .order-activity image {
width: 32rpx;
height: 32rpx;
} */
.order-activity-title-wrapper {
height: 48rpx;
}
......
......@@ -112,9 +112,9 @@ Page({
*/
doUpdateInfo: function () {
if (this.data.userInfo.name == '') {
wx.lin.showToast({
image: '/image/error.png',
title: '请填写姓名',
App.ui.showToast({
'iconType': 'error',
'title': '请填写姓名',
})
return
}
......
<l-toast l-image-class="toast-image"></l-toast>
<navigation class="navigation" titleText="个人资料" backIcon="/image/back.png"></navigation>
<m-toast></m-toast>
<m-nav titleText="个人资料"></m-nav>
<view class="container">
<view class="myInfo">
......
.myInfo {
width: 750rpx;
margin-top: 170rpx;
padding: 0 48rpx;
}
......
......@@ -70,10 +70,6 @@ Page({
this.setData({
isLoading: true
})
wx.showLoading({
title: '加载中',
mask: true
})
App.wxRequest({
url: '/api/v1/order/getOrderList',
data: {
......@@ -155,8 +151,6 @@ Page({
that.setData({
isLoading: false
})
}
})
},
......@@ -331,49 +325,44 @@ Page({
* @returns
*/
onOrderCancel: function (event) {
let that = this
wx.lin.showDialog({
type: "confirm",
title: "",
content: "是否确认取消订单",
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
wx.showLoading({
title: '处理中',
mask: true
})
this.setData({
isDoing: true
})
let funcItem = event.target.dataset.item
App.wxRequest({
url: '/api/v1/order/cancelOrder',
data: {
'orderId': funcItem.id,
'type': 0,
},
success: (response) => {
wx.hideLoading()
that.setData({
isDoing: false
})
that.setData({
'orderList': [],
'orderPages': 1,
})
that.queryOrder()
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
App.ui.showDialog({
type: 'confirm',
title: '是否确认取消订单',
content: '取消后无法恢复',
cancel: '暂不取消',
confirm: '确定取消',
success: () => {
App.ui.showToast({
'iconType': 'loading',
'title': '处理中',
'duration': 60000
})
this.setData({
isDoing: true
})
let funcItem = event.target.dataset.item
App.wxRequest({
url: '/api/v1/order/cancelOrder',
data: {
'orderId': funcItem.id,
'type': 0,
},
success: (response) => {
App.ui.showToast({
'iconType': 'success',
'title': '取消成功'
})
this.setData({
'isDoing': false,
'orderList': [],
'orderPages': 1,
})
this.queryOrder()
}
})
},
fail: () => { },
})
},
/**
......@@ -383,46 +372,44 @@ Page({
* @returns
*/
onOrderRemove: function (event) {
let that = this
wx.lin.showDialog({
type: "confirm",
title: "",
content: "是否确认删除订单",
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
wx.showLoading({
title: '处理中',
mask: true
})
this.setData({
isDoing: true
})
let funcItem = event.target.dataset.item
App.wxRequest({
url: '/api/v1/order/cancelOrder',
data: {
'orderId': funcItem.id,
'type': 1,
},
success: (response) => {
wx.hideLoading()
that.setData({
isDoing: false,
'orderList': [],
'orderPages': 1,
})
that.queryOrder()
console.log(response)
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
App.ui.showDialog({
type: 'confirm',
title: '是否确认删除订单?',
content: '删除后无法恢复',
cancel: '取消',
confirm: '确定',
success: () => {
App.ui.showToast({
'iconType': 'loading',
'title': '处理中',
'duration': 60000
})
this.setData({
isDoing: true
})
let funcItem = event.target.dataset.item
App.wxRequest({
url: '/api/v1/order/cancelOrder',
data: {
'orderId': funcItem.id,
'type': 1,
},
success: (response) => {
App.ui.showToast({
'iconType': 'success',
'title': '删除成功'
})
this.setData({
'isDoing': false,
'orderList': [],
'orderPages': 1,
})
this.queryOrder()
}
})
},
fail: () => {},
})
},
/**
* 检验数据是否都通过
......
<m-toast></m-toast>
<m-dialog></m-dialog>
<!-- 订单分类选择 -->
<view class="navigation-order row con-b align-c">
<image src="{{imageBase + 'icon/arrow-l-1.png'}}" bindtap="onNavigationBack"></image>
......@@ -141,6 +144,4 @@
<image src="{{imageBase + 'icon/close-1.png'}}"></image>
</view>
</view>
</view>
<!-- 确认框 -->
<l-dialog />
\ No newline at end of file
</view>
\ No newline at end of file
......@@ -4,14 +4,14 @@ page {
}
.fixed-tab {
z-index: 3;
position: fixed;
background: #fff;
top: 176rpx;
z-index: 99;
background: #fff;
}
.navigation-order {
z-index: 1700;
z-index: 3;
position: fixed;
top: 0;
left: 0;
......@@ -45,7 +45,7 @@ page {
/* 订单类型选择 */
.order-type-selection {
z-index: 1700;
z-index: 4;
position: fixed;
top: 176rpx;
left: 0;
......@@ -107,7 +107,7 @@ page {
font-size: 26rpx;
font-weight: 400;
line-height: 36rpx;
border-bottom: 4px #fff solid;
border-bottom: 4px rgba(0, 0, 0, 0) solid;
color: #959da9;
}
......
// pages/moreProblems/moreProblems.js
const app = getApp()
let App = getApp()
Page({
/**
......@@ -19,63 +18,12 @@ Page({
console.log('66');
console.log(e)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getCommonProblem(1)
this.getCommonProblem(2)
this.getCommonProblem(3)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
},
checkInTranform(e) {
let flag = !e.currentTarget.dataset.flag
let index = e.currentTarget.dataset.index;
......@@ -98,31 +46,30 @@ Page({
});
},
// 常见问题
getCommonProblem(type) {
let that = this
app.wxRequest({
getCommonProblem: function (type) {
App.wxRequest({
url: '/api/v1/smCommonProblem/getList',
data: {
type: type, // 1 入住 2门票 3 服务
top: '',
},
success: function(res) {
success: (res) => {
res.data.forEach(function(item) {
item.flag = false;
})
switch (type) {
case 1:
that.setData({
this.setData({
checkInProblems: res.data
})
break;
case 2:
that.setData({
this.setData({
ticketsProblems: res.data
})
break;
case 3:
that.setData({
this.setData({
serviceProblems: res.data
})
break;
......
<navigation class="navigation" titleText="常见问题" backIcon="/image/back.png"></navigation>
<m-nav titleText="常见问题"></m-nav>
<view class="container">
<view class="body">
<block wx:if="{{checkInProblems.length > 0}}">
......@@ -27,7 +26,6 @@
</l-collapse>
</view>
</view>
</block>
<block wx:if="{{ticketsProblems.length > 0}}">
......@@ -81,7 +79,5 @@
</view>
</view>
</block>
</view>
</view>
\ No newline at end of file
/* pages/moreProblems/moreProblems.wxss */
.body {
width: 670rpx;
padding-top: 200rpx;
padding-top: 60rpx;
}
.icon {
......
const App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
let App = getApp()
Page({
data: {
imageBase: App.globalData.appImageBase,
......@@ -34,23 +28,16 @@ Page({
focus: false,
remark: '',
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',
},
navigationScroll: 0,
onLoad: function (options) {
this.getCommonProblem();
this.setData({
height: wx.getSystemInfoSync().windowHeight, //获取屏幕的高度
isIphoneX: wx.getSystemInfoSync().model.indexOf("iPhone X")
})
},
//获取焦点的时候
linfocus(e) {
this.setData({
......@@ -174,16 +161,6 @@ Page({
});
console.log(this.data.commonProblems);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getCommonProblem();
this.setData({
height: wx.getSystemInfoSync().windowHeight, //获取屏幕的高度
isIphoneX: wx.getSystemInfoSync().model.indexOf("iPhone X")
})
},
// 提交意见反馈
feedbackSubmit() {
......@@ -191,33 +168,32 @@ Page({
return
}
let that = this
wx.lin.showToast({
icon: 'loading',
title: '提交中',
show: true,
mask: true,
duration: 1000 * 60,
App.ui.showToast({
'iconType': 'loading',
'title': '提交中',
'duration': 60000
})
App.wxRequest({
url: '/api/v1/smFeedback/doFeedBack',
data: {
content: that.data.remark
},
success: function(res) {
wx.lin.showToast({
image: '/image/success.png',
title: '提交成功',
success: (res) => {
App.ui.showToast({
'iconType': 'success',
'title': '提交成功',
})
that.setData({
this.setData({
inputHidden: true,
title: '客服中心',
remark: '',
})
},
fail: function(err) {
wx.lin.showToast({
image: '/image/error.png',
title: err.msg,
fail: (err) => {
App.ui.showToast({
'iconType': 'error',
'title': err.msg,
})
}
})
......@@ -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>
<navigation class="navigation" titleText="{{title}}" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<m-toast></m-toast>
<m-nav titleText="{{title}}" styleIndex="{{2}}" isOccupy="{{false}}"></m-nav>
<view style="height:{{height}}px;background-color:white;">
<image class="banner-img" src="http://upload.miaomiao-bao.com/70161202008161703131621.jpg"></image>
<view class="customer-body">
......
......@@ -2,8 +2,6 @@ let App = getApp()
Page({
data: {
winToastText: '操作成功',
winToast: false,
isDoing: false,
showNotice: false,
swiperCurrent: 0,
......@@ -27,7 +25,6 @@ Page({
shopConfig: App.globalData.shopId,
shopAppId: "",
marginTop: 0,
},
onLoad: function (options) {
......@@ -102,7 +99,6 @@ Page({
// 去支付
onOrderPay: function (event) {
// 数据校验不通过
let that = this
let wxRequest = this.data.orderInfo.wxRequest
// 待支付返回的wx支付参数
if (wxRequest) {
......@@ -113,7 +109,7 @@ Page({
signType: wxRequest.signType,
paySign: wxRequest.paySign,
success(res) {
that.queryOrderDetail()
this.queryOrderDetail()
},
fail(res) {}
})
......@@ -129,39 +125,34 @@ Page({
// 删除订单&取消订单
// type :1删除0取消
onDelOrCancelOrder: function (event) {
let type = event.currentTarget.dataset.type
let that = this
let tip = type == 1 ? '删除订单' : '取消订单'
wx.lin.showDialog({
type: "confirm",
title: "",
content: "是否确认" + tip,
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
wx.showLoading({
title: '处理中',
mask: true
})
this.setData({
isDoing: true,
})
App.wxRequest({
url: '/api/v1/order/cancelOrder',
data: {
'orderId': this.data.orderInfo.id,
'type': type,
},
success: (response) => {
wx.hideLoading()
let winToastText = type == 1 ? '订单删除成功' : '订单取消成功'
that.setData({
isDoing: false,
winToast: true,
winToastText: winToastText
})
setTimeout(function () {
App.ui.showDialog({
type: 'confirm',
title: type == 0 ? '是否确认取消订单' : '是否确认删除订单',
content: type == 0 ? '取消后无法恢复' : '删除后无法恢复',
cancel: type == 0 ? '暂不取消' : '取消',
confirm: type == 0 ? '确定取消' : '确定',
success: () => {
App.ui.showToast({
iconType: 'loading',
title: '处理中',
duration: 60000,
})
this.setData({
isDoing: true,
})
App.wxRequest({
url: '/api/v1/order/cancelOrder',
data: {
'orderId': this.data.orderInfo.id,
'type': type,
},
success: (response) => {
App.ui.showToast({
iconType: 'success',
title: type == 1 ? '订单删除成功' : '订单取消成功',
ending: function () {
console.log('ending')
if (type == 1) {
// 删除操作
wx.navigateBack({
......@@ -170,21 +161,20 @@ Page({
} else {
// 取消操作
let state = `orderInfo.state`
that.setData({
this.setData({
isDoing: false,
[state]: -1
})
}
}, 2000)
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
this.setData({
isDoing: false,
})
}
})
}
})
},
// 使用须知
handleNotice() {
......@@ -195,11 +185,11 @@ Page({
},
// 一键扫码
onFastScan: function (event) {
wx.showLoading({
App.ui.showToast({
iconType: 'loading',
title: '加载中',
duration: 60000,
})
App.wxRequest({
url: '/api/v1/order/getVolumesByOrderId',
......@@ -207,7 +197,7 @@ Page({
'orderId': this.data.orderInfo.id
},
success: (response) => {
wx.hideLoading()
App.ui.hideToast()
let list = response.data
this.setData({
showCodePopup: true,
......@@ -236,7 +226,6 @@ Page({
* @returns
*/
queryOrderDetail: function () {
let that = this
App.wxRequest({
url: '/api/v1/order/getOrderDetail',
data: {
......@@ -272,8 +261,6 @@ Page({
funcOrderInfo.expireTime = App.modular.miment(funcDate).format('MM月DD日 ') + funcTime[0] + ' - ' + funcTime[1]
}
// 设置印章
let shopName = funcResponse.officeName;
let shopFilter = this.data.shopConfig.filter(
......@@ -308,13 +295,13 @@ Page({
let residueStamp = endTime - now
let residuePayTime = App.modular.miment(residueStamp).format('mm:ss')
if (residueStamp > 0) {
that.setData({
this.setData({
residuePayTime: residuePayTime
})
} else {
clearInterval(timeInter)
let state = `orderInfo.state`
that.setData({
this.setData({
[state]: -1
})
}
......@@ -337,8 +324,10 @@ Page({
// 弹出单张二维码
onCouponCode: function (event) {
let funcOrderInfo = event.currentTarget.dataset.item
wx.showLoading({
App.ui.showToast({
iconType: 'loading',
title: '加载中',
duration: 60000,
})
App.wxRequest({
url: '/api/v1/volume/getVolume',
......@@ -346,9 +335,7 @@ Page({
'volumeId': funcOrderInfo.codeId
},
success: (response) => {
wx.hideLoading({
success: (res) => {},
})
App.ui.hideToast()
let funcResponse = response.data
let funcCodeInfo = {
'codeNo': funcResponse.serialNumber,
......@@ -363,21 +350,10 @@ Page({
})
},
// 多二维码 复制券码
setClipboard(e) {
const code = e.currentTarget.dataset.code
setClipboard: function (event) {
const code = event.currentTarget.dataset.code
wx.setClipboardData({
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>
<view class="container padding-bottom-166" style="margin-top: {{marginTop + 'px'}}">
<m-toast></m-toast>
<m-dialog></m-dialog>
<m-nav titleText="订单详情"></m-nav>
<view class="container">
<!-- 订单状态 -->
<view class="state row con-c">
<view class="state-content col con-c" wx:if="{{orderInfo.state === 0}}">
......@@ -362,9 +363,4 @@
</view>
</scroll-view>
</view>
</l-popup>
<!-- 成功提示 -->
<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
</l-popup>
\ No newline at end of file
/* 订单状态 */
.state {
width: 750rpx;
}
.container {
/* margin-top: 160rpx; */
margin-top: 60rpx;
}
.state-content {
......@@ -839,10 +837,6 @@
line-height: 42rpx;
}
.padding-bottom-166 {
padding-bottom: 166rpx;
}
.footer-btn {
position: fixed;
bottom: 0;
......
......@@ -961,10 +961,10 @@ Page({
success: (response) => {
if (/ 商品不存在/.test(response.data.msg)) {
wx.setStorageSync('shoppingCartBuffer', [])
wx.lin.showToast({
App.ui.showToast({
iconType: 'error',
title: '商品已下架,请重新下单。',
icon: 'error',
success: () => {
ending: () => {
wx.navigateBack({
delta: 2
})
......@@ -975,10 +975,10 @@ Page({
if (/价格不一致/.test(response.data.msg)) {
wx.setStorageSync('shoppingCartBuffer', [])
wx.lin.showToast({
App.ui.showToast({
iconType: 'error',
title: '价格已变更,请重新下单。',
icon: 'error',
success: () => {
ending: () => {
wx.navigateBack({
delta: 2
})
......@@ -988,9 +988,9 @@ Page({
}
if (/订单未支付/.test(response.data.msg)) {
wx.lin.showToast({
App.ui.showToast({
iconType: 'error',
title: response.data.msg,
icon: 'error',
})
this.setData({
isPaySubmit: false,
......@@ -1081,9 +1081,9 @@ Page({
},
success: (response) => {
if (/请勿重复报名/.test(response.data.msg)) {
wx.lin.showToast({
App.ui.showToast({
iconType: 'error',
title: response.data.msg,
icon: 'error',
})
this.setData({
isPaySubmit: false,
......@@ -1092,9 +1092,9 @@ Page({
}
if (/名额不足/.test(response.data.msg)) {
wx.lin.showToast({
App.ui.showToast({
iconType: 'error',
title: response.data.msg,
icon: 'error',
})
this.setData({
isPaySubmit: false,
......@@ -1103,9 +1103,9 @@ Page({
}
if (/总价格不能为空/.test(response.data.msg)) {
wx.lin.showToast({
App.ui.showToast({
iconType: 'error',
title: response.data.msg,
icon: 'error',
})
this.setData({
isPaySubmit: false,
......@@ -1114,9 +1114,9 @@ Page({
}
if (/价格不一致/.test(response.data.msg)) {
wx.lin.showToast({
App.ui.showToast({
iconType: 'error',
title: response.data.msg,
icon: 'error',
})
return
}
......@@ -1173,7 +1173,6 @@ Page({
App.globalData.payStateTimer = setInterval(() => {
if (!pagePayId) return
App.wxRequest({
url: '/api/v1/order/getOrderStatus',
data: {
......
<l-toast></l-toast>
<m-toast></m-toast>
<view class="container">
<!-- winBuyContent -->
<view class="buy-content" wx:if="{{winBuyContent}}">
......@@ -244,7 +243,7 @@
<view class="contact" wx:if="{{winContact && !winNoticeDetail && !winStockTip}}">
<view class="contact-title col">
<text>{{contactTitle}}</text>
<text hidden>仅用于接收订单确认短信</text>
<text>仅用于接收订单确认短信</text>
</view>
<view class="contact-input col">
<text class="contact-input-mark">姓名</text>
......
......@@ -15,5 +15,25 @@
* query
*
* 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 @@
.container {
display: flex;
flex-direction: column;
justify-content: 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