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
2629d51c
提交
2629d51c
authored
11月 23, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
9745141f
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
84 行增加
和
34 行删除
+84
-34
index.vue
src/pages/cart/index.vue
+3
-1
index.vue
src/pages/goods/index.vue
+5
-0
checkout.vue
src/pages/order/checkout.vue
+1
-2
downPdf.vue
src/pages/order/downPdf.vue
+12
-10
productLine.vue
src/pages/productLine/productLine.vue
+1
-0
productLineDetails.vue
src/pages/productLine/productLineDetails.vue
+46
-5
request.ts
src/utils/request.ts
+16
-16
没有找到文件。
src/pages/cart/index.vue
浏览文件 @
2629d51c
...
...
@@ -182,8 +182,9 @@ const deleteCart = (index: number) => {
showModel
.
show
=
true
;
};
// 批量
删除
// 批量
操作
const
tapOptions
=
()
=>
{
// 删除
if
(
delCircle
.
value
)
{
delIds
.
value
=
[];
_
.
each
(
checkedGoods
.
value
,
(
id
:
any
)
=>
{
...
...
@@ -195,6 +196,7 @@ const tapOptions = () => {
});
showModel
.
show
=
true
;
}
else
{
// 结算
let
storage
:
any
=
{
cartId
:
0
,
addressId
:
0
,
...
...
src/pages/goods/index.vue
浏览文件 @
2629d51c
...
...
@@ -162,6 +162,11 @@ const detailId = ref()
onLoad
((
options
:
any
)
=>
{
detailId
.
value
=
options
.
id
// 在结算中返回时使用
uni
.
setStorage
({
key
:
'detailId'
,
data
:
options
.
id
})
initDetails
(
options
.
id
)
initParts
(
options
.
id
)
});
...
...
src/pages/order/checkout.vue
浏览文件 @
2629d51c
...
...
@@ -87,7 +87,6 @@ import { checkoutCart, orderSubmit } from '@/api/index';
import
config
from
'@/utils/config'
;
let
baseUrl
=
config
.
baseUrl
;
const
buyNowId
=
ref
(
uni
.
getStorageSync
(
'buyNowId'
)
||
0
);
const
buyNowData
=
ref
();
const
remarks
=
ref
();
// 订单备注
...
...
@@ -108,7 +107,6 @@ const tapAddresss = () => {
// 结算
const
onsubmit
=
()
=>
{
let
types
=
0
;
console
.
log
(
type
.
value
,
'type.value'
);
if
(
type
.
value
===
'productline'
||
type
.
value
===
'productLineCart'
)
types
=
2
;
else
types
=
0
;
let
data
:
object
=
{
...
...
@@ -191,6 +189,7 @@ onShow(() => {
break
;
}
});
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/pages/order/downPdf.vue
浏览文件 @
2629d51c
...
...
@@ -102,12 +102,11 @@
import
{
ref
,
computed
}
from
'vue'
;
import
{
onLoad
,
onBackPress
}
from
'@dcloudio/uni-app'
;
import
config
from
'@/utils/config'
;
import
{
use
Store
,
use
CurrentStore
}
from
'@/store/useStore'
;
import
{
useCurrentStore
}
from
'@/store/useStore'
;
// import { getOrderPdf } from '@/api/cart';
import
{
orderDetail
,
getTax
}
from
'@/api/index'
;
let
baseUrl
=
config
.
baseUrl
;
let
store
=
useStore
();
let
currentStore
=
useCurrentStore
();
let
enclosure
=
ref
(
''
);
// pdf key值
let
detailData
=
ref
();
...
...
@@ -117,6 +116,7 @@ let tax = ref(0); // 税率
onLoad
((
options
:
any
)
=>
{
type
.
value
=
options
.
type
;
console
.
log
(
type
.
value
,
'type.value '
);
orderDetail
({
orderId
:
options
.
orderId
,
}).
then
((
res
:
any
)
=>
{
...
...
@@ -224,17 +224,19 @@ let initTax = () => {
});
};
onBackPress
(()
=>
{
if
(
type
.
value
===
'productline'
)
{
store
.
$reset
();
uni
.
reLaunch
({
url
:
'../productLine/productLine'
,
});
}
else
if
(
type
.
value
===
'profile'
)
{
onBackPress
((
options
:
any
)
=>
{
if
(
options
.
from
===
'navigateBack'
)
{
return
false
;
}
if
(
type
.
value
===
'profile'
)
{
uni
.
redirectTo
({
url
:
'../order/orderList?showType='
+
currentStore
.
current
,
});
}
else
{
}
else
if
(
type
.
value
===
'cart'
)
{
uni
.
reLaunch
({
url
:
'../cart/index'
,
});
}
else
if
(
type
.
value
===
'goods'
)
{
uni
.
reLaunch
({
url
:
'../index/index'
,
});
...
...
src/pages/productLine/productLine.vue
浏览文件 @
2629d51c
...
...
@@ -426,6 +426,7 @@ let reload = () => {
url
:
'/'
+
currPage
.
route
,
});
};
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/pages/productLine/productLineDetails.vue
浏览文件 @
2629d51c
...
...
@@ -98,12 +98,14 @@
<
script
setup
lang=
"ts"
>
import
{
ref
,
computed
}
from
'vue'
;
import
{
onLoad
}
from
'@dcloudio/uni-app'
;
import
config
from
'@/utils/config'
;
import
{
onLoad
,
onBackPress
}
from
'@dcloudio/uni-app'
;
import
{
getTax
,
orderDetail
}
from
'@/api/index'
;
import
{
quotationInit
}
from
'@/api/cart'
;
import
{
getProductLineIndex
}
from
'@/api/productLine'
;
import
{
useStore
}
from
'@/store/useStore'
;
import
config
from
'@/utils/config'
;
let
store
=
useStore
();
let
baseUrl
=
config
.
baseUrl
;
let
enclosure
=
ref
(
''
);
// pdf key值
let
detailData
=
ref
([]
as
any
);
...
...
@@ -113,10 +115,9 @@ let tax = ref(0); // 税率
onLoad
((
options
:
any
)
=>
{
type
.
value
=
options
.
type
;
orderId
.
value
=
options
.
orderId
orderId
.
value
=
options
.
orderId
;
console
.
log
(
type
.
value
,
'type.value'
);
initOrderData
(
options
.
orderId
);
// initQuotationInit(options.orderId);
// initPdf(options.orderId); // 查询pdf详细资料
initTax
();
// 查询税率
});
...
...
@@ -124,6 +125,11 @@ onLoad((options: any) => {
let
toIndex
=
()
=>
{
uni
.
reLaunch
({
url
:
'../index/index'
,
success
()
{
if
(
type
.
value
===
'productline'
)
{
store
.
$reset
();
// 重置pinia数据
}
},
});
};
...
...
@@ -239,6 +245,41 @@ let initProductLineIndex = (lineId: number) => {
}
});
};
onBackPress
((
options
:
any
)
=>
{
if
(
type
.
value
===
'productline'
)
{
if
(
options
.
from
===
'navigateBack'
)
{
return
false
;
}
uni
.
switchTab
({
url
:
'./productLine'
,
success
()
{
store
.
$reset
();
// 重置pinia数据
let
pages
=
getCurrentPages
();
//获取所有页面的数组对象
let
currPage
:
any
=
pages
[
pages
.
length
-
1
];
//当前页面
uni
.
reLaunch
({
url
:
'/'
+
currPage
.
route
,
});
},
});
return
true
;
}
else
if
(
type
.
value
===
'productLineCart'
)
{
if
(
options
.
from
===
'navigateBack'
)
{
return
false
;
}
uni
.
switchTab
({
url
:
'../cart/index'
,
success
()
{
let
pages
=
getCurrentPages
();
//获取所有页面的数组对象
let
currPage
:
any
=
pages
[
pages
.
length
-
1
];
//当前页面
uni
.
reLaunch
({
url
:
'/'
+
currPage
.
route
,
});
},
});
return
true
;
}
});
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/utils/request.ts
浏览文件 @
2629d51c
...
...
@@ -8,26 +8,27 @@ function request(url: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE', data?:
uni
.
showLoading
({
title
:
'加载中...'
,
});
if
(
uni
.
getStorageSync
(
'token'
)
!==
undefined
&&
uni
.
getStorageSync
(
'token'
)
!==
''
)
{
if
(
uni
.
getStorageSync
(
'token'
))
{
header
=
{
'content-type'
:
'application/json'
,
Authorization
:
uni
.
getStorageSync
(
'token'
),
};
}
else
{
let
pages
=
getCurrentPages
();
let
curRoute
=
pages
[
pages
.
length
-
1
].
route
;
if
(
curRoute
!=
'pages/login/login'
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'请重新登录'
,
success
()
{
uni
.
navigateTo
({
url
:
'/pages/login/login'
,
});
},
});
}
}
// else {
// let pages = getCurrentPages();
// let curRoute = pages[pages.length - 1].route;
// if (curRoute != 'pages/login/login') {
// uni.showToast({
// icon: 'none',
// title: '请重新登录',
// success() {
// uni.navigateTo({
// url: '/pages/login/login',
// });
// },
// });
// }
// }
uni
.
request
({
url
:
baseUrl
+
url
,
method
:
method
,
...
...
@@ -59,7 +60,6 @@ function request(url: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE', data?:
}
},
fail
(
err
:
any
)
{
uni
.
clearStorage
();
uni
.
hideLoading
();
//申请失败
uni
.
showToast
({
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论