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
e2b7fb01
提交
e2b7fb01
authored
12月 07, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
4ea27ba0
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
119 行增加
和
81 行删除
+119
-81
checkout.vue
src/pages/order/checkout.vue
+7
-1
quotation.vue
src/pages/order/quotation.vue
+81
-39
productLineDetails.vue
src/pages/productLine/productLineDetails.vue
+29
-38
address.vue
src/pages/profile/address.vue
+2
-3
没有找到文件。
src/pages/order/checkout.vue
浏览文件 @
e2b7fb01
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
onLoad
,
onBackPress
}
from
'@dcloudio/uni-app'
;
import
{
onLoad
,
onBackPress
,
onShow
}
from
'@dcloudio/uni-app'
;
import
{
ref
}
from
'vue'
;
import
{
ref
}
from
'vue'
;
import
{
checkoutCart
,
orderSubmit
}
from
'@/api/index'
;
import
{
checkoutCart
,
orderSubmit
}
from
'@/api/index'
;
import
config
from
'@/utils/config'
;
import
config
from
'@/utils/config'
;
...
@@ -198,6 +198,7 @@ const initCheckoutCart = (cartId: number, types: number) => {
...
@@ -198,6 +198,7 @@ const initCheckoutCart = (cartId: number, types: number) => {
});
});
};
};
// 更新
const
init
=
()
=>
{
const
init
=
()
=>
{
switch
(
type
.
value
)
{
switch
(
type
.
value
)
{
case
'cart'
:
case
'cart'
:
...
@@ -217,6 +218,11 @@ const init = () => {
...
@@ -217,6 +218,11 @@ const init = () => {
break
;
break
;
}
}
};
};
// 防止地址选择后不会更新渲染
onShow
(()
=>
{
init
();
});
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
src/pages/order/quotation.vue
浏览文件 @
e2b7fb01
...
@@ -173,8 +173,9 @@
...
@@ -173,8 +173,9 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
getCurrentInstance
,
ComponentInternalInstance
,
computed
}
from
'vue'
;
import
{
ref
,
getCurrentInstance
,
ComponentInternalInstance
,
computed
}
from
'vue'
;
import
{
fillQuotation
,
quotationInit
,
quotationOrder
}
from
'@/api/cart'
;
import
{
fillQuotation
,
quotationInit
,
quotationOrder
}
from
'@/api/cart'
;
import
{
onLoad
,
onReady
,
onShow
}
from
'@dcloudio/uni-app'
;
import
{
onLoad
,
onReady
}
from
'@dcloudio/uni-app'
;
import
{
orderDetail
,
getTax
}
from
'@/api/index'
;
import
{
orderDetail
,
getTax
}
from
'@/api/index'
;
import
{
getProductLineIndex
}
from
'@/api/productLine'
;
import
{
quotationExist
}
from
'@/api/cart'
import
{
quotationExist
}
from
'@/api/cart'
import
config
from
'@/utils/config'
;
import
config
from
'@/utils/config'
;
import
orderForm
from
'./components/orderForm.vue'
;
import
orderForm
from
'./components/orderForm.vue'
;
...
@@ -263,10 +264,12 @@ let guaranteeList = ref([
...
@@ -263,10 +264,12 @@ let guaranteeList = ref([
let
uFormRef
=
ref
();
let
uFormRef
=
ref
();
let
quotationData
=
ref
();
let
quotationData
=
ref
();
let
orderId
=
ref
()
let
orderId
=
ref
()
let
addressData
=
ref
()
// 获取收货地址信息
let
tax
=
ref
()
// 税率
let
tax
=
ref
()
// 税率
let
lineId
=
ref
()
// 产品线id 可以分辨是产品线还是普通商品
onLoad
((
options
:
any
)
=>
{
onLoad
((
options
:
any
)
=>
{
console
.
log
(
options
);
if
(
options
.
lineId
)
lineId
.
value
=
options
.
lineId
orderId
.
value
=
options
.
orderId
orderId
.
value
=
options
.
orderId
// 判断是否重复报价
// 判断是否重复报价
quotationExist
({
orderId
:
orderId
.
value
}).
then
((
res
:
any
)
=>
{
quotationExist
({
orderId
:
orderId
.
value
}).
then
((
res
:
any
)
=>
{
...
@@ -286,18 +289,19 @@ onLoad((options: any) => {
...
@@ -286,18 +289,19 @@ onLoad((options: any) => {
})
})
});
});
onShow
(()
=>
{
// 更新收货地址
uni
.
$on
(
'updateAddress'
,
(
data
:
any
)
=>
{
// 判断是否在报价页面返回
// 判断是否在报价页面返回
if
(
addressData
.
value
)
{
if
(
data
.
addr
)
{
// 同步修改收货地址的信息
// 同步修改收货地址的信息
formData
.
value
.
toCust
=
addressData
.
value
.
name
formData
.
value
.
toCust
=
data
.
addr
.
name
formData
.
value
.
quotationAttend
=
addressData
.
value
.
contactName
formData
.
value
.
quotationAttend
=
data
.
addr
.
contactName
formData
.
value
.
quotationEmail
=
addressData
.
value
.
customerEmail
formData
.
value
.
quotationEmail
=
data
.
addr
.
customerEmail
formData
.
value
.
quotationTel
=
addressData
.
value
.
tel
formData
.
value
.
quotationTel
=
data
.
addr
.
tel
formData
.
value
.
addr
=
addressData
.
value
.
province
+
formData
.
value
.
addr
=
data
.
addr
.
province
+
addressData
.
value
.
city
+
addressData
.
value
.
county
+
addressData
.
value
.
addressDetail
data
.
addr
.
city
+
data
.
addr
.
county
+
data
.
addr
.
addressDetail
}
}
console
.
log
(
data
.
addr
);
})
})
// 引入校验
// 引入校验
...
@@ -325,35 +329,51 @@ let taxTotlePirce = computed(() => {
...
@@ -325,35 +329,51 @@ let taxTotlePirce = computed(() => {
});
});
let
submit
=
()
=>
{
let
submit
=
()
=>
{
uFormRef
.
value
?.
validate
((
valid
:
any
,
err
:
any
)
=>
{
// 保证单价必填
if
(
valid
)
{
new
Promise
((
resolve
,
reject
)
=>
{
// 保证单价必填
detailData
.
value
.
some
((
item
:
any
)
=>
{
detailData
.
value
.
some
((
item
:
any
)
=>
{
if
(
typeof
item
.
unitPrice
===
'undefined'
)
{
if
(
typeof
item
.
unitPrice
===
'undefined'
)
{
return
uni
.
showToast
({
return
uni
.
showToast
({
title
:
`请填写
${
item
.
goodsName
}
单价`
,
title
:
`请填写
${
item
.
goodsName
}
单价`
,
icon
:
'none'
,
icon
:
'none'
,
});
});
}
})
resolve
(
true
)
}).
then
(()
=>
{
uFormRef
.
value
?.
validate
((
valid
:
any
,
err
:
any
)
=>
{
if
(
valid
)
{
if
(
lineId
.
value
)
{
// 同步价格
quotationData
.
value
.
items
.
forEach
((
item
:
any
)
=>
{
detailData
.
value
.
map
((
res
:
any
)
=>
{
if
(
item
.
goodsName
==
res
.
goodsName
)
{
item
.
price
=
res
.
unitPrice
}
})
})
}
else
{
// 同步价格
quotationData
.
value
.
items
.
forEach
((
item
:
any
)
=>
{
detailData
.
value
.
map
((
res
:
any
)
=>
{
if
(
item
.
goodsName
==
res
.
goodsName
)
{
item
.
price
=
res
.
unitPrice
}
})
})
}
}
})
let
data
=
{
// 同步价格
items
:
quotationData
.
value
.
items
,
quotationData
.
value
.
items
.
forEach
((
item
:
any
)
=>
{
quotation
:
formData
.
value
,
detailData
.
value
.
map
((
res
:
any
)
=>
{
};
if
(
item
.
goodsName
==
res
.
goodsName
)
{
item
.
price
=
res
.
unitPrice
fillQuotation
(
data
).
then
((
res
:
any
)
=>
{
}
if
(
res
.
data
.
code
===
200
)
showModel
.
value
=
true
})
});
})
}
else
{
let
data
=
{
console
.
log
(
err
);
items
:
quotationData
.
value
.
items
,
}
quotation
:
formData
.
value
,
})
};
fillQuotation
(
data
).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
showModel
.
value
=
true
});
}
else
{
console
.
log
(
err
);
}
})
})
};
};
...
@@ -428,6 +448,28 @@ let initQuotation = (orderId: number) => {
...
@@ -428,6 +448,28 @@ let initQuotation = (orderId: number) => {
};
};
let
initQuotaionData
=
(
id
:
number
)
=>
{
let
initQuotaionData
=
(
id
:
number
)
=>
{
// 查询产品线
if
(
lineId
.
value
)
{
getProductLineIndex
({
lineId
:
lineId
.
value
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
detailData
.
value
=
res
.
data
.
data
.
cartList
// 从quotationData获取 在detailData中添加 合同报价字段
if
(
quotationData
.
value
)
{
detailData
.
value
.
map
((
detail
:
any
)
=>
{
detail
.
unitPrice
=
undefined
quotationData
.
value
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
goodsName
==
detail
.
goodsName
)
{
detail
.
contractQuotation
=
item
.
contractQuotation
}
})
})
console
.
log
(
detailData
.
value
);
}
else
initQuotation
(
orderId
.
value
)
// console.log(res, '订单详情信息');
}
})
}
else
// 查询普通商品
orderDetail
({
orderId
:
id
}).
then
((
res
:
any
)
=>
{
orderDetail
({
orderId
:
id
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
detailData
.
value
=
res
.
data
.
data
.
orderGoods
detailData
.
value
=
res
.
data
.
data
.
orderGoods
...
...
src/pages/productLine/productLineDetails.vue
浏览文件 @
e2b7fb01
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
computed
}
from
'vue'
;
import
{
ref
,
computed
}
from
'vue'
;
import
{
onLoad
,
onBackPress
}
from
'@dcloudio/uni-app'
;
import
{
onLoad
,
onBackPress
}
from
'@dcloudio/uni-app'
;
import
{
getTax
,
orderDetail
}
from
'@/api/index'
;
import
{
orderDetail
}
from
'@/api/index'
;
import
{
quotationInit
}
from
'@/api/cart'
;
import
{
quotationInit
}
from
'@/api/cart'
;
import
{
getProductLineIndex
}
from
'@/api/productLine'
;
import
{
getProductLineIndex
}
from
'@/api/productLine'
;
import
{
useStore
}
from
'@/store/useStore'
;
import
{
useStore
}
from
'@/store/useStore'
;
...
@@ -85,7 +85,6 @@ onLoad((options: any) => {
...
@@ -85,7 +85,6 @@ onLoad((options: any) => {
orderId
.
value
=
options
.
orderId
;
orderId
.
value
=
options
.
orderId
;
console
.
log
(
type
.
value
,
'type.value'
);
console
.
log
(
type
.
value
,
'type.value'
);
initOrderData
(
options
.
orderId
);
initOrderData
(
options
.
orderId
);
initTax
();
// 查询税率
});
});
// 返回首页
// 返回首页
...
@@ -102,25 +101,28 @@ let toIndex = () => {
...
@@ -102,25 +101,28 @@ let toIndex = () => {
// 生成报价
// 生成报价
let
generateQuote
=
()
=>
{
let
generateQuote
=
()
=>
{
let
data
=
[]
as
any
;
// let data = [] as any;
let
flag
=
true
;
// let flag = true;
detailData
.
value
.
map
((
item
:
any
)
=>
{
// detailData.value.map((item: any) => {
if
(
typeof
item
.
unitPrice
===
'undefined'
)
{
// if (typeof item.unitPrice === 'undefined') {
flag
=
false
;
// flag = false;
return
uni
.
showToast
({
// return uni.showToast({
title
:
`请填写
${
item
.
goodsName
}
单价`
,
// title: `请填写 ${item.goodsName} 单价`,
icon
:
'none'
,
// icon: 'none',
});
// });
}
else
// } else
data
.
push
({
// data.push({
goodsName
:
item
.
goodsName
,
// goodsName: item.goodsName,
unitPrice
:
item
.
unitPrice
,
// unitPrice: item.unitPrice,
});
// });
// });
// if (flag)
// uni.navigateTo({
// url: `../order/quotation?orderId=${orderId.value}`,
// });
uni
.
navigateTo
({
url
:
`../order/quotation?orderId=
${
orderId
.
value
}
&lineId=
${
lineId
.
value
}
`
,
});
});
if
(
flag
)
uni
.
navigateTo
({
url
:
`../order/quotation?orderId=
${
orderId
.
value
}
`
,
});
};
};
// 总价格
// 总价格
...
@@ -170,35 +172,23 @@ let download = () => {
...
@@ -170,35 +172,23 @@ let download = () => {
});
});
};
};
// 获取下载pdf信息
// let initPdf = (orderId: number) => {
// getOrderPdf({ orderId }).then((res: any) => {
// if (res.data.code === 200) {
// console.log(res, 'pdf');
// }
// });
// };
// 获取税率
let
initTax
=
()
=>
{
getTax
().
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
tax
.
value
=
Number
(
res
.
data
.
data
.
mall_tax_rate
);
});
};
let
initQuotationInit
=
(
orderId
:
number
)
=>
{
let
initQuotationInit
=
(
orderId
:
number
)
=>
{
quotationInit
({
orderId
}).
then
((
res
:
any
)
=>
{
quotationInit
({
orderId
}).
then
((
res
:
any
)
=>
{
console
.
log
(
res
,
'产品线'
);
console
.
log
(
res
,
'产品线'
);
});
});
};
};
let
lineId
=
ref
();
// 获取goodsId
// 获取goodsId
let
initOrderData
=
(
orderId
:
number
)
=>
{
let
initOrderData
=
(
orderId
:
number
)
=>
{
orderDetail
({
orderId
}).
then
((
res
:
any
)
=>
{
orderDetail
({
orderId
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
enclosure
.
value
=
res
.
data
.
data
.
orderInfo
.
enclosure
;
enclosure
.
value
=
res
.
data
.
data
.
orderInfo
.
enclosure
;
res
.
data
.
data
.
orderGoods
.
map
((
item
:
any
)
=>
{
res
.
data
.
data
.
orderGoods
.
map
((
item
:
any
,
i
:
number
)
=>
{
initProductLineIndex
(
item
.
goodsId
);
if
(
res
.
data
.
data
.
orderGoods
.
length
-
1
===
i
)
{
lineId
.
value
=
item
.
goodsId
;
initProductLineIndex
(
item
.
goodsId
);
}
});
});
}
}
});
});
...
@@ -214,6 +204,7 @@ let initProductLineIndex = (lineId: number) => {
...
@@ -214,6 +204,7 @@ let initProductLineIndex = (lineId: number) => {
});
});
};
};
// 通过type判断返回页面
onBackPress
((
options
:
any
)
=>
{
onBackPress
((
options
:
any
)
=>
{
if
(
type
.
value
===
'productline'
)
{
if
(
type
.
value
===
'productline'
)
{
if
(
options
.
from
===
'navigateBack'
)
{
if
(
options
.
from
===
'navigateBack'
)
{
...
...
src/pages/profile/address.vue
浏览文件 @
e2b7fb01
...
@@ -83,12 +83,11 @@ const setAddress = (item: any) => {
...
@@ -83,12 +83,11 @@ const setAddress = (item: any) => {
success
()
{
success
()
{
let
pages
=
getCurrentPages
();
// 当前页面
let
pages
=
getCurrentPages
();
// 当前页面
let
beforePage
:
any
=
pages
[
pages
.
length
-
2
];
// 上一页
let
beforePage
:
any
=
pages
[
pages
.
length
-
2
];
// 上一页
console
.
log
(
beforePage
);
//
console.log(beforePage);
uni
.
navigateBack
({
uni
.
navigateBack
({
success
:
function
()
{
success
:
function
()
{
if
(
beforePage
.
route
===
'pages/order/quotation'
)
if
(
beforePage
.
route
===
'pages/order/quotation'
)
beforePage
.
$vm
.
addressData
=
item
;
uni
.
$emit
(
'updateAddress'
,
{
addr
:
item
});
else
beforePage
.
$vm
.
init
();
// 执行上一页的onLoad方法
},
},
});
});
},
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论