diff --git a/App.vue b/App.vue index 73acd1d..fc89215 100644 --- a/App.vue +++ b/App.vue @@ -1,26 +1,124 @@ + /*每个页面公共css */ + @import "uview-plus/index.scss"; + + ul, + li { + list-style: none; + } + + .show { + display: none !important; + } + + .hidden { + display: block !important; + } + + page, + view, + scroll-view, + swiper, + swiper-item, + match-media, + movable-area, + movable-view, + cover-view, + cover-image, + icon, + text, + rich-text, + progress, + button, + checkbox-group, + editor, + form, + input, + label, + picker, + picker-view, + radio-group, + slider, + switch, + textarea, + navigator, + audio, + camera, + image, + video, + live-player, + live-pusher, + map, + canvas, + web-view { + box-sizing: border-box; + padding: 0; + margin: 0; + text-decoration: none; + outline: none; + + } + + .initStyle { + padding: 20rpx; + background-color: #2a2a2a; + height: 100vh; + color: #fff; + } + + .fc { + color: #f4f693; + } + + .inputClass { + line-height: 80rpx; + } + + .inputClass input { + background-color: #fff; + height: 80rpx; + padding: 10rpx; + color: #000; + } + + .result { + position: absolute; + font-size: 100rpx; + left: 50%; + top: 800rpx; + transform: translateX(-50%); + } + + + + \ No newline at end of file diff --git a/http/http.js b/http/http.js index c80941b..688facf 100644 --- a/http/http.js +++ b/http/http.js @@ -1,17 +1,20 @@ - // 导入全局属性 import { sm4DecryptByResData } from '@/utils/encryptUtil.js' import infoBox from "@/utils/infoBox.js" -import { reject } from 'lodash'; +import { + reject +} from 'lodash'; import config from '@/commons/config.js' // 测试服 let baseUrl = config.baseApiUrl const loadingShowTime = 200 -function getHeader(){ - const headerObject={} - headerObject["token"] = uni.getStorageSync('token') + +function getHeader() { + const headerObject = {} + headerObject["token"] = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyNjkyNSIsImlhdCI6MTczNTg4OTk5NCwiZXhwIjoxNzM2NDk0Nzk0fQ.j-KFEE1FHckmFCO8UA884RBWvpMv8MfEGj7GPGf3kVo6sHeORl043Yle_w7HdTZKPpQqSr2LQLCq_rUxG4qqwA' + // headerObject["token"] = uni.getStorageSync('token') return headerObject } @@ -61,7 +64,7 @@ function commonsProcess(showLoading, httpReqCallback) { // http响应码不正确 if (statusCode != 200 && statusCode != 204 && statusCode != 201) { isShowErrorToast = true - data.message=data.message=='Bad credentials'?'用户名或密码错误':data.message + data.message = data.message == 'Bad credentials' ? '用户名或密码错误' : data.message infoBox.showToast(data.message || '服务器异常') return Promise.reject(bodyData) // 跳转到catch函数 } @@ -79,15 +82,16 @@ function commonsProcess(showLoading, httpReqCallback) { return Promise.resolve(bodyData) }).catch(res => { - if(res.status==401){ - infoBox.showErrorToast(res.message||'请登录').then(() => { - uni.redirectTo({url: '/pages/login/index'}) + if (res.status == 401) { + infoBox.showErrorToast(res.message || '请登录').then(() => { + uni.redirectTo({ + url: '/pages/login/index' + }) reject() }) } - if(res.status==500){ - infoBox.showErrorToast(res.message||'服务器异常').then(() => { - }) + if (res.status == 500) { + infoBox.showErrorToast(res.message || '服务器异常').then(() => {}) } reqFinishFunc(); // 请求完毕的动作 @@ -134,17 +138,30 @@ function request(args) { return commonsProcess(showLoading, () => { return uni.request( Object.assign({ - url: baseUrl + url, - data: params||data, + url: slash(baseUrl, url), + data: params || data, method: method, - header: getHeader() + header: getHeader() }, extParams) - + ) }) } - - +// 处理/ +function slash(baseUrl, url) { + let u = '' + if (baseUrl[baseUrl.length - 1] == '/') { + u += baseUrl + } else { + u = u + baseUrl + '/' + } + if (url[0] == '/') { + u = u + url.slice(1) + } else { + u = u + url + } + return u +} // 上传 function upload(uri, data, file, showLoading = true, extParams = {}) { @@ -156,14 +173,14 @@ function upload(uri, data, file, showLoading = true, extParams = {}) { url: baseUrl + uri, formData: data, name: "file", - filePath: file.path||file.url, - header: getHeader() + filePath: file.path || file.url, + header: getHeader() }, extParams) ).then((httpData) => { // uni.upload 返回bodyData 的是 string类型。 需要解析。 httpData.data = JSON.parse(httpData.data) return Promise.resolve(httpData) - }).catch(err=>{ + }).catch(err => { uni.hideLoading() infoBox.showErrorToast(`上传失败`) }) diff --git a/pages.json b/pages.json index 5805b45..3783e86 100644 --- a/pages.json +++ b/pages.json @@ -68,6 +68,13 @@ "style": { "navigationBarTitleText": "个人资料" } + }, + { + "path" : "pages/index/search/index", + "style" : + { + "navigationBarTitleText" : "" + } } ], "globalStyle": { diff --git a/pages/index/components/contentlist.vue b/pages/index/components/contentlist.vue new file mode 100644 index 0000000..3f890a3 --- /dev/null +++ b/pages/index/components/contentlist.vue @@ -0,0 +1,62 @@ + + + + + \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index e864e15..660e22a 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,20 +1,253 @@ - + \ No newline at end of file diff --git a/pages/index/search/index.vue b/pages/index/search/index.vue new file mode 100644 index 0000000..8183fd0 --- /dev/null +++ b/pages/index/search/index.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/static/index/gonggaobg.png b/static/index/gonggaobg.png new file mode 100644 index 0000000..48d4477 Binary files /dev/null and b/static/index/gonggaobg.png differ diff --git a/static/index/indexbh.png b/static/index/indexbh.png new file mode 100644 index 0000000..b3668e3 Binary files /dev/null and b/static/index/indexbh.png differ diff --git a/static/logo.png b/static/logo.png index b5771e2..cbcc87b 100644 Binary files a/static/logo.png and b/static/logo.png differ diff --git a/static/sosuo.png b/static/sosuo.png new file mode 100644 index 0000000..6fc95bf Binary files /dev/null and b/static/sosuo.png differ