|
|
|
@ -23,13 +23,8 @@ |
|
|
|
|
|
|
|
|
|
<uni-popup ref="popup" background-color="#fff" :mask-click='false'> |
|
|
|
|
<view class="imgCropper"> |
|
|
|
|
<!-- <button @click="chooseImage">选择图片</button> --> |
|
|
|
|
<view style="text-align:center;"> |
|
|
|
|
<image mode="widthFix" :src="path" @click="chooseImage"/> |
|
|
|
|
</view> |
|
|
|
|
<ksp-cropper :width="10" :height="10" :maxWidth="500" :maxHeight="500" :url="url" @cancel="oncancel" @ok="onok"></ksp-cropper> |
|
|
|
|
<ksp-cropper mode="free" :maxWidth="500" :maxHeight="500" :url="url" @cancel="oncancel" @ok="onok"></ksp-cropper> |
|
|
|
|
</view> |
|
|
|
|
<view class="qudbtn" @click="qudbtn">确定</view> |
|
|
|
|
</uni-popup> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -41,16 +36,18 @@ |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
top: 0, |
|
|
|
|
url: "", |
|
|
|
|
url: "https://bodybuilding.bsdong.cn/images/banner.png", |
|
|
|
|
path: "", |
|
|
|
|
yrenlianlist:[], |
|
|
|
|
jqrllist:[], |
|
|
|
|
userxixin:{} |
|
|
|
|
userxixin:{}, |
|
|
|
|
type: "", |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
onLoad(o) { |
|
|
|
|
this.type = (o.type?o.type:'') |
|
|
|
|
this.top = uni.getSystemInfoSync().statusBarHeight |
|
|
|
|
this.memberInfo() |
|
|
|
|
// this.memberInfo() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
fanhui(){ |
|
|
|
@ -61,62 +58,29 @@ |
|
|
|
|
this.userxixin = res.data |
|
|
|
|
console.log('this.userxixin',this.userxixin); |
|
|
|
|
if(this.userxixin.face_id!=0){ |
|
|
|
|
uni.switchTab({ |
|
|
|
|
url:'/pages/index/index' |
|
|
|
|
}) |
|
|
|
|
if(this.type =='order'){ |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
uni.switchTab({ |
|
|
|
|
url:'/pages/index/index' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
pais(){ |
|
|
|
|
// this.$refs.popup.open('center') |
|
|
|
|
this.chooseImage() |
|
|
|
|
const that = this; |
|
|
|
|
uni.chooseImage({ |
|
|
|
|
count: 1, |
|
|
|
|
success: function(res) { |
|
|
|
|
that.url = res.tempFilePaths[0] |
|
|
|
|
that.$refs.popup.open("center") |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
qudbtn(){ |
|
|
|
|
// this.$refs.popup.close('center') |
|
|
|
|
// var tjlist=[...this.yrenlianlist,...this.jqrllist] |
|
|
|
|
|
|
|
|
|
uni.uploadFile({ |
|
|
|
|
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){ |
|
|
|
|
that.$api.memberFace({face_id:data.data.file_id}).then(res=>{ |
|
|
|
|
if(res.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, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
chooseImage() { |
|
|
|
|
const that = this; |
|
|
|
|
that.yrenlianlist=[] |
|
|
|
@ -146,9 +110,15 @@ |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
setTimeout(function(){ |
|
|
|
|
uni.switchTab({ |
|
|
|
|
url:'/pages/user/index' |
|
|
|
|
}) |
|
|
|
|
if(that.type =='order'){ |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
uni.switchTab({ |
|
|
|
|
url:'/pages/user/index' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
},2000) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -156,7 +126,7 @@ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
title: data.msg, |
|
|
|
|
duration: 2000, |
|
|
|
|
duration: 5000, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -170,15 +140,14 @@ |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
onok(ev) { |
|
|
|
|
this.jqrllist=[] |
|
|
|
|
this.url = ""; |
|
|
|
|
this.$refs.popup.close() |
|
|
|
|
this.path = ev.path; |
|
|
|
|
this.jqrllist.push(this.path) |
|
|
|
|
console.log('this.path',this.path); |
|
|
|
|
}, |
|
|
|
|
oncancel() { |
|
|
|
|
// url设置为空,隐藏控件 |
|
|
|
|
this.url = ""; |
|
|
|
|
this.$refs.popup.close() |
|
|
|
|
}, |
|
|
|
|
previous() { |
|
|
|
|
uni.switchTab({ |
|
|
|
@ -205,7 +174,7 @@ |
|
|
|
|
} |
|
|
|
|
.imgCropper{ |
|
|
|
|
width: 750rpx; |
|
|
|
|
height: 1200rpx; |
|
|
|
|
height: 100vh; |
|
|
|
|
position: relative; |
|
|
|
|
} |
|
|
|
|
.fot { |
|
|
|
|