main
123456 2 weeks ago
parent 22329c539d
commit 552d8e2305
  1. 107
      pages/face/face.vue
  2. 8
      pages/index/index.vue
  3. 4
      pages/order/order.vue
  4. 5
      uni_modules/ksp-cropper/components/ksp-cropper/ksp-cropper.vue

@ -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()
},
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,
});
}
}
});
const that = this;
uni.chooseImage({
count: 1,
success: function(res) {
that.url = res.tempFilePaths[0]
that.$refs.popup.open("center")
}
});
},
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 {

@ -92,10 +92,10 @@
}
},
onShareAppMessage() {
return {
title: '运动湾24小时健身',
path: '/pages/index/index'
}
return {
title: '运动湾24小时健身',
path: '/pages/index/index'
}
},
onLoad() {
const that = this;

@ -89,9 +89,9 @@
that.vipxinxi = vipxinxi
that.mandianxinxi = tuijianlist
that.top = uni.getSystemInfoSync().statusBarHeight
this.memberInfo();
},
onShow() {
this.memberInfo();
var xzmd = uni.getStorageSync('xzmd')
console.log('xzmd',xzmd);
if (xzmd != '') {
@ -140,7 +140,7 @@
success(res) {
if(res.confirm){
uni.navigateTo({
url: "/pages/face/face"
url: "/pages/face/face?type=order"
})
}
}

@ -18,10 +18,7 @@
<image class="image" :class="{transit: transit}" :src="url"/>
</view>
</view>
<view class="line-one"></view>
<view class="line-two"></view>
<view class="line-three"></view>
<view class="line-four"></view>
<!-- <view class="frame-left-top" @touchstart="mwx.touchstart"></view>
<view class="frame-left-bottom" @touchstart="mwx.touchstart"></view>
<view class="frame-right-top" @touchstart="mwx.touchstart"></view>

Loading…
Cancel
Save