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
66413769
Commit
66413769
authored
Aug 09, 2024
by
陈宗胤(贵阳日报)
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.platform.xinhuaapp.com/pengjiani/groupPurchase-miniapp
parents
237b9070
db7ef839
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
404 additions
and
232 deletions
+404
-232
address.js
src/api/address.js
+37
-0
shop.js
src/api/assistingAgriculture/shop.js
+18
-0
storeEntry.js
src/api/storeEntry.js
+1
-0
addressEdit.vue
src/pages/address/addressEdit.vue
+30
-21
addressList.vue
src/pages/address/addressList.vue
+32
-29
presale.vue
src/pages/assistingAgriculture/index/presale.vue
+34
-83
index.vue
src/pages/assistingAgriculture/shop/index.vue
+244
-71
text.vue
src/pages/shop/text.vue
+0
-25
index.vue
src/pages/storeEntry/index.vue
+8
-3
No files found.
src/api/address.js
0 → 100644
View file @
66413769
import
{
request
}
from
'../utils/request'
;
export
function
groupBuyList
()
{
return
request
({
url
:
'/sgyrdd/category/groupBuyList'
,
method
:
'GET'
,
});
}
// 新增收货地址
export
async
function
addAddress
()
{
return
request
({
url
:
'/sgyrdd/useraddr/add'
,
method
:
'GET'
,
});
}
// 修改收货地址
export
async
function
updateAddress
()
{
return
request
({
url
:
'/sgyrdd/useraddr/update'
,
method
:
'GET'
,
});
}
// 删除收货地址
export
async
function
deleteAddress
(
addrId
)
{
return
request
({
url
:
`/sgyrdd/useraddr/delete/
${
addrId
}
`
,
method
:
'GET'
,
});
}
// 查询收货地址列表
export
async
function
getAddressList
()
{
return
request
({
url
:
'/sgyrdd/useraddr/list'
,
method
:
'GET'
,
});
}
src/api/assistingAgriculture/shop.js
0 → 100644
View file @
66413769
import
{
request
}
from
'../../utils/request'
;
// 筑农首页-分类查询商品列表
export
function
shopCategoryByShop
(
data
)
{
return
request
({
url
:
`/sgyrdd/shopCategory/byShop`
,
method
:
'GET'
,
data
,
});
}
// 筑农首页-店铺分类商品列表
export
function
searchProdPage
(
data
)
{
return
request
({
url
:
`/sgyrdd/search/prod/page`
,
method
:
'POST'
,
data
,
});
}
src/api/storeEntry.js
View file @
66413769
...
...
@@ -16,3 +16,4 @@ export function applyShop(data) {
data
,
});
}
src/pages/address/addressEdit.vue
View file @
66413769
<
template
>
<view
class=
"container"
>
<template
v-if=
"newAddressFlag"
>
<Header
title=
"新增收货地址"
></Header>
</
template
>
<
template
v-else
>
<Header
title=
"编辑收货地址"
></Header>
</
template
>
<Header
:title=
"newAddressFlag ? '新增收货地址' : '编辑收货地址'"
></Header>
<view
class=
"content"
>
<wd-form
ref=
"form"
:model=
"model"
id=
"form"
>
<wd-cell-group
border
>
<wd-cell-group>
<wd-input
label=
"联系人"
label-width=
"80px"
prop=
"
name
"
v-model=
"model.
name
"
prop=
"
receiver
"
v-model=
"model.
receiver
"
placeholder=
"请输入联系人姓名"
:rules=
"[
{ required: false, validator: fieldNotEmpty, message: '姓名不能为空' }]"
/>
<wd-input
label=
"手机号"
label-width=
"80px"
prop=
"
phon
e"
v-model=
"model.
phon
e"
prop=
"
mobil
e"
v-model=
"model.
mobil
e"
placeholder=
"请输入联系人手机号"
:rules=
"[
{ required: false, pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号' }]"
/>
<wd-input
label=
"详细地址"
label-width=
"80px"
prop=
"
detailAddress
"
v-model=
"model.
detailAddress
"
prop=
"
addr
"
v-model=
"model.
addr
"
placeholder=
"请输入详细地址"
:rules=
"[
{ required: false, validator: fieldNotEmpty, message: '详细地址不能为空' }]"
/>
...
...
@@ -46,11 +42,11 @@
</view>
</wd-cell>
</wd-checkbox-group>
<wd-checkbox-group
v-model=
"model.
isDefaultAddress
"
size=
"large"
>
<wd-cell
title=
"设置为默认地址"
center
clickable
@
click
=
"setDefaultAddress"
>
<wd-checkbox-group
v-model=
"model.
commonAddr
"
size=
"large"
>
<wd-cell
title=
"设置为默认地址"
center
clickable
@
tap
=
"setDefaultAddress"
>
<view>
<wd-checkbox
model
-valu
e=
"1"
model
Value
e=
"1"
ref=
"checkBoxAdress"
checked-color=
"#fa5151"
custom-style=
"margin-right:-18rpx"
...
...
@@ -61,7 +57,7 @@
</wd-cell-group>
<view
class=
"footer"
>
<wd-button
type=
"error"
block
class=
"addBtn"
@
click
=
"handleSubmit"
>
保存
</wd-button>
<wd-button
type=
"error"
block
class=
"addBtn"
@
tap
=
"handleSubmit"
>
保存
</wd-button>
</view>
</wd-form>
</view>
...
...
@@ -70,8 +66,9 @@
<
script
setup
>
import
Header
from
'@/pages/order/components/Header/index.vue'
;
import
{
addAddress
,
updateAddress
,
deleteAddress
}
from
'@/api/address'
;
const
fileDomain
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
;
const
newAddressFlag
=
ref
(
false
);
const
form
=
ref
();
const
checkBoxAdress
=
ref
();
...
...
@@ -92,9 +89,9 @@ onLoad((options) => {
isDefaultAddress
:
[],
});
}
else
{
model
.
value
.
name
=
'
这是名字
'
;
model
.
value
.
phone
=
'
13655844265
'
;
model
.
value
.
detailAddress
=
'
贵州省贵阳市南明区
'
;
model
.
value
.
name
=
''
;
model
.
value
.
phone
=
''
;
model
.
value
.
detailAddress
=
''
;
model
.
value
.
isDefaultAddress
=
[
'1'
];
}
});
...
...
@@ -111,6 +108,10 @@ function fieldNotEmpty(val) {
return
false
;
}
}
const
submit
=
async
()
=>
{
const
res
=
await
addAddress
(
model
.
value
);
console
.
log
(
res
);
};
function
handleSubmit
()
{
form
.
value
.
validate
()
...
...
@@ -146,15 +147,19 @@ page {
font-family
:
Source
Han
Sans
;
font-variation-settings
:
'opsz'
auto
;
font-feature-settings
:
'kern'
on
;
.content
{
padding-top
:
88rpx
;
#form
{
width
:
710rpx
;
margin
:
20rpx
auto
;
}
.
wd-input__label
.
is-required
:
:
after
{
display
:
none
!
important
;
}
.addBtn
{
width
:
630rpx
;
height
:
72rpx
;
...
...
@@ -171,10 +176,12 @@ page {
display
:
flex
;
width
:
100%
;
align-items
:
center
;
.area_l
{
flex
:
1
;
display
:
flex
;
flex-direction
:
column
;
.area_lt
{
font-size
:
24rpx
;
font-weight
:
500
;
...
...
@@ -183,6 +190,7 @@ page {
text-align
:
left
;
margin-bottom
:
10rpx
;
}
.area_lb
{
font-size
:
24rpx
;
font-weight
:
normal
;
...
...
@@ -191,6 +199,7 @@ page {
text-align
:
left
;
}
}
.area_r
{
width
:
40rpx
;
}
...
...
src/pages/address/addressList.vue
View file @
66413769
...
...
@@ -7,41 +7,21 @@
<img
src=
"@/static/address/address.png"
/>
<wd-button
type=
"error"
block
class=
"addBtn"
@
tap=
"addNewAddress"
>
新增地址
</wd-button>
</view>
<view
class=
"full_list"
v-else
>
<view
class=
"additem"
>
<view
class=
"additem_l"
>
<view
class=
"address"
>
这是地址这是地址这是地址这是地址这是地 址这是地址这是地址
</view>
<view
class=
"info"
>
<view
class=
"name"
>
这是姓名
</view>
<view
class=
"phone"
>
123456789258
</view>
</view>
<view
class=
"address_status"
>
<view
v-if=
"mainAddFlag"
class=
"box active"
>
<wd-icon
name=
"check-circle-filled"
size=
"12px"
></wd-icon>
<view
class=
"txt"
>
默认
</view>
</view>
<view
v-else
class=
"box"
>
<wd-icon
name=
"circle1"
size=
"12px"
></wd-icon>
<view
class=
"txt"
>
默认
</view>
</view>
</view>
</view>
<view
class=
"additem_r"
>
<wd-icon
name=
"edit-outline"
size=
"14px"
@
tap=
"editAddress"
></wd-icon>
</view>
</view>
<view
class=
"additem"
>
<view
class=
"additem"
v-for=
"(item, index) in addressList"
:key=
"index"
>
<view
class=
"additem_l"
>
<view
class=
"address"
>
这是地址这是地址这是地址这是地址这是地 址这是地址这是地址
</view>
<view
class=
"address"
>
{{
item
.
addr
}}
</view>
<view
class=
"info"
>
<view
class=
"name"
>
这是姓名
</view>
<view
class=
"phone"
>
123456789258
</view>
<view
class=
"name"
>
{{
item
.
receiver
}}
</view>
<view
class=
"phone"
>
{{
item
.
mobile
}}
</view>
</view>
<view
class=
"address_status"
>
<view
v-if=
"
mainAddFlag
"
class=
"box active"
>
<view
v-if=
"
item.commonAddr === 1
"
class=
"box active"
>
<wd-icon
name=
"check-circle-filled"
size=
"12px"
></wd-icon>
<view
class=
"txt"
>
默认
</view>
</view>
<view
v-else
class=
"box"
>
<wd-icon
name=
"circle1"
size=
"12px"
></wd-icon>
<view
class=
"txt"
>
默认
</view>
...
...
@@ -52,6 +32,7 @@
<wd-icon
name=
"edit-outline"
size=
"14px"
@
tap=
"editAddress"
></wd-icon>
</view>
</view>
<wd-button
type=
"error"
block
class=
"addBtn"
@
tap=
"addNewAddress"
>
新增地址
</wd-button>
</view>
</view>
...
...
@@ -60,9 +41,23 @@
<
script
setup
>
import
Header
from
'@/pages/order/components/Header/index.vue'
;
const
fileDomain
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
;
import
{
getAddressList
,
deleteAddress
}
from
'@/api/address'
;
const
isAdressEmpty
=
ref
(
false
);
const
mainAddFlag
=
ref
(
false
);
const
addressList
=
ref
([]);
const
getAddressListData
=
async
()
=>
{
const
{
data
:
res
}
=
await
getAddressList
();
console
.
log
(
res
);
if
(
res
)
{
addressList
.
value
=
res
;
res
.
length
===
0
?
(
isAdressEmpty
.
value
=
true
)
:
(
isAdressEmpty
.
value
=
false
);
}
};
getAddressListData
();
const
addNewAddress
=
()
=>
{
xma
.
navigateTo
({
url
:
'/pages/address/addressEdit?new=true'
});
...
...
@@ -97,6 +92,7 @@ page {
.full_list
{
margin-top
:
20rpx
;
.additem
{
width
:
710rpx
;
padding
:
20rpx
;
...
...
@@ -109,17 +105,20 @@ page {
font-family
:
Source
Han
Sans
;
font-variation-settings
:
'opsz'
auto
;
font-feature-settings
:
'kern'
on
;
.additem_l
{
width
:
600rpx
;
display
:
flex
;
flex-direction
:
column
;
}
.additem_r
{
flex
:
1
;
padding-top
:
30rpx
;
box-sizing
:
border-box
;
text-align
:
right
;
}
.address
{
font-size
:
24rpx
;
font-weight
:
500
;
...
...
@@ -136,6 +135,7 @@ page {
color
:
#abaaaa
;
display
:
flex
;
margin-bottom
:
30rpx
;
.phone
{
margin-left
:
10rpx
;
}
...
...
@@ -146,11 +146,13 @@ page {
display
:
flex
;
font-size
:
18rpx
;
align-items
:
center
;
.txt
{
margin-left
:
5rpx
;
color
:
#abaaaa
;
}
}
.box.active
{
color
:
#fa5151
;
}
...
...
@@ -172,12 +174,13 @@ page {
.empty_list
{
margin-top
:
20rpx
;
img
{
width
:
566rpx
;
height
:
566rpx
;
margin
:
40rpx
auto
60rpx
;
display
:
block
;
border
:
1px
dashed
rgb
(
182
,
182
,
182
);
//
border: 1px dashed rgb(182, 182, 182);
}
.addBtn
{
...
...
src/pages/assistingAgriculture/index/presale.vue
View file @
66413769
...
...
@@ -24,7 +24,7 @@
<view
style=
"display: flex; flex-direction: row"
>
<view
class=
"borderClass"
@
tap=
"chooseTab(item.categoryId)"
@
tap=
"chooseTab(i
ndex, i
tem.categoryId)"
v-for=
"(item, index) in sortList"
:key=
"index"
>
...
...
@@ -37,7 +37,7 @@
<view>
<scroll-view
class=
"tabs"
show-scrollbar=
"false"
scroll-x
:scroll-with-animation=
"true"
>
<text
@
tap=
"cho
ice
(index, item.categoryId)"
@
tap=
"cho
oseBTab
(index, item.categoryId)"
v-for=
"(item, index) in tabsData"
:key=
"index"
class=
"text"
...
...
@@ -47,7 +47,7 @@
</text>
</scroll-view>
</view>
<view
class=
"tab-list"
v-for=
"(item, index) in
sortData
List"
:key=
"index"
@
tap=
"toDetail"
>
<view
class=
"tab-list"
v-for=
"(item, index) in
buy
List"
:key=
"index"
@
tap=
"toDetail"
>
<img
class=
"buy-list"
:src=
"item.img"
style=
"width: 670rpx; height: 670rpx"
/>
<view>
<text
class=
"retail-price"
>
零售价:¥
{{
item
.
oriPrice
}}
/盒
</text>
...
...
@@ -73,7 +73,7 @@
<view
class=
"wt-left wt-list"
>
<view
class=
"wt-item"
v-for=
"(good, index) in buyList"
:key=
"index"
@
tap=
"toDetail"
>
<view
class=
"item-img"
>
<image
:src=
"good.img"
mode=
"widthFix"
></image>
<image
:src=
"good.img"
mode=
"widthFix"
style=
"border-radius: 16rpx"
></image>
<image
class=
"presale-img"
src=
"/static/assistingAgriculture/presale/presale.png"
...
...
@@ -100,6 +100,7 @@
<text
class=
"good-detail"
>
{{
good
.
detail
}}
</text>
<text
class=
"introduction"
>
{{
good
.
introduction
}}
</text>
<text
class=
"good-price"
>
¥
{{
good
.
price
}}
</text>
<img
class=
"add"
src=
"/static/assistingAgriculture/presale/add.png"
/>
</view>
</view>
</view>
...
...
@@ -137,62 +138,7 @@ const light = ref(0);
const
sortList
=
ref
([]);
const
tabsData
=
ref
([]);
const
buyList
=
ref
([]);
const
sortDataList
=
ref
([]);
const
shopList
=
ref
([
{
img
:
'/static/assistingAgriculture/presale/img7.png'
,
price
:
'29.9'
,
text
:
'应季好物'
},
{
img
:
'/static/assistingAgriculture/presale/img7.png'
,
price
:
'29.9'
,
text
:
'应季好物'
},
{
img
:
'/static/assistingAgriculture/presale/img7.png'
,
price
:
'29.9'
,
text
:
'应季好物'
},
{
img
:
'/static/assistingAgriculture/presale/img7.png'
,
price
:
'29.9'
,
text
:
'应季好物'
},
{
img
:
'/static/assistingAgriculture/presale/img7.png'
,
price
:
'29.9'
,
text
:
'应季好物'
},
{
img
:
'/static/assistingAgriculture/presale/img7.png'
,
price
:
'29.9'
,
text
:
'应季好物'
},
]);
// 声明需要的数据
const
data
=
reactive
({
leftList
:
[],
// 左边列图片
rightList
:
[],
// 右边列图片
leftHeight
:
0
,
// 左边列高度
rightHeight
:
0
,
// 右边列高度
columnWidth
:
0
,
// 列宽度
});
// 总商品数据列表
const
goodList
=
ref
([
{
id
:
1
,
name
:
'这是一个商品'
,
image
:
'/static/assistingAgriculture/presale/buy.png'
,
introduction
:
'商品简介商品简介'
,
price
:
69.9
,
},
{
id
:
2
,
name
:
'商品二'
,
image
:
'/static/assistingAgriculture/presale/img7.png'
,
introduction
:
'商品简介商品简介'
,
price
:
69.9
,
},
{
id
:
3
,
name
:
'商品三'
,
image
:
'/static/assistingAgriculture/assets/fruit.png'
,
introduction
:
'商品简介商品简介'
,
price
:
69.9
,
},
{
id
:
4
,
name
:
'商品四'
,
image
:
'/static/assistingAgriculture/presale/buy.png'
,
introduction
:
'商品简介商品简介'
,
price
:
69.9
,
},
{
id
:
5
,
name
:
'商品五'
,
image
:
'/static/assistingAgriculture/presale/buy.png'
,
introduction
:
'商品简介商品简介'
,
price
:
69.9
,
},
]);
const
router
=
useRoute
();
const
params
=
{
current
:
1
,
...
...
@@ -202,10 +148,8 @@ const params = {
const
tabsList
=
ref
([]);
onMounted
(
async
()
=>
{
getPresale
();
getPresaleProd
();
//
getPresaleProd();
presaleSortList
();
chooseTab
(
'3287'
);
choice
(
0
,
'3292'
);
});
// 预售板块轮播图
const
getPresale
=
()
=>
{
...
...
@@ -230,46 +174,48 @@ const presaleSortList = () => {
sortList
.
value
=
res
.
data
.
map
((
item
)
=>
{
return
item
.
imgUrl
;
});
console
.
log
(
res
.
data
,
111
);
sortList
.
value
=
res
.
data
;
chooseTab
(
0
,
sortList
.
value
[
0
].
categoryId
);
});
};
const
chooseTab
=
(
index
)
=>
{
getStrictSelection
({
parentId
:
index
}).
then
((
res
)
=>
{
const
chooseTab
=
(
index
,
categoryId
)
=>
{
getStrictSelection
({
parentId
:
categoryId
}).
then
((
res
)
=>
{
res
.
data
.
forEach
((
item
,
index
)
=>
{
item
.
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
pic
;
});
tabsData
.
value
=
res
.
data
;
chooseBTab
(
0
,
tabsData
.
value
[
0
].
categoryId
);
});
};
// 筑农首页-分类查询商品列表
const
getPresaleProd
=
()
=>
{
getPresaleProdList
(
params
).
then
((
res
)
=>
{
const
chooseBTab
=
(
index
,
categoryId
)
=>
{
getPresaleProdList
({
current
:
1
,
size
:
10
,
categoryId
}).
then
((
res
)
=>
{
res
.
data
.
records
.
forEach
((
item
)
=>
{
item
.
img
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
pic
;
});
buyList
.
value
=
res
.
data
.
records
;
});
light
.
value
=
index
;
};
// 筑农首页-分类查询商品列表
// const getPresaleProd = () => {
// getPresaleProdList(params).then((res) => {
// res.data.records.forEach((item) => {
// item.img = import.meta.env.VITE_APP_IMG_URL + item.pic;
// });
// buyList.value = res.data.records;
// });
// };
// 二级分类点击事件
const
choice
=
(
index
,
categoryId
)
=>
{
sortDataList
.
value
=
tabsData
.
value
[
index
];
getPresaleProdList
({
current
:
1
,
size
:
10
,
categoryId
}).
then
((
res
)
=>
{
res
.
data
.
records
.
forEach
((
item
)
=>
{
item
.
img
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
pic
;
});
buyList
.
value
=
res
.
data
.
records
;
});
light
.
value
=
index
;
};
// 左侧数据列表
const
LeftList
=
ref
([]);
// 右侧数据列表
const
RightList
=
ref
([]);
// 将商品信息列表分为左侧右侧两个部分
for
(
let
i
=
0
;
i
<
goodList
.
value
.
length
;
i
++
)
{
if
(
i
%
2
===
0
)
{
LeftList
.
value
.
push
(
goodList
.
value
[
i
]);
}
else
{
RightList
.
value
.
push
(
goodList
.
value
[
i
]);
}
}
// 点击商品 跳转详情
function
ToDetail
(
id
)
{
...
...
@@ -530,4 +476,9 @@ page {
width
:
56rpx
;
height
:
56rpx
;
}
img
.add
{
position
:
relative
;
left
:
200rpx
;
top
:
30rpx
;
}
</
style
>
src/pages/assistingAgriculture/shop/index.vue
View file @
66413769
<
template
>
<
div
class=
"page"
>
<
div
class=
"banner"
>
<
view
class=
"page"
>
<
view
class=
"banner"
>
<img
src=
"/static/assistingAgriculture/shop/banner.png"
alt=
""
/>
</
div
>
<
div
class=
"commodity-wrap"
>
<
div
class=
"top-bar"
>
<
div
class=
"header"
>
分类
</div
>
<
div
class=
"search"
>
</
view
>
<
view
class=
"commodity-wrap"
>
<
view
class=
"top-bar"
>
<
view
class=
"header"
>
分类
</view
>
<
view
class=
"search"
>
<wd-search
hide-cancel
placeholder=
"请输入要搜索的内容"
/>
</
div
>
</
div
>
<
div
class=
"content"
>
<
div
class=
"nav"
>
</
view
>
</
view
>
<
view
class=
"content"
>
<
view
class=
"nav"
>
<p
v-for=
"(v, i) in
navList
"
v-for=
"(v, i) in
listOfDishCategories
"
:key=
"i"
@
click=
"
acitveNav = v.id
"
:class=
"
{ active: acitveNav == v.
i
d }"
@
click=
"
changeCate(v)
"
:class=
"
{ active: acitveNav == v.
categoryI
d }"
>
{{
v
.
n
ame
}}
{{
v
.
categoryN
ame
}}
</p>
</
div
>
<
div
class=
"list"
>
<
div
class=
"list-top"
>
<
div
class=
"subclass"
>
<
div
v-for=
"v in 10"
:key=
"v"
>
鸡
</div
>
</
div
>
<
div
class=
"filter"
@
click=
"activeFilter = true"
v-if=
"!activeFilter"
>
</
view
>
<
view
class=
"list"
>
<
view
class=
"list-top"
>
<
!--
<view
class=
"subclass"
>
<
view
v-for=
"v in 10"
:key=
"v"
>
鸡
</view
>
</
view
>
<
view
class=
"filter"
@
click=
"activeFilter = true"
v-if=
"!activeFilter"
>
筛选
<img
src=
"/static/assistingAgriculture/shop/filter.png"
alt=
""
/>
</
div
>
<
div
class=
"sort"
v-else
>
</
view
>
<
view
class=
"sort"
v-else
>
<Sort>
销量
</Sort>
<Sort>
交割
</Sort>
</div>
</div>
<div
class=
"commodity-list"
>
<CommodityItem
v-for=
"v in 50"
:key=
"v"
/>
</div>
</div>
</div>
</div>
</view>
-->
</view>
<view
class=
"commodity-list"
>
<scroll-view
:scroll-top=
"scrollTop"
scroll-y=
"true"
class=
"scroll-Y"
lower-threshold=
"50"
@
scrolltolower=
"scrolltolowerFn"
@
scrolltoupper=
"upper"
@
scroll=
"scroll"
>
<view
class=
"item"
v-for=
"(item, i) in prodList"
:key=
"i"
>
<view
class=
"image-wrap"
:class=
"
{ border: isPreSale }">
<img
:src=
"imgUrl + item.pic"
alt=
""
/>
<view
class=
"count-down-wrop"
>
距离结束:
<wd-count-down
custom-class=
"date"
:format=
"format"
:millisecond=
"true"
:time=
"item.prodPresale.presaleEndTimeStamp * 1000 - new Date().getTime()"
/>
</view>
<view
class=
"type"
>
预售
</view>
<img
src=
"/src/static/assistingAgriculture/shop/commodityBorder.png"
alt=
""
/>
</view>
<view
class=
"commodity-info"
>
<view
class=
"name"
>
{{
item
.
prodName
}}
</view>
<view
class=
"wrap"
>
<view
class=
"describe"
>
{{
item
.
brief
}}
</view>
<view
class=
"date"
>
预计
{{
item
.
sendGoodTime
}}
发货
</view>
</view>
<view
class=
"price"
>
<span
style=
"font-size: 22rpx"
>
¥
</span>
{{
item
.
price
}}
<span
class=
"unit"
>
/只
</span>
</view>
</view>
<view
class=
"add-shopping-cart"
>
<img
src=
"/src/static/assistingAgriculture/shop/add.png"
alt=
""
/>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
<!-- 购物车悬浮按钮 -->
<div
class=
"cart-floating"
>
<view
class=
"cart-floating"
>
<wd-badge
modelValue=
"12"
>
<img
class=
"cart"
@
tap=
"toCart"
src=
"/static/assistingAgriculture/presale/cart.png"
/>
</div>
<!--
<div
class=
"shopping-cart"
>
-->
<!--
<div>
-->
</wd-badge>
</view>
<!--
<view
class=
"shopping-cart"
>
-->
<!--
<view>
-->
<!--
<img
src=
"/src/static/assistingAgriculture/shop/shoppingCart.png"
alt=
""
/>
-->
<!-- 购物车-->
<!--
</
div
>
-->
<!--
</
view
>
-->
<!--
<img
src=
"/src/static/assistingAgriculture/shop/doubleArrow.png"
alt=
""
/>
-->
<!--
</
div
>
-->
</
div
>
<!--
</
view
>
-->
</
view
>
</
template
>
<
script
setup
>
import
{
ref
}
from
'vue'
;
import
CommodityItem
from
'./commodityItem.vue'
;
import
Sort
from
'./sort.vue'
;
const
navList
=
ref
([
{
id
:
1
,
name
:
'鲜货家禽'
,
},
{
id
:
2
,
name
:
'鲜货家禽'
,
},
{
id
:
3
,
name
:
'鲜货家禽'
,
},
{
id
:
4
,
name
:
'鲜货家禽'
,
},
{
id
:
5
,
name
:
'鲜货家禽'
,
},
]);
import
{
shopCategoryByShop
,
searchProdPage
}
from
'@/api/assistingAgriculture/shop'
;
const
format
=
ref
(
'DD-HH:mm:ss'
);
const
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
;
const
currentShopId
=
ref
(
''
);
const
scrollTop
=
ref
(
0
);
const
prodList
=
ref
([]);
const
listOfDishCategories
=
ref
([]);
const
params
=
ref
({
isEnd
:
false
,
current
:
1
,
size
:
15
,
prodName
:
''
,
shopCategoryId
:
''
,
deliveryType
:
'3'
,
prodType
:
'7'
,
});
onLoad
((
options
)
=>
{
currentShopId
.
value
=
options
.
shopId
;
shopCategoryByShopFn
(
options
.
shopId
).
then
((
res
)
=>
{
searchProdPageFn
();
});
});
const
shopCategoryByShopFn
=
(
shopId
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
shopCategoryByShop
({
shopId
}).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
listOfDishCategories
.
value
=
res
.
data
;
params
.
value
.
shopCategoryId
=
res
.
data
[
0
].
categoryId
;
resolve
();
}
});
});
};
const
acitveNav
=
ref
(
1
);
const
changeCate
=
(
item
)
=>
{
acitveNav
.
value
=
item
.
categoryId
;
};
const
activeFilter
=
ref
(
false
);
function
toCart
()
{
// TODO: 跳转到购物车
...
...
@@ -90,6 +144,30 @@ function toCart() {
url
:
'/pages/assistingAgriculture/cart/cart'
,
});
}
const
scrolltolowerFn
=
()
=>
{
console
.
log
(
'触底了'
);
searchProdPageFn
();
};
const
searchProdPageFn
=
()
=>
{
if
(
params
.
value
.
isEnd
===
true
)
return
new
Promise
((
resolve
)
=>
{
resolve
();
});
xma
.
showLoading
({
title
:
'加载中...'
,
mask
:
true
,
});
return
searchProdPage
(
params
.
value
).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
data
.
data
.
length
<
params
.
value
.
size
)
{
params
.
value
.
isEnd
=
true
;
}
params
.
value
.
current
+=
1
;
prodList
.
value
=
prodList
.
value
.
concat
(
res
.
data
.
data
);
xma
.
hideLoading
();
}
});
};
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -146,6 +224,8 @@ uni-page-body {
.content
{
display
:
flex
;
flex
:
1
;
max-height
:
528
*
2rpx
;
overflow-y
:
scroll
;
.nav
{
width
:
180rpx
;
border-right
:
2rpx
solid
#f6f6f6
;
...
...
@@ -205,10 +285,103 @@ uni-page-body {
.commodity-list
{
padding
:
0
20rpx
;
overflow-y
:
scroll
;
height
:
200rpx
;
flex-grow
:
1
;
.scroll-Y
{
height
:
100%
;
.item
{
margin-bottom
:
20rpx
;
display
:
flex
;
position
:
relative
;
margin-top
:
50rpx
;
.image-wrap
{
width
:
160rpx
;
height
:
160rpx
;
margin-right
:
20rpx
;
position
:
relative
;
&
.border
{
border
:
2rpx
solid
#fcdbdb
;
box-sizing
:
border-box
;
border-radius
:
12rpx
;
}
.count-down-wrop
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
position
:
absolute
;
top
:
0
;
left
:
0
;
font-size
:
16rpx
;
color
:
#fa5151
;
z-index
:
1
;
height
:
24rpx
;
width
:
100%
;
text-wrap
:
nowrap
;
.date
{
font-size
:
16rpx
;
text-wrap
:
nowrap
;
color
:
#fa5151
;
}
}
.type
{
position
:
absolute
;
bottom
:
4rpx
;
right
:
10rpx
;
font-size
:
18rpx
;
color
:
#fff
;
z-index
:
1
;
}
img
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
}
}
.commodity-info
{
display
:
flex
;
flex-direction
:
column
;
color
:
#3d3d3d
;
padding-bottom
:
20rpx
;
box-sizing
:
border-box
;
.name
{
font-size
:
24rpx
;
}
.wrap
{
flex
:
1
;
}
.describe
{
color
:
#abaaaa
;
font-size
:
22rpx
;
}
.date
{
color
:
#fa5151
;
font-size
:
22rpx
;
}
.price
{
color
:
#fa5151
;
font-size
:
36rpx
;
span
{
font-size
:
22rpx
;
}
.unit
{
color
:
#3d3d3d
;
}
}
}
.add-shopping-cart
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
position
:
absolute
;
bottom
:
16rpx
;
right
:
0
;
img
{
width
:
52rpx
;
height
:
52rpx
;
}
}
}
}
}
}
...
...
@@ -231,7 +404,7 @@ uni-page-body {
height
:
20rpx
;
margin-right
:
70rpx
;
}
div
{
view
{
margin-right
:
10rpx
;
display
:
flex
;
flex-direction
:
column
;
...
...
@@ -248,7 +421,10 @@ uni-page-body {
}
.cart-floating
{
position
:
fixed
;
display
:
flex
;
text-align
:
center
;
justify-content
:
center
;
align-items
:
center
;
bottom
:
10%
;
width
:
80rpx
;
height
:
80rpx
;
...
...
@@ -258,10 +434,7 @@ uni-page-body {
margin-left
:
10px
;
}
.cart
{
position
:
relative
;
top
:
20rpx
;
left
:
16rpx
;
width
:
48rpx
;
height
:
46rpx
;
width
:
40rpx
;
height
:
40rpx
;
}
</
style
>
src/pages/shop/text.vue
deleted
100644 → 0
View file @
237b9070
<
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/pages/storeEntry/index.vue
View file @
66413769
...
...
@@ -9,7 +9,7 @@
class=
"pubList"
v-for=
"item in list"
:key=
"item.shopId"
@
click=
"item.shopStatus != [1, 2, 3] ? shopGto(item
.shopId
) : ''"
@
click=
"item.shopStatus != [1, 2, 3] ? shopGto(item) : ''"
>
<!-- 列表头部 -->
<view
class=
"titlecon"
>
...
...
@@ -42,6 +42,7 @@
</view>
</view>
<view
class=
"shbox"
v-if=
"list.length > 0"
>
审核被拒可点击修改重新提交
</view>
<wd-status-tip
image=
"content"
tip=
"暂无内容"
v-else
/>
</view>
<view
class=
"butCon"
><button
class=
"butXz"
@
click=
"shopGto()"
>
申请入驻
</button></view>
</view>
...
...
@@ -70,8 +71,12 @@ const getList = async () => {
}
};
const
shopGto
=
(
item
)
=>
{
xma
.
redirectTo
({
url
:
`/pages/storeEntry/detail
${
item
?
`?id=
${
item
}
`
:
''
}
`
,
xma
.
navigateTo
({
url
:
`/pages/storeEntry/detail
${
item
?
`?content=0`
:
''
}
`
,
success
:
function
(
res
)
{
// 通过eventChannel向被打开页面传送数据
res
.
eventChannel
.
emit
(
'acceptDataFromOpenerPage'
,
{
data
:
item
});
},
});
};
getList
();
...
...
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