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
03f542ba
Commit
03f542ba
authored
Aug 09, 2024
by
石建新(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商店首页
parent
6adfc6d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
11 deletions
+29
-11
index.vue
src/pages/assistingAgriculture/shop/index.vue
+28
-10
packageDetails.vue
src/pages/packageDetails/packageDetails.vue
+1
-1
No files found.
src/pages/assistingAgriculture/shop/index.vue
View file @
03f542ba
<
template
>
<
template
>
<view
class=
"page"
>
<view
class=
"page"
>
<view
class=
"banner"
>
<view
class=
"banner"
>
<
img
src=
"/static/assistingAgriculture/shop/banner.png"
alt=
""
/
>
<
wd-swiper
:list=
"shopImgList"
height=
"236rpx"
autoplay
></wd-swiper
>
</view>
</view>
<view
class=
"commodity-wrap"
>
<view
class=
"commodity-wrap"
>
<view
class=
"top-bar"
>
<view
class=
"top-bar"
>
<view
class=
"header"
>
分类
</view>
<view
class=
"header"
>
分类
</view>
<view
class=
"search"
>
<view
class=
"search"
>
<wd-search
@
search=
"searchFn"
hide-cancel
placeholder=
"请输入要搜索的内容"
/>
<wd-search
@
clear=
"clearFn"
@
search=
"searchFn"
hide-cancel
placeholder=
"请输入要搜索的内容"
/>
</view>
</view>
</view>
</view>
<view
class=
"content"
>
<view
class=
"content"
>
...
@@ -16,7 +21,6 @@
...
@@ -16,7 +21,6 @@
v-for=
"(v, i) in listOfDishCategories"
v-for=
"(v, i) in listOfDishCategories"
:key=
"i"
:key=
"i"
@
click=
"changeCate(v)"
@
click=
"changeCate(v)"
@
clear=
"clearFn"
:class=
"
{ active: acitveNav == v.categoryId }"
:class=
"
{ active: acitveNav == v.categoryId }"
>
>
{{
v
.
categoryName
}}
{{
v
.
categoryName
}}
...
@@ -101,12 +105,14 @@
...
@@ -101,12 +105,14 @@
import
{
ref
}
from
'vue'
;
import
{
ref
}
from
'vue'
;
import
{
shopCategoryByShop
,
searchProdPage
,
sgyBasketlist
}
from
'@/api/assistingAgriculture/shop'
;
import
{
shopCategoryByShop
,
searchProdPage
,
sgyBasketlist
}
from
'@/api/assistingAgriculture/shop'
;
import
{
addOrder
}
from
'@/api/packageDetail'
;
import
{
addOrder
}
from
'@/api/packageDetail'
;
import
{
getStoreInformation
}
from
'@/api/shop'
;
const
format
=
ref
(
'DD-HH:mm:ss'
);
const
format
=
ref
(
'DD-HH:mm:ss'
);
const
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
;
const
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
;
const
currentShopId
=
ref
(
''
);
const
currentShopId
=
ref
(
''
);
const
scrollTop
=
ref
(
0
);
const
scrollTop
=
ref
(
0
);
const
prodList
=
ref
([]);
const
prodList
=
ref
([]);
const
listOfDishCategories
=
ref
([]);
const
listOfDishCategories
=
ref
([]);
const
shopImgList
=
ref
([]);
const
params
=
ref
({
const
params
=
ref
({
isEnd
:
false
,
isEnd
:
false
,
current
:
1
,
current
:
1
,
...
@@ -122,6 +128,7 @@ onLoad((options) => {
...
@@ -122,6 +128,7 @@ onLoad((options) => {
searchProdPageFn
();
searchProdPageFn
();
});
});
sgyBasketlistFn
();
sgyBasketlistFn
();
getStoreInformationFn
();
});
});
const
shopCategoryByShopFn
=
(
shopId
)
=>
{
const
shopCategoryByShopFn
=
(
shopId
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
@@ -134,7 +141,19 @@ const shopCategoryByShopFn = (shopId) => {
...
@@ -134,7 +141,19 @@ const shopCategoryByShopFn = (shopId) => {
});
});
});
});
};
};
const
getStoreInformationFn
=
()
=>
{
getStoreInformation
(
currentShopId
.
value
).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
shopImgList
.
value
=
res
.
data
.
imgList
.
map
((
item
)
=>
{
console
.
log
(
'imgUrl.value'
,
imgUrl
.
value
);
item
.
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
imgUrl
;
return
item
.
imgUrl
;
});
console
.
log
(
'shopImgList'
,
shopImgList
);
}
});
};
const
acitveNav
=
ref
(
1
);
const
acitveNav
=
ref
(
1
);
const
searchFn
=
(
e
)
=>
{
const
searchFn
=
(
e
)
=>
{
const
{
value
}
=
e
;
const
{
value
}
=
e
;
...
@@ -155,6 +174,7 @@ const refreshData = (item) => {
...
@@ -155,6 +174,7 @@ const refreshData = (item) => {
params
.
value
.
isEnd
=
false
;
params
.
value
.
isEnd
=
false
;
params
.
value
.
current
=
1
;
params
.
value
.
current
=
1
;
prodList
.
value
=
[];
prodList
.
value
=
[];
params
.
value
.
prodName
=
''
;
resolve
();
resolve
();
});
});
};
};
...
@@ -183,10 +203,9 @@ const scrolltolowerFn = () => {
...
@@ -183,10 +203,9 @@ const scrolltolowerFn = () => {
searchProdPageFn
();
searchProdPageFn
();
};
};
function
clearFn
()
{
function
clearFn
()
{
console
.
log
(
'111111111111111111111111'
);
refreshData
().
then
((
res
)
=>
{
searchProdPageFn
();
params
.
value
.
prodName
=
''
;
});
searchProdPageFn
();
}
}
const
addPurchase
=
ref
(
0
);
const
addPurchase
=
ref
(
0
);
...
@@ -243,9 +262,8 @@ uni-page-body {
...
@@ -243,9 +262,8 @@ uni-page-body {
width
:
710rpx
;
width
:
710rpx
;
height
:
236rpx
;
height
:
236rpx
;
margin-bottom
:
20rpx
;
margin-bottom
:
20rpx
;
img
{
:deep
(
.wd-swiper__track
)
{
width
:
100%
;
border-radius
:
0
;
height
:
100%
;
}
}
}
}
.commodity-wrap
{
.commodity-wrap
{
...
...
src/pages/packageDetails/packageDetails.vue
View file @
03f542ba
...
@@ -917,7 +917,7 @@ page {
...
@@ -917,7 +917,7 @@ page {
font-weight
:
500
;
font-weight
:
500
;
}
}
img
{
img
{
width
:
100%
;
max-
width
:
100%
;
height
:
auto
;
height
:
auto
;
margin-top
:
20rpx
;
margin-top
:
20rpx
;
}
}
...
...
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