Skip to content

Commit

Permalink
Merge pull request #41 from HXTIA/dev
Browse files Browse the repository at this point in the history
fix:0.11.0版本补刀bug调整
  • Loading branch information
HardenSG authored May 20, 2024
2 parents a5c40b2 + f09eb53 commit 1613e92
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 50 deletions.
12 changes: 6 additions & 6 deletions scripts/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
37 changes: 20 additions & 17 deletions scripts/gitHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
8 changes: 4 additions & 4 deletions scripts/uploadDist/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/uploadDist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"author": "",
"license": "ISC",
"dependencies": {
"miniprogram-ci": "^1.9.10"
"miniprogram-ci": "^1.9.15"
}
}
17 changes: 8 additions & 9 deletions scripts/uploadDist/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -46,12 +46,11 @@ const upload = async () => {
setting: {
es6: true,
minify: true,
autoPrefixWXSS: true
autoPrefixWXSS: true,
},
robot,
onProgressUpdate: console.log,
})
console.log(uploadResult)
}
upload()

1 change: 1 addition & 0 deletions src/pages/Initial/components/orgInit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const Index = () => {
size,
keyword,
},
silent: false,
loadingNeedMask: true,
})
.then((res) => {
Expand Down
6 changes: 5 additions & 1 deletion src/pages/Initial/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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<boolean | undefined>()
const [isLoading, setLoading] = useState<boolean | undefined>(true)
/** 用户信息 拿到token 组织 年级 班级 */
const {
orgId: _orgId,
Expand Down Expand Up @@ -87,7 +89,6 @@ const Index = () => {
// 有token获取用户信息
const result = await Get<TBizStudentGetInfo>({
url: getStudentInfoUrl,
loadingNeedMask: true,
silent: true,
})
const { code, data } = result
Expand Down Expand Up @@ -149,6 +150,7 @@ const Index = () => {
const eventMap = { back }
const fn = eventMap[action]
fn && fn()
setLoading(false)
})
/** END */

Expand All @@ -160,8 +162,10 @@ const Index = () => {
}, [isLogin])

// 未完善,跳转到组织初始化页面

const notHaveOrg = !hasOrg
const onlyHasOrg = hasOrg && !hasGrade
if (isLoading) return <Loading isCover isShow />
if (notHaveOrg) return <OrgInit />
if (onlyHasOrg || !hasClass) return <GradeInit />
return <InitAccomplish />
Expand Down
13 changes: 12 additions & 1 deletion src/pages/Setting/Feedback/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand All @@ -64,6 +65,16 @@
}
}

.promise_text {
font-size: 26rpx;
color: #bfbbbb;
}

.from {
display: flex;
justify-content: flex-end;
}

page {
/* 覆盖field宽度 */
--form-label-width: 100rpx;
Expand Down
29 changes: 20 additions & 9 deletions src/pages/Setting/Feedback/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
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'
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) {
showToast('您还没有填写内容')
return
}

if (email.length > 0) {
if (!/\w+@\w+(\.\w+)+/.test(email)) {
showToast('您填写的邮箱有误')
return
}
}

const res = await showModal({
title: '反馈一下🤔',
content: '您提出的宝贵建议我们会仔细斟酌,请附上您的联系方式方便采纳后与您联系🫡',
Expand All @@ -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 (
<View className='feedback_wrapper'>
<View className='title_banner' />
Expand All @@ -50,7 +58,7 @@ const Index = () => {
onChange={({ detail: { value } }) => setText(value)}
/>
</Field>
<Field label='手机号'>
<Field label='邮箱'>
<Input
style={{
backgroundColor: 'rgba(245, 245, 245, 1)',
Expand All @@ -60,14 +68,17 @@ const Index = () => {
borderRadius: '10rpx',
paddingLeft: '10rpx',
}}
placeholder='请输入手机号'
type='number'
onChange={({ detail: { value } }) => setPhone(value as unknown as number)}
placeholder='请输入邮箱'
onChange={({ detail: { value } }) => setEmail(value)}
/>
</Field>
<Button className='btn' onClick={clickBtn}>
提交
我已知悉 提交
</Button>
<View className='promise_text'>
您提供的联系方式我们会妥善保管,我们承诺仅用于系统升级的后续沟通跟进,不会将您的信息以任何种形式外借、售卖、展示给任何人,以防您的信息泄漏
</View>
<View className='promise_text from'>-- 24.5.20 研发团队宣✊</View>
</View>
<View className='bg' />
</View>
Expand Down
16 changes: 14 additions & 2 deletions src/utils/perfTrack/business.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,28 @@ type TTrackUserFeedback = Pick<TTrackEventParams, 'extraParams'> & {
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,
},
})
}

0 comments on commit 1613e92

Please sign in to comment.