Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5d2f57a4
authored
Mar 07, 2025
by
huyue
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
动态获取门店地址
1 parent
172fcd2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
4 deletions
api/module/point.js
components/HomeFrame/components/Point/LevelPoint.vue
api/module/point.js
View file @
5d2f57a
...
...
@@ -172,5 +172,13 @@ module.exports = {
projectName
:
'boutique'
,
...
data
})
},
/** 查询附近地址 */
searchStoreAddress
(
data
)
{
return
http
.
post
({
method
:
'dj.api.car.boutique.resident.coupon.address.search'
,
projectName
:
'boutique'
,
...
data
})
}
}
components/HomeFrame/components/Point/LevelPoint.vue
View file @
5d2f57a
...
...
@@ -150,8 +150,8 @@
<view
class=
"store-info"
>
<view
class=
"sprite-icon icon-icon-store"
></view>
<p
class=
"store-label"
>
附近门店
</p>
<p
class=
"store-address"
>
{{
couponDetailInfo.merchant
Address }}
</p>
<view
class=
"copy-btn"
@
click=
"copyText"
><view
class=
"sprite-icon icon-icon-copy copy"
></view>
复制
</view>
<p
class=
"store-address"
>
{{
store
Address }}
</p>
<view
class=
"copy-btn"
v-if=
"this.storeAddress"
@
click=
"copyText"
><view
class=
"sprite-icon icon-icon-copy copy"
></view>
复制
</view>
</view>
<view
:class=
"['usage-notice', couponDetailInfo.couponState == 2 ? 'claimed-usage':'']"
>
<view
:class=
"[couponDetailInfo.couponState == 2 ? 'claimed-notice':'']"
>
...
...
@@ -233,7 +233,8 @@ export default {
},
total
:
0
,
pageNum
:
1
,
pageSize
:
8
pageSize
:
8
,
storeAddress
:
''
}
},
props
:
{
...
...
@@ -252,6 +253,31 @@ export default {
console
.
log
(
'init'
);
this
.
getGrantRecord
()
},
getLocation
(
brandName
)
{
uni
.
getLocation
({
type
:
'gcj02'
,
geocode
:
true
,
// 设置为 true 可直接获取经纬度及城市信息
success
:
function
(
res
)
{
console
.
log
(
res
,
'===='
);
// 打印位置信息
// 处理位置数据
const
params
=
{
brandName
,
lat
:
res
.
latitude
,
lng
:
res
.
longitude
}
uni
.
$api
.
pointApi
.
searchStoreAddress
(
params
).
then
(
res
=>
{
console
.
log
(
res
,
'======'
);
this
.
storeAddress
=
res
})
},
fail
:
function
()
{
uni
.
showToast
({
title
:
'获取地址失败,将导致部分功能不可用'
,
icon
:
'none'
});
}
});
},
/** 接口调用 uni.$api.pointApi*/
// 优惠券个数
statisticsCount
()
{
...
...
@@ -324,10 +350,12 @@ export default {
// 使用优惠券
this
.
showCouponPon
=
true
// this.couponDetailInfo = row
this
.
getLocation
(
row
.
brandName
)
break
case
2
:
this
.
showCouponPon
=
true
// this.couponDetailInfo = row
this
.
getLocation
(
row
.
brandName
)
break
default
:
return
...
...
@@ -335,6 +363,7 @@ export default {
},
closePop
()
{
this
.
showCouponPon
=
false
this
.
storeAddress
=
''
},
// 领取使用按钮
handleUse
()
{
...
...
@@ -363,7 +392,7 @@ export default {
// 复制
copyText
()
{
uni
.
setClipboardData
({
data
:
this
.
couponDetailInfo
.
merchant
Address
,
data
:
this
.
store
Address
,
success
:
function
()
{
uni
.
showToast
({
title
:
'复制成功'
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment