1
60
App.vue
@ -1,34 +1,36 @@
|
||||
<script>
|
||||
import config from './config'
|
||||
import store from '@/store'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import config from './config'
|
||||
import store from '@/store'
|
||||
import {
|
||||
getToken
|
||||
} from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
this.initApp()
|
||||
},
|
||||
methods: {
|
||||
// 初始化应用
|
||||
initApp() {
|
||||
// 初始化应用配置
|
||||
this.initConfig()
|
||||
// 检查用户登录状态
|
||||
//#ifdef H5
|
||||
this.checkLogin()
|
||||
//#endif
|
||||
},
|
||||
initConfig() {
|
||||
this.globalData.config = config
|
||||
},
|
||||
checkLogin() {
|
||||
if (!getToken()) {
|
||||
this.$tab.reLaunch('/pages/login')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
this.initApp()
|
||||
},
|
||||
methods: {
|
||||
// 初始化应用
|
||||
initApp() {
|
||||
// 初始化应用配置
|
||||
this.initConfig()
|
||||
// 检查用户登录状态
|
||||
//#ifdef H5
|
||||
this.checkLogin()
|
||||
//#endif
|
||||
},
|
||||
initConfig() {
|
||||
this.globalData.config = config
|
||||
},
|
||||
checkLogin() {
|
||||
if (!getToken()) {
|
||||
this.$tab.reLaunch('/pages/login')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '@/static/scss/index.scss'
|
||||
</style>
|
||||
@import '@/static/scss/index.scss'
|
||||
</style>
|
15
api/business/notice.js
Normal file
@ -0,0 +1,15 @@
|
||||
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
|
||||
})
|
||||
}
|
@ -10,3 +10,11 @@ export function getSiteConfig(params) {
|
||||
})
|
||||
}
|
||||
|
||||
// 根据code查分类值列表
|
||||
export function getCatgByCode(params) {
|
||||
return request({
|
||||
url: '/base/category/listByCode',
|
||||
method: 'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
154
components/tabbar/tabBar.vue
Normal file
@ -0,0 +1,154 @@
|
||||
<template>
|
||||
<view class="tabbar-container">
|
||||
<!-- :style="['width: calc(100% /' + tabbar.length + ')']" -->
|
||||
<view class="tabbar-item" :class="[item.centerItem ? ' center-item' : '']" v-for="(item, i) in tabbar" :key="i"
|
||||
@click="goPage(item)">
|
||||
<view class="item-top">
|
||||
<view style="position: relative;width: 45rpx;margin: auto;">
|
||||
<image class="dl-image" :src="currPage === item.id ? item.selectedIconPath : item.iconPath" />
|
||||
<image v-if="1==i" class="dl-vip" src="@/static/index/vip.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-bottom" :class="[currPage === item.id ? 'item-active' : '']">{{ item.text }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
currPage: 0,
|
||||
tabbar: [{
|
||||
id: 0,
|
||||
code: "home",
|
||||
text: "首页",
|
||||
iconPath: '/static/images/tabbar/home.png',
|
||||
selectedIconPath: '/static/images/tabbar/home_.png',
|
||||
centerItem: false
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
code: "dingyue",
|
||||
text: "订阅",
|
||||
iconPath: '/static/images/tabbar/dingyue.png',
|
||||
selectedIconPath: '/static/images/tabbar/dingyue_.png',
|
||||
centerItem: false
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
code: "myNotice",
|
||||
text: "我的通告",
|
||||
iconPath: '/static/images/tabbar/my_notice.png',
|
||||
selectedIconPath: '/static/images/tabbar/my_notice_.png',
|
||||
centerItem: false
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
code: "my",
|
||||
text: "我的",
|
||||
iconPath: '/static/images/tabbar/my.png',
|
||||
selectedIconPath: '/static/images/tabbar/my_.png',
|
||||
centerItem: false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 页面跳转
|
||||
* @param {Object} item
|
||||
*/
|
||||
goPage(item) {
|
||||
this.currPage=item.id
|
||||
this.$emit("changeMenu", item.code)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
$textDefaultColor: #9B9B9B; // 文字默认颜色
|
||||
$textSelectedColor: #FC1F3E; // 文字选中颜色
|
||||
$centerItemBg: #fff; // 中间凸起按钮背景
|
||||
|
||||
.tabbar-container {
|
||||
bottom: 0;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 125rpx;
|
||||
color: $textDefaultColor;
|
||||
background-color: #F7F7F7;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.tabbar-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
width: 150rpx;
|
||||
height: 120rpx;
|
||||
flex-grow: 1;
|
||||
position: relative;
|
||||
|
||||
.item-top {
|
||||
padding-top: 25rpx;
|
||||
flex-shrink: 0;
|
||||
width: 150rpx;
|
||||
height: 130rpx;
|
||||
|
||||
.dl-image {
|
||||
width: 70rpx;
|
||||
height: 55rpx;
|
||||
}
|
||||
|
||||
.dl-vip {
|
||||
position: absolute;
|
||||
height: 25rpx;
|
||||
top: -10rpx;
|
||||
right: -24px;
|
||||
}
|
||||
}
|
||||
|
||||
.item-bottom {
|
||||
width: 100%;
|
||||
font-size: 28rpx;
|
||||
position: absolute;
|
||||
bottom: 10rpx;
|
||||
}
|
||||
|
||||
.item-active {
|
||||
color: $textSelectedColor;
|
||||
}
|
||||
}
|
||||
|
||||
.center-item {
|
||||
position: relative;
|
||||
|
||||
.item-top {
|
||||
position: absolute;
|
||||
top: -55rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 105rpx;
|
||||
height: 105rpx;
|
||||
background-color: $centerItemBg;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.item-bottom {
|
||||
position: absolute;
|
||||
bottom: 5rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -41,6 +41,9 @@
|
||||
},
|
||||
"quickapp" : {},
|
||||
"mp-weixin" : {
|
||||
"optimization":{
|
||||
"subPackages":true
|
||||
},
|
||||
"appid" : "wxd8ef44a8268672e4",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
|
51
pages.json
@ -20,6 +20,11 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "工作台"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/work/my-notice",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的通告"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/index",
|
||||
"style": {
|
||||
@ -75,33 +80,31 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "浏览富文本"
|
||||
}
|
||||
}],
|
||||
"tabBar": {
|
||||
"color": "#000000",
|
||||
"selectedColor": "#000000",
|
||||
"borderStyle": "white",
|
||||
"backgroundColor": "#ffffff",
|
||||
"list": [{
|
||||
"pagePath": "pages/index",
|
||||
"iconPath": "static/images/tabbar/home.png",
|
||||
"selectedIconPath": "static/images/tabbar/home_.png",
|
||||
"text": "首页"
|
||||
}, {
|
||||
"pagePath": "pages/work/index",
|
||||
"iconPath": "static/images/tabbar/work.png",
|
||||
"selectedIconPath": "static/images/tabbar/work_.png",
|
||||
"text": "工作台"
|
||||
}, {
|
||||
"pagePath": "pages/mine/index",
|
||||
"iconPath": "static/images/tabbar/mine.png",
|
||||
"selectedIconPath": "static/images/tabbar/mine_.png",
|
||||
"text": "我的"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"path" : "pages/components/index",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "通告首页"
|
||||
}
|
||||
},{
|
||||
"path" : "pages/components/notice-item",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "通告组件"
|
||||
}
|
||||
}],
|
||||
// "subPackages": [
|
||||
// {
|
||||
// "root": "pages/notice",
|
||||
// "pages": [
|
||||
|
||||
// ]
|
||||
// }
|
||||
// ],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "RuoYi",
|
||||
"navigationBarTitleText": "多点通告",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}
|
||||
|
174
pages/components/notice-item.vue
Normal file
@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<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>
|
||||
</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>
|
||||
<view class="text-item">
|
||||
<image class="dl-icon" src="@/static/index/my.png" mode="aspectFit"></image>
|
||||
<view class="dl-content">粉丝:1K-10w</view>
|
||||
</view>
|
||||
<view class="text-item" style="border-bottom: 1rpx solid #F4F4F4;padding-bottom: 17rpx;">
|
||||
<image class="dl-icon" src="@/static/index/xing.png" mode="aspectFit"></image>
|
||||
<view class="dl-content">类型:时尚 探店 运动 颜值</view>
|
||||
</view>
|
||||
<view class="text-item" style="padding-top: 20rpx;">
|
||||
<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>
|
||||
</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>
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
<image class="right-image" src="@/static/images/profile.jpg" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
dataList: {
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.dl-components {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.dl-notice-box {
|
||||
font-size: 29rpx;
|
||||
width: 100%;
|
||||
padding: 20rpx;
|
||||
background-color: white;
|
||||
border-radius: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.dl-notice-title {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
padding-bottom: 20rpx;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.dl-image {
|
||||
flex: none;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
.dl-text {
|
||||
margin-left: 10rpx;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
|
||||
}
|
||||
}
|
||||
.dl-notice-content{
|
||||
font-size: 27rpx;
|
||||
display: flex;
|
||||
color: #363636;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.left-text{
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-right: 10rpx;
|
||||
|
||||
.text-item{
|
||||
display: flex;
|
||||
padding: 5rpx;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.dl-icon{
|
||||
flex: none;
|
||||
width: 40rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
.dl-content{
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
padding-left: 15rpx;
|
||||
}
|
||||
.item-box{
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.dl-icon2{
|
||||
flex: none;
|
||||
width: 40rpx;
|
||||
height: 44rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.dl-icon3{
|
||||
flex: none;
|
||||
width: 30rpx;
|
||||
height: 29rpx;
|
||||
}
|
||||
.dl-item-right{
|
||||
flex: 1;
|
||||
padding-left: 10rpx;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
.dl-number{
|
||||
font-size: 26rpx;
|
||||
margin-right: 5rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.right-image{
|
||||
flex: none;
|
||||
width: 230rpx;
|
||||
height: 230rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
115
pages/index.vue
@ -1,43 +1,86 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<image class="logo" src="@/static/logo.png"></image>
|
||||
<view class="text-area">
|
||||
<text class="title">Hello RuoYi</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<!-- 主体区域 -->
|
||||
<view style="width: 100%;">
|
||||
<!-- 通告列表页 -->
|
||||
<notice-index v-show="'home'==menuCode"></notice-index>
|
||||
<mine-index v-show="'my'==menuCode"></mine-index>
|
||||
</view>
|
||||
<tabBarVue :currPage="0" ref="tarBar" @changeMenu="changeMenu"></tabBarVue>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
onLoad: function() {
|
||||
}
|
||||
}
|
||||
import tabBarVue from '@/components/tabbar/tabBar.vue'
|
||||
import noticeIndex from '@/pages/components/index.vue'
|
||||
import mineIndex from '@/pages/mine/index.vue'
|
||||
export default {
|
||||
components:{
|
||||
tabBarVue,
|
||||
noticeIndex,
|
||||
mineIndex
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menus: ['全部', '最新', '高奖励', '急招', '品牌置换'],
|
||||
menuIndex: 0,
|
||||
dataList:['1','2','2','2'],
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
total: 0,
|
||||
//下来刷新状态
|
||||
isTriggered: false,
|
||||
menuCode:"home",
|
||||
}
|
||||
},
|
||||
onLoad: function() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
itemClick(index, item) {
|
||||
this.menuIndex = index
|
||||
},
|
||||
/**
|
||||
* 菜单切换
|
||||
* @param {Object} code
|
||||
*/
|
||||
changeMenu(code){
|
||||
this.menuCode=code
|
||||
},
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
onReachBottomCus() {
|
||||
//判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕
|
||||
if (this.queryParams.pageNo * this.queryParams.pageSize >= this.total) {
|
||||
uni.$u.toast('没有更多数据了')
|
||||
return
|
||||
}
|
||||
//页码+1,调用获取数据的方法获取第二页数据
|
||||
this.queryParams.pageNo++
|
||||
},
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
*/
|
||||
onRefresherrefresh() {
|
||||
this.isTriggered = true
|
||||
this.queryParams.pageNo = 1
|
||||
this.total = 0
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 200rpx;
|
||||
width: 200rpx;
|
||||
margin-top: 200rpx;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.text-area {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
color: #8f8f94;
|
||||
}
|
||||
<style lang="scss">
|
||||
.content {
|
||||
width: 100%;
|
||||
color: #363636;
|
||||
background-color: white;
|
||||
font-size: 38rpx;
|
||||
height: 100vh;
|
||||
padding-top: var(--status-bar-height);
|
||||
padding-bottom: var(--window-bottom);
|
||||
}
|
||||
</style>
|
||||
|
@ -73,13 +73,18 @@
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<tabBarVue :currPage="3" ref="tarBar" ></tabBarVue>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import tabBarVue from '@/components/tabbar/tabBar.vue'
|
||||
import storage from '@/utils/storage'
|
||||
|
||||
export default {
|
||||
components:{
|
||||
tabBarVue,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: this.$store.state.user.name,
|
||||
|
BIN
static/font/SourceHanSansCN-Medium-Alphabetic.ttf
Normal file
BIN
static/images/tabbar/dingyue.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
static/images/tabbar/dingyue_.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 4.1 KiB |
BIN
static/images/tabbar/my.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
static/images/tabbar/my_.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
static/images/tabbar/my_motice_.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
static/images/tabbar/my_notice.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 4.9 KiB |
BIN
static/index/douyin.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
static/index/eye.png
Normal file
After Width: | Height: | Size: 881 B |
BIN
static/index/go-view.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
static/index/member-bg.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
static/index/money.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
static/index/my.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
static/index/person.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
static/index/sanjiao.png
Normal file
After Width: | Height: | Size: 240 B |
BIN
static/index/search.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
static/index/vip.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
static/index/xiaohongshu.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
static/index/xing.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
static/index/zuanshi.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
static/index/服务类型@2x.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
static/index/矩形@2x.png
Normal file
After Width: | Height: | Size: 136 B |
BIN
static/platform/douyin.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
static/platform/xiaohongshu.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
@ -13,8 +13,8 @@
|
||||
body {
|
||||
background-color: #f1f1f1;
|
||||
font-size: 28upx;
|
||||
color: #333333;
|
||||
font-family: Helvetica Neue, Helvetica, sans-serif;
|
||||
color: #363636;
|
||||
font-family: 'SourceHanSansCN-Medium', sans-serif;
|
||||
}
|
||||
|
||||
view,
|
||||
|
@ -1,3 +1,9 @@
|
||||
@font-face {
|
||||
font-family: 'SourceHanSansCN-Medium';
|
||||
src: url('@/static/font/SourceHanSansCN-Medium-Alphabetic.ttf') format('opentype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
@ -7,9 +7,9 @@
|
||||
<uni-icons color="#c0c4cc" size="18" type="search" />
|
||||
</slot>
|
||||
</view>
|
||||
<input v-if="show || searchVal" :focus="showSync" :disabled="readonly" :placeholder="placeholderText" :maxlength="maxlength"
|
||||
class="uni-searchbar__box-search-input" confirm-type="search" type="text" v-model="searchVal"
|
||||
@confirm="confirm" @blur="blur" @focus="emitFocus" />
|
||||
<input v-if="show || searchVal" :focus="showSync" :disabled="readonly" :placeholder="placeholderText"
|
||||
:maxlength="maxlength" class="uni-searchbar__box-search-input" confirm-type="search" type="text"
|
||||
v-model="searchVal" @confirm="confirm" @blur="blur" @focus="emitFocus" />
|
||||
<text v-else class="uni-searchbar__text-placeholder">{{ placeholder }}</text>
|
||||
<view v-if="show && (clearButton==='always'||clearButton==='auto'&&searchVal!=='') &&!readonly"
|
||||
class="uni-searchbar__box-icon-clear" @click="clear">
|
||||
@ -149,7 +149,7 @@
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
if (newVal) {
|
||||
if(this.readonly) return
|
||||
if (this.readonly) return
|
||||
this.show = true;
|
||||
this.$nextTick(() => {
|
||||
this.showSync = true
|
||||
@ -166,7 +166,7 @@
|
||||
},
|
||||
methods: {
|
||||
searchClick() {
|
||||
if(this.readonly) return
|
||||
if (this.readonly) return
|
||||
if (this.show) {
|
||||
return
|
||||
}
|
||||
@ -182,7 +182,7 @@
|
||||
this.searchVal = ""
|
||||
},
|
||||
cancel() {
|
||||
if(this.readonly) return
|
||||
if (this.readonly) return
|
||||
this.$emit("cancel", {
|
||||
value: this.searchVal
|
||||
});
|
||||
@ -234,7 +234,6 @@
|
||||
/* #endif */
|
||||
flex-direction: row;
|
||||
position: relative;
|
||||
padding: 10px;
|
||||
// background-color: #fff;
|
||||
}
|
||||
|
||||
@ -267,7 +266,7 @@
|
||||
|
||||
.uni-searchbar__box-search-input {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
@ -281,7 +280,7 @@
|
||||
}
|
||||
|
||||
.uni-searchbar__text-placeholder {
|
||||
font-size: 14px;
|
||||
font-size: 30rpx;
|
||||
color: #B3B3B3;
|
||||
margin-left: 5px;
|
||||
}
|
||||
@ -289,10 +288,10 @@
|
||||
.uni-searchbar__cancel {
|
||||
padding-left: 10px;
|
||||
line-height: $uni-searchbar-height;
|
||||
font-size: 14px;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
/* #ifdef H5 */
|
||||
cursor: pointer;
|
||||
/* #endif */
|
||||
}
|
||||
</style>
|
||||
</style>
|
@ -11,3 +11,31 @@ export function setToken(token) {
|
||||
export function removeToken() {
|
||||
return uni.removeStorageSync(TokenKey)
|
||||
}
|
||||
|
||||
export function getJSONData(keyStr) {
|
||||
if(uni.getStorageSync(keyStr)){
|
||||
return JSON.parse(uni.getStorageSync(keyStr))
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
export function setJSONData(keyStr,dataObj) {
|
||||
return uni.setStorageSync(keyStr, JSON.stringify(dataObj))
|
||||
}
|
||||
|
||||
export function removeJSONData(keyStr) {
|
||||
return uni.removeStorageSync(keyStr)
|
||||
}
|
||||
|
||||
export function getStrData(keyStr) {
|
||||
return uni.getStorageSync(keyStr)
|
||||
}
|
||||
|
||||
export function setStrData(keyStr,dataStr) {
|
||||
return uni.setStorageSync(keyStr, dataStr)
|
||||
}
|
||||
|
||||
export function removeStrData(keyStr) {
|
||||
return uni.removeStorageSync(keyStr)
|
||||
}
|
@ -1,3 +1,31 @@
|
||||
import { getJSONData,setJSONData,removeJSONData,setStrData } from '@/utils/auth'
|
||||
// 用户权益code
|
||||
const UserRightsKey = 'User-Rights'
|
||||
//用户当前身份code
|
||||
const UserTypeKey = 'User-Type'
|
||||
|
||||
/**
|
||||
* 判断某用户是否有某权益
|
||||
* @param {Object} code 权益code
|
||||
*/
|
||||
export function hasRights(code) {
|
||||
let userRights = getJSONData(UserRightsKey)
|
||||
//默认无权限
|
||||
let rtnData = false
|
||||
if(''!=userRights && userRights.con){
|
||||
|
||||
}
|
||||
return rtnData
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换用户当前身份
|
||||
* @param {Object} value 身份值
|
||||
*/
|
||||
export function changeUserType(value) {
|
||||
setStrData(UserTypeKey,value)
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示消息提示框
|
||||
* @param content 提示的标题
|
||||
@ -51,4 +79,4 @@ export function tansParams(params) {
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
|