score/form

master
panliang 2023-12-11 14:34:15 +08:00
parent f43d0df1a7
commit e3d658ae7b
6 changed files with 42 additions and 37 deletions

View File

@ -149,7 +149,6 @@
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
position: relative; position: relative;
padding: 15rpx 0;
} }
.rank .title { .rank .title {
font-size: 36rpx; font-size: 36rpx;

View File

@ -7,7 +7,7 @@
<u-cell title="图片"> <u-cell title="图片">
<u-album slot="label" :urls="info.images" /> <u-album slot="label" :urls="info.images" />
</u-cell> </u-cell>
<u-cell title="附件" :label="info.file"></u-cell> <u-cell title="附件" :label="info.file" isLink @click="copy(info.file)" />
<u-cell title="提交时间" :value="info.created_at"></u-cell> <u-cell title="提交时间" :value="info.created_at"></u-cell>
<u-cell title="审核状态" :value="info.check_status_text"></u-cell> <u-cell title="审核状态" :value="info.check_status_text"></u-cell>
<u-cell title="审核时间" :value="info.check_at"></u-cell> <u-cell title="审核时间" :value="info.check_at"></u-cell>
@ -37,6 +37,20 @@ export default {
this.info = res.data this.info = res.data
} }
}) })
},
copy(text) {
if (text) {
uni.setClipboardData({
data: text,
showToast: false,
success: () => {
uni.showToast({
icon: 'success',
title: '下载地址已复制',
})
}
})
}
} }
} }
} }

View File

@ -68,6 +68,13 @@
onLoad(e) { onLoad(e) {
if (e.type) { if (e.type) {
this.type = e.type this.type = e.type
this.$ajax.get(`/api/keyword/${this.type}`).then(res => {
if (res.status == 0) {
uni.setNavigationBarTitle({
title: res.data.name
})
}
})
} }
if (e.id) { if (e.id) {
this.id = e.id this.id = e.id
@ -148,7 +155,12 @@
images: this.images.length > 0 ? this.images.map(item => { return item.url }) : null, images: this.images.length > 0 ? this.images.map(item => { return item.url }) : null,
file: this.files.length > 0 ? this.files[0].url : null file: this.files.length > 0 ? this.files[0].url : null
} }
this.$ajax.post('/api/user/score', params, { custom: {loading: true} }).then(res => { this.$ajax.request({
url: this.id ? `/api/user/score/${this.id}` : '/api/user/score',
method: this.id ? 'PUT' : 'POST',
data: params,
custom: { loading: true }
}).then(res => {
if (res.status == 0) { if (res.status == 0) {
uni.showToast({ uni.showToast({
title: '提交成功', title: '提交成功',

View File

@ -55,8 +55,10 @@ export default {
listHeight: 0, listHeight: 0,
} }
}, },
onLoad() { onShow() {
this.loadData(true) this.loadData(true)
},
onLoad() {
uni.getSystemInfo({ uni.getSystemInfo({
success: (res) => { success: (res) => {
this.listHeight = res.safeArea.height - 54 this.listHeight = res.safeArea.height - 54

View File

@ -68,7 +68,7 @@
} }
} }
}, },
onLoad() { onShow() {
this.init() this.init()
}, },
methods: { methods: {
@ -90,40 +90,17 @@
this.user.rank = res.data.current.rank this.user.rank = res.data.current.rank
} }
} }
res = await this.$ajax.get('/api/keyword', { params: { key: 'score_cate_' } }) res = await this.$ajax.get('/api/user/chart-option')
let radarIndicator = [ var option = null
{ name: '政治忠诚' },
{ name: '政治定力' },
{ name: '政治担当' },
{ name: '政治能力' },
{ name: '政治自律' },
]
let radarValues = []
if (res.status == 0) { if (res.status == 0) {
radarIndicator = res.data.map(item => { option = res.data
radarValues.push(radarValue[item.key])
return {key: item.key, name: item.name}
})
} }
uni.hideLoading() uni.hideLoading()
var option = { if (option) {
radar: { this.$nextTick(() => {
indicator: radarIndicator this.chart(option)
}, })
series: [ }
{
type: 'radar',
data: [
{
value: radarValues,
}
]
}
]
};
this.$nextTick(() => {
this.chart(option)
})
}, },
chart(option) { chart(option) {
if (document.getElementById('echart')) { if (document.getElementById('echart')) {

View File

@ -11,7 +11,6 @@ export function getToken() {
} }
export function navigateTarget(option) { export function navigateTarget(option) {
console.log(option)
if (!option || !option.target_url) { if (!option || !option.target_url) {
return; return;
} }
@ -19,5 +18,7 @@ export function navigateTarget(option) {
uni.navigateTo({ uni.navigateTo({
url: option.target_url url: option.target_url
}) })
} else if (option.target_type == 'web') {
window.open(option.target_url)
} }
} }