Compare commits
13 Commits
feat/meeti
...
main
Author | SHA1 | Date |
---|---|---|
|
3b9dcf3ad8 | 8 months ago |
|
a9ab5bcbc0 | 8 months ago |
|
f614457df1 | 8 months ago |
|
7f9adbb7a0 | 8 months ago |
|
63cbe2c2bb | 8 months ago |
|
b623d3e088 | 8 months ago |
|
8db2589a58 | 8 months ago |
|
25b5ffd7b0 | 8 months ago |
|
126fb61bee | 8 months ago |
|
28a07a8660 | 8 months ago |
|
0df518c15c | 8 months ago |
|
2110a7edcc | 8 months ago |
|
e85cfff697 | 9 months ago |
@ -1,176 +0,0 @@ |
||||
<template> |
||||
<view class="container"> |
||||
|
||||
<view class="input_box"> |
||||
<text class="input_title">{{$t('pages.user.auth.login.mobile')}}</text> |
||||
<view class="input_content"> |
||||
<u--input |
||||
:placeholder="$t('pages.user.auth.login.input_mobile')" |
||||
prefixIcon="phone" |
||||
prefixIconStyle="font-size: 24rpx;color: #909399" |
||||
v-model="form.mobile" |
||||
@change="mobileChange" |
||||
></u--input> |
||||
</view> |
||||
</view> |
||||
|
||||
|
||||
|
||||
<view class="input_box"> |
||||
<text class="input_title">{{$t('pages.user.auth.login.password')}}</text> |
||||
<view class="input_content"> |
||||
<u--input |
||||
:placeholder="$t('pages.user.auth.login.input_password')" |
||||
prefixIcon="lock" |
||||
prefixIconStyle="font-size: 24rpx;color: #909399" |
||||
border="surround" |
||||
password |
||||
clearable |
||||
v-model="form.password" |
||||
@change="pwdChange" |
||||
></u--input> |
||||
</view> |
||||
</view> |
||||
|
||||
|
||||
|
||||
<view class="button_box"> |
||||
<view class="submit"> |
||||
<u-button type="primary" :plain="true" :hairline="true" :text="$t('locale.login')" size="normal" @click="login"></u-button> |
||||
</view> |
||||
</view> |
||||
<view class="footer"> |
||||
<!-- <text class="footer-text">找回密码</text> --> |
||||
<text class="footer-text" @click="regist">{{$t('locale.regist')}}</text> |
||||
<!-- <text class="footer-text">投诉建议</text> --> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
<script> |
||||
export default { |
||||
components: { |
||||
|
||||
}, |
||||
data() { |
||||
return { |
||||
|
||||
form:{ |
||||
mobile:'', |
||||
password:'', |
||||
}, |
||||
}; |
||||
}, |
||||
onShow() { |
||||
var _this =this; |
||||
|
||||
}, |
||||
methods:{ |
||||
//跳转到注册 |
||||
regist(){ |
||||
uni.$u.route({ |
||||
type:'redirectTo', |
||||
url: 'pages/user/auth/regist', |
||||
params: {} |
||||
}); |
||||
}, |
||||
//手机号 |
||||
mobileChange(e) |
||||
{ |
||||
var _this = this; |
||||
_this.form['mobile'] = e; |
||||
|
||||
}, |
||||
//密码 |
||||
pwdChange(e) |
||||
{ |
||||
var _this = this; |
||||
_this.form['password'] = e; |
||||
}, |
||||
login(){ |
||||
var _this =this; |
||||
var form = _this.form; |
||||
if(!_this.$com.check(form.mobile,'mobile')) |
||||
{ |
||||
uni.$u.toast(_this.$t('pages.user.auth.login.mobile_must')); |
||||
return false; |
||||
} |
||||
if(form.password.length < 6) |
||||
{ |
||||
uni.$u.toast(_this.$t('pages.user.auth.login.password_must')); |
||||
return false; |
||||
} |
||||
|
||||
var post = form; |
||||
_this.$api.post('user/log',post,function(rs){ |
||||
console.log(rs); |
||||
_this.$user.session('userInfo',rs.userinfo); |
||||
_this.$user.session('token',rs.token); |
||||
uni.$u.route({ |
||||
type:'navigateBack', |
||||
delta:2, |
||||
params: {} |
||||
}); |
||||
},function(err){ |
||||
console.log(err); |
||||
}); |
||||
}, |
||||
|
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
/*输入框*/ |
||||
.input_box{ |
||||
width: 90%; |
||||
margin: 40rpx auto 40rpx auto; |
||||
height: auto; |
||||
} |
||||
.input_title{ |
||||
font-size: 30rpx; |
||||
color: #ABABAB; |
||||
height: 50rpx; |
||||
line-height: 50rpx; |
||||
margin: 10rpx auto; |
||||
display: block; |
||||
|
||||
} |
||||
|
||||
.button_box { |
||||
width: 90%; |
||||
margin: 40rpx auto 20rpx auto; |
||||
|
||||
} |
||||
|
||||
.submit { |
||||
width: 100%; |
||||
background-color: #4CAF50; |
||||
justify-content: center; |
||||
align-items: center; |
||||
border-radius: 10rpx; |
||||
} |
||||
|
||||
.submit-text { |
||||
color: white; |
||||
padding: 30rpx; |
||||
} |
||||
|
||||
.submit:active { |
||||
background-color: green; |
||||
opacity: 0.5; |
||||
} |
||||
|
||||
.footer { |
||||
flex-direction: row; |
||||
justify-content: center; |
||||
text-align: center; |
||||
align-items: center; |
||||
margin-top: 100rpx; |
||||
} |
||||
|
||||
.footer-text { |
||||
font-size: 28rpx; |
||||
color: #296db5; |
||||
padding: 30rpx; |
||||
} |
||||
</style> |
@ -1,205 +0,0 @@ |
||||
<template> |
||||
<view class="container"> |
||||
|
||||
<view class="input_box"> |
||||
<text class="input_title">{{$t('pages.user.auth.login.mobile')}}</text> |
||||
<view class="input_content"> |
||||
<u--input |
||||
:placeholder="$t('pages.user.auth.login.input_mobile')" |
||||
prefixIcon="phone" |
||||
prefixIconStyle="font-size: 24rpx;color: #909399" |
||||
type="number" |
||||
v-model="form.mobile" |
||||
@change="mobileChange" |
||||
></u--input> |
||||
</view> |
||||
</view> |
||||
|
||||
|
||||
|
||||
<view class="input_box"> |
||||
<text class="input_title">{{$t('pages.user.auth.login.password')}}</text> |
||||
<view class="input_content"> |
||||
<u--input |
||||
:placeholder="$t('pages.user.auth.login.input_password')" |
||||
prefixIcon="lock" |
||||
prefixIconStyle="font-size: 24rpx;color: #909399" |
||||
border="surround" |
||||
password |
||||
clearable |
||||
v-model="form.password" |
||||
@change="pwdChange" |
||||
></u--input> |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="input_box"> |
||||
<text class="input_title">{{$t('pages.user.auth.login.email')}}</text> |
||||
<view class="input_content"> |
||||
<u--input |
||||
:placeholder="$t('pages.user.auth.login.input_email')" |
||||
prefixIcon="email" |
||||
prefixIconStyle="font-size: 24rpx;color: #909399" |
||||
v-model="form.email" |
||||
@change="emailChange" |
||||
></u--input> |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="button_box"> |
||||
<view class="submit"> |
||||
<u-button type="primary" :plain="true" :hairline="true" :text="$t('locale.regist')" size="normal" @click="regist"></u-button> |
||||
</view> |
||||
</view> |
||||
<view class="footer"> |
||||
<!-- <text class="footer-text">找回密码</text> --> |
||||
<text class="footer-text" @click="login">{{$t('locale.login')}}</text> |
||||
<!-- <text class="footer-text">投诉建议</text> --> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
<script> |
||||
export default { |
||||
components: { |
||||
|
||||
}, |
||||
data() { |
||||
return { |
||||
form:{ |
||||
mobile:'', |
||||
password:'', |
||||
email:'', |
||||
}, |
||||
|
||||
}; |
||||
}, |
||||
onShow() { |
||||
var _this =this; |
||||
|
||||
}, |
||||
methods:{ |
||||
//跳转到登录 |
||||
login(){ |
||||
uni.$u.route({ |
||||
type:'redirectTo', |
||||
url: 'pages/user/auth/login', |
||||
params: {} |
||||
}); |
||||
}, |
||||
//手机号 |
||||
mobileChange(e) |
||||
{ |
||||
var _this = this; |
||||
_this.form['mobile'] = e; |
||||
|
||||
}, |
||||
//密码 |
||||
pwdChange(e) |
||||
{ |
||||
var _this = this; |
||||
_this.form['password'] = e; |
||||
}, |
||||
//email |
||||
emailChange(e) |
||||
{ |
||||
var _this = this; |
||||
_this.form['email'] = e; |
||||
}, |
||||
regist() |
||||
{ |
||||
var _this =this; |
||||
var form = _this.form; |
||||
if(!_this.$com.check(form.mobile,'mobile')) |
||||
{ |
||||
uni.$u.toast(_this.$t('pages.user.auth.login.mobile_must')); |
||||
return false; |
||||
} |
||||
if(form.password.length < 6) |
||||
{ |
||||
uni.$u.toast(_this.$t('pages.user.auth.login.password_must')); |
||||
return false; |
||||
} |
||||
if(!_this.$com.check(form.email,'email')) |
||||
{ |
||||
uni.$u.toast(_this.$t('pages.user.auth.login.email_must')); |
||||
return false; |
||||
} |
||||
|
||||
var post = form; |
||||
_this.$api.post('user/reg',post,function(rs){ |
||||
console.log(rs); |
||||
uni.showModal({ |
||||
title: _this.$t('locale.tips'), |
||||
content: _this.$t('pages.user.auth.regist.regist_success'), |
||||
success: function (res) { |
||||
if (res.confirm) { |
||||
console.log('用户点击确定'); |
||||
_this.login(); |
||||
} else if (res.cancel) { |
||||
console.log('用户点击取消'); |
||||
} |
||||
} |
||||
}); |
||||
},function(err){ |
||||
console.log(err); |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
/*输入框*/ |
||||
.input_box{ |
||||
width: 90%; |
||||
margin: 40rpx auto 40rpx auto; |
||||
height: auto; |
||||
} |
||||
.input_title{ |
||||
font-size: 30rpx; |
||||
color: #ABABAB; |
||||
height: 50rpx; |
||||
line-height: 50rpx; |
||||
margin: 10rpx auto; |
||||
display: block; |
||||
|
||||
} |
||||
|
||||
.button_box { |
||||
width: 90%; |
||||
margin: 40rpx auto 20rpx auto; |
||||
|
||||
} |
||||
|
||||
.submit { |
||||
width: 100%; |
||||
background-color: #4CAF50; |
||||
justify-content: center; |
||||
align-items: center; |
||||
border-radius: 10rpx; |
||||
} |
||||
|
||||
.submit-text { |
||||
color: white; |
||||
padding: 30rpx; |
||||
} |
||||
|
||||
.submit:active { |
||||
background-color: green; |
||||
opacity: 0.5; |
||||
} |
||||
|
||||
.footer { |
||||
flex-direction: row; |
||||
justify-content: center; |
||||
text-align: center; |
||||
align-items: center; |
||||
margin-top: 100rpx; |
||||
} |
||||
|
||||
.footer-text { |
||||
font-size: 28rpx; |
||||
color: #296db5; |
||||
padding: 30rpx; |
||||
} |
||||
</style> |
@ -0,0 +1,275 @@ |
||||
<template> |
||||
<view class="container"> |
||||
<custom_navbar :title="navbar_title" @getNavHeight="getNavHeight" :theme="theme" left="true" /> |
||||
<view class="xcontent" :style="'margin-top:'+margin_top+'px'"> |
||||
<view class="imgList"> |
||||
<!--如果是多个就用imgBox--> |
||||
<view class="imgBox" v-for="(item,index) in info.album_series" :key="index"> |
||||
<image :src="item.merge_image" mode="aspectFill"></image> |
||||
</view> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</view> |
||||
<view class="btnList"> |
||||
<view class="btnBox a1"> |
||||
<view class="btnImg"> |
||||
<image src="/static/img/user/delete.png" mode="widthFix"></image> |
||||
</view> |
||||
<view class="btnTxt" @click="deletePic">删除照片</view> |
||||
</view> |
||||
<view class="btnBox a2"> |
||||
<view class="btnImg"> |
||||
<image src="/static/img/user/download.png" mode="widthFix"></image> |
||||
</view> |
||||
<view class="btnTxt" @click="savePic">保存到相册</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
|
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import custom_navbar from "../../index/components/header.vue"; |
||||
export default { |
||||
components: { |
||||
custom_navbar |
||||
|
||||
}, |
||||
data() { |
||||
return { |
||||
|
||||
|
||||
|
||||
|
||||
id:0, |
||||
info:'', //详情 |
||||
|
||||
navbar_title: 'AI合影', |
||||
theme: "blue", |
||||
margin_top: 0, |
||||
|
||||
|
||||
} |
||||
}, |
||||
onLoad(option) { |
||||
//数据 |
||||
var _this =this; |
||||
var id = option.id; |
||||
if(_this.$com.isNull(id)) |
||||
{ |
||||
uni.navigateBack({ |
||||
delta:1, |
||||
}) |
||||
} |
||||
_this.id = id; |
||||
_this.getDetail(); |
||||
}, |
||||
onShow() { |
||||
var _this = this; |
||||
_this.checkAuth(); |
||||
}, |
||||
onPageScroll(e) { |
||||
if (e.scrollTop > 50) { |
||||
this.theme = 'white'; |
||||
|
||||
} else { |
||||
|
||||
this.theme = 'blue'; |
||||
|
||||
} |
||||
}, |
||||
methods: { |
||||
getNavHeight(e) { |
||||
this.margin_top += e; |
||||
}, |
||||
//判断 |
||||
checkAuth() { |
||||
var _this = this; |
||||
console.log('已授权---'); |
||||
uni.authorize({ |
||||
scope: 'scope.writePhotosAlbum', |
||||
success(res) { |
||||
console.log('已授权', res); |
||||
|
||||
}, |
||||
fail(err) { |
||||
|
||||
uni.showModal({ |
||||
title: '授权失败', |
||||
content: '请在设置界面打开存储相关权限', |
||||
success: (res) => { |
||||
if (res.confirm) { |
||||
uni.openSetting() |
||||
} |
||||
} |
||||
}) |
||||
}, |
||||
}) |
||||
}, |
||||
deletePic() |
||||
{ |
||||
var _this = this; |
||||
var id = _this.id; |
||||
|
||||
_this.$com.confirm('确认删除此次写真集吗?',function(res){ |
||||
|
||||
var post = { |
||||
id:id, |
||||
}; |
||||
_this.$api.post('api/photo_album/del', post,function(rs){ |
||||
console.log(rs); |
||||
uni.navigateBack({ |
||||
delta:1, |
||||
}) |
||||
|
||||
|
||||
}); |
||||
|
||||
|
||||
},'提示'); |
||||
}, |
||||
//保存道相册 |
||||
savePic(){ |
||||
var _this =this; |
||||
var ai_list = _this.info.album_series; |
||||
ai_list.forEach((item, index) => { |
||||
var url = item.merge_image; |
||||
uni.getSetting({ |
||||
success(res) { |
||||
console.log(res.authSetting); |
||||
if(!res.authSetting['scope.writePhotosAlbum']) |
||||
{ |
||||
uni.openSetting(); |
||||
} |
||||
else |
||||
{ |
||||
// 下载图片 |
||||
uni.downloadFile({ |
||||
url: url, |
||||
success: downloadResult => { |
||||
if (downloadResult.statusCode === 200) { |
||||
// 下载成功,保存图片到相册 |
||||
uni.saveImageToPhotosAlbum({ |
||||
filePath: downloadResult.tempFilePath, |
||||
success: () => { |
||||
uni.showToast({ |
||||
title: '保存成功' |
||||
}); |
||||
}, |
||||
fail: () => { |
||||
uni.showToast({ |
||||
title: '保存失败', |
||||
icon: 'none' |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
}, |
||||
fail: () => { |
||||
uni.showToast({ |
||||
title: '下载失败', |
||||
icon: 'none' |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
}) |
||||
}); |
||||
|
||||
|
||||
|
||||
}, |
||||
getDetail() |
||||
{ |
||||
var _this = this; |
||||
var id = _this.id; |
||||
if(id == 0) |
||||
{ |
||||
uni.navigateBack({ |
||||
delta:1, |
||||
}); |
||||
return; |
||||
} |
||||
var post = { |
||||
id:id, |
||||
}; |
||||
_this.$api.get('api/photo_album/details', post,function(rs){ |
||||
console.log(rs); |
||||
var Data = rs; |
||||
Data.album_series.forEach((item, index) => { |
||||
if(item.status == 3) |
||||
{ |
||||
Data.album_series[index].merge_image = _this.$api.ossurl(item.merge_image); |
||||
} |
||||
else |
||||
{ |
||||
Data.album_series[index].merge_image = _this.$api.ossurl(item.back_image); |
||||
} |
||||
}); |
||||
_this.info = Data; |
||||
|
||||
|
||||
}); |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
.container{width: 100%; padding-top: 20rpx;} |
||||
.xcontent{ width: 710rpx; height: auto; margin: 0rpx auto;} |
||||
.imgList{width: 100%; height: auto; |
||||
display: flex; flex-wrap: wrap; |
||||
justify-content: space-between; |
||||
align-items: center; /* 如果需要垂直居中子元素 */ |
||||
} |
||||
.imgBox{width: 340rpx; height: 440rpx; margin-bottom: 20rpx; } |
||||
.imgBox image{width: 340rpx; height: 440rpx; border-radius: 24rpx;} |
||||
|
||||
|
||||
.picBox{width: 660rpx; height: 770rpx; margin-top: 20rpx;margin-bottom: 20rpx; } |
||||
.picBox image{width: 660rpx; height: 770rpx; border-radius: 24rpx;} |
||||
|
||||
.btnList{ |
||||
width: 100%; height: 88rpx; |
||||
display: flex; flex-wrap: wrap; |
||||
justify-content: space-around; /* 使子元素在容器中均匀分布 */ |
||||
align-items: center; /* 如果需要垂直居中子元素 */ |
||||
} |
||||
.btnBox{ |
||||
width: 340rpx; height: 88rpx; |
||||
border-radius: 44rpx; |
||||
display: flex; |
||||
} |
||||
.btnBox .btnImg{ |
||||
width:126rpx ; |
||||
height: 88rpx; |
||||
} |
||||
.btnBox .btnImg image{ |
||||
width:30rpx ; |
||||
height: 30rpx; |
||||
margin-top: 29rpx; |
||||
margin-left: 80rpx; |
||||
} |
||||
.btnBox .btnTxt{ |
||||
width:214rpx ; |
||||
height: 88rpx; |
||||
font-weight: 700; |
||||
font-size: 30rpx; |
||||
line-height: 88rpx; |
||||
} |
||||
.a1{ |
||||
background: linear-gradient( 270deg, rgba(46,87,241,0.15) 0%, rgba(131,88,246,0.15) 100%); |
||||
color:#7A74F0; |
||||
} |
||||
.a2{ |
||||
background: linear-gradient( 270deg, #2E57F1 0%, #8358F6 100%); |
||||
color:#FFFFFF; |
||||
} |
||||
</style> |
||||
|
@ -0,0 +1,279 @@ |
||||
<template> |
||||
<view class="container"> |
||||
<custom_navbar :title="navbar_title" @getNavHeight="getNavHeight" :theme="theme" left="true" /> |
||||
<view class="xcontent" :style="'margin-top:'+margin_top+'px'"> |
||||
<view class="imgList"> |
||||
<!--如果是多个就用imgBox--> |
||||
<!-- <view class="imgBox"> |
||||
<image src="/static/img/index/pic.png" mode="aspectFill"></image> |
||||
</view> |
||||
|
||||
<view class="imgBox"> |
||||
<image src="/static/img/index/pic.png" mode="aspectFill"></image> |
||||
</view> |
||||
<view class="imgBox"> |
||||
<image src="/static/img/index/pic.png" mode="aspectFill"></image> |
||||
</view> |
||||
<view class="imgBox"> |
||||
<image src="/static/img/index/pic.png" mode="aspectFill"></image> |
||||
</view> --> |
||||
<!--如果是一个就用picBox--> |
||||
<view class="picBox"> |
||||
<image :src="xurl" mode="aspectFill"></image> |
||||
</view> |
||||
|
||||
|
||||
</view> |
||||
<view class="btnList"> |
||||
<view class="btnBox a1"> |
||||
<view class="btnImg"> |
||||
<image src="/static/img/user/delete.png" mode="widthFix"></image> |
||||
</view> |
||||
<view class="btnTxt" @click="deletePic">删除照片</view> |
||||
</view> |
||||
<view class="btnBox a2"> |
||||
<view class="btnImg"> |
||||
<image src="/static/img/user/download.png" mode="widthFix"></image> |
||||
</view> |
||||
<view class="btnTxt" @click="savePic">保存到相册</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import custom_navbar from "../../index/components/header.vue"; |
||||
export default { |
||||
components: { |
||||
custom_navbar |
||||
|
||||
}, |
||||
data() { |
||||
return { |
||||
id:0, |
||||
info:'', //详情 |
||||
xurl:'', |
||||
|
||||
navbar_title: '卡通画风', |
||||
theme: "blue", |
||||
margin_top: 0, |
||||
|
||||
} |
||||
}, |
||||
onLoad(option) { |
||||
//数据 |
||||
var _this =this; |
||||
var id = option.id; |
||||
if(_this.$com.isNull(id)) |
||||
{ |
||||
uni.navigateBack({ |
||||
delta:1, |
||||
}) |
||||
} |
||||
_this.id = id; |
||||
_this.getDetail(); |
||||
}, |
||||
onShow() { |
||||
var _this = this; |
||||
_this.checkAuth(); |
||||
}, |
||||
onPageScroll(e) { |
||||
if (e.scrollTop > 50) { |
||||
this.theme = 'white'; |
||||
|
||||
} else { |
||||
|
||||
this.theme = 'blue'; |
||||
|
||||
} |
||||
}, |
||||
methods: { |
||||
getNavHeight(e) { |
||||
this.margin_top += e; |
||||
}, |
||||
|
||||
//判断 |
||||
checkAuth() { |
||||
var _this = this; |
||||
console.log('已授权---'); |
||||
uni.authorize({ |
||||
scope: 'scope.writePhotosAlbum', |
||||
success(res) { |
||||
console.log('已授权', res); |
||||
|
||||
}, |
||||
fail(err) { |
||||
|
||||
uni.showModal({ |
||||
title: '授权失败', |
||||
content: '请在设置界面打开存储相关权限', |
||||
success: (res) => { |
||||
if (res.confirm) { |
||||
uni.openSetting() |
||||
} |
||||
} |
||||
}) |
||||
}, |
||||
}) |
||||
}, |
||||
deletePic() |
||||
{ |
||||
var _this = this; |
||||
var id = _this.id; |
||||
|
||||
_this.$com.confirm('确认删除此张卡通风吗?',function(res){ |
||||
|
||||
var post = { |
||||
id:id, |
||||
}; |
||||
_this.$api.post('api/photo_cartoon/del', post,function(rs){ |
||||
console.log(rs); |
||||
uni.navigateBack({ |
||||
delta:1, |
||||
}) |
||||
|
||||
|
||||
}); |
||||
|
||||
|
||||
},'提示'); |
||||
}, |
||||
//保存道相册 |
||||
savePic(){ |
||||
var _this =this; |
||||
var url = _this.xurl; |
||||
uni.getSetting({ |
||||
success(res) { |
||||
console.log(res.authSetting); |
||||
if(!res.authSetting['scope.writePhotosAlbum']) |
||||
{ |
||||
uni.openSetting(); |
||||
} |
||||
else |
||||
{ |
||||
// 下载图片 |
||||
uni.downloadFile({ |
||||
url: url, |
||||
success: downloadResult => { |
||||
if (downloadResult.statusCode === 200) { |
||||
// 下载成功,保存图片到相册 |
||||
uni.saveImageToPhotosAlbum({ |
||||
filePath: downloadResult.tempFilePath, |
||||
success: () => { |
||||
uni.showToast({ |
||||
title: '保存成功' |
||||
}); |
||||
}, |
||||
fail: () => { |
||||
uni.showToast({ |
||||
title: '保存失败', |
||||
icon: 'none' |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
}, |
||||
fail: () => { |
||||
uni.showToast({ |
||||
title: '下载失败', |
||||
icon: 'none' |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
}) |
||||
|
||||
|
||||
}, |
||||
getDetail() |
||||
{ |
||||
var _this = this; |
||||
var id = _this.id; |
||||
if(id == 0) |
||||
{ |
||||
uni.navigateBack({ |
||||
delta:1, |
||||
}); |
||||
return; |
||||
} |
||||
var post = { |
||||
id:id, |
||||
}; |
||||
_this.$api.get('api/photo_cartoon/details', post,function(rs){ |
||||
console.log(rs); |
||||
var Data = rs; |
||||
if(Data.status == 3) |
||||
{ |
||||
_this.xurl = _this.$api.ossurl(Data.merge_image); |
||||
} |
||||
else |
||||
{ |
||||
_this.xurl = _this.$api.ossurl(Data.users_image); |
||||
} |
||||
Data.merge_image = _this.$api.ossurl(Data.merge_image); |
||||
Data.users_image = _this.$api.ossurl(Data.users_image); |
||||
|
||||
_this.info = Data; |
||||
|
||||
|
||||
}); |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
.container{width: 100%; padding-top: 20rpx;} |
||||
.xcontent{ width: 710rpx; height: auto; margin: 0rpx auto;} |
||||
.imgList{width: 100%; height: auto; |
||||
display: flex; flex-wrap: wrap; |
||||
justify-content: space-around; |
||||
align-items: center; /* 如果需要垂直居中子元素 */ |
||||
} |
||||
.imgBox{width: 340rpx; height: 440rpx; margin-bottom: 20rpx; } |
||||
.imgBox image{width: 340rpx; height: 440rpx; border-radius: 24rpx;} |
||||
|
||||
|
||||
.picBox{width: 660rpx; height: 770rpx; margin-top: 20rpx;margin-bottom: 20rpx; } |
||||
.picBox image{width: 660rpx; height: 770rpx; border-radius: 24rpx;} |
||||
|
||||
.btnList{ |
||||
width: 100%; height: 88rpx; |
||||
display: flex; flex-wrap: wrap; |
||||
justify-content: space-around; /* 使子元素在容器中均匀分布 */ |
||||
align-items: center; /* 如果需要垂直居中子元素 */ |
||||
} |
||||
.btnBox{ |
||||
width: 340rpx; height: 88rpx; |
||||
border-radius: 44rpx; |
||||
display: flex; |
||||
} |
||||
.btnBox .btnImg{ |
||||
width:126rpx ; |
||||
height: 88rpx; |
||||
} |
||||
.btnBox .btnImg image{ |
||||
width:30rpx ; |
||||
height: 30rpx; |
||||
margin-top: 29rpx; |
||||
margin-left: 80rpx; |
||||
} |
||||
.btnBox .btnTxt{ |
||||
width:214rpx ; |
||||
height: 88rpx; |
||||
font-weight: 700; |
||||
font-size: 30rpx; |
||||
line-height: 88rpx; |
||||
} |
||||
.a1{ |
||||
background: linear-gradient( 270deg, rgba(46,87,241,0.15) 0%, rgba(131,88,246,0.15) 100%); |
||||
color:#7A74F0; |
||||
} |
||||
.a2{ |
||||
background: linear-gradient( 270deg, #2E57F1 0%, #8358F6 100%); |
||||
color:#FFFFFF; |
||||
} |
||||
</style> |
||||
|
@ -0,0 +1,249 @@ |
||||
<template> |
||||
<view class="container"> |
||||
<custom_navbar :title="navbar_title" @getNavHeight="getNavHeight" :theme="theme" left="true" /> |
||||
<view class="xcontent" :style="'margin-top:'+margin_top+'px'"> |
||||
<view class="imgList"> |
||||
<!--如果是多个就用imgBox--> |
||||
<!-- <view class="imgBox"> |
||||
<image src="/static/img/index/pic.png" mode="aspectFill"></image> |
||||
</view> |
||||
|
||||
<view class="imgBox"> |
||||
<image src="/static/img/index/pic.png" mode="aspectFill"></image> |
||||
</view> |
||||
<view class="imgBox"> |
||||
<image src="/static/img/index/pic.png" mode="aspectFill"></image> |
||||
</view> |
||||
<view class="imgBox"> |
||||
<image src="/static/img/index/pic.png" mode="aspectFill"></image> |
||||
</view> --> |
||||
<!--如果是一个就用picBox--> |
||||
<!-- <view class="picBox"> |
||||
<image src="/static/img/index/pic.png" mode="aspectFill"></image> |
||||
</view> --> |
||||
<view class="picBox"> |
||||
<image :src="xurl" mode="aspectFill"></image> |
||||
</view> |
||||
|
||||
</view> |
||||
<view class="btnList"> |
||||
<view class="btnBox a1"> |
||||
<view class="btnImg"> |
||||
<image src="/static/img/user/delete.png" mode="widthFix"></image> |
||||
</view> |
||||
<view class="btnTxt" @click="deletePic">删除照片</view> |
||||
</view> |
||||
<view class="btnBox a2"> |
||||
<view class="btnImg"> |
||||
<image src="/static/img/user/download.png" mode="widthFix"></image> |
||||
</view> |
||||
<view class="btnTxt" @click="savePic">保存到相册</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import custom_navbar from "../../index/components/header.vue"; |
||||
export default { |
||||
components: { |
||||
custom_navbar |
||||
|
||||
}, |
||||
data() { |
||||
return { |
||||
id:0, |
||||
old_url:'', |
||||
xurl:'', |
||||
|
||||
navbar_title: '换底色', |
||||
theme: "blue", |
||||
margin_top: 0, |
||||
} |
||||
}, |
||||
onLoad(option) { |
||||
//数据 |
||||
var _this =this; |
||||
var id = option.id; |
||||
var url = option.url; |
||||
if(_this.$com.isNull(url) || _this.$com.isNull(id)) |
||||
{ |
||||
uni.navigateBack({ |
||||
delta:1, |
||||
}) |
||||
} |
||||
_this.id = id; |
||||
_this.old_url = url; |
||||
_this.xurl = decodeURIComponent(url); |
||||
}, |
||||
onShow() { |
||||
var _this = this; |
||||
_this.checkAuth(); |
||||
}, |
||||
onPageScroll(e) { |
||||
if (e.scrollTop > 50) { |
||||
this.theme = 'white'; |
||||
|
||||
} else { |
||||
|
||||
this.theme = 'blue'; |
||||
|
||||
} |
||||
}, |
||||
methods: { |
||||
getNavHeight(e) { |
||||
this.margin_top += e; |
||||
}, |
||||
|
||||
//判断 |
||||
checkAuth() { |
||||
var _this = this; |
||||
console.log('已授权---'); |
||||
uni.authorize({ |
||||
scope: 'scope.writePhotosAlbum', |
||||
success(res) { |
||||
console.log('已授权', res); |
||||
|
||||
}, |
||||
fail(err) { |
||||
|
||||
uni.showModal({ |
||||
title: '授权失败', |
||||
content: '请在设置界面打开存储相关权限', |
||||
success: (res) => { |
||||
if (res.confirm) { |
||||
uni.openSetting() |
||||
} |
||||
} |
||||
}) |
||||
}, |
||||
}) |
||||
}, |
||||
deletePic() |
||||
{ |
||||
var _this = this; |
||||
var id = _this.id; |
||||
|
||||
_this.$com.confirm('确认删除此张换底色照吗?',function(res){ |
||||
|
||||
var post = { |
||||
id:id, |
||||
}; |
||||
_this.$api.post('api/photo_back_color/del', post,function(rs){ |
||||
console.log(rs); |
||||
uni.navigateBack({ |
||||
delta:1, |
||||
}) |
||||
|
||||
|
||||
}); |
||||
|
||||
|
||||
},'提示'); |
||||
}, |
||||
//保存道相册 |
||||
savePic(){ |
||||
var _this =this; |
||||
var url = _this.xurl; |
||||
uni.getSetting({ |
||||
success(res) { |
||||
console.log(res.authSetting); |
||||
if(!res.authSetting['scope.writePhotosAlbum']) |
||||
{ |
||||
uni.openSetting(); |
||||
} |
||||
else |
||||
{ |
||||
// 下载图片 |
||||
uni.downloadFile({ |
||||
url: url, |
||||
success: downloadResult => { |
||||
if (downloadResult.statusCode === 200) { |
||||
// 下载成功,保存图片到相册 |
||||
uni.saveImageToPhotosAlbum({ |
||||
filePath: downloadResult.tempFilePath, |
||||
success: () => { |
||||
uni.showToast({ |
||||
title: '保存成功' |
||||
}); |
||||
}, |
||||
fail: () => { |
||||
uni.showToast({ |
||||
title: '保存失败', |
||||
icon: 'none' |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
}, |
||||
fail: () => { |
||||
uni.showToast({ |
||||
title: '下载失败', |
||||
icon: 'none' |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
}) |
||||
|
||||
|
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
.container{width: 100%; padding-top: 20rpx;} |
||||
.xcontent{ width: 710rpx; height: auto; margin: 0rpx auto;} |
||||
.imgList{width: 100%; height: auto; |
||||
display: flex; flex-wrap: wrap; |
||||
justify-content: space-around; /* 使子元素在容器中均匀分布 */ |
||||
align-items: center; /* 如果需要垂直居中子元素 */ |
||||
} |
||||
.imgBox{width: 340rpx; height: 440rpx; margin-bottom: 20rpx; } |
||||
.imgBox image{width: 340rpx; height: 440rpx; border-radius: 24rpx;} |
||||
|
||||
|
||||
.picBox{width: 660rpx; height: 770rpx; margin-top: 20rpx;margin-bottom: 20rpx; } |
||||
.picBox image{width: 660rpx; height: 770rpx; border-radius: 24rpx;} |
||||
|
||||
.btnList{ |
||||
width: 100%; height: 88rpx; |
||||
display: flex; flex-wrap: wrap; |
||||
justify-content: space-around; /* 使子元素在容器中均匀分布 */ |
||||
align-items: center; /* 如果需要垂直居中子元素 */ |
||||
} |
||||
.btnBox{ |
||||
width: 340rpx; height: 88rpx; |
||||
border-radius: 44rpx; |
||||
display: flex; |
||||
} |
||||
.btnBox .btnImg{ |
||||
width:126rpx ; |
||||
height: 88rpx; |
||||
} |
||||
.btnBox .btnImg image{ |
||||
width:30rpx ; |
||||
height: 30rpx; |
||||
margin-top: 29rpx; |
||||
margin-left: 80rpx; |
||||
} |
||||
.btnBox .btnTxt{ |
||||
width:214rpx ; |
||||
height: 88rpx; |
||||
font-weight: 700; |
||||
font-size: 30rpx; |
||||
line-height: 88rpx; |
||||
} |
||||
.a1{ |
||||
background: linear-gradient( 270deg, rgba(46,87,241,0.15) 0%, rgba(131,88,246,0.15) 100%); |
||||
color:#7A74F0; |
||||
} |
||||
.a2{ |
||||
background: linear-gradient( 270deg, #2E57F1 0%, #8358F6 100%); |
||||
color:#FFFFFF; |
||||
} |
||||
</style> |
||||
|
@ -1,77 +0,0 @@ |
||||
<template> |
||||
<view> |
||||
<view class="content "> |
||||
<custom_navbar :title="navbar_title" @getNavHeight="getNavHeight" :theme="theme" /> |
||||
<view class="photo_main_face" :style="'margin-top:-'+margin_top+'px'"> |
||||
<view class="photo_main_face_head"></view> |
||||
<view class="photo_success_1"> |
||||
<image src="/static/img/common/photo_c1.png"/> |
||||
</view> |
||||
<view class="photo_success_2">生成已提交</view> |
||||
<view class="photo_success_3"> |
||||
<view>目前排队人数较多,请耐心等待</view> |
||||
<view>可去<text>【我的】</text>页面查看生成结果</view> |
||||
</view> |
||||
<view class="photo_success_4" @click="backIndex"> |
||||
<image src="/static/img/common/photo_c2.png"/> |
||||
</view> |
||||
</view> |
||||
|
||||
</view> |
||||
|
||||
|
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import custom_navbar from "./components/photo_header.vue"; |
||||
export default { |
||||
components: { |
||||
custom_navbar |
||||
|
||||
}, |
||||
data() { |
||||
return { |
||||
navbar_title: '', |
||||
theme: "blue", |
||||
margin_top: 0, |
||||
|
||||
|
||||
} |
||||
}, |
||||
|
||||
mounted() { |
||||
|
||||
}, |
||||
onPageScroll(e) { |
||||
if (e.scrollTop > 50) { |
||||
this.theme = 'white'; |
||||
|
||||
} else { |
||||
|
||||
this.theme = 'blue'; |
||||
} |
||||
}, |
||||
methods: { |
||||
|
||||
getNavHeight(e) { |
||||
this.margin_top += e; |
||||
}, |
||||
backIndex() |
||||
{ |
||||
uni.switchTab({ |
||||
url:'/pages/index/index', |
||||
}) |
||||
}, |
||||
|
||||
|
||||
|
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
@import './this.scss'; |
||||
|
||||
|
||||
</style> |
Before Width: | Height: | Size: 750 B |
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 588 B |
Before Width: | Height: | Size: 865 B After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 733 B |
Before Width: | Height: | Size: 866 B After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 764 B |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 93 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 274 B |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 762 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 886 B |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 721 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 805 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 902 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 401 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 7.8 KiB |