| @@ -7,15 +7,18 @@ export {} | |||
| declare module 'vue' { | |||
| export interface GlobalComponents { | |||
| Auth: typeof import('./src/components/Auth.vue')['default'] | |||
| BackgroundBasic: typeof import('./src/components/background-basic/index.vue')['default'] | |||
| Contact: typeof import('./src/components/contact/index.vue')['default'] | |||
| ContactForm: typeof import('./src/components/contact-form/index.vue')['default'] | |||
| Counter: typeof import('./src/components/Counter.vue')['default'] | |||
| ExternalLink: typeof import('./src/components/ExternalLink.vue')['default'] | |||
| Notification: typeof import('./src/components/notification/index.vue')['default'] | |||
| NutAvatar: typeof import('@nutui/nutui-taro')['Avatar'] | |||
| NutButton: typeof import('@nutui/nutui-taro')['Button'] | |||
| NutCalendar: typeof import('@nutui/nutui-taro')['Calendar'] | |||
| NutCell: typeof import('@nutui/nutui-taro')['Cell'] | |||
| NutCol: typeof import('@nutui/nutui-taro')['Col'] | |||
| NutCollapse: typeof import('@nutui/nutui-taro')['Collapse'] | |||
| NutCollapseItem: typeof import('@nutui/nutui-taro')['CollapseItem'] | |||
| NutDivider: typeof import('@nutui/nutui-taro')['Divider'] | |||
| @@ -24,6 +27,7 @@ declare module 'vue' { | |||
| NutFormItem: typeof import('@nutui/nutui-taro')['FormItem'] | |||
| NutInput: typeof import('@nutui/nutui-taro')['Input'] | |||
| NutNavbar: typeof import('@nutui/nutui-taro')['Navbar'] | |||
| NutRow: typeof import('@nutui/nutui-taro')['Row'] | |||
| NutSearchbar: typeof import('@nutui/nutui-taro')['Searchbar'] | |||
| NutSwitch: typeof import('@nutui/nutui-taro')['Switch'] | |||
| } | |||
| @@ -20,6 +20,7 @@ const config = { | |||
| outputRoot: 'dist', | |||
| plugins: ['@tarojs/plugin-html', 'tarojs-router-next-plugin'], | |||
| defineConstants: { | |||
| SERVER_URL: '"https://test.digimeta.com.cn"', | |||
| }, | |||
| copy: { | |||
| patterns: [ | |||
| @@ -32,7 +32,6 @@ | |||
| "pinia": "^2.1.7", | |||
| "taro-icons": "^0.4.0", | |||
| "tarojs-router-next": "^3.4.0", | |||
| "tarojs-router-next-plugin": "^3.4.0", | |||
| "vue": "^3.3.8" | |||
| }, | |||
| "devDependencies": { | |||
| @@ -54,6 +53,7 @@ | |||
| "eslint-plugin-vue": "^9.18.1", | |||
| "style-loader": "^3.3.3", | |||
| "stylelint": "^15.11.0", | |||
| "tarojs-router-next-plugin": "^3.4.0", | |||
| "ts-node": "^10.9.1", | |||
| "typescript": "^5.3.2", | |||
| "unplugin-vue-components": "^0.25.2", | |||
| @@ -3007,6 +3007,7 @@ | |||
| "version": "2.1.5", | |||
| "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", | |||
| "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", | |||
| "devOptional": true, | |||
| "dependencies": { | |||
| "@nodelib/fs.stat": "2.0.5", | |||
| "run-parallel": "^1.1.9" | |||
| @@ -3019,6 +3020,7 @@ | |||
| "version": "2.0.5", | |||
| "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", | |||
| "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", | |||
| "devOptional": true, | |||
| "engines": { | |||
| "node": ">= 8" | |||
| } | |||
| @@ -3027,6 +3029,7 @@ | |||
| "version": "1.2.8", | |||
| "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", | |||
| "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", | |||
| "devOptional": true, | |||
| "dependencies": { | |||
| "@nodelib/fs.scandir": "2.1.5", | |||
| "fastq": "^1.6.0" | |||
| @@ -4456,6 +4459,7 @@ | |||
| "version": "0.16.0", | |||
| "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.16.0.tgz", | |||
| "integrity": "sha512-SgJpzkTgZKLKqQniCjLaE3c2L2sdL7UShvmTmPBejAKd2OKV/yfMpQ2IWpAuA+VY5wy7PkSUaEObIqEK6afFuw==", | |||
| "dev": true, | |||
| "dependencies": { | |||
| "fast-glob": "^3.2.11", | |||
| "minimatch": "^5.1.0", | |||
| @@ -4467,6 +4471,7 @@ | |||
| "version": "5.1.6", | |||
| "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", | |||
| "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", | |||
| "dev": true, | |||
| "dependencies": { | |||
| "brace-expansion": "^2.0.1" | |||
| }, | |||
| @@ -6368,6 +6373,7 @@ | |||
| "version": "2.0.1", | |||
| "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", | |||
| "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", | |||
| "devOptional": true, | |||
| "dependencies": { | |||
| "balanced-match": "^1.0.0" | |||
| } | |||
| @@ -7093,7 +7099,8 @@ | |||
| "node_modules/code-block-writer": { | |||
| "version": "11.0.3", | |||
| "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-11.0.3.tgz", | |||
| "integrity": "sha512-NiujjUFB4SwScJq2bwbYUtXbZhBSlY6vYzm++3Q6oC+U+injTqfPYFK8wS9COOmb2lueqp0ZRB4nK1VYeHgNyw==" | |||
| "integrity": "sha512-NiujjUFB4SwScJq2bwbYUtXbZhBSlY6vYzm++3Q6oC+U+injTqfPYFK8wS9COOmb2lueqp0ZRB4nK1VYeHgNyw==", | |||
| "dev": true | |||
| }, | |||
| "node_modules/color-convert": { | |||
| "version": "1.9.3", | |||
| @@ -10124,6 +10131,7 @@ | |||
| "version": "3.3.2", | |||
| "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", | |||
| "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", | |||
| "devOptional": true, | |||
| "dependencies": { | |||
| "@nodelib/fs.stat": "^2.0.2", | |||
| "@nodelib/fs.walk": "^1.2.3", | |||
| @@ -10160,6 +10168,7 @@ | |||
| "version": "1.16.0", | |||
| "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", | |||
| "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", | |||
| "devOptional": true, | |||
| "dependencies": { | |||
| "reusify": "^1.0.4" | |||
| } | |||
| @@ -13397,6 +13406,7 @@ | |||
| "version": "1.4.1", | |||
| "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", | |||
| "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", | |||
| "devOptional": true, | |||
| "engines": { | |||
| "node": ">= 8" | |||
| } | |||
| @@ -13802,6 +13812,7 @@ | |||
| "version": "1.0.4", | |||
| "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", | |||
| "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", | |||
| "dev": true, | |||
| "bin": { | |||
| "mkdirp": "bin/cmd.js" | |||
| }, | |||
| @@ -14956,7 +14967,8 @@ | |||
| "node_modules/path-browserify": { | |||
| "version": "1.0.1", | |||
| "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", | |||
| "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" | |||
| "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", | |||
| "dev": true | |||
| }, | |||
| "node_modules/path-case": { | |||
| "version": "3.0.4", | |||
| @@ -16240,6 +16252,7 @@ | |||
| "version": "1.2.3", | |||
| "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", | |||
| "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", | |||
| "devOptional": true, | |||
| "funding": [ | |||
| { | |||
| "type": "github", | |||
| @@ -16343,13 +16356,13 @@ | |||
| } | |||
| }, | |||
| "node_modules/react": { | |||
| "version": "16.14.0", | |||
| "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", | |||
| "integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==", | |||
| "version": "18.2.0", | |||
| "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", | |||
| "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", | |||
| "optional": true, | |||
| "peer": true, | |||
| "dependencies": { | |||
| "loose-envify": "^1.1.0", | |||
| "object-assign": "^4.1.1", | |||
| "prop-types": "^15.6.2" | |||
| "loose-envify": "^1.1.0" | |||
| }, | |||
| "engines": { | |||
| "node": ">=0.10.0" | |||
| @@ -16936,6 +16949,7 @@ | |||
| "version": "1.0.4", | |||
| "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", | |||
| "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", | |||
| "devOptional": true, | |||
| "engines": { | |||
| "iojs": ">=1.0.0", | |||
| "node": ">=0.10.0" | |||
| @@ -16972,6 +16986,7 @@ | |||
| "version": "1.2.0", | |||
| "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", | |||
| "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", | |||
| "devOptional": true, | |||
| "funding": [ | |||
| { | |||
| "type": "github", | |||
| @@ -18681,6 +18696,19 @@ | |||
| "react": "^16.13.0" | |||
| } | |||
| }, | |||
| "node_modules/taro-icons/node_modules/react": { | |||
| "version": "16.14.0", | |||
| "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", | |||
| "integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==", | |||
| "dependencies": { | |||
| "loose-envify": "^1.1.0", | |||
| "object-assign": "^4.1.1", | |||
| "prop-types": "^15.6.2" | |||
| }, | |||
| "engines": { | |||
| "node": ">=0.10.0" | |||
| } | |||
| }, | |||
| "node_modules/tarojs-router-next": { | |||
| "version": "3.4.0", | |||
| "resolved": "https://registry.npmjs.org/tarojs-router-next/-/tarojs-router-next-3.4.0.tgz", | |||
| @@ -18693,6 +18721,7 @@ | |||
| "version": "3.4.0", | |||
| "resolved": "https://registry.npmjs.org/tarojs-router-next-plugin/-/tarojs-router-next-plugin-3.4.0.tgz", | |||
| "integrity": "sha512-+kgU9wpx5CwY27FtT5PwymTw9HUEBjJPNlkRZY+8CABWuwRb5tN4OhMeva+J+EeNmSngMuJn4Jyi4WAxqdP/Ug==", | |||
| "dev": true, | |||
| "dependencies": { | |||
| "normalize-path": "^3.0.0", | |||
| "ts-morph": "^15.1.0" | |||
| @@ -18972,6 +19001,7 @@ | |||
| "version": "15.1.0", | |||
| "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-15.1.0.tgz", | |||
| "integrity": "sha512-RBsGE2sDzUXFTnv8Ba22QfeuKbgvAGJFuTN7HfmIRUkgT/NaVLfDM/8OFm2NlFkGlWEXdpW5OaFIp1jvqdDuOg==", | |||
| "dev": true, | |||
| "dependencies": { | |||
| "@ts-morph/common": "~0.16.0", | |||
| "code-block-writer": "^11.0.0" | |||
| @@ -59,7 +59,6 @@ | |||
| "pinia": "^2.1.7", | |||
| "taro-icons": "^0.4.0", | |||
| "tarojs-router-next": "^3.4.0", | |||
| "tarojs-router-next-plugin": "^3.4.0", | |||
| "vue": "^3.3.8" | |||
| }, | |||
| "devDependencies": { | |||
| @@ -81,6 +80,7 @@ | |||
| "eslint-plugin-vue": "^9.18.1", | |||
| "style-loader": "^3.3.3", | |||
| "stylelint": "^15.11.0", | |||
| "tarojs-router-next-plugin": "^3.4.0", | |||
| "ts-node": "^10.9.1", | |||
| "typescript": "^5.3.2", | |||
| "unplugin-vue-components": "^0.25.2", | |||
| @@ -5,7 +5,9 @@ export default defineAppConfig({ | |||
| 'pages/contact-new/index', | |||
| 'pages/contact-edit/index', | |||
| 'pages/invite/index', | |||
| 'pages/settings/index' | |||
| 'pages/settings/index', | |||
| 'pages/login/index', | |||
| 'pages/web-view/index' | |||
| ], | |||
| window: { | |||
| backgroundTextStyle: 'light', | |||
| @@ -0,0 +1,57 @@ | |||
| <template> | |||
| <View/> | |||
| </template> | |||
| <script> | |||
| import { useAuthStore } from '../stores/auth' | |||
| import {NavigateType, Router} from "tarojs-router-next"; | |||
| import {Route, Session} from "../utils"; | |||
| import Taro from "@tarojs/taro"; | |||
| export default { | |||
| setup() { | |||
| const auth = useAuthStore() | |||
| if (Session.has('expires_in_timestamp') | |||
| && Session.get('expires_in_timestamp') >= new Date().getTime()+60*60*1000) { | |||
| auth.isLoggedIn = true; | |||
| console.log(Session.all()) | |||
| } else { | |||
| console.log(SERVER_URL+ '/system/api/weapp/login') | |||
| Taro.login({ | |||
| success: function (res) { | |||
| Taro.request({ | |||
| url: SERVER_URL + '/system/api/weapp/login', | |||
| data: {code: res.code}, | |||
| success: result => { | |||
| // console.log(result) | |||
| for (const [key, value] of Object.entries(result.data.data)) { | |||
| Session.set(key, value); | |||
| if (key === 'expires_in') { | |||
| Session.set('expires_in_timestamp', new Date().getTime() + (value * 60 * 1000)) | |||
| } | |||
| console.log(key, value); | |||
| } | |||
| auth.isLoggedIn = true | |||
| if (!Session.has('access_token')) { | |||
| if (Taro.getCurrentPages().length > 0) { | |||
| Router.navigate( {url: '/pages/login/index'}, { data: {prevPage:"/" + Taro.getCurrentPages()[0].route}, type: NavigateType.reLaunch } ) | |||
| } | |||
| else { | |||
| Router.navigate( {url: '/pages/login/index'}, { type: NavigateType.reLaunch } ) | |||
| } | |||
| } | |||
| } | |||
| }) | |||
| }, | |||
| fail: function (res) { | |||
| console.log(res) | |||
| } | |||
| }) | |||
| } | |||
| return {} | |||
| } | |||
| } | |||
| </script> | |||
| @@ -0,0 +1,13 @@ | |||
| <script setup> | |||
| import {Route} from "../utils"; | |||
| const props = defineProps(['href', 'style', 'class']) | |||
| const onExternalLinkTaped = () => { | |||
| Route.navigateTo({url: '/pages/web-view/index'}, {data: {href: props.href}}) | |||
| } | |||
| </script> | |||
| <template> | |||
| <Text :class="props.class" :style="props.style" @tap="onExternalLinkTaped"><slot></slot></Text> | |||
| </template> | |||
| @@ -2,7 +2,6 @@ | |||
| import "./index.scss"; | |||
| import Taro from "@tarojs/taro"; | |||
| import { Router } from 'tarojs-router-next' | |||
| import StringUtil from "../../utils/StringUtil"; | |||
| import { reactive, ref } from 'vue'; | |||
| @@ -1,10 +1,12 @@ | |||
| <script setup lang="ts"> | |||
| import Taro from "@tarojs/taro"; | |||
| import { Router } from 'tarojs-router-next' | |||
| import StringUtil from "../../utils/StringUtil"; | |||
| import {BjxHelper, ScreenHelper} from "../../utils"; | |||
| import "./index.scss"; | |||
| import {ref} from "vue"; | |||
| const props = defineProps(['items']) | |||
| // const elevatorHeight = ref(ScreenHelper.getScreenHeight() - ScreenHelper.getStatusBarHeight() - ScreenHelper.getWindowBarHeight()) | |||
| const clickItem = (key: string, item: any) => { | |||
| console.log(key); | |||
| @@ -13,15 +15,21 @@ const clickItem = (key: string, item: any) => { | |||
| Router.toContactEdit({ data: item }) | |||
| } | |||
| // ScreenHelper.getDomObjectHeight(".scroll").then( calcElevatorHeight => { | |||
| // console.log("calcElevatorHeight", calcElevatorHeight) | |||
| // elevatorHeight.value = calcElevatorHeight | |||
| // }) | |||
| </script> | |||
| <template> | |||
| <nut-elevator :index-list="props.items" is-sticky style="height: 100% !important;" @click-item="clickItem"> | |||
| <nut-elevator :index-list="props.items" is-sticky style="height: 100%" @click-item="clickItem"> | |||
| <template #default="{ item }"> | |||
| <view class="d-flex flex-row pb-2"> | |||
| <view class="pr-4 pt-2 h6"> | |||
| <nut-avatar size="normal" color="white" :bg-color="StringUtil.mbString2RgbHex(item.name)"> | |||
| <view v-if="StringUtil.getBJXFirstChar(item.name)">{{StringUtil.getBJXFirstChar(item.name)}}</view> | |||
| <nut-avatar size="normal" color="white" :bg-color="BjxHelper.mbString2RgbHex(item.name)"> | |||
| <view v-if="BjxHelper.getBJXFirstChar(item.name)">{{BjxHelper.getBJXFirstChar(item.name)}}</view> | |||
| <view v-else> | |||
| <Text className='fas fa-user fa-lg'/> | |||
| </view> | |||
| @@ -1,6 +1,6 @@ | |||
| <script setup> | |||
| import './index.scss' | |||
| import StringUtil from "../../utils/StringUtil"; | |||
| import { BjxHelper } from "../../utils"; | |||
| /** | |||
| @@ -8,7 +8,7 @@ import StringUtil from "../../utils/StringUtil"; | |||
| * example: [["YYYY-MM-DD hh:mm:ss"], ["YYYY-MM-DD hh:mm:ss"]] | |||
| */ | |||
| const props = defineProps(['avatar', 'name', 'company', 'is-vip', 'pass-date', 'pass-time', 'today-pass-time']) | |||
| let lastName = StringUtil.getBJXFirstChar(props.name) | |||
| let lastName = BjxHelper.getBJXFirstChar(props.name) | |||
| let isVIP = JSON.parse(props.isVip) | |||
| let todayPassJsonObject = JSON.parse(props.todayPassTime) | |||
| @@ -21,7 +21,7 @@ let todayPassJsonObject = JSON.parse(props.todayPassTime) | |||
| <view class="card-body"> | |||
| <view class="d-flex flex-row"> | |||
| <view class="pr-3 h6"> | |||
| <nut-avatar size="normal" color="white" :bg-color="StringUtil.mbString2RgbHex(lastName)"> | |||
| <nut-avatar size="normal" color="white" :bg-color="BjxHelper.mbString2RgbHex(lastName)"> | |||
| <view> | |||
| <view v-if="lastName">{{lastName}}</view> | |||
| <view v-else> | |||
| @@ -19,7 +19,7 @@ const goBack = () => { | |||
| <NutNavbar title=""></NutNavbar> | |||
| <view class="p-3 d-flex"> | |||
| <view class="flex-grow-1"> | |||
| <view class="h2"> | |||
| <view class="h3"> | |||
| <Text className="fas fa-chevron-left text-primary" @tap="goBack()"/> | |||
| 更新联系人 | |||
| </view> | |||
| @@ -15,7 +15,7 @@ const goBack = () => { | |||
| <NutNavbar title=""></NutNavbar> | |||
| <view class="p-3 d-flex"> | |||
| <view class="flex-grow-1"> | |||
| <view class="h2"> | |||
| <view class="h3"> | |||
| <Text className="fas fa-chevron-left text-primary" @tap="goBack()"/> | |||
| 新来访人 | |||
| </view> | |||
| @@ -64,7 +64,7 @@ const data = ref([ | |||
| <view class="h-100 d-flex flex-column"> | |||
| <BackgroundBasic/> | |||
| <NutNavbar title=""></NutNavbar> | |||
| <view class="pl-3 pt-3 pr-3 h2 d-flex"> | |||
| <view class="pl-3 pt-3 pr-3 h3 d-flex"> | |||
| <view class="flex-grow-1"> | |||
| 通讯录 | |||
| </view> | |||
| @@ -82,7 +82,7 @@ const data = ref([ | |||
| <view class="scroll"> | |||
| <Contact :items="data" style="height: 100%"/> | |||
| <Contact :items="data"/> | |||
| </view> | |||
| </view> | |||
| @@ -4,10 +4,15 @@ import { View, Text } from '@tarojs/components' | |||
| import './index.scss' | |||
| import Counter from '../../components/Counter.vue' | |||
| import Auth from "../../components/Auth" | |||
| import { ref } from 'vue' | |||
| import {useDidShow, useLoad} from "@tarojs/taro"; | |||
| import { Date } from '@nutui/icons-vue-taro'; | |||
| import Notification from "../../components/notification"; | |||
| // | |||
| // | |||
| // const show = ref(false); | |||
| @@ -38,11 +43,13 @@ import Notification from "../../components/notification"; | |||
| <template> | |||
| <Auth/> | |||
| <!-- <view class="h-25 bg-danger">22222222</view>--> | |||
| <view class="h-100 d-flex flex-column"> | |||
| <BackgroundBasic/> | |||
| <NutNavbar title=""></NutNavbar> | |||
| <View class="w-100" style="overflow-x: hidden"> | |||
| <View class="pl-3 pt-3 pr-3 h2 d-flex"> | |||
| <View class="pl-3 pt-3 pr-3 h3 d-flex"> | |||
| <View class="flex-grow-1"> | |||
| 来访记录 | |||
| </View> | |||
| @@ -0,0 +1,6 @@ | |||
| export default definePageConfig({ | |||
| navigationBarTitleText: '', | |||
| usingComponents: {}, | |||
| navigationStyle: 'custom', | |||
| disableScroll: true | |||
| }) | |||
| @@ -0,0 +1,17 @@ | |||
| page { | |||
| height: 100%; | |||
| } | |||
| .nut-navbar { | |||
| background: transparent; | |||
| -webkit-box-shadow: none; | |||
| box-shadow: none; | |||
| } | |||
| .scroll { | |||
| flex: 1; | |||
| overflow: scroll; | |||
| } | |||
| @@ -0,0 +1,108 @@ | |||
| <script setup> | |||
| import './index.scss' | |||
| import Taro from "@tarojs/taro"; | |||
| import {Route, Session} from "../../utils"; | |||
| import { Router } from "tarojs-router-next"; | |||
| import {ref} from "vue"; | |||
| import ExternalLink from "../../components/ExternalLink"; | |||
| const params = Router.getParams() | |||
| const data = Router.getData() | |||
| console.log("data", data) | |||
| const isBackendErrorShowed = ref(false) | |||
| const isWxUserNotStaff = ref(false) | |||
| const clickPhoneNumberButton = () => { | |||
| isBackendErrorShowed.value = false | |||
| isWxUserNotStaff.value = false | |||
| } | |||
| const getPhoneNumber = (e) => { | |||
| console.log(e) | |||
| Taro.request({ | |||
| method: 'POST', | |||
| url: SERVER_URL + '/system/api/weapp/signup', | |||
| data: { | |||
| weappAuth: Session.get('weappAuth'), | |||
| errMsg: e.detail.errMsg, | |||
| rawData: e.detail.rawData, | |||
| signature: e.detail.signature, | |||
| encryptedData: e.detail.encryptedData, | |||
| iv: e.detail.iv, | |||
| }, | |||
| success: result => { | |||
| if (result.statusCode === 200 && result.data.code === 200) { | |||
| for (const [key, value] of Object.entries(result.data.data)) { | |||
| if (key === 'expires_in') { | |||
| Session.set('expires_in_timestamp', new Date().getTime() + (value * 60 * 1000)) | |||
| } | |||
| Session.set(key, value); | |||
| } | |||
| console.log(Session.all()) | |||
| if (Session.has('access_token')) { | |||
| Route.redirectTo({ | |||
| url: ( data !== undefined && data.hasOwnProperty('prevPage') ) ? data.prevPage : '/pages/index/index' | |||
| }) | |||
| } | |||
| } | |||
| else if (result.statusCode === 401) { | |||
| isWxUserNotStaff.value = true | |||
| } | |||
| else { | |||
| isBackendErrorShowed.value = true | |||
| } | |||
| }, | |||
| fail: res => { | |||
| console.log(res); | |||
| } | |||
| }) | |||
| } | |||
| </script> | |||
| <template> | |||
| <view class="h-100 d-flex flex-column"> | |||
| <View style="top: 0; bottom: 0; z-index: -1020"> | |||
| <View style="z-index: -1010; top: 0; bottom: 0" class='position-absolute'> | |||
| <Image :src="require('./background.jpg')" mode='aspectFill' style="width: 100vw; height: 100vh"/> | |||
| </View> | |||
| </View> | |||
| <NutNavbar title=""></NutNavbar> | |||
| <View class="w-100" style="overflow-x: hidden"> | |||
| <NutRow type="flex" justify="center"> | |||
| <NutCol :span="8"> | |||
| <View class="d-flex justify-content-center pt-5"> | |||
| <Image :src="require('./logo.png')" mode="aspectFit"/> | |||
| </View> | |||
| </NutCol> | |||
| </NutRow> | |||
| <View class="text-center h5"> | |||
| 缔智元助理 | |||
| </View> | |||
| <View class="text-center text-black-50"> | |||
| 让每个企业都有自己的数字员工 | |||
| </View> | |||
| <View class="w-100 position-absolute" style="bottom: 150px"> | |||
| <View class="text-center text-black-50 p-5" v-show="isBackendErrorShowed"> | |||
| 服务器错误,请稍后重试 | |||
| </View> | |||
| <View class="text-center text-black-50 p-5" v-show="isWxUserNotStaff"> | |||
| 您还不是数字人产品中注册的企业员工,请联系您的公司管理员开通,或<ExternalLink class="text-primary" href="https://www.digimeta.com.cn/">与缔智元联系</ExternalLink>。 | |||
| </View> | |||
| <View class="w-100 d-flex justify-content-center position-absolute"> | |||
| <NutButton type="success" @click="clickPhoneNumberButton" openType='getPhoneNumber' @getphonenumber="getPhoneNumber"> | |||
| <Text className='text-white'>微信用户一键登录</Text> | |||
| </NutButton> | |||
| </View> | |||
| </View> | |||
| </View> | |||
| </view> | |||
| </template> | |||
| @@ -1,8 +1,98 @@ | |||
| <script setup> | |||
| import './index.scss' | |||
| import Taro from "@tarojs/taro"; | |||
| import {Route, Session} from "../../utils"; | |||
| import { Router } from "tarojs-router-next"; | |||
| import {ref} from "vue"; | |||
| const params = Router.getParams() | |||
| const data = Router.getData() | |||
| console.log("data", data) | |||
| const isBackendErrorShowed = ref(false) | |||
| const onExitLoginButtonClicked = () => { | |||
| isBackendErrorShowed.value = false | |||
| console.log("isBackendErrorShowed taped") | |||
| Taro.request({ | |||
| method: 'POST', | |||
| url: SERVER_URL + '/system/api/weapp/signout', | |||
| data: { | |||
| weappAuth: Session.get('weappAuth'), | |||
| }, | |||
| success: result => { | |||
| if (result.statusCode === 200 && result.data.code === 200) { | |||
| Session.cleanAll() | |||
| Route.reLaunch({url:"/pages/login/index"}) | |||
| } | |||
| else { | |||
| isBackendErrorShowed.value = true | |||
| } | |||
| }, | |||
| fail: res => { | |||
| console.log(res); | |||
| } | |||
| }) | |||
| } | |||
| const onAboutUsClicked = () => { | |||
| Route.navigateTo({url: '/pages/web-view/index'}, {data: {href: "https://www.digimeta.com.cn/"}}) | |||
| console.log("onAboutUsClicked") | |||
| } | |||
| </script> | |||
| <template> | |||
| <view class="index"> | |||
| <text>我是个人中心!</text> | |||
| <view class="h-100 d-flex flex-column"> | |||
| <BackgroundBasic/> | |||
| <NutNavbar title=""></NutNavbar> | |||
| <View class="w-100" style="overflow-x: hidden"> | |||
| <View class="d-flex justify-content-center pt-5 pb-3"> | |||
| <NutAvatar size="large" class="overflow-hidden"> | |||
| <img :src="Session.get('staff').avatar" /> | |||
| </NutAvatar> | |||
| </View> | |||
| <View class="text-center h4"> | |||
| {{ Session.get('staff').userName }} | |||
| </View> | |||
| <View class="text-center text-black-50"> | |||
| {{ Session.get('enterpriseName')}} | |||
| </View> | |||
| <View class="p-3"> | |||
| <nut-cell title="关于我们" @tap="onAboutUsClicked"> | |||
| <template #icon> | |||
| <Text className="fas fa-info-circle"/> | |||
| </template> | |||
| <template #link> | |||
| <Text className="fas fa-chevron-right"/> | |||
| </template> | |||
| </nut-cell> | |||
| <nut-cell title="版本信息" desc="1.0"> | |||
| <template #icon> | |||
| <Text className="fas fa-user"/> | |||
| </template> | |||
| </nut-cell> | |||
| </View> | |||
| <View class="w-100 position-absolute" style="bottom: 0"> | |||
| <View class="text-center text-black-50 p-5" v-show="isBackendErrorShowed"> | |||
| 服务器错误,请稍后重试 | |||
| </View> | |||
| <View class="p-5"> | |||
| <NutButton block type="danger" @tap="onExitLoginButtonClicked"> | |||
| <Text className='text-white'>退出登录</Text> | |||
| </NutButton> | |||
| </View> | |||
| </View> | |||
| </View> | |||
| </view> | |||
| </template> | |||
| <script setup> | |||
| </script> | |||
| @@ -0,0 +1,4 @@ | |||
| export default { | |||
| // navigationBarTitleText: '首页' | |||
| disableScroll: true | |||
| } | |||
| @@ -0,0 +1,4 @@ | |||
| .index { | |||
| flex-direction: column; | |||
| width: 100%; | |||
| } | |||
| @@ -0,0 +1,24 @@ | |||
| <script setup> | |||
| import {Component} from 'react' | |||
| import Taro,{ Current } from '@tarojs/taro' | |||
| import './index.scss' | |||
| import {Session} from "../../utils"; | |||
| import {Router, NavigateType} from "tarojs-router-next"; | |||
| import {View} from "@tarojs/components"; | |||
| const params = Router.getParams() | |||
| const data = Router.getData() | |||
| console.log(data.href) | |||
| const handleMessage = () => { | |||
| console.log("handleMessage") | |||
| } | |||
| </script> | |||
| <template> | |||
| <view class="content"> | |||
| <web-view :src="data.href"></web-view> | |||
| </view> | |||
| </template> | |||
| @@ -0,0 +1,26 @@ | |||
| // https://pinia.esm.dev/introduction.html | |||
| import { defineStore } from 'pinia' | |||
| import {Session} from "../utils"; | |||
| import Taro from "@tarojs/taro"; | |||
| export const useAuthStore = defineStore('auth', { | |||
| state: () => { | |||
| return { | |||
| isLoggedIn: false, | |||
| } | |||
| }, | |||
| actions: { | |||
| }, | |||
| }) | |||
| // You can even use a function (similar to a component setup()) to define a Store for more advanced use cases: | |||
| // export const useCounterStore = defineStore('counter', () => { | |||
| // const count = ref(0) | |||
| // | |||
| // function increment() { | |||
| // count.value++ | |||
| // } | |||
| // | |||
| // return {count, increment} | |||
| // }) | |||
| @@ -0,0 +1,42 @@ | |||
| import Taro from "@tarojs/taro"; | |||
| import { Session } from "./session"; | |||
| import {DocumentNode, print} from "graphql"; | |||
| export class GQLRequest { | |||
| static query(documentNode: DocumentNode, variable: object) { | |||
| return new Promise((resolve, reject) => { | |||
| Taro.request({ | |||
| method: 'POST', | |||
| url: SERVER_URL + '/graphql', | |||
| header: { | |||
| Authorization: 'Bearer ' + Session.get('token'), | |||
| }, | |||
| data: JSON.stringify({ query: print(documentNode), variables: variable }), | |||
| success: result => { | |||
| if (result.statusCode == 200) resolve(result.data) | |||
| else reject(result) | |||
| }, | |||
| fail: res => reject(res) | |||
| }) | |||
| }) | |||
| } | |||
| static shopQuery(documentNode: DocumentNode, variable: object) { | |||
| return new Promise((resolve, reject) => { | |||
| Taro.request({ | |||
| method: 'POST', | |||
| url: SERVER_SHOP_URL + '/graphql', | |||
| header: { | |||
| Authorization: 'Bearer ' + Session.get('shop_token'), | |||
| }, | |||
| data: JSON.stringify({ query: print(documentNode), variables: variable }), | |||
| success: result => { | |||
| if (result.statusCode == 200) resolve(result.data) | |||
| else reject(result) | |||
| }, | |||
| fail: res => reject(res) | |||
| }) | |||
| }) | |||
| } | |||
| } | |||
| @@ -1,6 +1,6 @@ | |||
| import bjxJson from './baijiaxing.json' | |||
| export default class StringUtil { | |||
| export class BjxHelper { | |||
| /** | |||
| * 文字转RGB颜色 | |||
| * @param str | |||
| @@ -0,0 +1,38 @@ | |||
| export class DateHelper { | |||
| //YYYY-mm-dd | |||
| static formatYmd = date => { | |||
| let d = new Date(date), | |||
| month = '' + (d.getMonth() + 1), | |||
| day = '' + d.getDate(), | |||
| year = d.getFullYear(); | |||
| if (month.length < 2) | |||
| month = '0' + month; | |||
| if (day.length < 2) | |||
| day = '0' + day; | |||
| return [year, month, day].join('-'); | |||
| } | |||
| static addDays(date: Date, numberOfDaysToAdd) { | |||
| return date.setDate(date.getDate() + numberOfDaysToAdd); | |||
| } | |||
| static addMonths(date: Date, numberOfMonthsToAdd) { | |||
| let d = date.getDate(); | |||
| date.setMonth(date.getMonth() + +numberOfMonthsToAdd); | |||
| if (date.getDate() != d) { | |||
| date.setDate(0); | |||
| } | |||
| return date; | |||
| } | |||
| static addHoursForTimeString(timeString: string, numberOfHoursToAdd) { | |||
| const time = timeString.split(':') | |||
| const date = new Date(1970, 1, 1, Number(time[0]), Number(time[1]), Number(time[2])) | |||
| date.setHours( date.getHours()+ numberOfHoursToAdd) | |||
| return date.toLocaleTimeString('en-US', { hour12: false }); | |||
| } | |||
| } | |||
| @@ -0,0 +1,6 @@ | |||
| export { BjxHelper } from './bjx-helper'; | |||
| export { DateHelper } from './date-helper'; | |||
| export { GQLRequest } from './GQLRequest'; | |||
| export { Route } from './route'; | |||
| export { ScreenHelper } from './screen-helper'; | |||
| export { Session } from './session' | |||
| @@ -0,0 +1,61 @@ | |||
| import { NavigateType, Router, Route as TaroJsRoute, NavigateOptions } from "tarojs-router-next"; | |||
| import { getCurrentInstance } from '@tarojs/taro' | |||
| import { Session } from "./session"; | |||
| if (!Session.has('prevent-double-click')) { | |||
| Session.set('prevent-double-click', Math.floor(Date.now()/100)) | |||
| } | |||
| export class Route { | |||
| static redirectTo = (route: TaroJsRoute, options?: NavigateOptions, withoutPreventDoubleClick?: boolean) => { | |||
| if (!withoutPreventDoubleClick && !Route.preventDoubleClick()) return | |||
| if (Route.isTabBar(route.url)) { | |||
| Router.navigate( route, {...options, ...{ type: NavigateType.switchTab }} ) | |||
| } | |||
| else { | |||
| Router.navigate( route, {...options, ...{ type: NavigateType.redirectTo }} ) | |||
| } | |||
| } | |||
| static navigateTo = (route: TaroJsRoute, options?: NavigateOptions, withoutPreventDoubleClick?: boolean) => { | |||
| if (!withoutPreventDoubleClick && !Route.preventDoubleClick()) return | |||
| if (Route.isTabBar(route.url)) { | |||
| Router.navigate( route, {...options, ...{ type: NavigateType.switchTab }} ) | |||
| } | |||
| else { | |||
| Router.navigate( route, {...options, ...{ type: NavigateType.navigateTo }} ) | |||
| } | |||
| } | |||
| static reLaunch = (route: TaroJsRoute, options?: NavigateOptions, withoutPreventDoubleClick?: boolean) => { | |||
| if (!withoutPreventDoubleClick && !Route.preventDoubleClick()) return | |||
| if (Route.isTabBar(route.url)) { | |||
| Router.navigate( route, {...options, ...{ type: NavigateType.switchTab }} ) | |||
| } | |||
| else { | |||
| Router.navigate( route, {...options, ...{ type: NavigateType.reLaunch }} ) | |||
| } | |||
| } | |||
| static preventDoubleClick() { | |||
| const currentTime = Math.floor(Date.now()/100) | |||
| if ((currentTime - Session.get('prevent-double-click')) < 10 ) return false | |||
| Session.set('prevent-double-click', currentTime) | |||
| return true | |||
| } | |||
| static isTabBar = (url) => { | |||
| // @ts-ignore | |||
| const tabBarList = getCurrentInstance().app?.config.tabBar.list; | |||
| if (tabBarList == undefined) return false | |||
| for (let item of tabBarList) { | |||
| if (url.match("/"+item.pagePath)) { | |||
| return true; | |||
| } | |||
| } | |||
| return false | |||
| } | |||
| static getRequest = () => { | |||
| return getCurrentInstance().router!.params | |||
| } | |||
| } | |||
| @@ -0,0 +1,61 @@ | |||
| import _isFunction from "lodash/isFunction"; | |||
| import Taro from "@tarojs/taro"; | |||
| export class ScreenHelper { | |||
| static systemInfo = () => { | |||
| if (!_isFunction(Taro.getSystemInfoSync)) { | |||
| return null; | |||
| } | |||
| return Taro.getSystemInfoSync() | |||
| } | |||
| static getScreenHeight = () => { | |||
| const systemInfo = ScreenHelper.systemInfo() | |||
| if (systemInfo === null) return null | |||
| console.log('screenHeight:', systemInfo.screenHeight) | |||
| return systemInfo.screenHeight | |||
| } | |||
| static getScreenWidth = () => { | |||
| const systemInfo = ScreenHelper.systemInfo() | |||
| if (systemInfo === null) return null | |||
| console.log('screenHeight:', systemInfo.screenWidth) | |||
| return systemInfo.screenWidth | |||
| } | |||
| static getStatusBarHeight = () => { | |||
| const systemInfo = ScreenHelper.systemInfo() | |||
| if (systemInfo === null) return null | |||
| console.log('statusBarHeight:', systemInfo.statusBarHeight) | |||
| return systemInfo.statusBarHeight | |||
| } | |||
| static getWindowBarHeight = () => { | |||
| const systemInfo = ScreenHelper.systemInfo() | |||
| if (systemInfo === null) return null | |||
| console.log('windowHeight:', systemInfo.windowHeight) | |||
| return systemInfo.windowHeight | |||
| } | |||
| // (value: ) => void | |||
| static getDomObject = (domObjectSelector) => { | |||
| return new Promise((resolve:(value: Taro.NodesRef.BoundingClientRectCallbackResult)=>void) => { | |||
| const query = Taro.createSelectorQuery(); | |||
| query.select(domObjectSelector).boundingClientRect((res) => { | |||
| console.log('domObject: ' + domObjectSelector, res); | |||
| if (res === null) { | |||
| setTimeout(() => {ScreenHelper.getDomObject(domObjectSelector).then(r => resolve(r))}, 1 ) | |||
| } | |||
| else { | |||
| resolve(res) | |||
| } | |||
| }).exec() | |||
| }) | |||
| } | |||
| static getDomObjectHeight = (domObjectSelector) => { | |||
| return new Promise((resolve: (value: number) => void) => { | |||
| ScreenHelper.getDomObject(domObjectSelector) | |||
| .then(res => { | |||
| resolve(res.height) | |||
| } | |||
| ) | |||
| }) | |||
| } | |||
| } | |||
| @@ -0,0 +1,14 @@ | |||
| import bjxJson from "./baijiaxing.json"; | |||
| export class Session { | |||
| static globalData = {} | |||
| static get = key => this.globalData[key] | |||
| static set = (key , value) => this.globalData[key] = value | |||
| static has = key => !(this.globalData[key] === null || this.globalData[key] === undefined) | |||
| static all = () => this.globalData | |||
| static cleanAll = () => { | |||
| for (const [key, value] of Object.entries(this.globalData)) { | |||
| if (key !== 'weappAuth') delete this.globalData[key] | |||
| } | |||
| } | |||
| } | |||