## 使用package.json内的脚本 'npm run commit' 提交代码
## 使用package.json内的脚本 'npm run commit' 提交代码
## 使用package.json内的脚本 'npm run commit' 提交代码
# 导视开发提测流程(使用npm包管理工具,其他类似)
1. 修改项目中根目录下的`.drone.yml`文件和`.tpl`文件中的**svn地址**配置,如下所示:
```yml
# 在.drone.yml文件的第75行, 修改svndir变量的值为相应项目的svn地址
# svn目录定义 开头和结尾不能有/,且不能出现中文乱码,复制地址时建议只复制02项目定制后的目录,会影响到变量取值
- svndir="2022研发/Prd007_智能导视/02项目定制"
# 以上海浦项写字楼项目为例,如下所示:
- svndir="2022研发/Prd007_智能导视/02项目定制/SH013上海浦项写字楼/导视应用"
```
```tpl
项目svn地址:http://svn.1000my.com/svn/2022研发/Prd007_智能导视/02项目定制/
项目svn地址:http://svn.1000my.com/svn/2022研发/Prd007_智能导视/02项目定制/SH013上海浦项写字楼/导视应用/
```
2. 修改项目中根目录下的`.tpl`文件中的**git地址**配置,如下所示:
```tpl
项目git地址:https://git.1000my.com/
项目git地址:https://git.1000my.com/project_shpuxiang/shpuxiang_daoshi_vue
```
3. 钉钉**群机器人**配置([钉钉机器人接入官方文档](https://open.dingtalk.com/document/group/custom-robot-access))
* 在项目钉钉群界面点击右上角的**群设置**按钮。
* 在群设置界面点击**智能群助手**按钮。
* 在智能群助手界面点击**添加机器人**按钮。
* 在弹出的弹窗界面中点击添加机器人右边的**小齿轮**按钮。
* 在选择添加机器人列表中选择**自定义机器人**。
* 在机器人详情界面点击**添加**按钮。
* 在添加机器人界面可以修改机器人的**头像**以及**名字**,在**安全设置**选项中选择**自定义关键字**,并添加**地址**关键字,勾选**我已阅读并同意《自定义机器人服务及免责条款**》,然后点击**完成**按钮。
* 完成创建后会自动生成机器人的**Webhook**地址,例如:`https://oapi.dingtalk.com/robot/send?access_token=XXXXXX`。复制地址中的`access_token=`后面的值,修改项目中根目录下的`.drone.yml`文件中的**钉钉机器人token**配置,如下所示:
```yml
# 钉钉机器人token配置在.drone.yml文件的第112行
# 钉钉通知
- name: dingTalk notification
pull: if-not-exists
image: lddsb/drone-dingtalk-message
failure: ignore
settings:
token: 5f1337cd8cb70e007d2693f70a3ca89fdec543781a9a9fe2f5519e061a1820a8
```
4. 项目首次提测步骤:(由于项目是从脚手架派生出来,log文件里会有脚手架的相关信息,所以第一次须删除相关内容)
* 删除项目根目录下的`CHANGELOG.md`文件。
* 通过`npm run commit`命令提交本地代码。
* 通过`npm run release:first`命令生成首次提测的`CHANGELOG.md`文件,该命令也会把生成的**tag**提交到远程仓库,相当于也执行了`push`命令。
* 在仓库项目地址中把`dev`分支合并到`test`分支,合并分支时选择**变基并合并**
5. 项目后续每次提测步骤:
* 通过`npm run commit`命令提交本地代码。
* 通过`npm run release`命令生成`CHANGELOG.md`文件,该命令也会把生成的**tag**提交到远程仓库,相当于也执行了`push`命令。
* 在仓库项目地址中把`dev`分支合并到`test`分支,合并分支时选择**变基并合并**
6. 每次当测试通过,项目正式发包后:
* 通过`npm run changelog`命令生成发包后的`CHANGELOG.md`文件,该命令也会把生成的**tag**提交到远程仓库,相当于也执行了`push`命令。
###
1. web页面fork **common** 组织下的相应仓库并设置具体见文档
2. `git clone` 到本地
3. 配置 mac和linux下 `chmod 700 .husky/*`
4. 推荐通过npx创建项目 `npx @vue/cli create project_name_`
5. 建议安装vscode的vue3的专属插件volar
6. Vue3常用工具库函数[VueUse](https://vueuse.org/)
7. 开发 及内置组件使用说明见以下文档
8. 所有需要写在App.vue内的组件请放到PublicComponent组件
9. windows平台退出弹框点击区域为左上角200*200的矩形 内部会判断手指点击坐标是否在安全区域内 内嵌Android自行删除相关业务代码
10. 地图SDK地址:https://1000my.com/mapapidoc/index.html
11. **所有跳到导航页面之前请先调用 @/utils/Class/Brand.ts 来生成一个新的shop数据 以更新store内的shop数据 (本身操作是店铺除外)看以下demo**
12. ```javascript
import { useStore } from '@/store/root'
import Brand from '@/utils/Class/Brand'
import { useRouter } from 'vue-router'
export const useFacilityNav = () => {
const store = useStore()
const router = useRouter()
// eslint-disable-next-line max-params
function _handleFacility(name: string, floorOrder: number, floorName: string, logoPath: string, yaxis: number) {
const shop = new Brand({ shopName: name, floorOrder, floor: floorName, logoUrl: logoPath, yaxis })
store.SET_SHOP(shop)
}
function handleFacility(item: Facility) {
const facility = window.Map_QM.pathIcon({ type: item.abbreviation })
const floorName = store.currentBuildingFloorsList.find(floor => floor.floorOrder === facility.floor)?.floor
_handleFacility(item.customFacilityName, facility.floor, floorName as string, item.filePath, facility.node as any)
router.push('/nav')
}
return { handleFacility }
}
```
# 无需引入全局mixin.scss文件 (已提前引入)
```javascript
// vue.config.js
module.exports = defineConfig({
css: {
loaderOptions: {
scss: {
additionalData: `@import "@/assets/scss/mixin.scss";`
}
}
},
lintOnSave: true,
productionSourceMap: false
})
```
### 添加基础旋转动画(scss) 以及列表过渡动画
```scss
// @/assets/scss/mixin.scss
@mixin no-wrap {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
@mixin more-wrap($row: 2) {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: $row;
-webkit-box-orient: vertical;
}
@mixin rotate($turn: 360deg, $count: infinite) {
animation-name: rotate;
animation-duration: 2s;
animation-iteration-count: $count;
animation-timing-function: linear;
@keyframes rotate {
0% {
transform: rotate(0) translateZ(0);
}
100% {
transform: rotate($turn) translateZ(0);
}
}
}
// App.vue
.zoom-enter-active {
transition: all 0.3s;
transition-timing-function: cubic-bezier(0.75, 0, 0.24, 1);
}
.zoom-leave-active {
position: absolute !important;
transition: all 0.3s;
transition-timing-function: cubic-bezier(0.75, 0, 0.24, 1);
}
.zoom-enter-from,
.zoom-leave-to {
transform: scale(0.83);
transform-origin: center center;
opacity: 0;
}
.zoom-move {
transition: transform 0.3s !important;
transition-timing-function: cubic-bezier(0.75, 0, 0.24, 1);
}
```
# 组件使用
### AutoBackNotification
| props | type | desc | default |
| :---: | :----: | :----------: | :-----: |
| title | string | 提示文字 | '' |
| delay | number | 倒计时的数字 | 0 |
### Logout
| props | type | desc | default |
| :--------: | :-----: | :--------------: | :-----: |
| modelValue | boolean | 控制组件显示隐藏 | false |
| events | type | desc |
| :----: | :------: | :----------------: |
| bingo | function | 密码输入正确时触发 |
```javascript
{{iconRef.status}}
//天气状况
{{iconRef.icon}}
//天气的iconfont import {useWeather} from '@/composables/useWeather' const {weatherRef, iconRef} = useWeather() ``` ### useSearchShop.js ```javascript import {ref} from 'vue' import {useSearchShopByKeyboard} from '@/composables/useSearchShopByKeyboard' const searchNameRef = ref('') const searchType = 0 //0:键盘搜索 1:手写搜索 //筛选之后的店铺列表 const {searchShopListRef} =useSearchShopByKeyboard(searchNameRef,searchType) ``` ### useGuideMapOperation.js(地图导览模块用于 复位 我的方向) ```javascript // type Item = { // name: String, // nameEn: String, // icon: String, // iconActive: String //选中的图标 // } //switchFloor:(floorOrder:number) => void 楼层切换 需传入楼层 //handleMapIcon:(item:Item, index:number) => void 绑定视图层 //list:Item[] 我的方向 复位 的列表 const { switchFloor, handleMapIcon, list } = useGuideMapOperation() ``` ### useStatistics.js (数据统计) ```javascript useStatistics(data) //data参数详见ts类型声明 ``` ### 切换语言 ```jsx