main
JING 8 months ago
parent a6590a6d4b
commit 9766d8d03f
  1. 102
      pages/user/archives/detail.vue
  2. 158
      pages/user/index.vue
  3. 25
      pagesA/color/index.vue

@ -1,73 +1,15 @@
<template>
<view class="container">
<view class="imgList">
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
<view class="imgList" v-if="imgList.length > 0">
<view class="imgBox" v-for="(item,index) in imgList" :key="index">
<image :src="item" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
<view class="imgBox">
<image src="/static/img/user/user.png" mode="aspectFill"></image>
</view>
</view>
<u-empty icon="/static/img/user/nodata.png" mode="list" text="你还没有面部档案" width="180rpx" marginTop="120px"></u-empty>
<view class="newBtn">去创建</view>
<u-empty icon="/static/img/user/nodata.png" mode="list" text="你还没有面部档案" width="180rpx" marginTop="120px" v-if="imgList.length == 0"></u-empty>
<view class="newBtn" v-if="imgList.length == 0" @click="newInfo">去创建</view>
</view>
</template>
@ -75,11 +17,41 @@
export default {
data() {
return {
id:0,
imgList:[],
}
},
onLoad(options){
var _this =this;
console.log('options', options);
_this.id = options.id;
_this.getDetail();
},
methods: {
getDetail()
{
var _this =this;
var id = _this.id;
if(id > 0)
{
var post ={id:_this.id};
_this.$api.get('api/portrait/details',post,function(rs){
console.log('档案详情',rs);
var imgs = rs.users_images;
imgs.forEach((item, index) => {
imgs[index] = _this.$api.ossurl(item);
})
_this.imgList = imgs;
});
}
},
newInfo(){
uni.navigateTo({
url:'/pagesA/merge/face_1'
})
},
}
}
</script>

