hookehuyr

✨ feat(书籍介绍首页): 方言查询系统参数API联调

......@@ -23,7 +23,7 @@ export const useVideoList = ($route) => {
// 修改默认语言绑定数据
if (checkLocalism.value) {
// tslint:disable-next-line:no-string-literal
chooseLanguage.value = { text: columns[0]['text'], val: columns[0]['val'] }
chooseLanguage.value = { text: columns.value[0]['text'], val: columns.value[0]['val'] }
} else {
chooseLanguage.value = { text: '普通话', val: '普通话' };
}
......@@ -32,11 +32,33 @@ export const useVideoList = ($route) => {
}
// 方言选择项
const columns = [
let columns = ref([
{ text: '所有方言', val: '所有方言' },
{ text: '上海话', val: '上海话' },
{ text: '广东话', val: '广东话' },
];
])
//
axios.get('/srv/?a=localism_list')
.then(res => {
if (res.data.code === 1) {
let arr = [];
_.each(res.data.data, item => {
arr.push({
text: item,
val: item
})
});
columns.value = _.concat(columns.value, arr);
console.warn(columns);
} else {
console.warn(res);
Toast({
icon: 'close',
message: res.data.msg
});
}
})
.catch(err => {
console.error(err);
})
const showPicker = ref(false);
......
<template>
<div class="video-detail-page">
<div class="detail-header">
<div @click="getUserInfo" class="detail-header">
<van-row>
<van-col span="4">
<van-image round width="3rem" height="3rem" :src="videoInfo.avatar" />
......@@ -49,6 +49,12 @@ import { Toast } from 'vant';
const $route = useRoute();
const $router = useRouter();
const getUserInfo = () => {
$router.push({
path: '/client/personIndex'
})
}
const active = ref(0); // index 0 为简介,1 为留言
const onClickTab = ({ title }) => {
console.warn(title);
......