main
JING 8 months ago
parent a99fc3d7aa
commit 9471ba32e0
  1. 14
      App.vue
  2. 29
      pagesA/merge/idcard.vue
  3. 120
      pagesA/merge/index.vue

@ -7,6 +7,7 @@
export default {
onLaunch: function(options) {
console.log('App Launch');
console.log('参数',options);
var _this =this;
//
uni.getSystemInfo({
@ -23,9 +24,10 @@
plus.screen.lockOrientation('portrait-primary'); //11
// #endif
},
onShow: function() {
console.log('App Show')
onShow: function(options) {
var _this =this;
console.log('App Show');
console.log('App Show参数',options);
// #ifdef MP
//
uni.getProvider({
@ -52,7 +54,13 @@
// #endif
// #ifdef H5
post.login_type = 'official_account';
// #endif
// #endif
//
if(!_this.$com.isNull(options.query.invite_code))
{
post.invite_code = options.query.invite_code;
}
_this.$api.post('api/login', post,function(rs){
console.log(rs);
_this.$user.session('userInfo',rs);

@ -120,18 +120,19 @@
],
tem_list: [],
photo_has :0,
save_type:''
save_type:'',
form:{},
}
},
mounted() {
},
onLoad() {
this.changeTab();
this.root_path = this.$api.getOssurl();
this.getUserInfo();
onLoad(options) {
var _this =this;
console.log('options',options);
_this.form = options;
_this.changeTab();
_this.root_path = _this.$api.getOssurl();
_this.getUserInfo();
},
onShow() {
@ -199,7 +200,17 @@
})
},
subThis(){
let data ={};
var _this =this;
var form = _this.form;
var data = {
specs_id:form.specs_id,
portrait_id:form.portrait_id,
};
if(form.ilk == 3)
{
data.w_h_px = {w:form.w,h:form.h};
data.kb = {min:form.min,max:form.max};
}
if(!this.save_type){
this.$com.showError('请选择保存格式!');
return false;

@ -38,7 +38,7 @@
lower-threshold="50">
<view class="listBox">
<view class="photoBox" v-for="(item,index) in temList" :key="index" @click="checkHave(item)">
<view class="photoBox" v-for="(item,index) in temList" :key="index" @click="checkHave(item,item.ilk)" v-if="item.ilk != 2">
<view class="photoTop">
<view class="topLeft">
<image :src="item.icon" mode="widthFix" @error="specsErr(index)"></image>
@ -96,8 +96,8 @@
<u-input
placeholder="宽"
border="surround"
v-model="FormData.w_h_px.w"
@change="change"
type="number"
v-model="FormData.w"
></u-input>
</view>
<view class="item3">x</view>
@ -105,8 +105,8 @@
<u-input
placeholder="高"
border="surround"
v-model="FormData.w_h_px.h"
@change="change"
type="number"
v-model="FormData.h"
></u-input>
</view>
<view class="item5">PX</view>
@ -117,8 +117,8 @@
<u-input
placeholder="最小"
border="surround"
v-model="value"
@change="change"
type="number"
v-model="FormData.min"
></u-input>
</view>
<view class="item3">-</view>
@ -126,8 +126,8 @@
<u-input
placeholder="最大"
border="surround"
v-model="value"
@change="change"
type="number"
v-model="FormData.max"
></u-input>
</view>
<view class="item5">KB</view>
@ -252,17 +252,16 @@
//
FormData:{
ilk:1,
specs_id:0, //id
portrait_id:0, //id
template_id:0,//id
w_h_px:{
w:0,
h:0,
},
kb:{
min:0,
max:0,
},
w:'',
h:'',
min:'',
max:'',
image_suffix:0,
},
}
@ -427,11 +426,12 @@
//
submit(key){
var _this =this;
_this.close(key);
switch(key)
{
//
case 'tips_show':
_this.close(key);
uni.navigateTo({
url:'/pagesA/merge/face_1'
});
@ -439,13 +439,39 @@
//
case 'select_show':
_this.FormData.portrait_id = _this.selectList[_this.selectIndex].id;
_this.close(key);
var FormData = _this.FormData;
console.log(FormData);
var str = '?specs_id='+FormData.specs_id+'&portrait_id='+FormData.portrait_id+'&ilk='+FormData.ilk;
if(FormData.ilk == 3)
{
str += '&w='+Number(FormData.w)+'&h='+Number(FormData.h)+'&min='+Number(FormData.min)+'&max='+Number(FormData.max);
}
uni.navigateTo({
url:'/pagesA/merge/idcard'
url:'/pagesA/merge/idcard'+str,
});
break;
//
case 'custom_show':
var FormData = _this.FormData;
if(!_this.$com.check(FormData.w,'digits') || !_this.$com.check(FormData.h,'digits'))
{
_this.$com.showError('宽/高必须为整数');
return;
}
if(!_this.$com.check(FormData.min,'digits') || !_this.$com.check(FormData.max,'digits'))
{
_this.$com.showError('最小/最大必须为整数');
return;
}
if(Number(FormData.min) >= Number(FormData.max))
{
_this.$com.showError('填写的最小值不能大于最大值');
return;
}
_this.close(key);
_this.getPortraitList();
break;
}
@ -453,34 +479,15 @@
},
//
checkHave(item){
checkHave(item,ilk){
var _this = this;
_this.FormData.ilk = ilk; //
_this.FormData.specs_id = item.id;
if(!(item.w_h_mm.w == 0 && item.w_h_mm.h == 0 && item.w_h_px.w == 0 && item.w_h_px.h == 0))
if(ilk == 1 || ilk == 2) // &&
{
var post = {};
_this.$api.get('api/portrait/list', post, function(res) {
var d = res;
console.log(d);
if(d.length == 0)
{
_this.tips_show = true;
}
else
{
var selectList = d;
selectList.forEach((item, index) => {
selectList[index].model_image = _this.$api.ossurl(item.model_image);
selectList[index].model_image_thumbnail = _this.$api.ossurl(item.model_image_thumbnail);
});
_this.selectList = selectList;
_this.selectIndex = 0;
_this.select_show = true;
}
});
_this.getPortraitList();
}
else
else //
{
_this.showEdit(item);
}
@ -490,6 +497,31 @@
},
//
getPortraitList(){
var _this =this;
var post = {};
_this.$api.get('api/portrait/list', post, function(res) {
var d = res;
console.log(d);
if(d.length == 0)
{
_this.tips_show = true;
}
else
{
var selectList = d;
selectList.forEach((item, index) => {
selectList[index].model_image = _this.$api.ossurl(item.model_image);
selectList[index].model_image_thumbnail = _this.$api.ossurl(item.model_image_thumbnail);
});
_this.selectList = selectList;
_this.selectIndex = 0;
_this.select_show = true;
}
});
},
//
selectPortrait(index)

Loading…
Cancel
Save