Commit 40bad449 authored by yuwenwen's avatar yuwenwen

移动端调整

parent 28d41209
.DS_Store
node_modules/
unpackage/
dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*.log
tests/**/coverage/
tests/e2e/reports
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.local
package-lock.json
yarn.lock
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<view> <view>
<view class="dynamic-item" @click="toDynamicDetailPage"> <view class="dynamic-item" @click="toDynamicDetailPage">
<view class="user-info-box" style="position: relative;"> <view class="user-info-box" style="position: relative;">
<image class="avatar" v-if="form.avatar" :src="form.avatar"></image> <image class="avatar" v-if="form.faceImg" :src="form.faceImg" @error="imgLoadFail"></image>
<image class="avatar" v-else src="/static/images/default-avatar.png"></image> <!-- <image class="avatar" v-else src="/static/images/default-avatar.png"></image> -->
<view class="user-name">{{form.nickName}}</view> <view class="user-name">{{form.nickName}}</view>
<image v-if="deleteable || userInfo.bbsAdmin || form.isSelf==1" class="more-icon" <image v-if="deleteable || userInfo.bbsAdmin || form.isSelf==1" class="more-icon"
@click.stop="handleDelDynamics" src="/static/images/more-icon.png"></image> @click.stop="handleDelDynamics" src="/static/images/more-icon.png"></image>
...@@ -35,14 +35,20 @@ ...@@ -35,14 +35,20 @@
</view> </view>
<view class="datetime-box">{{form.createTime}}</view> <view class="datetime-box">{{form.createTime}}</view>
<view class="operation-box"> <view class="operation-box">
<view class="favorite-box"> <view class="flex-layout">
<image src="/static/images/favorite.png" v-if="form.isLike==0" class="icon" <view class="favorite-box">
@click.stop="handleUpdateLikeStatus(1)"></image> <image src="/static/images/favorite.png" v-if="form.isLike==0" class="icon"
<image src="/static/images/favorite-active.png" v-if="form.isLike==1" @click.stop="handleUpdateLikeStatus(1)"></image>
@click.stop="handleUpdateLikeStatus(0)" class="icon"></image> <image src="/static/images/favorite-active.png" v-if="form.isLike==1"
<view class="num">{{form.likeCount}}</view> @click.stop="handleUpdateLikeStatus(0)" class="icon"></image>
<view class="num">{{form.likeCount}}</view>
</view>
<view class="favorite-box ml-10">
<image src="/static/images/comment.png" class="icon"></image>
<view class="num">{{form.commentCount}}</view>
</view>
</view> </view>
<view class="comment-box" @click.stop="handleOpenComment"> <view class="comment-box" v-if="displayComment" @click.stop="handleOpenComment">
<image class="icon" src="/static/images/comment-icon.png"></image> <image class="icon" src="/static/images/comment-icon.png"></image>
<view class="text">评论</view> <view class="text">评论</view>
</view> </view>
...@@ -53,14 +59,14 @@ ...@@ -53,14 +59,14 @@
<image src="/static/images/pk-icon.png" class="pk-icon"></image> <image src="/static/images/pk-icon.png" class="pk-icon"></image>
<view class="pk-title-text">{{form.voteTitle}}</view> <view class="pk-title-text">{{form.voteTitle}}</view>
</view> </view>
<view class="pk-imgs" v-if="form.voteOptionType=='IMAGE' && form.voteOptions.length>0 "> <view class="pk-imgs" v-if="form.voteOptionType=='IMAGE'&&form.voteOptions&&form.voteOptions.length>0 ">
<template v-for="(item,index) in form.voteOptions"> <template v-for="(item,index) in form.voteOptions">
<image :src="item.imageUrl" @click.stop="preview(form.voteOptions,index)" class="img"></image> <image :src="item.imageUrl" @click.stop="preview(form.voteOptions,index)" class="img"></image>
</template> </template>
</view> </view>
<!-- 未投票 --> <!-- 未投票 -->
<view v-if="form.isVote==0"> <view v-if="form.isVote==0">
<view class="pk-btns" v-if="form.voteOptions.length>0 "> <view class="pk-btns" v-if="form.voteOptions&&form.voteOptions&&form.voteOptions.length>0 ">
<view class="btns red-btn" @click.stop="handleVote(form.voteOptions[0])"> <view class="btns red-btn" @click.stop="handleVote(form.voteOptions[0])">
{{form.voteOptions[0].name}} {{form.voteOptions[0].name}}
</view> </view>
...@@ -77,17 +83,18 @@ ...@@ -77,17 +83,18 @@
<view class="left" @click.stop="toPKDetailPage(0)"> <view class="left" @click.stop="toPKDetailPage(0)">
<view class="left-num">{{form.voteOptions[0].name}} {{form.voteOptions[0].voteCount}}</view> <view class="left-num">{{form.voteOptions[0].name}} {{form.voteOptions[0].voteCount}}</view>
</view> </view>
<view class="right" @click.stop="toPKDetailPage(1)"> <view class="left" :style="'width:' + ((form.voteOptions[0].voteCount/(form.voteOptions[0].voteCount+form.voteOptions[1].voteCount))*100)+'%'"
<view class="right-num">{{form.voteOptions[1].name}} {{form.voteOptions[1].voteCount}} @click.stop="toPKDetailPage(0)">
</view> <view class="results-item left-item"></view>
</view> </view>
</view> </view>
<view class="pk-results"> <view class="pk-results">
<view class="left" :style="'flex:' + form.voteOptions[0].voteCount" <view class="right" @click.stop="toPKDetailPage(1)">
@click.stop="toPKDetailPage(0)"> <view class="right-num">{{form.voteOptions[1].name}} {{form.voteOptions[1].voteCount}}
<view class="results-item left-item"></view> </view>
</view> </view>
<view class="right" :style="'flex:' + form.voteOptions[1].voteCount" <view class="right" :style="'width:' + ((form.voteOptions[1].voteCount/(form.voteOptions[0].voteCount+form.voteOptions[1].voteCount))*100)+'%'"
@click.stop="toPKDetailPage(1)"> @click.stop="toPKDetailPage(1)">
<view class="results-item right-item"></view> <view class="results-item right-item"></view>
</view> </view>
...@@ -99,7 +106,7 @@ ...@@ -99,7 +106,7 @@
</view> </view>
</view> </view>
<!-- 评论区 --> <!-- 评论区 -->
<view class="comment-box" v-if="form.isEnableComment==1"> <!-- <view class="comment-box" v-if="form.isEnableComment==1">
<view class="comment-display-box" v-if="form.comments&& form.comments.length>0"> <view class="comment-display-box" v-if="form.comments&& form.comments.length>0">
<view class="comment-item" v-for="(item,index) in form.comments"> <view class="comment-item" v-for="(item,index) in form.comments">
<view class="user-info"> <view class="user-info">
...@@ -124,7 +131,7 @@ ...@@ -124,7 +131,7 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view> -->
</view> </view>
<!-- 发布评论区 --> <!-- 发布评论区 -->
<publish-comment :form="form" ref="publishCommentRef" @refresh="$emit('refresh')"></publish-comment> <publish-comment :form="form" ref="publishCommentRef" @refresh="$emit('refresh')"></publish-comment>
...@@ -143,9 +150,11 @@ ...@@ -143,9 +150,11 @@
import PublishComment from './PublishComment.vue'; import PublishComment from './PublishComment.vue';
import VideoPreview from './VideoPreview.vue'; import VideoPreview from './VideoPreview.vue';
import emotions from '@/utils/emjo'; import emotions from '@/utils/emjo';
import defalutAvatar from '/static/images/default-avatar.png'
import { import {
getUserInfo getUserInfo
} from '@/utils/auth'; } from '@/utils/auth';
import {generateSignature} from '@/utils/common.js';
export default { export default {
name: "Dynamic-Item", name: "Dynamic-Item",
data() { data() {
...@@ -173,6 +182,10 @@ ...@@ -173,6 +182,10 @@
deleteable: { deleteable: {
type: Boolean, type: Boolean,
default: false default: false
},
displayComment:{
type: Boolean,
default: true
} }
}, },
watch: { watch: {
...@@ -184,6 +197,7 @@ ...@@ -184,6 +197,7 @@
return; return;
} }
this.userInfo = JSON.parse(JSON.parse(getUserInfo())) this.userInfo = JSON.parse(JSON.parse(getUserInfo()))
this.form.faceImg = generateSignature(this.userInfo.userName)
this.preNodes = this.formatContent(val) this.preNodes = this.formatContent(val)
} }
} }
...@@ -282,7 +296,24 @@ ...@@ -282,7 +296,24 @@
// 打开评论区 // 打开评论区
handleOpenComment() { handleOpenComment() {
// this.showComment = true // this.showComment = true
this.$refs.publishCommentRef.openModal() const {isEnableVote,isVote} = this.form;
// 如果开启pk,则必须先已经投票才可以评论
if(isEnableVote == 1){
if(isVote == 1){
this.$refs.publishCommentRef.openModal()
}else{
uni.showToast({
title: '请先点击上方PK按钮,选择你的观点后才可进行评论',
icon:'none',
duration:3000
})
return;
}
}else{
this.$refs.publishCommentRef.openModal()
}
}, },
// 回复评论 // 回复评论
handleReplayComment(item) { handleReplayComment(item) {
...@@ -330,6 +361,7 @@ ...@@ -330,6 +361,7 @@
uni.showToast({ uni.showToast({
title: '投票成功' title: '投票成功'
}) })
uni.$emit('hanldeDynamicRefresh')
this.$emit('refreshCurrent', this.form.id) this.$emit('refreshCurrent', this.form.id)
} }
}) })
...@@ -369,6 +401,9 @@ ...@@ -369,6 +401,9 @@
}); });
} }
}, },
imgLoadFail() {
this.userInfo.faceImg = defalutAvatar
},
//预览视频 //预览视频
videoPreview(url) { videoPreview(url) {
this.$refs.videoPreviewRef.openModal(url) this.$refs.videoPreviewRef.openModal(url)
......
...@@ -4,16 +4,22 @@ const CONFIG = { ...@@ -4,16 +4,22 @@ const CONFIG = {
debug: true, debug: true,
platformName: '社区', platformName: '社区',
requestUrl: 'http://192.168.5.177:8089', requestUrl: 'http://192.168.5.177:8089',
videoLimitSize:10 videoLimitSize: 10,
secret: '775d4e98-49d8-86d7-48c9-c93b5f7c0c16',
appId: 'jfsq',
faceBaseUrl: 'https://photo.jift.edu.cn/preview/main/'
}, },
//生产环境配置 //生产环境配置
production: { production: {
debug: false, debug: false,
platformName: '社区', platformName: '社区',
requestUrl: '/bbs/prod-api', requestUrl: '/bbs/prod-api',
videoLimitSize:10 videoLimitSize: 10,
secret: '775d4e98-49d8-86d7-48c9-c93b5f7c0c16',
appId: 'jfsq',
faceBaseUrl: 'https://photo.jift.edu.cn/preview/main/'
} }
} }
export default CONFIG[process.env.NODE_ENV]; export default CONFIG[process.env.NODE_ENV];
\ No newline at end of file
<template> <template>
<view class="detail-page-container"> <view class="detail-page-container">
<dynamic-item :form="form" @refresh="handleRefresh" @deleteSuccess="deleteSuccess"></dynamic-item> <dynamic-item :form="form" @refresh="handleRefresh" @refreshCurrent="handleRefresh" @deleteSuccess="deleteSuccess"></dynamic-item>
<!-- 评论管理区 --> <!-- 评论管理区 -->
<comment-item :form="form" ></comment-item> <comment-item :form="form" ></comment-item>
</view> </view>
......
...@@ -11,20 +11,13 @@ ...@@ -11,20 +11,13 @@
<scroll-view class="scroll-view-index" scroll-y :show-scrollbar="false" v-if="list.length>0" <scroll-view class="scroll-view-index" scroll-y :show-scrollbar="false" v-if="list.length>0"
@scrolltolower="loadMore"> @scrolltolower="loadMore">
<template v-for="(item,index) in list"> <template v-for="(item,index) in list">
<dynamic-item :form="item" @refresh="refreshContentList" <dynamic-item :form="item" :displayComment="false" @refresh="refreshContentList"
@refreshCurrent="refreshCurrent"></dynamic-item> @refreshCurrent="refreshCurrent"></dynamic-item>
</template> </template>
</scroll-view> </scroll-view>
<scroll-view class="scroll-view-index" scroll-y :show-scrollbar="false" v-else> <scroll-view class="scroll-view-index" scroll-y :show-scrollbar="false" v-else>
<list-empty></list-empty> <list-empty></list-empty>
</scroll-view> </scroll-view>
<!-- 发布按钮 -->
<!-- <movable-area class="movable-area">
<movable-view class="add-dynamic-box move-button" :x="area.x+'rpx'" :y="area.y + 'rpx'" direction="all"
@change="onChange" damping="30" @click="toPublishPage">
<image class="icon" src="/static/images/publish-icon.png"></image>
</movable-view>
</movable-area> -->
<!-- 发布按钮 --> <!-- 发布按钮 -->
<view class="add-dynamic-box" @click="toPublishPage" :style="{ left: iconLeft + 'px', top: iconTop + 'px' }" <view class="add-dynamic-box" @click="toPublishPage" :style="{ left: iconLeft + 'px', top: iconTop + 'px' }"
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
</view> </view>
</view> </view>
<view class="publish-box"> <view class="publish-box">
<textarea class="textarea" v-model="form.content" placeholder="分享有趣事~" <textarea class="textarea" v-model="form.content" placeholder="分享有趣事~" placeholder-class="placeholder-class"
placeholder-class="placeholder-class" @focus="handleFocus" /> @focus="handleFocus" />
<image-upload v-model="form.attachments" ref="uploadRef" :limit="9" :showEmjo="showEmjo" :showIcons="true" <image-upload v-model="form.attachments" ref="uploadRef" :limit="9" :showEmjo="showEmjo" :showIcons="true"
@componentsType="handleSetComponentsType" @handleTopic="handleOpenTopicSelection" @componentsType="handleSetComponentsType" @handleTopic="handleOpenTopicSelection"
@handleEmjo="handleAddEmjo"></image-upload> @handleEmjo="handleAddEmjo"></image-upload>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<!-- pk数据编辑 --> <!-- pk数据编辑 -->
<view class="pk-edit-box" v-if="form.isEnableVote==1"> <view class="pk-edit-box" v-if="form.isEnableVote==1">
<view class="textarea-box"> <view class="textarea-box">
<textarea class="textarea" v-model="form.voteTitle" maxlength="12" placeholder="请输入PK标题~(0/12)" <textarea class="textarea" v-model="form.voteTitle" maxlength="50" placeholder="请输入PK标题~(0/50)"
placeholder-class="placeholder-class" /> placeholder-class="placeholder-class" />
</view> </view>
<view class="pk-type-box"> <view class="pk-type-box">
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<label class="radio" style="margin-right: 40rpx;"> <label class="radio" style="margin-right: 40rpx;">
<radio value="TEXT" :checked="form.voteOptionType=='TEXT'" />文字PK <radio value="TEXT" :checked="form.voteOptionType=='TEXT'" />文字PK
</label> </label>
<label class="radio" > <label class="radio">
<radio value="IMAGE" :checked="form.voteOptionType=='IMAGE'" />图片PK <radio value="IMAGE" :checked="form.voteOptionType=='IMAGE'" />图片PK
</label> </label>
</radio-group> </radio-group>
...@@ -50,24 +50,26 @@ ...@@ -50,24 +50,26 @@
<view class="choice-item"> <view class="choice-item">
<image-upload v-model="voteOptionsAffirmative" :limit="1" :width="120" :height="120" <image-upload v-model="voteOptionsAffirmative" :limit="1" :width="120" :height="120"
:showIcons="false"></image-upload> :showIcons="false"></image-upload>
<input class="text" v-model="form.voteOptions[0].name" placeholder="请输入选项1(4字以内)" /> <input class="text" maxlength="16" v-model="form.voteOptions[0].name"
placeholder="请输入选项1(16字以内)" />
</view> </view>
<view class="choice-item"> <view class="choice-item">
<image-upload v-model="voteOptionsOpposing" :limit="1" :width="120" :height="120" <image-upload v-model="voteOptionsOpposing" :limit="1" :width="120" :height="120"
:showIcons="false"></image-upload> :showIcons="false"></image-upload>
<input class="text" v-model="form.voteOptions[1].name" placeholder="请输入选项2(4字以内)" /> <input class="text" maxlength="16" v-model="form.voteOptions[1].name"
placeholder="请输入选项2(16字以内)" />
</view> </view>
</view> </view>
<view class="choice-box" v-if="form.voteOptionType=='TEXT'"> <view class="choice-box" v-if="form.voteOptionType=='TEXT'">
<view class="choice-item text-item"> <view class="choice-item text-item">
<view class="label">选项1</view> <view class="label">选项1</view>
<input class="text" maxlength="4" v-model="form.voteOptions[0].name" <input class="text" maxlength="16" v-model="form.voteOptions[0].name"
placeholder="请输入选项1(4字以内)" /> placeholder="请输入选项1(16字以内)" />
</view> </view>
<view class="choice-item text-item"> <view class="choice-item text-item">
<view class="label">选项2</view> <view class="label">选项2</view>
<input class="text" maxlength="4" v-model="form.voteOptions[1].name" <input class="text" maxlength="16" v-model="form.voteOptions[1].name"
placeholder="请输入选项2(4字以内)" /> placeholder="请输入选项2(16字以内)" />
</view> </view>
</view> </view>
</view> </view>
...@@ -155,7 +157,7 @@ ...@@ -155,7 +157,7 @@
voteOptionsAffirmative: [], voteOptionsAffirmative: [],
voteOptionsOpposing: [], voteOptionsOpposing: [],
emotions, emotions,
showEmjo:false showEmjo: false
} }
}, },
components: { components: {
...@@ -176,25 +178,25 @@ ...@@ -176,25 +178,25 @@
}, },
// 当内容变化时自动更新预览 // 当内容变化时自动更新预览
watch: { watch: {
"form.content": { "form.content": {
immediate: true, immediate: true,
handler(val, oldVal) { handler(val, oldVal) {
if (val === oldVal) return; if (val === oldVal) return;
if (val && val.length < oldVal.length) { if (val && val.length < oldVal.length) {
// 计算删除的字符长度(正常退格删1个,表情需要删N个) // 计算删除的字符长度(正常退格删1个,表情需要删N个)
const deleteLen = oldVal.length - val.length; const deleteLen = oldVal.length - val.length;
// 检查删除前的末尾是否是表情,且删除长度不够(比如表情是4个字符,只删了1个) // 检查删除前的末尾是否是表情,且删除长度不够(比如表情是4个字符,只删了1个)
const sortedEmojis = [...this.emotions].sort((a, b) => b.symbol.length - a.symbol.length); const sortedEmojis = [...this.emotions].sort((a, b) => b.symbol.length - a.symbol.length);
for (const emoji of sortedEmojis) { for (const emoji of sortedEmojis) {
if (oldVal.endsWith(emoji.symbol) && deleteLen < emoji.symbol.length) { if (oldVal.endsWith(emoji.symbol) && deleteLen < emoji.symbol.length) {
// 补删剩余的表情字符(比如表情4个字符,已删1个,再删3个) // 补删剩余的表情字符(比如表情4个字符,已删1个,再删3个)
this.form.content = oldVal.slice(0, -emoji.symbol.length); this.form.content = oldVal.slice(0, -emoji.symbol.length);
break; break;
} }
} }
} }
} }
} }
}, },
methods: { methods: {
// 允许评论,开启精选等操作 // 允许评论,开启精选等操作
...@@ -274,6 +276,7 @@ ...@@ -274,6 +276,7 @@
handleCloseTopicSelection() { handleCloseTopicSelection() {
this.showTopicSelection = false, this.showTopicSelection = false,
this.topicResultList = undefined this.topicResultList = undefined
this.topicParams.name = ''
}, },
// 搜索话题 // 搜索话题
handleSearchTopic() { handleSearchTopic() {
...@@ -306,12 +309,13 @@ ...@@ -306,12 +309,13 @@
}, },
// 删除话题 // 删除话题
handleDeleteTopic(index) { handleDeleteTopic(index) {
let _this = this;
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '是否取消选择话题', content: '是否取消选择话题',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
this.topicList.splice(index, 1) _this.topicList.splice(index, 1)
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消'); console.log('用户点击取消');
} }
...@@ -320,7 +324,7 @@ ...@@ -320,7 +324,7 @@
}, },
// textarea聚焦时关闭表情窗口 // textarea聚焦时关闭表情窗口
handleFocus(){ handleFocus() {
this.$refs.uploadRef.closeEmjo() this.$refs.uploadRef.closeEmjo()
}, },
// 添加表情 // 添加表情
...@@ -330,28 +334,28 @@ ...@@ -330,28 +334,28 @@
}, },
// 删除表情 // 删除表情
deleteContent() { deleteContent() {
// 1. 处理 form.content 为空的情况,直接返回避免报错 // 1. 处理 form.content 为空的情况,直接返回避免报错
if (!this.form.content || this.form.content.trim() === '') { if (!this.form.content || this.form.content.trim() === '') {
return; return;
} }
let deleted = false; let deleted = false;
// 2. 按表情符号长度排序(长符号优先,避免短符号误匹配) // 2. 按表情符号长度排序(长符号优先,避免短符号误匹配)
const sortedEmojis = [...this.emotions].sort((a, b) => b.symbol.length - a.symbol.length); const sortedEmojis = [...this.emotions].sort((a, b) => b.symbol.length - a.symbol.length);
let lastIndex = -1; let lastIndex = -1;
// 3. 检查内容是否以某个表情符号结尾,记录最后一个表情符号的位置 // 3. 检查内容是否以某个表情符号结尾,记录最后一个表情符号的位置
for (const emoji of sortedEmojis) { for (const emoji of sortedEmojis) {
if (this.form.content.endsWith(emoji.symbol)) { if (this.form.content.endsWith(emoji.symbol)) {
lastIndex = this.form.content.lastIndexOf(emoji.symbol); lastIndex = this.form.content.lastIndexOf(emoji.symbol);
deleted = true; deleted = true;
} }
} }
// 4. 若找到表情符号,删除所有匹配的表情符号 // 4. 若找到表情符号,删除所有匹配的表情符号
if (deleted) { if (deleted) {
this.form.content = this.form.content.slice(0, lastIndex); this.form.content = this.form.content.slice(0, lastIndex);
} else { } else {
// 5. 若未匹配到表情,删除最后一个普通字符 // 5. 若未匹配到表情,删除最后一个普通字符
this.form.content = this.form.content.slice(0, -1); this.form.content = this.form.content.slice(0, -1);
} }
} }
} }
} }
......
...@@ -31,16 +31,17 @@ $common-width:94vw; ...@@ -31,16 +31,17 @@ $common-width:94vw;
// 话题容器样式 // 话题容器样式
.topic-box-common { .topic-box-common {
height: 52rpx; // height: 52rpx;
padding: 0 20rpx;
background-color: rgba(0, 123, 255, 0.1); background-color: rgba(0, 123, 255, 0.1);
color: $color-main-blue; color: $color-main-blue;
border-radius: 26rpx; font-size: 26rpx; /* 基准字体大小 */
line-height: 52rpx; padding: 10rpx 16px; /* 只左右内边距,高度由line-height决定 */
margin-right: 20rpx; border-radius: 2em; /* 1em = 16px = 高度32px的50% */
height: fit-content;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.search-box-common{ .search-box-common{
height: 76rpx; height: 76rpx;
width: $common-width; width: $common-width;
......
...@@ -70,6 +70,10 @@ ...@@ -70,6 +70,10 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.flex-layout{
display: flex;
align-items: center;
}
.favorite-box{ .favorite-box{
width: 112rpx; width: 112rpx;
height: 60rpx; height: 60rpx;
...@@ -90,6 +94,9 @@ ...@@ -90,6 +94,9 @@
color: rgba(245, 166, 35, 1); color: rgba(245, 166, 35, 1);
} }
} }
.ml-10{
margin-left: 20rpx;
}
.comment-box{ .comment-box{
display: flex; display: flex;
...@@ -122,6 +129,7 @@ ...@@ -122,6 +129,7 @@
.pk-title-text{ .pk-title-text{
color: rgba(16, 16, 16, 1); color: rgba(16, 16, 16, 1);
font-size: 24rpx; font-size: 24rpx;
width: calc(100% - 50rpx);
} }
} }
...@@ -139,10 +147,11 @@ ...@@ -139,10 +147,11 @@
.pk-btns{ .pk-btns{
margin: 20rpx 0; margin: 20rpx 0;
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.btns{ .btns{
width: 208rpx; width: 520rpx;
height: 76rpx; height: 76rpx;
line-height: 76rpx; line-height: 76rpx;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
...@@ -150,11 +159,11 @@ ...@@ -150,11 +159,11 @@
text-align: center; text-align: center;
} }
.red-btn{ .red-btn{
border-radius: 38rpx 6rpx 6rpx 38rpx; border-radius: 38rpx;
background-color: rgba(255, 100, 95, 1); background-color: rgba(255, 100, 95, 1);
} }
.blue-btn{ .blue-btn{
border-radius: 6rpx 38rpx 38rpx 6rpx; border-radius: 38rpx;
background-color: rgba(52, 132, 253, 1); background-color: rgba(52, 132, 253, 1);
} }
...@@ -175,43 +184,39 @@ ...@@ -175,43 +184,39 @@
.pk-results{ .pk-results{
margin-top: 20rpx; margin-top: 20rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
display: flex; // display: flex;
align-items: center; // align-items: center;
justify-content: space-between; // justify-content: space-between;
font-size: 24rpx; font-size: 24rpx;
.left{ .left{
width: 100%;
flex: 1;
.left-num{ .left-num{
color: rgba(255, 100, 95, 1); color: rgba(255, 100, 95, 1);
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
} }
.right{ .right{
width: 100%;
flex: 1;
text-align: right;
.right-num{ .right-num{
color: rgba(52, 132, 253, 1); color: rgba(52, 132, 253, 1);
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
} }
.results-item{ .results-item{
width: 100%; width: 100%;
height: 12rpx; height: 12rpx;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
font-size: 28rpx; font-size: 28rpx;
} }
.left-item{ .left-item{
border-radius: 6rpx 0 0 6rpx; border-radius: 6rpx;
margin-right: 10rpx; min-width: 10rpx;
background-color: rgba(255, 100, 95, 1); background-color: rgba(255, 100, 95, 1);
} }
.right-item{ .right-item{
border-radius: 0 6rpx 6rpx 0; border-radius: 6rpx;
margin-left: 10rpx; min-width: 10rpx;
background-color: rgba(52, 132, 253, 1); background-color: rgba(52, 132, 253, 1);
} }
......
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
color: rgba(187, 187, 187, 1); color: rgba(187, 187, 187, 1);
font-size: 32rpx; font-size: 32rpx;
margin-left: 32rpx; margin-left: 32rpx;
width: calc(100% - 140rpx);
} }
.label{ .label{
color: rgba(16, 16, 16, 1); color: rgba(16, 16, 16, 1);
...@@ -176,6 +177,7 @@ ...@@ -176,6 +177,7 @@
} }
.input{ .input{
margin-left: 20rpx; margin-left: 20rpx;
width: calc(100% - 50rpx);
} }
.input-class{ .input-class{
font-size: 14px; font-size: 14px;
...@@ -185,11 +187,13 @@ ...@@ -185,11 +187,13 @@
.topic-result-list{ .topic-result-list{
margin-top: 32rpx; margin-top: 32rpx;
.list-item{ .list-item{
height: 64rpx; padding: 10rpx 16rpx;
border-radius: 32rpx; border-radius: 32rpx;
background-color: rgba(245, 248, 250, 1); background-color: rgba(245, 248, 250, 1);
font-size: 26rpx; font-size: 26rpx; /* 基准字体大小 */
padding: 0 20rpx;
border-radius: 2em; /* 1em = 16px = 高度32px的50% */
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -170,4 +170,23 @@ export function getQuery(name) { ...@@ -170,4 +170,23 @@ export function getQuery(name) {
} else return decodeURIComponent(r[2]); } else return decodeURIComponent(r[2]);
} }
return null; return null;
}
import md5 from 'js-md5';
import config from '@/config/index.config.js'
export function generateSignature(userName) {
if (!userName || typeof userName !== 'string') {
throw new Error('用户名/学工号不能为空,且必须是字符串类型');
}
const timestamp = Date.now();
const appSecret = config.secret;
const appId = config.appId;
const baseUrl = config.faceBaseUrl;
const rawStr = userName + timestamp.toString() + appSecret;
const signature = md5(rawStr);
return baseUrl + userName + "?appid=" + appId + "&timestamp=" + timestamp.toString() + "&signature=" + signature;
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment