12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <template>
- <view class="wrap">
- <page-nav :desc="desc" title="nav.components"></page-nav>
- <view class="list-wrap">
- <u-cell-group title-bg-color="rgb(243, 244, 246)" :title="getGroupTitle(item)" v-for="(item, index) in list" :key="index">
- <u-cell-item :titleStyle="{fontWeight: 500}" @click="openPage(item1.path)" :title="getFieldTitle(item1)"
- v-for="(item1, index1) in item.list" :key="index1">
- <image slot="icon" class="u-cell-icon" :src="getIcon(item1.icon)" mode="widthFix"></image>
- </u-cell-item>
- </u-cell-group>
- </view>
- <u-gap height="70"></u-gap>
- <!-- <u-tabbar :list="vuex_tabbar" :mid-button="true"></u-tabbar> -->
- </view>
- </template>
- <script>
- import list from "./components.config.js";
- import getUrlParams from "../../utils/getUrlParams.js";
- export default {
- data() {
- return {
- list: list,
- //desc: '众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让你快速集成,开箱即用。',
- }
- },
- computed: {
- getIcon() {
- return path => {
- return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
- }
- },
- desc() {
- return this.$t('components.desc');
- }
- },
- onShow() {
- uni.setNavigationBarTitle({
- title: this.$t('nav.components')
- });
-
- let locationLocaturl = window.location.search;
- let openId = getUrlParams(locationLocaturl,"openId");
- if(!this.vuex_hasLogin&&!!openId){
- this.$u.api.getuseinfo(openId).then(res => {
- console.log('getuseinfo',res.retBody);
- this.$u.vuex('vuex_user', res.retBody);
- this.$u.vuex('vuex_hasLogin', true);
- this.$u.vuex('vuex_token', res.retBody.token);
- if(!res.retBody.phone){
- this.openPage('/pages/template/bindPhoneNumber/bindPhoneNumber')
- }
- })
- }
- },
- created() {
-
- },
- methods: {
- openPage(path) {
- this.$u.route({
- url: path
- })
- },
- getGroupTitle(item) {
- return this.$i18n.locale == 'zh' ? item.groupName : item.groupName_en
- },
- getFieldTitle(item) {
- return this.$i18n.locale == 'zh' ? item.title : item.title_en
- }
- }
- }
- </script>
- <style>
- /* page {
- background-color: rgb(240, 242, 244);
- } */
- </style>
- <style lang="scss" scoped>
-
- .u-cell-icon {
- width: 36rpx;
- height: 36rpx;
- margin-right: 8rpx;
- }
- </style>
|