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
cf72bbd2
Commit
cf72bbd2
authored
Aug 09, 2024
by
张娇(东信)
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
f517dba2
2d193102
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
4 deletions
+78
-4
shop.js
src/api/assistingAgriculture/shop.js
+16
-0
ConfirmOrder.vue
src/pages/assistingAgriculture/cart/ConfirmOrder.vue
+61
-4
shop.vue
src/pages/shop/shop.vue
+1
-0
No files found.
src/api/assistingAgriculture/shop.js
View file @
cf72bbd2
...
@@ -24,3 +24,19 @@ export function sgyBasketlist(data) {
...
@@ -24,3 +24,19 @@ export function sgyBasketlist(data) {
data
,
data
,
});
});
}
}
// 筑农首页-通过购物车创建临时订单
export
function
sgyrddBasketConfirm
(
data
)
{
return
request
({
url
:
`/sgyrdd/previewOrder/basket/confirm`
,
method
:
'POST'
,
data
,
});
}
// 筑农首页-提交订单并返回支付信息
export
function
znsgyOrderCreate
(
data
)
{
return
request
({
url
:
`/sgyrdd/sgyOrder/create`
,
method
:
'POST'
,
data
,
});
}
src/pages/assistingAgriculture/cart/ConfirmOrder.vue
View file @
cf72bbd2
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<view
class=
"customer-phone"
>
187****5632
</view>
<view
class=
"customer-phone"
>
187****5632
</view>
</view>
</view>
</view>
</view>
<view
class=
"estimated-time-view"
>
<
!--
<
view
class=
"estimated-time-view"
>
<text
class=
"send-time"
>
立即送出
</text>
<text
class=
"send-time"
>
立即送出
</text>
<view
class=
"estimated-time"
>
大约13:45送达
</view>
<view
class=
"estimated-time"
>
大约13:45送达
</view>
<view
class=
"estimated-icon"
></view>
<view
class=
"estimated-icon"
></view>
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
src=
"/src/static/assistingAgriculture/assets/right-arrow.png"
src=
"/src/static/assistingAgriculture/assets/right-arrow.png"
alt=
""
alt=
""
/>
/>
</view>
</view>
-->
</view>
</view>
<view
class=
"commordity-information-view"
>
<view
class=
"commordity-information-view"
>
<view
class=
"trade-name"
>
杨家黄焖鸡
</view>
<view
class=
"trade-name"
>
杨家黄焖鸡
</view>
...
@@ -89,6 +89,7 @@
...
@@ -89,6 +89,7 @@
placeholder=
"请输入你的问题"
placeholder=
"请输入你的问题"
maxlength=
"200"
maxlength=
"200"
v-model=
"textInputs"
v-model=
"textInputs"
@
input=
"inputRemake"
></textarea>
></textarea>
<view
class=
"current-word"
>
{{
inputLength
}}
/
{{
wordMax
}}
</view>
<view
class=
"current-word"
>
{{
inputLength
}}
/
{{
wordMax
}}
</view>
</view>
</view>
...
@@ -106,17 +107,73 @@
...
@@ -106,17 +107,73 @@
</view>
</view>
<view
class=
"total-discounts"
>
总共优惠
 
¥0.00
</view>
<view
class=
"total-discounts"
>
总共优惠
 
¥0.00
</view>
</view>
</view>
<button
class=
"submit-button"
>
提交订单
</button>
<button
class=
"submit-button"
@
click=
"openZfType"
>
提交订单
</button>
<Payment
ref=
"PaymentRef"
@
payment=
"payNow"
></Payment>
</view>
</view>
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
ref
,
computed
}
from
'vue'
;
import
{
ref
,
computed
}
from
'vue'
;
import
Payment
from
'@/pages/order/components/Payment/index.vue'
;
import
{
sgyrddBasketConfirm
,
znsgyOrderCreate
}
from
'@/api/assistingAgriculture/shop'
;
const
wordMax
=
ref
(
200
);
const
wordMax
=
ref
(
200
);
const
textInputs
=
ref
(
''
);
const
textInputs
=
ref
(
''
);
const
basketIds
=
ref
([]);
const
inputLength
=
computed
(()
=>
{
const
inputLength
=
computed
(()
=>
{
return
textInputs
.
value
.
length
;
return
textInputs
.
value
.
length
;
});
});
onLoad
((
options
)
=>
{
const
{
ids
}
=
options
;
basketIds
.
value
=
ids
.
split
(
','
);
sgyrddBasketConfirmFn
(
basketIds
.
value
);
});
const
sgyrddBasketConfirmFn
=
(
basketIds
)
=>
{
sgyrddBasketConfirm
({
basketIds
,
orderType
:
'logistics'
}).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
console
.
log
(
'11'
);
}
});
};
const
inputRemake
=
(
e
)
=>
{
const
{
value
}
=
e
.
detail
;
params
.
value
.
remark
=
value
;
};
const
params
=
ref
({
id
:
''
,
tradeType
:
''
,
placeOrderWay
:
'sgy'
,
basketIds
:
[],
remark
:
''
,
});
const
PaymentRef
=
ref
(
null
);
const
openZfType
=
()
=>
{
PaymentRef
.
value
.
open
();
};
const
payNow
=
async
(
data
)
=>
{
params
.
value
.
id
=
data
.
orderNumber
;
params
.
value
.
tradeType
=
data
.
selectType
;
params
.
value
.
basketIds
=
[];
const
res
=
await
znsgyOrderCreate
(
params
);
const
{
paymentUrl
,
outTradeNo
}
=
res
.
data
.
result
;
// 修改列表待付款订单号
dataList
.
value
[
changeIndex
.
value
].
orderNumber
=
outTradeNo
;
pendingPaymentOrder
.
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'
,
});
// 这里可以跳转到应用下载页面
}
},
1000
);
};
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
@@ -131,7 +188,7 @@ page {
...
@@ -131,7 +188,7 @@ page {
}
}
.information-view
{
.information-view
{
width
:
710rpx
;
width
:
710rpx
;
height
:
365rpx
;
//
height: 365rpx;
border-radius
:
16rpx
;
border-radius
:
16rpx
;
// display: flex;
// display: flex;
overflow
:
hidden
;
overflow
:
hidden
;
...
...
src/pages/shop/shop.vue
View file @
cf72bbd2
...
@@ -844,6 +844,7 @@ page {
...
@@ -844,6 +844,7 @@ page {
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
.shop-title
{
.shop-title
{
max-width
:
500rpx
;
font-size
:
18
*
2rpx
;
font-size
:
18
*
2rpx
;
font-weight
:
bold
;
font-weight
:
bold
;
color
:
#3d3d3d
;
color
:
#3d3d3d
;
...
...
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