main
123456 2 weeks ago
parent 22329c539d
commit 552d8e2305
  1. 105
      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'> <uni-popup ref="popup" background-color="#fff" :mask-click='false'>
<view class="imgCropper"> <view class="imgCropper">
<!-- <button @click="chooseImage">选择图片</button> --> <ksp-cropper mode="free" :maxWidth="500" :maxHeight="500" :url="url" @cancel="oncancel" @ok="onok"></ksp-cropper>
<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>
<view class="qudbtn" @click="qudbtn">确定</view>
</uni-popup> </uni-popup>
</view> </view>
</view> </view>
@ -41,16 +36,18 @@
data() { data() {
return { return {
top: 0, top: 0,
url: "", url: "https://bodybuilding.bsdong.cn/images/banner.png",
path: "", path: "",
yrenlianlist:[], yrenlianlist:[],
jqrllist:[], jqrllist:[],
userxixin:{} userxixin:{},
type: "",
} }
}, },
onLoad() { onLoad(o) {
this.type = (o.type?o.type:'')
this.top = uni.getSystemInfoSync().statusBarHeight this.top = uni.getSystemInfoSync().statusBarHeight
this.memberInfo() // this.memberInfo()
}, },
methods: { methods: {
fanhui(){ fanhui(){
@ -61,62 +58,29 @@
this.userxixin = res.data this.userxixin = res.data
console.log('this.userxixin',this.userxixin); console.log('this.userxixin',this.userxixin);
if(this.userxixin.face_id!=0){ if(this.userxixin.face_id!=0){
uni.switchTab({ if(this.type =='order'){
url:'/pages/index/index' uni.navigateBack({
}) delta: 1
})
}else{
uni.switchTab({
url:'/pages/index/index'
})
}
} }
}) })
}, },
pais(){ pais(){
// this.$refs.popup.open('center') const that = this;
this.chooseImage() 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() { chooseImage() {
const that = this; const that = this;
that.yrenlianlist=[] that.yrenlianlist=[]
@ -146,9 +110,15 @@
}); });
setTimeout(function(){ setTimeout(function(){
uni.switchTab({ if(that.type =='order'){
url:'/pages/user/index' uni.navigateBack({
}) delta: 1
})
}else{
uni.switchTab({
url:'/pages/user/index'
})
}
},2000) },2000)
} }
}) })
@ -156,7 +126,7 @@
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: data.msg, title: data.msg,
duration: 2000, duration: 5000,
}); });
} }
@ -170,15 +140,14 @@
}); });
}, },
onok(ev) { onok(ev) {
this.jqrllist=[]
this.url = ""; this.url = "";
this.$refs.popup.close()
this.path = ev.path; this.path = ev.path;
this.jqrllist.push(this.path)
console.log('this.path',this.path);
}, },
oncancel() { oncancel() {
// url // url
this.url = ""; this.url = "";
this.$refs.popup.close()
}, },
previous() { previous() {
uni.switchTab({ uni.switchTab({
@ -205,7 +174,7 @@
} }
.imgCropper{ .imgCropper{
width: 750rpx; width: 750rpx;
height: 1200rpx; height: 100vh;
position: relative; position: relative;
} }
.fot { .fot {

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

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

@ -18,10 +18,7 @@
<image class="image" :class="{transit: transit}" :src="url"/> <image class="image" :class="{transit: transit}" :src="url"/>
</view> </view>
</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-top" @touchstart="mwx.touchstart"></view>
<view class="frame-left-bottom" @touchstart="mwx.touchstart"></view> <view class="frame-left-bottom" @touchstart="mwx.touchstart"></view>
<view class="frame-right-top" @touchstart="mwx.touchstart"></view> <view class="frame-right-top" @touchstart="mwx.touchstart"></view>

Loading…
Cancel
Save