main
JING 11 months ago
parent a6590a6d4b
commit 9766d8d03f
  1. 100
      pages/user/archives/detail.vue
  2. 146
      pages/user/index.vue
  3. 25
      pagesA/color/index.vue

@ -1,73 +1,15 @@
<template> <template>
<view class="container"> <view class="container">
<view class="imgList"> <view class="imgList" v-if="imgList.length > 0">
<view class="imgBox"> <view class="imgBox" v-for="(item,index) in imgList" :key="index">
<image src="/static/img/user/user.png" mode="aspectFill"></image> <image :src="item" mode="aspectFill"></image>
</view> </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> </view>
<u-empty icon="/static/img/user/nodata.png" mode="list" text="你还没有面部档案" width="180rpx" marginTop="120px"></u-empty> <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">去创建</view> <view class="newBtn" v-if="imgList.length == 0" @click="newInfo">去创建</view>
</view> </view>
</template> </template>
@ -75,11 +17,41 @@
export default { export default {
data() { data() {
return { return {
id:0,
imgList:[],
} }
}, },
onLoad(options){
var _this =this;
console.log('options', options);
_this.id = options.id;
_this.getDetail();
},
methods: { 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> </script>

@ -26,15 +26,16 @@
<view class="mb_desc">分享可解锁新面部档案</view> <view class="mb_desc">分享可解锁新面部档案</view>
</view> </view>
<view class="mright"> <view class="mright">
<view class="mbItem" @click="goTo('/pages/user/archives/detail')"> <view class="mbItem" v-for="(item,index) in portraitList" :key="index">
<image src="/static/img/user/have.png" mode="widthFix"></image> <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>
<view class="mbItem"> <!-- <view class="mbItem">
<image src="/static/img/user/have_no.png" mode="widthFix"></image> <image src="/static/img/user/have_no.png" mode="widthFix"></image>
</view> </view>
<view class="mbItem"> <view class="mbItem">
<image src="/static/img/user/have_no.png" mode="widthFix"></image> <image src="/static/img/user/have_no.png" mode="widthFix"></image>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
@ -173,16 +174,18 @@ export default {
}, },
tabList: [ tabList: [
{ {
name: 'AI写真',
}, {
name: '证件照合成', name: '证件照合成',
}, { }, {
name: '证件照换色' name: '证件照换色',
}, {
name: 'AI写真'
}, { }, {
name: '卡通风格' name: '卡通风格'
} }
], ],
current:0, current:0,
//
portraitList:[],
}; };
}, },
@ -202,7 +205,8 @@ export default {
onShow() { onShow() {
var _this =this; var _this =this;
_this.getUserInfo(); _this.getUserInfo();
//
_this.getPortraitList();
}, },
onShareAppMessage() { onShareAppMessage() {
@ -231,7 +235,7 @@ export default {
var _this =this; var _this =this;
var post ={}; var post ={};
_this.$api.get('api/userInfo',post,function(rs){ _this.$api.get('api/userInfo',post,function(rs){
console.log('用户信息',rs); //console.log('',rs);
var oldToken = _this.$user.session('token'); var oldToken = _this.$user.session('token');
// //
_this.$user.session('userInfo',rs); _this.$user.session('userInfo',rs);
@ -279,117 +283,37 @@ export default {
console.log(e); console.log(e);
_this.current = e.index; _this.current = e.index;
}, },
tools(item) //
{ getPortraitList(){
var _this =this; var _this =this;
if(item.type == 'service') 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++)
{ {
var phone = _this.$user.session('servicePhone'); //console.log(i,can_num);
uni.makePhoneCall({ if(i <= can_num)
phoneNumber: phone, {
success(res) { baseList.push({id:0,image:'/static/img/user/have.png',can:true});
console.log(res);
},
fail(err) {
console.log(err);
},
});
} }
else else
{ {
uni.$u.route({ baseList.push({id:0,image:'/static/img/user/have_no.png',can:false});
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('授权失败')
}
},
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))
{
_this.$com.alert('切换失败,请退出并重新进入小程序重试');
} }
// #ifdef MP var post ={};
// _this.$api.get('api/portrait/list',post,function(rs){
uni.getProvider({ console.log('档案信息',rs);
service: 'oauth', if(rs.length > 0)
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); rs.forEach((item, index) => {
} baseList[index].id = item.id;
_this.isLogin = true; })
_this.getUserInfo();
});
},
fail:function(rs){
console.log('登录失败'+rs.errMsg);
}
});
} }
}); _this.portraitList = baseList;
// #endif
},function(err){
console.log(err);
}); });
}, },

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

Loading…
Cancel
Save