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
2cd12346
Commit
2cd12346
authored
Aug 12, 2024
by
石建新(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
旅居收藏
parent
b1cc3330
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
3 deletions
+42
-3
route.js
src/api/assistingAgriculture/route.js
+7
-0
RouteDetails.vue
src/pages/assistingAgriculture/RouteDetails/RouteDetails.vue
+35
-3
No files found.
src/api/assistingAgriculture/route.js
View file @
2cd12346
...
@@ -64,3 +64,10 @@ export function getItinerary(data) {
...
@@ -64,3 +64,10 @@ export function getItinerary(data) {
data
,
data
,
});
});
}
}
// 店铺信息
export
function
getStoreInformation
(
data
)
{
return
request
({
url
:
`/sgyrdd/shop/getById?shopId=
${
data
}
`
,
method
:
'GET'
,
});
}
src/pages/assistingAgriculture/RouteDetails/RouteDetails.vue
View file @
2cd12346
...
@@ -292,9 +292,10 @@
...
@@ -292,9 +292,10 @@
</div>
</div>
</scroll-view>
</scroll-view>
<div
class=
"footer flex-between"
>
<div
class=
"footer flex-between"
>
<div
class=
"like"
>
<div
class=
"like"
@
click=
"getCollectFn"
>
<wd-icon
name=
"star"
></wd-icon>
<wd-icon
v-if=
"shopInfo.isCollect === 0"
name=
"star"
></wd-icon>
<p>
收藏
</p>
<wd-icon
v-else
color=
"red"
name=
"star-on"
></wd-icon>
<p>
{{
shopInfo
.
privateIntFcount
||
0
}}
</p>
</div>
</div>
<button>
立即预定
</button>
<button>
立即预定
</button>
</div>
</div>
...
@@ -313,7 +314,9 @@ import {
...
@@ -313,7 +314,9 @@ import {
getMealList
,
getMealList
,
getPriceList
,
getPriceList
,
getItinerary
,
getItinerary
,
getStoreInformation
,
}
from
'@/api/assistingAgriculture/route'
;
}
from
'@/api/assistingAgriculture/route'
;
import
{
getCollect
}
from
'@/api/packageDetail'
;
const
swiperList
=
ref
([
const
swiperList
=
ref
([
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg'
,
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg'
,
...
@@ -338,6 +341,7 @@ const priceList = ref([]);
...
@@ -338,6 +341,7 @@ const priceList = ref([]);
const
viewPriceList
=
ref
([]);
const
viewPriceList
=
ref
([]);
const
activePrice
=
ref
({});
const
activePrice
=
ref
({});
const
show
=
ref
(
false
);
const
show
=
ref
(
false
);
const
shopIds
=
ref
(
''
);
watch
(
show
,
(
value
)
=>
{
watch
(
show
,
(
value
)
=>
{
let
index
=
priceList
.
value
.
indexOf
(
activePrice
.
value
);
let
index
=
priceList
.
value
.
indexOf
(
activePrice
.
value
);
index
=
Math
.
max
(
1
,
index
);
index
=
Math
.
max
(
1
,
index
);
...
@@ -355,9 +359,22 @@ const getPriceListFn = (mealId) => {
...
@@ -355,9 +359,22 @@ const getPriceListFn = (mealId) => {
viewPriceList
.
value
=
res
.
data
.
slice
(
0
,
4
);
viewPriceList
.
value
=
res
.
data
.
slice
(
0
,
4
);
});
});
};
};
const
shopInfo
=
ref
({});
// 获取店铺信息
const
getStoreInformationFn
=
(
id
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getStoreInformation
(
id
).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
shopInfo
.
value
=
res
.
data
.
shop
;
resolve
();
}
});
});
};
// 行程
// 行程
const
itineraryData
=
ref
([]);
const
itineraryData
=
ref
([]);
onLoad
(({
shopId
,
prodId
})
=>
{
onLoad
(({
shopId
,
prodId
})
=>
{
shopIds
.
value
=
shopId
;
getProd
({
getProd
({
prodId
,
prodId
,
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
...
@@ -387,7 +404,22 @@ onLoad(({ shopId, prodId }) => {
...
@@ -387,7 +404,22 @@ onLoad(({ shopId, prodId }) => {
getItinerary
({
prodId
}).
then
((
res
)
=>
{
getItinerary
({
prodId
}).
then
((
res
)
=>
{
itineraryData
.
value
=
res
.
data
;
itineraryData
.
value
=
res
.
data
;
});
});
// 获取店铺信息
getStoreInformationFn
(
shopId
);
});
});
function
getCollectFn
()
{
getCollect
(
shopIds
.
value
).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
if
(
shopInfo
.
value
.
isCollect
===
0
)
{
shopInfo
.
value
.
privateIntFcount
++
;
shopInfo
.
value
.
isCollect
=
1
;
}
else
{
shopInfo
.
value
.
privateIntFcount
--
;
shopInfo
.
value
.
isCollect
=
0
;
}
}
});
}
// 返回上一级
// 返回上一级
function
back
()
{
function
back
()
{
xma
.
navigateBack
({
xma
.
navigateBack
({
...
...
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