Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
Sign in / Register
Toggle navigation
S
site-uniapp
概览
Overview
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
王柯
site-uniapp
Commits
928dfa85
提交
928dfa85
authored
1月 09, 2023
作者:
wk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
组织切换
父级
d0b38113
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
384 行增加
和
94 行删除
+384
-94
api/api.js
+7
-3
pages.json
+26
-30
pages/gallery/gallery.vue
+28
-5
pages/gallery/message/message.vue
+9
-4
pages/index/index.vue
+97
-5
pages/login/login/login.vue
+6
-0
pages/mine/changeCompany/changeCompany.vue
+147
-0
pages/mine/changeOrg/changeOrg.vue
+36
-40
pages/mine/mine.vue
+1
-1
pages/mine/myScore/myScore.vue
+27
-6
没有找到文件。
api/api.js
View file @
928dfa85
...
...
@@ -166,7 +166,7 @@ const params = {
method
:
"post"
},
getMessages
:
{
url
:
"/
plat/api/v1/common_check/msg_notify/list
"
,
url
:
"/
ydt/warnRecord/getMsg
"
,
method
:
"get"
},
/* 数据智管 */
...
...
@@ -247,8 +247,12 @@ const params = {
method
:
"get"
},
getOrgTree
:
{
url
:
"/api/v1/org/node/get_org_tree"
,
method
:
"post"
url
:
"/plat/api/v1/screen/org_project_tree"
,
method
:
"get"
},
getCompany
:
{
url
:
"/api/v1/org/o_comp_user/user_comp_list"
,
method
:
"get"
}
}
...
...
pages.json
View file @
928dfa85
...
...
@@ -424,61 +424,57 @@
"enablePullDownRefresh"
:
false
}
}
,{
"path"
:
"pages/gallery/app/modeList/modeList"
,
"style"
:
{
},
{
"path"
:
"pages/gallery/app/modeList/modeList"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
}
,{
"path"
:
"pages/gallery/app/processFormDetail/processFormDetail"
,
"style"
:
{
},
{
"path"
:
"pages/gallery/app/processFormDetail/processFormDetail"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
}
,{
"path"
:
"pages/mine/changeOrg/changeOrg"
,
"style"
:
{
},
{
"path"
:
"pages/mine/changeOrg/changeOrg"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
}
}
,{
"path"
:
"pages/gallery/app/editAloneForm/editAloneForm"
,
"style"
:
{
},
{
"path"
:
"pages/gallery/app/editAloneForm/editAloneForm"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
}
,{
"path"
:
"pages/gallery/app/editRecordDetail/editRecordDetail"
,
"style"
:
{
},
{
"path"
:
"pages/gallery/app/editRecordDetail/editRecordDetail"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
}
,{
"path"
:
"pages/gallery/app/selectUserPage/selectUserPage"
,
"style"
:
{
},
{
"path"
:
"pages/gallery/app/selectUserPage/selectUserPage"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/mine/changeCompany/changeCompany"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
}
}
],
"globalStyle"
:
{
...
...
pages/gallery/gallery.vue
View file @
928dfa85
...
...
@@ -3,8 +3,8 @@
<view
class=
"header-content"
>
<image
src=
"../../static/home-head.png"
class=
"header-image"
></image>
<navbar
:title=
"title"
:showBack=
"false"
></navbar>
<view
class=
"project-content"
:style=
"
{top:statusBarHeight+45+'px'}">
<view
class=
"name"
>
XXX市高薪区府城写字楼二期改造项目
</view>
<view
class=
"project-content"
:style=
"
{top:statusBarHeight+45+'px'}"
@click="toChangeOrg"
>
<view
class=
"name"
>
{{
orgName
}}
</view>
<image
class=
"image"
src=
"../../static/down-arrow.png"
></image>
</view>
<view
class=
"message-content"
:style=
"
{top:statusBarHeight+78+'px'}">
...
...
@@ -87,6 +87,7 @@
is_publish
:
1
,
app_sort
:
1
},
orgName
:
""
}
},
onLoad
()
{
...
...
@@ -97,8 +98,31 @@
onShow
()
{
this
.
getMessages
()
this
.
getNeedDo
()
uni
.
$once
(
"refreshOrg"
,
res
=>
{
this
.
orgName
=
uni
.
getStorageSync
(
"org_name"
)
})
this
.
getOrgTree
()
},
methods
:
{
getOrgTree
()
{
Api
.
getOrgTree
({
data
:
{
company_id
:
uni
.
getStorageSync
(
"company_id"
),
org_no
:
getApp
().
globalData
.
userInfo
.
user
.
org_no
}
}).
then
((
result
)
=>
{
console
.
log
(
"组织树"
,
result
);
if
(
result
.
code
==
0
)
{
this
.
trees
=
result
.
data
.
list
[
0
].
children_list
this
.
orgName
=
uni
.
getStorageSync
(
"org_name"
)
||
result
.
data
.
list
[
0
].
name
}
})
},
toChangeOrg
()
{
uni
.
navigateTo
({
url
:
"/pages/mine/changeOrg/changeOrg"
})
},
toIndex
(
model
)
{
this
.
$mta
(
model
.
app_id
)
this
.
getAppDetail
(
model
)
...
...
@@ -172,9 +196,8 @@
getMessages
()
{
Api
.
getMessages
({
data
:
{
"page"
:
1
,
"page_size"
:
5
,
"is_page"
:
1
"pageNum"
:
1
,
"pageSize"
:
5
,
}
}).
then
((
result
)
=>
{
console
.
log
(
"消息列表"
,
result
);
...
...
pages/gallery/message/message.vue
View file @
928dfa85
...
...
@@ -3,8 +3,8 @@
<titleBar
title=
"消息中心"
></titleBar>
<v-tabs
:tabs=
"tabs"
:scroll=
"true"
:value=
"current"
@
change=
"tabChange"
></v-tabs>
<view
class=
"list-content"
>
<view
v-for=
"(item,index) in list"
:key=
"index"
class=
"list-item"
>
<view
class=
"red-dot"
></view>
<view
v-for=
"(item,index) in list"
:key=
"index"
class=
"list-item"
@
click=
"itemClick(index,item)"
>
<view
class=
"red-dot"
v-if=
"!item.readStatus"
></view>
<view
class=
"item-content "
>
<view
class=
"title"
>
塔机告警
</view>
<view
class=
"desc-content"
>
...
...
@@ -30,6 +30,7 @@
page
:
1
,
pageSize
:
20
,
totalPage
:
1
,
isHasMore
:
false
}
},
onLoad
()
{
...
...
@@ -46,6 +47,10 @@
}
},
methods
:
{
itemClick
(
index
,
item
)
{
item
.
readStatus
=
true
this
.
$set
(
this
.
list
,
index
,
item
)
},
tabChange
(
e
)
{
console
.
log
(
"tab切换"
,
e
);
this
.
current
=
e
...
...
@@ -56,8 +61,8 @@
Api
.
getMessages
({
data
:
{
"page"
:
this
.
page
,
"page
_s
ize"
:
this
.
pageSize
,
"
is_page"
:
1
"page
S
ize"
:
this
.
pageSize
,
"
msgType"
:
this
.
current
}
}).
then
((
result
)
=>
{
console
.
log
(
"消息列表"
,
result
);
...
...
pages/index/index.vue
View file @
928dfa85
...
...
@@ -144,7 +144,8 @@
pageTemplateComponent
:
[],
isWeatherShow
:
true
,
role
:
"VISITOR"
,
nowTime
:
""
nowTime
:
""
,
project
:
{}
}
},
onLoad
()
{
...
...
@@ -177,11 +178,12 @@
success
(
res
)
{
//获取用户信息
that
.
getUserInfo
()
//
that.getNews()
that
.
getNews
()
that
.
getSetting
()
that
.
getMyScore
()
that
.
getHomeComp
()
that
.
getWeather
()
that
.
loadProject
()
if
(
that
.
isCommonSel
)
{
that
.
getCommonApp
()
}
else
{
...
...
@@ -195,6 +197,50 @@
}
})
},
loadProject
:
function
()
{
let
that
=
this
this
.
$http
.
get
({
url
:
"/api/v1/project/project_list"
,
data
:
{
is_all
:
1
,
org_no
:
uni
.
getStorageSync
(
"org_no"
)
},
header
:
{
"access_token"
:
this
.
getToken
()
}
}).
then
(
res
=>
{
let
result
=
res
.
data
console
.
log
(
"项目列表:"
,
result
);
if
(
result
.
code
===
0
)
{
this
.
project
=
result
.
data
.
list
[
0
]
}
this
.
getGoodsList
()
})
},
getGoodsList
()
{
Api
.
getGoodsList
({
data
:
{
is_page
:
0
,
project_id
:
this
.
project
.
project_id
}
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
shopList
=
res
.
data
.
list
||
[]
this
.
shopList
.
map
(
item
=>
{
let
userScore
=
this
.
scoreDetail
.
integral
||
0
let
goodsScore
=
item
.
goods_integral
||
0
item
.
percent
=
userScore
/
goodsScore
item
.
percent
=
item
.
percent
>=
1
?
1
:
0
if
(
item
.
percent
>=
100
)
{
item
.
tip
=
'可以兑换啦'
}
else
{
item
.
tip
=
`还差
${
goodsScore
-
userScore
}
分`
}
})
}
})
},
add0
(
text
)
{
if
(
text
<
10
)
{
return
"0"
+
text
...
...
@@ -329,9 +375,7 @@
},
toLink
(
app
)
{
this
.
$mta
(
app
.
app_id
)
uni
.
navigateTo
({
url
:
"/pages/mine/myScore/myScore"
})
this
.
getAppDetail
(
app
)
},
getHomeComp
()
{
Api
.
getHomeComp
({
...
...
@@ -488,7 +532,55 @@
},
nameLengthDeal
(
name
)
{
return
StringUtils
.
stringLength
(
name
,
5
)
},
getAppDetail
(
model
)
{
Api
.
getAppDetail
({
data
:
{
"check_tpl_id"
:
model
.
source_id
}
}).
then
((
result
)
=>
{
console
.
log
(
"应用信息"
,
result
);
uni
.
setStorageSync
(
"business_name"
,
result
.
data
.
tpl_name
)
if
(
result
.
code
==
0
)
{
if
(
!
result
.
data
.
business_type
)
{
uni
.
navigateTo
({
url
:
`/pages/gallery/app/originalIndex/originalIndex?check_tpl_id=
${
model
.
source_id
}
&title=
${
result
.
data
.
tpl_name
}
`
})
}
else
if
(
result
.
data
.
business_type
==
2
)
{
//独立模式 需要获取模块数量 如果只有一个模块 自动跳转表单页面 "体验嘛 呵呵"
this
.
toAlone
(
model
,
result
.
data
)
}
else
if
(
result
.
data
.
business_type
==
3
||
result
.
data
.
business_type
==
4
)
{
//流程模式
this
.
models
=
result
.
data
.
tpl_config
uni
.
navigateTo
({
url
:
`/pages/gallery/app/modeFormList/modeFormList?check_tpl_id=
${
model
.
source_id
}
&business_type=
${
result
.
data
.
business_type
}
&title=
${
result
.
data
.
tpl_name
}
&showCfg=
${
JSON
.
stringify
(
this
.
models
[
0
].
show_cfg
)}
`
})
}
else
if
(
result
.
data
.
business_type
==
5
)
{
this
.
currentModel
=
result
.
data
.
tpl_config
[
0
]
console
.
log
(
this
.
currentModel
);
this
.
$refs
.
bottomDialog
.
handleShow
()
}
else
{
//之前的默认
uni
.
navigateTo
({
url
:
`/pages/gallery/app/originalIndex/originalIndex?check_tpl_id=
${
model
.
source_id
}
&title=
${
result
.
data
.
tpl_name
}
`
})
}
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
})
},
toAlone
(
model
,
info
)
{
this
.
models
=
info
.
tpl_config
if
(
this
.
models
.
length
==
1
)
{
let
is_model_edit
=
this
.
models
[
0
].
is_edit
uni
.
navigateTo
({
url
:
`/pages/gallery/app/modeFormList/modeFormList?business_type=2&check_tpl_id=
${
model
.
source_id
}
&check_module_id=
${
this
.
models
[
0
].
check_module_id
}
&title=
${
this
.
models
[
0
].
module_name
}
&is_edit=
${
is_model_edit
}
&showCfg=
${
JSON
.
stringify
(
this
.
models
[
0
].
show_cfg
)}
`
})
}
else
{
uni
.
navigateTo
({
url
:
`/pages/gallery/app/modeList/modeList?check_tpl_id=
${
model
.
source_id
}
&title=
${
info
.
tpl_name
}
`
})
}
},
}
}
</
script
>
...
...
pages/login/login/login.vue
View file @
928dfa85
...
...
@@ -134,6 +134,7 @@
this
.
setToken
(
result
.
data
.
access_token
)
uni
.
setStorageSync
(
"user_info"
,
result
.
data
)
uni
.
setStorageSync
(
"company_id"
,
result
.
data
.
comp_id
)
uni
.
setStorageSync
(
"org_no"
,
result
.
data
.
org_no
)
uni
.
showToast
({
title
:
"授权登录成功"
,
icon
:
'none'
...
...
@@ -281,6 +282,8 @@
uni
.
setStorageSync
(
"short_token"
,
result
.
data
.
short_token
)
uni
.
setStorageSync
(
"token"
,
result
.
data
.
access_token
)
uni
.
setStorageSync
(
"user_info"
,
result
.
data
)
uni
.
setStorageSync
(
"org_no"
,
result
.
data
.
org_no
)
uni
.
setStorageSync
(
"company_id"
,
result
.
data
.
comp_id
)
uni
.
showToast
({
title
:
"授权登录成功"
,
icon
:
'none'
...
...
@@ -308,6 +311,7 @@
uni
.
setStorageSync
(
"token"
,
result
.
data
.
access_token
)
uni
.
setStorageSync
(
"user_info"
,
result
.
data
)
uni
.
setStorageSync
(
"company_id"
,
result
.
data
.
comp_id
)
uni
.
setStorageSync
(
"org_no"
,
result
.
data
.
org_no
)
uni
.
showToast
({
title
:
"授权登录成功"
,
icon
:
'none'
...
...
@@ -348,6 +352,7 @@
uni
.
setStorageSync
(
"short_token"
,
result
.
data
.
short_token
)
uni
.
setStorageSync
(
"user_info"
,
result
.
data
)
uni
.
setStorageSync
(
"company_id"
,
result
.
data
.
comp_id
)
uni
.
setStorageSync
(
"org_no"
,
result
.
data
.
org_no
)
uni
.
setStorageSync
(
"refresh_token"
,
result
.
data
.
refresh_token
)
uni
.
showToast
({
title
:
"登录成功"
,
...
...
@@ -387,6 +392,7 @@
uni
.
setStorageSync
(
"short_token"
,
result
.
data
.
short_token
)
uni
.
setStorageSync
(
"user_info"
,
result
.
data
)
uni
.
setStorageSync
(
"company_id"
,
result
.
data
.
comp_id
)
uni
.
setStorageSync
(
"org_no"
,
result
.
data
.
org_no
)
uni
.
setStorageSync
(
"refresh_token"
,
result
.
data
.
refresh_token
)
uni
.
showToast
({
title
:
"登录成功"
,
...
...
pages/mine/changeCompany/changeCompany.vue
0 → 100644
View file @
928dfa85
<
template
>
<view
class=
"content"
>
<titleBar
title=
"切换组织"
></titleBar>
<view
class=
"org-content"
>
<view
class=
"org-list"
>
<view
class=
"org-item"
v-for=
"(item,index) in list"
:key=
"index"
>
<view
class=
"org"
>
<view
class=
"name"
>
{{
item
.
company_name
}}
</view>
<view
class=
" enter"
@
click=
"itemClick(item)"
>
{{
isCurrent
(
item
)?
"当前组织"
:
"进入"
}}
</view>
</view>
</view>
</view>
</view>
</view>
</
template
>
<
script
>
import
Api
from
"../../../api/api.js"
export
default
{
data
()
{
return
{
list
:
[]
}
},
onLoad
()
{
this
.
getCompany
()
},
methods
:
{
getCompany
()
{
Api
.
getCompany
({
data
:
{
is_page
:
0
,
}
}).
then
((
result
)
=>
{
console
.
log
(
"单位列表"
,
result
);
if
(
result
.
code
==
0
)
{
this
.
list
=
result
.
data
.
list
}
})
},
isCurrent
(
item
)
{
return
item
.
company_id
==
uni
.
getStorageSync
(
"company_id"
)
},
itemClick
:
function
(
item
)
{
if
(
this
.
isCurrent
())
{
return
}
let
that
=
this
uni
.
showModal
({
title
:
'提示'
,
content
:
'确定切换到该单位?'
,
showCancel
:
true
,
confirmText
:
"切换"
,
confirmColor
:
'#1890FF'
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
that
.
switchCompany
(
item
)
}
}
})
},
switchCompany
:
function
(
company
)
{
this
.
$http
.
consolePut
({
url
:
"/api/v1/user/user/switch_company"
,
data
:
{
company_id
:
company
.
company_id
},
header
:
{
access_token
:
this
.
getToken
()
}
}).
then
((
res
)
=>
{
let
result
=
res
.
data
if
(
result
.
code
==
0
)
{
uni
.
setStorageSync
(
"token"
,
result
.
data
.
access_token
)
uni
.
setStorageSync
(
"refresh_token"
,
result
.
data
.
refresh_token
)
uni
.
setStorageSync
(
"company_id"
,
company
.
company_id
)
this
.
currentCompany
=
company
uni
.
setStorageSync
(
"user_info"
,
result
.
data
)
this
.
getUserInfo
()
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
})
},
getUserInfo
()
{
Api
.
getUserInfo
().
then
((
result
)
=>
{
if
(
result
.
code
==
0
)
{
getApp
().
globalData
.
userInfo
=
result
.
data
uni
.
navigateBack
({
delta
:
1
})
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
})
},
}
}
</
script
>
<
style
lang=
"scss"
>
.content
{
display
:
flex
;
flex-direction
:
column
;
.org-content
{
display
:
flex
;
flex-direction
:
column
;
margin
:
30
rpx
;
}
.org-item
{
padding
:
30
rpx
0
30
rpx
30
rpx
;
display
:
flex
;
flex-direction
:
column
;
border-radius
:
30
rpx
;
background-color
:
#fff
;
}
.org
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
image
{
width
:
48
rpx
;
height
:
24
rpx
;
}
.name
{
font-size
:
28
rpx
;
color
:
#333
;
margin-left
:
20
rpx
;
flex
:
1
;
font-weight
:
500
;
}
.enter
{
font-size
:
28
rpx
;
margin-right
:
30
rpx
;
color
:
#3B73FE
;
font-weight
:
600
;
}
}
}
</
style
>
pages/mine/changeOrg/changeOrg.vue
View file @
928dfa85
...
...
@@ -15,7 +15,7 @@
<view
v-if=
"tree.isOpen"
style=
"margin-top: 20rpx;"
>
<view
class=
"org-item"
v-for=
"(oneLevel,oneIndex) in tree.children_list"
:key=
"oneIndex"
>
<view
class=
"org"
>
<image
<image
v-if=
"!oneLevel.project_id"
:src=
"oneLevel.isOpen?'../../../static/icon_up_arrow.png':'../../../static/icon_drop_arrow.png'"
class=
"image"
@
click=
"toNextChild(index,oneLevel,oneIndex)"
></image>
<view
class=
"name"
@
click=
"toNextChild(index,oneLevel,oneIndex)"
>
{{
oneLevel
.
name
}}
...
...
@@ -27,7 +27,7 @@
:key=
"twoIndex"
>
<view
class=
"org"
>
<view
class=
"name"
>
{{
twoLevel
.
name
}}
</view>
<view
class=
"enter"
@
click=
"itemClick(
one
Level)"
>
进入
</view>
<view
class=
"enter"
@
click=
"itemClick(
two
Level)"
>
进入
</view>
</view>
</view>
</view>
...
...
@@ -51,11 +51,26 @@
this
.
getOrgTree
()
},
methods
:
{
dealProject
(
list
)
{
var
projects
=
[]
list
.
forEach
((
item
)
=>
{
if
(
item
.
dept_type
==
2
)
{
projects
=
projects
.
concat
(
item
.
children_list
)
}
})
console
.
log
(
"项目列表"
,
projects
);
return
projects
},
getOrgTree
()
{
Api
.
getOrgTree
().
then
((
result
)
=>
{
Api
.
getOrgTree
({
data
:
{
company_id
:
uni
.
getStorageSync
(
"company_id"
),
org_no
:
getApp
().
globalData
.
userInfo
.
user
.
org_no
}
}).
then
((
result
)
=>
{
console
.
log
(
"组织树"
,
result
);
if
(
result
.
code
==
0
)
{
this
.
trees
=
result
.
data
this
.
trees
=
result
.
data
.
list
[
0
].
children_list
}
})
},
...
...
@@ -86,7 +101,7 @@
}
this
.
$set
(
this
.
trees
[
index
].
children_list
,
oneIndex
,
item
)
},
itemClick
:
function
(
item
)
{
itemClick
:
function
(
item
,
isProject
)
{
let
that
=
this
uni
.
showModal
({
title
:
'提示'
,
...
...
@@ -96,46 +111,22 @@
confirmColor
:
'#1890FF'
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
that
.
switch
Company
(
item
)
that
.
switch
Org
(
item
)
}
}
})
},
switchCompany
:
function
(
company
)
{
this
.
$http
.
consolePut
({
url
:
"/api/v1/user/user/switch_company"
,
data
:
{
company_id
:
company
.
company_id
},
header
:
{
access_token
:
this
.
getToken
()
}
}).
then
((
res
)
=>
{
let
result
=
res
.
data
if
(
result
.
code
==
0
)
{
uni
.
setStorageSync
(
"token"
,
result
.
data
.
access_token
)
uni
.
setStorageSync
(
"refresh_token"
,
result
.
data
.
refresh_token
)
uni
.
setStorageSync
(
"company_id"
,
company
.
company_id
)
uni
.
setStorageSync
(
"org_no"
,
company
.
org_no
)
this
.
currentCompany
=
company
uni
.
setStorageSync
(
"user_info"
,
result
.
data
)
this
.
getUserInfo
()
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
})
},
getUserInfo
()
{
Api
.
getUserInfo
().
then
((
result
)
=>
{
if
(
result
.
code
==
0
)
{
getApp
().
globalData
.
userInfo
=
result
.
data
switchOrg
:
function
(
item
)
{
uni
.
setStorageSync
(
"org_no"
,
item
.
org_no
)
uni
.
setStorageSync
(
"org_name"
,
item
.
name
)
uni
.
setStorageSync
(
"org_id"
,
item
.
id
)
if
(
item
.
project_id
)
{
uni
.
setStorageSync
(
"project_id"
,
item
.
project_id
)
}
uni
.
$emit
(
"refreshOrg"
)
uni
.
navigateBack
({
delta
:
1
})
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
})
},
}
}
...
...
@@ -152,12 +143,17 @@
margin
:
30
rpx
;
}
.org-item
{
padding
:
30
rpx
0
30
rpx
30
rpx
;
.org-list
{
display
:
flex
;
flex-direction
:
column
;
border-radius
:
30
rpx
;
background-color
:
#fff
;
}
.org-item
{
padding
:
30
rpx
0
30
rpx
30
rpx
;
display
:
flex
;
flex-direction
:
column
;
}
...
...
pages/mine/mine.vue
View file @
928dfa85
...
...
@@ -40,7 +40,7 @@
<view
class=
"version-content"
>
<text
class=
"text"
>
当前版本:v1.0.0
</text>
</view>
<view
class=
"btn-org"
@
click=
"linkTo('/pages/mine/change
Org/changeOrg
')"
>
<view
class=
"btn-org"
@
click=
"linkTo('/pages/mine/change
Company/changeCompany
')"
>
<text
class=
"text"
>
切换组织
</text>
</view>
<view
class=
"btn-logout"
@
click=
"toLinkLogin"
>
...
...
pages/mine/myScore/myScore.vue
View file @
928dfa85
...
...
@@ -85,25 +85,47 @@
this
.
requestParam
.
time
=
year
+
'-'
+
month
+
'-'
+
day
this
.
requestParam
.
worker_id
=
this
.
userInfo
.
worker_id
||
''
this
.
requestParam
.
project_id
=
this
.
project
.
project_id
||
''
this
.
getScoreDetail
()
this
.
loadProject
()
},
methods
:
{
getScoreDetail
()
{
Api
.
getUserScore
({
data
:
this
.
requestParam
data
:
{
project_id
:
this
.
project
.
project_id
,
worker_id
:
getApp
().
globalData
.
userInfo
.
user
.
user_id
}
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
scoreDetail
=
res
.
data
}
})
},
loadProject
:
function
()
{
let
that
=
this
this
.
$http
.
get
({
url
:
"/api/v1/project/project_list"
,
data
:
{
is_all
:
1
,
org_no
:
uni
.
getStorageSync
(
"org_no"
)
},
header
:
{
"access_token"
:
this
.
getToken
()
}
}).
then
(
res
=>
{
let
result
=
res
.
data
console
.
log
(
"项目列表:"
,
result
);
if
(
result
.
code
===
0
)
{
this
.
project
=
result
.
data
.
list
[
0
]
}
this
.
getGoodsList
()
this
.
getScoreDetail
()
})
},
getGoodsList
()
{
Api
.
getGoodsList
({
data
:
{
is_page
:
0
,
project_id
:
this
.
project
.
project_id
,
content
:
this
.
requestParam
.
content
project_id
:
this
.
project
.
project_id
}
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
...
...
@@ -120,7 +142,6 @@
item
.
tip
=
`还差
${
goodsScore
-
userScore
}
分`
}
})
this
.
getGoodsList
()
}
})
},
...
...
Write
Preview
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
Please
register
or
sign in
to comment