@ -1,15 +1,20 @@ | |||||
<script> | <script> | ||||
export default { | export default { | ||||
onLaunch: function() { | onLaunch: function() { | ||||
}, | }, | ||||
onShow: function() { | onShow: function() { | ||||
// this.$store.commit('initConfig') | // this.$store.commit('initConfig') | ||||
}, | }, | ||||
onHide: function() { | onHide: function() { | ||||
} | } | ||||
} | } | ||||
</script> | </script> | ||||
<style> | <style> | ||||
/*每个页面公共css */ | /*每个页面公共css */ | ||||
.reserveSpace { | |||||
padding-top: var(--status-bar-height); | |||||
} | |||||
</style> | </style> |
@ -1,30 +1,55 @@ | |||||
{ | { | ||||
"easycom": { | |||||
"autoscan": true, | |||||
"custom": { | |||||
"^uv-(.*)": "@/uni_modules/uv-$1/components/uv-$1/uv-$1.vue" | |||||
} | |||||
}, | |||||
"pages": [ | |||||
"pages": [{ | |||||
"path": "pages/login/login", | |||||
"style": { | |||||
"navigationBarTitleText": "登录" | |||||
} | |||||
}, { | |||||
"path": "pages/repair/repair", | |||||
"style": { | |||||
"navigationBarTitleText": "报修" | |||||
} | |||||
}, | |||||
{ | { | ||||
"path": "pages/index/index", | |||||
"path": "pages/repairList/repairList", | |||||
"style": { | "style": { | ||||
"navigationBarTitleText": "unapp模板" | |||||
"navigationBarTitleText": "记录" | |||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
"path" : "pages/map/map", | |||||
"style" : | |||||
{ | |||||
"navigationBarTitleText" : "" | |||||
"path": "pages/reject/reject", | |||||
"style": { | |||||
"navigationBarTitleText": "驳回" | |||||
} | |||||
}, | |||||
{ | |||||
"path": "pages/finish/finish", | |||||
"style": { | |||||
"navigationBarTitleText": "结单" | |||||
} | } | ||||
} | } | ||||
], | ], | ||||
"globalStyle": { | "globalStyle": { | ||||
"navigationBarTextStyle": "black", | "navigationBarTextStyle": "black", | ||||
"navigationBarTitleText": "unapp模板", | |||||
"navigationBarTitleText": "", | |||||
"navigationBarBackgroundColor": "#F8F8F8", | "navigationBarBackgroundColor": "#F8F8F8", | ||||
"backgroundColor": "#F8F8F8" | |||||
"backgroundColor": "#F8F8F8", | |||||
"navigationStyle": "custom" | |||||
}, | |||||
"tabBar": { | |||||
"backgroundColor": "white", | |||||
"selectedColor": "#3c9cff", | |||||
"list": [{ | |||||
"selectedIconPath": "/static/bar/2.png", | |||||
"iconPath": "/static/bar/1.png", | |||||
"pagePath": "pages/repair/repair", | |||||
"text": "报修" | |||||
}, { | |||||
"selectedIconPath": "/static/bar/4.png", | |||||
"iconPath": "/static/bar/3.png", | |||||
"pagePath": "pages/repairList/repairList", | |||||
"text": "记录" | |||||
}] | |||||
}, | }, | ||||
"uniIdRouter": {} | "uniIdRouter": {} | ||||
} | |||||
} |
@ -1,39 +0,0 @@ | |||||
<template> | |||||
<view class="content"> | |||||
<button @click="$refs.configPopup.open()">{{ locale.agreement }}</button> | |||||
<button @click="$refs.changeLanguage.open()">切换语言</button> | |||||
<button @click="$utils.navigateTo('/map/map')">地图</button> | |||||
<changeLanguage ref="changeLanguage"/> | |||||
<configPopup | |||||
keyValue="asd" | |||||
ref="configPopup"/> | |||||
</view> | |||||
</template> | |||||
<script> | |||||
export default { | |||||
data() { | |||||
return { | |||||
} | |||||
}, | |||||
computed : { | |||||
locale(){ | |||||
return this.$t('pages.index.index') | |||||
} | |||||
}, | |||||
methods: { | |||||
} | |||||
} | |||||
</script> | |||||
<style scoped lang="scss"> | |||||
.content{ | |||||
padding: 20px; | |||||
button{ | |||||
margin-bottom: 10rpx; | |||||
} | |||||
} | |||||
</style> |
@ -1,22 +0,0 @@ | |||||
<template> | |||||
<view> | |||||
</view> | |||||
</template> | |||||
<script> | |||||
export default { | |||||
data() { | |||||
return { | |||||
} | |||||
}, | |||||
methods: { | |||||
} | |||||
} | |||||
</script> | |||||
<style> | |||||
</style> |
@ -1,39 +0,0 @@ | |||||
import OSS from "ali-oss" | |||||
import utils from './utils.js' | |||||
import config from '../config.js' | |||||
function uploadFileToOSS(file) { | |||||
uni.showLoading({ | |||||
title: '上传中...' | |||||
}); | |||||
return new Promise((resolve,reject) => { | |||||
// 创建OSS实例 | |||||
const client = new OSS(config.aliOss.config); | |||||
// 设置文件名和文件目录 | |||||
const suffix = '.' + file.name.split('.').pop(); | |||||
const fileName = utils.generateUUID() + suffix; // 注意:文件名需要是唯一的 | |||||
// 使用put接口上传文件 | |||||
client.multipartUpload(fileName, file, { | |||||
headers: { | |||||
'Content-Disposition': 'inline', | |||||
'Content-Type': file.type | |||||
} | |||||
}).then(res => { | |||||
uni.hideLoading(); | |||||
resolve(config.aliOss.url + res.name); | |||||
}).catch(err => { | |||||
uni.hideLoading(); | |||||
reject(err) | |||||
}) | |||||
}) | |||||
} | |||||
export default uploadFileToOSS |