1
This commit is contained in:
parent
6b0e104d51
commit
9127778c6f
@ -1,15 +1,11 @@
|
||||
import upload from '@/utils/upload'
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 根据code查分类树
|
||||
export function getCatgByCode(code) {
|
||||
const data = {
|
||||
oldPassword,
|
||||
newPassword
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/profile/updatePwd',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 根据条件查询通告列表
|
||||
export function getNoticeList(params) {
|
||||
return request({
|
||||
url: '/busi/notice/appList',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
@ -2,45 +2,51 @@
|
||||
<view class="dl-components">
|
||||
<view v-for="(item,index) in dataList" class="dl-notice-box">
|
||||
<view class="dl-notice-title">
|
||||
<image class="dl-image" src="@/static/index/xiaohongshu.png" mode="aspectFit"></image>
|
||||
<view class="dl-text">某品牌鞋子上海、宁波博主探店招募某品牌鞋子上海、宁波博主探店招募</view>
|
||||
<image class="dl-image" :src="'/static/platform/'+item.platformCode+'.png'" mode="aspectFit"></image>
|
||||
<view class="dl-text">{{item.title}}</view>
|
||||
</view>
|
||||
<view class="dl-notice-content">
|
||||
<view class="left-text">
|
||||
<view class="text-item">
|
||||
<image class="dl-icon" src="@/static/index/money.png" mode="aspectFit"></image>
|
||||
<view class="dl-content">奖励:¥30-400</view>
|
||||
<view v-if="0==item.feeUp" class="dl-content">奖励:无稿费</view>
|
||||
<view v-else class="dl-content">奖励:¥{{item.feeDown}}-{{item.feeUp}}</view>
|
||||
</view>
|
||||
<view class="text-item">
|
||||
<image class="dl-icon" src="@/static/index/my.png" mode="aspectFit"></image>
|
||||
<view class="dl-content">粉丝:1K-10w</view>
|
||||
<view class="dl-content">
|
||||
粉丝:{{formatNumberWithUnits(item.fansDown)}}-{{formatNumberWithUnits(item.fansUp)}}</view>
|
||||
</view>
|
||||
<view class="text-item" style="border-bottom: 1rpx solid #F4F4F4;padding-bottom: 17rpx;">
|
||||
<view class="text-item" style="border-bottom: 1rpx solid #F4F4F4;padding-bottom: 10rpx;">
|
||||
<image class="dl-icon" src="@/static/index/xing.png" mode="aspectFit"></image>
|
||||
<view class="dl-content">类型:时尚 探店 运动 颜值</view>
|
||||
<view class="dl-content">类型:{{item.bloggerTypesText}}</view>
|
||||
</view>
|
||||
<view class="text-item" style="padding-top: 20rpx;">
|
||||
<view class="text-item" style="padding-top: 10rpx;">
|
||||
<view class="item-box" style="width: 40%;">
|
||||
<image class="dl-icon2" src="@/static/images/profile.jpg" mode="aspectFit"></image>
|
||||
<view class="dl-item-right">资深Pr资深</view>
|
||||
<image class="dl-icon2" :src="imageUrl+item.avatar" mode="aspectFit"></image>
|
||||
<view class="dl-item-right">{{item.userNickName}}</view>
|
||||
</view>
|
||||
<view class="item-box">
|
||||
<image class="dl-icon3" src="@/static/index/person.png" mode="aspectFit"></image>
|
||||
<view class="dl-item-right dl-number">659</view>
|
||||
<view class="dl-item-right dl-number">{{item.reportNum}}</view>
|
||||
</view>
|
||||
<view class="item-box">
|
||||
<image class="dl-icon3" src="@/static/index/eye.png" mode="aspectFit"></image>
|
||||
<view class="dl-item-right dl-number">659</view>
|
||||
<view class="dl-item-right dl-number">{{item.viewNum}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<image class="right-image" src="@/static/images/profile.jpg" mode="aspectFit"></image>
|
||||
<image class="right-image" :src="imageUrl+item.mainImage" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
formatNumberWithUnits
|
||||
} from '@/utils/common.js'
|
||||
import config from '@/config'
|
||||
export default {
|
||||
props: {
|
||||
dataList: {
|
||||
@ -50,11 +56,13 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
imageUrl: config.baseUrl
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
formatNumberWithUnits(number) {
|
||||
return formatNumberWithUnits(number)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -67,7 +75,7 @@
|
||||
.dl-notice-box {
|
||||
font-size: 29rpx;
|
||||
width: 100%;
|
||||
padding: 20rpx;
|
||||
padding: 18rpx;
|
||||
background-color: white;
|
||||
border-radius: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
@ -75,7 +83,7 @@
|
||||
.dl-notice-title {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
padding-bottom: 20rpx;
|
||||
padding-bottom: 10rpx;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@ -93,35 +101,37 @@
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
.dl-notice-content{
|
||||
|
||||
.dl-notice-content {
|
||||
font-size: 27rpx;
|
||||
display: flex;
|
||||
color: #363636;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.left-text{
|
||||
|
||||
.left-text {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-right: 10rpx;
|
||||
|
||||
.text-item{
|
||||
|
||||
.text-item {
|
||||
display: flex;
|
||||
padding: 5rpx;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.dl-icon{
|
||||
|
||||
.dl-icon {
|
||||
flex: none;
|
||||
width: 40rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
.dl-content{
|
||||
|
||||
.dl-content {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@ -129,43 +139,48 @@
|
||||
width: 100%;
|
||||
padding-left: 15rpx;
|
||||
}
|
||||
.item-box{
|
||||
|
||||
.item-box {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.dl-icon2{
|
||||
|
||||
.dl-icon2 {
|
||||
flex: none;
|
||||
width: 40rpx;
|
||||
height: 44rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.dl-icon3{
|
||||
|
||||
.dl-icon3 {
|
||||
flex: none;
|
||||
width: 30rpx;
|
||||
height: 29rpx;
|
||||
}
|
||||
.dl-item-right{
|
||||
|
||||
.dl-item-right {
|
||||
flex: 1;
|
||||
padding-left: 10rpx;
|
||||
min-width: 0;
|
||||
min-width: 100rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
.dl-number{
|
||||
|
||||
.dl-number {
|
||||
font-size: 26rpx;
|
||||
margin-right: 5rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.right-image{
|
||||
|
||||
.right-image {
|
||||
flex: none;
|
||||
width: 230rpx;
|
||||
height: 230rpx;
|
||||
width: 220rpx;
|
||||
height: 220rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
126
utils/common.js
126
utils/common.js
@ -1,4 +1,9 @@
|
||||
import { getJSONData,setJSONData,removeJSONData,setStrData } from '@/utils/auth'
|
||||
import {
|
||||
getJSONData,
|
||||
setJSONData,
|
||||
removeJSONData,
|
||||
setStrData
|
||||
} from '@/utils/auth'
|
||||
// 用户权益code
|
||||
const UserRightsKey = 'User-Rights'
|
||||
//用户当前身份code
|
||||
@ -12,7 +17,7 @@ export function hasRights(code) {
|
||||
let userRights = getJSONData(UserRightsKey)
|
||||
//默认无权限
|
||||
let rtnData = false
|
||||
if(''!=userRights && userRights.con){
|
||||
if ('' != userRights && userRights.con) {
|
||||
|
||||
}
|
||||
return rtnData
|
||||
@ -23,60 +28,89 @@ export function hasRights(code) {
|
||||
* @param {Object} value 身份值
|
||||
*/
|
||||
export function changeUserType(value) {
|
||||
setStrData(UserTypeKey,value)
|
||||
setStrData(UserTypeKey, value)
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示消息提示框
|
||||
* @param content 提示的标题
|
||||
*/
|
||||
* 显示消息提示框
|
||||
* @param content 提示的标题
|
||||
*/
|
||||
export function toast(content) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: content
|
||||
})
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: content
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示模态弹窗
|
||||
* @param content 提示的标题
|
||||
*/
|
||||
* 显示模态弹窗
|
||||
* @param content 提示的标题
|
||||
*/
|
||||
export function showConfirm(content) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: content,
|
||||
cancelText: '取消',
|
||||
confirmText: '确定',
|
||||
success: function(res) {
|
||||
resolve(res)
|
||||
}
|
||||
})
|
||||
})
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: content,
|
||||
cancelText: '取消',
|
||||
confirmText: '确定',
|
||||
success: function(res) {
|
||||
resolve(res)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数处理
|
||||
* @param params 参数
|
||||
*/
|
||||
* 参数处理
|
||||
* @param params 参数
|
||||
*/
|
||||
export function tansParams(params) {
|
||||
let result = ''
|
||||
for (const propName of Object.keys(params)) {
|
||||
const value = params[propName]
|
||||
var part = encodeURIComponent(propName) + "="
|
||||
if (value !== null && value !== "" && typeof (value) !== "undefined") {
|
||||
if (typeof value === 'object') {
|
||||
for (const key of Object.keys(value)) {
|
||||
if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') {
|
||||
let params = propName + '[' + key + ']'
|
||||
var subPart = encodeURIComponent(params) + "="
|
||||
result += subPart + encodeURIComponent(value[key]) + "&"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result += part + encodeURIComponent(value) + "&"
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
let result = ''
|
||||
for (const propName of Object.keys(params)) {
|
||||
const value = params[propName]
|
||||
var part = encodeURIComponent(propName) + "="
|
||||
if (value !== null && value !== "" && typeof(value) !== "undefined") {
|
||||
if (typeof value === 'object') {
|
||||
for (const key of Object.keys(value)) {
|
||||
if (value[key] !== null && value[key] !== "" && typeof(value[key]) !== 'undefined') {
|
||||
let params = propName + '[' + key + ']'
|
||||
var subPart = encodeURIComponent(params) + "="
|
||||
result += subPart + encodeURIComponent(value[key]) + "&"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result += part + encodeURIComponent(value) + "&"
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* 数字单位转换
|
||||
* @param {Object} num
|
||||
*/
|
||||
export function formatNumberWithUnits(num) {
|
||||
const units = ['', 'k', 'w', 'kw'];
|
||||
const absNum = Math.abs(num); // 获取绝对值以处理负数
|
||||
// 处理小于1000的情况,直接返回原数字的字符串形式
|
||||
if (absNum < 1000) {
|
||||
return absNum.toString();
|
||||
}
|
||||
|
||||
// 寻找合适的单位
|
||||
let unitIndex = 0;
|
||||
if (absNum > 10000000) {
|
||||
absNum /= 10000000;
|
||||
unitIndex = 3;
|
||||
} else if (absNum > 10000) {
|
||||
absNum /= 10000;
|
||||
unitIndex = 2;
|
||||
} else if (absNum > 1000) {
|
||||
absNum /= 1000;
|
||||
unitIndex = 1;
|
||||
}
|
||||
// 格式化数字,并添加单位
|
||||
const formattedNum = absNum.toFixed(2).replace(/\.?0+$/, ''); // 保留两位小数并去除末尾的零
|
||||
return formattedNum + units[unitIndex];
|
||||
}
|
Loading…
Reference in New Issue
Block a user