Commit 4bb50609 by 严立

LL - 服务首页

parent 538f3685
const App = getApp() const App = getApp()
Page({ Page({
data: { data: {
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase, resourcesBase: App.globalData.appResourcesBase,
option: {}, option: {},
userInfo: {},
greetingName: '', // 问候姓名
greetingMessage: '', // 问候消息
phone: '13316748039', phone: '13316748039',
hotline: false, //客服热线 hotline: false, //客服热线
...@@ -17,9 +21,12 @@ Page({ ...@@ -17,9 +21,12 @@ Page({
onLoad: function (option) { onLoad: function (option) {
this.setData({ this.setData({
option: option option: option,
userInfo: wx.getStorageSync('userInfo')
}) })
this.setGreetingMessage()
// formPage=order&shopAppId=1&commodityType=5 // formPage=order&shopAppId=1&commodityType=5
}, },
...@@ -28,6 +35,54 @@ Page({ ...@@ -28,6 +35,54 @@ Page({
}, },
/** /**
* 问候消息
* @function
* @param {object} - funcEvent
* @returns
*/
setGreetingMessage: function () {
let funcHour = Number(App.modular.miment().format('hh'))
let funcMinute = Number(App.modular.miment().format('mm'))
let funcTime = [{
'min': 0,
'max': 12,
'message': '上午好!'
}, {
'min': 12,
'max': 18,
'message': '下午好!'
}, {
'min': 18,
'max': 24,
'message': '晚上好!'
}]
let funcIndex = 0
for (let i = 0, l = funcTime.length; i < l; i ++) {
// 判断小时区间
if (funcTime[i].min < funcHour && funcHour <= funcTime[i].max) {
// 如果小时区间等于该区间最大数值,那么分钟不为零时递增一个区间
if (funcHour === funcTime[i].max && 0 < funcMinute) {
funcIndex = i + 1
} else {
funcIndex = i
}
break
}
}
let funcGreetingName = this.data.userInfo.name
if (funcGreetingName.length > 5) funcGreetingName = funcGreetingName.substring(0, 5) + '...'
if (funcGreetingName === '') funcGreetingName = 'Hello,'
this.setData({
greetingName: funcGreetingName,
greetingMessage: funcTime[funcIndex].message
})
},
/**
* 查询推荐商品 * 查询推荐商品
* @function * @function
* @param {object} - funcEvent * @param {object} - funcEvent
...@@ -190,6 +245,7 @@ Page({ ...@@ -190,6 +245,7 @@ Page({
'logo': funcShopId[i].logo, 'logo': funcShopId[i].logo,
'cover': funcShopId[i].cover, 'cover': funcShopId[i].cover,
'shopType': funcShopType, 'shopType': funcShopType,
'commodityLogo': funcShopId[i].commodityLogo
} }
wx.setStorageSync('shopInfoBuffer', funcShopInfo) wx.setStorageSync('shopInfoBuffer', funcShopInfo)
break break
......
<navigation class="navigation"></navigation> <navigation class="navigation"></navigation>
<view class="container"> <view class="container">
<view class="title"> <!-- 问候订制 -->
<image src="{{resourcesBase + 'commodity/home/title.png'}}" class="title_img"></image> <view class="greeting">
<text>{{greetingName + greetingMessage}}</text>
</view> </view>
<!-- 商店 --> <!-- 商店 -->
......
...@@ -11,12 +11,6 @@ ...@@ -11,12 +11,6 @@
text-align: left; text-align: left;
} }
.title_img {
width: 214rpx;
height: 50rpx;
margin-top: 128rpx;
}
.greetings_body { .greetings_body {
width: 750rpx; width: 750rpx;
height: height; height: height;
...@@ -182,14 +176,17 @@ ...@@ -182,14 +176,17 @@
font-weight: 500; font-weight: 500;
} }
.title { .greeting {
width: 750rpx; width: 750rpx;
height: 280rpx; padding: 140rpx 46rpx 130rpx 46rpx;
} }
.title image { .greeting text {
width: 750rpx; height: 82rpx;
height: 80rpx; font-size: 58rpx;
font-weight: 500;
line-height: 82rpx;
color: #15191F;
} }
/* 商店样式 */ /* 商店样式 */
......
...@@ -38,16 +38,18 @@ Page({ ...@@ -38,16 +38,18 @@ Page({
option: option option: option
}) })
console.log(this.data.option)
this.setSideBarStyle() this.setSideBarStyle()
},
onShow: function () {
this.resetShoppingCart() this.resetShoppingCart()
this.setCartAnimation() this.setCartAnimation()
this.setShopInfo() this.setShopInfo()
this.querySideBar() this.querySideBar()
},
onShow: function () {
if (wx.getStorageSync('shoppingCartBuffer').length === 0) { if (wx.getStorageSync('shoppingCartBuffer').length === 0) {
this.resetShoppingCart() this.resetShoppingCart()
} else { } else {
...@@ -346,8 +348,6 @@ Page({ ...@@ -346,8 +348,6 @@ Page({
funcItem = this.data.commodityDetail funcItem = this.data.commodityDetail
} }
console.log(funcItem)
// 判断购物车中是否存在同类商品 // 判断购物车中是否存在同类商品
// 修改相应的商品数量 // 修改相应的商品数量
if (funcShoppingCart.length !== 0) { if (funcShoppingCart.length !== 0) {
......
...@@ -94,6 +94,7 @@ Page({ ...@@ -94,6 +94,7 @@ Page({
'priceType': 1, 'priceType': 1,
'describe': funcResponse[i].synopsis, 'describe': funcResponse[i].synopsis,
'tags': funcResponse[i].tags, 'tags': funcResponse[i].tags,
'notificationId': funcResponse[i].notificationId, // 下单须知
} }
let funcUserType = wx.getStorageSync('userInfo').userType let funcUserType = wx.getStorageSync('userInfo').userType
...@@ -135,6 +136,7 @@ Page({ ...@@ -135,6 +136,7 @@ Page({
'priceType': 1, 'priceType': 1,
'describe': funcResponse[i].synopsis, 'describe': funcResponse[i].synopsis,
'tags': funcResponse[i].tags, 'tags': funcResponse[i].tags,
'notificationId': funcResponse[i].notificationId, // 下单须知
} }
let funcUserType = wx.getStorageSync('userInfo').userType let funcUserType = wx.getStorageSync('userInfo').userType
......
...@@ -2,92 +2,59 @@ let App = getApp() ...@@ -2,92 +2,59 @@ let App = getApp()
Page({ Page({
data: { data: {
shopInfo: {}, imageBase: App.globalData.appImageBase,
commodityTypeId: '', resourcesBase: App.globalData.appResourcesBase,
commodityList: [],
winLoading: false, banner: [],
projectType: 1, // 1 儿童营地,2 - SPA,3 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
bannerIndex: 0, bannerIndex: 0,
banner: [
{ shopAppId: [
id: 0,
img: ''
},
{
id: 1,
img: ''
},
{ {
id: 2, 'appId': 1,
img: '' 'commodityType': 3,
}, {
'appId': 7,
'commodityType': 2,
}, {
'appId': 3,
'commodityType': 1,
} }
], ],
projectAll: { shopCommodityData: [],
projectArt: {
projectType: 3,
btn: '购买门票',
titleImg: '',
list: []
},
projectSpa: {
projectType: 2,
btn: '查看服务',
list: []
},
projectChild: {
projectType: 1,
btn: '购买门票',
list: []
}
}
},
onLoad: function (options) {
this.setData({
shopInfo: wx.getStorageSync('shopInfoBuffer')
})
this.queryCommodityTab()
}, },
queryCommodityTab: function () { onLoad: function (options) {
App.wxRequest({ for (let i = 0, l = this.data.shopAppId.length; i < l; i++) {
url: '/api/v1/commodity/getClassifys', this.queryPassCheck(this.data.shopAppId[i].appId, this.data.shopAppId[i].commodityType, i)
data: {
'officeId': this.data.shopInfo.id,
'genre': this.data.shopInfo.shopType,
},
success: (response) => {
let funcResponse = response.data
this.setData({
commodityTypeId: funcResponse[0].id
})
this.queryCommodity()
} }
})
}, },
queryCommodity: function () { queryPassCheck: function (funcShopAppId, funcCommodityType, funcIndex) {
this.setData({ let funcShopId = ''
shopInfo: wx.getStorageSync('shopInfoBuffer') for (let i = 0, l = App.globalData.shopId.length; i < l; i++) {
}) if (funcShopAppId === App.globalData.shopId[i].appId) {
funcShopId = App.globalData.shopId[i].id
break
}
}
App.wxRequest({ App.wxRequest({
url: '/api/v1/commodity/getCommoditys', url: '/api/v1/commodity/getCommoditys',
data: { data: {
'officeId': this.data.shopInfo.id, 'officeId': funcShopId,
'classifyId': this.data.commodityTypeId, 'genre': funcCommodityType,
'genre': this.data.shopInfo.shopType,
}, },
success: (response) => { success: (response) => {
let funcCommodityList = [] let funcCommodityList = []
let funcResponse = response.data let funcResponse = response.data
switch (funcCommodityType) {
// 年卡月卡
case 1:
for (let i = 0, l = funcResponse.length; i < l; i++) { for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = { let funcItem = {
'id': funcResponse[i].id, // 商品标识 'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].classifyId, // 商品分类标识 'typeId': funcResponse[i].genre, // 商品类型
'inventoriesId': funcResponse[i].inventorie[0].inventoriesId, // 仓库标识 'inventoriesId': funcResponse[i].inventorie[0].inventoriesId, // 仓库标识
'name': funcResponse[i].name, 'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面 'cover': funcResponse[i].coverImg, // 商品封面
...@@ -97,9 +64,10 @@ Page({ ...@@ -97,9 +64,10 @@ Page({
'priceSpecialText': App.modular.utils.formatAmount(funcResponse[i].inventorie[0].ownerPrice), // 业主价文本格式 'priceSpecialText': App.modular.utils.formatAmount(funcResponse[i].inventorie[0].ownerPrice), // 业主价文本格式
'priceDiscount': funcResponse[i].inventorie[0].price, // 活动价 'priceDiscount': funcResponse[i].inventorie[0].price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcResponse[i].inventorie[0].price), // 活动价文本格式 'priceDiscountText': App.modular.utils.formatAmount(funcResponse[i].inventorie[0].price), // 活动价文本格式
'priceType': '', 'priceType': 1,
'describe': funcResponse[i].synopsis, 'describe': funcResponse[i].synopsis,
'tags': funcResponse[i].tags, 'tags': funcResponse[i].tags,
'notificationId': funcResponse[i].notificationId, // 下单须知
} }
let funcUserType = wx.getStorageSync('userInfo').userType let funcUserType = wx.getStorageSync('userInfo').userType
...@@ -115,24 +83,73 @@ Page({ ...@@ -115,24 +83,73 @@ Page({
funcItem.priceType = 3 funcItem.priceType = 3
} }
} }
funcCommodityList.push(funcItem) funcCommodityList.push(funcItem)
} }
break
// 普通商品
case 2:
// 门票商品
case 3:
default:
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,
'tags': funcResponse[i].tags,
'notificationId': funcResponse[i].notificationId, // 下单须知
}
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcItem.priceDiscount) {
funcItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
funcItem.priceType = 2
} else {
funcItem.priceType = 3
}
}
funcCommodityList.push(funcItem)
}
break
}
let funcShopCommodityData = this.data.shopCommodityData
funcShopCommodityData[funcIndex] = funcCommodityList
this.setData({ this.setData({
winLoading: false, shopCommodityData: funcShopCommodityData,
commodityList: funcCommodityList,
}) })
}, },
}) })
}, },
onBuy: function () {
console.log(JSON.stringify(this.data.shopCommodityData) )
},
/** /**
* banner 切换图片同步自定义标识组件 * banner 切换图片同步自定义标识组件
* @function * @function
* @param {object} - funcEvent * @param {object} - funcEvent
* @returns * @returns
*/ */
onSwiperChange: function (funcEvent) { eventSwiperChange: function (funcEvent) {
this.setData({ this.setData({
bannerIndex: funcEvent.detail.current bannerIndex: funcEvent.detail.current
}) })
......
...@@ -26,110 +26,132 @@ ...@@ -26,110 +26,132 @@
left: 0; left: 0;
} }
.project-wrapper { /* 门店样式 */
.shop-list {
background: #F3F4F6;
}
.shop-item {
width: 670rpx; width: 670rpx;
margin-top: 48rpx; margin: 48rpx 40rpx 0 40rpx;
padding: 36rpx 32rpx 14rpx; padding: 32rpx;
background-color: #fff; border-radius: 4px;
background: #FFFFFF;
} }
.project-title {
height: 88rpx; .shop-name {
background-color: #ccc; width: 606rpx;
height: 70rpx;
} }
.project-item {
margin-top: 48rpx; .shop-name image {
padding-bottom: 50rpx; margin-right: 20rpx;
border-bottom: 1px solid #E2E7EF; }
/* 商品信息样式 */
.commodity-item {
height: 214rpx;
margin-top: 50rpx;
border-bottom: 1px #E2E7EF solid;
} }
.project-item:last-child {
.commodity-item:last-child {
border-bottom: none; border-bottom: none;
} }
.project-cover { .commodity-cover image {
width: 128rpx; width: 128rpx;
height: 128rpx; height: 128rpx;
background-color: #ccc; margin-right: 24rpx;
background: #999999;
} }
.project-content { .commodity-describe {
margin-left: 24rpx; position: relative;
flex: 1; flex-grow: 1;
} }
.project-info { .commodity-describe text:nth-child(1) {
height: 42rpx;
}
.project-name {
height: 46rpx;
color: #15191F;
font-size: 30rpx; font-size: 30rpx;
font-weight: 600; font-weight: 500;
line-height: 42rpx;
color: #15191F;
overflow: hidden;
text-overflow: ellipsis;
} }
.project-msg text {
margin-top: 8rpx; .commodity-describe text:nth-child(2) {
color: #959DA9; position: absolute;
top: 54rpx;
left: 0;
max-width: 320rpx;
max-height: 120rpx;
border: 1px red solid;
background: #FFFFFF;
overflow: hidden;
font-size: 22rpx; font-size: 22rpx;
} font-weight: 400;
.project-price-wrapper { line-height: 40rpx;
flex: 1; word-wrap: break-word;
height: 100%; color: #959DA9;
width: 100%;
}
.project-price-special {
}
.price-wrap {
color: #EF4E4E;
letter-spacing: 2rpx;
display: table-cell;
vertical-align: bottom;
} }
.price-symbol { .commodity-price-symbol {
height: 32rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: 500;
line-height: 32rpx;
color: #EF4E4E;
} }
.price-special { .commodity-price-value {
font-size: 34rpx; height: 32rpx;
font-size: 32rpx;
font-weight: 500;
line-height: 32rpx;
color: #EF4E4E;
} }
.price-special-msg {
.commodity-price-special {
display: inline-block;
width: 78rpx; width: 78rpx;
height: 32rpx; height: 32rpx;
color: #E8D0AF; margin: 0 0 0 8rpx;
font-size: 18rpx; border-radius: 4px;
background: linear-gradient(180deg, #3F4357 0%, #252532 100%);
text-align: center; text-align: center;
font-size: 18rpx;
font-weight: 500;
line-height: 32rpx; line-height: 32rpx;
background: linear-gradient(180deg, #3F4357 0%, #252532 100%); color: #E8D0AF;
border-radius: 4rpx; }
.commodity-price-through {
margin-top: 12rpx;
} }
.project-price-old {
.commodity-price-through text {
height: 32rpx; height: 32rpx;
color: #959DA9; font-size: 22rpx;
font-weight: 400;
line-height: 32rpx; line-height: 32rpx;
text-decoration: line-through; text-decoration: line-through;
color: #959DA9;
} }
.price-old {
font-size: 22rpx;
}
.price-symbol-old {
font-size: 20rpx;
}
.project-buy-wrapper {
flex: 1;
} .commodity-price-operation button {
.project-buy-btn {
width: 120rpx; width: 120rpx;
height: 56rpx; height: 56rpx;
margin-top: 24rpx; margin-top: 24rpx;
color: #fff; border-radius: 4px;
font-size: 22rpx; background: #86C5E1;
line-height: 56rpx;
text-align: center;
background-color: #86C5E1;
border-radius: 4rpx;
}
image { font-size: 22rpx;
width: 100%; font-weight: 500;
height: 100%; line-height: 32rpx;
color: #FFFFFF;
} }
\ No newline at end of file
...@@ -7,7 +7,6 @@ Page({ ...@@ -7,7 +7,6 @@ Page({
shopId: '', shopId: '',
shopName: '',
shopLogo: '', shopLogo: '',
shoppingCart: [], // 购物车列表 shoppingCart: [], // 购物车列表
shoppingCartSelection: 0, // 购物车选择数量 shoppingCartSelection: 0, // 购物车选择数量
...@@ -101,8 +100,7 @@ Page({ ...@@ -101,8 +100,7 @@ Page({
let funcShopInfo = wx.getStorageSync('shopInfoBuffer') let funcShopInfo = wx.getStorageSync('shopInfoBuffer')
this.setData({ this.setData({
shopId: funcShopInfo.id, shopId: funcShopInfo.id,
shopName: funcShopInfo.name, shopLogo: funcShopInfo.commodityLogo
shopLogo: funcShopInfo.logo
}) })
console.log(this.data.shopLogo) console.log(this.data.shopLogo)
...@@ -161,7 +159,7 @@ Page({ ...@@ -161,7 +159,7 @@ Page({
let funcShoppingCart = this.data.shoppingCart let funcShoppingCart = this.data.shoppingCart
if (funcShoppingCart[funcIndex].quantityMax <= funcShoppingCart[funcIndex].quantity) return if (funcShoppingCart[funcIndex].quantityMax <= funcShoppingCart[funcIndex].quantity) return
funcShoppingCart[funcIndex].quantity = funcShoppingCart[funcIndex].quantity + 1 funcShoppingCart[funcIndex].quantity = funcShoppingCart[funcIndex].quantity + 100
this.setData({ this.setData({
shoppingCart: funcShoppingCart shoppingCart: funcShoppingCart
}) })
......
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
<l-toast show="{{winToast}}" icon="error" title="请选购商品后结算"></l-toast> <l-toast show="{{winToast}}" icon="error" title="请选购商品后结算"></l-toast>
<view class="container" wx:if="{{shoppingCart.length > 0}}"> <view class="container" wx:if="{{shoppingCart.length > 0}}">
<view class="shop-info row align-c"> <view class="shop-info row con-b align-c">
<image wx:if="{{shopLogo}}" src="{{resourcesBase + shopLogo}}" mode="left"></image> <image wx:if="{{shopLogo}}" src="{{resourcesBase + shopLogo}}" mode="widthFix"></image>
<text>{{shopName}}</text>
<text bindtap="onClearn">清空</text> <text bindtap="onClearn">清空</text>
</view> </view>
......
...@@ -12,33 +12,23 @@ ...@@ -12,33 +12,23 @@
.shop-info { .shop-info {
width: 750rpx; width: 750rpx;
height: 116rpx; height: 110rpx;
padding: 16rpx 40rpx; padding: 0 30rpx 0 40rpx;
font-size: 30rpx; font-size: 30rpx;
} }
.shop-info > image { .shop-info > image {
max-width: 120rpx; width: 380rpx;
height: 100%; height: 110rpx;
} }
.shop-info > text:nth-child(2) { .shop-info > text {
flex-grow: 1;
height: 42rpx; height: 42rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: 500; font-weight: 500;
line-height: 42rpx; line-height: 42rpx;
color: #586A46; color: #586A46;
} }
.shop-info > text:nth-child(3) {
flex-grow: 1;
height: 100rpx;
text-align: right;
line-height: 100rpx;
color: #656e7b;
}
.l-content { .l-content {
color: #959da9 !important; color: #959da9 !important;
} }
...@@ -134,6 +124,8 @@ ...@@ -134,6 +124,8 @@
font-weight: 400; font-weight: 400;
line-height: 32rpx; line-height: 32rpx;
color: #959DA9; color: #959DA9;
text-decoration: line-through;
} }
.list-item-quantity { .list-item-quantity {
......
...@@ -15,13 +15,15 @@ Page({ ...@@ -15,13 +15,15 @@ Page({
address: '', address: '',
}, },
onLoad: function (options) { onLoad: function (options) {
let funcUserInfo = wx.getStorageSync('userInfo')
let mobile = wx.getStorageSync('mobile')
let nickName = wx.getStorageSync('nickName') let mobile = funcUserInfo.phone
let avatarUrl = wx.getStorageSync('avatarUrl') let nickName = funcUserInfo.name
let sex = wx.getStorageSync('sex') let avatarUrl = funcUserInfo.avatar
let birthday = wx.getStorageSync('birthday') let sex = funcUserInfo.sex
let address = wx.getStorageSync('address') let birthday = funcUserInfo.birthday
let address = birthday.address
this.setData({ this.setData({
mobile: this.toHide(mobile), mobile: this.toHide(mobile),
nickName: nickName, nickName: nickName,
......
...@@ -4,6 +4,9 @@ Page({ ...@@ -4,6 +4,9 @@ Page({
data: { data: {
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase, resourcesBase: App.globalData.appResourcesBase,
option: {},
orderTypeTitle: '全部分类', orderTypeTitle: '全部分类',
orderTypeHeight: 0, orderTypeHeight: 0,
orderType: [], orderType: [],
...@@ -34,6 +37,7 @@ Page({ ...@@ -34,6 +37,7 @@ Page({
isFinished: false isFinished: false
}, },
onLoad: function (options) { onLoad: function (options) {
this.setData({ option: options })
this.setOrderType() this.setOrderType()
}, },
...@@ -219,9 +223,15 @@ Page({ ...@@ -219,9 +223,15 @@ Page({
}, },
onNavigationBack: function () { onNavigationBack: function () {
if (this.data.option.fromPage) {
wx.switchTab({
url: '/pages/mine/home/home',
})
} else {
wx.navigateBack({ wx.navigateBack({
'delta': 1 'delta': 1
}) })
}
}, },
/** /**
...@@ -451,14 +461,12 @@ Page({ ...@@ -451,14 +461,12 @@ Page({
* @returns * @returns
*/ */
onOrderAgain: function (event) { onOrderAgain: function (event) {
let item = event.currentTarget.dataset.item let item = event.currentTarget.dataset.item
let commodityType = item.goodType let commodityType = item.goodType
let shopAppId = wx.getStorageSync('shopInfoBuffer') ? wx.getStorageSync('shopInfoBuffer').appId : "" let shopAppId = wx.getStorageSync('shopInfoBuffer') ? wx.getStorageSync('shopInfoBuffer').appId : ""
wx.navigateTo({ wx.navigateTo({
url: `/pages/commodity/menu-food/menu-food?formPage=order&shopAppId=${shopAppId}&commodityType=${commodityType}`, url: `/pages/commodity/menu-food/menu-food?formPage=order&shopAppId=${shopAppId}&commodityType=${commodityType}`,
}) })
}, },
/** /**
...@@ -468,7 +476,6 @@ Page({ ...@@ -468,7 +476,6 @@ Page({
* @returns * @returns
*/ */
onReachBottom: function () { onReachBottom: function () {
this.setData({ this.setData({
orderPages: this.data.orderPages + 1 orderPages: this.data.orderPages + 1
}) })
......
...@@ -308,6 +308,7 @@ Page({ ...@@ -308,6 +308,7 @@ Page({
setShoppingCartData: function () { setShoppingCartData: function () {
// 读取上级页面的购物车数据,默认选中所有。 // 读取上级页面的购物车数据,默认选中所有。
let funcShoppingCart = wx.getStorageSync('shoppingCartBuffer') let funcShoppingCart = wx.getStorageSync('shoppingCartBuffer')
console.log(JSON.stringify(funcShoppingCart))
// 设置商品的最终提交价格 // 设置商品的最终提交价格
let funcPayAmount = 0 let funcPayAmount = 0
...@@ -378,9 +379,6 @@ Page({ ...@@ -378,9 +379,6 @@ Page({
* @returns * @returns
*/ */
setStock: function () { setStock: function () {
console.log('funcCommodity')
console.log(this.data.shoppingCartList)
let funcItem = this.data.shoppingCartList[0] let funcItem = this.data.shoppingCartList[0]
App.wxRequest({ App.wxRequest({
...@@ -453,6 +451,8 @@ Page({ ...@@ -453,6 +451,8 @@ Page({
clearTimeout(funcTimer) clearTimeout(funcTimer)
}, 100) }, 100)
console.log(this.data.shoppingCartList)
App.wxRequest({ App.wxRequest({
url: '/api/v1/commodity/getNotification', url: '/api/v1/commodity/getNotification',
data: { data: {
...@@ -592,12 +592,14 @@ Page({ ...@@ -592,12 +592,14 @@ Page({
// 定位到当前问题位置 // 定位到当前问题位置
if (funcErrorIndex !== null) { if (funcErrorIndex !== null) {
const funcQuery = wx.createSelectorQuery() const funcQuery = wx.createSelectorQuery()
funcQuery.selectAll('.register-item-title').boundingClientRect() funcQuery.selectAll('.contact-input-mark').boundingClientRect()
funcQuery.exec((response) => { funcQuery.exec((response) => {
console.log(response) let funcScrollTop = response[0][funcErrorIndex].top
if (funcScrollTop !== 0) {
wx.pageScrollTo({ wx.pageScrollTo({
scrollTop: response[0][funcErrorIndex].top scrollTop: response[0][funcErrorIndex].top
}) })
}
}) })
} }
return funcPass return funcPass
...@@ -663,7 +665,30 @@ Page({ ...@@ -663,7 +665,30 @@ Page({
'smPersonalDetails': funcUserInfo 'smPersonalDetails': funcUserInfo
}, },
success: (response) => { success: (response) => {
console.log(response) if (/价格不一致/.test(response.data.msg)) {
wx.lin.showToast({
title: '价格已变更,请重新下单。',
icon: 'error',
success: () => {
wx.navigateBack({
delta: 2
})
}
})
return
}
if (/订单未支付/.test(response.data.msg)) {
wx.lin.showToast({
title: response.data.msg,
icon: 'error',
})
this.setData({
isPaySubmit: false,
})
return
}
if (/库存不足/.test(response.data.msg)) { if (/库存不足/.test(response.data.msg)) {
let funcList = [] let funcList = []
for (let i = 0, l = response.data.data.list.length; i < l; i++) { for (let i = 0, l = response.data.data.list.length; i < l; i++) {
...@@ -763,7 +788,7 @@ Page({ ...@@ -763,7 +788,7 @@ Page({
} else { } else {
// 取消支付直接进入订单 // 取消支付直接进入订单
wx.reLaunch({ wx.reLaunch({
url: '/pages/pay/order/order' url: '/pages/mine/order/order?fromPage=pay'
}) })
} }
}, },
......
<!-- 购买须知详情 --> <l-toast></l-toast>
<view class="notice-detail" wx:if="{{winNoticeDetail}}" bindtap="onNoticeClose">
<view class="notice-item" animation="{{animation}}">
<view class="notice-title">
<text>{{noticeText}}</text>
</view>
<view class="notice-rich">
<rich-text nodes="{{noticeDetail}}"></rich-text>
</view>
</view>
</view>
<view class="container"> <view class="container">
<!-- winBuyContent --> <!-- winBuyContent -->
...@@ -201,7 +191,7 @@ ...@@ -201,7 +191,7 @@
<text>仅用于接收订单确认短信</text> <text>仅用于接收订单确认短信</text>
</view> </view>
<view class="contact-input col"> <view class="contact-input col">
<text>姓名</text> <text class="contact-input-mark">姓名</text>
<input placeholder="请输入姓名" data-type="name" data-index="{{0}}" bindblur="onInputBlur"></input> <input placeholder="请输入姓名" data-type="name" data-index="{{0}}" bindblur="onInputBlur"></input>
<text>{{registerInfo[0].errorName}}</text> <text>{{registerInfo[0].errorName}}</text>
</view> </view>
...@@ -227,7 +217,7 @@ ...@@ -227,7 +217,7 @@
<text>{{registerTitle + (index + 1)}}</text> <text>{{registerTitle + (index + 1)}}</text>
</view> </view>
<view class="contact-input col"> <view class="contact-input col">
<text>姓名</text> <text class="contact-input-mark">姓名</text>
<input placeholder="请输入姓名" data-type="name" data-index="{{index}}" bindblur="onInputBlur"></input> <input placeholder="请输入姓名" data-type="name" data-index="{{index}}" bindblur="onInputBlur"></input>
<text>{{item.errorName}}</text> <text>{{item.errorName}}</text>
</view> </view>
...@@ -262,6 +252,21 @@ ...@@ -262,6 +252,21 @@
<cover-view class="appointment-confirm row con-c align-c">确认预约</cover-view> <cover-view class="appointment-confirm row con-c align-c">确认预约</cover-view>
</cover-view> </cover-view>
<!-- 购买须知详情 -->
<view class="notice-detail" wx:if="{{winNoticeDetail}}" bindtap="onNoticeClose">
<view class="notice-item" animation="{{animation}}">
<view class="notice-title">
<text>{{noticeText}}</text>
</view>
<view class="notice-rich">
<rich-text nodes="{{noticeDetail}}"></rich-text>
</view>
</view>
</view>
<!-- 未支付订单超额提示 -->
<!-- 库存不足提示 --> <!-- 库存不足提示 -->
<view class="stock-mask row con-c align-c" wx:if="{{winStockTip}}"> <view class="stock-mask row con-c align-c" wx:if="{{winStockTip}}">
<view class="stock col con-c align-c"> <view class="stock col con-c align-c">
......
...@@ -915,6 +915,8 @@ ...@@ -915,6 +915,8 @@
.stock-info { .stock-info {
width: 526rpx; width: 526rpx;
max-height: 480rpx;
overflow-y: scroll;
} }
.stock-close { .stock-close {
......
...@@ -26,7 +26,6 @@ let output = { ...@@ -26,7 +26,6 @@ let output = {
*/ */
formatAmount: function (funcAmountValue) { formatAmount: function (funcAmountValue) {
if (!funcAmountValue && funcAmountValue !== 0) return if (!funcAmountValue && funcAmountValue !== 0) return
console.log(funcAmountValue, funcAmountValue.toString().length)
switch (funcAmountValue.toString().length) { switch (funcAmountValue.toString().length) {
case 1: case 1:
funcAmountValue = '00' + funcAmountValue funcAmountValue = '00' + funcAmountValue
......
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