Commit f439e286 authored by JYbmarawcp's avatar JYbmarawcp

证书生成并长按保存

parents 4f3104cb 73ec870e
import { Component, Vue } from 'vue-property-decorator';
import { State, Action } from 'vuex-class';
@Component
export default class Index extends Vue {
@Action('getSysTemplateList') private getSysTemplateList!: () => void;
public mounted() {
this.getSysTemplateList();
}
}
......@@ -14,12 +14,13 @@ export default new Vuex.Store({
authInfo: {}, // 个人认证信息
companyAuthInfo: {}, // 企业认证信息
proofCount: 0,
sysTemplateList: [],
},
getters: {
isPhone( { userInfo }) {
return userInfo.phone;
},
isPhoneStr( {userInfo }) {
isPhoneStr( { userInfo }) {
return userInfo.phone ? '手机号' : '邮箱';
},
userIcon( {userInfo} ) {
......@@ -48,6 +49,9 @@ export default new Vuex.Store({
updateProofCount(state: any, payload: any) {
state.proofCount = payload;
},
updateSysTemplateList(state: any, payload: any) {
state.sysTemplateList = payload || [];
},
},
actions: {
getUserInfo({ commit }) {
......@@ -87,6 +91,13 @@ export default new Vuex.Store({
commit('updateCompanyAuthInfo', res);
});
},
getSysTemplateList({ commit, state }) {
if (state.sysTemplateList.length <= 0) {
Vue.prototype.$api.template.systemList().then(({results = []}) => {
commit('updateSysTemplateList', results);
});
}
},
},
modules: {
},
......
......@@ -16,10 +16,11 @@
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue, Watch, Inject } from 'vue-property-decorator';
import { Component, Prop, Vue, Watch, Inject, Mixins } from 'vue-property-decorator';
import { List, Image, Empty } from 'vant';
import { TEMPLATETYPE } from '@/const/enum';
import { State, Action } from 'vuex-class';
import IndexMixin from '@/mixins/Index';
@Component({
components: {
[List.name]: List,
......@@ -27,20 +28,15 @@ import { State, Action } from 'vuex-class';
[Empty.name]: Empty,
},
})
export default class IndexCs extends Vue {
@Inject('isSy') private isSy!: boolean;
@Inject('APP-NAME') private APP_NAME!: string;
@State('isLogin') private isLogin!: boolean;
@State('proofCount') private proofCount!: number;
@Action('getProofCount') private getProofCount!: any;
export default class IndexCs extends Mixins(IndexMixin) {
@State('sysTemplateList') private systemList!: [];
private charityType: any[] = [];
private list: any[] = [];
private loading: boolean = true;
@Watch('isLogin', { immediate: true })
private async onIsLoginChange(newVal: boolean, oldVal: boolean) {
if (!newVal) {
this.loading = false;
@Watch('systemList', { immediate: true, deep: true })
private async onChange(newVal: any[], oldVal: any[]) {
if (newVal.length) {
this.charityType = (newVal[0] as any).detail;
}
<<<<<<< HEAD
if (newVal) {
const promises = Promise.all([
this.getProofCount(),
......@@ -64,6 +60,8 @@ export default class IndexCs extends Vue {
private async getSystemList() {
const { results = []} = await this.$api.template.systemList();
this.charityType = results[0].detail;
=======
>>>>>>> 73ec870e1d8b720afdf1afce7a7ef7d4ed915a7f
}
private goProofDetail(templateId: string) {
this.$router.push({ name: 'ProofDetail', query: {templateId} });
......
......@@ -19,7 +19,7 @@
:key="id"
@click="goTemplList(detail)"
>
<van-image :src="folder_simg_url" width="44px" fit="contain"></van-image>
<van-image :src="folder_simg_url" width="44px" height="64px" fit="contain"></van-image>
<div style="font-size:14px;color:#353535;">{{folder_name}}</div>
</li>
</ul>
......@@ -60,10 +60,12 @@
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue, Watch, Inject } from 'vue-property-decorator';
import { Component, Prop, Vue, Watch, Inject, Mixins } from 'vue-property-decorator';
import { List, Image, Empty } from 'vant';
import { TEMPLATETYPE } from '@/const/enum';
import { State, Action } from 'vuex-class';
import IndexMixin from '@/mixins/Index';
@Component({
components: {
[List.name]: List,
......@@ -71,12 +73,16 @@ import { State, Action } from 'vuex-class';
[Empty.name]: Empty,
},
})
<<<<<<< HEAD
export default class IndexSy extends Vue {
=======
export default class IndexSy extends Mixins(IndexMixin) {
>>>>>>> 73ec870e1d8b720afdf1afce7a7ef7d4ed915a7f
@Inject('APP-NAME') private APP_NAME!: string;
@State('isLogin') private isLogin!: boolean;
@State('proofCount') private proofCount!: number;
@State('sysTemplateList') private systemList!: [];
@Action('getProofCount') private getProofCount!: any;
private systemList: any[] = [];
private list: any[] = [];
private loading: boolean = true;
@Watch('isLogin', { immediate: true })
......@@ -101,13 +107,6 @@ export default class IndexSy extends Vue {
private toLogin() {
this.$router.push({name: 'Login'});
}
private mounted() {
this.getSystemList();
}
private async getSystemList() {
const { results = []} = await this.$api.template.systemList();
this.systemList = results;
}
private goTemplList(templList: [] = []) {
this.$router.push({ name: 'TemplList', query: { templList: JSON.stringify(templList) } });
}
......
......@@ -110,6 +110,7 @@ export default class Detail extends Vue {
.aaa {
position: absolute;
top: 0;
opacity: 0;
}
}
}
......
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