diff --git a/scripts/changelog.js b/scripts/changelog.js index b363c00..d6d93c7 100644 --- a/scripts/changelog.js +++ b/scripts/changelog.js @@ -3,14 +3,14 @@ const { multiProcessCommandExec } = require('./utils') const { logUtils } = require('./constant') async function changelog() { - const currentBranch = multiProcessCommandExec('git branch --show-current') - logUtils.warn(`⌛️:当前分支:${currentBranch},changelog生成中....\n`) + const currentBranch = multiProcessCommandExec('git branch --show-current') + logUtils.warn(`⌛️:当前分支:${currentBranch},changelog生成中....\n`) - if (currentBranch === 'dev') return + if (currentBranch === 'dev') return - logUtils.warn(`⌛️:此次版本更新为根目录基建,即将更新根目录CHANGELOG..\n`) - await exec.promise('conventional-changelog -p angular -i CHANGELOG.md -s') - logUtils.success('✅:CHANGELOG输出成功!\n') + logUtils.warn('⌛️:此次版本更新为根目录基建,即将更新根目录CHANGELOG..\n') + await exec.promise('npx conventional-changelog -p angular -i CHANGELOG.md -s') + logUtils.success('✅:CHANGELOG输出成功!\n') } changelog() diff --git a/scripts/gitHelper.js b/scripts/gitHelper.js index 112c0cf..ef31baf 100644 --- a/scripts/gitHelper.js +++ b/scripts/gitHelper.js @@ -4,28 +4,31 @@ const { logUtils, REGISTRY_URL } = require('./constant') const git = CLI_COMMON_CONFIG().git const gitHelper = async () => { - const currentBranch = multiProcessCommandExec('git branch --show-current') - logUtils.warn(`⌛️:当前分支:${currentBranch},git release 发版运行中....\n`) + const currentBranch = multiProcessCommandExec('git branch --show-current') + logUtils.warn(`⌛️:当前分支:${currentBranch},git release 发版运行中....\n`) - if (currentBranch === 'dev') return + if (currentBranch === 'dev') return - const isNeedTag = true - const pkg = fileUtils() + const isNeedTag = true + const pkg = fileUtils() + const remoteRepo = multiProcessCommandExec('git remote -v').trim() + if (!remoteRepo.includes('origin')) { await exec.promise(`git remote add origin ${REGISTRY_URL}`) - await exec.promise(`git config user.name "${git.name}"`); - await exec.promise(`git config user.email "${git.email}"`); + } + await exec.promise(`git config user.name "${git.name}"`) + await exec.promise(`git config user.email "${git.email}"`) - await exec.promise('git add .'); - await exec.promise(`git commit -m "chore(release): ${pkg.version} feature release"`) - await exec.promise('git pull') - await exec.promise(`git push --set-upstream origin ${currentBranch}`) - if (isNeedTag) { - logUtils.warn('⌛️:需要tag,推送远程标签中.....'); - await exec.promise(`git tag v${pkg.version}`); - await exec.promise(`git push origin --tags`); - logUtils.success('✅:推送远程成功🏅'); - } + await exec.promise('git add .') + await exec.promise(`git commit -m "chore(release): ${pkg.version} feature release"`) + await exec.promise('git pull') + await exec.promise(`git push --set-upstream origin ${currentBranch}`) + if (isNeedTag) { + logUtils.warn('⌛️:需要tag,推送远程标签中.....') + await exec.promise(`git tag v${pkg.version}`) + await exec.promise('git push origin --tags') + logUtils.success('✅:推送远程成功🏅') + } } gitHelper() diff --git a/scripts/uploadDist/package-lock.json b/scripts/uploadDist/package-lock.json index cb650c2..34b3e28 100644 --- a/scripts/uploadDist/package-lock.json +++ b/scripts/uploadDist/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "miniprogram-ci": "^1.9.10" + "miniprogram-ci": "^1.9.15" } }, "node_modules/@ampproject/remapping": { @@ -5233,9 +5233,9 @@ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" }, "node_modules/miniprogram-ci": { - "version": "1.9.10", - "resolved": "https://registry.npmmirror.com/miniprogram-ci/-/miniprogram-ci-1.9.10.tgz", - "integrity": "sha512-uNvVSzXfV1Za0biLSMM/tRX5R9XqFs8IoJBcGvyzU0TDTgNHQ+S0CX+PQgfe0/DU2Gv9/9ZnsIBsF7LIdEyByQ==", + "version": "1.9.15", + "resolved": "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/miniprogram-ci/-/miniprogram-ci-1.9.15.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2Fminiprogram-ci%2F-%2Fminiprogram-ci-1.9.15.tgz", + "integrity": "sha512-n2dH4CFeF+/lg32rTZYrAH5JEzQ0iyGWPm5A7AdiegbbrpJBEyXmkcvc6yK9ZzdmyV5p55xLJzSpqzHPlUnjVQ==", "dependencies": { "@babel/core": "7.21.4", "@babel/generator": "7.21.4", diff --git a/scripts/uploadDist/package.json b/scripts/uploadDist/package.json index 1f83ba3..174590f 100644 --- a/scripts/uploadDist/package.json +++ b/scripts/uploadDist/package.json @@ -10,6 +10,6 @@ "author": "", "license": "ISC", "dependencies": { - "miniprogram-ci": "^1.9.10" + "miniprogram-ci": "^1.9.15" } } diff --git a/scripts/uploadDist/upload.js b/scripts/uploadDist/upload.js index de93052..b128c8a 100644 --- a/scripts/uploadDist/upload.js +++ b/scripts/uploadDist/upload.js @@ -6,21 +6,21 @@ const cwd = process.cwd() const { version } = require(path.resolve(cwd + '/package.json')) const ROBOT_MAP = { - 'dev': 1, - 'pre': 2, - 'main': 3 + dev: 1, + pre: 2, + main: 3, } const getCurrentBranch = () => execSync('git branch --show-current').toString().trim() -const getLatestCommitAuthor = () => execSync('git log -1 --pretty=format:"%an <%ae>"').toString().trim(); +const getLatestCommitAuthor = () => + execSync('git log -1 --pretty=format:"%an <%ae>"').toString().trim() const getTargetRobotId = () => ROBOT_MAP[getCurrentBranch()] - const upload = async () => { const robot = getTargetRobotId() - console.log('当前分支:' + getCurrentBranch() + ' 机器人编号为:' + robot); + console.log('当前分支:' + getCurrentBranch() + ' 机器人编号为:' + robot) if (!robot) { - console.log('您当前不在能够上传产物的白名单分支,请切换到指定分支并重新构建产物'); + console.log('您当前不在能够上传产物的白名单分支,请切换到指定分支并重新构建产物') return } @@ -46,7 +46,7 @@ const upload = async () => { setting: { es6: true, minify: true, - autoPrefixWXSS: true + autoPrefixWXSS: true, }, robot, onProgressUpdate: console.log, @@ -54,4 +54,3 @@ const upload = async () => { console.log(uploadResult) } upload() - diff --git a/src/pages/Initial/components/orgInit.tsx b/src/pages/Initial/components/orgInit.tsx index 440665c..3c1a39c 100644 --- a/src/pages/Initial/components/orgInit.tsx +++ b/src/pages/Initial/components/orgInit.tsx @@ -33,6 +33,7 @@ const Index = () => { size, keyword, }, + silent: false, loadingNeedMask: true, }) .then((res) => { diff --git a/src/pages/Initial/index.tsx b/src/pages/Initial/index.tsx index 007bf51..9ac4695 100644 --- a/src/pages/Initial/index.tsx +++ b/src/pages/Initial/index.tsx @@ -12,6 +12,7 @@ import { TBizStudentGetInfo, } from 'src/utils' import useUpdateEffect from 'src/hooks/useUpdateEffect' +import Loading from 'src/components/baseBuiltComp/Loading' import OrgInit from './components/orgInit' import { getStudentInfoUrl, loginInterUrl } from './common' import GradeInit from './components/gradeInit' @@ -25,6 +26,7 @@ const Index = () => { const userState = useSelector((root: RootState) => root.userinfoModel) const orgCacheState = useSelector((root: RootState) => root.runtimeModel.organizationCache) const [isLogin, setLogin] = useState() + const [isLoading, setLoading] = useState(true) /** 用户信息 拿到token 组织 年级 班级 */ const { orgId: _orgId, @@ -87,7 +89,6 @@ const Index = () => { // 有token获取用户信息 const result = await Get({ url: getStudentInfoUrl, - loadingNeedMask: true, silent: true, }) const { code, data } = result @@ -149,6 +150,7 @@ const Index = () => { const eventMap = { back } const fn = eventMap[action] fn && fn() + setLoading(false) }) /** END */ @@ -160,8 +162,10 @@ const Index = () => { }, [isLogin]) // 未完善,跳转到组织初始化页面 + const notHaveOrg = !hasOrg const onlyHasOrg = hasOrg && !hasGrade + if (isLoading) return if (notHaveOrg) return if (onlyHasOrg || !hasClass) return return diff --git a/src/pages/Setting/Feedback/index.module.scss b/src/pages/Setting/Feedback/index.module.scss index 7279fff..4aca75b 100644 --- a/src/pages/Setting/Feedback/index.module.scss +++ b/src/pages/Setting/Feedback/index.module.scss @@ -46,7 +46,8 @@ line-height: 80rpx; // box-shadow: -10rpx 13rpx $primary-color; background-color: $primary-color; - margin-top: 70rpx; + margin-top: 30rpx; + margin-bottom: 10rpx; } } @@ -64,6 +65,16 @@ } } +.promise_text { + font-size: 26rpx; + color: #bfbbbb; +} + +.from { + display: flex; + justify-content: flex-end; +} + page { /* 覆盖field宽度 */ --form-label-width: 100rpx; diff --git a/src/pages/Setting/Feedback/index.tsx b/src/pages/Setting/Feedback/index.tsx index f6f5344..47c3740 100644 --- a/src/pages/Setting/Feedback/index.tsx +++ b/src/pages/Setting/Feedback/index.tsx @@ -1,4 +1,4 @@ -import { View, Button } from '@tarojs/components' +import { View, Button, Text } from '@tarojs/components' import React, { useCallback, useState } from 'react' import { Field, Textarea, Input } from '@taroify/core' import { goTo, showModal, showToast, trackFeedbackContent } from 'src/utils' @@ -6,7 +6,7 @@ import './index.module.scss' const Index = () => { const [text, setText] = useState('') - const [phone, setPhone] = useState(0) + const [email, setEmail] = useState('') const clickBtn = useCallback(async () => { if (text.length <= 0) { @@ -14,6 +14,13 @@ const Index = () => { return } + if (email.length > 0) { + if (!/\w+@\w+(\.\w+)+/.test(email)) { + showToast('您填写的邮箱有误') + return + } + } + const res = await showModal({ title: '反馈一下🤔', content: '您提出的宝贵建议我们会仔细斟酌,请附上您的联系方式方便采纳后与您联系🫡', @@ -24,14 +31,15 @@ const Index = () => { console.log('提交') trackFeedbackContent({ - user_phone: phone ?? 0, + user_phone: 0, + user_email: email, user_feedback: text, }) showToast('反馈成功,即将返回上一页!') setTimeout(() => { goTo({ methodType: 'navigateBack' }) }, 1000) - }, [phone, text]) + }, [email, text]) return ( @@ -50,7 +58,7 @@ const Index = () => { onChange={({ detail: { value } }) => setText(value)} /> - + { borderRadius: '10rpx', paddingLeft: '10rpx', }} - placeholder='请输入手机号' - type='number' - onChange={({ detail: { value } }) => setPhone(value as unknown as number)} + placeholder='请输入邮箱' + onChange={({ detail: { value } }) => setEmail(value)} /> + + 您提供的联系方式我们会妥善保管,我们承诺仅用于系统升级的后续沟通跟进,不会将您的信息以任何种形式外借、售卖、展示给任何人,以防您的信息泄漏 + + -- 24.5.20 研发团队宣✊ diff --git a/src/utils/perfTrack/business.ts b/src/utils/perfTrack/business.ts index 5819924..6233b3c 100644 --- a/src/utils/perfTrack/business.ts +++ b/src/utils/perfTrack/business.ts @@ -86,16 +86,28 @@ type TTrackUserFeedback = Pick & { user_feedback?: string /** 用户手机号 */ user_phone?: number + /** 邮箱 */ + user_email?: string } /** 上报用户反馈信息 */ -export const trackFeedbackContent = ({ user_feedback, user_phone }: TTrackUserFeedback) => { - /*#__PURE__ */ console.log(' === 运行时用户反馈埋点上报 === ', user_feedback, user_phone) +export const trackFeedbackContent = ({ + user_feedback, + user_phone, + user_email, +}: TTrackUserFeedback) => { + /*#__PURE__ */ console.log( + ' === 运行时用户反馈埋点上报 === ', + user_feedback, + user_phone, + user_email, + ) trackEvent({ eventId: BUSINESS_EVENT_MAP.USER_FEEDBACK, extraParams: { user_feedback, user_phone, + user_email, }, }) }