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
c4582e93
Commit
c4582e93
authored
Aug 19, 2024
by
石建新(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地址
parent
c362463f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
10 deletions
+50
-10
addressList.vue
src/pages/address/addressList.vue
+23
-3
ConfirmOrder.vue
src/pages/assistingAgriculture/cart/ConfirmOrder.vue
+27
-7
No files found.
src/pages/address/addressList.vue
View file @
c4582e93
...
@@ -9,7 +9,13 @@
...
@@ -9,7 +9,13 @@
<view
class=
"full_list"
v-else
>
<view
class=
"full_list"
v-else
>
<wd-swipe-action>
<wd-swipe-action>
<view
class=
"additem"
v-for=
"(item, index) in addressList"
:key=
"index"
>
<view
@
click
.
stop=
"selectAddress(item)"
:class=
"activeAdd === item ? 'acitve-additem' : 'additem'"
class=
"additem"
v-for=
"(item, index) in addressList"
:key=
"index"
>
<view
class=
"additem_l"
>
<view
class=
"additem_l"
>
<view
class=
"address"
>
{{
item
.
addr
}}
</view>
<view
class=
"address"
>
{{
item
.
addr
}}
</view>
<view
class=
"info"
>
<view
class=
"info"
>
...
@@ -22,7 +28,7 @@
...
@@ -22,7 +28,7 @@
<view
class=
"txt"
>
默认
</view>
<view
class=
"txt"
>
默认
</view>
</view>
</view>
<view
v-else
class=
"box"
@
click=
"deleteAdd(item.addrId)"
>
<view
v-else
class=
"box"
@
click
.
stop
=
"deleteAdd(item.addrId)"
>
<wd-icon
name=
"circle1"
size=
"12px"
></wd-icon>
<wd-icon
name=
"circle1"
size=
"12px"
></wd-icon>
<view
class=
"txt"
>
删除
</view>
<view
class=
"txt"
>
删除
</view>
</view>
</view>
...
@@ -47,12 +53,16 @@ import { getAddressList, deleteAddress } from '@/api/address';
...
@@ -47,12 +53,16 @@ import { getAddressList, deleteAddress } from '@/api/address';
const
isAdressEmpty
=
ref
(
false
);
const
isAdressEmpty
=
ref
(
false
);
const
addressList
=
ref
([]);
const
addressList
=
ref
([]);
const
activeAdd
=
ref
(
null
);
const
getAddressListData
=
async
()
=>
{
const
getAddressListData
=
async
()
=>
{
const
{
data
:
res
}
=
await
getAddressList
();
const
{
data
:
res
}
=
await
getAddressList
();
console
.
log
(
res
);
console
.
log
(
res
);
if
(
res
)
{
if
(
res
)
{
addressList
.
value
=
res
;
addressList
.
value
=
res
;
activeAdd
.
value
=
res
.
filter
((
item
)
=>
{
return
item
.
commonAddr
===
1
;
})[
0
];
res
.
length
===
0
?
(
isAdressEmpty
.
value
=
true
)
:
(
isAdressEmpty
.
value
=
false
);
res
.
length
===
0
?
(
isAdressEmpty
.
value
=
true
)
:
(
isAdressEmpty
.
value
=
false
);
}
}
};
};
...
@@ -61,6 +71,13 @@ getAddressListData();
...
@@ -61,6 +71,13 @@ getAddressListData();
const
addNewAddress
=
()
=>
{
const
addNewAddress
=
()
=>
{
xma
.
navigateTo
({
url
:
'/pages/address/addressEdit?new=true'
});
xma
.
navigateTo
({
url
:
'/pages/address/addressEdit?new=true'
});
};
};
const
selectAddress
=
(
item
)
=>
{
activeAdd
.
value
=
item
;
xma
.
setStorageSync
(
'address'
,
item
);
xma
.
navigateBack
({
delta
:
1
,
});
};
const
editAddress
=
(
col
)
=>
{
const
editAddress
=
(
col
)
=>
{
xma
.
navigateTo
({
xma
.
navigateTo
({
url
:
`/pages/address/addressEdit?content=
${
JSON
.
stringify
(
col
)}
`
,
url
:
`/pages/address/addressEdit?content=
${
JSON
.
stringify
(
col
)}
`
,
...
@@ -100,6 +117,7 @@ page {
...
@@ -100,6 +117,7 @@ page {
margin-top
:
20rpx
;
margin-top
:
20rpx
;
padding-bottom
:
180rpx
;
padding-bottom
:
180rpx
;
.acitve-additem
,
.additem
{
.additem
{
width
:
710rpx
;
width
:
710rpx
;
padding
:
20rpx
;
padding
:
20rpx
;
...
@@ -166,7 +184,9 @@ page {
...
@@ -166,7 +184,9 @@ page {
}
}
}
}
}
}
.acitve-additem
{
border
:
2rpx
solid
#fa5151
;
}
.addBtn
{
.addBtn
{
width
:
630rpx
;
width
:
630rpx
;
height
:
72rpx
;
height
:
72rpx
;
...
...
src/pages/assistingAgriculture/cart/ConfirmOrder.vue
View file @
c4582e93
...
@@ -161,7 +161,6 @@ const imgUrl = import.meta.env.VITE_APP_IMG_URL;
...
@@ -161,7 +161,6 @@ const imgUrl = import.meta.env.VITE_APP_IMG_URL;
const
textInputs
=
ref
(
''
);
const
textInputs
=
ref
(
''
);
const
basketIds
=
ref
([]);
const
basketIds
=
ref
([]);
const
activeCouponId
=
ref
(
''
);
const
activeCouponId
=
ref
(
''
);
const
changeAddress
=
ref
(
false
);
const
addressParams
=
ref
({});
const
addressParams
=
ref
({});
const
showpopup
=
ref
(
false
);
const
showpopup
=
ref
(
false
);
const
outTradeNos
=
ref
(
null
);
const
outTradeNos
=
ref
(
null
);
...
@@ -177,12 +176,15 @@ onLoad((options) => {
...
@@ -177,12 +176,15 @@ onLoad((options) => {
skuIds
.
value
=
skuId
;
skuIds
.
value
=
skuId
;
types
.
value
=
type
;
types
.
value
=
type
;
if
(
type
===
'qg'
)
{
if
(
type
===
'qg'
)
{
console
.
log
(
'1111111111111111111'
);
groupBuyConfirmFn
(
prodId
,
skuId
).
then
((
res
)
=>
{
groupBuyConfirmFn
(
prodId
,
skuId
).
then
((
res
)
=>
{
useraddrDefaultUserAddrFn
().
then
(()
=>
{
useraddrDefaultUserAddrFn
().
then
(()
=>
{
groupBuyUpdateFnQg
();
groupBuyUpdateFnQg
();
});
});
});
});
}
else
{
}
else
{
console
.
log
(
'22222222222222222222222'
);
basketIds
.
value
=
ids
.
split
(
','
);
basketIds
.
value
=
ids
.
split
(
','
);
sgyrddBasketConfirmFn
(
basketIds
.
value
).
then
(()
=>
{
sgyrddBasketConfirmFn
(
basketIds
.
value
).
then
(()
=>
{
useraddrDefaultUserAddrFn
().
then
(()
=>
{
useraddrDefaultUserAddrFn
().
then
(()
=>
{
...
@@ -193,6 +195,7 @@ onLoad((options) => {
...
@@ -193,6 +195,7 @@ onLoad((options) => {
});
});
function
groupBuyUpdateFnQg
(
couponUserId
=
''
)
{
function
groupBuyUpdateFnQg
(
couponUserId
=
''
)
{
const
{
receiverName
,
receiverMobile
,
receiverAddress
}
=
addressParams
.
value
;
const
{
receiverName
,
receiverMobile
,
receiverAddress
}
=
addressParams
.
value
;
groupBuyUpdate
({
groupBuyUpdate
({
key
:
orderInfo
.
value
.
key
,
key
:
orderInfo
.
value
.
key
,
couponUserId
,
couponUserId
,
...
@@ -206,21 +209,37 @@ function groupBuyUpdateFnQg(couponUserId = '') {
...
@@ -206,21 +209,37 @@ function groupBuyUpdateFnQg(couponUserId = '') {
});
});
}
}
onShow
(()
=>
{
onShow
(()
=>
{
if
(
changeAddress
.
value
)
{
const
storgeAddress
=
xma
.
getStorageSync
(
'address'
)
||
null
;
if
(
storgeAddress
)
{
addressInfo
.
value
=
storgeAddress
;
addressParams
.
value
.
receiverName
=
storgeAddress
.
receiver
;
addressParams
.
value
.
receiverMobile
=
storgeAddress
.
mobile
;
addressParams
.
value
.
receiverAddress
=
storgeAddress
.
addr
;
if
(
types
.
value
===
'qg'
)
{
if
(
types
.
value
===
'qg'
)
{
groupBuyConfirmFn
(
prodIds
.
value
,
skuIds
.
value
).
then
((
res
)
=>
{
groupBuyConfirmFn
(
prodIds
.
value
,
skuIds
.
value
).
then
((
res
)
=>
{
useraddrDefaultUserAddrFn
().
then
(()
=>
{
groupBuyUpdateFnQg
();
groupBuyUpdateFnQg
();
});
});
});
}
else
{
}
else
{
sgyrddBasketConfirmFn
(
basketIds
.
value
).
then
(()
=>
{
sgyrddBasketConfirmFn
(
basketIds
.
value
).
then
(()
=>
{
useraddrDefaultUserAddrFn
().
then
(()
=>
{
groupBuyUpdateFn
();
groupBuyUpdateFn
();
});
});
});
}
}
}
}
// else {
// if (types.value === 'qg') {
// groupBuyConfirmFn(prodIds.value, skuIds.value).then((res) => {
// useraddrDefaultUserAddrFn().then(() => {
// groupBuyUpdateFnQg();
// });
// });
// } else {
// sgyrddBasketConfirmFn(basketIds.value).then(() => {
// useraddrDefaultUserAddrFn().then(() => {
// groupBuyUpdateFn();
// });
// });
// }
// }
if
(
outTradeNos
.
value
)
{
if
(
outTradeNos
.
value
)
{
// 查询订单状态决定是否支付
// 查询订单状态决定是否支付
...
@@ -306,7 +325,6 @@ function selectShopCoupon(item) {
...
@@ -306,7 +325,6 @@ function selectShopCoupon(item) {
}
}
}
}
const
jumpToAddressList
=
()
=>
{
const
jumpToAddressList
=
()
=>
{
changeAddress
.
value
=
true
;
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
'/pages/address/addressList'
,
url
:
'/pages/address/addressList'
,
});
});
...
@@ -380,6 +398,7 @@ const payNow = async (data) => {
...
@@ -380,6 +398,7 @@ const payNow = async (data) => {
}
else
{
}
else
{
groupBuyConfirmFn
(
prodIds
.
value
,
skuIds
.
value
);
groupBuyConfirmFn
(
prodIds
.
value
,
skuIds
.
value
);
}
}
xma
.
removeStorageSync
(
'address'
);
});
});
}
else
{
}
else
{
znsgyOrderCreate
(
params
.
value
).
then
((
res
)
=>
{
znsgyOrderCreate
(
params
.
value
).
then
((
res
)
=>
{
...
@@ -388,6 +407,7 @@ const payNow = async (data) => {
...
@@ -388,6 +407,7 @@ const payNow = async (data) => {
}
else
{
}
else
{
sgyrddBasketConfirmFn
(
basketIds
.
value
);
sgyrddBasketConfirmFn
(
basketIds
.
value
);
}
}
xma
.
removeStorageSync
(
'address'
);
});
});
}
}
};
};
...
...
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