Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
严立
/
mini-shimao
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c05279b8
authored
Sep 16, 2020
by
严立
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
LL - 商品购买问题修复
parent
862a7ead
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
177 additions
and
45 deletions
app.js
pages/commodity/home/home.js
pages/commodity/home/home.wxml
pages/commodity/menu-food/menu-food.js
pages/commodity/menu-food/menu-food.wxml
pages/commodity/menu-food/menu-food.wxss
pages/commodity/shopping-cart/shopping-cart.js
pages/commodity/shopping-cart/shopping-cart.wxss
pages/home/guide/guide.js
pages/home/guide/guide.wxml
pages/home/guide/js/point.js
pages/pay/order-input/order-input.js
pages/pay/order-input/order-input.wxml
pages/pay/order-input/order-input.wxss
utils/utils.js
app.js
View file @
c05279b8
...
@@ -14,6 +14,7 @@ App({
...
@@ -14,6 +14,7 @@ App({
appImageBase
:
'../../../image/'
,
appImageBase
:
'../../../image/'
,
appResourcesBase
:
'https://sm-web.meiqicloud.com/userfiles/appResourcesS2/'
,
appResourcesBase
:
'https://sm-web.meiqicloud.com/userfiles/appResourcesS2/'
,
shopId
:
iEnvironmental
.
shopId
,
shopId
:
iEnvironmental
.
shopId
,
pointInfo
:
iEnvironmental
.
pointInfo
,
payStateTimer
:
0
,
payStateTimer
:
0
,
...
@@ -67,7 +68,7 @@ App({
...
@@ -67,7 +68,7 @@ App({
}
}
}
else
if
(
402
==
code
)
{
// token失效
}
else
if
(
402
==
code
)
{
// token失效
this
.
refreshToken
({
this
.
refreshToken
({
success
:
function
()
{
success
:
()
=>
{
this
.
wxRequest
(
obj
)
this
.
wxRequest
(
obj
)
}
}
})
})
...
...
pages/commodity/home/home.js
View file @
c05279b8
...
@@ -4,6 +4,8 @@ Page({
...
@@ -4,6 +4,8 @@ Page({
imageBase
:
App
.
globalData
.
appImageBase
,
imageBase
:
App
.
globalData
.
appImageBase
,
resourcesBase
:
App
.
globalData
.
appResourcesBase
,
resourcesBase
:
App
.
globalData
.
appResourcesBase
,
option
:
{},
phone
:
'13316748039'
,
phone
:
'13316748039'
,
hotline
:
false
,
//客服热线
hotline
:
false
,
//客服热线
...
@@ -13,8 +15,12 @@ Page({
...
@@ -13,8 +15,12 @@ Page({
shopRecommendD
:
[],
// 底部第二商店推荐
shopRecommendD
:
[],
// 底部第二商店推荐
},
},
onLoad
:
function
()
{
onLoad
:
function
(
option
)
{
this
.
setData
({
option
:
option
})
// formPage=order&shopAppId=1&commodityType=5
},
},
onShow
:
function
()
{
onShow
:
function
()
{
...
@@ -303,7 +309,7 @@ Page({
...
@@ -303,7 +309,7 @@ Page({
this
.
setShopInfo
(
funcShopAppId
,
funcShopType
)
this
.
setShopInfo
(
funcShopAppId
,
funcShopType
)
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
'/pages/commodity/menu-
snacks/menu-snacks
'
url
:
'/pages/commodity/menu-
food/menu-food
'
})
})
},
},
...
@@ -320,7 +326,26 @@ Page({
...
@@ -320,7 +326,26 @@ Page({
this
.
setShopInfo
(
funcShopAppId
,
funcShopType
)
this
.
setShopInfo
(
funcShopAppId
,
funcShopType
)
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
'/pages/commodity/menu-art/menu-art'
url
:
'/pages/commodity/menu-food/menu-food'
})
},
/**
* 点击推荐文创
* @function
* @param {object} - event
* @returns
*/
onBuyRecommendOriginality
:
function
(
event
)
{
// funcShopType 使用函数区分商品类型,所以每个函数里的数值是固定的
let
funcShopType
=
4
let
funcShopAppId
=
event
.
currentTarget
.
dataset
.
id
let
funcCommodityItem
=
event
.
currentTarget
.
dataset
.
item
console
.
log
(
funcCommodityItem
)
this
.
setShopInfo
(
funcShopAppId
,
funcShopType
)
wx
.
navigateTo
({
url
:
'/pages/commodity/menu-food/menu-food?commodityId='
+
funcCommodityItem
.
id
+
'&sideBarId='
+
funcCommodityItem
.
sideBarId
})
})
},
},
...
...
pages/commodity/home/home.wxml
View file @
c05279b8
...
@@ -113,7 +113,7 @@
...
@@ -113,7 +113,7 @@
</view>
</view>
<view class="shop-menu">
<view class="shop-menu">
<block wx:for="{{shopRecommendC}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<block wx:for="{{shopRecommendC}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="shop-menu-item col con-c align-c" data-id="{{1}}" data-item="{{item}}" bindtap="onBuyRecommend
Food
">
<view class="shop-menu-item col con-c align-c" data-id="{{1}}" data-item="{{item}}" bindtap="onBuyRecommend
Originality
">
<image src="{{item.cover}}"></image>
<image src="{{item.cover}}"></image>
<text>{{item.name}}</text>
<text>{{item.name}}</text>
</view>
</view>
...
@@ -129,7 +129,7 @@
...
@@ -129,7 +129,7 @@
</view>
</view>
<view class="shop-menu">
<view class="shop-menu">
<block wx:for="{{shopRecommendD}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<block wx:for="{{shopRecommendD}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="shop-menu-item col con-c align-c" data-id="{{3}}" data-item="{{item}}" bindtap="onBuyRecommend
Food
">
<view class="shop-menu-item col con-c align-c" data-id="{{3}}" data-item="{{item}}" bindtap="onBuyRecommend
Originality
">
<image src="{{item.cover}}"></image>
<image src="{{item.cover}}"></image>
<text>{{item.name}}</text>
<text>{{item.name}}</text>
</view>
</view>
...
...
pages/commodity/menu-food/menu-food.js
View file @
c05279b8
...
@@ -16,6 +16,7 @@ Page({
...
@@ -16,6 +16,7 @@ Page({
shopInfo
:
{},
shopInfo
:
{},
sideBar
:
[],
// 侧边菜单
sideBar
:
[],
// 侧边菜单
sideBarTopPadding
:
0
,
menuTitle
:
''
,
// 商品列表标题
menuTitle
:
''
,
// 商品列表标题
commodityList
:
[],
// 商品列表
commodityList
:
[],
// 商品列表
commodityDetail
:
{},
// 商品详情
commodityDetail
:
{},
// 商品详情
...
@@ -37,6 +38,8 @@ Page({
...
@@ -37,6 +38,8 @@ Page({
option
:
option
option
:
option
})
})
this
.
setSideBarStyle
()
this
.
resetShoppingCart
()
this
.
resetShoppingCart
()
this
.
setCartAnimation
()
this
.
setCartAnimation
()
...
@@ -55,6 +58,12 @@ Page({
...
@@ -55,6 +58,12 @@ Page({
}
}
},
},
setSideBarStyle
:
function
()
{
this
.
setData
({
sideBarTopPadding
:
wx
.
getStorageSync
(
'navigationStatusHeight'
)
+
wx
.
getStorageSync
(
'navigationCapsuleHeight'
)
})
},
/**
/**
* 添加动画初始
* 添加动画初始
* @function
* @function
...
...
pages/commodity/menu-food/menu-food.wxml
View file @
c05279b8
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<view class="row">
<view class="row">
<!-- 侧边菜单 -->
<!-- 侧边菜单 -->
<view class="side-bar">
<view class="side-bar"
style="{{'padding-top: ' + sideBarTopPadding + 'px;'}}"
>
<block wx:for="{{sideBar}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<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">
<view class="menu-item {{currentIndex === index ? 'active' : ''}}" data-index="{{index}}" bindtap="onSelectionSideBar">
<text>{{item.tab}}</text>
<text>{{item.tab}}</text>
...
...
pages/commodity/menu-food/menu-food.wxss
View file @
c05279b8
...
@@ -13,7 +13,6 @@ page {
...
@@ -13,7 +13,6 @@ page {
.side-bar {
.side-bar {
width: 160rpx;
width: 160rpx;
height: 100vh;
height: 100vh;
padding-top: 126rpx;
overflow-y: scroll;
overflow-y: scroll;
background: #f2f3f5;
background: #f2f3f5;
}
}
...
...
pages/commodity/shopping-cart/shopping-cart.js
View file @
c05279b8
...
@@ -263,6 +263,7 @@ Page({
...
@@ -263,6 +263,7 @@ Page({
// 格式化金额
// 格式化金额
funcAmountDiscount
=
funcAmountDiscount
-
funcAmountPay
funcAmountDiscount
=
funcAmountDiscount
-
funcAmountPay
console
.
log
(
'funcAmountDiscount'
,
funcAmountDiscount
)
funcAmountPay
=
App
.
modular
.
utils
.
formatAmount
(
funcAmountPay
)
funcAmountPay
=
App
.
modular
.
utils
.
formatAmount
(
funcAmountPay
)
funcAmountDiscount
=
App
.
modular
.
utils
.
formatAmount
(
funcAmountDiscount
)
funcAmountDiscount
=
App
.
modular
.
utils
.
formatAmount
(
funcAmountDiscount
)
...
...
pages/commodity/shopping-cart/shopping-cart.wxss
View file @
c05279b8
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
.shopping-cart-list {
.shopping-cart-list {
width: 750rpx;
width: 750rpx;
margin-top: 50rpx;
margin-top: 50rpx;
padding-bottom: 2
0
0rpx;
padding-bottom: 2
4
0rpx;
}
}
.list-item {
.list-item {
...
...
pages/home/guide/guide.js
View file @
c05279b8
...
@@ -8,6 +8,9 @@ let logicData = {
...
@@ -8,6 +8,9 @@ let logicData = {
Page
({
Page
({
data
:
{
data
:
{
imageBase
:
App
.
globalData
.
appImageBase
,
resourcesBase
:
App
.
globalData
.
appResourcesBase
,
mapCss
:
''
,
mapCss
:
''
,
pointDetail
:
'./image/card/01.png'
,
pointDetail
:
'./image/card/01.png'
,
winPointDetail
:
false
,
winPointDetail
:
false
,
...
...
pages/home/guide/guide.wxml
View file @
c05279b8
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<navigation class="navigation" titleText="智慧导览" backIcon="/image/back.png"></navigation>
<navigation class="navigation" titleText="智慧导览" backIcon="/image/back.png"></navigation>
<scroll-view class="guide" scroll-x scroll-left="{{selectionPoint}}">
<scroll-view class="guide" scroll-x scroll-left="{{selectionPoint}}">
<image id="guide-map" src="
http://sm-web.meiqicloud.com/userfiles/appResources/guide/guide.png
" style="{{mapCss}}"></image>
<image id="guide-map" src="
{{resourcesBase + 'guide/guide.png'}}
" style="{{mapCss}}"></image>
<view class="point-map" style="{{mapCss}}" catch:tap="onCancel">
<view class="point-map" style="{{mapCss}}" catch:tap="onCancel">
<block wx:for="{{pointInfo}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<block wx:for="{{pointInfo}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view
<view
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
</scroll-view>
</scroll-view>
<view class="point-detail" hidden="{{!winPointDetail}}" catch:tap="onPointDetail">
<view class="point-detail" hidden="{{!winPointDetail}}" catch:tap="onPointDetail">
<image src="{{pointDetail}}"></image>
<image src="{{
resourcesBase +
pointDetail}}"></image>
</view>
</view>
<view class="save-map row con-c align-c" bindtap="onSaveMap">
<view class="save-map row con-c align-c" bindtap="onSaveMap">
...
...
pages/home/guide/js/point.js
View file @
c05279b8
...
@@ -5,7 +5,7 @@ let output = [
...
@@ -5,7 +5,7 @@ let output = [
id
:
''
,
id
:
''
,
name
:
'温泉洋房(建设中)'
,
name
:
'温泉洋房(建设中)'
,
icon
:
'./image/icon/01.png'
,
icon
:
'./image/icon/01.png'
,
card
:
'
./imag
e/card/01.png'
,
card
:
'
guid
e/card/01.png'
,
detail
:
'/pages/play/point-detail/point-detail?id=105'
,
detail
:
'/pages/play/point-detail/point-detail?id=105'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -14,7 +14,7 @@ let output = [
...
@@ -14,7 +14,7 @@ let output = [
id
:
''
,
id
:
''
,
name
:
'海错图2号馆'
,
name
:
'海错图2号馆'
,
icon
:
'./image/icon/02.png'
,
icon
:
'./image/icon/02.png'
,
card
:
'
./imag
e/card/02.png'
,
card
:
'
guid
e/card/02.png'
,
detail
:
'/pages/play/service-detail/service-detail?id=1'
,
detail
:
'/pages/play/service-detail/service-detail?id=1'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -23,7 +23,7 @@ let output = [
...
@@ -23,7 +23,7 @@ let output = [
id
:
1
,
id
:
1
,
name
:
'海错图1号馆'
,
name
:
'海错图1号馆'
,
icon
:
'./image/icon/03.png'
,
icon
:
'./image/icon/03.png'
,
card
:
'
./imag
e/card/03.png'
,
card
:
'
guid
e/card/03.png'
,
detail
:
'/pages/play/service-detail/service-detail?id=1'
,
detail
:
'/pages/play/service-detail/service-detail?id=1'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -32,7 +32,7 @@ let output = [
...
@@ -32,7 +32,7 @@ let output = [
id
:
4
,
id
:
4
,
name
:
'原味舒食'
,
name
:
'原味舒食'
,
icon
:
'./image/icon/04.png'
,
icon
:
'./image/icon/04.png'
,
card
:
'
./imag
e/card/04.png'
,
card
:
'
guid
e/card/04.png'
,
detail
:
'/pages/play/service-detail/service-detail?id=4'
,
detail
:
'/pages/play/service-detail/service-detail?id=4'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -41,7 +41,7 @@ let output = [
...
@@ -41,7 +41,7 @@ let output = [
id
:
6
,
id
:
6
,
name
:
'星空影院'
,
name
:
'星空影院'
,
icon
:
'./image/icon/05.png'
,
icon
:
'./image/icon/05.png'
,
card
:
'
./imag
e/card/05.png'
,
card
:
'
guid
e/card/05.png'
,
detail
:
'/pages/play/service-detail/service-detail?id=6'
,
detail
:
'/pages/play/service-detail/service-detail?id=6'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -50,7 +50,7 @@ let output = [
...
@@ -50,7 +50,7 @@ let output = [
id
:
3
,
id
:
3
,
name
:
'元养水韵SPA'
,
name
:
'元养水韵SPA'
,
icon
:
'./image/icon/06.png'
,
icon
:
'./image/icon/06.png'
,
card
:
'
./imag
e/card/06.png'
,
card
:
'
guid
e/card/06.png'
,
detail
:
'/pages/play/service-detail/service-detail?id=3'
,
detail
:
'/pages/play/service-detail/service-detail?id=3'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -59,7 +59,7 @@ let output = [
...
@@ -59,7 +59,7 @@ let output = [
id
:
5
,
id
:
5
,
name
:
'原野MOJITO'
,
name
:
'原野MOJITO'
,
icon
:
'./image/icon/07.png'
,
icon
:
'./image/icon/07.png'
,
card
:
'
./imag
e/card/07.png'
,
card
:
'
guid
e/card/07.png'
,
detail
:
'/pages/play/service-detail/service-detail?id=5'
,
detail
:
'/pages/play/service-detail/service-detail?id=5'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -68,7 +68,7 @@ let output = [
...
@@ -68,7 +68,7 @@ let output = [
id
:
2
,
id
:
2
,
name
:
'拾光花坊'
,
name
:
'拾光花坊'
,
icon
:
'./image/icon/08.png'
,
icon
:
'./image/icon/08.png'
,
card
:
'
./imag
e/card/08.png'
,
card
:
'
guid
e/card/08.png'
,
detail
:
'/pages/play/service-detail/service-detail?id=2'
,
detail
:
'/pages/play/service-detail/service-detail?id=2'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -77,7 +77,7 @@ let output = [
...
@@ -77,7 +77,7 @@ let output = [
id
:
''
,
id
:
''
,
name
:
'星光广场'
,
name
:
'星光广场'
,
icon
:
'./image/icon/09.png'
,
icon
:
'./image/icon/09.png'
,
card
:
'
./imag
e/card/09.png'
,
card
:
'
guid
e/card/09.png'
,
detail
:
'/pages/play/point-detail/point-detail?id=101'
,
detail
:
'/pages/play/point-detail/point-detail?id=101'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -86,7 +86,7 @@ let output = [
...
@@ -86,7 +86,7 @@ let output = [
id
:
''
,
id
:
''
,
name
:
'云之亭'
,
name
:
'云之亭'
,
icon
:
'./image/icon/10.png'
,
icon
:
'./image/icon/10.png'
,
card
:
'
./imag
e/card/10.png'
,
card
:
'
guid
e/card/10.png'
,
detail
:
'/pages/play/point-detail/point-detail?id=102'
,
detail
:
'/pages/play/point-detail/point-detail?id=102'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -95,7 +95,7 @@ let output = [
...
@@ -95,7 +95,7 @@ let output = [
id
:
''
,
id
:
''
,
name
:
'湿地公园'
,
name
:
'湿地公园'
,
icon
:
'./image/icon/11.png'
,
icon
:
'./image/icon/11.png'
,
card
:
'
./imag
e/card/11.png'
,
card
:
'
guid
e/card/11.png'
,
detail
:
'/pages/play/point-detail/point-detail?id=103'
,
detail
:
'/pages/play/point-detail/point-detail?id=103'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -104,7 +104,7 @@ let output = [
...
@@ -104,7 +104,7 @@ let output = [
id
:
''
,
id
:
''
,
name
:
'新月码头'
,
name
:
'新月码头'
,
icon
:
'./image/icon/12.png'
,
icon
:
'./image/icon/12.png'
,
card
:
'
./imag
e/card/12.png'
,
card
:
'
guid
e/card/12.png'
,
detail
:
'/pages/play/point-detail/point-detail?id=104'
,
detail
:
'/pages/play/point-detail/point-detail?id=104'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -113,7 +113,7 @@ let output = [
...
@@ -113,7 +113,7 @@ let output = [
id
:
''
,
id
:
''
,
name
:
'儿童营地'
,
name
:
'儿童营地'
,
icon
:
'./image/icon/13.png'
,
icon
:
'./image/icon/13.png'
,
card
:
'
./imag
e/card/13.png'
,
card
:
'
guid
e/card/13.png'
,
detail
:
'/pages/campsite/home-mirror/home-mirror'
,
detail
:
'/pages/campsite/home-mirror/home-mirror'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -122,7 +122,7 @@ let output = [
...
@@ -122,7 +122,7 @@ let output = [
id
:
''
,
id
:
''
,
name
:
'星耀银湖'
,
name
:
'星耀银湖'
,
icon
:
'./image/icon/14.png'
,
icon
:
'./image/icon/14.png'
,
card
:
'
./imag
e/card/14.png'
,
card
:
'
guid
e/card/14.png'
,
detail
:
'/pages/play/point-detail/point-detail?id=106'
,
detail
:
'/pages/play/point-detail/point-detail?id=106'
,
isActive
:
false
,
isActive
:
false
,
},
{
},
{
...
@@ -131,7 +131,7 @@ let output = [
...
@@ -131,7 +131,7 @@ let output = [
id
:
''
,
id
:
''
,
name
:
'奇幻森林'
,
name
:
'奇幻森林'
,
icon
:
'./image/icon/15.png'
,
icon
:
'./image/icon/15.png'
,
card
:
'
./imag
e/card/15.png'
,
card
:
'
guid
e/card/15.png'
,
detail
:
'/pages/play/point-detail/point-detail?id=107'
,
detail
:
'/pages/play/point-detail/point-detail?id=107'
,
isActive
:
false
,
isActive
:
false
,
},
},
...
...
pages/pay/order-input/order-input.js
View file @
c05279b8
...
@@ -59,13 +59,14 @@ Page({
...
@@ -59,13 +59,14 @@ Page({
contactTitle
:
''
,
contactTitle
:
''
,
// 用户信息
// 用户信息
registerTitle
:
''
,
registerInfo
:
[],
registerInfo
:
[],
// 立即支付
// 立即支付
payAmount
:
''
,
payAmount
:
''
,
// 购买须知详情
// 购买须知详情
noticeDetail
:
App
.
globalData
.
appResourcesBase
+
'pay/notice-detail.png
'
,
noticeDetail
:
'
'
,
// 以下变量均为界面控制
// 以下变量均为界面控制
winBuyContent
:
false
,
// 购买内容
winBuyContent
:
false
,
// 购买内容
...
@@ -84,7 +85,6 @@ Page({
...
@@ -84,7 +85,6 @@ Page({
winStockTip
:
false
,
winStockTip
:
false
,
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
console
.
log
(
options
)
if
(
options
.
type
)
options
.
type
=
Number
(
options
.
type
)
if
(
options
.
type
)
options
.
type
=
Number
(
options
.
type
)
logicData
.
option
=
options
logicData
.
option
=
options
...
@@ -182,7 +182,6 @@ Page({
...
@@ -182,7 +182,6 @@ Page({
this
.
setData
({
this
.
setData
({
orderType
:
logicData
.
option
.
type
,
orderType
:
logicData
.
option
.
type
,
buyContentTitle
:
this
.
data
.
shopInfo
.
name
,
buyContentTitle
:
this
.
data
.
shopInfo
.
name
,
buyContentTime
:
'周一至周日 10:00-12:00'
,
quantityTitle
:
'选择购买数量'
,
quantityTitle
:
'选择购买数量'
,
contactTitle
:
'填写取货人信息'
,
contactTitle
:
'填写取货人信息'
,
...
@@ -203,7 +202,6 @@ Page({
...
@@ -203,7 +202,6 @@ Page({
this
.
setData
({
this
.
setData
({
orderType
:
logicData
.
option
.
type
,
orderType
:
logicData
.
option
.
type
,
buyContentTitle
:
this
.
data
.
shopInfo
.
name
,
buyContentTitle
:
this
.
data
.
shopInfo
.
name
,
buyContentTime
:
'周一至周日 10:00-21:30'
,
quantityTitle
:
'选择购买数量'
,
quantityTitle
:
'选择购买数量'
,
contactTitle
:
'填写取货人信息'
,
contactTitle
:
'填写取货人信息'
,
...
@@ -224,7 +222,7 @@ Page({
...
@@ -224,7 +222,7 @@ Page({
this
.
setData
({
this
.
setData
({
orderType
:
logicData
.
option
.
type
,
orderType
:
logicData
.
option
.
type
,
buyContentTitle
:
this
.
data
.
shopInfo
.
name
,
buyContentTitle
:
this
.
data
.
shopInfo
.
name
,
buyContentTime
:
'周一至周日 10:00-21:30
'
,
noticeText
:
'报名须知
'
,
buyContentAmount
:
'36.00'
,
buyContentAmount
:
'36.00'
,
quantityTitle
:
'报名人数'
,
quantityTitle
:
'报名人数'
,
quantityTipText
:
'剩余库存'
,
quantityTipText
:
'剩余库存'
,
...
@@ -248,7 +246,7 @@ Page({
...
@@ -248,7 +246,7 @@ Page({
this
.
setData
({
this
.
setData
({
orderType
:
logicData
.
option
.
type
,
orderType
:
logicData
.
option
.
type
,
buyContentTitle
:
this
.
data
.
shopInfo
.
name
,
buyContentTitle
:
this
.
data
.
shopInfo
.
name
,
buyContentTime
:
'8月4日 19:30-21:30
'
,
noticeText
:
'预约须知
'
,
buyContentAmount
:
'免费'
,
buyContentAmount
:
'免费'
,
quantityTitle
:
'选择预约座位'
,
quantityTitle
:
'选择预约座位'
,
quantityTipText
:
'剩余座位'
,
quantityTipText
:
'剩余座位'
,
...
@@ -285,6 +283,26 @@ Page({
...
@@ -285,6 +283,26 @@ Page({
this
.
setData
({
this
.
setData
({
shopInfo
:
wx
.
getStorageSync
(
'shopInfoBuffer'
),
shopInfo
:
wx
.
getStorageSync
(
'shopInfoBuffer'
),
})
})
// 获取地点营业时间
let
funcPointId
=
''
for
(
let
i
=
0
,
l
=
App
.
globalData
.
pointInfo
.
length
;
i
<
l
;
i
++
)
{
if
(
this
.
data
.
shopInfo
.
appId
===
App
.
globalData
.
pointInfo
[
i
].
appId
)
{
funcPointId
=
App
.
globalData
.
pointInfo
[
i
].
id
break
}
}
App
.
wxRequest
({
url
:
'/api/v1/park/getDetail'
,
data
:
{
'id'
:
funcPointId
},
success
:
(
response
)
=>
{
this
.
setData
({
buyContentTime
:
response
.
data
.
businessTime
})
}
})
},
},
setShoppingCartData
:
function
()
{
setShoppingCartData
:
function
()
{
...
@@ -374,8 +392,18 @@ Page({
...
@@ -374,8 +392,18 @@ Page({
},
},
success
:
(
response
)
=>
{
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
let
funcResponse
=
response
.
data
let
funcQuantityStock
=
funcResponse
.
inventorie
?
funcResponse
.
inventorie
[
0
].
number
:
funcResponse
.
number
let
funcRegisterTitle
let
funcQuantityStock
// 年卡月卡
if
(
funcResponse
.
inventorie
)
{
funcRegisterTitle
=
funcResponse
.
inventorie
[
0
].
cardName
funcQuantityStock
=
funcResponse
.
inventorie
[
0
].
number
}
else
{
funcQuantityStock
=
funcResponse
.
number
}
this
.
setData
({
this
.
setData
({
registerTitle
:
funcRegisterTitle
,
quantityTipNumber
:
funcQuantityStock
,
quantityTipNumber
:
funcQuantityStock
,
quantityMax
:
funcQuantityStock
<
this
.
data
.
quantityMax
?
funcQuantityStock
:
this
.
data
.
quantityMax
quantityMax
:
funcQuantityStock
<
this
.
data
.
quantityMax
?
funcQuantityStock
:
this
.
data
.
quantityMax
})
})
...
@@ -402,7 +430,7 @@ Page({
...
@@ -402,7 +430,7 @@ Page({
},
},
/**
/**
*
购买
须知详情
* 须知详情
* @function
* @function
* @param
* @param
* @returns
* @returns
...
@@ -424,10 +452,27 @@ Page({
...
@@ -424,10 +452,27 @@ Page({
})
})
clearTimeout
(
funcTimer
)
clearTimeout
(
funcTimer
)
},
100
)
},
100
)
App
.
wxRequest
({
url
:
'/api/v1/commodity/getNotification'
,
data
:
{
'notificationId'
:
this
.
data
.
shoppingCartList
[
0
].
notificationId
},
success
:
(
response
)
=>
{
let
funcRichText
=
response
.
data
.
particulars
.
replace
(
/<img/gi
,
'<img style="max-width:100%;height:auto;display:block" '
)
.
replace
(
/<section/g
,
'<div'
)
.
replace
(
/
\/
section>/g
,
'\div>'
)
this
.
setData
({
noticeDetail
:
funcRichText
})
}
})
},
},
/**
/**
* 关闭
购买
须知详情
* 关闭须知详情
* @function
* @function
* @param
* @param
* @returns
* @returns
...
@@ -517,6 +562,7 @@ Page({
...
@@ -517,6 +562,7 @@ Page({
*/
*/
inspectData
:
function
()
{
inspectData
:
function
()
{
let
funcPass
=
true
let
funcPass
=
true
let
funcErrorIndex
=
null
// 校验数组用户信息
// 校验数组用户信息
let
funcRegisterInfo
=
this
.
data
.
registerInfo
let
funcRegisterInfo
=
this
.
data
.
registerInfo
...
@@ -524,11 +570,13 @@ Page({
...
@@ -524,11 +570,13 @@ Page({
if
(
funcRegisterInfo
[
i
].
name
===
''
||
funcRegisterInfo
[
i
].
errorName
!==
''
)
{
if
(
funcRegisterInfo
[
i
].
name
===
''
||
funcRegisterInfo
[
i
].
errorName
!==
''
)
{
this
.
setUserInfo
(
'name'
,
funcRegisterInfo
[
i
].
name
,
i
,
App
.
modular
.
rule
.
item
(
'name'
,
funcRegisterInfo
[
i
].
name
))
this
.
setUserInfo
(
'name'
,
funcRegisterInfo
[
i
].
name
,
i
,
App
.
modular
.
rule
.
item
(
'name'
,
funcRegisterInfo
[
i
].
name
))
funcPass
=
false
funcPass
=
false
if
(
funcErrorIndex
===
null
)
funcErrorIndex
=
i
}
}
if
(
funcRegisterInfo
[
i
].
phone
===
''
||
funcRegisterInfo
[
i
].
errorPhone
!==
''
)
{
if
(
funcRegisterInfo
[
i
].
phone
===
''
||
funcRegisterInfo
[
i
].
errorPhone
!==
''
)
{
this
.
setUserInfo
(
'phone'
,
funcRegisterInfo
[
i
].
phone
,
i
,
App
.
modular
.
rule
.
item
(
'phone'
,
funcRegisterInfo
[
i
].
phone
))
this
.
setUserInfo
(
'phone'
,
funcRegisterInfo
[
i
].
phone
,
i
,
App
.
modular
.
rule
.
item
(
'phone'
,
funcRegisterInfo
[
i
].
phone
))
funcPass
=
false
funcPass
=
false
if
(
funcErrorIndex
===
null
)
funcErrorIndex
=
i
}
}
// 仅在需要的订单场景下校验
// 仅在需要的订单场景下校验
...
@@ -536,9 +584,22 @@ Page({
...
@@ -536,9 +584,22 @@ Page({
if
(
funcRegisterInfo
[
i
].
identity
===
''
||
funcRegisterInfo
[
i
].
errorIdentity
!==
''
)
{
if
(
funcRegisterInfo
[
i
].
identity
===
''
||
funcRegisterInfo
[
i
].
errorIdentity
!==
''
)
{
this
.
setUserInfo
(
'identity'
,
funcRegisterInfo
[
i
].
identity
,
i
,
App
.
modular
.
rule
.
item
(
'identity'
,
funcRegisterInfo
[
i
].
identity
))
this
.
setUserInfo
(
'identity'
,
funcRegisterInfo
[
i
].
identity
,
i
,
App
.
modular
.
rule
.
item
(
'identity'
,
funcRegisterInfo
[
i
].
identity
))
funcPass
=
false
funcPass
=
false
if
(
funcErrorIndex
===
null
)
funcErrorIndex
=
i
}
}
}
}
}
}
// 定位到当前问题位置
if
(
funcErrorIndex
!==
null
)
{
const
funcQuery
=
wx
.
createSelectorQuery
()
funcQuery
.
selectAll
(
'.register-item-title'
).
boundingClientRect
()
funcQuery
.
exec
((
response
)
=>
{
console
.
log
(
response
)
wx
.
pageScrollTo
({
scrollTop
:
response
[
0
][
funcErrorIndex
].
top
})
})
}
return
funcPass
return
funcPass
},
},
...
@@ -702,7 +763,7 @@ Page({
...
@@ -702,7 +763,7 @@ Page({
}
else
{
}
else
{
// 取消支付直接进入订单
// 取消支付直接进入订单
wx
.
reLaunch
({
wx
.
reLaunch
({
url
:
'/pages/pay/order
-detail/order-detail?id='
+
this
.
data
.
orderId
+
'&fromPage=
order'
url
:
'/pages/pay/order
/
order'
})
})
}
}
},
},
...
@@ -711,5 +772,8 @@ Page({
...
@@ -711,5 +772,8 @@ Page({
this
.
setData
({
this
.
setData
({
winStockTip
:
false
,
winStockTip
:
false
,
})
})
wx
.
navigateBack
({
delta
:
1
})
}
}
})
})
\ No newline at end of file
pages/pay/order-input/order-input.wxml
View file @
c05279b8
<!-- 购买须知详情 -->
<!-- 购买须知详情 -->
<view class="notice-detail" wx:if="{{winNoticeDetail}}" bindtap="onNoticeClose">
<view class="notice-detail" wx:if="{{winNoticeDetail}}" bindtap="onNoticeClose">
<view class="notice-item" animation="{{animation}}">
<view class="notice-item" animation="{{animation}}">
<image src="{{noticeDetail}}"></image>
<view class="notice-title">
<text>{{noticeText}}</text>
</view>
<view class="notice-rich">
<rich-text nodes="{{noticeDetail}}"></rich-text>
</view>
</view>
</view>
</view>
</view>
...
@@ -219,7 +224,7 @@
...
@@ -219,7 +224,7 @@
<block wx:for="{{registerInfo}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<block wx:for="{{registerInfo}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="register-item-title">
<view class="register-item-title">
<text>{{
'年卡'
+ (index + 1)}}</text>
<text>{{
registerTitle
+ (index + 1)}}</text>
</view>
</view>
<view class="contact-input col">
<view class="contact-input col">
<text>姓名</text>
<text>姓名</text>
...
...
pages/pay/order-input/order-input.wxss
View file @
c05279b8
...
@@ -14,15 +14,31 @@
...
@@ -14,15 +14,31 @@
left: 0;
left: 0;
bottom: -950rpx;
bottom: -950rpx;
width: 750rpx;
width: 750rpx;
padding: 28px 0 50rpx 0;
height: 70%;
padding: 130rpx 40rpx 50rpx 40rpx;
border-radius: 24px 24px 0px 0px;
border-radius: 24px 24px 0px 0px;
background: #FFFFFF;
background: #FFFFFF;
}
}
.notice-item image {
.notice-title {
display: block;
position: absolute;
width: 750rpx;
top: 50rpx;
height: 950rpx;
width: 670rpx;
height: 130rpx;
}
.notice-title text {
height: 58rpx;
font-size: 42rpx;
font-weight: 500;
line-height: 58rpx;
color: #15191F;
}
.notice-rich {
width: 670rpx;
height: 100%;
overflow-y: scroll;
}
}
.container {
.container {
...
...
utils/utils.js
View file @
c05279b8
...
@@ -25,9 +25,17 @@ let output = {
...
@@ -25,9 +25,17 @@ let output = {
* @returns
* @returns
*/
*/
formatAmount
:
function
(
funcAmountValue
)
{
formatAmount
:
function
(
funcAmountValue
)
{
if
(
funcAmountValue
===
0
)
funcAmountValue
=
'000'
if
(
!
funcAmountValue
&&
funcAmountValue
!==
0
)
return
console
.
log
(
funcAmountValue
,
funcAmountValue
.
toString
().
length
)
switch
(
funcAmountValue
.
toString
().
length
)
{
case
1
:
funcAmountValue
=
'00'
+
funcAmountValue
break
if
(
!
funcAmountValue
)
return
case
2
:
funcAmountValue
=
'0'
+
funcAmountValue
break
}
return
funcAmountValue
.
toString
().
replace
(
/
([
0-9
]{2})
$/
,
'.$1'
)
return
funcAmountValue
.
toString
().
replace
(
/
([
0-9
]{2})
$/
,
'.$1'
)
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment