diff --git a/api/index.js b/api/index.js index 126dbde..c1bedef 100644 --- a/api/index.js +++ b/api/index.js @@ -80,6 +80,13 @@ const api = { data }) }, + newGetCity(data) { + return request({ + url: 'api/newGetCity', + method: 'post', + data + }) + }, ipGetCity(data) { return request({ url: 'api/ipGetCity', diff --git a/pages.json b/pages.json index 661fc0c..ee6b9eb 100644 --- a/pages.json +++ b/pages.json @@ -3,6 +3,7 @@ "path": "pages/index/index", "style": { "navigationBarTitleText": "首页", + "navigationBarTextStyle": "black", "navigationStyle": "custom" } @@ -83,8 +84,8 @@ ] }, "globalStyle": { - "navigationBarTextStyle": "#222222", - "navigationBarTitleText": "uni-app", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "", "navigationBarBackgroundColor": "#F8A617", "app-plus": { "background": "#efeff4" diff --git a/pages/face/face.vue b/pages/face/face.vue index 977723e..5314cc7 100644 --- a/pages/face/face.vue +++ b/pages/face/face.vue @@ -1,34 +1,37 @@ @@ -37,6 +40,7 @@ export default { data() { return { + top: 0, url: "", path: "", yrenlianlist:[], @@ -44,12 +48,13 @@ userxixin:{} } }, - onShow() { + onLoad() { + this.top = uni.getSystemInfoSync().statusBarHeight this.memberInfo() }, methods: { fanhui(){ - uni.navigateBack() + uni.navigateBack({delta:1}) }, memberInfo() { this.$api.memberInfo().then(res => { @@ -63,48 +68,47 @@ }) }, pais(){ - this.$refs.popup.open('center') + // this.$refs.popup.open('center') this.chooseImage() }, qudbtn(){ // this.$refs.popup.close('center') // var tjlist=[...this.yrenlianlist,...this.jqrllist] + uni.uploadFile({ - url: this.ymurl+'/api/uploadFile', - filePath:this.path, + url: that.ymurl+'/api/uploadFile', + filePath: that.path, name: 'file', formData: { 'user': 'test' }, + fail(err) { + console.log(11,err) + }, success: (res) => { console.log('tjlist',JSON.parse(res.data)); var data=JSON.parse(res.data) if(data.code==200){ - uni.showToast({ - icon: "none", - title: '上传成功', - duration: 5000, - }); - this.$api.memberFace({face_id:data.data.file_id}).then(res=>{ + that.$api.memberFace({face_id:data.data.file_id}).then(res=>{ if(res.code=='200'){ uni.showToast({ icon: "none", title: '上传成功', - duration: 5000, + duration: 2000, }); setTimeout(function(){ uni.switchTab({ url:'/pages/user/index' }) - },1000) + },2000) } }) }else{ uni.showToast({ icon: "none", title: data.msg, - duration: 5000, + duration: 2000, }); } @@ -114,18 +118,54 @@ }, chooseImage() { - var that=this + const that = this; that.yrenlianlist=[] uni.chooseImage({ count: 1, success: function(res) { - console.log(111,res); - console.log(888,this); - that.url = res.tempFilePaths[0]; - that.yrenlianlist.push(that.url) + uni.uploadFile({ + url: that.ymurl+'/api/uploadFile', + filePath: res.tempFilePaths[0], + name: 'file', + formData: { + 'user': 'test' + }, + fail(err) { + console.log(11,err) + }, + success: (res1) => { + console.log('tjlist',JSON.parse(res1.data)); + var data=JSON.parse(res1.data) + if(data.code==200){ + that.$api.memberFace({face_id:data.data.file_id}).then(res2=>{ + if(res2.code=='200'){ + uni.showToast({ + icon: "none", + title: '上传成功', + duration: 2000, + }); + + setTimeout(function(){ + uni.switchTab({ + url:'/pages/user/index' + }) + },2000) + } + }) + }else{ + uni.showToast({ + icon: "none", + title: data.msg, + duration: 2000, + }); + } + + } + }); }, - fail() { - that.$refs.popup.close('center') + fail(err) { + console.log(err) + // that.$refs.popup.close('center') } }); }, @@ -213,8 +253,7 @@ .xinxirl { text-align: center; - margin-top: -600rpx; - + margin-top: 150rpx; } .xinxirl2 { @@ -231,14 +270,54 @@ font-size: 48rpx; color: #222222; } - + .xinxirl4 { + font-weight: 500; + font-size: 36rpx; + color: #222222; + margin-top: 35rpx; + } + .bg{ + width: 100%; + height: 100%; + position: absolute; + left: 0; + top: 0; + z-index: 1; + background: #f5f5f5; + } + .content{ + width: 100%; + position: relative; + left: 0; + top: 0; + z-index: 2; + } .top { + width: 100%; + left: 0; + z-index: 22; + top: 0; + height: 88rpx; + overflow: hidden; + position: fixed; + } + .top .xuzou{ + width: 100%; + height: 88rpx; display: flex; + position: fixed; + align-items: center; + position: relative; + z-index: 23; + } + .top .hs{ + width: 100%; + height: 100%; position: absolute; - top: 96rpx; - left: 20rpx; + left: 0; + top: 0; + z-index: 1; } - .title { padding-left: 14rpx; } diff --git a/pages/index/index.vue b/pages/index/index.vue index 2ecf687..4657b79 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,56 +1,58 @@