|
@@ -28,11 +28,8 @@
|
|
|
<view v-if="active==2">
|
|
|
<image block class="nicheng" mode="widthFix" :src="koutu"></image>
|
|
|
<view class="you black mt-30">
|
|
|
- <!-- <tm-pickers v-for="item in arrbig" class="tan" :default-value.sync="item.choosevalue" rang-key="category_name" list="[]">
|
|
|
- <tm-input title="分类" placeholder="请选择分类" disabled :value="obTstrnew(category_danarr,'')" right-icon="icon-angle-right"></tm-input>
|
|
|
- </tm-pickers> -->
|
|
|
<view v-for="(item,index) in arrbig">
|
|
|
- <tm-pickers v-if="item.type=='select'" @confirm="xuanze" :indexfu="item.name" :list="item.value">
|
|
|
+ <tm-pickers class="tan" v-if="item.type=='select'" @confirm="xuanze" :indexfu="item.name" :list="item.value">
|
|
|
<tm-input :title="item.name" align="right" :placeholder="'请选择'+item.name" v-model="item.choosevalue" disabled right-icon="icon-angle-right"></tm-input>
|
|
|
</tm-pickers>
|
|
|
<tm-input v-if="item.type=='text' && item.name !='颜色'" :title="item.name" v-model="item.choosevalue" align="right"></tm-input>
|
|
@@ -44,31 +41,6 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <!-- <tm-listitem
|
|
|
- v-for="item in arrbig"
|
|
|
- :left-icon-size="80"
|
|
|
- value="打开"
|
|
|
- title="支付"
|
|
|
- label="微信和支付宝微信和支付宝微信和支付宝微信和支付宝"
|
|
|
- left-icon="https://cdn.roundicons.com/wp-content/uploads/2017/09/Lego-freebie-icon.png"
|
|
|
- show-left-icon
|
|
|
- ></tm-listitem> -->
|
|
|
- <!-- <tm-input :required="true" title="商品名称" v-model="reqData.goods_name" align="right"></tm-input> -->
|
|
|
- <!-- <tm-pickers class="tan" :default-value.sync="category_danarr" rang-key="category_name" :list="category_arr">
|
|
|
- <tm-input :required="true" title="分类" placeholder="请选择分类" :value="obTstr1(category_danarr,'category_name')" right-icon="icon-angle-right"></tm-input>
|
|
|
- </tm-pickers> -->
|
|
|
- <!-- <tm-pickers class="tan" :default-value.sync="role_danarr" rang-key="username" :list="role_arr">
|
|
|
- <tm-input title="所属成员" :required="true" placeholder="请选择所属成员" disabled :value="obTstr3(role_danarr)" right-icon="icon-angle-right"></tm-input>
|
|
|
- </tm-pickers> -->
|
|
|
- <!-- <tm-input title="年份" v-model="reqData.year" align="right"></tm-input>
|
|
|
- <tm-input title="颜色" v-model="reqData.color" align="right"></tm-input>
|
|
|
- <tm-pickers class="tan" :default-value.sync="size_danarr" rang-key="title" :list="size_arr">
|
|
|
- <tm-input title="尺码" placeholder="请选择尺码" disabled :value="obTstr2(size_danarr)" right-icon="icon-angle-right"></tm-input>
|
|
|
- </tm-pickers>
|
|
|
- <tm-input title="适用人群" v-model="reqData.type" align="right"></tm-input>
|
|
|
- <tm-input title="品牌" v-model="reqData.brand" align="right"></tm-input>
|
|
|
- <tm-input title="材料" v-model="reqData.science" align="right"></tm-input> -->
|
|
|
</view>
|
|
|
<tm-button :round="24" class="sao mb-40 mt-40" @click="chuangjianFun()" block>提交</tm-button>
|
|
|
</view>
|
|
@@ -109,33 +81,8 @@ export default {
|
|
|
arrbig:[],
|
|
|
koutu:'/static/img/53.png',
|
|
|
active:1,
|
|
|
- category_arr:[],
|
|
|
- category_danarr:[],
|
|
|
- size_arr:[
|
|
|
- {title:"S",id:1},
|
|
|
- {title:"M",id:2},
|
|
|
- {title:"L",id:3},
|
|
|
- {title:"XL",id:4},
|
|
|
- {title:"XXL",id:5},
|
|
|
- {title:"其他",id:6},
|
|
|
- ],
|
|
|
- size_danarr:[],
|
|
|
role_arr:[],
|
|
|
- role_danarr:[],
|
|
|
- reqData:{
|
|
|
- goods_name:'',
|
|
|
- category_id:'',
|
|
|
- year:'',
|
|
|
- color:'',
|
|
|
- image:'',
|
|
|
- type:'',
|
|
|
- thumb:'',
|
|
|
- size:'',
|
|
|
- brand:'',
|
|
|
- science:'',
|
|
|
- role_id:'',
|
|
|
- fenlei:[]
|
|
|
- },
|
|
|
+ fenlei:[],
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -143,9 +90,7 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.sys = uni.getSystemInfoSync();
|
|
|
- this.getFl();
|
|
|
this.getCY();
|
|
|
- this.jiaobenFun()
|
|
|
},
|
|
|
methods: {
|
|
|
/* 显示获取颜色选择弹窗 */
|
|
@@ -159,37 +104,17 @@ export default {
|
|
|
/* 判断颜色值是否有效 */
|
|
|
if(color){
|
|
|
this.buttonColor=color;
|
|
|
- console.log('选择的颜色值是:'+color);
|
|
|
}
|
|
|
},
|
|
|
showPickerColorPop(){
|
|
|
this.showPickerColor=true;
|
|
|
},
|
|
|
xuanze(data){
|
|
|
- // var index=data[0].index;
|
|
|
- // this.arrbig[index].choosevalue=data[0].data;
|
|
|
for(let i=0;i<this.arrbig.length;i++){
|
|
|
if(this.arrbig[i].name==data[0].name){
|
|
|
this.arrbig[i].choosevalue=data[0].data
|
|
|
}
|
|
|
}
|
|
|
- console.log(data)
|
|
|
- // console.log(this.arrbig)
|
|
|
- },
|
|
|
- getFl(){
|
|
|
- var that=this;
|
|
|
- myRequest({
|
|
|
- url: "/api/Category/list",
|
|
|
- method:'post',
|
|
|
- data:{}
|
|
|
- }).then(res => {
|
|
|
- console.log(res.data)
|
|
|
- if (res.data.code == 200) {
|
|
|
- this.category_arr=res.data.data;
|
|
|
- }else{
|
|
|
- that.category_arr=[];
|
|
|
- }
|
|
|
- })
|
|
|
},
|
|
|
getCY(){
|
|
|
var that=this;
|
|
@@ -261,7 +186,7 @@ export default {
|
|
|
myRequest({
|
|
|
url: "/api/Goods/selectScript",
|
|
|
method:'post',
|
|
|
- data:that.reqData
|
|
|
+ data:''
|
|
|
}).then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
// var arrbig=[
|
|
@@ -274,14 +199,21 @@ export default {
|
|
|
myRequest({
|
|
|
url: "/api/Category/list",
|
|
|
method:'post',
|
|
|
- data:that.reqData
|
|
|
+ data:''
|
|
|
}).then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
- var valuearr=[];
|
|
|
+ var valuearr=[],rolevaluearr=[];
|
|
|
for(let i=0;i<res.data.data.length;i++){
|
|
|
valuearr.push(res.data.data[i].category_name)
|
|
|
}
|
|
|
- var arrsmall=[{name:"分类",value:valuearr,choosevalue:'',type:'select',classid:''}];
|
|
|
+ for(let i=0;i<that.role_arr.length;i++){
|
|
|
+ rolevaluearr.push(that.role_arr[i].username)
|
|
|
+ }
|
|
|
+
|
|
|
+ var arrsmall=[
|
|
|
+ {name:"分类",value:valuearr,choosevalue:'',type:'select',classid:''},
|
|
|
+ {name:"所属成员",value:rolevaluearr,choosevalue:'',type:'select',classid:''},
|
|
|
+ ];
|
|
|
that.arrbig=arrsmall.concat(that.arrbig)
|
|
|
that.fenlei=res.data.data;
|
|
|
that.active=2;
|
|
@@ -297,7 +229,6 @@ export default {
|
|
|
},
|
|
|
getBase64Image(path){
|
|
|
var that=this;
|
|
|
- console.log(" 开始转换")
|
|
|
pathToBase64(path)
|
|
|
.then(base64 => {
|
|
|
that.shibie(base64)
|
|
@@ -335,36 +266,26 @@ export default {
|
|
|
that.$refs.toast.show({model:'warn',label:'请将数据填写完整'})
|
|
|
return
|
|
|
}
|
|
|
- // 这里写循环放id
|
|
|
+ }
|
|
|
+ // 分类id
|
|
|
+ for(let i=0;i<that.fenlei.length;i++){
|
|
|
+ if(that.fenlei[i].category_name==that.arrbig[0].choosevalue){
|
|
|
+ that.arrbig[0].classid=that.fenlei[i].id
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 成员id
|
|
|
+ for(let i=0;i<that.role_arr.length;i++){
|
|
|
+ if(that.role_arr[i].category_name==that.arrbig[0].choosevalue){
|
|
|
+ that.arrbig[0].classid=that.role_arr[i].id
|
|
|
+ }
|
|
|
}
|
|
|
console.log(that.arrbig)
|
|
|
- // if(that.reqData.goods_name==""){
|
|
|
- // that.$refs.toast.show({model:'warn',label:'请输入商品名称'})
|
|
|
- // return
|
|
|
- // }
|
|
|
- // if(that.category_danarr.length==0){
|
|
|
- // that.$refs.toast.show({model:'warn',label:'请选择分类'})
|
|
|
- // return
|
|
|
- // }else{
|
|
|
- // that.reqData.category_id=that.category_danarr[0].id
|
|
|
- // }
|
|
|
- // if(that.role_danarr.length==0){
|
|
|
- // that.$refs.toast.show({model:'warn',label:'请选择成员'})
|
|
|
- // return
|
|
|
- // }else{
|
|
|
- // that.reqData.role_id=that.role_danarr[0].id
|
|
|
- // }
|
|
|
- // if(that.size_danarr.length!=0){
|
|
|
- // that.reqData.size=that.size_danarr[0].id
|
|
|
- // }
|
|
|
// that.reqData.image=that.koutu;
|
|
|
- // that.reqData.thumb=that.koutu;
|
|
|
// myRequest({
|
|
|
// url: "/api/Goods/addGodds",
|
|
|
// method:'post',
|
|
|
// data:that.reqData
|
|
|
// }).then(res => {
|
|
|
- // console.log(res.data)
|
|
|
// if (res.data.code == 200) {
|
|
|
// that.active=3;
|
|
|
// }else{
|