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
efdd8151
Commit
efdd8151
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
7b420ede
9e429445
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
96 additions
and
59 deletions
+96
-59
DepartureDate.vue
src/Components/assistingAgriculture/index/DepartureDate.vue
+1
-9
address.js
src/api/address.js
+1
-1
shop.js
src/api/assistingAgriculture/shop.js
+8
-0
addressEdit.vue
src/pages/address/addressEdit.vue
+19
-8
addressList.vue
src/pages/address/addressList.vue
+42
-33
RouteDetails.vue
src/pages/assistingAgriculture/RouteDetails/RouteDetails.vue
+9
-4
RuralTravel.vue
src/pages/assistingAgriculture/RuralTravel/RuralTravel.vue
+7
-3
cart.vue
src/pages/assistingAgriculture/cart/cart.vue
+9
-1
No files found.
src/Components/assistingAgriculture/index/DepartureDate.vue
View file @
efdd8151
...
...
@@ -8,7 +8,7 @@
:class=
"
{ active: selectedItem === index }"
@tap="selectItem(index, item)"
>
{{
item
}}
{{
item
.
startDate
}}
</li>
<wd-calendar
use-default-slot
v-model=
"value"
@
confirm=
"handleConfirm4"
>
<li>
选择日期
</li>
...
...
@@ -39,21 +39,13 @@ onMounted(async () => {
getStartDateList
();
});
const
selectItem
=
(
index
,
item
)
=>
{
console
.
log
(
'item'
,
item
);
selectedItem
.
value
=
index
;
emit
(
'dataParams'
,
item
);
};
// 查询出发日期
const
getStartDateList
=
()
=>
{
getStartDate
(
params
).
then
((
res
)
=>
{
console
.
log
(
'res.data'
,
res
.
data
);
const
transformedData
=
Object
.
keys
(
res
.
data
).
reduce
((
acc
,
key
)
=>
{
acc
[
key
]
=
{
[
key
]:
res
.
data
[
key
]
};
return
acc
;
},
{});
dataList
.
value
=
res
.
data
;
console
.
log
(
Object
.
keys
(
dataList
.
value
,
232
));
});
};
function
handleConfirm4
({
value
})
{
...
...
src/api/address.js
View file @
efdd8151
...
...
@@ -20,7 +20,7 @@ export async function updateAddress(data) {
export
async
function
deleteAddress
(
addrId
)
{
return
request
({
url
:
`/sgyrdd/useraddr/delete/
${
addrId
}
`
,
method
:
'
GE
T'
,
method
:
'
POS
T'
,
});
}
// 查询收货地址列表
...
...
src/api/assistingAgriculture/shop.js
View file @
efdd8151
...
...
@@ -64,3 +64,11 @@ export function sgyOrderOrderInfo(data) {
data
,
});
}
// 筑农首页-3、订单详情
export
function
quantity
(
data
)
{
return
request
({
url
:
`/sgyrdd/sgyBasket/quantity`
,
method
:
'POST'
,
data
,
});
}
src/pages/address/addressEdit.vue
View file @
efdd8151
...
...
@@ -79,9 +79,11 @@ const forMData = ref({
lat
:
''
,
commonAddr
:
false
,
});
const
content
=
ref
([]);
onLoad
((
options
)
=>
{
newAddressFlag
.
value
=
options
.
new
;
content
.
value
=
JSON
.
parse
(
options
.
content
);
forMData
.
value
=
content
.
value
;
});
function
fieldNotEmpty
(
val
)
{
...
...
@@ -93,12 +95,22 @@ function fieldNotEmpty(val) {
}
const
hdSubmit
=
async
()
=>
{
await
addAddress
({
...
forMData
.
value
,
commonAddr
:
forMData
.
value
.
commonAddr
?
1
:
0
,
province
:
forMData
.
value
.
province
,
city
:
forMData
.
value
.
city
,
area
:
forMData
.
value
.
area
,
if
(
!
content
.
value
.
addrId
)
{
await
addAddress
({
...
forMData
.
value
,
commonAddr
:
forMData
.
value
.
commonAddr
?
1
:
0
,
province
:
forMData
.
value
.
province
,
city
:
forMData
.
value
.
city
,
area
:
forMData
.
value
.
area
,
});
}
else
{
await
updateAddress
({
...
forMData
.
value
,
commonAddr
:
forMData
.
value
.
commonAddr
?
1
:
0
,
});
}
uni
.
navigateTo
({
url
:
'/pages/address/addressList'
,
});
};
function
handleSubmit
()
{
...
...
@@ -126,7 +138,6 @@ async function changeLocation() {
forMData
.
value
.
addr
=
res
.
address
;
forMData
.
value
.
lng
=
res
.
longitude
;
forMData
.
value
.
lat
=
res
.
latitude
;
console
.
log
(
'位置信息:'
+
JSON
.
stringify
(
res
));
uni
.
request
({
url
:
'/ws/geocoder/v1/'
,
data
:
{
...
...
src/pages/address/addressList.vue
View file @
efdd8151
...
...
@@ -9,29 +9,31 @@
</view>
<view
class=
"full_list"
v-else
>
<view
class=
"additem"
v-for=
"(item, index) in addressList"
:key=
"index"
>
<view
class=
"additem_l"
>
<view
class=
"address"
>
{{
item
.
addr
}}
</view>
<view
class=
"info"
>
<view
class=
"name"
>
{{
item
.
receiver
}}
</view>
<view
class=
"phone"
>
{{
item
.
mobile
}}
</view>
</view>
<view
class=
"address_status"
>
<view
v-if=
"item.commonAddr === 1"
class=
"box active"
>
<wd-icon
name=
"check-circle-filled"
size=
"12px"
></wd-icon>
<view
class=
"txt"
>
默认
</view>
<wd-swipe-action>
<view
class=
"additem"
v-for=
"(item, index) in addressList"
:key=
"index"
>
<view
class=
"additem_l"
>
<view
class=
"address"
>
{{
item
.
addr
}}
</view>
<view
class=
"info"
>
<view
class=
"name"
>
{{
item
.
receiver
}}
</view>
<view
class=
"phone"
>
{{
item
.
mobile
}}
</view>
</view>
<view
v-else
class=
"box"
>
<wd-icon
name=
"circle1"
size=
"12px"
></wd-icon>
<view
class=
"txt"
>
默认
</view>
<view
class=
"address_status"
>
<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"
@
click=
"deleteAdd(item.addrId)"
>
<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(item)"
></wd-icon>
</view>
</view>
<view
class=
"additem_r"
>
<wd-icon
name=
"edit-outline"
size=
"14px"
@
tap=
"editAddress"
></wd-icon>
</view>
</view>
</wd-swipe-action>
<wd-button
type=
"error"
block
class=
"addBtn"
@
tap=
"addNewAddress"
>
新增地址
</wd-button>
</view>
...
...
@@ -45,7 +47,6 @@ import Header from '@/pages/order/components/Header/index.vue';
import
{
getAddressList
,
deleteAddress
}
from
'@/api/address'
;
const
isAdressEmpty
=
ref
(
false
);
const
mainAddFlag
=
ref
(
false
);
const
addressList
=
ref
([]);
const
getAddressListData
=
async
()
=>
{
...
...
@@ -56,26 +57,32 @@ const getAddressListData = async () => {
res
.
length
===
0
?
(
isAdressEmpty
.
value
=
true
)
:
(
isAdressEmpty
.
value
=
false
);
}
};
onLoad
(()
=>
{});
getAddressListData
();
const
addNewAddress
=
()
=>
{
xma
.
navigateTo
({
url
:
'/pages/address/addressEdit?new=true'
});
};
const
editAddress
=
()
=>
{
xma
.
navigateTo
({
url
:
'/pages/address/addressEdit'
});
const
editAddress
=
(
col
)
=>
{
xma
.
navigateTo
({
url
:
`/pages/address/addressEdit?content=
${
JSON
.
stringify
(
col
)}
`
,
});
};
onLoad
(()
=>
{
xma
.
getLocation
({
success
:
(
res
)
=>
{
console
.
log
(
res
);
},
fail
:
(
err
)
=>
{
console
.
log
(
err
);
const
deleteAdd
=
async
(
id
)
=>
{
console
.
log
(
id
);
xma
.
showModal
({
title
:
'提示'
,
content
:
'确定删除该地址吗?'
,
showCancel
:
true
,
confirmText
:
'确定'
,
cancelText
:
'取消'
,
success
:
async
(
res
)
=>
{
if
(
res
.
confirm
)
{
await
deleteAddress
(
id
);
getAddressListData
();
}
},
});
}
)
;
};
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -92,6 +99,7 @@ page {
.full_list
{
margin-top
:
20rpx
;
padding-bottom
:
180rpx
;
.additem
{
width
:
710rpx
;
...
...
@@ -146,6 +154,7 @@ page {
display
:
flex
;
font-size
:
18rpx
;
align-items
:
center
;
// justify-content: space-between;
.txt
{
margin-left
:
5rpx
;
...
...
src/pages/assistingAgriculture/RouteDetails/RouteDetails.vue
View file @
efdd8151
...
...
@@ -20,10 +20,10 @@
<p
class=
"t2"
>
月销
{{
prodData
.
monthSoldNum
}}
份
</p>
</div>
<div
class=
"name"
>
{{
prodData
.
prodName
}}
</div>
<div
class=
"tags flex-align-center"
>
<
!--
<
div
class=
"tags flex-align-center"
>
<p>
无购物
</p>
<p>
无自费
</p>
</div>
</div>
-->
</div>
<!-- 保障 -->
<!--
<div
class=
"guarantee"
>
...
...
@@ -357,7 +357,11 @@ const getPriceListFn = (mealId) => {
};
// 行程
const
itineraryData
=
ref
([]);
/* shopId:1821388624367861761
prodId:43835 */
onLoad
(({
shopId
,
prodId
})
=>
{
// const shopId = 1821388624367861761n;
// const prodId = 43835;
getProd
({
prodId
,
}).
then
((
res
)
=>
{
...
...
@@ -605,16 +609,17 @@ uni-page-body {
margin-top
:
20rpx
;
display
:
grid
;
gap
:
40rpx
;
grid-template-columns
:
1fr
1fr
;
grid-template-columns
:
1fr
1fr
1fr
1fr
;
overflow-x
:
scroll
;
.package-item
{
border-radius
:
16rpx
;
width
:
280rpx
;
opacity
:
1
;
padding
:
20rpx
;
background
:
linear-gradient
(
180deg
,
#feeeee
0%
,
#ffffff
100%
);
box-shadow
:
0rpx
4rpx
8rpx
0rpx
rgba
(
0
,
0
,
0
,
0
.08
);
&
.active
{
border
:
1px
solid
#fa5151
;
box-sizing
:
border-box
;
}
.price
{
font-size
:
24rpx
;
...
...
src/pages/assistingAgriculture/RuralTravel/RuralTravel.vue
View file @
efdd8151
...
...
@@ -213,6 +213,9 @@ const locationFiltering = (index) => {
sortType
.
value
=
null
;
attractionId
.
value
=
null
;
dateType
.
value
=
null
;
startCity
.
value
=
null
;
serviceCommitment
.
value
=
null
;
labelId
.
value
=
null
;
}
};
// 查询热门路线
...
...
@@ -231,7 +234,8 @@ const sortParams = (sortMode) => {
};
// 出发日期
const
dataParams
=
(
item
)
=>
{
dateType
.
value
=
item
;
console
.
log
(
item
,
item
.
key
,
22322323
);
dateType
.
value
=
item
.
key
;
getProd
();
};
// 景点
...
...
@@ -258,7 +262,7 @@ const getProd = () => {
size
:
10
,
...(
sortType
.
value
!==
null
&&
{
sortType
:
sortType
.
value
.
sortMode
}),
...(
attractionId
.
value
!==
null
&&
{
attractionId
:
attractionId
.
value
.
id
}),
...(
dateType
.
value
!==
null
&&
{
dateType
:
dateType
.
value
}),
...(
dateType
.
value
!==
null
&&
{
dateType
:
dateType
.
value
.
key
}),
...(
startCity
.
value
!==
null
&&
{
startCity
:
startCity
.
value
}),
...(
serviceCommitment
.
value
!==
null
&&
{
serviceCommitment
:
serviceCommitment
.
value
}),
...(
labelId
.
value
!==
null
&&
{
labelId
:
labelId
.
value
}),
...
...
@@ -274,7 +278,7 @@ function toRouteDetails(item) {
console
.
log
(
item
,
22222
);
// TODO: 跳转到线路详情
xma
.
navigateTo
({
url
:
`/pages/assistingAgriculture/RouteDetails/RouteDetails?prodId=
${
item
.
prodId
}
`
,
url
:
`/pages/assistingAgriculture/RouteDetails/RouteDetails?
shopId=
${
item
.
shopId
}
,
prodId=
${
item
.
prodId
}
`
,
});
}
function
toSpecialOfferZoneList
()
{
...
...
src/pages/assistingAgriculture/cart/cart.vue
View file @
efdd8151
...
...
@@ -31,7 +31,7 @@
<span>
¥
</span>
{{
item
.
skuPrice
}}
</div>
<wd-input-number
v-model=
"item.count"
/>
<wd-input-number
v-model=
"item.count"
@
change=
"changeQuantity(item)"
/>
</div>
</div>
</div>
...
...
@@ -60,6 +60,7 @@
import
{
ref
,
computed
,
onMounted
}
from
'vue'
;
import
{
getshoppingCartList
}
from
'../../../api/packageDetail'
;
import
{
categoryPresaleList
}
from
'../../../api/assistingAgriculture/building'
;
import
{
quantity
}
from
'../../../api/assistingAgriculture/shop'
;
// 计算是否全选
const
checkedAll
=
computed
(()
=>
{
return
cartList
.
value
.
every
((
item
)
=>
item
.
isChecked
);
...
...
@@ -114,6 +115,13 @@ const presaleSortList = (index) => {
});
});
};
// 购物车数量修改
const
changeQuantity
=
async
(
item
)
=>
{
const
res
=
await
quantity
({
basketId
:
item
.
basket
.
basketId
,
basketCount
:
item
.
count
,
});
};
const
selectedItems
=
computed
(()
=>
{
return
cartList
.
value
.
reduce
((
acc
,
shop
)
=>
{
const
selectedProducts
=
shop
.
prodInfos
.
filter
((
item
)
=>
item
.
isChecked
);
...
...
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