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
5603a2bb
Commit
5603a2bb
authored
Aug 12, 2024
by
石建新(贵阳日报)
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.platform.xinhuaapp.com/pengjiani/groupPurchase-miniapp
parents
064c1a29
33f7eaa5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
228 additions
and
24 deletions
+228
-24
search.js
src/api/assistingAgriculture/search.js
+20
-0
cart.vue
src/pages/assistingAgriculture/cart/cart.vue
+1
-1
detail.vue
src/pages/assistingAgriculture/detail/detail.vue
+1
-1
building.vue
src/pages/assistingAgriculture/index/building.vue
+15
-3
presale.vue
src/pages/assistingAgriculture/index/presale.vue
+15
-1
searchPage.vue
src/pages/assistingAgriculture/searchPage/searchPage.vue
+173
-15
confirmOrder.vue
src/pages/shop/confirmOrder.vue
+3
-3
No files found.
src/api/assistingAgriculture/search.js
0 → 100644
View file @
5603a2bb
import
{
request
}
from
'../../utils/request'
;
// 店铺分类商品列表/商品搜索
export
function
searchCommodity
(
data
)
{
return
request
({
url
:
`/sgyrdd/search/prod/page`
,
method
:
'POST'
,
data
,
});
}
// 商家列表分页-搜索列表
export
function
searchBusiness
(
data
)
{
return
request
({
url
:
`/sgyrdd/shop/page`
,
method
:
'POST'
,
data
,
});
}
src/pages/assistingAgriculture/cart/cart.vue
View file @
5603a2bb
...
...
@@ -164,7 +164,7 @@ const toStore = (item) => {
<
style
lang=
"scss"
scoped
>
.cart-wrap
{
height
:
1
00%
;
height
:
1
300rpx
;
background-color
:
#f6f6f6
;
position
:
relative
;
padding
:
20rpx
;
...
...
src/pages/assistingAgriculture/detail/detail.vue
View file @
5603a2bb
...
...
@@ -223,7 +223,7 @@ function toCart() {
function
toSettle
()
{
// TODO: 跳转到结算页面
xma
.
navigateTo
({
url
:
'/pages/assistingAgriculture/cart/ConfirmOrder'
,
url
:
`/pages/assistingAgriculture/cart/ConfirmOrder?type=qg&prodId=
${
dataDetails
.
value
.
skus
[
0
].
prodId
}
&skuId=
${
dataDetails
.
value
.
skus
[
0
].
skuId
}
`
,
});
}
</
script
>
...
...
src/pages/assistingAgriculture/index/building.vue
View file @
5603a2bb
...
...
@@ -119,7 +119,7 @@
</view>
<!-- 购物车悬浮按钮 -->
<view
class=
"cart-floating"
@
tap=
"toCart"
>
<wd-badge
modelValue=
"4
"
>
<wd-badge
:modelValue=
"subscript
"
>
<img
class=
"shop-car"
src=
"/static/assistingAgriculture/presale/cart.png"
...
...
@@ -136,7 +136,8 @@ import {
getGoodSaleProdList
,
getPlatformProdList
,
}
from
'../../../api/assistingAgriculture/building'
;
import
{
onMounted
}
from
'vue'
;
import
{
getshoppingCartList
}
from
'@/api/packageDetail'
;
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
useRoute
}
from
'vue-router'
;
const
current
=
ref
(
0
);
...
...
@@ -144,6 +145,7 @@ const rightList = ref([]);
const
light
=
ref
(
0
);
const
hotImgList
=
ref
([]);
const
testData
=
ref
([]);
const
subscript
=
ref
(
0
);
let
sortData
;
// 轮播图
const
swiperList
=
ref
([
...
...
@@ -169,8 +171,18 @@ const filteredProdList = ref([]);
onMounted
(
async
()
=>
{
getGoodSaleProd
();
platformProdList
();
getshoppingCartListFn
();
});
// 获取购物车列表
const
getshoppingCartListFn
=
()
=>
{
getshoppingCartList
({}).
then
((
res
)
=>
{
// 累加prodInfos长度
const
totalLength
=
res
.
data
.
reduce
((
accumulator
,
current
)
=>
{
return
accumulator
+
(
current
.
prodInfos
?
current
.
prodInfos
.
length
:
0
);
},
0
);
subscript
.
value
=
totalLength
;
});
};
// 好货热卖
const
getGoodSaleProd
=
()
=>
{
getGoodSaleProdList
(
params
).
then
((
res
)
=>
{
...
...
src/pages/assistingAgriculture/index/presale.vue
View file @
5603a2bb
...
...
@@ -113,7 +113,7 @@
</view>
<!-- 购物车悬浮按钮 -->
<view
class=
"cart-floating"
@
tap=
"toCart"
>
<wd-badge
modelValue=
"4
"
>
<wd-badge
:modelValue=
"subscript
"
>
<img
class=
"shop-car"
src=
"/static/assistingAgriculture/presale/cart.png"
...
...
@@ -133,6 +133,8 @@ import {
getPresaleProdList
,
getStrictSelection
,
}
from
'../../../api/assistingAgriculture/building'
;
import
{
getshoppingCartList
}
from
'@/api/packageDetail'
;
const
swiperList
=
ref
([]);
const
current
=
ref
(
0
);
// 轮播图数据
...
...
@@ -149,11 +151,23 @@ const params = {
size
:
10
,
categoryId
:
router
.
query
.
categoryId
,
};
const
subscript
=
ref
(
0
);
const
tabsList
=
ref
([]);
onMounted
(
async
()
=>
{
getPresale
();
presaleSortList
();
getshoppingCartListFn
();
});
// 获取购物车列表
const
getshoppingCartListFn
=
()
=>
{
getshoppingCartList
({}).
then
((
res
)
=>
{
// 累加prodInfos长度
const
totalLength
=
res
.
data
.
reduce
((
accumulator
,
current
)
=>
{
return
accumulator
+
(
current
.
prodInfos
?
current
.
prodInfos
.
length
:
0
);
},
0
);
subscript
.
value
=
totalLength
;
});
};
// 预售板块轮播图
const
getPresale
=
()
=>
{
getPresaleList
({
place
:
'presale'
}).
then
((
res
)
=>
{
...
...
src/pages/assistingAgriculture/searchPage/searchPage.vue
View file @
5603a2bb
<
template
>
<view
class=
"search-page"
>
<view
class=
"search"
:style=
"
{ background: '#FF0101' }">
<view
class=
"search"
style=
"background: linear-gradient(180deg, #71c456 0%, rgba(243, 243, 243, 0) 100%)"
>
<wd-icon
name=
"thin-arrow-left"
class=
"icon"
...
...
@@ -21,20 +24,82 @@
</view>
</view>
</view>
<wd-tabs
v-model=
"tab"
>
<wd-tabs
custom-class=
"tabss"
v-model=
"tab"
>
<block
v-for=
"(item, index) in tabs"
:key=
"index"
>
<wd-tab
:title=
"item"
>
<view
class=
"content"
v-show=
"tab === 0"
>
内容1
</view>
<view
class=
"content"
v-show=
"tab === 1"
>
内容2
</view>
<view
class=
"content1"
v-show=
"tab === 0"
>
<view
class=
"shopitem"
v-for=
"(item, index) in commoditys"
:key=
"index"
>
<image
class=
"img"
:src=
"item.imgUrl"
mode=
"aspectFill"
/>
<view
class=
"middle"
>
<text
class=
"text"
>
{{
item
.
prodName
}}
</text>
<text
class=
"text2"
>
¥
{{
item
.
price
}}
</text>
<text
class=
"collection"
>
月销量
{{
item
.
soldNum
}}
</text>
</view>
</view>
</view>
<view
class=
"content2"
v-show=
"tab === 1"
>
<view
class=
"shopitem"
v-for=
"(item, index) in shops"
:key=
"index"
>
<view
class=
"left"
>
<image
class=
"img"
:src=
"item.shopLogo"
mode=
"aspectFill"
/>
<view
class=
"middle"
>
<text
class=
"text"
>
{{
item
.
shopName
}}
</text>
<wd-rate
custom-class=
"icon-statr"
active-color=
"linear-gradient(180deg, rgba(255,238,0,1) 0%,rgba(250,176,21,1) 100%)"
size=
"24rpx"
v-model=
"item.grade"
/>
<text
class=
"collection"
>
{{
item
.
privateIntFcount
}}
人收藏
</text>
</view>
</view>
<view
class=
"btn"
>
进店看看
</view>
</view>
</view>
</wd-tab>
</block>
</wd-tabs>
</
template
>
<
script
setup
>
function
toSearch
(
keyword
)
{}
import
{
searchCommodity
,
searchBusiness
}
from
'@/api/assistingAgriculture/search'
;
const
tab
=
ref
(
0
);
const
tabs
=
ref
([
'商品'
,
'店铺'
]);
const
value
=
ref
(
5
);
const
commoditys
=
ref
([]);
const
shops
=
ref
([]);
const
baseImgurl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
;
function
changeValue
({
value
})
{
console
.
log
(
value
);
}
// 搜索
const
toSearch
=
(
data
)
=>
{
const
keyword
=
data
.
detail
.
value
;
const
params
=
{
current
:
1
,
size
:
100
,
};
const
params2
=
{
current
:
1
,
size
:
100
,
};
// 商品搜索
params
.
prodName
=
keyword
;
searchCommodity
(
params
).
then
((
res
)
=>
{
res
.
data
.
data
.
forEach
((
item
)
=>
{
const
imgs
=
item
.
imgs
.
split
(
','
);
item
.
imgUrl
=
baseImgurl
+
imgs
[
0
];
});
commoditys
.
value
=
res
.
data
.
data
;
});
// 店铺搜索
params2
.
keyword
=
keyword
;
searchBusiness
(
params2
).
then
((
res
)
=>
{
res
.
data
.
content
.
forEach
((
item
)
=>
{
item
.
shopLogo
=
baseImgurl
+
item
.
shopLogo
;
});
shops
.
value
=
res
.
data
.
content
;
});
};
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -78,20 +143,113 @@ page {
}
}
}
.content
{
display
:
flex
;
flex-direction
:
column
;
align-content
:
center
;
gap
:
20rpx
;
}
}
:deep
(
.wd-tabs__line
)
{
background-color
:
#
e9231b
;
background-color
:
#
2fb641
;
bottom
:
2px
;
}
.content
{
line-height
:
120px
;
text-align
:
center
;
.content1
{
background
:
#f6f6f6
;
box-sizing
:
border-box
;
.shopitem
{
padding
:
0
20rpx
;
display
:
flex
;
height
:
200rpx
;
background-color
:
white
;
align-items
:
center
;
border-bottom
:
1rpx
solid
rgb
(
225
,
223
,
223
);
.img
{
width
:
200rpx
;
height
:
150rpx
;
border-radius
:
16rpx
;
flex-shrink
:
0
;
}
.middle
{
height
:
150rpx
;
margin-left
:
20rpx
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-around
;
.text
{
font-weight
:
bold
;
font-size
:
26rpx
;
}
.text2
{
font-weight
:
bold
;
font-size
:
22rpx
;
color
:
red
;
}
.collection
{
font-size
:
22rpx
;
color
:
rgb
(
147
,
145
,
145
);
}
}
.btn
{
text-align
:
center
;
border-radius
:
50rpx
;
background
:
#2fb641
;
font-size
:
22rpx
;
padding
:
8rpx
15rpx
;
color
:
white
;
box-sizing
:
border-box
;
}
}
}
.content2
{
background
:
#f6f6f6
;
padding
:
10rpx
15rpx
;
box-sizing
:
border-box
;
.shopitem
{
padding
:
0
20rpx
;
display
:
flex
;
height
:
150rpx
;
background-color
:
white
;
border-radius
:
16rpx
;
align-items
:
center
;
justify-content
:
space-between
;
margin-bottom
:
10rpx
;
.left
{
display
:
flex
;
align-items
:
center
;
height
:
100rpx
;
.img
{
width
:
100rpx
;
height
:
100rpx
;
border-radius
:
16rpx
;
}
.middle
{
height
:
100%
;
margin-left
:
20rpx
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
.text
{
font-weight
:
bold
;
font-size
:
26rpx
;
margin-bottom
:
8rpx
;
}
.icon-statr
{
:deep
(
.wd-icon-star-on
)
{
display
:
block
!
important
;
}
}
.collection
{
font-size
:
22rpx
;
}
}
}
.btn
{
text-align
:
center
;
border-radius
:
50rpx
;
background
:
#2fb641
;
font-size
:
22rpx
;
padding
:
8rpx
15rpx
;
color
:
white
;
box-sizing
:
border-box
;
}
}
}
</
style
>
src/pages/shop/confirmOrder.vue
View file @
5603a2bb
...
...
@@ -231,10 +231,10 @@ function groupBuyConfirmFn(prodId, skuId) {
res
.
data
.
orderItems
[
0
].
pic
=
imgUrl
+
res
.
data
.
orderItems
[
0
].
pic
;
orderInfo
.
value
=
res
.
data
;
resolve
(
res
.
data
.
shopId
);
}
else
{
}
else
{
wx
.
showToast
({
title
:
res
.
msg
})
title
:
res
.
msg
,
})
;
}
});
});
...
...
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