|
|
|
@ -23,12 +23,16 @@ |
|
|
|
|
|
|
|
|
|
<uni-popup ref="popup" background-color="#fff" :mask-click='false'> |
|
|
|
|
<view class="imgCropper"> |
|
|
|
|
<ksp-cropper mode="free" :maxWidth="500" :maxHeight="500" :url="url" @cancel="oncancel" @ok="onok"></ksp-cropper> |
|
|
|
|
<!-- <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> |
|
|
|
|
</view> |
|
|
|
|
<view class="qudbtn" @click="qudbtn">确定</view> |
|
|
|
|
</uni-popup> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
@ -36,18 +40,18 @@ |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
top: 0, |
|
|
|
|
url: "https://bodybuilding.bsdong.cn/images/banner.png", |
|
|
|
|
url: "", |
|
|
|
|
path: "", |
|
|
|
|
yrenlianlist:[], |
|
|
|
|
jqrllist:[], |
|
|
|
|
userxixin:{}, |
|
|
|
|
type: "", |
|
|
|
|
type: "" |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(o) { |
|
|
|
|
this.type = (o.type?o.type:'') |
|
|
|
|
this.top = uni.getSystemInfoSync().statusBarHeight |
|
|
|
|
// this.memberInfo() |
|
|
|
|
this.type = o.type |
|
|
|
|
this.memberInfo() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
fanhui(){ |
|
|
|
@ -58,29 +62,66 @@ |
|
|
|
|
this.userxixin = res.data |
|
|
|
|
console.log('this.userxixin',this.userxixin); |
|
|
|
|
if(this.userxixin.face_id!=0){ |
|
|
|
|
if(this.type =='order'){ |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
uni.switchTab({ |
|
|
|
|
url:'/pages/index/index' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
pais(){ |
|
|
|
|
// this.$refs.popup.open('center') |
|
|
|
|
this.chooseImage() |
|
|
|
|
}, |
|
|
|
|
qudbtn(){ |
|
|
|
|
// this.$refs.popup.close('center') |
|
|
|
|
// var tjlist=[...this.yrenlianlist,...this.jqrllist] |
|
|
|
|
const that = this; |
|
|
|
|
uni.chooseImage({ |
|
|
|
|
count: 1, |
|
|
|
|
success: function(res) { |
|
|
|
|
that.url = res.tempFilePaths[0] |
|
|
|
|
that.$refs.popup.open("center") |
|
|
|
|
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(){ |
|
|
|
|
if(that.type == 'order'){ |
|
|
|
|
uni.navigateBack({delta:1}) |
|
|
|
|
}else{ |
|
|
|
|
uni.switchTab({ |
|
|
|
|
url:'/pages/user/index' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
},2000) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
title: data.msg, |
|
|
|
|
duration: 2000, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
chooseImage() { |
|
|
|
|
const that = this; |
|
|
|
|
that.yrenlianlist=[] |
|
|
|
@ -111,9 +152,7 @@ |
|
|
|
|
|
|
|
|
|
setTimeout(function(){ |
|
|
|
|
if(that.type == 'order'){ |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 |
|
|
|
|
}) |
|
|
|
|
uni.navigateBack({delta:1}) |
|
|
|
|
}else{ |
|
|
|
|
uni.switchTab({ |
|
|
|
|
url:'/pages/user/index' |
|
|
|
@ -126,7 +165,7 @@ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
title: data.msg, |
|
|
|
|
duration: 5000, |
|
|
|
|
duration: 2000, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -140,14 +179,15 @@ |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
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({ |
|
|
|
@ -174,7 +214,7 @@ |
|
|
|
|
} |
|
|
|
|
.imgCropper{ |
|
|
|
|
width: 750rpx; |
|
|
|
|
height: 100vh; |
|
|
|
|
height: 1200rpx; |
|
|
|
|
position: relative; |
|
|
|
|
} |
|
|
|
|
.fot { |
|
|
|
|