|
|
@@ -58,7 +58,7 @@
|
|
|
<u-upload v-else ref="dUpload" :action="action" :file-list="xqImage" @on-success="detailsSuccess"
|
|
|
@on-remove="detailsRemove" max-count="20" width="140rpx" height="140rpx"></u-upload>
|
|
|
</view>
|
|
|
- <view class="item">
|
|
|
+ <view class="item" v-if="form.categoryId != '1945013773786701826'">
|
|
|
<view class="label">
|
|
|
原价<span>*</span>
|
|
|
</view>
|
|
|
@@ -69,7 +69,7 @@
|
|
|
元
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="item">
|
|
|
+ <view class="item" v-if="form.categoryId != '1945013773786701826'">
|
|
|
<view class="label">
|
|
|
实际售价<span>*</span>
|
|
|
</view>
|
|
|
@@ -80,7 +80,7 @@
|
|
|
元
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="item">
|
|
|
+ <view class="item" v-if="form.categoryId != '1945013773786701826'">
|
|
|
<view class="label">
|
|
|
组合套餐
|
|
|
</view>
|
|
|
@@ -89,6 +89,44 @@
|
|
|
<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <!-- 钣金喷漆 -->
|
|
|
+ <view class="spray" v-if="form.categoryId == '1945013773786701826'">
|
|
|
+ <view class="label" style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
|
|
|
+ 商品规格
|
|
|
+ <view class="change">
|
|
|
+ <span @click="allSelect">
|
|
|
+ <image src="/static/product/select.png" mode="" v-if="all"></image>
|
|
|
+ <image src="/static/product/round.png" mode="" v-else></image>
|
|
|
+ 全选
|
|
|
+ </span>
|
|
|
+ <span @click="reverseSelsct">
|
|
|
+ <image src="/static/product/select.png" mode="" v-if="reverse"></image>
|
|
|
+ <image src="/static/product/round.png" mode="" v-else></image>
|
|
|
+ 反选
|
|
|
+ </span>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="spray_items">
|
|
|
+ <view class="spra" v-for="(item,index) in form.specItems" :key="item.craftId">
|
|
|
+ <view class="square" @click="select(item)">
|
|
|
+ <image src="/static/product/square_select.png" mode="" v-if="item.replaced == true"></image>
|
|
|
+ <image src="/static/product/square.png" mode="" v-else></image>
|
|
|
+ </view>
|
|
|
+ <view class="right">
|
|
|
+ <view class="name">
|
|
|
+ <!-- {{item.craftId}} -->
|
|
|
+ {{item.partName}} {{item.positionName}} {{item.craftName}}
|
|
|
+ </view>
|
|
|
+ <view class="price">
|
|
|
+ <view class="option">原价<input v-model="item.price" placeholder="输入商品原价" style="height: 49rpx;" />
|
|
|
+ </view>
|
|
|
+ <view class="option">参考售价<input v-model="item.soldPrice" placeholder="输入商品参考售价" /></view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view v-show="schedule == 2">
|
|
|
<view class="form" style="margin-bottom: 24rpx;">
|
|
|
@@ -262,6 +300,9 @@
|
|
|
import refund from '@/components/product/refund.vue'
|
|
|
|
|
|
import configService from '../../common/service/config.service'
|
|
|
+ import {
|
|
|
+ nextTick
|
|
|
+ } from "vue"
|
|
|
export default {
|
|
|
components: {
|
|
|
rangTime,
|
|
|
@@ -311,9 +352,40 @@
|
|
|
productId: '',
|
|
|
jindouChecked: false,
|
|
|
jifenChecked: false,
|
|
|
+ selectVaule: 0, //钣金喷漆选择
|
|
|
+ all: false, //是否全选
|
|
|
+ reverse: false, //是否反选
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //全选
|
|
|
+ allSelect() {
|
|
|
+ this.all = true
|
|
|
+ this.reverse = false
|
|
|
+ this.form.specItems.forEach(item => {
|
|
|
+ item.replaced = true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //反选
|
|
|
+ reverseSelsct() {
|
|
|
+ this.reverse = true
|
|
|
+ this.all = false
|
|
|
+ this.form.specItems.forEach(item => {
|
|
|
+ item.replaced = !item.replaced
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //选中
|
|
|
+ select(item) {
|
|
|
+ item.replaced = !item.replaced
|
|
|
+ // const index = this.form.specItems.findIndex(i => i.id === item.id);
|
|
|
+ // if (index !== -1) {
|
|
|
+ // this.form.specItems.splice(index, 1, {
|
|
|
+ // ...item,
|
|
|
+ // replaced: !item.replaced
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ },
|
|
|
+
|
|
|
// 上传封面图成功回调
|
|
|
handleSuccess(res, index, lists) {
|
|
|
this.form.productImage = this.imageHttp + res.message
|
|
|
@@ -326,45 +398,40 @@
|
|
|
//上传详情图
|
|
|
detailsSuccess(res, index, lists) {
|
|
|
console.log(lists)
|
|
|
- this.processImageList(lists);
|
|
|
+ this.processImageList(lists);
|
|
|
this.xqImage = lists
|
|
|
},
|
|
|
detailsRemove(index, lists) {
|
|
|
this.xqImage = lists
|
|
|
- this.processImageList(lists);
|
|
|
+ this.processImageList(lists);
|
|
|
+ },
|
|
|
+ // 处理图片列表,生成URL字符串
|
|
|
+ processImageList(lists) {
|
|
|
+ let temp = [];
|
|
|
+ lists.forEach(item => {
|
|
|
+ if (item.response && item.response.message) {
|
|
|
+ temp.push(this.imageHttp + item.response.message);
|
|
|
+ } else if (item.url) {
|
|
|
+ // 处理已存在的图片
|
|
|
+ temp.push(item.url);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.form.detailImages = temp.join(',');
|
|
|
+ console.log('当前图片URL字符串:', this.form.detailImages);
|
|
|
},
|
|
|
- // 处理图片列表,生成URL字符串
|
|
|
- processImageList(lists) {
|
|
|
- let temp = [];
|
|
|
- lists.forEach(item => {
|
|
|
- if (item.response && item.response.message) {
|
|
|
- temp.push(this.imageHttp + item.response.message);
|
|
|
- } else if (item.url) {
|
|
|
- // 处理已存在的图片
|
|
|
- temp.push(item.url);
|
|
|
- }
|
|
|
- });
|
|
|
- this.form.detailImages = temp.join(',');
|
|
|
- console.log('当前图片URL字符串:', this.form.detailImages);
|
|
|
- },
|
|
|
//下一步
|
|
|
next() {
|
|
|
- console.log(this.xqImage);
|
|
|
-
|
|
|
let temp = []
|
|
|
- // if (this.xqImage.length > 0) {
|
|
|
- // this.xqImage.forEach((item => {
|
|
|
- // // temp.push(item.url)
|
|
|
- // if (item.response.message) {
|
|
|
-
|
|
|
- // temp.push({
|
|
|
- // url: this.imageHttp + item.response.message
|
|
|
- // })
|
|
|
- // }
|
|
|
- // }))
|
|
|
-
|
|
|
- // }
|
|
|
- // this.form.detailImages = temp.join(',')
|
|
|
+ if(this.form.specItems){
|
|
|
+ this.form.specItems.forEach(item => {
|
|
|
+ // item.replaced = true
|
|
|
+ if(item.replaced){
|
|
|
+ temp.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.form.specItems = temp
|
|
|
+ }
|
|
|
+
|
|
|
//基础信息必填提示
|
|
|
if (!this.form.categoryId) {
|
|
|
uni.showToast({
|
|
|
@@ -394,19 +461,24 @@
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.form.price) {
|
|
|
+ if (!this.form.price && !this.form.categoryId == '1945013773786701826') {
|
|
|
uni.showToast({
|
|
|
title: '请输入商品原价',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.form.soldPrice) {
|
|
|
+ if (!this.form.soldPrice && !this.form.categoryId == '1945013773786701826') {
|
|
|
uni.showToast({
|
|
|
title: '请输入商品售价',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
return
|
|
|
+ } else if (this.form.categoryId == '1945013773786701826' && temp.length ==0) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请选择最少一个配置',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
} else {
|
|
|
this.schedule += 1
|
|
|
}
|
|
|
@@ -576,7 +648,8 @@
|
|
|
icon: 'none'
|
|
|
});
|
|
|
return
|
|
|
- } else if (this.form.refundConfirmName == '' || this.form.refundLabelName == '') {
|
|
|
+ // } else if (this.tabIndex != 1 && (this.form.refundConfirmName == null || this.form.refundLabelName == null)) {
|
|
|
+ } else if (this.tabIndex != 1 && (this.form.refundConfirm == null || this.form.refundLabel == null)) {
|
|
|
uni.showToast({
|
|
|
title: '请选择退款标签',
|
|
|
icon: 'none'
|
|
|
@@ -638,6 +711,7 @@
|
|
|
this.$http.get("/app/product/queryById?id=" + this.productId, {}).then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
this.form = res.data.result
|
|
|
+
|
|
|
this.jifenChecked = res.data.result.integralAward ? true : false
|
|
|
this.jindouChecked = res.data.result.goldAward ? true : false
|
|
|
this.showText = res.data.result.productCategory
|
|
|
@@ -670,6 +744,7 @@
|
|
|
}
|
|
|
|
|
|
console.log(this.showRule)
|
|
|
+
|
|
|
uni.setStorage({
|
|
|
key: 'group',
|
|
|
data: res.data.result.productGroups
|
|
|
@@ -841,6 +916,88 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .spray {
|
|
|
+ .label {
|
|
|
+ height: 57rpx;
|
|
|
+ margin-right: 20rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 28rpx;
|
|
|
+ min-width: 126rpx;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+
|
|
|
+ .change {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-weight: 400;
|
|
|
+
|
|
|
+ span {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-left: 30rpx;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 36rpx;
|
|
|
+ height: 36rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ margin-right: 4rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .spray_items {
|
|
|
+ .spra {
|
|
|
+ height: 106rpx;
|
|
|
+ margin-bottom: 32rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: start;
|
|
|
+
|
|
|
+ .square {
|
|
|
+ margin-right: 12rpx;
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 30rpx;
|
|
|
+ height: 40rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .name {
|
|
|
+ display: flex;
|
|
|
+ font-size: 28rpx;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .price {
|
|
|
+ height: 49rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .option {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #666666;
|
|
|
+
|
|
|
+ input {
|
|
|
+ height: 49rpx;
|
|
|
+ width: 160rpx;
|
|
|
+ background: #F7F8FC;
|
|
|
+ border-radius: 4rpx;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #666666;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.upload {
|
|
|
display: block;
|
|
|
height: auto;
|