From d1cc2576979f8e816808d61db39ec6adc64d0911 Mon Sep 17 00:00:00 2001 From: longjieli <1060695654@qq.com> Date: Sun, 25 Aug 2024 17:42:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 5 ++ components/base/navbar.vue | 144 +-------------------------------------------- config.js | 5 +- manifest.json | 10 +++- pages.json | 57 +++++++++++++----- pages/index/index.vue | 39 ------------ pages/map/map.vue | 22 ------- utils/index.js | 4 +- utils/upload.js | 39 ------------ utils/utils.js | 21 ++++++- 10 files changed, 79 insertions(+), 267 deletions(-) delete mode 100644 pages/index/index.vue delete mode 100644 pages/map/map.vue delete mode 100644 utils/upload.js diff --git a/App.vue b/App.vue index 9b7d993..30bcbdb 100644 --- a/App.vue +++ b/App.vue @@ -1,15 +1,20 @@ diff --git a/components/base/navbar.vue b/components/base/navbar.vue index 57c8792..bf79db1 100644 --- a/components/base/navbar.vue +++ b/components/base/navbar.vue @@ -1,37 +1,6 @@ @@ -41,124 +10,17 @@ props : { title : { type : String, - default : '' + default : '参数' }, leftClick : { type : Function, - }, - moreClick : { - type : Function, - }, - isSearch : { - type : Boolean, - default : false, - }, - isPlus : { - type : Boolean, - default : false, - }, - moreText : { - + require : true } - }, - created() { - }, - beforeDestroy() { - }, - data() { - return { - }; - }, - methods : { } } \ No newline at end of file diff --git a/config.js b/config.js index 971f7be..3975a22 100644 --- a/config.js +++ b/config.js @@ -4,7 +4,7 @@ import api from '@/api/api.js' import utils from './utils/utils.js' import uvUI from '@/uni_modules/uv-ui-tools' -Vue.use(uvUI); +Vue.use(uvUI) // 当前环境 const type = 'dev' @@ -40,11 +40,8 @@ const defaultConfig = { }, } - uni.$uv.setConfig({ - // 修改$uv.config对象的属性 config: { - // 修改默认单位为rpx,相当于执行 uni.$uv.config.unit = 'rpx' unit: 'rpx' }, }) diff --git a/manifest.json b/manifest.json index 1c6f5a6..d8b312b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "unapp模板", - "appid" : "__UNI__197A38F", + "appid" : "__UNI__F370613", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", @@ -41,9 +41,13 @@ ] }, /* ios打包配置 */ - "ios" : {}, + "ios" : { + "dSYMs" : false + }, /* SDK配置 */ - "sdkConfigs" : {} + "sdkConfigs" : { + "ad" : {} + } } }, /* 快应用特有相关 */ diff --git a/pages.json b/pages.json index 56a0f2d..6c4ccf4 100644 --- a/pages.json +++ b/pages.json @@ -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": { - "navigationBarTitleText": "unapp模板" + "navigationBarTitleText": "记录" } }, { - "path" : "pages/map/map", - "style" : - { - "navigationBarTitleText" : "" + "path": "pages/reject/reject", + "style": { + "navigationBarTitleText": "驳回" + } + }, + { + "path": "pages/finish/finish", + "style": { + "navigationBarTitleText": "结单" } } ], "globalStyle": { "navigationBarTextStyle": "black", - "navigationBarTitleText": "unapp模板", + "navigationBarTitleText": "", "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": {} -} +} \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue deleted file mode 100644 index 667eeeb..0000000 --- a/pages/index/index.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - - - diff --git a/pages/map/map.vue b/pages/map/map.vue deleted file mode 100644 index 8183fd0..0000000 --- a/pages/map/map.vue +++ /dev/null @@ -1,22 +0,0 @@ - - - - - diff --git a/utils/index.js b/utils/index.js index ead0f6f..b40f098 100644 --- a/utils/index.js +++ b/utils/index.js @@ -18,11 +18,11 @@ Vue.prototype.$wxPay = wxPay dayjs.locale('zh-cn') -import uploadFileToOSS from './upload.js' +import Oss from '@/utils/oss-upload/oss/index.js' import { handleTree } from './tree.js' Vue.prototype.$handleTree = handleTree -Vue.prototype.$uploadFileToOSS = uploadFileToOSS +Vue.prototype.$Oss = Oss Vue.prototype.$dayjs = dayjs Vue.prototype.$timeUtils = time diff --git a/utils/upload.js b/utils/upload.js deleted file mode 100644 index fcd7997..0000000 --- a/utils/upload.js +++ /dev/null @@ -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 \ No newline at end of file diff --git a/utils/utils.js b/utils/utils.js index f25edb6..a561057 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -120,6 +120,23 @@ export function navigateBack(num = -1){ uni.navigateBack(num) } +//选择图片 +export function chooseImage(callBack){ + uni.chooseImage({ + count: 5, //默认9 + sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 + sourceType: ['album'], //从相册选择 + success: function(res) { + callBack && callBack(res) + } + }); +} + +//图片预览 +export function previewImage(options){ + uni.previewImage(options); +} + export default { toArray, generateUUID, @@ -130,5 +147,7 @@ export default { getHrefParams, deepMergeObject, navigateTo, - navigateBack + navigateBack, + chooseImage, + previewImage } \ No newline at end of file