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
4bb50609
authored
Sep 17, 2020
by
严立
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
LL - 服务首页
parent
538f3685
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
257 additions
and
149 deletions
pages/commodity/home/home.js
pages/commodity/home/home.wxml
pages/commodity/home/home.wxss
pages/commodity/menu-food/menu-food.js
pages/commodity/project-detail/project-detail.js
pages/commodity/project/project.js
pages/commodity/project/project.wxml
pages/commodity/project/project.wxss
pages/commodity/shopping-cart/shopping-cart.js
pages/commodity/shopping-cart/shopping-cart.wxml
pages/commodity/shopping-cart/shopping-cart.wxss
pages/mine/info/info.js
pages/mine/order/order.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
pages/commodity/home/home.js
View file @
4bb50609
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,8 +21,11 @@ Page({
...
@@ -17,8 +21,11 @@ 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
...
...
pages/commodity/home/home.wxml
View file @
4bb50609
<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>
<!-- 商店 -->
<!-- 商店 -->
...
...
pages/commodity/home/home.wxss
View file @
4bb50609
...
@@ -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: 280
rpx;
padding: 140rpx 46rpx 130rpx 46
rpx;
}
}
.title image {
.greeting text {
width: 750rpx;
height: 82rpx;
height: 80rpx;
font-size: 58rpx;
font-weight: 500;
line-height: 82rpx;
color: #15191F;
}
}
/* 商店样式 */
/* 商店样式 */
...
...
pages/commodity/menu-food/menu-food.js
View file @
4bb50609
...
@@ -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
)
{
...
...
pages/commodity/project-detail/project-detail.js
View file @
4bb50609
...
@@ -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
...
...
pages/commodity/project/project.js
View file @
4bb50609
This diff is collapsed.
Click to expand it.
pages/commodity/project/project.wxml
View file @
4bb50609
This diff is collapsed.
Click to expand it.
pages/commodity/project/project.wxss
View file @
4bb50609
...
@@ -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;
}
}
.project-price-old {
.commodity-price-through {
margin-top: 12rpx;
}
.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;
.commodity-price-operation button {
}
.price-symbol-old {
font-size: 20rpx;
}
.project-buy-wrapper {
flex: 1;
}
.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
pages/commodity/shopping-cart/shopping-cart.js
View file @
4bb50609
...
@@ -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
+
1
00
this
.
setData
({
this
.
setData
({
shoppingCart
:
funcShoppingCart
shoppingCart
:
funcShoppingCart
})
})
...
...
pages/commodity/shopping-cart/shopping-cart.wxml
View file @
4bb50609
...
@@ -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>
...
...
pages/commodity/shopping-cart/shopping-cart.wxss
View file @
4bb50609
...
@@ -12,33 +12,23 @@
...
@@ -12,33 +12,23 @@
.shop-info {
.shop-info {
width: 750rpx;
width: 750rpx;
height: 11
6
rpx;
height: 11
0
rpx;
padding:
16rpx
40rpx;
padding:
0 30rpx 0
40rpx;
font-size: 30rpx;
font-size: 30rpx;
}
}
.shop-info > image {
.shop-info > image {
max-width: 12
0rpx;
width: 38
0rpx;
height: 1
00%
;
height: 1
10rpx
;
}
}
.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 {
...
...
pages/mine/info/info.js
View file @
4bb50609
...
@@ -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
,
...
...
pages/mine/order/order.js
View file @
4bb50609
...
@@ -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
()
{
wx
.
navigateBack
({
if
(
this
.
data
.
option
.
fromPage
)
{
'delta'
:
1
wx
.
switchTab
({
})
url
:
'/pages/mine/home/home'
,
})
}
else
{
wx
.
navigateBack
({
'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
})
})
...
...
pages/pay/order-input/order-input.js
View file @
4bb50609
...
@@ -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
wx
.
pageScrollTo
({
if
(
funcScrollTop
!==
0
)
{
scrollTop
:
response
[
0
][
funcErrorIndex
].
top
wx
.
pageScrollTo
({
})
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
'
})
})
}
}
},
},
...
...
pages/pay/order-input/order-input.wxml
View file @
4bb50609
<!-- 购买须知详情 -->
<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">
...
...
pages/pay/order-input/order-input.wxss
View file @
4bb50609
...
@@ -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 {
...
...
utils/utils.js
View file @
4bb50609
...
@@ -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
...
...
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