Initial commit to Gitea
This commit is contained in:
@@ -33,228 +33,166 @@
|
||||
<image :src="temp.temptele_src" alt="" class="img" mode="widthFix" />
|
||||
|
||||
</view>
|
||||
|
||||
<view class="meta">
|
||||
|
||||
<view class="author">
|
||||
<cloud-image
|
||||
height="64rpx" width="64rpx" borderRadius="50%"
|
||||
:src="userInfo.avatar_file.url"></cloud-image>
|
||||
<text class="at" :style="color">{{ userInfo.nickname || '' }}</text>
|
||||
<text class="split">·</text>
|
||||
|
||||
<text class="date" :style="color">{{ publishTime( data.publish_date) }}</text>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<view class="meta">
|
||||
<view class="author">
|
||||
<cloud-image height="64rpx" width="64rpx" borderRadius="50%"
|
||||
:src="userInfo.avatar_file.url"></cloud-image>
|
||||
<text class="at" :style="color">{{ userInfo.nickname || '' }}</text>
|
||||
<text class="split">·</text>
|
||||
|
||||
<text class="date" :style="color">{{ publishTime( data.publish_date) }}</text>
|
||||
|
||||
</view>
|
||||
<view class="" v-if="data.edit_type === 'mobile'">
|
||||
|
||||
|
||||
<view class="" v-for="(item, index) in data.cmsLst" :key="index">
|
||||
<u-parse
|
||||
:content="item.html"
|
||||
v-if="item.type === 'image' || item.type === 'video'">
|
||||
</u-parse>
|
||||
<view class="" v-if="item.type === 'image'"
|
||||
|
||||
</view>
|
||||
<view class="" v-if="data.edit_type === 'mobile'">
|
||||
|
||||
|
||||
<view class="" v-for="(item, index) in data.cmsLst" :key="index">
|
||||
<u-parse :content="item.html" v-if="item.type === 'image' || item.type === 'video'">
|
||||
</u-parse>
|
||||
<view class="" v-if="item.type === 'image'"
|
||||
style="width: 100wv;margin-top: 30rpx;margin-bottom: 30rpx;">
|
||||
<cloud-image
|
||||
width="100%"
|
||||
height="500rpx"
|
||||
mode="aspectFit"
|
||||
:src="item.image.src">
|
||||
</cloud-image>
|
||||
</view>
|
||||
<view class="" v-if="item.type === 'video'"
|
||||
<cloud-image width="100%" height="500rpx" mode="aspectFit" :src="item.image.src">
|
||||
</cloud-image>
|
||||
</view>
|
||||
<view class="" v-if="item.type === 'video'"
|
||||
style="width: 100wv;margin-top: 30rpx;margin-bottom: 30rpx;">
|
||||
<!-- <cloud-image
|
||||
<!-- <cloud-image
|
||||
width="100%"
|
||||
height="500rpx"
|
||||
mode="aspectFit"
|
||||
:src="item.video.poster">
|
||||
</cloud-image> -->
|
||||
<video
|
||||
style="width: 100%; height: 500rpx;"
|
||||
:src="item.video.src"
|
||||
enable-danmu
|
||||
danmu-btn
|
||||
<video style="width: 100%; height: 500rpx;" :src="item.video.src" enable-danmu danmu-btn
|
||||
controls>
|
||||
</video>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="" v-if="item.type === 'vote'">
|
||||
<uni-card>
|
||||
<view class="vote-container">
|
||||
<text class="vote-title">{{ item.vote.voteTitle }}</text>
|
||||
<text class="deadline">截止时间:{{ item.vote.datetime }}</text>
|
||||
<view class="" v-if="item.vote.type === voteType[0]">
|
||||
<view class="">
|
||||
<view class=""
|
||||
v-if="isSelectVoteValue[item.vote.vote_id] === true"
|
||||
v-for="(radio, radioIndex) in item.vote.voteLst">
|
||||
<text>
|
||||
{{ radio.value }}
|
||||
</text>
|
||||
|
||||
<view class="progress-container">
|
||||
|
||||
<u-line-progress
|
||||
:percentage="((selectVoteValue[item.vote.vote_id].
|
||||
all_data.selectValue[radio.value] || 0) /
|
||||
selectVoteValue[item.vote.vote_id]
|
||||
.all_data.count).toFixed(4) * 100"
|
||||
:activeColor="selectVoteValue[item.vote.vote_id].
|
||||
user_data.selectValue === radio.value ? '#3366ff' : '#66ff66'"
|
||||
:showText="true"
|
||||
class="progress"
|
||||
></u-line-progress>
|
||||
|
||||
|
||||
<text class="count-text">
|
||||
{{
|
||||
(selectVoteValue[item.vote.vote_id].
|
||||
all_data.selectValue[radio.value] || 0)
|
||||
}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="" v-if="isSelectVoteValue[item.vote.vote_id] === false">
|
||||
<u-radio-group
|
||||
v-model="selectVoteValue[item.vote.vote_id].val"
|
||||
placement="column"
|
||||
@change="groupChange"
|
||||
wrap
|
||||
>
|
||||
|
||||
<u-radio
|
||||
:customStyle="{marginBottom: '8px'}"
|
||||
v-for="(radio, radioIndex) in item.vote.voteLst"
|
||||
:key="radioIndex"
|
||||
:label="radio.value"
|
||||
:name="radio.value"
|
||||
@change="() => {this.setVoteValue(item.vote.vote_id, radio.value)}"
|
||||
style="width: 100%;"
|
||||
>
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</video>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="" v-if="item.vote.type === voteType[1]">
|
||||
</view>
|
||||
<view class="" v-if="item.type === 'vote'">
|
||||
<uni-card>
|
||||
<view class="vote-container">
|
||||
<text class="vote-title">{{ item.vote.voteTitle }}</text>
|
||||
<text class="deadline">截止时间:{{ item.vote.datetime }}</text>
|
||||
<view class="" v-if="item.vote.type === voteType[0]">
|
||||
<view class="">
|
||||
<view class=""
|
||||
v-if="isSelectVoteValue[item.vote.vote_id] === true"
|
||||
v-for="(radio, radioIndex) in item.vote.voteLst">
|
||||
v-if="isSelectVoteValue[item.vote.vote_id] === true || isExpired(item.vote.datetime)"
|
||||
v-for="(radio, radioIndex) in item.vote.voteLst">
|
||||
|
||||
<text>
|
||||
{{ radio.value }}
|
||||
</text>
|
||||
|
||||
<view class="progress-container">
|
||||
|
||||
<u-line-progress
|
||||
:percentage="((selectVoteValue[item.vote.vote_id].
|
||||
all_data.selectValue[radio.value] || 0) /
|
||||
selectVoteValue[item.vote.vote_id]
|
||||
.all_data.count).toFixed(4) * 100"
|
||||
:activeColor="selectVoteValue[item.vote.vote_id].
|
||||
user_data.selectValue === radio.value ? '#3366ff' : '#66ff66'"
|
||||
:showText="true"
|
||||
class="progress"
|
||||
></u-line-progress>
|
||||
|
||||
|
||||
<text class="count-text">
|
||||
{{
|
||||
(selectVoteValue[item.vote.vote_id].
|
||||
all_data.selectValue[radio.value] || 0)
|
||||
}}
|
||||
</text>
|
||||
<u-line-progress :percentage="(selectVoteValue[item.vote.vote_id].all_data.selectValue[radio.value] || 0) /
|
||||
selectVoteValue[item.vote.vote_id].all_data.count * 100"
|
||||
:activeColor="selectVoteValue[item.vote.vote_id].user_data.selectValue === radio.value ? '#3366ff' : '#66ff66'"
|
||||
class="progress">
|
||||
</u-line-progress>
|
||||
<text class="count-text">
|
||||
{{
|
||||
(selectVoteValue[item.vote.vote_id].
|
||||
all_data.selectValue[radio.value] || 0)
|
||||
}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="isSelectVoteValue[item.vote.vote_id] === false">
|
||||
<u-checkbox-group
|
||||
v-model="selectVoteValue[item.vote.vote_id].val"
|
||||
placement="column"
|
||||
@change="checkboxChange"
|
||||
>
|
||||
<u-checkbox
|
||||
:customStyle="{marginBottom: '8px'}"
|
||||
v-for="(checkbox, checkboxIndex) in item.vote.voteLst"
|
||||
:key="checkboxIndex"
|
||||
:label="checkbox.value"
|
||||
:name="checkbox.value"
|
||||
>
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="" v-if="item.vote.type === voteType[2]">
|
||||
<u-checkbox-group
|
||||
v-model="item.vote.selectValue"
|
||||
placement="column"
|
||||
@change="checkboxChange"
|
||||
|
||||
>
|
||||
<view class="">
|
||||
<u-checkbox
|
||||
:customStyle="{marginBottom: '8px'}"
|
||||
|
||||
<view class="" v-if="isSelectVoteValue[item.vote.vote_id] === false">
|
||||
<u-radio-group v-model="selectVoteValue[item.vote.vote_id].val"
|
||||
placement="column" @change="groupChange" wrap>
|
||||
|
||||
<u-radio :customStyle="{marginBottom: '8px'}"
|
||||
v-for="(radio, radioIndex) in item.vote.voteLst" :key="radioIndex"
|
||||
:label="radio.value" :name="radio.value"
|
||||
@change="() => {this.setVoteValue(item.vote.vote_id, radio.value)}"
|
||||
style="width: 100%;">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="" v-if="item.vote.type === voteType[1]">
|
||||
<view class="" v-if="isSelectVoteValue[item.vote.vote_id] === true"
|
||||
v-for="(radio, radioIndex) in item.vote.voteLst">
|
||||
<text>
|
||||
{{ radio.value }}
|
||||
</text>
|
||||
|
||||
<view class="progress-container">
|
||||
|
||||
|
||||
<u-line-progress :percentage="(selectVoteValue[item.vote.vote_id].all_data.selectValue[radio.value] || 0) /
|
||||
selectVoteValue[item.vote.vote_id].all_data.count * 100"
|
||||
:activeColor="selectVoteValue[item.vote.vote_id].
|
||||
user_data.selectValue === radio.value ? '#3366ff' : '#66ff66'" :showText="true"
|
||||
class="progress"></u-line-progress>
|
||||
|
||||
<text class="count-text">
|
||||
{{
|
||||
(selectVoteValue[item.vote.vote_id].
|
||||
all_data.selectValue[radio.value] || 0)
|
||||
}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="isSelectVoteValue[item.vote.vote_id] === false">
|
||||
<u-checkbox-group v-model="selectVoteValue[item.vote.vote_id].val"
|
||||
placement="column" @change="checkboxChange">
|
||||
<u-checkbox :customStyle="{marginBottom: '8px'}"
|
||||
v-for="(checkbox, checkboxIndex) in item.vote.voteLst"
|
||||
:key="checkboxIndex"
|
||||
:label="checkbox.value"
|
||||
:name="checkbox.value"
|
||||
:disabled="isCheckboxDisabled(item.vote.selectValue, checkbox.value)"
|
||||
>
|
||||
:key="checkboxIndex" :label="checkbox.value" :name="checkbox.value">
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="" v-if="item.vote.type === voteType[2]">
|
||||
<u-checkbox-group v-model="item.vote.selectValue" placement="column"
|
||||
@change="checkboxChange">
|
||||
<view class="">
|
||||
<u-checkbox :customStyle="{marginBottom: '8px'}"
|
||||
v-for="(checkbox, checkboxIndex) in item.vote.voteLst"
|
||||
:key="checkboxIndex" :label="checkbox.value" :name="checkbox.value"
|
||||
:disabled="isCheckboxDisabled(item.vote.selectValue, checkbox.value)">
|
||||
</u-checkbox>
|
||||
</view>
|
||||
|
||||
</u-checkbox-group>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<view class=""
|
||||
v-if="isExpired(item.vote.datetime)"
|
||||
style="border-top: 3rpx solid #ccc;padding-top: 20rpx;margin-top: 20rpx;
|
||||
text-align: center;;">
|
||||
已截止
|
||||
</view>
|
||||
|
||||
<view class=""
|
||||
v-else-if="!isLogin"
|
||||
@click="toLogin()"
|
||||
style="border-top: 3rpx solid #ccc;padding-top: 20rpx;margin-top: 20rpx;
|
||||
text-align: center;;">
|
||||
点击登录后投票
|
||||
</view>
|
||||
|
||||
<view class=""
|
||||
v-else-if="isLogin && isSelectVoteValue[item.vote.vote_id]"
|
||||
style="border-top: 3rpx solid #ccc;padding-top: 20rpx;margin-top: 20rpx;
|
||||
text-align: center;">
|
||||
你已投票
|
||||
</view>
|
||||
|
||||
<view class=""
|
||||
v-else
|
||||
@click="selectVote(item)"
|
||||
style="border-top: 3rpx solid #ccc;padding-top: 20rpx;margin-top: 20rpx;
|
||||
text-align: center;">
|
||||
点击投票
|
||||
</view>
|
||||
|
||||
|
||||
</u-checkbox-group>
|
||||
|
||||
</view>
|
||||
</uni-card>
|
||||
</view>
|
||||
|
||||
<view class="" v-if="isLogin && isSelectVoteValue[item.vote.vote_id] === true"
|
||||
style="border-top: 3rpx solid #ccc;padding-top: 20rpx;margin-top: 20rpx;
|
||||
text-align: center;">
|
||||
你已投票
|
||||
</view>
|
||||
<view class="" v-else-if="isExpired(item.vote.datetime)" style="border-top: 3rpx solid #ccc;padding-top: 20rpx;margin-top: 20rpx;
|
||||
text-align: center;;">
|
||||
已截止
|
||||
</view>
|
||||
<view class="" v-else-if="!isLogin" @click="toLogin()" style="border-top: 3rpx solid #ccc;padding-top: 20rpx;margin-top: 20rpx;
|
||||
text-align: center;;">
|
||||
点击登录后投票
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="" v-else @click="selectVote(item)" style="border-top: 3rpx solid #ccc;padding-top: 20rpx;margin-top: 20rpx;
|
||||
text-align: center;">
|
||||
点击投票
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</uni-card>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view v-else>
|
||||
<view>
|
||||
<view class="meta">
|
||||
@@ -262,7 +200,7 @@
|
||||
<text class="text" :style="color">{{ data.title }}</text>
|
||||
</view>
|
||||
|
||||
<!-- <view class="author" @click="toPersonalpage()">
|
||||
<!-- <view class="author" @click="toPersonalpage()">
|
||||
<template>
|
||||
<cloud-image v-if="checkUrlProtocol(data.user_id[0].avatar_file.url) === 'cloud'"
|
||||
height="64rpx" width="64rpx" borderRadius="50%"
|
||||
@@ -318,7 +256,7 @@
|
||||
</view>
|
||||
<view class="example-body" style="justify-content:center" v-for="(item, index) in cmsArticleLogList"
|
||||
:key="index">
|
||||
<view class="" v-if="item" v-for="(item1, index1) in item" :key="index1">
|
||||
<!-- <view class="" v-if="item" v-for="(item1, index1) in item" :key="index1">
|
||||
<cloud-image v-if="checkUrlProtocol(item1.user_id[0].avatar_file.url) === 'cloud'" height="64rpx"
|
||||
width="64rpx" borderRadius="50%" :src="item1.user_id[0].avatar_file.url"></cloud-image>
|
||||
<image v-else-if="checkUrlProtocol(item1.user_id[0].avatar_file.url) === 'http/https'"
|
||||
@@ -326,7 +264,7 @@
|
||||
</image>
|
||||
<image v-else src="https://qnycdn.mymoyu.top/static/avatar.jpg"
|
||||
style="width: 64rpx;height: 64rpx;border-radius: 50%;"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
|
||||
@@ -343,9 +281,8 @@
|
||||
@replyAdd="replyAdd" @getTreeComment="getTreeComment" :deleteTip="'确认删除?'" :cmData="commentData"
|
||||
v-if="commentData" :user_name_color="temp.user_name_color" :btn_color="btn_color"
|
||||
:select_icon_color="select_icon_color" :icon_color="icon_color"
|
||||
:btn_send_commends_color="btn_send_commends_color"
|
||||
:btn_send_commends_font_color="btn_send_commends_font_color"
|
||||
:icon_font_color="icon_font_color"
|
||||
:btn_send_commends_color="btn_send_commends_color"
|
||||
:btn_send_commends_font_color="btn_send_commends_font_color" :icon_font_color="icon_font_color"
|
||||
:select_font_color="select_font_color">
|
||||
</hb-comment>
|
||||
</view>
|
||||
@@ -568,7 +505,7 @@
|
||||
import mediaList from "@/components/image-grid/media-list.vue";
|
||||
import uCheckboxGroup from "@/uni_modules/uview-ui/components/u-checkbox-group/u-checkbox-group.vue";
|
||||
import uCheckbox from "@/uni_modules/uview-ui/components/u-checkbox/u-checkbox.vue";
|
||||
|
||||
|
||||
import uniNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue';
|
||||
import renderArticleDetail from "@/uni_modules/uni-cms-article/components/render-article-detail/index.vue";
|
||||
import translatePublishTime from "@/uni_modules/uni-cms-article/common/publish-time";
|
||||
@@ -672,12 +609,12 @@
|
||||
temp: {},
|
||||
isPlay: true,
|
||||
isSelectVoteValue: {
|
||||
|
||||
|
||||
},
|
||||
selectVoteValue: {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
@@ -754,14 +691,18 @@
|
||||
return this.userInfo.realNameAuth.authStatus
|
||||
},
|
||||
isLogin() {
|
||||
return this.userInfo._id?true:false;
|
||||
return this.userInfo._id ? true : false;
|
||||
},
|
||||
where() {
|
||||
return `_id =="${this.id}"`
|
||||
return {
|
||||
_id: this.id
|
||||
}
|
||||
},
|
||||
collection() {
|
||||
return [
|
||||
db.collection("uni-cms-articles").where(this.where).getTemp(),
|
||||
db.collection("uni-cms-articles").where({
|
||||
_id: this.id
|
||||
}).getTemp(),
|
||||
db.collection("uni-id-users").field('_id, nickname,avatar_file').getTemp()
|
||||
]
|
||||
},
|
||||
@@ -851,7 +792,7 @@
|
||||
methods: {
|
||||
setVoteValue(vote_id, value) {
|
||||
this.selectVoteValue[vote_id].val = value;
|
||||
|
||||
|
||||
},
|
||||
async isSelectVote(vote_id) {
|
||||
console.log(vote_id)
|
||||
@@ -867,7 +808,26 @@
|
||||
}
|
||||
},
|
||||
isExpired(voteEndTime) {
|
||||
return new Date() > new Date(voteEndTime);
|
||||
if (!voteEndTime) return false; // 处理 null/undefined
|
||||
|
||||
const endTime = new Date(voteEndTime);
|
||||
if (isNaN(endTime.getTime())) {
|
||||
console.warn('Invalid voteEndTime:', voteEndTime);
|
||||
return false; // 或根据业务需求返回 true
|
||||
}
|
||||
|
||||
return new Date() >= endTime;
|
||||
},
|
||||
async safeToFixed(value, digits = 2) {
|
||||
// 确保 value 是数字
|
||||
const num = Number(value);
|
||||
|
||||
// 检查是否是有效数字
|
||||
if (typeof num !== 'number' || isNaN(num) || !isFinite(num)) {
|
||||
return '0'.padEnd(digits + 1, '.0'); // 返回 "0.00"
|
||||
}
|
||||
|
||||
return num.toFixed(digits);
|
||||
},
|
||||
isCheckboxDisabled(arr, name) {
|
||||
console.log(arr, name)
|
||||
@@ -880,32 +840,36 @@
|
||||
console.log(this.selectVoteValue);
|
||||
console.log(e)
|
||||
},
|
||||
groupChange(n) {
|
||||
groupChange(n) {
|
||||
console.log('groupChange', n);
|
||||
},
|
||||
radioChange(n) {
|
||||
},
|
||||
radioChange(n) {
|
||||
console.log('radioChange', n);
|
||||
|
||||
},
|
||||
formatDate(date, format) {
|
||||
const map = {
|
||||
'yyyy': date.getFullYear(),
|
||||
'MM': String(date.getMonth() + 1).padStart(2, '0'),
|
||||
'dd': String(date.getDate()).padStart(2, '0'),
|
||||
'HH': String(date.getHours()).padStart(2, '0'),
|
||||
'mm': String(date.getMinutes()).padStart(2, '0'),
|
||||
'ss': String(date.getSeconds()).padStart(2, '0')
|
||||
};
|
||||
|
||||
return format.replace(
|
||||
/yyyy|MM|dd|HH|mm|ss/g,
|
||||
matched => map[matched]
|
||||
);
|
||||
},
|
||||
// 时间格式化
|
||||
formatTime() {
|
||||
return this.formatDate(new Date(), 'yyyy-MM-dd HH:mm');
|
||||
},
|
||||
|
||||
},
|
||||
formatDate(date, format) {
|
||||
const map = {
|
||||
'yyyy': date.getFullYear(),
|
||||
'MM': String(date.getMonth() + 1).padStart(2, '0'),
|
||||
'dd': String(date.getDate()).padStart(2, '0'),
|
||||
'HH': String(date.getHours()).padStart(2, '0'),
|
||||
'mm': String(date.getMinutes()).padStart(2, '0'),
|
||||
'ss': String(date.getSeconds()).padStart(2, '0')
|
||||
};
|
||||
|
||||
return format.replace(
|
||||
/yyyy|MM|dd|HH|mm|ss/g,
|
||||
matched => map[matched]
|
||||
);
|
||||
},
|
||||
// 时间格式化
|
||||
formatTime() {
|
||||
return this.formatDate(new Date(), 'yyyy-MM-dd HH:mm');
|
||||
},
|
||||
async ttt(item) {
|
||||
console.log(item)
|
||||
console.log(this.isExpired(item.vote.datetime))
|
||||
},
|
||||
async monthlyGiftChartsListLoad(data) {
|
||||
console.log(data);
|
||||
|
||||
@@ -1223,22 +1187,22 @@
|
||||
},
|
||||
async getVoteInfo(vote_id) {
|
||||
let user_id = this.userInfo._id;
|
||||
|
||||
|
||||
let query = {
|
||||
user_id: user_id,
|
||||
vote_id: vote_id
|
||||
};
|
||||
|
||||
|
||||
const res = await uniCloud.importObject("cms-vote").getVoteInfo(query);
|
||||
|
||||
|
||||
if (res.code === 200) {
|
||||
this.selectVoteValue[vote_id] = {
|
||||
user_data: res.user_data,
|
||||
all_data: res.all_data
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
async loadData(data) {
|
||||
console.log(data);
|
||||
@@ -1250,7 +1214,7 @@
|
||||
this.detail_music = data.music_url_id
|
||||
this.temp_id = data.temp_id
|
||||
if (data.edit_type === "mobile") {
|
||||
for (let i = 0 ; i < data.cmsLst.length ; i++ ) {
|
||||
for (let i = 0; i < data.cmsLst.length; i++) {
|
||||
if (data.cmsLst[i].type === "vote") {
|
||||
let vote_id = data.cmsLst[i].vote.vote_id;
|
||||
await this.isSelectVote(vote_id);
|
||||
@@ -1520,14 +1484,14 @@
|
||||
selectValue: this.selectVoteValue[vote_id].val,
|
||||
type: item.vote.type
|
||||
}
|
||||
|
||||
|
||||
const res = await uniCloud.importObject("cms-vote").add_vote(query);
|
||||
|
||||
|
||||
if (res.code === 200) {
|
||||
await this.getVoteInfo(vote_id);
|
||||
this.isSelectVoteValue[vote_id] = true;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
checkUrlProtocol(url) {
|
||||
try {
|
||||
@@ -2346,7 +2310,7 @@
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
|
||||
.order-index {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
@@ -2356,7 +2320,7 @@
|
||||
|
||||
.avatar-column {
|
||||
flex: 1;
|
||||
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
@@ -2370,7 +2334,7 @@
|
||||
|
||||
.nickname-column {
|
||||
flex: 4;
|
||||
|
||||
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
@@ -2379,7 +2343,7 @@
|
||||
|
||||
.gift-value {
|
||||
flex: 2;
|
||||
|
||||
|
||||
text-align: right;
|
||||
color: #e6a23c;
|
||||
font-weight: 500;
|
||||
@@ -2400,40 +2364,45 @@
|
||||
height: 64rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
|
||||
.grid-container {
|
||||
display: flex;
|
||||
gap: 10px; /* 列间距 */
|
||||
padding: 15px;
|
||||
background: #f5f5f5;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
/* 列间距 */
|
||||
padding: 15px;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
|
||||
.grid-item {
|
||||
flex: 1; /* 等分容器宽度 */
|
||||
min-width: 0; /* 防止内容溢出 */
|
||||
aspect-ratio: 1; /* 默认正方形 */
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
/* 等分容器宽度 */
|
||||
min-width: 0;
|
||||
/* 防止内容溢出 */
|
||||
aspect-ratio: 1;
|
||||
/* 默认正方形 */
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
.page-container {
|
||||
padding: 20rpx 0;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
|
||||
.rectangle-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
aspect-ratio: 16/9; /* 设置长方形比例 */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
aspect-ratio: 16/9;
|
||||
/* 设置长方形比例 */
|
||||
}
|
||||
|
||||
|
||||
.meta {
|
||||
|
||||
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding-top: 20rpx;
|
||||
|
||||
|
||||
.title {
|
||||
.text {
|
||||
font-size: 40rpx;
|
||||
@@ -2442,63 +2411,64 @@
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.excerpt {
|
||||
margin-top: 10rpx;
|
||||
|
||||
|
||||
.text {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.author {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
flex-direction: row;
|
||||
margin-top: 20rpx;
|
||||
|
||||
|
||||
.at,
|
||||
.split,
|
||||
.date {
|
||||
font-size: 26rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
|
||||
.split {
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.body {
|
||||
padding: 20rpx;
|
||||
|
||||
.cms-body {
|
||||
display: flex;
|
||||
min-height: 60hv;
|
||||
width: 100wv;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.v-preview {
|
||||
.img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.btn-area {
|
||||
position: relative;
|
||||
top: -50rpx;
|
||||
}
|
||||
|
||||
|
||||
.red-btn-area {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 10rpx 0;
|
||||
margin: 0 40rpx 20rpx 40rpx;
|
||||
font-size: 20rpx;
|
||||
|
||||
|
||||
.red-btn {
|
||||
position: relative;
|
||||
color: #fff;
|
||||
@@ -2508,13 +2478,13 @@
|
||||
line-height: 40rpx;
|
||||
margin: 0;
|
||||
background-image: linear-gradient(to bottom, #c11c1f, #5c0201);
|
||||
|
||||
|
||||
+.red-btn {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.red-btn-plain-area {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -2529,16 +2499,16 @@
|
||||
#b13636,
|
||||
#f44336bf,
|
||||
#fff) 1;
|
||||
|
||||
|
||||
.red-btn-plain {
|
||||
position: relative;
|
||||
color: #b13636;
|
||||
font-weight: 700;
|
||||
padding-left: 15rpx;
|
||||
|
||||
|
||||
+.red-btn-plain {
|
||||
margin-left: 10rpx;
|
||||
|
||||
|
||||
&::before {
|
||||
// border-left: 2px solid #f44336;
|
||||
content: "";
|
||||
@@ -2554,68 +2524,75 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.vote-container {
|
||||
padding: 20rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
.vote-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
display: block;
|
||||
margin-bottom: 10rpx;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
display: block;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
|
||||
.deadline {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-bottom: 30rpx;
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-bottom: 30rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
.radio-group {
|
||||
margin-bottom: 40rpx;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
|
||||
.option-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 15rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 15rpx 0;
|
||||
}
|
||||
|
||||
|
||||
.option-label {
|
||||
margin-left: 20rpx;
|
||||
font-size: 14px;
|
||||
margin-left: 20rpx;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
|
||||
.vote-btn {
|
||||
background-color: #2979FF;
|
||||
color: white;
|
||||
border-radius: 8rpx;
|
||||
font-size: 14px;
|
||||
margin-top: 30rpx;
|
||||
|
||||
&[disabled] {
|
||||
background-color: #CCCCCC;
|
||||
}
|
||||
}
|
||||
background-color: #2979FF;
|
||||
color: white;
|
||||
border-radius: 8rpx;
|
||||
font-size: 14px;
|
||||
margin-top: 30rpx;
|
||||
|
||||
&[disabled] {
|
||||
background-color: #CCCCCC;
|
||||
}
|
||||
}
|
||||
|
||||
.progress-container {
|
||||
display: flex;
|
||||
align-items: center; /* 垂直居中 */
|
||||
width: 100%; /* 父容器宽度 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* 垂直居中 */
|
||||
width: 100%;
|
||||
/* 父容器宽度 */
|
||||
}
|
||||
|
||||
.progress {
|
||||
flex: 1; /* 占据剩余空间 */
|
||||
margin-right: 16rpx; /* 与右侧计数间隔 */
|
||||
flex: 1;
|
||||
/* 占据剩余空间 */
|
||||
margin-right: 16rpx;
|
||||
/* 与右侧计数间隔 */
|
||||
}
|
||||
|
||||
.count-text {
|
||||
min-width: 80rpx; /* 防止数字换行 */
|
||||
text-align: right;
|
||||
color: #666; /* 文字颜色 */
|
||||
font-size: 24rpx;
|
||||
min-width: 80rpx;
|
||||
/* 防止数字换行 */
|
||||
text-align: right;
|
||||
color: #666;
|
||||
/* 文字颜色 */
|
||||
font-size: 24rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -12,15 +12,15 @@
|
||||
<script lang="uts">
|
||||
const db = uniCloud.databaseForJQL()
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
colList(): any[] {
|
||||
return [
|
||||
db.collection('uni-cms-articles').where("\"article_status\" == 1").field('thumbnail,title,publish_date,user_id').getTemp(), // 文章集合
|
||||
db.collection('uni-id-users').field('_id,nickname').getTemp() // 用户集合
|
||||
]
|
||||
}
|
||||
}
|
||||
export default {
|
||||
computed: {
|
||||
colList(): any[] {
|
||||
return [
|
||||
db.collection('uni-cms-articles').where({ article_status: 1 }).field('thumbnail,title,publish_date,user_id').getTemp(), // 文章集合
|
||||
db.collection('uni-id-users').field('_id,nickname').getTemp() // 用户集合
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
},
|
||||
// 连表查询,返回两个集合的查询结果
|
||||
colList() {
|
||||
if (this.colList_flag === false) {
|
||||
if (this.colList_flag === false || !this.tags_v || this.tags_v.length === 0) {
|
||||
return [
|
||||
db.collection(articleDBName).where({
|
||||
article_status: 1,
|
||||
@@ -118,7 +118,7 @@
|
||||
return [
|
||||
db.collection(articleDBName).where({
|
||||
article_status: 1,
|
||||
category_id: this.tags_v ? db.command.in(this.tags_v) : []
|
||||
category_id: db.command.in(this.tags_v)
|
||||
}).field('thumbnail,title,publish_date,user_id, excerpt').getTemp(), // 文章集合
|
||||
db.collection(userDBName).field('_id,nickname').getTemp() // 用户集合
|
||||
]
|
||||
@@ -336,4 +336,4 @@
|
||||
.pages .uni-list ::v-deep .uni-list--border:after {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user