Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yongxinda-h5
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
yongxinda-h5
Commits
0e4f141e
提交
0e4f141e
authored
11月 07, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
d7130a00
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
90 行增加
和
23 行删除
+90
-23
index.vue
src/pages/cart/index.vue
+7
-3
index.vue
src/pages/index/index.vue
+15
-6
checkout.vue
src/pages/order/checkout.vue
+19
-10
quotation.vue
src/pages/order/quotation.vue
+48
-3
config.ts
src/utils/config.ts
+1
-1
没有找到文件。
src/pages/cart/index.vue
浏览文件 @
0e4f141e
...
...
@@ -102,7 +102,7 @@
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
}
from
'vue'
;
import
{
getCartIndex
,
cartChecked
,
cartDelete
,
cartUpdate
}
from
'@/api/cart'
;
import
{
onShow
}
from
'@dcloudio/uni-app'
;
import
{
onShow
,
onLoad
}
from
'@dcloudio/uni-app'
;
import
_
from
'lodash'
;
import
config
from
'@/utils/config'
;
...
...
@@ -206,7 +206,8 @@ const tapOptions = () => {
data
:
el
,
success
(
res
:
any
)
{
if
(
prop
==
'cartId'
&&
el
==
0
)
{
uni
.
navigateTo
({
url
:
`../order/checkout?type=`
+
'cart'
});
if
(
type
.
value
===
0
)
uni
.
navigateTo
({
url
:
`../order/checkout?type=`
+
'cart'
});
else
uni
.
navigateTo
({
url
:
`../order/checkout?type=`
+
'productLineCart'
});
}
},
});
...
...
@@ -327,7 +328,10 @@ const getCheckedList = (goods: any) => {
return
result
;
};
onShow
(()
=>
initCartIndex
(
type
.
value
));
onShow
(()
=>
{
initCartIndex
(
type
.
value
);
type
.
value
=
0
;
});
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/pages/index/index.vue
浏览文件 @
0e4f141e
...
...
@@ -11,7 +11,7 @@
</view>
<!-- 轮播图 -->
<view
class=
"wrap"
>
<u-swiper
:list=
"indexData?.banner"
name=
"url"
height=
"400"
></u-swiper>
<u-swiper
:list=
"indexData?.banner"
name=
"url"
height=
"400"
img-mode=
"aspectFit"
></u-swiper>
</view>
<!-- 宫格布局 -->
<u-grid
:col=
"6"
class=
"grid"
@
tap=
"clickGrid"
>
...
...
@@ -20,7 +20,12 @@
:key=
"item.id"
:index=
"
{ id: item.id, index }"
>
<u-icon
:name=
"item.iconUrl"
:size=
"46"
></u-icon>
<u-icon
:name=
"
item.iconUrl.split('http').length > 1 ? item.iconUrl : baseUrl + item.iconUrl
"
:size=
"46"
></u-icon>
<view
class=
"grid-text"
>
{{
item
.
name
}}
</view>
</u-grid-item>
</u-grid>
...
...
@@ -186,11 +191,15 @@ const toTopic = (row: any) => {
const
initIndex
=
()
=>
{
homeIndex
().
then
((
res
:
any
)
=>
{
// console.log(res);
// if (res.data.code === 200) {
if
(
res
.
data
.
code
===
200
)
{
indexData
.
value
=
res
.
data
.
data
;
console
.
log
(
res
,
'首页数据'
);
// }
indexData
.
value
.
banner
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
url
.
split
(
'http'
).
length
<=
1
)
{
item
.
url
=
baseUrl
+
item
.
url
;
}
});
console
.
log
(
indexData
.
value
.
banner
);
}
});
};
initIndex
();
...
...
src/pages/order/checkout.vue
浏览文件 @
0e4f141e
...
...
@@ -44,10 +44,10 @@
<!-- list -->
<view
class=
"list"
>
<view
class=
"item-list"
>
<
!--
<
view
class=
"item-list"
>
<view
class=
"label"
>
商品金额
</view>
<view
class=
"item-price"
>
¥
{{
buyNowData
?.
goodsTotalPrice
.
toFixed
(
2
)
}}
</view>
</view>
</view>
-->
<view
class=
"item-list-end"
>
<view
class=
"label"
>
订单备注
</view>
<u-input
v-model=
"remarks"
/>
...
...
@@ -57,12 +57,12 @@
<!-- 提交订单 -->
<view
class=
"footer"
>
<view>
<text
style=
"font-size: 30rpx;"
>
总计
</text>
<
!--
<
text
style=
"font-size: 30rpx;"
>
总计
</text>
<text
style=
"margin-right: 24rpx; color: #ee0a24; font-size: 30rpx; font-weight: 600;"
>
¥
{{
buyNowData
?.
orderTotalPrice
.
toFixed
(
2
)
}}
</text>
</text>
-->
<u-button
type=
"error"
size=
"medium"
shape=
"circle"
@
tap=
"onsubmit"
>
结算
</u-button>
</view>
</view>
...
...
@@ -113,7 +113,9 @@ const onsubmit = () => {
}).
then
((
res1
:
any
)
=>
{
console
.
log
(
res1
,
'订单详情信息'
);
uni
.
navigateTo
({
url
:
`/pages/order/downPdf?data=
${
JSON
.
stringify
(
res1
.
data
.
data
)}
&type=
${
type
.
value
}
`
,
url
:
`/pages/order/downPdf?data=
${
JSON
.
stringify
(
res1
.
data
.
data
)}
&type=
${
type
.
value
}
`
,
});
});
}
...
...
@@ -150,18 +152,25 @@ const initCheckoutCart = (cartId: number, types: number) => {
};
onShow
(()
=>
{
if
(
type
.
value
===
'cart'
)
{
switch
(
type
.
value
)
{
case
'cart'
:
buyNowId
.
value
=
0
;
initCheckoutCart
(
buyNowId
.
value
,
0
);
type
.
value
=
''
;
break
;
case
'productLineCart'
:
buyNowId
.
value
=
0
;
initCheckoutCart
(
buyNowId
.
value
,
2
);
type
.
value
=
''
;
}
if
(
type
.
value
===
'goods'
)
{
break
;
case
'goods'
:
buyNowId
.
value
=
uni
.
getStorageSync
(
'buyNowId'
);
initCheckoutCart
(
buyNowId
.
value
,
0
);
}
if
(
type
.
value
==
'productline'
)
{
break
;
case
'productline'
:
buyNowId
.
value
=
uni
.
getStorageSync
(
'buyNowId'
);
initCheckoutCart
(
buyNowId
.
value
,
2
);
break
;
}
});
</
script
>
...
...
src/pages/order/quotation.vue
浏览文件 @
0e4f141e
...
...
@@ -8,7 +8,10 @@
<u-input
v-model=
"formData.tel"
/>
</u-form-item>
<u-form-item
label=
"单价:"
prop=
"price"
>
<u-input
v-model=
"formData.price"
/>
<!--
<u-input
v-model=
"formData.price"
/>
-->
<view
style=
"width: 100%; text-align: left;"
>
<u-button
type=
"primary"
size=
"mini"
@
tap=
"fillIn"
>
填写商品单价
</u-button>
</view>
</u-form-item>
<u-form-item
label=
"地址:"
prop=
"addr"
><u-input
v-model=
"formData.addr"
/></u-form-item>
<u-form-item
label=
"no:"
prop=
"noOrder"
>
...
...
@@ -30,7 +33,7 @@
<u-input
v-model=
"formData.quotationAttend"
/>
</u-form-item>
<u-form-item
label=
"报价Email:"
prop=
"quotationEmail"
>
<u-input
v-model=
"formData.quotation
Email
"
/>
<u-input
v-model=
"formData.quotation
Attend
"
/>
</u-form-item>
<u-form-item
label=
"收货方:"
prop=
"toCust"
>
<u-input
v-model=
"formData.toCust"
/>
...
...
@@ -41,12 +44,17 @@
</u-form>
<u-button
@
click=
"submit"
>
提交
</u-button>
</view>
<order-from
ref=
"orderRef"
@
onSubmit=
"onSubmit"
/>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
;
import
{
fillQuotation
,
quotationInit
}
from
'@/api/cart'
;
import
{
onLoad
}
from
'@dcloudio/uni-app'
;
import
{
onLoad
,
onReady
}
from
'@dcloudio/uni-app'
;
import
orderFrom
from
'./components/orderFrom.vue'
;
let
orderRef
=
ref
()
let
formData
=
ref
({
createdBy
:
''
,
...
...
@@ -65,6 +73,20 @@ let formData = ref({
noOrder
:
''
,
});
let
rules
=
ref
({
attend
:
[{
required
:
true
,
message
:
'请输入姓名'
,
trigger
:
'blur'
}],
tel
:
[{
required
:
true
,
message
:
'请输入姓名'
,
trigger
:
'blur'
}],
addr
:
[{
required
:
true
,
message
:
'请输入姓名'
,
trigger
:
'blur'
}],
noOrder
:
[{
required
:
true
,
message
:
'请输入姓名'
,
trigger
:
'blur'
}],
deliveryAddr
:
[{
required
:
true
,
message
:
'请输入姓名'
,
trigger
:
'blur'
}],
deliveryDate
:
[{
required
:
true
,
message
:
'请输入姓名'
,
trigger
:
'blur'
}],
email
:
[{
required
:
true
,
message
:
'请输入姓名'
,
trigger
:
'blur'
}],
pay
:
[{
required
:
true
,
message
:
'请输入姓名'
,
trigger
:
'blur'
}],
quotationAttend
:
[{
required
:
true
,
message
:
'请输入姓名'
,
trigger
:
'blur'
}],
toCust
:
[{
required
:
true
,
message
:
'请输入姓名'
,
trigger
:
'blur'
}],
intro
:
[{
min
:
5
,
message
:
'简介不能少于5个字'
,
trigger
:
'change'
}],
});
let
uFormRef
=
ref
();
let
quotationData
=
ref
();
...
...
@@ -72,7 +94,21 @@ onLoad((options: any) => {
initQuotation
(
options
.
orderId
);
});
onReady
(()
=>
{
uFormRef
.
value
?.
setRules
(
rules
.
value
);
})
// 打开单价popup
let
fillIn
=
()
=>
{
if
(
!
quotationData
.
value
.
items
)
return
orderRef
.
value
.
form
=
quotationData
.
value
.
items
orderRef
.
value
.
show
=
true
}
let
submit
=
()
=>
{
uFormRef
.
value
?.
validate
((
valid
:
any
,
err
:
any
)
=>
{
if
(
valid
)
{
quotationData
.
value
.
items
[
0
].
price
=
23
;
let
data
=
{
items
:
quotationData
.
value
.
items
,
...
...
@@ -83,8 +119,17 @@ let submit = () => {
console
.
log
(
res
);
}
});
}
else
{
console
.
log
(
err
);
}
})
};
let
onSubmit
=
(
data
:
any
)
=>
{
quotationData
.
value
.
items
=
data
orderRef
.
value
.
show
=
false
}
let
initQuotation
=
(
orderId
:
number
)
=>
{
quotationInit
({
orderId
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
...
...
src/utils/config.ts
浏览文件 @
0e4f141e
...
...
@@ -2,7 +2,7 @@ const CONFIG: any = {
// 开发环境配置
development
:
{
assetsPath
:
'http://192.168.0.23'
,
// 静态资源路径
baseUrl
:
'http://192.168.0.
9:8089
'
,
// 后台接口请求地址
baseUrl
:
'http://192.168.0.
23
'
,
// 后台接口请求地址
hostUrl
:
'http://192.168.0.23'
,
// H5地址(前端运行地址)
websocketUrl
:
''
,
// websocket服务端地址
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论