Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
243e7bda
Commit
243e7bda
authored
Aug 31, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
确认订单地址
parent
f1350a3d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
114 additions
and
20 deletions
+114
-20
defalut.png
src/assets/imgs/7_1_0/08_22/defalut.png
+0
-0
no-defalut.png
src/assets/imgs/7_1_0/08_22/no-defalut.png
+0
-0
addAddress.js
src/pages/addAddress/addAddress.js
+0
-1
confirmOrder.js
src/pages/confirmOrder/confirmOrder.js
+90
-12
confirmOrder.wxml
src/pages/confirmOrder/confirmOrder.wxml
+4
-4
confirmOrder.wxss
src/pages/confirmOrder/confirmOrder.wxss
+6
-1
myAddress.js
src/pages/myAddress/myAddress.js
+9
-1
myAddress.wxml
src/pages/myAddress/myAddress.wxml
+3
-1
myAddress.wxss
src/pages/myAddress/myAddress.wxss
+2
-0
No files found.
src/assets/imgs/7_1_0/08_22/defalut.png
0 → 100644
View file @
243e7bda
2.8 KB
src/assets/imgs/7_1_0/08_22/no-defalut.png
0 → 100644
View file @
243e7bda
2.82 KB
src/pages/addAddress/addAddress.js
View file @
243e7bda
...
...
@@ -49,7 +49,6 @@ wxService.page({
},
/**
* 生命周期函数--监听页面显示
*/
...
...
src/pages/confirmOrder/confirmOrder.js
View file @
243e7bda
...
...
@@ -7,7 +7,7 @@ wxService.page({
* 页面的初始数据
*/
data
:
{
addressInfo
:
''
,
addressInfo
:
[]
,
showSelectCoupon
:
false
,
skuIds
:
[],
trolleySku2Buy
:
Array
,
...
...
@@ -24,8 +24,7 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
// 地址列表
this
.
getAddressList
()
},
/**
* 生命周期函数--监听页面显示
...
...
@@ -39,11 +38,74 @@ wxService.page({
})
}
this
.
initCitys
()
// 地址列表
this
.
getAddressList
()
},
// 提交
formSubmit
(
e
){
console
.
log
(
'提交'
,
e
)
formSubmit
(
e
)
{
const
{
goodsAddress
}
=
this
.
data
// 保存地址 && 支付
if
(
goodsAddress
)
{
if
(
!
e
.
detail
.
value
.
name
)
{
wx
.
showToast
({
title
:
`请输入姓名`
,
icon
:
'none'
})
return
false
;
}
if
(
!
e
.
detail
.
value
.
phone
)
{
wx
.
showToast
({
title
:
`请输入电话`
,
icon
:
'none'
})
return
false
;
}
if
(
!
this
.
data
.
cityView
)
{
wx
.
showToast
({
title
:
`请选择地区`
,
icon
:
'none'
})
return
false
;
}
if
(
!
e
.
detail
.
value
.
address
)
{
wx
.
showToast
({
title
:
`请输入详细地址`
,
icon
:
'none'
})
return
false
;
}
this
.
setData
({
params
:
{
userId
:
memberId
,
name
:
e
.
detail
.
value
.
name
,
phone
:
e
.
detail
.
value
.
phone
,
fullArea
:
this
.
data
.
cityView
,
address
:
e
.
detail
.
value
.
address
,
type
:
this
.
data
.
isSelect
?
1
:
0
}
})
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
post
(
`/member/addressManage/save`
,
this
.
data
.
params
).
then
(
res
=>
{
const
{
result
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
wx
.
showToast
({
title
:
`保存成功`
,
icon
:
'none'
})
// 调起支付
this
.
handelGobuy
()
}
})
}
else
{
// 调起支付
this
.
handelGobuy
()
}
},
initCitys
()
{
wxService
.
getC1
().
then
((
c1
)
=>
{
...
...
@@ -65,8 +127,8 @@ wxService.page({
this
.
setData
({
multiIndex
,
cityView
},
()
=>
{
console
.
log
(
'================0'
,
this
.
data
.
cityView
,
this
.
data
.
multiIndex
)
},
()
=>
{
console
.
log
(
'================0'
,
this
.
data
.
cityView
,
this
.
data
.
multiIndex
)
})
}
},
...
...
@@ -130,9 +192,8 @@ wxService.page({
})
},
handelGobuy
()
{
this
.
formSubmit
()
const
{
trolleySku2Buy
}
=
this
.
data
//
this.getBill(trolleySku2Buy) // 下单
this
.
getBill
(
trolleySku2Buy
)
// 下单
},
// 下单
getBill
(
trolleySku2Buy
)
{
...
...
@@ -176,6 +237,24 @@ wxService.page({
this
.
setData
({
goodsAddress
:
true
})
}
else
{
// 缓存有没有地址
let
hasDefalut
=
wx
.
getStorageSync
(
'_defalutAddress'
)
let
_defalutAddress
=
null
if
(
hasDefalut
)
{
_defalutAddress
=
hasDefalut
}
else
{
data
.
forEach
(
item
=>
{
if
(
item
.
type
==
1
){
_defalutAddress
=
item
}
})
}
this
.
setData
({
addressInfo
:
_defalutAddress
})
}
}
}).
finally
(()
=>
{
...
...
@@ -189,7 +268,6 @@ wxService.page({
this
.
setData
({
goodsAddress
:
false
,
addressInfo
:
res
,
})
},
fail
:
function
(
err
)
{
...
...
src/pages/confirmOrder/confirmOrder.wxml
View file @
243e7bda
...
...
@@ -35,16 +35,16 @@
<input class="address-input address-detail" name="address" placeholder="请输入路名门牌号" />
</view>
</block>
<block wx:if="{{!goodsAddress}}">
<view class="address-list" bindtap="selectAddress">
<view class="address-info">
<view>
<text class="user-name">{{addressInfo.userName}}</text>
<text class="phone-number">{{addressInfo.telNumber}}</text>
<image class="defalut-add-img" src="{{addressInfo.type == 1 ? '/assets/imgs/7_1_0/08_22/defalut.png' : '/assets/imgs/7_1_0/08_22/no-defalut.png'}}" />
<text class="user-name">{{addressInfo.name}}</text>
<text class="phone-number">{{addressInfo.phone}}</text>
</view>
<view class="address-list-detail">
{{addressInfo.
provinceName}} {{addressInfo.cityName}} {{addressInfo.countyName}} {{addressInfo.detailInfo
}}
{{addressInfo.
fullArea}} {{addressInfo.address
}}
</view>
<view class="arrow-right-wrap">
<image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right.png" />
...
...
src/pages/confirmOrder/confirmOrder.wxss
View file @
243e7bda
/* pages/confirmOrder/confirmOrder.wxss */
@import './../../base/base.wxss';
.defalut-add-img {
width: 84rpx;
height: 33rpx;
border-radius: 16rpx;
/* background-color: rgba(203, 60, 60, 1); */
}
.address-wrap{
padding: 0 30rpx;
}
...
...
src/pages/myAddress/myAddress.js
View file @
243e7bda
...
...
@@ -24,7 +24,15 @@ wxService.page({
onLoad
:
function
(
options
)
{
},
handelCheckShopAddress
(
e
)
{
const
index
=
e
.
currentTarget
.
dataset
.
index
const
item
=
this
.
data
.
addressList
[
index
]
wx
.
setStorageSync
(
'_defalutAddress'
,
item
)
setTimeout
(()
=>
{
wxService
.
router
().
back
()
},
300
)
},
/**
* 生命周期函数--监听页面显示
...
...
src/pages/myAddress/myAddress.wxml
View file @
243e7bda
...
...
@@ -14,7 +14,9 @@
bindtouchstart="drawStart"
bindtouchmove="drawMove"
bindtouchend="drawEnd"
bindtap='handelCheckShopAddress'
style="right:{{item.right}}rpx"
data-id="{{item.id}}"
data-index="{{index}}"
>
<view class="name">
...
...
@@ -27,7 +29,7 @@
data-type="{{item.type}}"
data-id="{{item.id}}"
>
<view class="{{item.type == 1 ? 'theme-color' : ''}} circle-radio">
<view class="{{item.type == 1 ? 'theme-color' : ''}} circle-radio
check-default-address
">
<image
wx:if="{{item.type == 1}}"
class="tick-success"
...
...
src/pages/myAddress/myAddress.wxss
View file @
243e7bda
...
...
@@ -80,9 +80,11 @@ page{
.tick-success{
width: 18rpx;
}
.default-address{
display: flex;
margin-top: 25rpx;
width: 250rpx;
}
.setting-default{
margin-left: 19rpx;
...
...
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