Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
groupPurchase-miniapp
Project
Project
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
彭佳妮(贵阳日报)
groupPurchase-miniapp
Commits
d0f15039
Commit
d0f15039
authored
Aug 07, 2024
by
刘玉宏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.platform.xinhuaapp.com/pengjiani/groupPurchase-miniapp
parents
5bab3427
9f1da310
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
512 additions
and
137 deletions
+512
-137
FoodDetails.vue
src/Components/index/FoodDetails.vue
+12
-1
ShopCard.vue
src/Components/index/ShopCard.vue
+27
-3
building.js
src/api/assistingAgriculture/building.js
+28
-10
pages.json
src/pages.json
+7
-0
specialOfferZoneList.vue
...assistingAgriculture/RuralTravel/specialOfferZoneList.vue
+280
-0
building.vue
src/pages/assistingAgriculture/index/building.vue
+1
-1
index.vue
src/pages/assistingAgriculture/index/index.vue
+43
-33
presale.vue
src/pages/assistingAgriculture/index/presale.vue
+15
-20
coupon.vue
src/pages/index/coupon.vue
+5
-3
index.vue
src/pages/index/index.vue
+18
-19
listFood.vue
src/pages/index/listFood.vue
+6
-2
packageDetails.vue
src/pages/packageDetails/packageDetails.vue
+2
-2
confirmOrder.vue
src/pages/shop/confirmOrder.vue
+14
-13
shop.vue
src/pages/shop/shop.vue
+28
-29
text.vue
src/pages/shop/text.vue
+25
-0
common.js
src/utils/common.js
+1
-1
No files found.
src/Components/index/FoodDetails.vue
View file @
d0f15039
...
@@ -7,7 +7,9 @@
...
@@ -7,7 +7,9 @@
<text
class=
"one-text"
>
{{
item
.
grade
}}
推荐
</text>
<text
class=
"one-text"
>
{{
item
.
grade
}}
推荐
</text>
<!--
<text
class=
"two-text"
>
¥30/人
</text>
-->
<!--
<text
class=
"two-text"
>
¥30/人
</text>
-->
<text
class=
"three-text"
>
销量
{{
item
.
monthSoldNum
}}
</text>
<text
class=
"three-text"
>
销量
{{
item
.
monthSoldNum
}}
</text>
<text
class=
"four-text"
>
1.2km
</text>
<text
class=
"four-text"
>
{{
getDistance
(
item
.
shopLat
,
item
.
shopLng
,
latF
,
lonF
)
}}
</text>
</view>
</view>
<view
class=
"threeBox"
v-if=
"item.evaluationVos.length === 0"
>
<view
class=
"threeBox"
v-if=
"item.evaluationVos.length === 0"
>
<image
class=
"img2"
:src=
"item.evaluationVos[0].avatar"
mode=
"aspectFill"
/>
<image
class=
"img2"
:src=
"item.evaluationVos[0].avatar"
mode=
"aspectFill"
/>
...
@@ -36,6 +38,15 @@
...
@@ -36,6 +38,15 @@
<
script
setup
>
<
script
setup
>
import
{
defineProps
}
from
'vue'
;
import
{
defineProps
}
from
'vue'
;
import
{
getLocation
}
from
'../../utils/tool'
;
import
{
getDistance
}
from
'../../utils/common'
;
const
lonF
=
ref
(
0
);
const
latF
=
ref
(
0
);
onMounted
(
async
()
=>
{
const
{
lon
,
lat
}
=
await
getLocation
();
lonF
.
value
=
lon
;
latF
.
value
=
lat
;
});
const
props
=
defineProps
({
const
props
=
defineProps
({
cardData
:
{
cardData
:
{
type
:
Array
,
type
:
Array
,
...
...
src/Components/index/ShopCard.vue
View file @
d0f15039
...
@@ -10,7 +10,9 @@
...
@@ -10,7 +10,9 @@
<text
class=
"one-text"
>
{{
shopCardData
.
grade
}}
推荐
</text>
<text
class=
"one-text"
>
{{
shopCardData
.
grade
}}
推荐
</text>
<!--
<text
class=
"two-text"
>
¥30/人
</text>
-->
<!--
<text
class=
"two-text"
>
¥30/人
</text>
-->
<text
class=
"three-text"
>
销量
{{
shopCardData
.
monthSoldNum
}}
</text>
<text
class=
"three-text"
>
销量
{{
shopCardData
.
monthSoldNum
}}
</text>
<text
class=
"four-text"
>
1.2km
</text>
<text
class=
"four-text"
>
{{
getDistance
(
shopCardData
.
shopLat
,
shopCardData
.
shopLng
,
latF
,
lonF
)
}}
</text>
</view>
</view>
<view
class=
"threeBox"
>
<view
class=
"threeBox"
>
<image
class=
"img2"
:src=
"shopCardData.evaluationVos[0].avatar"
mode=
"aspectFill"
/>
<image
class=
"img2"
:src=
"shopCardData.evaluationVos[0].avatar"
mode=
"aspectFill"
/>
...
@@ -23,7 +25,12 @@
...
@@ -23,7 +25,12 @@
</view>
</view>
</view>
</view>
<view
class=
"nearby-bootom"
>
<view
class=
"nearby-bootom"
>
<view
class=
"contentBox"
v-for=
"(item, index) in shopCardData.simpleProds"
:key=
"index"
>
<view
class=
"contentBox"
@
tap=
"topFoodDetails(item.prodId)"
v-for=
"(item, index) in shopCardData.simpleProds"
:key=
"index"
>
<image
class=
"img"
:src=
"item.pic"
mode=
"aspectFill"
/>
<image
class=
"img"
:src=
"item.pic"
mode=
"aspectFill"
/>
<text
class=
"one"
>
{{
item
.
prodName
}}
</text>
<text
class=
"one"
>
{{
item
.
prodName
}}
</text>
<view
class=
"price"
>
<view
class=
"price"
>
...
@@ -38,6 +45,10 @@
...
@@ -38,6 +45,10 @@
<
script
setup
>
<
script
setup
>
import
{
defineProps
}
from
'vue'
;
import
{
defineProps
}
from
'vue'
;
import
{
getDistance
}
from
'../../utils/common'
;
import
{
getLocation
}
from
'../../utils/tool'
;
const
lonF
=
ref
(
0
);
const
latF
=
ref
(
0
);
const
props
=
defineProps
({
const
props
=
defineProps
({
shopCardData
:
{
shopCardData
:
{
type
:
Object
,
type
:
Object
,
...
@@ -46,6 +57,16 @@ const props = defineProps({
...
@@ -46,6 +57,16 @@ const props = defineProps({
}),
}),
},
},
});
});
onMounted
(
async
()
=>
{
const
{
lon
,
lat
}
=
await
getLocation
();
lonF
.
value
=
lon
;
latF
.
value
=
lat
;
});
const
topFoodDetails
=
(
id
)
=>
{
xma
.
navigateTo
({
url
:
`/pages/packageDetails/packageDetails?prodId=
${
id
}
`
,
});
};
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
@@ -90,6 +111,8 @@ const props = defineProps({
...
@@ -90,6 +111,8 @@ const props = defineProps({
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
margin-top
:
10rpx
;
margin-top
:
10rpx
;
position
:
relative
;
width
:
510rpx
;
.one-text
{
.one-text
{
font-size
:
22rpx
;
font-size
:
22rpx
;
font-weight
:
bold
;
font-weight
:
bold
;
...
@@ -111,7 +134,8 @@ const props = defineProps({
...
@@ -111,7 +134,8 @@ const props = defineProps({
font-size
:
20rpx
;
font-size
:
20rpx
;
color
:
#ffffff
;
color
:
#ffffff
;
font-weight
:
500
;
font-weight
:
500
;
margin-left
:
182rpx
;
position
:
absolute
;
right
:
20rpx
;
}
}
}
}
.threeBox
{
.threeBox
{
...
...
src/api/assistingAgriculture/building.js
View file @
d0f15039
import
{
request
}
from
'../../utils/request'
;
import
{
request
}
from
'../../utils/request'
;
//
获取指定类型轮播图
//
筑农专区分类
export
function
getSortList
(
data
)
{
export
function
getSortList
(
data
)
{
return
request
({
return
request
({
url
:
`/sgyrdd/category/znList`
,
url
:
`/sgyrdd/category/znList`
,
...
@@ -9,6 +9,24 @@ export function getSortList(data) {
...
@@ -9,6 +9,24 @@ export function getSortList(data) {
});
});
}
}
// 预售板块轮播图
export
function
getPresaleList
(
data
)
{
return
request
({
url
:
`/sgyrdd/carousel/presaleList`
,
method
:
'GET'
,
data
,
});
}
// 筑农严选分类
export
function
getStrictSelection
(
data
)
{
return
request
({
url
:
`/sgyrdd/category/getZnyx`
,
method
:
'GET'
,
data
,
});
}
// 筑农严选首页-分类预售商品列表
// 筑农严选首页-分类预售商品列表
export
function
getPresaleCategory
(
data
)
{
export
function
getPresaleCategory
(
data
)
{
return
request
({
return
request
({
...
@@ -18,28 +36,28 @@ export function getPresaleCategory(data) {
...
@@ -18,28 +36,28 @@ export function getPresaleCategory(data) {
});
});
}
}
//
预售板块轮播图
//
筑农严选首页-好货特卖商品列表
export
function
get
Presale
List
(
data
)
{
export
function
get
GoodSaleProd
List
(
data
)
{
return
request
({
return
request
({
url
:
`/sgyrdd/
carousel/presale
List`
,
url
:
`/sgyrdd/
znprod/getGoodSaleProd
List`
,
method
:
'GET'
,
method
:
'GET'
,
data
,
data
,
});
});
}
}
// 筑农严选
分类
// 筑农严选
首页-分类查询商品列表
export
function
get
StrictSelection
(
data
)
{
export
function
get
PlatformProdList
(
data
)
{
return
request
({
return
request
({
url
:
`/sgyrdd/
category/getZnyx
`
,
url
:
`/sgyrdd/
znprod/getPlatformProdList
`
,
method
:
'GET'
,
method
:
'GET'
,
data
,
data
,
});
});
}
}
// 筑农
预售分类
// 筑农
首页-分类查询商品列表
export
function
get
BuindingSor
t
(
data
)
{
export
function
get
PresaleProdLis
t
(
data
)
{
return
request
({
return
request
({
url
:
`/sgyrdd/
category/presale
List`
,
url
:
`/sgyrdd/
znprod/getPresaleProd
List`
,
method
:
'GET'
,
method
:
'GET'
,
data
,
data
,
});
});
...
...
src/pages.json
View file @
d0f15039
...
@@ -140,6 +140,13 @@
...
@@ -140,6 +140,13 @@
"navigationBarBackgroundColor"
:
"#ffffff"
"navigationBarBackgroundColor"
:
"#ffffff"
}
}
},
},
{
"path"
:
"pages/assistingAgriculture/RuralTravel/specialOfferZoneList"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarBackgroundColor"
:
"#ffffff"
}
},
{
{
"path"
:
"pages/assistingAgriculture/shop/index"
,
"path"
:
"pages/assistingAgriculture/shop/index"
,
"style"
:
{
"style"
:
{
...
...
src/pages/assistingAgriculture/RuralTravel/specialOfferZoneList.vue
0 → 100644
View file @
d0f15039
<
template
>
<view
class=
"special-offer-zone-list-page"
>
<view
class=
"swiper"
>
<wd-swiper
customClass=
"swiper-custom"
:list=
"shopSwiperList"
autoplay
height=
"440rpx"
customStyle=
"border-radius: 0rpx !important;"
:current=
"current"
@
click=
"handleClick"
@
change=
"onChange"
:indicator=
"
{ type: 'dots-bar' }"
>
<template
#
indicator=
"
{ current, total }">
<view
class=
"custom-indicator"
style=
"position: absolute; bottom: 24rpx; right: 24rpx"
>
{{
current
+
1
}}
/
{{
total
}}
</view>
</
template
>
</wd-swiper>
<!-- 列表-->
<view
class=
"bootom"
>
<view
class=
"bootom-top"
>
<view
class=
"option"
@
tap=
"locationFiltering(0)"
>
<text
:class=
"{ rotate: rotate }"
>
智能排序
</text>
<wd-icon
:class=
"{ rotate: rotate }"
name=
"fill-arrow-down"
size=
"24rpx"
class=
"icons"
></wd-icon>
</view>
</view>
<view
class=
"bootom-top"
>
<view
class=
"option"
@
tap=
"locationFiltering(1)"
>
<text
:class=
"{ rotate: rotate2 }"
>
出发日期
</text>
<wd-icon
:class=
"{ rotate: rotate2 }"
name=
"fill-arrow-down"
size=
"24rpx"
class=
"icons"
></wd-icon>
</view>
</view>
<view
class=
"bootom-top"
>
<view
class=
"option"
@
tap=
"locationFiltering(2)"
>
<text
:class=
"{ rotate: rotate3 }"
>
景点
</text>
<wd-icon
:class=
"{ rotate: rotate3 }"
name=
"fill-arrow-down"
size=
"24rpx"
class=
"icons"
></wd-icon>
</view>
</view>
<view
class=
"bootom-top"
>
<view
class=
"option"
@
tap=
"locationFiltering(3)"
>
<text
:class=
"{ rotate: rotate4 }"
>
筛选
</text>
<wd-icon
:class=
"{ rotate: rotate4 }"
name=
"fill-arrow-down"
size=
"24rpx"
class=
"icons"
></wd-icon>
</view>
</view>
<Sort
v-show=
"rotate"
/>
<DepartureDate
v-show=
"rotate2"
/>
<ScenicSpots
v-show=
"rotate3"
/>
<Screen
v-show=
"rotate4"
/>
</view>
<view
class=
"list"
>
<view
class=
"item"
v-for=
"i in 10"
:key=
"i"
>
<image
mode=
"aspectFill"
src=
"@/static/assistingAgriculture/reviewDetails/fj.png"
></image>
<view
class=
"info"
>
<text
class=
"title multi-line"
>
红枫湖+青岩古镇+云漫湖+云顶高坡景区一日游
</text>
<text
class=
"subtitle"
>
赠价值59元特产伴手礼一份
</text>
<view
class=
"tag-list"
>
<text
class=
"tag"
>
可定明日
</text>
<text
class=
"tag"
>
可定明日
</text>
<text
class=
"tag"
>
可定明日
</text>
</view>
<view
class=
"fs-box"
>
<text
class=
"fs-num"
>
4.9分
</text>
<text
style=
"margin-left: 20rpx"
class=
"sales-volume"
>
月销2000+
</text>
</view>
<text
class=
"address"
>
云岩出发
</text>
</view>
<text
class=
"price"
>
¥299.00
</text>
</view>
</view>
</view>
</view>
</template>
<
script
setup
>
import
Sort
from
'../../../components/assistingAgriculture/index/Sort.vue'
;
import
DepartureDate
from
'../../../components/assistingAgriculture/index/DepartureDate.vue'
;
import
ScenicSpots
from
'../../../components/assistingAgriculture/index/ScenicSpots.vue'
;
import
Screen
from
'../../../components/assistingAgriculture/index/Screen.vue'
;
const
rotate
=
ref
(
false
);
const
rotate2
=
ref
(
false
);
const
rotate3
=
ref
(
false
);
const
rotate4
=
ref
(
false
);
const
current
=
ref
(
0
);
const
shopSwiperList
=
ref
([
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg'
,
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/capybara.jpg'
,
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.jpg'
,
]);
const
locationFiltering
=
(
index
)
=>
{
switch
(
index
)
{
case
0
:
rotate
.
value
=
!
rotate
.
value
;
rotate2
.
value
=
false
;
rotate3
.
value
=
false
;
rotate4
.
value
=
false
;
break
;
case
1
:
rotate2
.
value
=
!
rotate2
.
value
;
rotate
.
value
=
false
;
rotate3
.
value
=
false
;
rotate4
.
value
=
false
;
break
;
case
2
:
rotate3
.
value
=
!
rotate3
.
value
;
rotate
.
value
=
false
;
rotate2
.
value
=
false
;
rotate4
.
value
=
false
;
break
;
case
3
:
rotate4
.
value
=
!
rotate4
.
value
;
rotate
.
value
=
false
;
rotate2
.
value
=
false
;
rotate3
.
value
=
false
;
break
;
}
};
function
handleClick
(
e
)
{
console
.
log
(
e
);
}
function
onChange
(
e
)
{
console
.
log
(
e
);
}
</
script
>
<
style
lang=
"scss"
scoped
>
page
{
background
:
#f3f3f3
;
}
.special-offer-zone-list-page
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
width
:
750rpx
;
.custom-indicator
{
padding
:
0
12rpx
;
height
:
48rpx
;
line-height
:
48rpx
;
border-radius
:
45%
;
background
:
rgba
(
0
,
0
,
0
,
0
.6
);
color
:
#ffffff
;
font-size
:
24rpx
;
}
.swiper
{
width
:
100%
;
:deep
(
.wd-swiper__track
)
{
border-radius
:
0
;
}
}
.bootom
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-around
;
border-radius
:
6rpx
;
position
:
relative
;
margin-top
:
20rpx
;
.bootom-top
{
display
:
flex
;
align-items
:
center
;
padding
:
0
20rpx
;
justify-content
:
space-between
;
.option
{
text
{
font-size
:
24rpx
;
color
:
#343434
;
}
.red
{
color
:
#fa5151
;
}
.icons
{
color
:
#d8d8d8
;
transform
:
rotate
(
-180deg
);
transition
:
all
0
.3s
linear
;
}
.rotate
{
transform
:
rotate
(
0deg
);
transition
:
all
0
.3s
linear
;
color
:
#fa5151
;
}
}
.light
{
color
:
#ff7c00
;
background
:
#ffdcbb
;
}
}
}
.list
{
width
:
335
*
2rpx
;
background
:
#fff
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
margin
:
0
auto
;
border-radius
:
16rpx
;
margin-top
:
20rpx
;
.item
{
width
:
100%
;
padding
:
20rpx
;
box-sizing
:
border-box
;
display
:
flex
;
image
{
width
:
240rpx
;
height
:
240rpx
;
border-radius
:
16rpx
;
flex-shrink
:
0
;
}
.info
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
flex-start
;
margin-left
:
20rpx
;
.title
{
max-width
:
400rpx
;
font-size
:
14
*
2rpx
;
color
:
#3d3d3d
;
}
.subtitle
{
font-size
:
11
*
2rpx
;
color
:
#666666
;
margin-top
:
10rpx
;
}
.tag-list
{
display
:
flex
;
flex-wrap
:
wrap
;
margin-top
:
10rpx
;
.tag
{
box-sizing
:
border-box
;
padding
:
10rpx
16rpx
;
background
:
#eee
;
color
:
#3d3d3d
;
font-size
:
16rpx
;
border-radius
:
30rpx
;
margin-top
:
10rpx
;
margin-left
:
10rpx
;
}
}
.fs-box
{
margin-top
:
10rpx
;
font-size
:
12
*
2rpx
;
color
:
#0974f5
;
}
.address
{
margin-top
:
10rpx
;
font-size
:
12
*
2rpx
;
color
:
#0974f5
;
}
}
.price
{
font-size
:
14
*
2rpx
;
font-weight
:
bold
;
/* 主题色 */
color
:
#fa5151
;
align-self
:
flex-end
;
}
}
}
}
</
style
>
src/pages/assistingAgriculture/index/building.vue
View file @
d0f15039
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
<view
class=
"hot-sale"
>
<view
class=
"hot-sale"
>
<view
class=
"top-title"
>
<view
class=
"top-title"
>
<text
class=
"left-title"
>
好货热卖
</text>
<text
class=
"left-title"
>
好货热卖
</text>
<text
class=
"right-title"
>
更多
</text>
<text
class=
"right-title"
@
tap=
"toPresale"
>
更多
</text>
</view>
</view>
<wd-icon
<wd-icon
name=
"arrow-right"
name=
"arrow-right"
...
...
src/pages/assistingAgriculture/index/index.vue
View file @
d0f15039
...
@@ -8,21 +8,16 @@
...
@@ -8,21 +8,16 @@
placeholderText=
"请输入要搜索的内容"
placeholderText=
"请输入要搜索的内容"
></Search>
></Search>
<view>
<view>
<img
<wd-swiper
class=
"img1"
:list=
"swiperList"
src=
"/static/assistingAgriculture/assets/bacImg.png"
autoplay
style=
"width: 750rpx; height: 440rpx"
v-model:current=
"current"
/>
@
click=
"handleClick"
<img
@
change=
"onChange"
class=
"img2"
customClass=
"guiyang"
src=
"/static/assistingAgriculture/assets/bottom.png"
height=
"220"
style=
"width: 750rpx; height: 32rpx"
imageMode=
"aspectFill"
/>
></wd-swiper>
<img
class=
"img3"
src=
"/static/assistingAgriculture/assets/right.png"
style=
"width: 288rpx; height: 124rpx"
/>
</view>
</view>
<view
class=
"sort"
>
<view
class=
"sort"
>
<view
style=
"display: flex; flex-direction: row"
>
<view
style=
"display: flex; flex-direction: row"
>
...
@@ -62,11 +57,19 @@
...
@@ -62,11 +57,19 @@
import
Search
from
'../../../components/assistingAgriculture/index/Search.vue'
;
import
Search
from
'../../../components/assistingAgriculture/index/Search.vue'
;
import
{
import
{
getPresaleCategory
,
getPresaleCategory
,
getPresaleList
,
getSortList
,
getSortList
,
getStrictSelection
,
getStrictSelection
,
}
from
'../../../api/assistingAgriculture/building'
;
}
from
'../../../api/assistingAgriculture/building'
;
import
{
onMounted
}
from
'vue'
;
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
groupImgList
}
from
'@/api'
;
const
list
=
ref
([]);
const
list
=
ref
([]);
const
sortList
=
ref
([]);
const
swiperList
=
ref
([]);
const
current
=
ref
(
0
);
// 轮播图数据
let
lunboData
;
const
detailList
=
ref
([
const
detailList
=
ref
([
{
{
img
:
'/static/assistingAgriculture/assets/detailedMapOne.png'
,
img
:
'/static/assistingAgriculture/assets/detailedMapOne.png'
,
...
@@ -84,11 +87,11 @@ const detailList = ref([
...
@@ -84,11 +87,11 @@ const detailList = ref([
text
:
'麻辣鱼豆腐'
,
text
:
'麻辣鱼豆腐'
,
},
},
]);
]);
const
sortList
=
ref
([]);
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
getList
();
getList
();
getPresaleCategoryList
();
getPresaleCategoryList
();
getStrictSelectionList
();
getStrictSelectionList
();
getPresale
();
});
});
// 获取筑农专区分类;
// 获取筑农专区分类;
const
getList
=
()
=>
{
const
getList
=
()
=>
{
...
@@ -107,7 +110,6 @@ const getPresaleCategoryList = () => {
...
@@ -107,7 +110,6 @@ const getPresaleCategoryList = () => {
item
.
commodityList
=
item
.
prodSimples
;
item
.
commodityList
=
item
.
prodSimples
;
item
.
commodityList
.
forEach
((
item
)
=>
{
item
.
commodityList
.
forEach
((
item
)
=>
{
item
.
commodityImg
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
pic
;
item
.
commodityImg
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
pic
;
console
.
log
(
item
.
commodityImg
,
111
);
});
});
});
});
list
.
value
=
res
.
data
;
list
.
value
=
res
.
data
;
...
@@ -115,23 +117,40 @@ const getPresaleCategoryList = () => {
...
@@ -115,23 +117,40 @@ const getPresaleCategoryList = () => {
};
};
// 筑农严选分类
// 筑农严选分类
const
getStrictSelectionList
=
()
=>
{
const
getStrictSelectionList
=
()
=>
{
getStrictSelection
().
then
((
res
)
=>
{
getStrictSelection
().
then
((
res
)
=>
{});
console
.
log
(
res
,
333
);
};
// 预售板块轮播图
const
getPresale
=
()
=>
{
getPresaleList
({
place
:
'index_top'
}).
then
((
res
)
=>
{
console
.
log
(
res
,
111
);
res
.
data
.
forEach
((
item
)
=>
{
item
.
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
imgUrl
;
});
lunboData
=
res
.
data
;
swiperList
.
value
=
res
.
data
.
map
((
item
)
=>
{
return
item
.
imgUrl
;
});
});
});
};
};
const
onChange
=
(
e
)
=>
{
// console.log(e);
};
function
toBuilding
(
index
)
{
function
toBuilding
(
index
)
{
if
(
index
===
0
)
{
if
(
index
===
0
)
{
// TODO: 跳转到筑农严选
// TODO: 跳转到筑农严选
xma
.
navigateTo
({
xma
.
navigateTo
({
url
:
'/pages/assistingAgriculture/index/building'
,
url
:
'/pages/assistingAgriculture/index/building'
,
});
});
}
else
if
(
index
===
1
)
{
console
.
log
(
111
);
}
else
if
(
index
===
2
)
{
}
else
if
(
index
===
2
)
{
// TODO: 跳转到乡村旅居
// TODO: 跳转到乡村旅居
xma
.
navigateTo
({
xma
.
navigateTo
({
url
:
'/pages/assistingAgriculture/RuralTravel/RuralTravel'
,
url
:
'/pages/assistingAgriculture/RuralTravel/RuralTravel'
,
});
});
}
else
if
(
index
===
3
)
{
console
.
log
(
222
);
}
}
console
.
log
(
index
,
121
);
}
}
// 跳转详情页
// 跳转详情页
function
toDetail
()
{
function
toDetail
()
{
...
@@ -157,15 +176,6 @@ page {
...
@@ -157,15 +176,6 @@ page {
.img1
{
.img1
{
display
:
flex
;
display
:
flex
;
}
}
.img2
{
display
:
flex
;
margin-top
:
-31rpx
;
}
.img3
{
display
:
flex
;
margin-top
:
-120rpx
;
margin-left
:
462rpx
;
}
.bottom-image
{
.bottom-image
{
position
:
relative
;
position
:
relative
;
top
:
-40rpx
;
top
:
-40rpx
;
...
@@ -273,8 +283,8 @@ page {
...
@@ -273,8 +283,8 @@ page {
color
:
#fa5151
;
color
:
#fa5151
;
}
}
::v-deep
.icon
{
::v-deep
.icon
{
width
:
40rpx
;
width
:
40
rpx
;
height
:
40rpx
;
height
:
40
rpx
;
margin-left
:
40rpx
;
margin-left
:
40
rpx
;
}
}
</
style
>
</
style
>
src/pages/assistingAgriculture/index/presale.vue
View file @
d0f15039
...
@@ -10,13 +10,14 @@
...
@@ -10,13 +10,14 @@
</view>
</view>
<view
class=
"nav"
>
<view
class=
"nav"
>
<wd-swiper
<wd-swiper
class=
"main-img"
:list=
"swiperList"
:list=
"swiperList"
autoplay
autoplay
v-model:current=
"current"
v-model:current=
"current"
@
click=
"handleClick"
@
click=
"handleClick"
@
change=
"onChange"
@
change=
"onChange"
height=
"188"
customClass=
"guiyang"
height=
"220"
imageMode=
"aspectFill"
></wd-swiper>
></wd-swiper>
</view>
</view>
<view
class=
"sort"
>
<view
class=
"sort"
>
...
@@ -143,12 +144,11 @@
...
@@ -143,12 +144,11 @@
<
script
setup
>
<
script
setup
>
import
Search
from
'../../../components/assistingAgriculture/index/Search.vue'
;
import
Search
from
'../../../components/assistingAgriculture/index/Search.vue'
;
import
{
ref
,
onMounted
}
from
'vue'
;
import
{
ref
,
onMounted
}
from
'vue'
;
import
{
import
{
getPresaleList
}
from
'../../../api/assistingAgriculture/building'
;
getBuindingSort
,
const
swiperList
=
ref
([]);
getPresaleList
,
getStrictSelection
,
}
from
'../../../api/assistingAgriculture/building'
;
const
current
=
ref
(
0
);
const
current
=
ref
(
0
);
// 轮播图数据
let
lunboData
;
const
light
=
ref
(
0
);
const
light
=
ref
(
0
);
const
sortList
=
ref
([
const
sortList
=
ref
([
{
img
:
'/static/assistingAgriculture/presale/bacImg.png'
,
price
:
'25'
,
text
:
'应季好物'
},
{
img
:
'/static/assistingAgriculture/presale/bacImg.png'
,
price
:
'25'
,
text
:
'应季好物'
},
...
@@ -157,11 +157,6 @@ const sortList = ref([
...
@@ -157,11 +157,6 @@ const sortList = ref([
{
img
:
'/static/assistingAgriculture/presale/img4.png'
,
price
:
'25'
,
text
:
'预选蔬菜'
},
{
img
:
'/static/assistingAgriculture/presale/img4.png'
,
price
:
'25'
,
text
:
'预选蔬菜'
},
{
img
:
'/static/assistingAgriculture/presale/img5.png'
,
price
:
'25'
,
text
:
'心选水果'
},
{
img
:
'/static/assistingAgriculture/presale/img5.png'
,
price
:
'25'
,
text
:
'心选水果'
},
]);
]);
const
swiperList
=
ref
([
'../../../static/assistingAgriculture/presale/img.png'
,
'../../../static/assistingAgriculture/presale/img.png'
,
'../../../static/assistingAgriculture/presale/img.png'
,
]);
const
tabsData
=
ref
([
const
tabsData
=
ref
([
{
img
:
'/static/assistingAgriculture/assets/mainPicture.png'
,
text
:
'全部'
},
{
img
:
'/static/assistingAgriculture/assets/mainPicture.png'
,
text
:
'全部'
},
{
img
:
'/static/assistingAgriculture/assets/presale.png'
,
text
:
'分类1'
},
{
img
:
'/static/assistingAgriculture/assets/presale.png'
,
text
:
'分类1'
},
...
@@ -235,18 +230,18 @@ const goodList = ref([
...
@@ -235,18 +230,18 @@ const goodList = ref([
]);
]);
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
getPresale
();
getPresale
();
getBuindingSortList
();
});
});
// 预售板块轮播图
// 预售板块轮播图
const
getPresale
=
()
=>
{
const
getPresale
=
()
=>
{
getPresaleList
({
place
:
3
}).
then
((
res
)
=>
{
getPresaleList
({
place
:
'presale'
}).
then
((
res
)
=>
{
console
.
log
(
res
,
111
);
console
.
log
(
res
,
111
);
});
res
.
data
.
forEach
((
item
)
=>
{
};
item
.
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
imgUrl
;
// 筑农预售分类
});
const
getBuindingSortList
=
()
=>
{
lunboData
=
res
.
data
;
getBuindingSort
({
level
:
3
}).
then
((
res
)
=>
{
swiperList
.
value
=
res
.
data
.
map
((
item
)
=>
{
console
.
log
(
res
,
222
);
return
item
.
imgUrl
;
});
});
});
};
};
// 左侧数据列表
// 左侧数据列表
...
...
src/pages/index/coupon.vue
View file @
d0f15039
...
@@ -53,12 +53,11 @@
...
@@ -53,12 +53,11 @@
<
script
setup
>
<
script
setup
>
import
{}
from
'vue'
;
import
{}
from
'vue'
;
import
{
getCoupon
,
getShopAndProdPage
}
from
'../../api/index'
;
import
{
getCoupon
,
getShopAndProdPage
}
from
'../../api/index'
;
import
{
getLocation
}
from
'../../utils/tool'
;
const
tabs
=
ref
([
'推荐'
,
'附近美食'
,
'果蔬生鲜'
,
'数码商城'
,
'小吃快餐'
,
'数码商城'
,
'餐饮券'
]);
const
tabs
=
ref
([
'推荐'
,
'附近美食'
,
'果蔬生鲜'
,
'数码商城'
,
'小吃快餐'
,
'数码商城'
,
'餐饮券'
]);
const
params
=
{
const
params
=
{
current
:
1
,
current
:
1
,
size
:
6
,
size
:
6
,
lng
:
106.68650025025502
,
lat
:
26.567192352601154
,
};
};
let
total
;
let
total
;
const
active
=
ref
(
0
);
const
active
=
ref
(
0
);
...
@@ -107,10 +106,13 @@ const getCoupons = () => {
...
@@ -107,10 +106,13 @@ const getCoupons = () => {
};
};
// 领券中心-店铺商品列表分页
// 领券中心-店铺商品列表分页
const
getShop
=
()
=>
{
const
getShop
=
async
()
=>
{
xma
.
showLoading
({
xma
.
showLoading
({
title
:
'加载中'
,
title
:
'加载中'
,
});
});
const
{
lon
,
lat
}
=
await
getLocation
();
params
.
lng
=
lon
;
params
.
lat
=
lat
;
getShopAndProdPage
(
params
).
then
((
res
)
=>
{
getShopAndProdPage
(
params
).
then
((
res
)
=>
{
xma
.
hideLoading
();
xma
.
hideLoading
();
total
=
res
.
data
.
total
;
total
=
res
.
data
.
total
;
...
...
src/pages/index/index.vue
View file @
d0f15039
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
@
click=
"handleClick"
@
click=
"handleClick"
@
change=
"onChange"
@
change=
"onChange"
customClass=
"guiyang"
customClass=
"guiyang"
height=
"
68
"
height=
"
120
"
imageMode=
"aspectFill"
imageMode=
"aspectFill"
></wd-swiper>
></wd-swiper>
<!-- 附近人气美食 -->
<!-- 附近人气美食 -->
...
@@ -120,10 +120,10 @@
...
@@ -120,10 +120,10 @@
:class=
"
{ rotate: rotate }"
:class=
"
{ rotate: rotate }"
>
</wd-icon>
>
</wd-icon>
</view>
</view>
<view
class=
"box"
>
<
!--
<
view
class=
"box"
>
<text
class=
"text2"
>
排序筛选
</text>
<text
class=
"text2"
>
排序筛选
</text>
<wd-icon
name=
"fill-arrow-down"
size=
"22rpx"
class=
"icon2"
></wd-icon>
<wd-icon
name=
"fill-arrow-down"
size=
"22rpx"
class=
"icon2"
></wd-icon>
</view>
</view>
-->
</view>
</view>
<!-- 位置定位 -->
<!-- 位置定位 -->
<Position
v-show=
"rotate"
@
nearby=
"nearby"
@
popular=
"popular"
@
region=
"region"
/>
<Position
v-show=
"rotate"
@
nearby=
"nearby"
@
popular=
"popular"
@
region=
"region"
/>
...
@@ -175,6 +175,7 @@ import ShopCard from '../../components/index/ShopCard.vue';
...
@@ -175,6 +175,7 @@ import ShopCard from '../../components/index/ShopCard.vue';
import
Marketing
from
'../../components/index/Marketing.vue'
;
import
Marketing
from
'../../components/index/Marketing.vue'
;
import
Position
from
'../../components/index/Position.vue'
;
import
Position
from
'../../components/index/Position.vue'
;
import
{
orderStatus
}
from
'../../utils/signIn'
;
import
{
orderStatus
}
from
'../../utils/signIn'
;
import
{
getLocation
,
timeConversion
}
from
'../../utils/tool'
;
import
{
import
{
getTokenUser
,
getTokenUser
,
groupBuyList
,
groupBuyList
,
...
@@ -185,7 +186,7 @@ import {
...
@@ -185,7 +186,7 @@ import {
couponMainList
,
couponMainList
,
receiveCoupon
,
receiveCoupon
,
}
from
'../../api/index'
;
}
from
'../../api/index'
;
import
{
timeConversion
}
from
'../../utils/tool'
;
// import testJson from '../../static/json/test.json';
// import testJson from '../../static/json/test.json';
const
nowTime
=
ref
(
new
Date
().
getTime
());
const
nowTime
=
ref
(
new
Date
().
getTime
());
const
title
=
ref
(
'小程序平台'
);
const
title
=
ref
(
'小程序平台'
);
...
@@ -285,24 +286,19 @@ const getClassification = () => {
...
@@ -285,24 +286,19 @@ const getClassification = () => {
});
});
};
};
// 附近人气美食分页
// 附近人气美食分页
const
nearbyFood
=
()
=>
{
const
nearbyFood
=
async
()
=>
{
// xma.getLocation({
xma
.
showLoading
({
// isHighAccuracy: true,
title
:
'加载中'
,
// success: function (res) {
});
// console.log('经度', res.longitude);
// console.log('维度', res.latitude);
// },
// fail: function (err) {
// console.log('获取位置失败:', err);
// },
// });
const
data
=
{
const
data
=
{
current
:
1
,
current
:
1
,
size
:
3
,
size
:
3
,
lon
:
106.68650025025502
,
lat
:
26.567192352601154
,
};
};
const
{
lon
,
lat
}
=
await
getLocation
();
data
.
lon
=
lon
;
data
.
lat
=
lat
;
popularityPage
(
data
).
then
((
res
)
=>
{
popularityPage
(
data
).
then
((
res
)
=>
{
xma
.
hideLoading
();
res
.
data
.
content
.
forEach
((
item
)
=>
{
res
.
data
.
content
.
forEach
((
item
)
=>
{
item
.
shopLogo
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
shopLogo
;
item
.
shopLogo
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
shopLogo
;
item
.
lastBuyTime
=
new
Date
().
getTime
()
-
new
Date
(
item
.
lastBuyTime
).
getTime
();
item
.
lastBuyTime
=
new
Date
().
getTime
()
-
new
Date
(
item
.
lastBuyTime
).
getTime
();
...
@@ -313,7 +309,7 @@ const nearbyFood = () => {
...
@@ -313,7 +309,7 @@ const nearbyFood = () => {
// 附近美食查看更多
// 附近美食查看更多
const
more
=
()
=>
{
const
more
=
()
=>
{
xma
.
navigateTo
({
xma
.
navigateTo
({
url
:
'/pages/index/listFood?
type=2
'
,
url
:
'/pages/index/listFood?
categoryId=&place=rqms
'
,
});
});
};
};
// 轮播图
// 轮播图
...
@@ -351,10 +347,13 @@ const toUse = () => {
...
@@ -351,10 +347,13 @@ const toUse = () => {
});
});
};
};
// 商家列表分页-搜索列表
// 商家列表分页-搜索列表
const
getMerchantList
=
()
=>
{
const
getMerchantList
=
async
()
=>
{
xma
.
showLoading
({
xma
.
showLoading
({
title
:
'加载中'
,
title
:
'加载中'
,
});
});
const
{
lon
,
lat
}
=
await
getLocation
();
listParams
.
lon
=
lon
;
listParams
.
lat
=
lat
;
merchantList
(
listParams
).
then
((
res
)
=>
{
merchantList
(
listParams
).
then
((
res
)
=>
{
xma
.
hideLoading
();
xma
.
hideLoading
();
total
=
res
.
data
.
totalElements
;
total
=
res
.
data
.
totalElements
;
...
...
src/pages/index/listFood.vue
View file @
d0f15039
...
@@ -72,7 +72,7 @@ import Classification from '../../components/index/Classification.vue';
...
@@ -72,7 +72,7 @@ import Classification from '../../components/index/Classification.vue';
import
Position
from
'../../components/index/Position.vue'
;
import
Position
from
'../../components/index/Position.vue'
;
import
Sort
from
'../../components/index/Sort.vue'
;
import
Sort
from
'../../components/index/Sort.vue'
;
import
{
merchantList
,
getByParentId
,
getByType
}
from
'../../api/index'
;
import
{
merchantList
,
getByParentId
,
getByType
}
from
'../../api/index'
;
import
{
getLocation
}
from
'../../utils/tool'
;
const
business
=
reactive
([
'优选商家'
,
'超值半价'
,
'今日可订'
,
'经典单人'
]);
const
business
=
reactive
([
'优选商家'
,
'超值半价'
,
'今日可订'
,
'经典单人'
]);
const
active
=
ref
(
null
);
const
active
=
ref
(
null
);
const
rotate
=
ref
(
false
);
const
rotate
=
ref
(
false
);
...
@@ -169,11 +169,15 @@ const back = () => {
...
@@ -169,11 +169,15 @@ const back = () => {
});
});
};
};
// 商家列表分页-搜索列表
// 商家列表分页-搜索列表
const
getMerchantList
=
()
=>
{
const
getMerchantList
=
async
()
=>
{
xma
.
showLoading
({
xma
.
showLoading
({
title
:
'加载中'
,
title
:
'加载中'
,
});
});
const
{
lon
,
lat
}
=
await
getLocation
();
listParams
.
lon
=
lon
;
listParams
.
lat
=
lat
;
merchantList
(
listParams
).
then
((
res
)
=>
{
merchantList
(
listParams
).
then
((
res
)
=>
{
xma
.
hideLoading
();
total
=
res
.
data
.
totalElements
;
total
=
res
.
data
.
totalElements
;
xma
.
hideLoading
();
xma
.
hideLoading
();
console
.
log
(
'商家列表'
,
res
);
console
.
log
(
'商家列表'
,
res
);
...
...
src/pages/packageDetails/packageDetails.vue
View file @
d0f15039
...
@@ -227,7 +227,7 @@
...
@@ -227,7 +227,7 @@
<text
class=
"goods-type"
>
火锅
</text>
<text
class=
"goods-type"
>
火锅
</text>
<!--
<text
class=
"goods-rs"
>
36/人
</text>
-->
<!--
<text
class=
"goods-rs"
>
36/人
</text>
-->
</view>
</view>
<text
class=
"distance"
>
距你
{{
distance
}}
</text>
<text
class=
"distance"
>
距你
{{
shopInfo
.
distance
}}
</text>
<text
class=
"address"
>
{{
shopInfo
.
shopAddress
}}
</text>
<text
class=
"address"
>
{{
shopInfo
.
shopAddress
}}
</text>
</view>
</view>
<!-- 适用门店-end -->
<!-- 适用门店-end -->
...
@@ -398,8 +398,8 @@ function getLocationFn() {
...
@@ -398,8 +398,8 @@ function getLocationFn() {
success
:
function
(
res
)
{
success
:
function
(
res
)
{
const
myLatitude
=
shopLocation
.
value
.
latitude
;
const
myLatitude
=
shopLocation
.
value
.
latitude
;
const
myLongitude
=
shopLocation
.
value
.
longitude
;
const
myLongitude
=
shopLocation
.
value
.
longitude
;
console
.
log
(
'myLongitude'
,
myLatitude
,
myLongitude
);
const
distance
=
getDistance
(
res
.
latitude
,
res
.
longitude
,
myLatitude
,
myLongitude
,
1
);
const
distance
=
getDistance
(
res
.
latitude
,
res
.
longitude
,
myLatitude
,
myLongitude
,
1
);
shopInfo
.
value
.
distance
=
distance
;
shopInfo
.
value
.
distance
=
distance
;
},
},
fail
:
function
(
err
)
{
fail
:
function
(
err
)
{
...
...
src/pages/shop/confirmOrder.vue
View file @
d0f15039
...
@@ -163,6 +163,7 @@
...
@@ -163,6 +163,7 @@
import
Header
from
'@/pages/order/components/Header/index.vue'
;
import
Header
from
'@/pages/order/components/Header/index.vue'
;
import
{
groupBuyConfirm
,
groupBuyUpdate
,
groupBuyCreate
}
from
'@/api/confirmOrder'
;
import
{
groupBuyConfirm
,
groupBuyUpdate
,
groupBuyCreate
}
from
'@/api/confirmOrder'
;
import
{
getOrderDetail
}
from
'@/api/order'
;
import
{
getOrderDetail
}
from
'@/api/order'
;
import
{
debounce
}
from
'@/utils/common'
;
const
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
;
const
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
;
const
selectType
=
ref
(
'TENPAY'
);
const
selectType
=
ref
(
'TENPAY'
);
const
prodId
=
ref
(
null
);
const
prodId
=
ref
(
null
);
...
@@ -261,7 +262,7 @@ function groupBuyUpdateFn(couponUserId) {
...
@@ -261,7 +262,7 @@ function groupBuyUpdateFn(couponUserId) {
}
}
});
});
}
}
function
submitOrder
()
{
const
submitOrder
=
debounce
(()
=>
{
// TODO: 跳转到确认订单页面,并��带所选的支付方式
// TODO: 跳转到确认订单页面,并��带所选的支付方式
// id String 是 临时订单的id或key
// id String 是 临时订单的id或key
...
@@ -276,28 +277,28 @@ function submitOrder() {
...
@@ -276,28 +277,28 @@ function submitOrder() {
};
};
groupBuyCreate
(
params
).
then
((
res
)
=>
{
groupBuyCreate
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
let
timeout
=
null
;
const
start
=
new
Date
().
getTime
();
const
{
paymentUrl
,
outTradeNo
}
=
res
.
data
.
result
;
const
{
paymentUrl
,
outTradeNo
}
=
res
.
data
.
result
;
outTradeNos
.
value
=
outTradeNo
;
outTradeNos
.
value
=
outTradeNo
;
window
.
location
.
href
=
paymentUrl
;
window
.
location
.
href
=
paymentUrl
;
timeout
=
setTimeout
(
function
()
{
// 设置一个延时器
const
end
=
new
Date
().
getTime
();
const
start
=
Date
.
now
();
// 如果超时未打开应用,则假设未安装
setTimeout
(()
=>
{
if
(
end
-
start
<
1000
)
{
const
end
=
Date
.
now
();
if
(
end
-
start
<
1200
)
{
groupBuyConfirmFn
(
prodIds
.
value
,
skuIds
.
value
);
// 如果 iframe 加载时间小于 1.2 秒,说明应用没有安装
xma
.
showToast
({
xma
.
showToast
({
title
:
'未安装App'
,
title
:
'未安装App'
,
icon
:
'error'
,
icon
:
'error'
,
});
});
groupBuyConfirmFn
(
prodIds
.
value
,
skuIds
.
value
);
// 这里可以跳转到应用下载页面
}
}
},
1500
);
},
1000
);
}
else
{
groupBuyConfirmFn
(
prodIds
.
value
,
skuIds
.
value
);
}
}
});
});
// xma.redirectTo({
},
1000
);
// url: '/pages/shop/paymentSuccessful',
// });
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
src/pages/shop/shop.vue
View file @
d0f15039
...
@@ -271,6 +271,7 @@
...
@@ -271,6 +271,7 @@
class=
"scroll-view-item_H"
class=
"scroll-view-item_H"
v-for=
"(item, index) in recommendedListOfPeripherals"
v-for=
"(item, index) in recommendedListOfPeripherals"
:key=
"index"
:key=
"index"
@
click=
"refreshShowDetail(item)"
>
>
<view
class=
"item-box"
>
<view
class=
"item-box"
>
<image
mode=
"aspectFill"
:src=
"imgUrl + item.shopLogo"
></image>
<image
mode=
"aspectFill"
:src=
"imgUrl + item.shopLogo"
></image>
...
@@ -348,31 +349,6 @@ const recommendedTypesOfPeripherals = ref([]);
...
@@ -348,31 +349,6 @@ const recommendedTypesOfPeripherals = ref([]);
const
shopId
=
ref
(
''
);
const
shopId
=
ref
(
''
);
// 周边推荐-商家列表
// 周边推荐-商家列表
const
recommendedListOfPeripherals
=
ref
([]);
const
recommendedListOfPeripherals
=
ref
([]);
// onLoad((options) => {
// params.value.shopId = options.shopId;
// getStoreInformationFn(options.shopId).then(() => {
// peripheryRecomFn();
// });
// groupBuyListFn(options.shopId);
// shopId.value = options.shopId;
// couponShopListFn(options.shopId);
// getEvaluationPageFn();
// });
// onShow(() => {
// getStoreInformationFn(params.value.shopId).then(() => {
// // 获取位置
// getLocationFn().then((res) => {
// const distance = getDistance(
// res.lat,
// res.lon,
// shopLocation.value.lat,
// shopLocation.value.lon,
// 1,
// );
// shopInfo.value.distance = distance;
// });
// });
// });
onLoad
(
async
(
options
)
=>
{
onLoad
(
async
(
options
)
=>
{
params
.
value
.
shopId
=
options
.
shopId
;
params
.
value
.
shopId
=
options
.
shopId
;
shopId
.
value
=
options
.
shopId
;
shopId
.
value
=
options
.
shopId
;
...
@@ -400,6 +376,26 @@ onShow(async () => {
...
@@ -400,6 +376,26 @@ onShow(async () => {
// 获取位置并计算距离
// 获取位置并计算距离
calculateDistance
();
calculateDistance
();
});
});
async
function
refreshShowDetail
(
item
)
{
params
.
value
.
shopId
=
item
.
shopId
;
shopId
.
value
=
item
.
shopId
;
// 使用 Promise.all 并行请求,提升性能
await
Promise
.
all
([
getStoreInformationFn
(
item
.
shopId
),
groupBuyListFn
(
item
.
shopId
),
couponShopListFn
(
item
.
shopId
),
]);
// 获取周边推荐信息
peripheryRecomFn
();
// 获取评价信息
getEvaluationPageFn
();
// 获取位置并计算距离
calculateDistance
();
}
// 计算距离的函数封装
// 计算距离的函数封装
async
function
calculateDistance
()
{
async
function
calculateDistance
()
{
try
{
try
{
...
@@ -474,7 +470,6 @@ function sgyrddShopPageFn(categoryIds, lat, lon) {
...
@@ -474,7 +470,6 @@ function sgyrddShopPageFn(categoryIds, lat, lon) {
.
filter
((
item
)
=>
{
.
filter
((
item
)
=>
{
return
item
!==
''
;
return
item
!==
''
;
});
});
console
.
log
(
'res.data.content'
,
res
.
data
.
content
);
recommendedListOfPeripherals
.
value
=
res
.
data
.
content
;
recommendedListOfPeripherals
.
value
=
res
.
data
.
content
;
xma
.
hideLoading
();
xma
.
hideLoading
();
...
@@ -560,9 +555,13 @@ const groupBuyListFn = (shopId) => {
...
@@ -560,9 +555,13 @@ const groupBuyListFn = (shopId) => {
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
listOfGroupBuyingProducts
.
value
=
res
.
data
.
map
((
item
)
=>
{
listOfGroupBuyingProducts
.
value
=
res
.
data
.
map
((
item
)
=>
{
item
.
pic
=
imgUrl
+
item
.
pic
;
item
.
pic
=
imgUrl
+
item
.
pic
;
item
.
labelNames
=
item
.
labelNames
.
split
(
','
).
filter
((
lab
)
=>
{
if
(
item
.
labelNames
)
{
return
lab
!==
''
;
item
.
labelNames
=
item
.
labelNames
.
split
(
','
).
filter
((
lab
)
=>
{
});
return
lab
!==
''
;
});
}
else
{
item
.
labelNames
=
[];
}
return
item
;
return
item
;
});
});
}
}
...
...
src/pages/shop/text.vue
0 → 100644
View file @
d0f15039
<
template
>
<div>
<wd-rate
custom-class=
"icon-statr"
color=
"#fff"
readonly
v-model=
"grade"
size=
"22rpx"
space=
"8rpx"
:active-color=
"['#FA5151']"
/>
</div>
</
template
>
<
script
setup
>
const
grade
=
ref
(
5
);
</
script
>
<
style
lang=
"scss"
scoped
>
.icon-statr
{
:deep
(
.wd-icon-star-on
)
{
display
:
block
!
important
;
}
}
</
style
>
src/utils/common.js
View file @
d0f15039
...
@@ -21,7 +21,7 @@ export function getDistance(lat1, lng1, lat2, lng2, type = 1) {
...
@@ -21,7 +21,7 @@ export function getDistance(lat1, lng1, lat2, lng2, type = 1) {
?
type
===
0
?
type
===
0
?
distance
.
toFixed
(
2
)
+
'千米'
?
distance
.
toFixed
(
2
)
+
'千米'
:
distance
.
toFixed
(
2
)
+
'km'
:
distance
.
toFixed
(
2
)
+
'km'
:
type
===
1
:
type
===
0
?
(
distance
*
1000
).
toFixed
(
2
)
+
'米'
?
(
distance
*
1000
).
toFixed
(
2
)
+
'米'
:
(
distance
*
1000
).
toFixed
(
2
)
+
'm'
;
:
(
distance
*
1000
).
toFixed
(
2
)
+
'm'
;
}
}
...
...
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