@ -26,15 +26,16 @@
<view class="mb_desc">分享可解锁新面部档案</view>
</view>
<view class="mright">
<view class="mbItem" @click="goTo('/pages/user/archives/detail')">
<image src="/static/img/user/have.png" mode="widthFix"></image>
<view class="mbItem" v-for="(item,index) in portraitList" :key="index">
<image v-if="item.can == true" :src="item.image" mode="widthFix" @click="goTo('/pages/user/archives/detail?id='+item.id)"></image>
<image v-if="item.can == false" :src="item.image" mode="widthFix"></image>
</view>
<view class="mbItem">
<!-- <view class="mbItem">
<image src="/static/img/user/have_no.png" mode="widthFix"></image>
</view>
<view class="mbItem">
<image src="/static/img/user/have_no.png" mode="widthFix"></image>
</view>
</view> -->
</view>
</view>
</view>
@ -173,16 +174,18 @@ export default {
},
tabList: [
{
name: 'AI写真',
}, {
name: '证件照合成',
}, {
name: '证件照换色'
name: '证件照换色',
}, {
name: 'AI写真'
}, {
name: '卡通风格'
}
],
current:0,
current:0,
//
portraitList:[],
};
},
@ -202,7 +205,8 @@ export default {
onShow() {
var _this =this;
_this.getUserInfo();
//
_this.getPortraitList();
},
onShareAppMessage() {
@ -231,7 +235,7 @@ export default {
var _this =this;
var post ={};
_this.$api.get('api/userInfo',post,function(rs){
console.log('用户信息',rs);
//console.log('',rs);
var oldToken = _this.$user.session('token');
//
_this.$user.session('userInfo',rs);
@ -279,118 +283,38 @@ export default {
console.log(e);
_this.current = e.index;
},
tools(item)
{
//
getPortraitList(){
var _this =this;
if(item.type == 'service')
{
var phone = _this.$user.session('servicePhone');
uni.makePhoneCall({
phoneNumber: phone,
success(res) {
console.log(res);
},
fail(err) {
console.log(err);
},
});
}
else
var config = _this.$user.session('app_config');
var all = config.photo.photo_model_number; //
var user = _this.$user.session('userInfo');
var can_num = user.attach.user_face.available_number; //使
var use_num = user.attach.user_face.used_already_number;//使
var baseList = [];
for (var i=1; i<= all; i++)
{
uni.$u.route({
type:'navigateTo',
url: item.url,
});
}
},
//
openVideo(){
var _this =this;
_this.video_show = true;
},
videoErrorCallback(e)
{
console.log(e);
},
closeVideo(){
var _this =this;
_this.video_show = false;
_this.videoContext.pause = true;
},
getPhoneNumber(e){
var _this =this;
var detail = e.detail;
console.log(detail);
if (detail.errMsg === 'getPhoneNumber:ok') {
_this.getPhoneApi(detail);
} else {
_this.$com.alert('授权失败')
//console.log(i,can_num);
if(i <= can_num)
{
baseList.push({id:0,image:'/static/img/user/have.png',can:true});
}
else
{
baseList.push({id:0,image:'/static/img/user/have_no.png',can:false});
}
}
},
getPhoneApi(detail){
var _this = this;
var openid = _this.$user.session('openid');
var post ={
code: detail.code,
};
_this.$api.post('ycl/user/wx-phone',post,function(rs){
console.log(rs);
var phoneNumber = rs;
_this.userInfo.phoneNumber = phoneNumber;
if(_this.$com.isNull(openid))
var post ={};
_this.$api.get('api/portrait/list',post,function(rs){
console.log('档案信息',rs);
if(rs.length > 0)
{
_this.$com.alert('切换失败,请退出并重新进入小程序重试');
rs.forEach((item, index) => {
baseList[index].id = item.id;
})
}
// #ifdef MP
//
uni.getProvider({
service: 'oauth',
success: function (res) {
console.log(res.provider)
var provider = res.provider[0];
uni.login({
provider:provider,
scopes:'auth_base',
success: function (login) {
console.log(login);
//
var xpost = {
loginCode: login.code,
phoneNumber:phoneNumber,
};
_this.$api.post('ycl/user/wx-login', xpost,function(resx){
console.log(resx);
_this.$user.session('openid',resx.wxOpenid);
_this.$user.session('user_id',resx.id);
if(!_this.$com.isNull(resx.token))
{
_this.$user.session('token',resx.token);
}
_this.isLogin = true;
_this.getUserInfo();
});
},
fail:function(rs){
console.log('登录失败'+rs.errMsg);
}
});
}
});
// #endif
},function(err){
console.log(err);
});
_this.portraitList = baseList;
});
},

@ -1,5 +1,7 @@
<template>
<view class="container">
<custom_navbar :title="navbar_title" @getNavHeight="getNavHeight" :theme="theme" />
<view class="topSpace" :style="'margin-top:-'+margin_top+'px'"></view>
<view class="uploadBox">
<view class="uploadBtn">
<view class="uploadBtn_img">
@ -72,9 +74,19 @@
</template>
<script>
import custom_navbar from "../photo/components/photo_header.vue";
export default {
components: {
custom_navbar
},
data() {
return {
navbar_title: '证件照换底色',
theme: "blue",
margin_top: 0,
//
show: false,
content: `<p>1.人物需抬头挺胸,两眼平视前方</p>
@ -91,7 +103,19 @@
}
},
onPageScroll(e) {
if (e.scrollTop > 50) {
this.theme = 'white';
} else {
this.theme = 'blue';
}
},
methods: {
getNavHeight(e) {
this.margin_top += e;
},
//
scroll1(e) {
console.log(e);
@ -118,6 +142,7 @@
<style lang="scss">
page{background-color: #F5F6FB;}
.container{width: 100%;}
.topSpace{ width: 100%; height: 100rpx;}
.uploadBox{
width: 400rpx;
height: 500rpx;

Loading…
Cancel
Save