|
@@ -36,7 +36,8 @@ Page({
|
|
|
rollFilmList:[],
|
|
|
chooseIndex:'',
|
|
|
chooseItemIndex:'',
|
|
|
- set_status:''
|
|
|
+ set_status:'',
|
|
|
+ special_type:false
|
|
|
},
|
|
|
handleCancel(){
|
|
|
this.setData({
|
|
@@ -156,8 +157,10 @@ onSearchN(event){
|
|
|
title: '上传成功',
|
|
|
})
|
|
|
let src = JSON.parse(ress.data).data.url;
|
|
|
- console.log(that.data,123);
|
|
|
that.data.chooseList[that.data.chooseIndex].detail[that.data.chooseItemIndex].src = `${app.globalData.url}${src}`;
|
|
|
+ if(that.data.set_status){
|
|
|
+ that.data.chooseList[that.data.chooseIndex].detail[that.data.chooseItemIndex].show_url = `${app.globalData.url}${src}`;
|
|
|
+ }
|
|
|
that.setData({
|
|
|
chooseList:that.data.chooseList,
|
|
|
showCamera:false
|
|
@@ -208,12 +211,17 @@ onSearchN(event){
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- fail: function(res) {
|
|
|
- console.log(res);
|
|
|
- }
|
|
|
+ fail: function(res) {}
|
|
|
})
|
|
|
},
|
|
|
handleOpenCamera(data){
|
|
|
+ console.log(data);
|
|
|
+ if(this.data.chooseList[data.currentTarget.dataset.index].detail[data.currentTarget.dataset.itemindex].src){
|
|
|
+ wx.previewImage({
|
|
|
+ urls:[this.data.chooseList[data.currentTarget.dataset.index].detail[data.currentTarget.dataset.itemindex].src]
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
if(this.data.set_status=='is_detail'){
|
|
|
return
|
|
|
}
|
|
@@ -336,14 +344,19 @@ handleChooseN(item){
|
|
|
}else{
|
|
|
sub =JSON.parse(JSON.stringify(this.data.carDepartList.filter(c=>res.data.data.car_depart_sub.indexOf(c.id)!=-1)));
|
|
|
}
|
|
|
-
|
|
|
+ console.log(item.target.dataset.item.roll_film_id,this.data.rollFilmList)
|
|
|
+ if(!this.data.rollFilmList.find(c=>c.id==item.target.dataset.item.roll_film_id)){
|
|
|
+ return wx.showToast({
|
|
|
+ icon:'none',
|
|
|
+ title: '套餐中的对应卷膜的未找到!',
|
|
|
+ })
|
|
|
+ }
|
|
|
sub.forEach(b=>{
|
|
|
b.car_depart_id = b.id,
|
|
|
b.car_depart_name = b.title,
|
|
|
- b. basic_roll_film_id=item.target.dataset.item.basic_roll_film_id,
|
|
|
+ b.basic_roll_film_id=item.target.dataset.item.basic_roll_film_id,
|
|
|
b.basic_roll_film_name=item.target.dataset.item.roll_film_type,
|
|
|
b.roll_film_id=item.target.dataset.item.roll_film_id,
|
|
|
- console.log(this.data.rollFilmList);
|
|
|
b.warranty_year = this.data.rollFilmList.find(c=>c.id==b.roll_film_id).warranty_year
|
|
|
b.roll_film_name=item.target.dataset.item.roll_film_name,
|
|
|
b.roll_film_number='',
|
|
@@ -472,6 +485,16 @@ this.setData({
|
|
|
chooseList:arr
|
|
|
})
|
|
|
},
|
|
|
+ handleDelPic(e){
|
|
|
+ let arr = this.data.chooseList;
|
|
|
+ arr[e.currentTarget.dataset.index].detail[e.currentTarget.dataset.itemindex].src='';
|
|
|
+ if(this.data.set_status){
|
|
|
+ arr[e.currentTarget.dataset.index].detail[e.currentTarget.dataset.itemindex].show_url='';
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ chooseList: arr
|
|
|
+ })
|
|
|
+ },
|
|
|
handleReturn(){
|
|
|
let app = getApp();
|
|
|
let openid = app.globalData.openID;
|
|
@@ -482,7 +505,6 @@ this.setData({
|
|
|
}else{
|
|
|
app.globalData.stepData.forEach((v,index)=>{
|
|
|
if(v.sort === 6){
|
|
|
- console.log(index);
|
|
|
app.globalData.stepData.splice(index,1);
|
|
|
}
|
|
|
})
|
|
@@ -520,7 +542,6 @@ this.setData({
|
|
|
onLoad(option) {
|
|
|
let app = getApp();
|
|
|
let openid = app.globalData.openID;
|
|
|
- console.log(app);
|
|
|
//获取套餐列表 productList
|
|
|
wx.p.request({
|
|
|
url: `${app.globalData.url}wx/rollFilmCombineList`,
|
|
@@ -538,7 +559,6 @@ this.setData({
|
|
|
this.setData({
|
|
|
productList:res.data.data.data.filter(v=>(v.company_id==app.globalData.company_id)&&(app.globalData.choose_b_r_f_id.indexOf(v.basic_roll_film_id)!=-1))
|
|
|
})
|
|
|
- console.log(this.data.productList);
|
|
|
}
|
|
|
})
|
|
|
//获取施工部位
|
|
@@ -573,7 +593,6 @@ this.setData({
|
|
|
let company_id = app.globalData.company_id;
|
|
|
let img_type = app.globalData.img_type||'';
|
|
|
let data = {}
|
|
|
- console.log(app.globalData)
|
|
|
if(app.globalData.set_status){
|
|
|
data.order_number = app.globalData.detailData.order_number
|
|
|
}
|
|
@@ -582,6 +601,7 @@ this.setData({
|
|
|
url: `${app.globalData.url}wx/rollFilmList`,
|
|
|
method:'POST',
|
|
|
data:{
|
|
|
+ use:1,
|
|
|
openid,
|
|
|
storehouse_id,
|
|
|
company_id,
|
|
@@ -611,16 +631,20 @@ this.setData({
|
|
|
o.expend_meters = o.meter;
|
|
|
if(app.globalData.detailData.img.find(d=>d.type==3)){
|
|
|
let src = app.globalData.detailData.img.find(d=>d.type==3).src.split(',')
|
|
|
- o.src = src[index]?`${app.globalData.url}${src[index]}`:''
|
|
|
+ let show_url = app.globalData.detailData.img.find(d=>d.type==3).show_url.split(',')
|
|
|
+ o.src = src[index]?`${app.globalData.url}${src[index]}`:'';
|
|
|
+ o.show_url = show_url[index]?show_url[index]:''
|
|
|
}else{
|
|
|
- o.src=''
|
|
|
+ o.src='';
|
|
|
+ o.show_url= '';
|
|
|
}
|
|
|
index++;
|
|
|
})
|
|
|
})
|
|
|
this.setData({
|
|
|
chooseList:sub,
|
|
|
- set_status:app.globalData.set_status
|
|
|
+ set_status:app.globalData.set_status,
|
|
|
+ special_type:app.globalData.bussiness_special_type
|
|
|
})
|
|
|
}else{
|
|
|
wx.p.request({
|
|
@@ -638,14 +662,15 @@ this.setData({
|
|
|
app.globalData = data;
|
|
|
app.globalData.set_status = '';
|
|
|
if(box){
|
|
|
- console.log(data.stepData);
|
|
|
this.setData({
|
|
|
chooseList:box.data.chooseList,
|
|
|
- set_status:''
|
|
|
+ set_status:'',
|
|
|
+ special_type:data.bussiness_special_type
|
|
|
})
|
|
|
}else{
|
|
|
this.setData({
|
|
|
- set_status:''
|
|
|
+ set_status:'',
|
|
|
+ special_type:data.bussiness_special_type
|
|
|
})
|
|
|
}
|
|
|
}
|