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
50a85aa6
提交
50a85aa6
authored
1月 11, 2023
作者:
wk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
积分兑换记录
父级
f71c6784
隐藏空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
280 行增加
和
57 行删除
+280
-57
App.vue
+10
-0
common/dateUtils.js
+35
-0
components/uni-tabbar/uni-tabbar.vue
+3
-3
main.js
+2
-0
pages/gallery/app/selectUserPage/selectUserPage.vue
+2
-2
pages/gallery/gallery.vue
+16
-1
pages/gallery/nextProcessPage/nextProcessPage.vue
+7
-6
pages/index/bussConfig/bussConfig.vue
+3
-4
pages/index/index.vue
+102
-6
pages/index/newDetail/newDetail.vue
+1
-1
pages/login/joinDepartment/joinDepartment.vue
+6
-0
pages/login/joinOrg/joinOrg.vue
+5
-0
pages/login/login/login.vue
+3
-1
pages/login/wxLogin/wxLogin.vue
+10
-0
pages/mine/historyScore/historyScore.vue
+8
-9
pages/mine/mine.vue
+2
-2
pages/mine/myScore/myScore.vue
+64
-21
pages/mine/projectInfo/projectInfo.vue
+1
-1
static/add-ic.png
+0
-0
static/close-btn.png
+0
-0
static/close-ic.png
+0
-0
没有找到文件。
App.vue
View file @
50a85aa6
...
...
@@ -72,6 +72,16 @@
color
:
#FF4D4F
;
}
.image-add
{
width
:
40
rpx
;
height
:
40
rpx
;
}
.line-grey
{
height
:
2
rpx
;
background-color
:
#F5F5F5
;
}
.uni-blue-button
{
height
:
96
rpx
;
display
:
flex
;
...
...
common/dateUtils.js
0 → 100644
View file @
50a85aa6
const
$date
=
{
timeDiff
(
time
,
isBefore
)
{
var
dateTime
=
new
Date
();
var
end
=
new
Date
(
time
);
var
dateDiff
=
0
if
(
isBefore
)
{
dateDiff
=
dateTime
.
getTime
()
-
end
.
getTime
();
//时间差的毫秒数
}
else
{
dateDiff
=
end
.
getTime
()
-
dateTime
.
getTime
();
//时间差的毫秒数
}
if
(
dateDiff
>
0
)
{
return
this
.
formatDuring
(
dateDiff
)
}
else
{
return
"0秒"
}
},
formatDuring
(
mss
)
{
let
days
=
Math
.
floor
(
mss
/
(
1000
*
60
*
60
*
24
));
let
hours
=
Math
.
floor
((
mss
%
(
1000
*
60
*
60
*
24
))
/
(
1000
*
60
*
60
));
let
minutes
=
Math
.
floor
((
mss
%
(
1000
*
60
*
60
))
/
(
1000
*
60
));
let
seconds
=
Math
.
round
((
mss
%
(
1000
*
60
))
/
1000
);
if
(
days
>
0
)
{
return
days
+
"天"
+
hours
+
"小时"
+
minutes
+
"分钟"
+
seconds
+
"秒"
;
}
else
if
(
hours
>
0
)
{
return
hours
+
"小时"
+
minutes
+
"分钟"
+
seconds
+
"秒"
;
}
else
if
(
minutes
>
0
)
{
return
minutes
+
"分钟"
+
seconds
+
"秒"
;
}
else
if
(
seconds
>
0
)
{
return
seconds
+
"秒"
;
}
},
}
export
default
$date
components/uni-tabbar/uni-tabbar.vue
View file @
50a85aa6
...
...
@@ -4,7 +4,7 @@
<view
class=
"tabbar-item"
v-for=
"(item,index) in tabList"
:class=
"[item.centerItem ? 'center-item' : '']"
@
click=
"changeItem(item)"
:key=
"index"
>
<view
class=
"item-top"
:style=
"
{padding: item.id == 2?0:'10rpx'}">
<image
:src=
"tabId==item.id?item.selectIcon:item.icon"
mode=
""
></image>
<image
:src=
"tabId==item.id?item.selectIcon:item.icon"
></image>
</view>
<view
class=
"item-bottom"
:class=
"[tabId==item.id ? 'item-active' : '']"
>
<text>
{{
item
.
text
}}
</text>
...
...
@@ -173,8 +173,8 @@
.tabbar-container
.center-item
.item-top
{
flex-shrink
:
0
;
width
:
1
3
0
rpx
;
height
:
1
3
0
rpx
;
width
:
1
5
0
rpx
;
height
:
1
5
0
rpx
;
position
:
absolute
;
top
:
-50
rpx
;
/* left: calc(50% - 70rpx); */
...
...
main.js
View file @
50a85aa6
...
...
@@ -9,6 +9,8 @@ import $config from './common/config.js'
import
$mta
from
"api/mta.js"
import
$http
from
'./api/request.js'
import
$imageUtils
from
'./common/imageUtils.js'
import
$date
from
"./common/dateUtils.js"
Vue
.
prototype
.
$date
=
$date
Vue
.
prototype
.
$http
=
$http
Vue
.
prototype
.
$mta
=
$mta
Vue
.
prototype
.
$toast
=
$toast
...
...
pages/gallery/app/selectUserPage/selectUserPage.vue
View file @
50a85aa6
...
...
@@ -2,7 +2,7 @@
<view>
<view
class=
"search-form-parent"
>
<view
class=
"search-form"
>
<image
src=
"../../static/search-icon.png"
style=
"width: 40rpx;height: 40rpx;"
></image>
<image
src=
"../../
../../
static/search-icon.png"
style=
"width: 40rpx;height: 40rpx;"
></image>
<input
placeholder=
"搜索人员"
placeholder-class=
"search-placeholder"
class=
"search-input"
v-model=
"key"
@
input=
"search"
/>
</view>
...
...
@@ -28,7 +28,7 @@
</view>
<view
class=
"user-item"
v-else
>
{{
user
.
user_name
}}
(
{{
user
.
job_name
||
""
}}
)
</view>
<image
:src=
"selectIds.indexOf(user.user_id)!=-1?'../../
static/cb-big-sel.png':'
../../static/cb-big.png'"
:src=
"selectIds.indexOf(user.user_id)!=-1?'../../
../../static/cb-big-sel.png':'../../
../../static/cb-big.png'"
style=
"width: 48rpx;height: 48rpx;"
></image>
</view>
</view>
...
...
pages/gallery/gallery.vue
View file @
50a85aa6
...
...
@@ -83,7 +83,8 @@
showed
:
1
,
app_endpoint
:
2
,
is_publish
:
1
,
app_sort
:
1
app_sort
:
1
,
publish_target
:
"ydt"
},
orgName
:
""
,
mostUsed
:
{},
...
...
@@ -116,6 +117,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
getOrgTree
()
{
...
...
@@ -130,6 +133,8 @@
this
.
trees
=
result
.
data
.
list
[
0
].
children_list
this
.
orgName
=
uni
.
getStorageSync
(
"org_name"
)
||
result
.
data
.
list
[
0
].
name
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
toChangeOrg
()
{
...
...
@@ -177,6 +182,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
toAlone
(
model
,
info
)
{
...
...
@@ -223,6 +230,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
getNeedDo
()
{
...
...
@@ -235,6 +244,8 @@
}
}).
then
((
result
)
=>
{
this
.
needDoCount
=
result
.
data
.
total_count
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
getAppGroup
()
{
...
...
@@ -266,6 +277,8 @@
this
.
$toast
.
showToast
(
result
.
msg
)
}
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
getAppList
:
function
()
{
...
...
@@ -297,6 +310,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
sortGroup
:
function
(
arr
)
{
...
...
pages/gallery/nextProcessPage/nextProcessPage.vue
View file @
50a85aa6
...
...
@@ -12,15 +12,15 @@
<view
class=
"process-centent"
>
<view
style=
"display: flex;flex-direction: row;align-items: center;"
v-if=
"isShow"
>
<view
class=
"text-black-normal"
style=
"flex: 1;"
>
请选择执行人
</view>
<image
src=
"../../static/add-ic.png"
style=
"width: 40rpx;height: 40rpx;"
@
click=
"toSelectExecutor"
>
<image
src=
"../../
../
static/add-ic.png"
style=
"width: 40rpx;height: 40rpx;"
@
click=
"toSelectExecutor"
>
</image>
</view>
<view
style=
"display: flex;flex-direction: row;flex-wrap: wrap;margin-top: 20rpx;"
>
<view
v-for=
"(item,index) in executors"
:key=
"index"
:index=
"index"
@
click=
"clickItem(index)"
>
<view
class=
"label-item"
>
<text>
{{
item
.
user_name
}}
</text>
<image
src=
"../../
static/close-btn.png"
style=
"width: 40rpx;height: 40rpx;margin-left: 20rpx;
"
@
click=
"deleteExe(index)"
></image>
<image
src=
"../../
../static/close-btn.png
"
style=
"width: 40rpx;height: 40rpx;margin-left: 20rpx;"
@
click=
"deleteExe(index)"
></image>
</view>
</view>
</view>
...
...
@@ -29,15 +29,16 @@
<view
class=
"process-notice-centent"
>
<view
style=
"display: flex;flex-direction: row;align-items: center;"
>
<view
class=
"text-black-normal"
style=
"flex: 1;"
>
请选择通知人
</view>
<image
src=
"../../static/add-ic.png"
style=
"width: 40rpx;height: 40rpx;"
@
click=
"toSelectNotifier"
>
<image
src=
"../../../static/add-ic.png"
style=
"width: 40rpx;height: 40rpx;"
@
click=
"toSelectNotifier"
>
</image>
</view>
<view
style=
"display: flex;flex-direction: row;flex-wrap: wrap;margin-top: 20rpx;"
>
<view
v-for=
"(item,index) in notifiers"
:key=
"index"
:index=
"index"
@
click=
"clickItem(index)"
>
<view
class=
"label-item"
>
<text>
{{
item
.
user_name
}}
</text>
<image
src=
"../../
static/close-btn.png"
style=
"width: 40rpx;height: 40rpx;margin-left: 20rpx;
"
@
click=
"deleteNot(index)"
></image>
<image
src=
"../../
../static/close-btn.png
"
style=
"width: 40rpx;height: 40rpx;margin-left: 20rpx;"
@
click=
"deleteNot(index)"
></image>
</view>
</view>
</view>
...
...
pages/index/bussConfig/bussConfig.vue
View file @
50a85aa6
...
...
@@ -13,9 +13,7 @@
<view
class=
"app-list"
>
<view
class=
"menu-item"
v-for=
"(item,index) in selList"
:key=
"index"
>
<view
class=
"logo-content"
>
<image
:src=
"item.ydt_logo"
class=
"logo"
></image>
<image
:src=
"item.ydt_logo"
class=
"logo"
></image>
<image
src=
"../../../static/delete-ic.png"
class=
"del"
@
click=
"toDel(index)"
></image>
</view>
<view
class=
"text"
>
{{
nameLengthDeal
(
item
.
app_name
)
}}
</view>
...
...
@@ -70,7 +68,8 @@
showed
:
1
,
app_endpoint
:
2
,
is_publish
:
1
,
app_sort
:
1
app_sort
:
1
,
publish_target
:
"ydt"
},
}
},
...
...
pages/index/index.vue
View file @
50a85aa6
...
...
@@ -79,7 +79,16 @@
<image
src=
"../../static/right-arrow.png"
@
click=
"toLinkScore"
></image>
</view>
<view
class=
"score-count"
>
剩余:
{{
scoreDetail
.
integral
||
0
}}
积分
</view>
<view
class=
"record-content"
v-if=
"changeRecords.length>0"
>
<!--
<image
src=
"../../static/notice.png"
style=
"width: 20rpx;height: 20rpx;"
></image>
-->
<swiper
circular=
"true"
:autoplay=
"true"
class=
"swiper"
:vertical=
"true"
>
<swiper-item
v-for=
"(item,index) in changeRecords"
:key=
"index"
class=
"item"
>
<view
class=
"record"
>
{{
dealTimeDiff
(
item
.
created_at
)
}}
前
{{
item
.
ex_worker_name
}}
兑换了
{{
item
.
goods_name
}}
</view>
</swiper-item>
</swiper>
</view>
<view
class=
"list-content"
>
<view
class=
"left-content"
>
<view
class=
"item-content"
v-for=
"(item,index) in leftList()"
:key=
"index"
>
...
...
@@ -145,7 +154,8 @@
role
:
"VISITOR"
,
nowTime
:
""
,
project
:
{},
project_id
:
""
project_id
:
""
,
changeRecords
:
[]
}
},
onLoad
()
{
...
...
@@ -243,6 +253,7 @@
if
(
this
.
role
==
'WORKER'
)
{
this
.
getGoodsList
()
this
.
getMyScore
()
this
.
getChangeRecord
()
}
})
},
...
...
@@ -287,9 +298,21 @@
})
},
exchange
(
item
)
{
if
(
item
.
goods_integral
>
this
.
scoreDetail
.
integral
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
`积分不足,无法兑换`
,
showCancel
:
false
,
confirmText
:
"知道了"
,
confirmColor
:
"#3B73FE"
,
success
:
(
res
)
=>
{}
})
return
}
uni
.
showModal
({
title
:
'提示'
,
content
:
`使用
${
item
.
goods_integral
}
积分兑换
${
item
.
goods_name
}
`
,
confirmColor
:
"#3B73FE"
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
this
.
exchangeGood
(
item
)
...
...
@@ -306,11 +329,11 @@
},
// 兑换商品
exchangeGood
(
item
)
{
Score
Api
.
exchangeGood
({
Api
.
exchangeGood
({
data
:
{
goods_id
:
item
.
goods_id
,
worker_id
:
this
.
userInfo
.
worker
.
worker
_i
d
,
project_id
:
this
.
project
.
project
_id
,
worker_id
:
this
.
userInfo
.
worker
.
worker
I
d
,
project_id
:
this
.
project_id
,
order_num
:
1
}
}).
then
(
res
=>
{
...
...
@@ -319,7 +342,10 @@
title
:
'兑换成功'
})
this
.
getMyScore
()
this
.
getChangeRecord
()
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
getBanners
()
{
...
...
@@ -336,6 +362,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
getNews
()
{
...
...
@@ -352,6 +380,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
//获取常用应用
...
...
@@ -362,6 +392,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
getRecentlyApp
()
{
...
...
@@ -371,6 +403,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
toLinkScore
()
{
...
...
@@ -389,15 +423,41 @@
data
:
{
project_id
:
this
.
userInfo
.
worker
.
projectId
,
worker_id
:
this
.
userInfo
.
worker
.
workerId
,
time
:
date
.
getFullYear
()
+
"-"
+
date
.
getMonth
()
+
1
+
"-"
+
date
.
getDate
()
time
:
date
.
getFullYear
()
+
"-"
+
date
.
getMonth
()
+
1
+
"-"
+
date
.
getDate
()
,
}
}).
then
(
res
=>
{
console
.
log
(
"用户积分"
,
res
);
if
(
res
.
code
===
0
)
{
this
.
scoreDetail
=
res
.
data
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
getChangeRecord
()
{
Api
.
getExchangeList
({
data
:
{
project_id
:
this
.
project_id
,
type
:
1
,
is_page
:
1
,
page
:
1
,
page_size
:
10
,
order
:
"desc"
}
}).
then
((
result
)
=>
{
console
.
log
(
"兑换记录"
,
result
);
if
(
result
.
code
==
0
)
{
this
.
changeRecords
=
result
.
data
.
list
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
dealTimeDiff
(
startTime
)
{
return
this
.
$date
.
timeDiff
(
startTime
,
true
)
},
select
(
index
)
{
if
(
index
==
0
)
{
this
.
isCommonSel
=
true
...
...
@@ -425,6 +485,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
isCompShow
(
comNo
)
{
...
...
@@ -452,6 +514,7 @@
this
.
project_id
=
this
.
userInfo
.
worker
.
projectId
this
.
getGoodsList
()
this
.
getMyScore
()
this
.
getChangeRecord
()
uni
.
setStorageSync
(
"org_no"
,
this
.
userInfo
.
user
.
org_no
)
uni
.
setStorageSync
(
"org_name"
,
this
.
userInfo
.
currentProject
.
projectName
)
this
.
city
=
this
.
userInfo
.
currentProject
.
city
...
...
@@ -465,6 +528,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
toLogin
:
function
()
{
...
...
@@ -555,6 +620,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
// 用户授权
...
...
@@ -621,6 +688,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
toAlone
(
model
,
info
)
{
...
...
@@ -1106,6 +1175,33 @@
}
}
}
.record-content
{
display
:
flex
;
flex-direction
:
row
;
.swiper
{
height
:
32px
;
flex
:
1
;
.item
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
.record
{
font-family
:
"MicrosoftYaHeiUI"
;
font-weight
:
400
;
flex
:
1
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
font-size
:
24
rpx
;
color
:
#FFAA44
;
}
}
}
}
}
}
</
style
>
pages/index/newDetail/newDetail.vue
View file @
50a85aa6
...
...
@@ -11,7 +11,7 @@
</view>
<image
:src=
"newDetail.articleImg"
class=
"image"
></image>
<view
class=
"text-content"
>
<rich-text
:nodes=
"newDetail.content"
></rich-text>
<rich-text
:nodes=
"newDetail.content"
style=
"font-size: 28rpx;color: #333;"
></rich-text>
</view>
</view>
<view
class=
"other-content"
>
...
...
pages/login/joinDepartment/joinDepartment.vue
View file @
50a85aa6
...
...
@@ -101,6 +101,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
departChange
(
e
)
{
...
...
@@ -151,6 +153,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
getPost
()
{
...
...
@@ -167,6 +171,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
}
}
...
...
pages/login/joinOrg/joinOrg.vue
View file @
50a85aa6
...
...
@@ -77,10 +77,13 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
toNext
()
{
if
(
this
.
code
==
""
)
{
this
.
$toast
.
showToast
(
"请输入邀请码"
)
return
}
uni
.
navigateTo
({
...
...
@@ -141,6 +144,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
}
}
...
...
pages/login/login/login.vue
View file @
50a85aa6
...
...
@@ -92,7 +92,9 @@
if
(
code
==
0
)
{
//已绑定直接登录
this
.
directLogin
()
}
else
if
(
code
==
33199
)
{
//未绑定 去绑定
this
.
showMadel
()
uni
.
navigateTo
({
url
:
"/pages/login/wxLogin/wxLogin"
})
}
else
{
//其他错误
uni
.
showToast
({
title
:
res
.
data
.
msg
,
...
...
pages/login/wxLogin/wxLogin.vue
View file @
50a85aa6
...
...
@@ -68,6 +68,8 @@
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
authLogin
()
{
...
...
@@ -148,6 +150,8 @@
icon
:
'none'
})
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
showMadel
:
function
()
{
...
...
@@ -191,6 +195,8 @@
url
:
"/pages/index/index"
})
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
directLogin
:
function
()
{
...
...
@@ -218,6 +224,8 @@
icon
:
'none'
})
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
login
()
{
...
...
@@ -244,6 +252,8 @@
let
result
=
res
.
data
console
.
log
(
result
);
_this
.
unique_token
=
result
.
unique_token
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
});
...
...
pages/mine/historyScore/historyScore.vue
View file @
50a85aa6
...
...
@@ -30,9 +30,7 @@
</
template
>
<
script
>
// import {
// ScoreApi
// } from '../../services/Score/index.js'
import
Api
from
"../../../api/api.js"
export
default
{
data
()
{
return
{
...
...
@@ -49,15 +47,15 @@
}
},
onShow
()
{
//监听页面显示
this
.
userInfo
=
uni
.
getStorageSync
(
'userInfo'
)
this
.
project
=
uni
.
getStorageSync
(
'userProject'
)
||
{}
this
.
userInfo
=
getApp
().
globalData
.
userInfo
this
.
project
_id
=
this
.
userInfo
.
currentProject
.
projectId
let
date
=
new
Date
()
let
year
=
date
.
getFullYear
()
let
month
=
date
.
getMonth
()
+
1
let
day
=
date
.
getDate
()
this
.
requestParam
.
time
=
year
+
'-'
+
month
+
'-'
+
day
this
.
requestParam
.
worker_id
=
this
.
userInfo
.
worker
_id
this
.
requestParam
.
project_id
=
this
.
project
.
project_id
this
.
requestParam
.
worker_id
=
this
.
userInfo
.
worker
.
workerId
||
''
this
.
requestParam
.
project_id
=
this
.
project
_id
||
''
this
.
getScoreDetail
()
//暂时先注释掉02.16
// for(var i=0;i
<
100
;
i
++
){
//历史明细假数据
// this.scoreDetail.listData.push({id:i+1,time:'2022-02-16',item_name:'csy'+(i+1),integral:i+1})
...
...
@@ -72,7 +70,7 @@
},
// 获取积分数据
getScoreDetail
()
{
Score
Api
.
getUserScore
({
Api
.
getUserScore
({
data
:
this
.
requestParam
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
...
...
@@ -124,7 +122,8 @@
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
height
:
104
rpx
;
padding
:
30
rpx
;
border-radius
:
30
rpx
;
position
:
relative
;
border-bottom
:
1px
solid
rgba
(
$
color
:
#999
,
$
alpha
:
0.5
);
...
...
pages/mine/mine.vue
View file @
50a85aa6
...
...
@@ -6,8 +6,8 @@
<view
class=
"info-content"
:style=
"
{top:statusBarHeight+45+'px'}">
<image
src=
"../../static/mine-bg.png"
class=
"image"
></image>
<view
class=
"company"
>
{{
currentJob
.
org_name
||
""
}}
</view>
<view
class=
"name"
>
{{
userInfo
.
user
.
user_name
}}
{{
currentJob
.
job_name
}}
</view>
<view
class=
"project"
>
{{
currentJob
.
dept_name
}}
</view>
<view
class=
"name"
>
{{
userInfo
.
user
.
user_name
||
""
}}
{{
currentJob
.
job_name
||
""
}}
</view>
<view
class=
"project"
>
{{
currentJob
.
dept_name
||
""
}}
</view>
<image
src=
"../../static/avatar-def.png"
class=
"avatar"
></image>
</view>
</view>
...
...
pages/mine/myScore/myScore.vue
View file @
50a85aa6
...
...
@@ -6,7 +6,7 @@
<view
class=
"score-content"
:style=
"
{top:statusBarHeight+53+'px'}">
<image
src=
"../../../static/ic-coin.png"
class=
"image"
></image>
<view
class=
"score-count-content"
>
<view
class=
"count"
>
{{
score
}}
</view>
<view
class=
"count"
>
{{
score
Detail
.
integral
||
0
}}
</view>
<view
class=
"unit"
>
积分
</view>
</view>
<view
class=
"history-content"
@
click=
"toHistory"
>
...
...
@@ -25,25 +25,23 @@
<view
class=
"list-content"
>
<view
class=
"left-content"
>
<view
class=
"item-content"
v-for=
"(item,index) in leftList()"
:key=
"index"
>
<image
class=
"image"
src=
"https://img.alicdn.com/imgextra/i1/27493396/O1CN013NYTVu1axPeymS1yi_!!0-saturn_solar.jpg_468x468q75.jpg_.webp"
>
<image
class=
"image"
:src=
"item.goods_img"
>
</image>
<view
class=
"count"
>
500
积分可兑换
</view>
<view
class=
"count"
>
{{
item
.
goods_integral
}}
积分可兑换
</view>
<view
class=
"name-content"
>
<view
class=
"name"
>
XXX牌雨伞XXX牌雨伞XXX牌雨伞XXX牌雨伞
</view>
<image
src=
"../../../static/exchange.png"
class=
"image"
></image>
<view
class=
"name"
>
{{
item
.
goods_name
}}
</view>
<image
src=
"../../../static/exchange.png"
class=
"image"
@
click=
"exchange(item)"
></image>
</view>
</view>
</view>
<view
class=
"right-content"
>
<view
class=
"item-content"
v-for=
"(item,index) in rightList()"
:key=
"index"
>
<image
class=
"image"
src=
"https://bkimg.cdn.bcebos.com/pic/8718367adab44aedf44fb8c1b11c8701a18bfb96?x-bce-process=image/watermark,image_d2F0ZXIvYmFpa2U4MA==,g_7,xp_5,yp_5"
>
<image
class=
"image"
:src=
"item.goods_img"
>
</image>
<view
class=
"count"
>
500
积分可兑换
</view>
<view
class=
"count"
>
{{
item
.
goods_integral
}}
积分可兑换
</view>
<view
class=
"name-content"
>
<view
class=
"name"
>
XXX牌雨伞XXX牌雨伞XXX牌雨伞XXX牌雨伞
</view>
<image
src=
"../../../static/exchange.png"
class=
"image"
></image>
<view
class=
"name"
>
{{
item
.
goods_name
}}
</view>
<image
src=
"../../../static/exchange.png"
class=
"image"
@
click=
"exchange(item)"
></image>
</view>
</view>
</view>
...
...
@@ -76,15 +74,15 @@
onLoad
(
option
)
{
const
info
=
uni
.
getSystemInfoSync
()
this
.
statusBarHeight
=
info
.
statusBarHeight
this
.
userInfo
=
uni
.
getStorageSync
(
'userInfo'
)
this
.
project
=
uni
.
getStorageSync
(
'userProject'
)
||
{}
this
.
userInfo
=
getApp
().
globalData
.
userInfo
this
.
project
_id
=
this
.
userInfo
.
currentProject
.
projectId
let
date
=
new
Date
()
let
year
=
date
.
getFullYear
()
let
month
=
date
.
getMonth
()
+
1
let
day
=
date
.
getDate
()
this
.
requestParam
.
time
=
year
+
'-'
+
month
+
'-'
+
day
this
.
requestParam
.
worker_id
=
this
.
userInfo
.
worker
_i
d
||
''
this
.
requestParam
.
project_id
=
this
.
project
.
project
_id
||
''
this
.
requestParam
.
worker_id
=
this
.
userInfo
.
worker
.
workerI
d
||
''
this
.
requestParam
.
project_id
=
this
.
project_id
||
''
this
.
getGoodsList
()
this
.
getScoreDetail
()
},
...
...
@@ -92,22 +90,20 @@
getScoreDetail
()
{
var
date
=
new
Date
()
Api
.
getUserScore
({
data
:
{
project_id
:
getApp
().
globalData
.
userInfo
.
worker
.
projectId
,
worker_id
:
getApp
().
globalData
.
userInfo
.
worker
.
workerId
,
time
:
date
.
getFullYear
()
+
"-"
+
date
.
getMonth
()
+
1
+
"-"
+
date
.
getDate
()
}
data
:
this
.
requestParam
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
scoreDetail
=
res
.
data
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
getGoodsList
()
{
Api
.
getGoodsList
({
data
:
{
is_page
:
0
,
project_id
:
getApp
().
globalData
.
userInfo
.
worker
.
projectI
d
project_id
:
this
.
project_i
d
}
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
...
...
@@ -125,6 +121,8 @@
}
})
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
toHistory
()
{
...
...
@@ -150,6 +148,51 @@
}
return
list
},
exchange
(
item
)
{
if
(
item
.
goods_integral
>
this
.
scoreDetail
.
integral
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
`积分不足,无法兑换`
,
showCancel
:
false
,
confirmText
:
"知道了"
,
confirmColor
:
"#3B73FE"
,
success
:
(
res
)
=>
{}
})
return
}
uni
.
showModal
({
title
:
'提示'
,
content
:
`使用
${
item
.
goods_integral
}
积分兑换
${
item
.
goods_name
}
`
,
confirmColor
:
"#3B73FE"
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
this
.
exchangeGood
(
item
)
}
else
if
(
res
.
cancel
)
{
}
}
})
},
// 兑换商品
exchangeGood
(
item
)
{
Api
.
exchangeGood
({
data
:
{
goods_id
:
item
.
goods_id
,
worker_id
:
this
.
userInfo
.
worker
.
workerId
,
project_id
:
this
.
project_id
,
order_num
:
1
}
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
uni
.
showToast
({
title
:
'兑换成功'
})
this
.
getScoreDetail
()
}
},
(
err
)
=>
{
this
.
$toast
.
showToast
(
err
.
msg
)
})
},
}
}
</
script
>
...
...
pages/mine/projectInfo/projectInfo.vue
View file @
50a85aa6
...
...
@@ -49,7 +49,7 @@
</view>
<view
class=
"model-view"
:style=
"showModal?'':'display:none;'"
>
<view
class=
"model-out-box"
>
<view
class=
"text-black-normal"
>
{{
curTitle
}}
</view>
<view
class=
"text-black-normal"
v-if=
"false"
>
{{
curTitle
}}
</view>
<view
class=
"model-content"
>
<canvas
canvas-id=
"qrcode"
style=
"margin: 40rpx;"
></canvas>
</view>
...
...
static/add-ic.png
View file @
50a85aa6
343 Bytes
|
W:
|
H:
1.1 KB
|
W:
|
H:
2-up
Swipe
Onion skin
static/close-btn.png
0 → 100644
View file @
50a85aa6
1.2 KB
static/close-ic.png
0 → 100644
View file @
50a85aa6
1.1 KB
Write
Preview
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
Please
register
or
sign in
to comment