api
This commit is contained in:
parent
dc69746320
commit
dc72f79ee8
18
README.md
18
README.md
@ -32,3 +32,21 @@
|
||||
- master分支将开启保护 请使用gitea合并功能
|
||||
- 每人各自工作分支 每天合并
|
||||
- 合并请及时拉取处理冲突
|
||||
## 公共函数
|
||||
```javascript
|
||||
/**
|
||||
* 转义富文本标签
|
||||
* @param { String } temp 后台返回需要处理的富文本
|
||||
* @return { String } 处理好的富文本
|
||||
*/
|
||||
unescapeHTML(temp){}
|
||||
|
||||
/**
|
||||
* php时间戳转为格式化日期
|
||||
* @param { String } timestamp 必填 php 返回的时间戳
|
||||
* @param { String } spacer 可选 日期间隔符,默认 '-'
|
||||
* @param { String } end 可选 年月日时分秒截止位置,默认 day,可传 second
|
||||
* @return { String } 格式化日期
|
||||
*/
|
||||
timestampToDate({timestamp, spacer = '-', end = 'day'} = {}) {}
|
||||
```
|
@ -11,6 +11,12 @@ export default {
|
||||
is_video_img: is_video_img,
|
||||
});
|
||||
},
|
||||
// 发现详情
|
||||
getArticleInfo({ article_id }){
|
||||
return vm.$u.post('article/articleInfo', {
|
||||
article_id: article_id,
|
||||
});
|
||||
},
|
||||
// 发现(取消)点赞
|
||||
articleLike({ article_id }) {
|
||||
return vm.$u.post('article/articleLike', {
|
||||
@ -34,6 +40,21 @@ export default {
|
||||
getRecommendList(){
|
||||
return vm.$u.post('MemberExpert/recommendList');
|
||||
},
|
||||
// 达人(搜索)列表
|
||||
getExpertList({ page, store_id, live_status, like_nickname }){
|
||||
return vm.$u.post('MemberExpert/expertList', {
|
||||
page: page,
|
||||
store_id: store_id,
|
||||
live_status: live_status,
|
||||
like_nickname: like_nickname,
|
||||
});
|
||||
},
|
||||
// 达人详情
|
||||
getExpertInfo({ member_id }){
|
||||
return vm.$u.post('MemberExpert/expertInfo', {
|
||||
member_id: member_id,
|
||||
});
|
||||
},
|
||||
// 获取商城首页信息(顶部轮播图与商品分类)
|
||||
getShopTopList(){
|
||||
return vm.$u.post('Shop/getShopTopList');
|
||||
|
@ -168,14 +168,16 @@ export default {
|
||||
getPointslogList() {
|
||||
return vm.$u.post('member/pointslogList');
|
||||
},
|
||||
// 商品收藏列表
|
||||
getGoodsFavoritesList() {
|
||||
return vm.$u.post('Member/getFavoritesList');
|
||||
// 收藏列表 商品 不传值;店铺 type: 2
|
||||
getFavoritesList({ type = undefined } = {}) {
|
||||
let params = {};
|
||||
if(type) Object.assign(params, {type: type})
|
||||
return vm.$u.post('Member/getFavoritesList', params);
|
||||
},
|
||||
// 店铺收藏列表
|
||||
getStoreFavoritesList({ type }) {
|
||||
return vm.$u.post('Member/getFavoritesList', {
|
||||
type: type,
|
||||
// 取消收藏(商品/店铺)
|
||||
removeFavorite({ id }) {
|
||||
return vm.$u.post('Member/removeFavorite', {
|
||||
id: id
|
||||
});
|
||||
},
|
||||
// 设置-用户信息
|
||||
@ -191,6 +193,14 @@ export default {
|
||||
birthday: birthday,
|
||||
});
|
||||
},
|
||||
// 设置-关于我们
|
||||
aboutUsInfo() {
|
||||
return vm.$u.post('Setting/AboutUsInfo');
|
||||
},
|
||||
// 设置-证照中心
|
||||
certificateInfo() {
|
||||
return vm.$u.post('Setting/CertificateInfo');
|
||||
},
|
||||
// 用户浏览记录
|
||||
getBrowseList() {
|
||||
return vm.$u.post('Member/BrowseList');
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="daren-item">
|
||||
<view class="daren-item" @click="toDetailsPage">
|
||||
<image class="head" :src="info.member_avatar"></image>
|
||||
<text class="name">{{ info.member_nickname }}</text>
|
||||
<text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text>
|
||||
@ -11,7 +11,17 @@ export default {
|
||||
name:"daren-item",
|
||||
props: {
|
||||
info: Object,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toDetailsPage() {
|
||||
this.$u.route({
|
||||
url: '',
|
||||
params: {
|
||||
name: 'lisa'
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="video-item" v-if="item">
|
||||
<view class="video-item" v-if="item" @click="toDetailsPage">
|
||||
<image class="head" :src="item.article_pic"></image>
|
||||
<view class="title" v-if="!isguanzhu">{{ item.article_title }}</view>
|
||||
<view class="jianjie">{{ item.article_content }}</view>
|
||||
@ -8,7 +8,7 @@
|
||||
<image :src="item.member_avatar"></image>
|
||||
<text>{{ item.member_nickname }}</text>
|
||||
</view>
|
||||
<image src="/static/image/common/4.png" @click="showAction"></image>
|
||||
<image src="/static/image/common/4.png" @click.stop="showAction"></image>
|
||||
<view class="action" v-if="show == item.article_id">
|
||||
<view class="bubble">
|
||||
<view @click="articleLike">
|
||||
@ -210,6 +210,9 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetailsPage() {
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
@ -6,7 +6,7 @@
|
||||
:index='index'
|
||||
:show="item.show"
|
||||
:options="options"
|
||||
@click="click"
|
||||
@click="removeFavorite"
|
||||
@open="open"
|
||||
>
|
||||
<view class="item u-border-bottom">
|
||||
@ -60,16 +60,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getGoodsFavoritesList() {
|
||||
this.$u.api.getGoodsFavoritesList().then(res => {
|
||||
if(res.errCode == 0) {
|
||||
|
||||
}
|
||||
|
||||
this.$u.api.getFavoritesList().then(res => {
|
||||
if(res.errCode == 0) {}
|
||||
})
|
||||
},
|
||||
click(index) {
|
||||
this.list.splice(index, 1);
|
||||
this.$u.toast(`删除了第${index+1}个cell`);
|
||||
removeFavorite(id) {
|
||||
this.$u.api.removeFavorite({
|
||||
id: id
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.getGoodsFavoritesList();
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
open(index) {
|
||||
// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
|
||||
|
@ -45,6 +45,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import common from '@/static/js/common.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -90,10 +91,6 @@
|
||||
this.videoContext = uni.createVideoContext('myVideo')
|
||||
},
|
||||
methods: {
|
||||
unescapeHTML(temp) {
|
||||
temp = "" + temp;
|
||||
return temp.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'");
|
||||
},
|
||||
apiwelcome() {
|
||||
this.$u.api.documentInfo({
|
||||
document_code: 'agreement'
|
||||
@ -101,7 +98,7 @@
|
||||
if (res.errCode == 0) {
|
||||
let agreement = res.data;
|
||||
// console.log(agreement.document_content)
|
||||
agreement.document_content = this.unescapeHTML(agreement.document_content);
|
||||
agreement.document_content = common.unescapeHTML(agreement.document_content);
|
||||
// console.log(agreement);
|
||||
this.agreement = agreement;
|
||||
}
|
||||
@ -307,4 +304,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -115,11 +115,6 @@
|
||||
},
|
||||
// 用户登录
|
||||
loginOn() {
|
||||
// 测试用的
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
return false;
|
||||
console.log("登录")
|
||||
// console.log(this.member_mobile)
|
||||
// console.log(this.sms_code)
|
||||
|
@ -7,59 +7,56 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import common from '@/static/js/common.js'
|
||||
var graceRichText = require("../../components/logininput/rictText.js");
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
document_content : ''
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
document_content : ''
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
console.log(option)
|
||||
// 协议类型调用不同的的协议
|
||||
let typeIindex = option.index;
|
||||
this.typeIndexRquest(typeIindex)
|
||||
},
|
||||
methods: {
|
||||
typeIndexRquest(typeIindex){
|
||||
// 3种协议分别是 0 1 2 【agreement:用户协议,open_store:开店协议,privacy:隐私协议,use:使用协议】;
|
||||
if(typeIindex == 0){
|
||||
this.$u.api.documentInfo({
|
||||
document_code: 'agreement'
|
||||
}).then((res)=>{
|
||||
console.log(res)
|
||||
let data = common.unescapeHTML(res.data.document_content);
|
||||
this.document_content = data
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
console.log(option)
|
||||
// 协议类型调用不同的的协议
|
||||
let typeIindex = option.index;
|
||||
this.typeIndexRquest(typeIindex)
|
||||
},
|
||||
methods: {
|
||||
unescapeHTML (temp){
|
||||
temp = "" + temp;
|
||||
return temp.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'");
|
||||
},
|
||||
typeIndexRquest(typeIindex){
|
||||
// 3种协议分别是 0 1 2 【agreement:用户协议,open_store:开店协议,privacy:隐私协议,use:使用协议】;
|
||||
if(typeIindex == 0){
|
||||
this.$u.api.documentInfo({
|
||||
document_code: 'agreement'
|
||||
}).then((res)=>{
|
||||
console.log(res)
|
||||
let data = this.unescapeHTML(res.data.document_content);
|
||||
this.document_content = data
|
||||
})
|
||||
}
|
||||
if(typeIindex == 1){
|
||||
this.$u.api.documentInfo({
|
||||
document_code: 'privacy'
|
||||
}).then((res)=>{
|
||||
console.log(res)
|
||||
let data = this.unescapeHTML(res.data.document_content);
|
||||
this.document_content = data
|
||||
})
|
||||
}
|
||||
if(typeIindex == 2){
|
||||
this.$u.api.documentInfo({
|
||||
document_code: 'use'
|
||||
}).then((res)=>{
|
||||
console.log(res)
|
||||
let data = this.unescapeHTML(res.data.document_content);
|
||||
this.document_content = data
|
||||
})
|
||||
}
|
||||
if(typeIindex == 1){
|
||||
this.$u.api.documentInfo({
|
||||
document_code: 'privacy'
|
||||
}).then((res)=>{
|
||||
console.log(res)
|
||||
let data = common.unescapeHTML(res.data.document_content);
|
||||
this.document_content = data
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
},
|
||||
components:{}
|
||||
}
|
||||
if(typeIindex == 2){
|
||||
this.$u.api.documentInfo({
|
||||
document_code: 'use'
|
||||
}).then((res)=>{
|
||||
console.log(res)
|
||||
let data = common.unescapeHTML(res.data.document_content);
|
||||
this.document_content = data
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
},
|
||||
components:{}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -1,18 +1,15 @@
|
||||
<template>
|
||||
<view class="follow">
|
||||
<view class="sosuo">
|
||||
<image></image>
|
||||
<view class="sosuo" @click="searchValue">
|
||||
<image src="/static/image/common/10.png"></image>
|
||||
<text>输入达人名称</text>
|
||||
</view>
|
||||
<view class="list">
|
||||
<darenItem style="margin-top:20rpx;margin-right:23rpx" v-for="item in 50"></darenItem>
|
||||
<darenItem style="margin-top:20rpx;margin-right:23rpx" v-for="item in recommendList" :key="item.id" :info="item"></darenItem>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
image{
|
||||
background-color: #0f0;
|
||||
}
|
||||
.follow{
|
||||
background-color: #ECECEC;
|
||||
min-height: calc(100vh - var(--window-top));
|
||||
@ -53,8 +50,25 @@ export default {
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
|
||||
recommendList: [], // 推荐达人
|
||||
}
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getRecommendList();
|
||||
},
|
||||
methods: {
|
||||
getRecommendList() {
|
||||
this.$u.api.getRecommendList().then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.recommendList = res.data.list;
|
||||
}
|
||||
})
|
||||
},
|
||||
searchValue() {
|
||||
uni.navigateTo({
|
||||
url: '/pageB/search/index'
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
@ -55,7 +55,7 @@ export default {
|
||||
}
|
||||
this.list.push(temp);
|
||||
})
|
||||
console.log(this.goodsInfo.mobile_body);
|
||||
// console.log(this.goodsInfo.mobile_body);
|
||||
|
||||
}
|
||||
})
|
||||
|
@ -4,6 +4,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import common from '@/static/js/common.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -11,8 +12,11 @@ export default {
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
// type: 1 证件中心 2: 关于我们
|
||||
// console.log(option);
|
||||
this.getUseHelpInfo(option.id);
|
||||
if(option.id) this.getUseHelpInfo(option.id);
|
||||
if(option.type == 1) this.certificateInfo();
|
||||
if(option.type == 2) this.getAboutUsInfo();
|
||||
},
|
||||
methods: {
|
||||
setTitle(title){
|
||||
@ -20,21 +24,32 @@ export default {
|
||||
title: title
|
||||
});
|
||||
},
|
||||
// 处理富文本
|
||||
unescapeHTML (temp){
|
||||
temp = "" + temp;
|
||||
return temp.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'");
|
||||
},
|
||||
getUseHelpInfo(id) {
|
||||
this.$u.api.getUseHelpInfo({
|
||||
launch_id: id,
|
||||
}).then((res)=>{
|
||||
}).then(res => {
|
||||
if (res.errCode == 0) {
|
||||
this.nodes = this.unescapeHTML(res.data.info[0].help_info);
|
||||
this.nodes = common.unescapeHTML(res.data.info[0].help_info);
|
||||
this.setTitle(res.data.info[0].help_title);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getAboutUsInfo() {
|
||||
this.$u.api.aboutUsInfo().then(res => {
|
||||
if (res.errCode == 0) {
|
||||
this.nodes = common.unescapeHTML(res.data.info.value);
|
||||
this.setTitle(res.data.info.remark);
|
||||
}
|
||||
})
|
||||
},
|
||||
certificateInfo() {
|
||||
this.$u.api.certificateInfo().then(res => {
|
||||
if (res.errCode == 0) {
|
||||
this.nodes = common.unescapeHTML(res.data.info.value);
|
||||
this.setTitle(res.data.info.remark);
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@ -31,6 +31,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import common from '@/static/js/common.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -72,7 +73,7 @@ export default {
|
||||
[this.nickname, this.phoneNumber, this.birthday, this.gender, this.avatar] = [
|
||||
userInfo.member_nickname,
|
||||
userInfo.member_mobile,
|
||||
userInfo.member_birthday,
|
||||
common.timestampToDate({timestamp: userInfo.member_birthday}),
|
||||
userInfo.member_sex,
|
||||
userInfo.member_avatar,
|
||||
];
|
||||
@ -97,7 +98,7 @@ export default {
|
||||
},
|
||||
setBirthday(value) {
|
||||
// console.log(value);
|
||||
this.birthday = value.year + '.' + value.month + '.' + value.day;
|
||||
this.birthday = value.year + '-' + value.month + '-' + value.day;
|
||||
},
|
||||
updatePhone() {
|
||||
uni.navigateTo({
|
||||
|
@ -9,7 +9,7 @@
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="title">性别</view>
|
||||
<view class="value">{{ userInfo.member_sex }}</view>
|
||||
<view class="value">{{ userInfo.member_sex == 1 ? '男' : '女' }}</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="title">生日</view>
|
||||
|
@ -6,7 +6,7 @@
|
||||
:index='index'
|
||||
:show="item.show"
|
||||
:options="options"
|
||||
@click="click"
|
||||
@click="removeFavorite"
|
||||
@open="open"
|
||||
>
|
||||
<view class="item u-border-bottom">
|
||||
@ -44,17 +44,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getStoreFavoritesList() {
|
||||
this.$u.api.getStoreFavoritesList({
|
||||
type: 2 // 固定值
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
|
||||
}
|
||||
this.$u.api.getFavoritesList({
|
||||
type: 2 // 店铺 type: 2
|
||||
})
|
||||
},
|
||||
click(index) {
|
||||
this.list.splice(index, 1);
|
||||
this.$u.toast(`删除了第${index+1}个cell`);
|
||||
removeFavorite(id = 18) {
|
||||
this.$u.api.removeFavorite({
|
||||
id: id
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.getStoreFavoritesList();
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
open(index) {
|
||||
// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
|
||||
|
@ -57,11 +57,11 @@ export default {
|
||||
},
|
||||
{
|
||||
title: '证件中心',
|
||||
link: '../mine/ArticleDetails?title=证件照中心'
|
||||
link: '../mine/ArticleDetails?type=1'
|
||||
},
|
||||
{
|
||||
title: '关于我们',
|
||||
link: '../mine/ArticleDetails?title=关于我们'
|
||||
link: '../mine/ArticleDetails?type=2'
|
||||
},
|
||||
{
|
||||
title: '帮助与反馈',
|
||||
|
19
pageE/zhibo/index.nvue
Normal file
19
pageE/zhibo/index.nvue
Normal file
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div>
|
||||
<myText ref="telText" tel="11" style="width:750rem;height:100vh" @onTel="onTel" @click="myTextClick"></myText>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
@ -83,7 +83,7 @@
|
||||
{
|
||||
"path": "follow/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarTitleText": "推荐达人列表",
|
||||
"app-plus":{
|
||||
"titleNView":{
|
||||
"backgroundColor":"#ffffff"
|
||||
@ -315,6 +315,12 @@
|
||||
{
|
||||
"root": "pageE",
|
||||
"pages":[
|
||||
{
|
||||
"path": "zhibo/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "tool/MineHistory",
|
||||
"style": {
|
||||
|
@ -52,17 +52,17 @@
|
||||
<scroll-view style="width:100%;height:100%" scroll-y="true">
|
||||
<view class="box">
|
||||
<view class="tuijian">
|
||||
<view class="title">
|
||||
<view class="title" @click="toSearchPage">
|
||||
<view class="left">
|
||||
<view></view>
|
||||
<text>推荐达人</text>
|
||||
</view>
|
||||
<image class="right"></image>
|
||||
<image class="right" src="/static/image/common/1.png"></image>
|
||||
</view>
|
||||
<view class="tuijianlist">
|
||||
<!-- <darenItem style="margin-right:23rpx"></darenItem>
|
||||
<darenItem style="margin-right:23rpx"></darenItem> -->
|
||||
<darenItem v-for="item in recommendList" :key="item.id" :info="item"></darenItem>
|
||||
<darenItem v-for="item in recommendList.slice(0,3)" :key="item.id" :info="item"></darenItem>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
@ -223,6 +223,11 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
toSearchPage() {
|
||||
uni.navigateTo({
|
||||
url: '/pageB/follow/index'
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
@ -34,7 +34,6 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
// 通知消息
|
||||
information_dl: [{
|
||||
id: 0,
|
||||
|
@ -113,10 +113,6 @@
|
||||
<img src="/static/image/mine/15.png" />
|
||||
<view>投诉意见</view>
|
||||
</view>
|
||||
<view @click="clickaa()">
|
||||
<img src="/static/image/mine/15.png" />
|
||||
<view>投诉意见11</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -124,7 +120,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var testModule = uni.requireNativePlugin("TestModule")
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -143,9 +138,6 @@ export default {
|
||||
this.toOtherPage("/setting/Index");
|
||||
},
|
||||
methods: {
|
||||
clickaa() {
|
||||
testModule.gotoNativePage();
|
||||
},
|
||||
getUserInfo() {
|
||||
this.$u.api.getMemberInfo().then(res => {
|
||||
if (res.errCode == 0) {
|
||||
|
BIN
static/fonts/emoji.ttf
Normal file
BIN
static/fonts/emoji.ttf
Normal file
Binary file not shown.
BIN
static/image/common/10.png
Normal file
BIN
static/image/common/10.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
32
static/js/common.js
Normal file
32
static/js/common.js
Normal file
@ -0,0 +1,32 @@
|
||||
const common = {
|
||||
/**
|
||||
* 转义富文本标签
|
||||
* @param { String } temp 后台返回需要处理的富文本
|
||||
* @return { String } 处理好的富文本
|
||||
*/
|
||||
unescapeHTML(temp){
|
||||
temp = "" + temp;
|
||||
return temp.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'");
|
||||
},
|
||||
/**
|
||||
* php时间戳转为格式化日期
|
||||
* @param { String } timestamp 必填 php返回的时间戳
|
||||
* @param { String } spacer 可选 日期间隔符,默认 '-'
|
||||
* @param { String } end 可选 年月日时分秒截止位置,默认 day,可传 second
|
||||
* @return { String } 格式化日期
|
||||
*/
|
||||
timestampToDate({timestamp, spacer = '-', end = 'day'} = {}) {
|
||||
const newDate = new Date(parseInt(timestamp) * 1000);
|
||||
// const year = newDate.getUTCFullYear();
|
||||
const year = newDate.getFullYear();
|
||||
const month = newDate.getMonth() + 1;
|
||||
const nowday = newDate.getDate();
|
||||
const hours = newDate.getHours();
|
||||
const minutes = newDate.getMinutes();
|
||||
const seconds = newDate.getSeconds();
|
||||
return end == 'day'
|
||||
? year + spacer + month + spacer + nowday
|
||||
: year + spacer + month + spacer + nowday + spacer + hours + spacer + minutes + spacer + seconds;
|
||||
}
|
||||
}
|
||||
export default common
|
Loading…
Reference in New Issue
Block a user