Commit a943b2a4 authored by 李星剑's avatar 李星剑

fix:面料建模

parent 3c5161bc
......@@ -205,7 +205,7 @@ const actions = {
'brand','sale_season','material_position','technolog_type','technology_point',
'production_type','style_type','sale_type','year','series','wave','pattern','base_unit',
'material_node','cloth_width_unit','fabric_width_unit','development_rules','production_list',
'price_fixed','age_fixed','style_fixed','customer_type'
'price_fixed','age_fixed','style_fixed','customer_type','express'
];
http('base.dictionary',{codeList}).then(res => {
let { code, data } = res;
......
......@@ -275,7 +275,7 @@ export default {
this.loadStatus = 'loading';
let { current, size } = this.pages;
this.$http(
'modelingtask.selectModelingTaskPage',
'modeling.selectModelingTaskPage',
{
materialName: this.value ? this.value : null,
status: this.status,
......
......@@ -83,8 +83,8 @@
watch: {
id: {
handler() {
this.materialDetail()
this.detail()
// this.materialDetail()
// this.detail()
}
}
},
......@@ -108,11 +108,11 @@
this.materialDetail()
this.detail()
},
created() {
this.materialDetail()
this.detail()
this.id = this.$route.query.id
},
// created() {
// this.materialDetail()
// this.detail()
// this.id = this.$route.query.id
// },
methods: {
materialDetail() {
this.$http('materialinfo.getMaterialById', this.id).then(res => {
......
......@@ -247,17 +247,26 @@ export default {
resolve(
Promise.all(fileList)
.then((images) =>{
console.log(images)
// Draw images to canvas
images.forEach((image) => {
this.ctx.globalAlpha = image.opacity ? image.opacity : 1;
return this.ctx.drawImage(image, 0, 0 ,this.canvas_width, this.canvas_height);
return this.ctx.drawImage(image, 0, 0);
});
this.ctx.draw();
})
)
})
},
scaleImage(){
let config = {
};
return {
width: this.compatibilitySize(parseFloat(config.w)*this.scale),
height: this.compatibilitySize(parseFloat(config.h)*this.scale))
}
},
drawImage(config){
return new Promise(async (resolve,reject)=>{
if(config.url){
......
......@@ -17,21 +17,21 @@
<!-- <u-image height="750rpx" :src="`${$IMG_URL}${detail.originalImageCode}`"></u-image>-->
<view>
<!--新增 初始化的时候显示 部位编辑的时候不显示-->
<e-canvas ref="eCanvas" v-show="!isPartEdit && isEditMode"></e-canvas>
<e-canvas ref="eCanvas" v-show="isEditMode"></e-canvas>
<!--调试-->
<!--<e-canvas ref="eCanvasHelp" ></e-canvas>-->
<e-canvas ref="eCanvasHelp" style="position: fixed;top: -100000px;"></e-canvas>
<!--部位编辑的时候显示 -->
<image
v-show="isPartEdit || !isEditMode"
:style="{
'--src': `url(${activeBgPic})`,
'--transform': `rotate(${angle}deg)`,
}"
:src="`${activePartPicCode}`"
mode="heightFix"
class="height-750rpx view"
></image>
<!-- <image-->
<!-- v-show="isPartEdit || !isEditMode"-->
<!-- :style="{-->
<!-- '&#45;&#45;src': `url(${activeBgPic})`,-->
<!-- '&#45;&#45;transform': `rotate(${angle}deg)`,-->
<!-- }"-->
<!-- :src="`${activePartPicCode}`"-->
<!-- mode="heightFix"-->
<!-- class="height-750rpx view"-->
<!-- ></image>-->
</view>
<view v-if="!isEdit">
<view
......@@ -47,31 +47,33 @@
>下一款</view
>
</view>
<view
:class="[!isEdit ? 'hide' : 'active']"
class="u-absolute step u-p-r-30 u-p-l-30"
>
<view class="step-main u-p-r-20 u-p-l-20 u-flex">
<text class="width_100">{{ angle }}°</text>
<view class="u-relative u-flex-1">
<view class="line" id="line">
<view class="line-center"></view>
<view
class="line-step"
id="line-step"
:style="{
left:
((offset.x - lineOffset.left) / lineWidth) * 100 + '%',
}"
@touchmove="touchMove"
@touchend="touchEnd"
@touchstart="touchStart"
/>
</view>
</view>
<text class="u-m-l-24" @click="resetStep">重置</text>
</view>
</view>
<!--角度调整-->
<!-- <view-->
<!-- :class="[!isEdit ? 'hide' : 'active']"-->
<!-- class="u-absolute step u-p-r-30 u-p-l-30"-->
<!-- >-->
<!-- <view class="step-main u-p-r-20 u-p-l-20 u-flex">-->
<!-- <text class="width_100">{{ angle }}°</text>-->
<!-- <view class="u-relative u-flex-1">-->
<!-- <view class="line" id="line">-->
<!-- <view class="line-center"></view>-->
<!-- <view-->
<!-- class="line-step"-->
<!-- id="line-step"-->
<!-- :style="{-->
<!-- left:-->
<!-- ((offset.x - lineOffset.left) / lineWidth) * 100 + '%',-->
<!-- }"-->
<!-- @touchmove="touchMove"-->
<!-- @touchend="touchEnd"-->
<!-- @touchstart="touchStart"-->
<!-- />-->
<!-- </view>-->
<!-- </view>-->
<!-- <text class="u-m-l-24" @click="resetStep">重置</text>-->
<!-- </view>-->
<!-- </view>-->
<!--角度调整-->
</view>
<view class="">
<!--可调整部位-->
......@@ -111,11 +113,11 @@
:class="[selectedMaterial.id === color.id ? 'active' : '']"
v-for="color in MaterialList"
>
<image :src="`${$IMG_URL}${color}`" style="width: 100%; height: 100%"></image>
<image :src="`${$IMG_URL}${color.colourFileCode}`" style="width: 100%; height: 100%"></image>
<view class="image-tip u-line-1">{{ color.materialName }}</view>
</view>
</view>
<view class="overflow" v-if="selectedMaterialItemColors.length > 0">
<view class="overflow u-p-t-30 u-p-b-30" v-if="selectedMaterialItemColors.length > 0">
<u-image
:src="`${$IMG_URL}${item.fileCode}`"
width="80rpx"
......@@ -128,18 +130,18 @@
class="u-m-r-20 inline-block color-item"
></u-image>
</view>
<view class="u-p-t-30 u-p-b-20 text-right">
<view
class="button inline-block button-plain button-plain-default"
@click="cancelMaterialItem"
>取消</view
>
<view
@click="setMaterialItem"
class="button inline-block button-default"
>确定</view
>
</view>
<!-- <view class="u-p-t-30 u-p-b-20 text-right">-->
<!-- <view-->
<!-- class="button inline-block button-plain button-plain-default"-->
<!-- @click="cancelMaterialItem"-->
<!-- >取消</view-->
<!-- >-->
<!-- <view-->
<!-- @click="setMaterialItem"-->
<!-- class="button inline-block button-default"-->
<!-- >确定</view-->
<!-- >-->
<!-- </view>-->
</view>
</view>
<!--颜色选择-->
......@@ -155,7 +157,7 @@
<view
class="image u-m-r-10"
:class="[
activeMainPartBodyColorId === color.mdmMaterialColourId
activeMainPartBodyColorId === color.id
? 'active'
: '',
]"
......@@ -196,7 +198,7 @@
:class="[
mainPartOtherColor
.map((item) => item.mdmMaterialColourId)
.indexOf(color.mdmMaterialColourId) > -1
.indexOf(color.id) > -1
? 'active'
: '',
]"
......@@ -602,17 +604,29 @@ export default {
setMaterialItem() {
if (this.activePartIndex === 0) {
this.materialDetail = this.selectedMaterialItem;
this.colorSelect(this.activeColor, this.selectedMaterialItemColors,this.toggleCanvasEditCallback);
if(this.activeColor.colourId){
this.colorSelect(
this.activeColor,
this.selectedMaterialItemColors,
this.toggleCanvasEditCallback
);
}
this.isEdit = false;
} else {
if(this.activeColor.colourId){
this.ontherPartTrigger(
this.activeColor,
this.selectedMaterialItemColors
);
this.isEdit = false;
}else{
this.$refs.uToast.show({
title: '请选择一个颜色'
});
}
}
this.activeColor = {};
this.isEdit = false;
this.isPartEdit = false;
},
cancelMaterialItem() {
this.isEdit = false;
......@@ -623,6 +637,7 @@ export default {
materialId: this.selectedMaterialItem.id,
mdmMaterialColourId: color.id,
};
this.setMaterialItem()
},
pageReload() {
this.$Router.replace({
......
......@@ -26,8 +26,12 @@
</view>
</view>
</view>
<view id="body" class="body u-p-r-30 u-p-l-30" :style="{ bottom: footerHeight + 'px', top: headerHeight+ 'px'}">
<view v-if="activeStatus === 0">
<!-- todo-->
<view id="body" >
<scroll-view v-if="activeStatus === 0"
class="body u-p-r-30 u-p-l-30" :style="{ bottom: footerHeight + 'px', top: headerHeight+ 'px'}"
:scroll-y="true"
@scrolltolower="loadMore">
<view class="u-p-t-24 u-p-b-24">待上架:{{ pageOptions.pages }}款</view>
<view class="entrust bg-fff u-p-30"
v-for="(item,index) in computedList">
......@@ -83,8 +87,11 @@
</view>
</view>
</view>
</view>
<view v-if="activeStatus === 1">
</scroll-view>
<scroll-view v-if="activeStatus === 1"
class="body u-p-r-30 u-p-l-30" :style="{ top: headerHeight+ 'px'}"
:scroll-y="true"
@scrolltolower="loadMore">
<view class="u-p-t-24 u-p-b-24">已上架:{{ pageOptions.pages }}款</view>
<view class="entrust bg-fff u-p-30" v-for="(item,index) in computedList" >
<view class="entrust-title u-flex">
......@@ -97,6 +104,7 @@
@click="triggerToggle(index)"
/>
</view>
<view v-if="checkToggle(index)">
<view class="u-flex u-p-t-30" v-for="item in item.children">
<view class="item u-flex-1 u-flex u-p-l-30" @click="goItem(item)">
<view class="item-img">
......@@ -127,10 +135,13 @@
</view>
</view>
</view>
</view>
</view>
<view v-if="activeStatus === 2">
</scroll-view>
<scroll-view v-if="activeStatus === 2"
class="body u-p-r-30 u-p-l-30" :style="{ top: headerHeight+ 'px'}"
:scroll-y="true"
@scrolltolower="loadMore">
<view class="u-p-t-24 u-p-b-24">全部:{{ pageOptions.pages }}款</view>
<view v-for="item in list" @click="goItem(item)" :key="item.id">
......@@ -177,7 +188,7 @@
</view>
</view>
</view>
</scroll-view>
</view>
<view id="footer" class="footer" v-if="activeStatus === 0">
<view class="footer-btn">
......@@ -368,13 +379,16 @@ export default {
}
},
// 触底加载更多
onReachBottom() {
loadMore() {
if (this.pageOptions.current < this.pageOptions.pages) {
this.pageOptions.current += 1;
this.getList();
this.getList(false);
}
},
getList(isReload = false){
uni.showLoading({
mask: true
})
this.$http("stylelibraryorder.getToShelvesManagerList",{
status: this.statusList[this.activeStatus].value,
...this.pageOptions
......@@ -387,12 +401,15 @@ export default {
this.pageOptions.pages = data.total;
this.loadStatus = this.list.length < data.total ? 'loadmore' : 'nomore';
}else{
this.list = [];
this.list = this.list.concat([]);
this.pageOptions.pages = 0;
this.loadStatus = 'nomore';
}
}
})
.then(res =>{
uni.hideLoading()
})
},
goEntrustList(){
this.$Router.push({
......@@ -520,7 +537,7 @@ $main-color: #fff;
right: 0;
bottom: 0;
top: 0;
overflow-y: auto;
//overflow-y: auto;
}
.footer {
......
......@@ -66,10 +66,19 @@ export default {
},
computed:{
mainPic(){
return this.item.colourApiList.filter((item) => item.isMain)[0]
// return this.item.colourApiList.filter((item) => item.isMain)[0];
return this.item.colourApiList.length > 0 ?
this.item.colourApiList.filter((item) => item.isMain)[0]:
{
fileCode: ''
}
},
subPic(){
return this.item.colourApiList.filter((item) => !item.isMain)
return this.item.colourApiList.length > 0 ?
this.item.colourApiList.filter((item) => !item.isMain):
{
fileCode: ''
}
},
materialInfo(){
let item = this.item.materialInfo || {};
......
......@@ -19,7 +19,10 @@
</view>
</view>
<!-- 列表 确定-->
<view class="u-p-30 body" :style="{ bottom: footerHeight+ 'px', top: headerHeight + 'px' }">
<scroll-view class="u-p-30 body"
:scroll-y="true"
@scrolltolower="loadMore"
:style="{ bottom: footerHeight+ 'px', top: headerHeight + 'px' }">
<view v-for="(item, index) in computedList" :key="item.id" class="u-flex u-m-b-20">
<view class="u-m-r-30">
<u-icon :name="index === selectedIndex ? 'checkmark-circle-fill': 'checkmark-circle'"
......@@ -33,7 +36,7 @@
<u-loadmore v-if="!isEmpty" height="80rpx" :status="loadStatus" icon-type="flower" color="#ccc" />
<!-- 缺省页 -->
<hs-empty v-if="isEmpty" tipText="没有数据"></hs-empty>
</view>
</scroll-view>
<!-- 底部按钮 确定-->
......@@ -80,7 +83,7 @@ export default {
materialCategory: this.categoryDictionary.find(($item) =>{
return item.category == $item.value
})?.label,
materialDoorWidth: item.fabricWidth,
materialDoorWidth: item.clothWidth,
materialElement: item.saoriStandard,
}
})
......@@ -90,14 +93,14 @@ export default {
}
},
onLoad(){
this.getList();
this.getList(false);
},
methods:{
// 触底加载更多
onReachBottom() {
loadMore() {
if (this.pageOptions.current < this.pageOptions.pages) {
this.pageOptions.current += 1;
this.getData();
this.getList(false);
}
},
search(){
......@@ -105,12 +108,13 @@ export default {
current: 1,
size: 10,
}
this.getList();
this.getList(true);
},
getList(){
getList(isReload){
this.loadStatus = 'loading';
this.$http('materialinfo.getMaterialList', {
"codeAndName": this.keyword,
"isFilter": true,
"isDisabled": false,
"materialCode": "",
"materialType": "面料",
......@@ -118,7 +122,8 @@ export default {
}).then(res => {
let { code, data } = res;
if (code == 200) {
this.list = data.page.records;
this.list = isReload ? data.page.records :
this.list.concat(data.page.records || []);
this.pageOptions.pages = data.page.total;
this.loadStatus = this.list.length < data.page.total ? 'loadmore' : 'nomore';
}
......
......@@ -14,6 +14,7 @@ export default {
getMaterialList(){
this.$http("materialinfo.getMaterialList",{
isDisabled: false,
isFilter: true,
materialType: "面料",
current: 1,
size: 10,
......
......@@ -634,19 +634,6 @@ export default {
},
submit(type){
let {modelingTaskPictureDTOList, ...onther} = this.detail;
console.log(this.detail.modelingTaskMaterialColourList)
console.log(
Object.assign({},
onther,
{
designAgencyColourQuantity: this.designAgencyColourQuantity,
operationType:type,
modelingTaskPictureDTOList: modelingTaskPictureDTOList.concat(this.delModelingTaskPictureDTOList)}
)
)
return
this.$http("modeling.submit",Object.assign({},
onther,
{
......
......@@ -3,7 +3,7 @@
<!--选款-->
<u-navbar title="客户详情"
:border-bottom="false"
:background="{backgroundColor: 'transparent'}">
:background="{backgroundColor: 'whitesmoke'}">
</u-navbar>
<view class="u-p-30">
<view class="border-radius-8 bg-fff u-p-r-30 u-p-l-30 u-m-b-20">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment