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
83a95827
Commit
83a95827
authored
Aug 05, 2024
by
彭佳妮(贵阳日报)
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.platform.xinhuaapp.com/pengjiani/groupPurchase-miniapp
parents
0104af20
01d04082
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
14 deletions
+48
-14
index.js
src/api/index.js
+8
-0
foodClassification.vue
src/pages/index/foodClassification.vue
+25
-6
confirmOrder.vue
src/pages/shop/confirmOrder.vue
+15
-8
No files found.
src/api/index.js
View file @
83a95827
...
...
@@ -94,3 +94,11 @@ export function receiveCoupon(data) {
data
,
});
}
// 列表顶部优惠商品
export
function
prodSpecial
(
data
)
{
return
request
({
url
:
`/sgyrdd/prod/special`
,
method
:
'GET'
,
data
,
});
}
src/pages/index/foodClassification.vue
View file @
83a95827
...
...
@@ -8,10 +8,10 @@
</Search>
<!-- 类别选择 -->
<scroll-view
class=
"scroll-x"
scroll-x=
"true"
@
scroll=
"scroll"
>
<view
class=
"foodCard"
v-for=
"(item, index) in
5
"
:key=
"index"
>
<view
class=
"foodCard"
v-for=
"(item, index) in
topDiscountedProducts
"
:key=
"index"
>
<image
class=
"test5"
src=
"../../static/index/test5.png"
mode=
"widthFix"
/>
<view
class=
"content"
>
<text
class=
"title"
>
【热销】贵阳火神烧烤单人畅吃
</text>
<text
class=
"title"
>
{{
item
.
prodName
}}
</text>
<view
class=
"labelBox"
>
<view
class=
"item"
v-for=
"(item, index) in 4"
:key=
"index"
>
30天有效
</view>
</view>
...
...
@@ -20,7 +20,8 @@
<text
class=
"text"
>
¥39.9
</text>
<text
class=
"text2"
>
¥58
</text>
<view
class=
"btn"
>
<text
class=
"text3"
>
仅剩余5张
</text>
<!--
<text
class=
"text3"
>
仅剩余5张
</text>
-->
<text
class=
"text3"
></text>
<image
class=
"qiang"
src=
"../../static/index/qiang.png"
mode=
"widthFix"
/>
</view>
</view>
...
...
@@ -87,20 +88,22 @@ import Search from '../../components/index/Search.vue';
import
Classification
from
'../../components/index/Classification.vue'
;
import
Position
from
'../../components/index/Position.vue'
;
import
Sort
from
'../../components/index/Sort.vue'
;
import
{
getByParentId
,
merchantList
}
from
'../../api/index'
;
import
{
getByParentId
,
merchantList
,
prodSpecial
}
from
'../../api/index'
;
const
business
=
reactive
([
'优选商家'
,
'超值半价'
,
'今日可订'
,
'经典单人'
]);
const
active
=
ref
(
null
);
const
rotate
=
ref
(
false
);
const
rotate2
=
ref
(
false
);
const
rotate3
=
ref
(
false
);
const
parentIds
=
ref
(
null
);
const
categoryId
=
ref
(
null
);
const
topDiscountedProducts
=
ref
([]);
const
pics
=
ref
(
null
);
onLoad
((
option
)
=>
{
const
{
parentId
,
pic
}
=
option
;
parentIds
.
value
=
parentId
;
categoryId
.
value
=
parentId
;
pics
.
value
=
pic
;
query
(
parentId
);
prodSpecialFn
();
});
onMounted
(()
=>
{
getMerchantList
();
...
...
@@ -111,6 +114,22 @@ const query = (parentId) => {
console
.
log
(
'打印res'
,
res
);
});
};
const
prodSpecialFn
=
()
=>
{
prodSpecial
({
categoryId
:
categoryId
.
value
}).
then
((
res
)
=>
{
res
.
data
.
data
=
res
.
data
.
data
.
map
((
el
)
=>
{
if
(
el
.
labels
)
{
el
.
labels
=
el
.
labels
.
split
(
','
);
}
return
el
;
})
.
filter
((
it
)
=>
{
return
it
.
it
&&
it
!==
''
;
});
topDiscountedProducts
.
value
=
res
.
data
;
});
};
// onLoad(option) {
// //option为object类型,会序列化上个页面传递的参数
// console.log(option.id); //打印出上个页面传递的参数。
...
...
src/pages/shop/confirmOrder.vue
View file @
83a95827
...
...
@@ -182,14 +182,21 @@ onShow(() => {
if
(
outTradeNos
.
value
)
{
// 查询订单状态决定是否支付
getOrderDetail
({
orderNumber
:
outTradeNos
.
value
}).
then
((
res
)
=>
{
if
(
orderDetail
.
value
.
status
===
'2'
||
orderDetail
.
value
.
status
===
'3'
)
{
xma
.
redirectTo
({
url
:
`/pages/shop/paymentSuccessful?outTradeNos=
${
outTradeNos
.
value
}
`
,
});
}
else
{
xma
.
redirectTo
({
url
:
`/pages/shop/paymentSuccessful?outTradeNos=
${
outTradeNos
.
value
}
`
,
});
switch
(
orderDetail
.
value
.
status
)
{
case
'1'
:
xma
.
showToast
({
title
:
'支付失败'
,
icon
:
'success'
,
duration
:
2000
,
});
break
;
case
'2'
||
'3'
:
xma
.
redirectTo
({
url
:
`/pages/shop/paymentSuccessful?outTradeNos=
${
outTradeNos
.
value
}
`
,
});
break
;
default
:
break
;
}
});
}
...
...
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