Commit ed9fd412 authored by xhx's avatar xhx

fix:调整

parent 9540f596
......@@ -36,7 +36,8 @@ http://121.40.18.70:9056/
### 活动发起地址
```
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
// src/constants/permission
```
### nginx代理地址
......
......@@ -15,6 +15,8 @@ import { mapState } from 'vuex'
import { Loading } from 'vant'
import { getCurrentBTYAddress } from '@/utils/bridge' // 币钱包环境
// import { test } from '@/constants/test' // 本地测试
// import {routes} from '@/router/index'
// import { permissionList } from '@/constants/permission'
Vue.use(Loading)
export default Vue.extend({
components: {
......@@ -50,6 +52,11 @@ export default Vue.extend({
getCurrentBTYAddress('',(res: any) => {
console.log('res', res)
this.$store.commit('app/SET_ADDRESS', res)
// const _routes = routes[0].children as NavItem[]
// if (permissionList.indexOf(res) > -1) {
// _routes[2].meta.text = '发起活动'
// }
// console.log(_routes)
})
// window.onresize = function () {
......
export const permissionList = [
'14KEKbYtKKQm4wMthSK9J4La4nAiidGozt',
// '14KEKbYtKKQm4wMthSK9J4La4nAiidGozt',
'1L1L1Mjd81Q1JSRKn1rQEL17wAXnBjURDk',
'1KMzj1S2mEBSc1TWXfwK4B6AhW8iySzEq1'
'1KMzj1S2mEBSc1TWXfwK4B6AhW8iySzEq1',
'1MwgSgsRpuMVnRLGBgs7c7VNELA4PPHM1n' // 测试地址
]
\ No newline at end of file
<template>
<div class="flex w-full justify-around bg-app-blue-1 z-50" >
{{ currentIndex }}
<div v-for="(i,index) in navRoutes" :key="index" class="py-3 flex flex-col text-center " @click="navigating(i,index)">
<div v-for="(i,index) in routeList" :key="index" class="py-3 flex flex-col text-center " @click="navigating(i,index)">
<div class="self-center">
<app-icon customize :type='i.meta.icon' size='18px' :color='index===activedIndex?"#FFBB00":" #FFFFFF"'></app-icon>
</div>
......@@ -16,6 +16,7 @@ import Vue from 'vue';
import {routes} from '@/router/index'
import Icon from '@/components/common/Icon.vue'
import { permissionList } from '@/constants/permission'
// import { mapState } from 'vuex';
interface NavItem{
component:any;
meta:{
......@@ -52,19 +53,19 @@ export default Vue.extend({
},
methods:{
init() {
if (permissionList.indexOf(this.$store.state.app.address) > -1) {
this.navRoutes.forEach(item => {
if (item.meta.text === '发起提案') {
item.meta.text = '发起活动'
}
})
} else {
this.navRoutes.forEach(item => {
if (item.meta.text === '发起提案') {
item.meta.text = '发起提案'
}
})
}
// if (permissionList.indexOf(this.$store.state.app.address) > -1) {
// this.navRoutes.forEach(item => {
// if (item.meta.text === '发起提案') {
// item.meta.text = '发起活动'
// }
// })
// } else {
// this.navRoutes.forEach(item => {
// if (item.meta.text === '发起提案') {
// item.meta.text = '发起提案'
// }
// })
// }
const indexNumber = this.navRoutes.findIndex(i=>{
// console.log(i);
return i?.path === this.$route?.path
......@@ -97,6 +98,17 @@ export default Vue.extend({
},
currentIndex() {
return this.$store.state.app.index
},
address():string {
return this.$store.state.app.address
},
routeList(): Array<NavItem> {
const _route = routes[0].children as NavItem[]
console.log('change menu', this.address);
if (permissionList.indexOf(this.address) > -1) {
_route[2].meta.text = '发起活动'
}
return _route
}
},
watch: {
......
......@@ -29,6 +29,11 @@ export const appStore = {
state: () => ({
...stateData
}),
getter: {
getAddress(state: {address: string}) {
return state.address
}
},
mutations: {
TOGGLE_STATUS(state:AppType){
state.overlay.show = !state.overlay.show
......
......@@ -24,13 +24,13 @@ export default Vue.extend({
},
created() {
const addr = this.$store.state.app.address
console.log(addr)
if (permissionList.indexOf(addr) > -1) {
this.isFounder = false
this.$route.meta.text = '发起活动'
} else {
this.$route.meta.text = '发起提案'
// this.$route.meta.text = '发起活动'
}
// else {
// this.$route.meta.text = '发起提案'
// }
// // 测试关闭投票
// service.memberCloseVote({
// voteId: '000000000608800001'
......
......@@ -115,11 +115,12 @@ export default Vue.extend({
let o = []
o = lists.filter((item: any) => item.isToday)
this.isToday = o[0]?.isToday
if (this.community.isClose) {
this.rest = 0
} else {
this.rest = +o[0]?.balance || 0
}
// if (this.community.isClose) {
// this.rest = 0
// } else {
// this.rest = +o[0]?.balance || 0
// }
this.rest = +o[0]?.balance || 0
this.endHeight = +o[0]?.endHeight || 0
// 结束时间或下次投票
if (Math.abs(this.endHeight - +this.end) < 5) {
......
......@@ -87,10 +87,10 @@
</div>
</div>
<div class="cell flex justify-between items-center py-2 ">
<!-- <div class="cell flex justify-between items-center py-2 ">
<div>是否公开投票</div>
<van-switch v-model="checked" size="18px"/>
</div>
</div> -->
<!-- <div class="space h-11"></div> -->
<!-- <div v-show="!checked" class="cell flex justify-between items-center py-2 ">
<div>成员数设置</div>
......
......@@ -164,7 +164,6 @@ export default Vue.extend({
payload: {
id: this.$route.query.voteID as string,
addr: this.$store.state.app.address
// addr: test.addr
}
}).then(res => {
const lists = res.data.result && res.data.result.dayAccount || []
......
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