|
@@ -46,7 +46,7 @@
|
|
|
<view class="black shuru pa-30">
|
|
|
<tm-form>
|
|
|
<view class="text-size-m">请输入家庭名称</view>
|
|
|
- <tm-input name="title" v-model="name" clear placeholder="相亲相爱一家人"></tm-input>
|
|
|
+ <tm-input name="title" v-model="reqData.familyname" clear placeholder="相亲相爱一家人"></tm-input>
|
|
|
</tm-form>
|
|
|
</view>
|
|
|
<tm-button :round="24" class="sao mb-40 mt-40" @click="chuangjianFun()" block>创建家庭</tm-button>
|
|
@@ -54,21 +54,21 @@
|
|
|
<view v-if="active==3">
|
|
|
<view>
|
|
|
<view class="fl zuo" style="width:70px;">
|
|
|
- <view class="flex-center flex-col mt-30" style="position: relative;" v-for="(item,index) in renList">
|
|
|
- <image block mode="widthFix" src="/static/img/53.png"></image>
|
|
|
- <tm-badges icon="icon-times" @click="shanchu(item.timestamp)" v-if="index != 0"></tm-badges>
|
|
|
+ <view class="flex-center flex-col mt-30" style="position: relative;" v-for="(item,index) in reqData.role">
|
|
|
+ <image @click="qiehuanren(index)" block v-if="index==0" mode="widthFix" src="/static/img/53.png"></image>
|
|
|
+ <image @click="qiehuanren(index)" block v-else mode="widthFix" src="/static/img/61.png"></image>
|
|
|
+ <tm-badges icon="icon-times" @click="shanchu(item.timestamp)" v-if="(show==index && index !=0)"></tm-badges>
|
|
|
</view>
|
|
|
- <view class="flex-center flex-col mt-30" style="position: relative;" v-if="renList.length<4">
|
|
|
+ <view class="flex-center flex-col mt-30" style="position: relative;" v-if="reqData.role.length<4">
|
|
|
<image block mode="widthFix" src="/static/img/54.png" @click="add()"></image>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
- <view class="fr you black mt-30" style="width: calc(100% - 100px); ">
|
|
|
- <tm-input :required="true" title="用户名" v-model="reqData.username" placeholder="你想叫自己什么" align="right"></tm-input>
|
|
|
- <tm-input :required="true" title="身高(cm)" v-model="reqData.height" align="right"></tm-input>
|
|
|
- <tm-input :required="true" title="体重(kg)" v-model="reqData.weight" align="right"></tm-input>
|
|
|
- <tm-pickers class="tan" :default-value.sync="reqData.shencai" rang-key="title" :list="chelianglis">
|
|
|
- <tm-input name="shencai" title="身材" placeholder="请选择车型" disabled :value="obTstr2(reqData.shencai)" right-icon="icon-angle-right"></tm-input>
|
|
|
+ <view class="fr you black mt-30" style="width: calc(100% - 100px);" v-for="(item1,index1) in reqData.role" v-if="show==index1">
|
|
|
+ <tm-input :required="true" title="用户名" v-model="item1.username" placeholder="你想叫自己什么" align="right"></tm-input>
|
|
|
+ <tm-input :required="true" title="身高(cm)" v-model="item1.height" align="right"></tm-input>
|
|
|
+ <tm-input :required="true" title="体重(kg)" v-model="item1.weight" align="right"></tm-input>
|
|
|
+ <tm-pickers class="tan" :default-value.sync="item1.body_arr" rang-key="title" :list="chelianglis">
|
|
|
+ <tm-input name="shencai" title="身材" placeholder="请选择车型" disabled :value="obTstr2(item1.body_arr)" right-icon="icon-angle-right"></tm-input>
|
|
|
</tm-pickers>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -86,7 +86,7 @@
|
|
|
<text class="text-size-m">衣柜和手机关联成功</text>
|
|
|
</view>
|
|
|
<view class="px-24">
|
|
|
- <tm-button theme="primary" :round="24" block class="mt-50 logincla">添加衣服</tm-button>
|
|
|
+ <tm-button theme="primary" @click="quyifu()" :round="24" block class="mt-50 logincla">添加衣服</tm-button>
|
|
|
<tm-button @click="quindex()" theme="primary" :round="24" block class="mt-30 quindex">进入首页</tm-button>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -108,24 +108,26 @@ export default {
|
|
|
{title:"瘦子",id:51},
|
|
|
{title:"模特",id:61},
|
|
|
],
|
|
|
- shenxing:'',
|
|
|
- active:3,
|
|
|
- name:'',
|
|
|
- val_1:'',
|
|
|
+ active:2,
|
|
|
chelianglis:[
|
|
|
- {title:"标准",id:21},
|
|
|
- {title:"偏瘦",id:31},
|
|
|
- {title:"偏胖",id:41},
|
|
|
- {title:"梨形",id:51},
|
|
|
- {title:"S型",id:61},
|
|
|
+ {title:"标准",id:1},
|
|
|
+ {title:"偏瘦",id:2},
|
|
|
+ {title:"偏胖",id:3},
|
|
|
+ {title:"梨形",id:4}
|
|
|
],
|
|
|
+ show:0,
|
|
|
reqData:{
|
|
|
- username:'',
|
|
|
- height:'',
|
|
|
- weight:'',
|
|
|
- shencai:[]
|
|
|
+ wardrode_no:'6943819164690',
|
|
|
+ familyname:'',
|
|
|
+ role:[{
|
|
|
+ username:'',
|
|
|
+ weight:'',
|
|
|
+ height:'',
|
|
|
+ body_type:'',
|
|
|
+ body_arr:[]
|
|
|
+ }]
|
|
|
+
|
|
|
},
|
|
|
- renList:[]
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -133,37 +135,75 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.sys = uni.getSystemInfoSync();
|
|
|
- this.add()
|
|
|
},
|
|
|
methods: {
|
|
|
+ qiehuanren(index){
|
|
|
+ this.show=index;
|
|
|
+ },
|
|
|
+ quyifu(){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/luru/index",
|
|
|
+ })
|
|
|
+ },
|
|
|
quindex(){
|
|
|
uni.navigateTo({
|
|
|
url: "/pages/index/index",
|
|
|
})
|
|
|
},
|
|
|
tijiao(){
|
|
|
- // console.log(this.renList)
|
|
|
- // for(let i=0;i<this.renList.length;i++){
|
|
|
- // if(this.renList[i].){}
|
|
|
- // }
|
|
|
- // this.active=4;
|
|
|
+ var that=this;
|
|
|
+ var arr=this.reqData.role;
|
|
|
+ for(let i=0;i<arr.length;i++){
|
|
|
+ if(arr[i].username==""){
|
|
|
+ that.$refs.toast.show({model:'warn',label:'请将数据填写完整'})
|
|
|
+ return;
|
|
|
+ }if(arr[i].weight==""){
|
|
|
+ that.$refs.toast.show({model:'warn',label:'请将数据填写完整'})
|
|
|
+ return;
|
|
|
+ }if(arr[i].height==""){
|
|
|
+ that.$refs.toast.show({model:'warn',label:'请将数据填写完整'})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(arr[i].body_arr.length !=0){
|
|
|
+ arr[i].body_type=arr[i].body_arr[0].id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(this.reqData)
|
|
|
+ myRequest({
|
|
|
+ url: "/api/Family/addFamilyMember",
|
|
|
+ method:'post',
|
|
|
+ data:that.reqData
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res.data)
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ uni.setStorageSync("family_id",res.data.data.family_id)
|
|
|
+ that.$refs.toast.show({model:'success',label:res.data.msg})
|
|
|
+ that.active=4;
|
|
|
+ }else{
|
|
|
+ that.$refs.toast.show({model:'error',label:res.data.msg})
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
add(){
|
|
|
var timestamp = Date.parse(new Date());
|
|
|
var obj={
|
|
|
username:'',
|
|
|
- height:'',
|
|
|
weight:'',
|
|
|
- shencai:[],
|
|
|
+ height:'',
|
|
|
+ body_type:'',
|
|
|
+ body_arr:[],
|
|
|
timestamp:timestamp
|
|
|
}
|
|
|
- this.renList.push(obj)
|
|
|
+ this.reqData.role.push(obj);
|
|
|
+ this.show=this.reqData.role.length-1;
|
|
|
},
|
|
|
shanchu(timestamp){
|
|
|
- var index = this.renList.findIndex((item) => {
|
|
|
+ var index = this.reqData.role.findIndex((item) => {
|
|
|
return item.timestamp == timestamp;
|
|
|
});
|
|
|
- this.renList.splice(index, 1);
|
|
|
+ this.reqData.role.splice(index, 1);
|
|
|
+ this.show=this.reqData.role.length-1;
|
|
|
},
|
|
|
obTstr2(o){
|
|
|
if(Array.isArray(o)){
|
|
@@ -179,6 +219,7 @@ export default {
|
|
|
success: function (res) {
|
|
|
console.log('条码类型:' + res.scanType);
|
|
|
console.log('条码内容:' + res.result);
|
|
|
+ that.reqData.wardrode_no=res.result;
|
|
|
that.active=2;
|
|
|
},
|
|
|
error : function(e) {
|
|
@@ -188,7 +229,7 @@ export default {
|
|
|
},
|
|
|
chuangjianFun(){
|
|
|
var that=this;
|
|
|
- if(that.name==""){
|
|
|
+ if(that.reqData.familyname==""){
|
|
|
that.$refs.toast.show({model:'warn',label:'请输入家庭名称'})
|
|
|
return
|
|
|
}
|