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
c740f522
Commit
c740f522
authored
Aug 15, 2024
by
石建新(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
旅居支付
parent
bfec95e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
23 deletions
+77
-23
RouteDetails.vue
src/pages/assistingAgriculture/RouteDetails/RouteDetails.vue
+75
-21
loading.vue
src/pages/index/loading.vue
+2
-2
No files found.
src/pages/assistingAgriculture/RouteDetails/RouteDetails.vue
View file @
c740f522
...
@@ -327,7 +327,8 @@ import {
...
@@ -327,7 +327,8 @@ import {
getItinerary
,
getItinerary
,
getStoreInformation
,
getStoreInformation
,
}
from
'@/api/assistingAgriculture/route'
;
}
from
'@/api/assistingAgriculture/route'
;
import
{
groupBuyConfirm
,
groupBuyUpdate
}
from
'@/api/confirmOrder'
;
import
{
sgyOrderOrderInfo
}
from
'@/api/assistingAgriculture/shop'
;
import
{
groupBuyConfirm
,
groupBuyUpdate
,
groupBuyCreate
}
from
'@/api/confirmOrder'
;
import
{
getCollect
}
from
'@/api/packageDetail'
;
import
{
getCollect
}
from
'@/api/packageDetail'
;
const
swiperList
=
ref
([
const
swiperList
=
ref
([
...
@@ -362,6 +363,41 @@ watch(show, (value) => {
...
@@ -362,6 +363,41 @@ watch(show, (value) => {
index
=
Math
.
min
(
priceList
.
value
.
length
-
3
,
index
);
index
=
Math
.
min
(
priceList
.
value
.
length
-
3
,
index
);
viewPriceList
.
value
=
priceList
.
value
.
slice
(
index
-
1
,
index
+
3
);
viewPriceList
.
value
=
priceList
.
value
.
slice
(
index
-
1
,
index
+
3
);
});
});
onShow
(()
=>
{
if
(
outTradeNos
.
value
)
{
// 查询订单状态决定是否支付
sgyOrderOrderInfo
({
orderNumber
:
outTradeNos
.
value
}).
then
((
res
)
=>
{
switch
(
res
.
data
.
baseOrder
.
subStatus
)
{
case
'1'
:
xma
.
showToast
({
title
:
'支付失败'
,
icon
:
'error'
,
duration
:
1000
,
success
()
{
setTimeout
(()
=>
{
xma
.
redirectTo
({
url
:
`/pages/order/order?status=not_pay`
,
});
},
1500
);
},
});
break
;
case
'2'
:
xma
.
redirectTo
({
url
:
`/pages/order/detail?orderNumber=
${
outTradeNos
.
value
}
`
,
});
break
;
case
'3'
:
xma
.
redirectTo
({
url
:
`/pages/order/detail?orderNumber=
${
outTradeNos
.
value
}
`
,
});
break
;
default
:
break
;
}
});
}
});
const
getWeek
=
(
date
)
=>
{
const
getWeek
=
(
date
)
=>
{
const
week
=
[
'日'
,
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
];
const
week
=
[
'日'
,
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
];
return
week
[
new
Date
(
date
).
getDay
()];
return
week
[
new
Date
(
date
).
getDay
()];
...
@@ -382,7 +418,7 @@ function jumpPage() {
...
@@ -382,7 +418,7 @@ function jumpPage() {
}
}
function
groupBuyConfirmFn
(
prodId
,
skuId
)
{
function
groupBuyConfirmFn
(
prodId
,
skuId
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
groupBuyConfirm
({
prodId
,
skuId
}).
then
((
res
)
=>
{
groupBuyConfirm
({
prodId
,
skuId
,
orderType
:
'store'
}).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
orderInfo
.
value
=
res
.
data
;
orderInfo
.
value
=
res
.
data
;
resolve
(
res
.
data
.
shopId
);
resolve
(
res
.
data
.
shopId
);
...
@@ -417,33 +453,51 @@ function formatDate(inputDate) {
...
@@ -417,33 +453,51 @@ function formatDate(inputDate) {
}
}
const
payNow
=
async
(
data
)
=>
{
const
payNow
=
async
(
data
)
=>
{
groupBuyConfirmFn
(
activeMeal
.
value
.
prodId
,
activeMeal
.
value
.
skuId
).
then
((
res
)
=>
{
groupBuyConfirmFn
(
activeMeal
.
value
.
prodId
,
activeMeal
.
value
.
skuId
).
then
((
res
)
=>
{
groupBuyUpdateFnQg
().
then
(()
=>
{});
groupBuyUpdateFnQg
().
then
(()
=>
{
const
qgParams
=
{
id
:
orderInfo
.
value
.
key
,
placeOrderWay
:
'sgy'
,
payWayCode
:
5
,
tradeType
:
data
.
selectType
,
};
groupBuyCreate
(
qgParams
).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
openUrl
(
res
.
data
.
result
);
}
else
{
groupBuyConfirmFn
(
activeMeal
.
value
.
prodId
,
activeMeal
.
value
.
skuId
);
}
});
});
});
});
params
.
value
.
id
=
orderInfo
.
value
.
key
;
params
.
value
.
tradeType
=
data
.
selectType
;
params
.
value
.
basketIds
=
basketIds
.
value
;
const
qgParams
=
{
id
:
orderInfo
.
value
.
key
,
placeOrderWay
:
'sgy'
,
payWayCode
:
5
,
tradeType
:
data
.
selectType
,
};
// groupBuyCreate(qgParams).then((res) => {
// if (res.code === 0) {
// openUrl(res.data.result);
// } else {
// groupBuyConfirmFn(prodIds.value, skuIds.value);
// }
// });
};
};
function
groupBuyUpdateFnQg
(
couponUserId
=
''
)
{
const
outTradeNos
=
ref
(
null
);
const
openUrl
=
(
result
)
=>
{
const
{
paymentUrl
,
outTradeNo
}
=
result
;
outTradeNos
.
value
=
outTradeNo
;
window
.
location
.
href
=
paymentUrl
;
// 设置一个延时器
const
start
=
Date
.
now
();
setTimeout
(()
=>
{
const
end
=
Date
.
now
();
if
(
end
-
start
<
1200
)
{
// 如果 iframe 加载时间小于 1.2 秒,说明应用没有安装
xma
.
showToast
({
title
:
'未安装App'
,
icon
:
'error'
,
});
// 这里可以跳转到应用下载页面
}
},
1600
);
};
function
groupBuyUpdateFnQg
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
groupBuyUpdate
({
groupBuyUpdate
({
key
:
orderInfo
.
value
.
key
,
key
:
orderInfo
.
value
.
key
,
receiverTime
:
formatDate
(
activePrice
.
value
.
priceDay
),
receiverTime
:
activePrice
.
value
.
priceDay
.
replace
(
' '
,
'-'
),
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
orderInfo
.
value
=
res
.
data
;
orderInfo
.
value
=
res
.
data
;
resolve
();
}
}
});
});
});
});
...
...
src/pages/index/loading.vue
View file @
c740f522
...
@@ -10,8 +10,8 @@ import { getTokenUser } from '../../api/index';
...
@@ -10,8 +10,8 @@ import { getTokenUser } from '../../api/index';
import
{
getToken
}
from
'../../utils/auth'
;
import
{
getToken
}
from
'../../utils/auth'
;
onLoad
(
async
(
options
)
=>
{
onLoad
(
async
(
options
)
=>
{
await
signIn
();
//
await signIn();
//
if (!getToken()) await signIn2();
if
(
!
getToken
())
await
signIn2
();
const
{
type
}
=
options
;
const
{
type
}
=
options
;
switch
(
type
)
{
switch
(
type
)
{
case
'0'
:
case
'0'
:
...
...
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