合并分支
commit
e1000d324e
|
@ -14,9 +14,10 @@
|
|||
"js-cookie": "^2.2.1",
|
||||
"less": "^3.12.2",
|
||||
"less-loader": "^5.0.0",
|
||||
"mv-count-down": "^0.1.15",
|
||||
"psl": "^1.8.0",
|
||||
"qs": "^6.9.4",
|
||||
"swiper": "^6.4.1",
|
||||
"swiper": "^5.2.0",
|
||||
"uuid": "^8.3.2",
|
||||
"v-distpicker": "^1.0.17",
|
||||
"view-design": "^4.3.2",
|
||||
|
|
Binary file not shown.
|
@ -11,4 +11,6 @@
|
|||
<glyph unicode="" glyph-name="next" horiz-adv-x="1025" d="M1024.951 448c0 2.706-1.097 5.193-1.536 7.826-0.585 3.145-0.658 6.363-1.902 9.362l-0.146 0.366c-1.682 3.95-4.389 7.314-7.022 10.606-1.024 1.317-1.463 2.926-2.706 4.096 0 0-0.146 0-0.146 0.146l-241.591 240.274c-8.15 7.642-19.145 12.336-31.236 12.336-25.247 0-45.714-20.467-45.714-45.714 0-12.218 4.793-23.317 12.602-31.518l-0.018 0.019 162.889-162.085h-821.76c-25.247 0-45.714-20.467-45.714-45.714s20.467-45.714 45.714-45.714h821.76l-162.889-162.085c-8.921-8.364-14.479-20.222-14.479-33.379 0-25.247 20.467-45.714 45.714-45.714 13.029 0 24.785 5.451 33.112 14.196l0.018 0.019 241.737 240.421c1.17 1.243 1.682 2.779 2.706 4.096 2.633 3.291 5.339 6.583 7.022 10.606l0.146 0.366c1.243 2.926 1.317 6.217 1.902 9.362 0.439 2.633 1.463 5.12 1.463 7.753v0.073c0 0.073 0 0 0 0z" />
|
||||
<glyph unicode="" glyph-name="qq" d="M512 929.009c-265.653 0-480.989-215.345-480.989-481.012 0-265.662 215.335-481.006 480.989-481.006s480.989 215.345 480.989 481.006c-0.001 265.668-215.335 481.012-480.989 481.012v0zM776.822 298.086c-12.422-11.596-33.749 1.033-54.249 29.4-8.901-24.019-20.497-46.171-33.956-66.051 28.987-10.353 47.626-26.505 47.626-44.726 0-31.473-55.699-56.942-124.443-56.942-40.79 0-76.819 8.899-99.593 22.777-22.565-13.877-58.799-22.777-99.59-22.777-68.745 0-124.443 25.469-124.443 56.942 0 18.014 18.637 34.373 47.626 44.726-13.666 19.877-25.056 42.033-33.959 66.051-20.496-28.156-41.822-40.997-54.249-29.4-16.978 15.94-10.555 72.263 14.702 125.688 5.799 12.215 12.010 23.188 18.428 32.716 3.518 155.297 105.805 279.947 231.281 279.947h0.413c125.475 0 227.762-124.443 231.281-279.947 6.417-9.527 12.634-20.501 18.427-32.716 25.055-53.425 31.684-109.748 14.701-125.688v0z" />
|
||||
<glyph unicode="" glyph-name="wechat" d="M579.6 448.4c-11.7 0-23.4-10.8-23.4-24.2 0-10.8 11.7-21.7 23.4-21.7 17.5 0 30 10.8 30 21.7 0 13.4-12.5 24.2-30 24.2zM502.8 561c18.4 0 30 11.7 30 29.2 0 18.4-11.7 29.2-30 29.2-17.5 0-34.2-10.8-34.2-29.2 0-17.5 16.7-29.2 34.2-29.2zM512 960c-282.8 0-512-229.2-512-512s229.2-512 512-512 512 229.2 512 512-229.2 512-512 512zM415.2 318.3c-30.9 0-53.4 5-82.6 13.3l-84.3-42.5 24.2 71.7c-59.2 41.7-94.3 94.3-94.3 158.5 0 113.5 106.8 200.2 236.9 200.2 115.1 0 217.7-68.4 237.7-165.2-8.3 1.7-15.9 2.5-22.5 2.5-113.5 0-201-85.1-201-187.7 0-17.5 2.5-33.4 6.7-50.1-6.6-0.7-14.1-0.7-20.8-0.7zM763.1 236.5l16.7-60.1-63.4 35.9c-24.2-5-47.5-12.5-71.7-12.5-111.8 0-200.2 76.7-200.2 171.8s88.4 171.8 200.2 171.8c105.9 0 201-76.7 201-171.8 0-53.3-35.9-100.9-82.6-135.1zM337.7 619.4c-17.5 0-35.9-10.8-35.9-29.2 0-17.5 18.4-29.2 35.9-29.2 16.7 0 30 11.7 30 29.2 0 18.4-13.4 29.2-30 29.2zM710.5 448.4c-12.5 0-23.4-10.8-23.4-24.2 0-10.8 10.8-21.7 23.4-21.7 16.7 0 29.2 10.8 29.2 21.7 0 13.4-12.5 24.2-29.2 24.2z" />
|
||||
<glyph unicode="" glyph-name="qrcode" d="M445.077 845.495h-290.715c-20.056 0-36.327-16.27-36.327-36.327v-290.715c0-20.056 16.27-36.327 36.327-36.327h290.715c20.056 0 36.327 16.27 36.327 36.327v290.613c0 20.056-16.27 36.429-36.327 36.429zM449.784 518.351c0-2.558-2.149-4.707-4.707-4.707h-290.715c-2.558 0-4.707 2.149-4.707 4.707v290.715c0 2.558 2.149 4.707 4.707 4.707h290.715c2.558 0 4.707-2.149 4.707-4.707v-290.715zM350.219 737.231h-101.1c-12.689 0-22.922-10.335-22.922-22.922v-101.1c0-12.689 10.335-22.922 22.922-22.922h101.1c12.689 0 22.922 10.335 22.922 22.922v101.1c0.102 12.586-10.233 22.922-22.922 22.922zM341.521 621.907h-83.705v83.705h83.705v-83.705zM350.219 306.122h-101.1c-12.689 0-22.922-10.335-22.922-22.922v-101.1c0-12.689 10.335-22.922 22.922-22.922h101.1c12.689 0 22.922 10.335 22.922 22.922v101.1c0.102 12.689-10.233 22.922-22.922 22.922zM341.521 190.798h-83.705v83.705h83.705v-83.705zM673.474 590.288h101.1c12.689 0 22.922 10.335 22.922 22.922v101.1c0 12.689-10.335 22.922-22.922 22.922h-101.1c-12.689 0-22.922-10.335-22.922-22.922v-101.1c0-12.689 10.233-22.922 22.922-22.922zM682.172 705.612h83.705v-83.705h-83.705v83.705zM445.077 417.148h-290.715c-20.056 0-36.327-16.27-36.327-36.327v-290.715c0-20.056 16.27-36.327 36.327-36.327h290.715c20.056 0 36.327 16.27 36.327 36.327v290.715c0 20.056-16.27 36.327-36.327 36.327zM449.784 90.107c0-2.558-2.149-4.707-4.707-4.707h-290.715c-2.558 0-4.707 2.149-4.707 4.707v290.715c0 2.558 2.149 4.707 4.707 4.707h290.715c2.558 0 4.707-2.149 4.707-4.707v-290.715zM580.458 416.022c-20.056 0-36.327-16.27-36.327-36.327v-167.205c0-8.698 7.061-15.861 15.861-15.861 8.698 0 15.861 7.061 15.861 15.861v167.102c0 2.558 2.149 4.707 4.707 4.707h176.005c8.698 0 15.861 7.061 15.861 15.861s-7.061 15.861-15.861 15.861h-176.107zM578.616 482.024h290.715c20.056 0 36.327 16.27 36.327 36.327v290.715c0 20.056-16.27 36.327-36.327 36.327h-290.715c-20.056 0-36.327-16.27-36.327-36.327v-290.715c0-19.954 16.373-36.327 36.327-36.327zM574.011 809.066c0 2.558 2.149 4.707 4.707 4.707h290.715c2.558 0 4.707-2.149 4.707-4.707v-290.715c0-2.558-2.149-4.707-4.707-4.707h-290.817c-2.558 0-4.707 2.149-4.707 4.707v290.715h0.102zM905.964 400.161c0 8.698-7.061 15.861-15.861 15.861h-58.020c-8.698 0-15.861-7.061-15.861-15.861s7.061-15.861 15.861-15.861h42.159v-60.988h-131.492c-8.698 0-15.861-7.061-15.861-15.861 0-8.698 7.061-15.861 15.861-15.861h147.353c8.698 0 15.861 7.061 15.861 15.861v92.71zM614.226 84.888h-38.475v44.104c0 8.698-7.061 15.861-15.861 15.861s-15.861-7.061-15.861-15.861v-59.862c0-8.698 7.061-15.861 15.861-15.861h54.336c8.698 0 15.861 7.061 15.861 15.861 0 8.698-7.061 15.759-15.861 15.759zM789.412 207.579c0 8.698-7.061 15.861-15.861 15.861h-99.975c-8.698 0-15.861-7.061-15.861-15.861v-140.088c0-8.698 7.061-15.861 15.861-15.861s15.861 7.061 15.861 15.861v124.227h84.114c8.8 0 15.861 7.061 15.861 15.861zM890.001 265.088c-8.698 0-15.861-7.061-15.861-15.861v-166.898h-143.26c-8.698 0-15.861-7.061-15.861-15.861 0-8.698 7.061-15.861 15.861-15.861h159.018c8.698 0 15.861 7.061 15.861 15.861v182.758c0 8.8-7.061 15.861-15.759 15.861zM636.431 350.839c-8.698 0-15.861-7.061-15.861-15.861v-51.471c0-8.698 7.061-15.861 15.861-15.861 8.698 0 15.861 7.061 15.861 15.861v51.471c0 8.8-7.163 15.861-15.861 15.861z" />
|
||||
<glyph unicode="" glyph-name="uniE905" horiz-adv-x="1055" d="M745.891 349.28c0-26.168 21.214-47.382 47.382-47.382s47.382 21.214 47.382 47.382c0 26.168-21.214 47.382-47.382 47.382v0c-26.168 0-47.382-21.214-47.382-47.382v0zM759.195 244.935c-44.978 0.149-81.399 36.571-81.548 81.534v52.143c0.149 44.978 36.571 81.399 81.534 81.548h296.231v168.518c-0.149 44.978-36.571 81.399-81.534 81.548h-892.329c-44.978-0.149-81.399-36.571-81.548-81.534v-611.144c0.149-44.978 36.571-81.399 81.534-81.548h892.329c44.978 0.149 81.399 36.571 81.548 81.534v227.4zM905.15 762.004l-86.061 155.918c-14.23 25.257-40.876 42.035-71.44 42.035-14.412 0-27.953-3.731-39.71-10.279l0.416 0.213-339.907-187.887z" />
|
||||
</font></defs></svg>
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 8.0 KiB |
Binary file not shown.
Binary file not shown.
|
@ -1,10 +1,10 @@
|
|||
@font-face {
|
||||
font-family: 'icomoon';
|
||||
src: url('icomoon.eot?4ejtdc');
|
||||
src: url('icomoon.eot?4ejtdc#iefix') format('embedded-opentype'),
|
||||
url('icomoon.ttf?4ejtdc') format('truetype'),
|
||||
url('icomoon.woff?4ejtdc') format('woff'),
|
||||
url('icomoon.svg?4ejtdc#icomoon') format('svg');
|
||||
src: url('icomoon.eot?jvagvf');
|
||||
src: url('icomoon.eot?jvagvf#iefix') format('embedded-opentype'),
|
||||
url('icomoon.ttf?jvagvf') format('truetype'),
|
||||
url('icomoon.woff?jvagvf') format('woff'),
|
||||
url('icomoon.svg?jvagvf#icomoon') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
|
@ -25,6 +25,14 @@
|
|||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-wallet:before {
|
||||
content: "\e905";
|
||||
color: #3c56c6;
|
||||
}
|
||||
.icon-qrcode:before {
|
||||
content: "\e904";
|
||||
color: #999;
|
||||
}
|
||||
.icon-customer-service:before {
|
||||
content: "\e900";
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
<span class="inventory"> 库存{{skuDetail.quantity}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-select">
|
||||
<div class="item-select" v-if="skuDetail.goodsType !== 'VIRTUAL_GOODS'">
|
||||
<div class="item-select-title">
|
||||
<p>重量</p>
|
||||
</div>
|
||||
|
@ -119,11 +119,11 @@
|
|||
<span class="inventory"> {{skuDetail.weight}}kg</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="add-buy-car" v-if="$route.query.way === 'POINT'">
|
||||
<div class="add-buy-car" v-if="$route.query.way === 'POINT' && skuDetail.isAuth === 'PASS'">
|
||||
<Button type="error" :loading="loading" :disabled="skuDetail.quantity === 0" @click="pointPay">积分购买</Button>
|
||||
</div>
|
||||
<div class="add-buy-car" v-else>
|
||||
<Button type="error" :loading="loading" :disabled="skuDetail.quantity === 0" @click="addShoppingCartBtn">加入购物车</Button>
|
||||
<div class="add-buy-car" v-if="$route.query.way !== 'POINT' && skuDetail.isAuth === 'PASS'">
|
||||
<Button type="error" v-if="skuDetail.goodsType !== 'VIRTUAL_GOODS'" :loading="loading" :disabled="skuDetail.quantity === 0" @click="addShoppingCartBtn">加入购物车</Button>
|
||||
<Button type="warning" :loading="loading1" :disabled="skuDetail.quantity === 0" @click="buyNow">立即购买</Button>
|
||||
</div>
|
||||
|
||||
|
@ -151,7 +151,7 @@ export default {
|
|||
count: 1, // 商品数量
|
||||
imgIndex: 0, // 展示图片下标
|
||||
currentSelceted: [], // 当前商品sku
|
||||
imgList: this.detail.data.specList[0].specImage, // 商品图片列表
|
||||
imgList: this.detail.data.specList[0].specImage || [], // 商品图片列表
|
||||
skuDetail: this.detail.data, // sku详情
|
||||
goodsSpecList: this.detail.specs, // 商品spec
|
||||
promotionMap: { // 活动状态
|
||||
|
@ -199,7 +199,6 @@ export default {
|
|||
skuId: this.skuDetail.id
|
||||
};
|
||||
this.loading = true;
|
||||
console.log(11111111);
|
||||
addCartGoods(params).then(res => {
|
||||
debugger;
|
||||
this.loading = false;
|
||||
|
@ -219,11 +218,15 @@ export default {
|
|||
skuId: this.skuDetail.id,
|
||||
cartType: 'BUY_NOW'
|
||||
};
|
||||
// 虚拟商品购买
|
||||
if (this.skuDetail.goodsType === 'VIRTUAL_GOODS') {
|
||||
params.cartType = 'VIRTUAL'
|
||||
}
|
||||
this.loading1 = true;
|
||||
addCartGoods(params).then(res => {
|
||||
this.loading1 = false;
|
||||
if (res.success) {
|
||||
this.$router.push({path: '/pay', query: {way: 'BUY_NOW'}});
|
||||
this.$router.push({path: '/pay', query: {way: params.cartType}});
|
||||
} else {
|
||||
this.$Message.warning(res.message);
|
||||
}
|
||||
|
@ -324,6 +327,7 @@ export default {
|
|||
})
|
||||
},
|
||||
promotion () { // 格式化促销活动,返回当前促销的对象
|
||||
if (!this.detail.promotionMap) return false;
|
||||
let keysArr = Object.keys(this.detail.promotionMap);
|
||||
if (keysArr.length === 0) return false;
|
||||
|
||||
|
|
|
@ -86,6 +86,14 @@
|
|||
</div>
|
||||
</div>
|
||||
</TabPane>
|
||||
<TabPane label="商品参数">
|
||||
<table class="mt_10" border="1" cellpadding='0' cellspacing="0" v-if="skuDetail.goodsParamsList && skuDetail.length">
|
||||
<tr v-for="param in skuDetail.goodsParamsList" :key="param">
|
||||
<td>{{param.paramName}}</td><td>{{param.paramValue}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- <div v-else>暂无商品参数</div> -->
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -475,4 +483,18 @@ export default {
|
|||
.ivu-rate-star-full:before, .ivu-rate-star-half .ivu-rate-star-content:before {
|
||||
color: $theme_color;
|
||||
}
|
||||
table{
|
||||
border-color: #eee;
|
||||
color: #999;
|
||||
width: 70%;
|
||||
margin-left: 10px;
|
||||
tr{
|
||||
td:nth-child(1){
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
td{
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
</template>
|
||||
<script>
|
||||
import { Swiper, SwiperSlide, directive } from 'vue-awesome-swiper';
|
||||
import 'swiper/swiper-bundle.css';
|
||||
// import 'swiper/swiper-bundle.css';
|
||||
export default {
|
||||
components: {
|
||||
Swiper,
|
||||
|
|
|
@ -98,14 +98,14 @@ export default {
|
|||
}
|
||||
},
|
||||
created () {
|
||||
this.getImg();
|
||||
// this.getImg();
|
||||
},
|
||||
watch: {
|
||||
verifyType: {
|
||||
immediate: true,
|
||||
handler: function (v) {
|
||||
this.type = v;
|
||||
this.refresh();
|
||||
// this.refresh();
|
||||
}
|
||||
},
|
||||
show (v) {
|
||||
|
|
|
@ -30,13 +30,13 @@
|
|||
</div>
|
||||
<empty v-else />
|
||||
<!-- 分页 -->
|
||||
<div class="page-size mt_10" v-if="paging">
|
||||
<!-- <div class="page-size mt_10" v-if="paging">
|
||||
<Page :total="total" @on-change="changePageNum"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size="params.pageSize"
|
||||
show-sizer>
|
||||
</Page>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -61,7 +61,7 @@ export default {
|
|||
total: 0, // 收藏总数
|
||||
params: { // 请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 100,
|
||||
type: 'GOODS'
|
||||
},
|
||||
spinShow: false // 加载状态
|
||||
|
|
|
@ -44,6 +44,12 @@
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="order-card" v-if="afterSale.afterSaleImage">
|
||||
<h3 class="mb_10">图片信息</h3>
|
||||
<div v-for="img in afterSale.afterSaleImage.split(',')" :key="img">
|
||||
<img :src="img" width="200" height="200" @click="perviewImg(img)" class="hover-pointer" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -83,6 +89,9 @@ export default {
|
|||
filterOrderStatus (status) { // 获取订单状态中文
|
||||
const ob = this.afterSaleStatusList.filter(e => { return e.status === status });
|
||||
return ob[0].name
|
||||
},
|
||||
perviewImg (img) {
|
||||
window.open(img, '_blank')
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
</template>
|
||||
</Table>
|
||||
<div>
|
||||
<Form :model="form" ref="form" :rules="rules" :label-width="80">
|
||||
<Form :model="form" ref="form" class="mt_10" :rules="rules" :label-width="80">
|
||||
<FormItem label="售后类别">
|
||||
<RadioGroup v-model="form.serviceType" @on-change="changeReason" type="button" button-style="solid">
|
||||
<Radio label="RETURN_GOODS">退货</Radio>
|
||||
<Radio label="RETURN_MONEY">退款</Radio>
|
||||
<Radio v-if="info.returnGoods" label="RETURN_GOODS">退货</Radio>
|
||||
<Radio v-if="info.returnMoney" label="RETURN_MONEY">退款</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem label="提交数量" prop="num">
|
||||
|
@ -144,6 +144,10 @@ export default {
|
|||
if (res.success) {
|
||||
this.info = res.result
|
||||
this.goodsData.push(res.result)
|
||||
if (!this.info.returnGoods && this.info.returnMoney) {
|
||||
this.form.serviceType = 'RETURN_MONEY'
|
||||
}
|
||||
this.getReason(this.form.serviceType)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -195,7 +199,6 @@ export default {
|
|||
mounted () {
|
||||
this.accessToken.accessToken = storage.getItem('accessToken');
|
||||
this.getInfo()
|
||||
this.getReason('RETURN_GOODS')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="order-detail" v-if="order.order">
|
||||
<card _Title="订单详情" :_Size="16"></card>
|
||||
<div class="order-card">
|
||||
<p class="global_color fontsize_18">{{ order.orderStatusValue }}</p>
|
||||
<p class="global_color fontsize_18">{{ order.orderStatusValue }} <span class="verificationCode" v-if="order.order.verificationCode">核验码:{{order.order.verificationCode}}</span></p>
|
||||
<p class="global_color">订单号:{{ order.order.sn }}</p>
|
||||
<div style="color:#999;" class="operation-time">操作时间:{{order.order.updateTime}}</div>
|
||||
<Steps class="progress" :current="progressList.length" direction="vertical">
|
||||
|
@ -22,8 +22,8 @@
|
|||
</div>
|
||||
<div class="order-card">
|
||||
<h3>付款信息</h3>
|
||||
<p>支付方式:在线支付</p>
|
||||
<p>付款状态:未付款</p>
|
||||
<p>支付方式:{{order.paymentMethodValue}}</p>
|
||||
<p>付款状态:{{order.payStatusValue}}</p>
|
||||
</div>
|
||||
<div class="order-card">
|
||||
<h3>配送信息</h3>
|
||||
|
@ -234,7 +234,12 @@ table {
|
|||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.verificationCode {
|
||||
font-size: 16px;
|
||||
margin-left: 240px;
|
||||
color: rgb(65, 63, 63);
|
||||
font-weight: bold;
|
||||
}
|
||||
/** 订单进度条 */
|
||||
.progress {
|
||||
margin: 15px 0;
|
||||
|
|
|
@ -215,7 +215,7 @@ export default {
|
|||
color: 'green'
|
||||
}
|
||||
},
|
||||
params.row.money
|
||||
this.$options.filters.unitPrice(params.row.money, '+ ¥')
|
||||
)
|
||||
]);
|
||||
} else if (params.row.money < 0) {
|
||||
|
@ -227,7 +227,7 @@ export default {
|
|||
color: 'red'
|
||||
}
|
||||
},
|
||||
params.row.money
|
||||
this.$options.filters.unitPrice(0 - params.row.money, '- ¥')
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
@ -252,7 +252,10 @@ export default {
|
|||
},
|
||||
{
|
||||
title: '充值金额',
|
||||
key: 'rechargeMoney'
|
||||
key: 'rechargeMoney',
|
||||
render: (h, params) => {
|
||||
return h('div', [h('span', this.$options.filters.unitPrice(params.row.rechargeMoney, '¥'))]);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '支付状态',
|
||||
|
@ -281,7 +284,9 @@ export default {
|
|||
{
|
||||
title: '提现金额',
|
||||
key: 'applyMoney',
|
||||
width: 120
|
||||
render: (h, params) => {
|
||||
return h('div', [h('span', this.$options.filters.unitPrice(params.row.applyMoney, '¥'))]);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '提现状态',
|
||||
|
@ -392,9 +397,10 @@ export default {
|
|||
if (valid) {
|
||||
recharge(this.formData).then((res) => {
|
||||
if (res.message === 'success') {
|
||||
// TODO 根据返回的值跳转到收银台进行支付,一下是输出sn
|
||||
console.warn(res.result.rechargeSn);
|
||||
this.modal = false;
|
||||
this.$router.push({
|
||||
path: '/payment',
|
||||
query: { orderType: 'RECHARGE', sn: res.result.rechargeSn }
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -15,6 +15,14 @@
|
|||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- 分页 -->
|
||||
<div class="page-size">
|
||||
<Page :total="total" @on-change="changePageNum"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size="params.pageSize"
|
||||
show-sizer>
|
||||
</Page>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -25,7 +33,14 @@ export default {
|
|||
data () {
|
||||
return {
|
||||
list: [], // 我的足迹,商品列表
|
||||
spinShow: false // 控制loading是否加载
|
||||
spinShow: false, // 控制loading是否加载
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 30,
|
||||
order: 'desc',
|
||||
sort: 'createTime'
|
||||
},
|
||||
total: 0
|
||||
};
|
||||
},
|
||||
mounted () {
|
||||
|
@ -71,7 +86,16 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
getList () {
|
||||
changePageNum (val) { // 修改页码
|
||||
this.params.pageNumber = val;
|
||||
this.getList()
|
||||
},
|
||||
changePageSize (val) { // 修改页数
|
||||
this.pageNumber = 1;
|
||||
this.params.pageSize = val;
|
||||
this.getList()
|
||||
},
|
||||
getList () { // 获取足迹列表
|
||||
this.spinShow = true;
|
||||
tracksList(this.params).then(res => {
|
||||
this.spinShow = false
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
</div>
|
||||
<div class="pay-btn">
|
||||
<Button type="primary" @click="$router.push('/')">继续逛逛</Button>
|
||||
<Button type="info" @click="$router.push('home/myOrder')">查看订单</Button>
|
||||
<Button type="info" v-if="$route.query.orderType ==='RECHARGE'" @click="$router.push('/home/MoneyManagement')">查看余额</Button>
|
||||
<Button type="info" v-else @click="$router.push('/home/myOrder')">查看订单</Button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -5,31 +5,64 @@
|
|||
<div class="head-left">
|
||||
<div class="left-tips">订单提交成功,请尽快付款!</div>
|
||||
<div class="left-tips-time">请您尽快完成支付,否则订单会被自动取消</div>
|
||||
<div class="left-tips-count-down">
|
||||
<mv-count-down :startTime="startTime" class="count-down"
|
||||
:endTime="endTime"
|
||||
:endText="endText"
|
||||
:dayTxt="'天'"
|
||||
:hourTxt="'小时'"
|
||||
:minutesTxt="'分钟'"
|
||||
:secondsTxt="'秒'"
|
||||
:isStart="isStart"></mv-count-down>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-right">
|
||||
<div>应付金额 <span class="price">{{ payDetail.price | unitPrice }}</span>元</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper-box">
|
||||
<div class="-box-item" @click="handlePay('ALIPAY')">
|
||||
<img src="https://ss3.bdstatic.com/yrwDcj7w0QhBkMak8IuT_XF5ehU5bvGh7c50/logopic/a9936a369e82e0c6c42112674a5220e8_fullsize.jpg" alt="">
|
||||
<div v-if="support.includes('ALIPAY')" class="-box-item" @click="handlePay('ALIPAY')">
|
||||
<img
|
||||
src="https://ss3.bdstatic.com/yrwDcj7w0QhBkMak8IuT_XF5ehU5bvGh7c50/logopic/a9936a369e82e0c6c42112674a5220e8_fullsize.jpg"
|
||||
alt="">
|
||||
<span>支付宝</span>
|
||||
</div>
|
||||
<div class="-box-item" @click="handlePay('WECHAT')">
|
||||
<img src="https://dss1.bdstatic.com/6OF1bjeh1BF3odCf/it/u=3774939867,2826752539&fm=74&app=80&f=JPEG&size=f121,121?sec=1880279984&t=796e842a5ef2d16d9edc872d6f1147ef" alt="">
|
||||
<div v-if="support.includes('WECHAT')" class="-box-item" @click="handlePay('WECHAT')">
|
||||
<img
|
||||
src="https://dss1.bdstatic.com/6OF1bjeh1BF3odCf/it/u=3774939867,2826752539&fm=74&app=80&f=JPEG&size=f121,121?sec=1880279984&t=796e842a5ef2d16d9edc872d6f1147ef"
|
||||
alt="">
|
||||
<span>微信</span>
|
||||
</div>
|
||||
<div v-if="support.includes('WALLET') && $route.query.orderType !== 'RECHARGE'" class="-box-item" @click="handlePay('WALLET')">
|
||||
<Icon custom="icomoon icon-wallet" size="60"/>
|
||||
<span>余额支付</span>
|
||||
<span>当前剩余({{ walletValue | unitPrice('¥') }})</span>
|
||||
</div>
|
||||
</div>
|
||||
<BaseFooter></BaseFooter>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { tradeDetail } from '@/api/pay.js';
|
||||
|
||||
import {tradeDetail, pay} from '@/api/pay.js';
|
||||
import MvCountDown from 'mv-count-down'
|
||||
import {Message} from 'view-design';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
MvCountDown
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
payDetail: {}, // 支付详情
|
||||
qrcode: '' // 支付二维码
|
||||
support: [], // 支持配送方式
|
||||
walletValue: 0, // 当前余额
|
||||
qrcode: '', // 支付二维码
|
||||
startTime: new Date().getTime(), // 开始时间(时间戳)
|
||||
endTime: 0, // 完成的时间(时间戳)
|
||||
endText: '订单已超时取消', // 倒计时完成的提示文本
|
||||
isStart: false // 控制倒计时开始的时机(异步请求完成开启)
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -39,16 +72,46 @@ export default {
|
|||
tradeDetail(params).then(res => {
|
||||
if (res.success) {
|
||||
this.payDetail = res.result;
|
||||
this.endTime = this.payDetail.autoCancel
|
||||
this.isStart = true
|
||||
this.support = this.payDetail.support
|
||||
this.walletValue = this.payDetail.walletValue
|
||||
}
|
||||
});
|
||||
},
|
||||
// 支付
|
||||
handlePay (way) {
|
||||
// 余额支付则直接跳转
|
||||
if (way === 'WALLET') {
|
||||
// 如果待支付金额大于余额,则报错
|
||||
if (this.payDetail.price > this.walletValue) {
|
||||
Message.error('余额不足以支付当前订单,如需充值请前往会员中心');
|
||||
return;
|
||||
}
|
||||
}
|
||||
const params = this.$route.query;
|
||||
params.paymentMethod = way;
|
||||
params.paymentClient = 'NATIVE';
|
||||
params.price = this.payDetail.price;
|
||||
if (way === 'WALLET') {
|
||||
this.$Modal.confirm({
|
||||
title: '支付确认',
|
||||
content: '<p>确认使用余额支付吗?</p>',
|
||||
onOk: () => {
|
||||
pay(params).then(res => {
|
||||
if (res.success) {
|
||||
this.$Message.warning(res.message)
|
||||
this.$router.push('/payDone');
|
||||
} else {
|
||||
this.$Message.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$router.push({path: '/qrpay', query: params});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getTradeDetail();
|
||||
|
@ -59,61 +122,80 @@ export default {
|
|||
.head-left {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.left-tips {
|
||||
font-size: 21px;
|
||||
|
||||
}
|
||||
|
||||
.-box-item {
|
||||
margin-right: 30px;
|
||||
display: flex;
|
||||
font-size: 21px;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
align-items: center;
|
||||
margin: 20px 20px;
|
||||
cursor: pointer;
|
||||
@include content_color($light_content_color);
|
||||
|
||||
&:hover{color: $theme_color;}
|
||||
&:hover {
|
||||
color: $theme_color;
|
||||
}
|
||||
|
||||
> span {
|
||||
margin-left: 10px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
> img {
|
||||
border-radius: 10px;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
.left-tips-time {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.left-tips-count-down {
|
||||
font-size: 10px;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.wrapper-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
line-height: 1.75;
|
||||
}
|
||||
|
||||
.wrapper-head,
|
||||
.wrapper-box {
|
||||
padding: 20px 40px;
|
||||
width: 1200px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
.wrapper-box {
|
||||
@include white_background_color();
|
||||
height: auto;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: $theme_color;
|
||||
}
|
||||
|
||||
.head-right {
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
}
|
||||
.count-down{
|
||||
font-size: 16px!important;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -70,7 +70,7 @@ export default {
|
|||
payCallback(params).then(res => {
|
||||
if (res.result) {
|
||||
clearInterval(this.interval);
|
||||
this.$router.push('/payDone');
|
||||
this.$router.push({path: '/payDone', query: {orderType: this.$route.query.orderType}});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -2051,7 +2051,7 @@ copy-webpack-plugin@^4.0.1:
|
|||
p-limit "^1.0.0"
|
||||
serialize-javascript "^1.4.0"
|
||||
|
||||
core-js@^2.4.0, core-js@^2.5.0:
|
||||
core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.5:
|
||||
version "2.6.12"
|
||||
resolved "https://registry.npm.taobao.org/core-js/download/core-js-2.6.12.tgz?cache=0&sync_timestamp=1607216048810&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec"
|
||||
integrity sha1-2TM9+nsGXjR8xWgiGdb2kIWcwuw=
|
||||
|
@ -5150,6 +5150,16 @@ mute-stream@0.0.7:
|
|||
resolved "https://registry.npm.taobao.org/mute-stream/download/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
|
||||
integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=
|
||||
|
||||
mv-count-down@^0.1.15:
|
||||
version "0.1.15"
|
||||
resolved "https://registry.npmjs.org/mv-count-down/-/mv-count-down-0.1.15.tgz#a3f3c1677576e592c7710b441b2dda96acac2702"
|
||||
integrity sha512-7poh86i27D/u4AvE9Ne8QHhy61p4MYAhSf4XAVyxzL0gXVCyccJ0NtJferEOxBP6C2q9jImknpKLGdwnEeJ7qQ==
|
||||
dependencies:
|
||||
core-js "^2.6.5"
|
||||
vue "^2.6.10"
|
||||
vue-router "^3.0.3"
|
||||
vuex "^3.0.1"
|
||||
|
||||
nan@^2.12.1, nan@^2.13.2:
|
||||
version "2.14.2"
|
||||
resolved "https://registry.npm.taobao.org/nan/download/nan-2.14.2.tgz?cache=0&sync_timestamp=1602591700047&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnan%2Fdownload%2Fnan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19"
|
||||
|
@ -8315,6 +8325,11 @@ vue-router@^3.0.1:
|
|||
resolved "https://registry.npm.taobao.org/vue-router/download/vue-router-3.4.9.tgz?cache=0&sync_timestamp=1607347231238&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-router%2Fdownload%2Fvue-router-3.4.9.tgz#c016f42030ae2932f14e4748b39a1d9a0e250e66"
|
||||
integrity sha1-wBb0IDCuKTLxTkdIs5odmg4lDmY=
|
||||
|
||||
vue-router@^3.0.3:
|
||||
version "3.5.2"
|
||||
resolved "https://registry.npmjs.org/vue-router/-/vue-router-3.5.2.tgz#5f55e3f251970e36c3e8d88a7cd2d67a350ade5c"
|
||||
integrity sha512-807gn82hTnjCYGrnF3eNmIw/dk7/GE4B5h69BlyCK9KHASwSloD1Sjcn06zg9fVG4fYH2DrsNBZkpLtb25WtaQ==
|
||||
|
||||
vue-style-loader@^3.0.0, vue-style-loader@^3.0.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-3.1.2.tgz#6b66ad34998fc9520c2f1e4d5fa4091641c1597a"
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
"sockjs-client": "^1.4.0",
|
||||
"stompjs": "^2.3.3",
|
||||
"swiper": "^6.3.5",
|
||||
"uuid": "^8.3.2",
|
||||
"view-design": "^4.2.0",
|
||||
"vue": "^2.6.10",
|
||||
"vue-apexcharts": "^1.5.1",
|
||||
|
@ -48,8 +49,7 @@
|
|||
"vuex": "^3.4.0",
|
||||
"wangeditor": "^4.5.3",
|
||||
"xlsx": "^0.16.2",
|
||||
"xss": "^1.0.7",
|
||||
"uuid": "^8.3.2"
|
||||
"xss": "^1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^4.4.4",
|
||||
|
|
|
@ -76,15 +76,15 @@ export const disableCategory = (id, type) => {
|
|||
|
||||
// 获取商品规格分页列表
|
||||
export const getSpecListData = (params) => {
|
||||
return getRequest('/goods/spec/page', params)
|
||||
return getRequest('/goods/spec', params)
|
||||
}
|
||||
// 添加或修改规格设置
|
||||
export const insertSpec = (params) => {
|
||||
return postRequest('/goods/spec', params)
|
||||
}
|
||||
// 添加或修改规格设置
|
||||
export const updateSpec = (params) => {
|
||||
return putRequest('/goods/spec', params)
|
||||
export const updateSpec = (id,params) => {
|
||||
return putRequest(`/goods/spec/${id}`, params)
|
||||
}
|
||||
//根据分类id获取关联规格
|
||||
export const getCategorySpecListData = (category_id, params) => {
|
||||
|
@ -94,15 +94,6 @@ export const getCategorySpecListData = (category_id, params) => {
|
|||
export const delSpec = (id, params) => {
|
||||
return deleteRequest(`/goods/spec/${id}`, params)
|
||||
}
|
||||
// 获取商品规格值列表
|
||||
export const getSpecValuesListData = (id, params) => {
|
||||
return getRequest(`/goods/specValues/values/${id}`, params)
|
||||
}
|
||||
// 添加商品规格值
|
||||
export const saveSpecValues = (id, params) => {
|
||||
return postRequest(`/goods/specValues/save/${id}`, params)
|
||||
}
|
||||
|
||||
|
||||
// 查询某分类下的全部子分类列表
|
||||
export const getGoodsCategory = (parent_id) => {
|
||||
|
|
|
@ -6,7 +6,7 @@ import ViewUI from 'view-design'
|
|||
import './styles/theme.less';
|
||||
|
||||
import "core-js/stable"
|
||||
import "regenerator-runtime/runtime"
|
||||
// import "regenerator-runtime/runtime"
|
||||
import App from './App'
|
||||
import { router } from './router/index'
|
||||
import store from './store'
|
||||
|
|
|
@ -16,6 +16,22 @@ export function unitPrice(val, unit, location) {
|
|||
return (unit || '') + price
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单来源
|
||||
*/
|
||||
export function clientTypeWay(val) {
|
||||
if (val == "H5") {
|
||||
return "移动端";
|
||||
} else if (val == "PC") {
|
||||
return "PC端";
|
||||
} else if (val == "WECHAT_MP") {
|
||||
return "小程序端";
|
||||
} else if (val == "APP") {
|
||||
return "移动应用端";
|
||||
} else {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -261,7 +261,6 @@ export default {
|
|||
getCategorySpecListData(v.id).then((res) => {
|
||||
this.categoryId = v.id;
|
||||
this.modalSpecTitle = "规格关联";
|
||||
console.log(res);
|
||||
this.specForm.categorySpecs = res.map((item) => item.id);
|
||||
this.modalSpecVisible = true;
|
||||
});
|
||||
|
|
|
@ -62,25 +62,9 @@
|
|||
<FormItem label="规格名称" prop="specName">
|
||||
<Input v-model="form.specName" maxlength="30" clearable style="width: 100%"/>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="saveSpec"
|
||||
>提交</Button
|
||||
>
|
||||
</div>
|
||||
</Modal>
|
||||
<Modal
|
||||
:title="modalTitle"
|
||||
v-model="dialogSpecValuesVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
:styles="{ top: '30px' }"
|
||||
class="permModal"
|
||||
>
|
||||
<Form ref="specForm" :model="specForm" :label-width="100">
|
||||
<FormItem label="规格值" prop="specValue">
|
||||
<Select
|
||||
v-model="specForm.specValue"
|
||||
v-model="form.specValue"
|
||||
placeholder="输入后回车添加"
|
||||
multiple
|
||||
filterable
|
||||
|
@ -90,23 +74,19 @@
|
|||
style="width: 100%; text-align: left; margin-right: 10px"
|
||||
>
|
||||
<Option
|
||||
v-for="item in specValues"
|
||||
:value="item.specValue"
|
||||
:key="item.id"
|
||||
:label="item.specValue"
|
||||
v-for="item in specValue"
|
||||
:value="item"
|
||||
:label="item"
|
||||
>
|
||||
</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="dialogSpecValuesVisible = false"
|
||||
>取消</Button
|
||||
>
|
||||
<Button
|
||||
type="primary"
|
||||
:loading="submitLoading"
|
||||
@click="submitSpecValuesForm"
|
||||
>提交</Button
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="saveSpec"
|
||||
>提交
|
||||
</Button
|
||||
>
|
||||
</div>
|
||||
</Modal>
|
||||
|
@ -118,10 +98,9 @@ import {
|
|||
getSpecListData,
|
||||
insertSpec,
|
||||
updateSpec,
|
||||
delSpec,
|
||||
getSpecValuesListData,
|
||||
saveSpecValues,
|
||||
delSpec
|
||||
} from "@/api/goods";
|
||||
|
||||
export default {
|
||||
name: "spec",
|
||||
components: {},
|
||||
|
@ -131,7 +110,6 @@ export default {
|
|||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
dialogSpecValuesVisible: false, // 添加或编辑规格值
|
||||
specTitle: "", // 添加或编辑规格值
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
|
@ -145,9 +123,8 @@ export default {
|
|||
specName: "",
|
||||
specValue: "",
|
||||
},
|
||||
specForm: {},
|
||||
/** 编辑规格值 */
|
||||
specValues: [],
|
||||
specValue: [],
|
||||
// 表单验证规则
|
||||
formValidate: {},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
|
@ -179,24 +156,7 @@ export default {
|
|||
width: 250,
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "primary",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.editSpec(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"编辑规格值"
|
||||
),
|
||||
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
|
@ -239,23 +199,28 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
//初始化,获取数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
//修改分页
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
//修改页面大小
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
//搜索参数
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
//重置搜索参数
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
|
@ -263,6 +228,7 @@ export default {
|
|||
// 重新加载数据
|
||||
this.getDataList();
|
||||
},
|
||||
//更改排序
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
|
@ -271,36 +237,27 @@ export default {
|
|||
}
|
||||
this.getDataList();
|
||||
},
|
||||
//清除已选择
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
//修改已选择
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
//获取数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getSpecListData(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
this.data = res.records;
|
||||
this.total = res.total;
|
||||
});
|
||||
this.loading = false;
|
||||
},
|
||||
submitSpecValuesForm() {
|
||||
saveSpecValues(this.specForm.specId, this.specForm).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("规格值保存成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
this.dialogSpecValuesVisible = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
//新增规格
|
||||
saveSpec() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
|
@ -318,7 +275,7 @@ export default {
|
|||
});
|
||||
} else {
|
||||
// 编辑
|
||||
updateSpec(this.form).then((res) => {
|
||||
updateSpec(this.form.id, this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
|
@ -330,6 +287,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
//弹出添加框
|
||||
add() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加";
|
||||
|
@ -337,31 +295,31 @@ export default {
|
|||
delete this.form.id;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
//弹出编辑框
|
||||
edit(v) {
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "编辑";
|
||||
this.$refs.form.resetFields();
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] === null) {
|
||||
v[attr] = "";
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
this.form = data;
|
||||
let localVal = v.specValue;
|
||||
|
||||
this.form.specName = v.specName;
|
||||
this.form.id = v.id;
|
||||
this.form.specValue = v.specValue;
|
||||
|
||||
if (localVal && localVal.indexOf("," > 0)) {
|
||||
this.form.specValue = localVal.split(",")
|
||||
this.specValue = this.form.specValue
|
||||
this.$set(this, 'specValue', this.form.specValue)
|
||||
} else {
|
||||
this.specValue = [];
|
||||
}
|
||||
this.modalVisible = true;
|
||||
},
|
||||
editSpec(v) {
|
||||
getSpecValuesListData(v.id).then((res) => {
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "编辑";
|
||||
this.specValues = res.result;
|
||||
this.specForm.specValue = res.result.map(item => item.specValue)
|
||||
this.specForm.specId = v.id;
|
||||
this.dialogSpecValuesVisible = true;
|
||||
});
|
||||
},
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
|
|
|
@ -98,14 +98,14 @@ export default {
|
|||
}
|
||||
},
|
||||
created () {
|
||||
this.getImg();
|
||||
// this.getImg();
|
||||
},
|
||||
watch: {
|
||||
verifyType: {
|
||||
immediate: true,
|
||||
handler: function (v) {
|
||||
this.type = v;
|
||||
this.refresh();
|
||||
// this.refresh();
|
||||
}
|
||||
},
|
||||
show (v) {
|
||||
|
|
|
@ -215,13 +215,13 @@ export const getSkuPage = params => {
|
|||
};
|
||||
|
||||
// 获取商品规格值列表
|
||||
export const getSpecValuesListSellerData = (id, params) => {
|
||||
return getRequest(`/goods/spec-values/values/${id}`, params);
|
||||
};
|
||||
// export const getSpecValuesListSellerData = (id, params) => {
|
||||
// return getRequest(`/goods/spec-values/values/${id}`, params);
|
||||
// };
|
||||
// 添加商品规格值
|
||||
export const saveSpecValuesSeller = (id, params) => {
|
||||
return postRequest(`/goods/spec-values/save/${id}`, params);
|
||||
};
|
||||
// export const saveSpecValuesSeller = (id, params) => {
|
||||
// return postRequest(`/goods/spec-values/save/${id}`, params);
|
||||
// };
|
||||
|
||||
// 获取商品规格分页列表
|
||||
export const getSpecListSellerData = params => {
|
||||
|
@ -312,8 +312,8 @@ export const getCategoryParamsListDataSeller = (id, params) => {
|
|||
};
|
||||
|
||||
//保存获取关联规格
|
||||
export const getGoodsSpecInfoSeller = (category_id, params) => {
|
||||
return getRequest(`/goods/spec/${category_id}`, params);
|
||||
export const getGoodsSpecInfoSeller = (category_id) => {
|
||||
return getRequest(`/goods/spec/${category_id}`);
|
||||
};
|
||||
|
||||
//批量设置运费模板
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
<!-- 选择商品类型 -->
|
||||
<Modal v-model="selectGoodsType" width="550" :closable="false">
|
||||
<div class="goods-type-list" v-if="!showGoodsTemplates">
|
||||
<div class="goods-type-item" :class="{'active-goods-type':item.check}" @click="handleClickGoodsType(item)" v-for="(item,index) in goodsTypeWay" :key="index">
|
||||
<div class="goods-type-item" :class="{'active-goods-type':item.check}" @click="handleClickGoodsType(item)"
|
||||
v-for="(item,index) in goodsTypeWay" :key="index">
|
||||
<img :src="item.img"/>
|
||||
<div>
|
||||
<h2>{{ item.title }}</h2>
|
||||
|
@ -13,7 +14,8 @@
|
|||
</div>
|
||||
<div v-else class="goods-type-list">
|
||||
<h2 @click="showGoodsTemplates = !showGoodsTemplates">返回</h2>
|
||||
<div class="goods-type-item template-item" @click="handleClickGoodsTemplate(item)" v-for="(item,index) in goodsTemplates" :key="index">
|
||||
<div class="goods-type-item template-item" @click="handleClickGoodsTemplate(item)"
|
||||
v-for="(item,index) in goodsTemplates" :key="index">
|
||||
<img :src="item.thumbnail"/>
|
||||
<div>
|
||||
<h2>{{ item.goodsName }}</h2>
|
||||
|
@ -25,8 +27,6 @@
|
|||
|
||||
</Modal>
|
||||
|
||||
|
||||
|
||||
<div class="step-list">
|
||||
<steps :current="activestep" simple style="height:60px;margin-top: 10px" process-status="process">
|
||||
<div class="step-view">
|
||||
|
@ -43,19 +43,22 @@
|
|||
<div class="content-goods-publish" v-show="activestep === 0">
|
||||
<div class="goods-category">
|
||||
<ul v-if="categoryListLevel1 && categoryListLevel1.length > 0">
|
||||
<li v-for="(item, index) in categoryListLevel1" :class="{ activeClass: index == activeCategoryIndex1 }" @click="handleSelectCategory(item, index, 1)" :key="index">
|
||||
<li v-for="(item, index) in categoryListLevel1" :class="{ activeClass: index == activeCategoryIndex1 }"
|
||||
@click="handleSelectCategory(item, index, 1)" :key="index">
|
||||
<span>{{ item.name }}</span>
|
||||
<span>></span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul v-if="categoryListLevel2 && categoryListLevel2.length > 0">
|
||||
<li v-for="(item, index) in categoryListLevel2" :class="{ activeClass: index == activeCategoryIndex2 }" @click="handleSelectCategory(item, index, 2)" :key="index">
|
||||
<li v-for="(item, index) in categoryListLevel2" :class="{ activeClass: index == activeCategoryIndex2 }"
|
||||
@click="handleSelectCategory(item, index, 2)" :key="index">
|
||||
<span>{{ item.name }}</span>
|
||||
<span>></span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul v-if="categoryListLevel3 && categoryListLevel3.length > 0">
|
||||
<li v-for="(item, index) in categoryListLevel3" :class="{ activeClass: index == activeCategoryIndex3 }" @click="handleSelectCategory(item, index, 3)" :key="index">
|
||||
<li v-for="(item, index) in categoryListLevel3" :class="{ activeClass: index == activeCategoryIndex3 }"
|
||||
@click="handleSelectCategory(item, index, 3)" :key="index">
|
||||
<span>{{ item.name }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -67,8 +70,7 @@
|
|||
<span v-show="activeCategoryName3">> {{ activeCategoryName3 }}</span>
|
||||
</p>
|
||||
<template v-if="!$route.query.id && draftId">
|
||||
<Divider>已选商品模版:{{goodsTemplates.find(item=>{return item.id == draftId}).goodsName}}</Divider>
|
||||
|
||||
<Divider>已选商品模版:{{checkedTemplate()}}</Divider>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
|
@ -105,7 +107,8 @@
|
|||
</Select>
|
||||
</FormItem>
|
||||
<FormItem class="form-item-view-el" label="销售模式" prop="salesModel">
|
||||
<RadioGroup type="button" v-if="baseInfoForm.goodsType!='VIRTUAL_GOODS'" button-style="solid" v-model="baseInfoForm.salesModel">
|
||||
<RadioGroup type="button" v-if="baseInfoForm.goodsType!='VIRTUAL_GOODS'" button-style="solid"
|
||||
v-model="baseInfoForm.salesModel">
|
||||
<Radio title="零售型" label="RETAIL">
|
||||
<span>零售型</span>
|
||||
</Radio>
|
||||
|
@ -145,17 +148,9 @@
|
|||
</div>
|
||||
<div>
|
||||
<Icon type="ios-arrow-dropleft" @click.native="
|
||||
handleGoodsPicRemoteUp(
|
||||
baseInfoForm.goodsGalleryFiles,
|
||||
__index
|
||||
)
|
||||
" />
|
||||
handleGoodsPicRemoteUp(baseInfoForm.goodsGalleryFiles,__index)"/>
|
||||
<Icon type="ios-arrow-dropright" @click.native="
|
||||
handleGoodsPicRemoteDown(
|
||||
baseInfoForm.goodsGalleryFiles,
|
||||
__index
|
||||
)
|
||||
" />
|
||||
handleGoodsPicRemoteDown(baseInfoForm.goodsGalleryFiles,__index)"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -163,8 +158,10 @@
|
|||
<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
|
||||
</template>
|
||||
</div>
|
||||
<Upload ref="upload" :show-upload-list="false" :default-file-list="baseInfoForm.goodsGalleryFiles" :on-success="handleSuccessGoodsPicture" :format="['jpg', 'jpeg', 'png']"
|
||||
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize" :before-upload="handleBeforeUploadGoodsPicture" multiple type="drag" :action="uploadFileUrl"
|
||||
<Upload ref="upload" :show-upload-list="false" :default-file-list="baseInfoForm.goodsGalleryFiles"
|
||||
:on-success="handleSuccessGoodsPicture" :format="['jpg', 'jpeg', 'png']"
|
||||
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize"
|
||||
:before-upload="handleBeforeUploadGoodsPicture" multiple type="drag" :action="uploadFileUrl"
|
||||
:headers="accessToken" style="display: inline-block;margin-left:10px;">
|
||||
<div style="width: 80px; height: 80px; line-height: 80px">
|
||||
<Icon type="ios-camera" size="20"></Icon>
|
||||
|
@ -185,29 +182,39 @@
|
|||
<div class="sku-item" v-for="(item, $index) in skuInfo" :key="$index">
|
||||
<Card :bordered="true">
|
||||
<FormItem label="规格名:" class="sku-item-content-name">
|
||||
<AutoComplete style="width: 150px" v-model="item.name" :maxlength="30" :data="specListSelected" placeholder="请输入规格项名称" />
|
||||
<AutoComplete style="width: 150px" v-model="item.name" :maxlength="30"
|
||||
placeholder="请输入规格项名称"
|
||||
:filter-method="filterMethod" :data="skuData"
|
||||
@on-change="editSkuItem">
|
||||
</AutoComplete>
|
||||
<Button type="error" style="margin-left: 10px" @click="handleCloseSkuItem($index)">删除
|
||||
</Button>
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="规格值:" prop="sku">
|
||||
<!--规格值文本列表-->
|
||||
<div v-for="(val, index) in item.spec_values" :key="index" style="padding: 0px 20px 10px 0px; float: left">
|
||||
<div v-for="(val, index) in item.spec_values" :key="index"
|
||||
style="padding: 0px 20px 10px 0px; float: left">
|
||||
<div>
|
||||
<AutoComplete style="width: 150px; float: left" v-model="val.value" :maxlength="30" :data="skuValue" placeholder="请输入规格值名称"></AutoComplete>
|
||||
<Button type="error" style="float: left; margin-left: 10px" @click="handleCloseSkuValue($index, index)">删除</Button>
|
||||
<AutoComplete style="width: 150px; float: left" v-model="val.value"
|
||||
:maxlength="30" placeholder="请输入规格值名称"
|
||||
:filter-method="filterMethod" :data="skuVal"
|
||||
@on-focus="changeSkuVals(item.name)"
|
||||
@on-change="skuValueChange(val.value, $index, item)">
|
||||
</AutoComplete>
|
||||
<Button type="error" style="margin-left: 10px" @click="handleCloseSkuValue(item, index)">
|
||||
删除
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="float: left">
|
||||
<Button type="primary" @click="addSpec($index, item)">添加规格值
|
||||
</Button>
|
||||
<Button type="primary" @click="addSpec($index, item)">添加规格值</Button>
|
||||
</div>
|
||||
</FormItem>
|
||||
</Card>
|
||||
</div>
|
||||
</Form>
|
||||
<Button class="add-sku-btn" type="primary" size="mini" @click="addSkuItem">添加规格项目
|
||||
</Button>
|
||||
<Button class="add-sku-btn" type="primary" size="mini" @click="addSkuItem">添加规格项目</Button>
|
||||
</div>
|
||||
</Panel>
|
||||
<Panel name="2">
|
||||
|
@ -229,7 +236,8 @@
|
|||
</template>
|
||||
|
||||
<template slot-scope="{ row }" slot="quantity">
|
||||
<Input v-model="row.quantity" placeholder="请输入库存" @on-change="updateSkuTable(row, 'quantity')" />
|
||||
<Input v-model="row.quantity" placeholder="请输入库存"
|
||||
@on-change="updateSkuTable(row, 'quantity')"/>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ row }" slot="cost">
|
||||
|
@ -241,7 +249,8 @@
|
|||
</template>
|
||||
<template slot-scope="{ row }" slot="images">
|
||||
<Button @click="editSkuPicture(row)">编辑图片</Button>
|
||||
<Modal v-model="showSkuPicture" :styles="{ top: '30px' }" class-name="sku-preview-modal" title="编辑图片" ok-text="结束编辑" @on-ok="updateSkuPicture()" cancel-text="取消">
|
||||
<Modal v-model="showSkuPicture" :styles="{ top: '30px' }" class-name="sku-preview-modal"
|
||||
title="编辑图片" ok-text="结束编辑" @on-ok="updateSkuPicture()" cancel-text="取消">
|
||||
<div class="preview-picture">
|
||||
<img v-if="previewPicture !== ''" :src="previewPicture"/>
|
||||
</div>
|
||||
|
@ -258,8 +267,10 @@
|
|||
<Progress v-if="img.showProgress" :percent="img.percentage" hide-info></Progress>
|
||||
</template>
|
||||
</div>
|
||||
<Upload ref="uploadSku" :show-upload-list="false" :default-file-list="row.images" :on-success="handleSuccess" :format="['jpg', 'jpeg', 'png']"
|
||||
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize" :before-upload="handleBeforeUpload" multiple type="drag" :action="uploadFileUrl"
|
||||
<Upload ref="uploadSku" :show-upload-list="false" :default-file-list="row.images"
|
||||
:on-success="handleSuccess" :format="['jpg', 'jpeg', 'png']"
|
||||
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize"
|
||||
:before-upload="handleBeforeUpload" multiple type="drag" :action="uploadFileUrl"
|
||||
:headers="accessToken" style="display: inline-block; width: 58px">
|
||||
<div>
|
||||
<Icon type="ios-camera" size="55"></Icon>
|
||||
|
@ -348,21 +359,26 @@
|
|||
</FormItem>
|
||||
</div>
|
||||
<div class="form-item-view-bottom">
|
||||
<Collapse v-model="show" v-for="paramsgroup in goodsParams" :title="paramsgroup.groupName" style="text-align: left" :key="paramsgroup.groupName">
|
||||
<Panel key="1" name="1">
|
||||
{{ paramsgroup.groupName }}
|
||||
<Collapse v-model="params_panel" v-for="(paramsGroup,groupIndex) in goodsParams"
|
||||
:title="paramsGroup.groupName"
|
||||
class="mb_10"
|
||||
style="text-align: left" :key="paramsGroup.groupName">
|
||||
<Panel :name="paramsGroup.groupName">
|
||||
{{paramsGroup.groupName}}
|
||||
<p slot="content">
|
||||
<FormItem v-for="(
|
||||
goodsParamsList, index
|
||||
) in baseInfoForm.goodsParamsList" :key="index" :label="`${goodsParamsList.paramName}:`">
|
||||
<Select v-model="goodsParamsList.paramValue" placeholder="请选择" style="width: 200px" clearable>
|
||||
<Option v-for="option in goodsParamsList.optionList" :key="option.paramValue" :label="option" :value="option"></Option>
|
||||
<FormItem v-for="( params, paramsIndex) in paramsGroup.params" :key="paramsIndex"
|
||||
:label="`${params.paramName}:`">
|
||||
<Select v-model="params.paramValue" placeholder="请选择" style="width: 200px" clearable
|
||||
@on-change="selectParams(paramsGroup,groupIndex,params,paramsIndex,params.paramValue)">
|
||||
<Option v-for="option in params.options.split(',')" :label="option"
|
||||
:value="option"></Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
</p>
|
||||
</Panel>
|
||||
</Collapse>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</Form>
|
||||
|
@ -401,11 +417,9 @@
|
|||
<Button type="primary" @click="save" :loading="submitLoading" v-if="activestep === 1">
|
||||
{{ this.goodsId ? "保存" : "保存商品" }}
|
||||
</Button>
|
||||
<Button type="primary" @click="saveToDraft('TEMPLATE')" v-if="activestep === 1">
|
||||
<Button type="primary" @click="saveToDraft" v-if="activestep === 1">
|
||||
保存为模版
|
||||
</Button>
|
||||
<!-- <Button type="primary" @click="saveToDraft('DRAFT')" v-if="activestep === 1 && !isOperationGoods">保存至草稿箱
|
||||
</Button> -->
|
||||
</ButtonGroup>
|
||||
|
||||
</div>
|
||||
|
@ -523,7 +537,6 @@ export default {
|
|||
check: false,
|
||||
},
|
||||
],
|
||||
show: "1",
|
||||
//提交状态
|
||||
submitLoading: false,
|
||||
//上传图片路径
|
||||
|
@ -542,7 +555,6 @@ export default {
|
|||
selectedSku: {},
|
||||
//选择店铺分类
|
||||
strict: true,
|
||||
goodsParamsList: [],
|
||||
//模版 / 草稿 id
|
||||
draftId: undefined,
|
||||
/** 当前激活步骤*/
|
||||
|
@ -577,32 +589,12 @@ export default {
|
|||
categoryListLevel3: [],
|
||||
|
||||
/** 请求的商品参数组列表 */
|
||||
goodsParams: [
|
||||
{
|
||||
groupId: "",
|
||||
groupName: "",
|
||||
params: [
|
||||
{
|
||||
paramId: 0,
|
||||
paramName: "",
|
||||
paramType: 1,
|
||||
paramValue: "",
|
||||
required: 0,
|
||||
optionList: [
|
||||
{ value: 1, label: "" },
|
||||
{ value: 2, label: "" },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
goodsParams: [],
|
||||
/** 当前状态/模式 默认发布商品0 编辑商品1 编辑草稿箱商品2 */
|
||||
currentStatus: 0,
|
||||
|
||||
baseInfoForm: {
|
||||
salesModel: "RETAIL",
|
||||
/** 商品参数列表 */
|
||||
goodsParamsList: [],
|
||||
/** 商品重量 */
|
||||
weight: "",
|
||||
/** 商品相册列表 */
|
||||
|
@ -616,8 +608,9 @@ export default {
|
|||
brandId: 0,
|
||||
/** 计量单位 **/
|
||||
goodsUnit: "",
|
||||
/** 商品类型 **/
|
||||
goodsType: "",
|
||||
/** 路径 **/
|
||||
/** 分类路径 **/
|
||||
categoryPath: "",
|
||||
/** 商品卖点 **/
|
||||
sellingPoint: "",
|
||||
|
@ -629,6 +622,8 @@ export default {
|
|||
regeneratorSkuFlag: false,
|
||||
/** 运费模板id **/
|
||||
templateId: 0,
|
||||
/** 参数组*/
|
||||
goodsParamsDTOList: [],
|
||||
},
|
||||
/** 表单数据*/
|
||||
skuForm: {},
|
||||
|
@ -637,54 +632,28 @@ export default {
|
|||
/** 表格数据 */
|
||||
skuTableData: [],
|
||||
|
||||
/** 请求数据*/
|
||||
/** 默认的规格参数 */
|
||||
skuData: [],
|
||||
|
||||
/** 当前可选择的 规格名称*/
|
||||
skuKey: [],
|
||||
|
||||
/** 当前可选择的 规格值*/
|
||||
skuValue: [],
|
||||
|
||||
/** 默认的规格值 */
|
||||
skuVals: [],
|
||||
// 某一规格名下的规格值
|
||||
skuVal: [],
|
||||
open_panel: [1, 2],
|
||||
|
||||
/** 要提交的规格数据*/
|
||||
skuInfo: [],
|
||||
|
||||
/** 当前选择的规格项*/
|
||||
specSelected: "",
|
||||
|
||||
/** 当前选择的规格值*/
|
||||
specValSelected: "",
|
||||
/** 当前规格项下的规格值列表*/
|
||||
specListSelected: [],
|
||||
|
||||
/** 当前规格项下的规格值列表*/
|
||||
specList: [],
|
||||
|
||||
/** 当前规格项索引 */
|
||||
activeSkuItemIndex: 0,
|
||||
|
||||
/** 当前规格项 */
|
||||
activeSkuItem: {},
|
||||
|
||||
/** 规格图片 */
|
||||
images: [],
|
||||
/** 当前规格值索引 */
|
||||
activeSkuValIndex: 0,
|
||||
|
||||
/** 当前规格值 */
|
||||
activeSkuVal: {},
|
||||
|
||||
/** 当前百分比 */
|
||||
currentPercent: 0,
|
||||
|
||||
/** 运费模板 **/
|
||||
logisticsTemplate: [],
|
||||
|
||||
/** 固定列校验提示内容 */
|
||||
validatatxt: "请输入0~99999999之间的数字值",
|
||||
|
||||
//参数panel展示
|
||||
params_panel: [],
|
||||
/** 存储未通过校验的单元格位置 */
|
||||
validateError: [],
|
||||
baseInfoFormRule: {
|
||||
|
@ -738,6 +707,7 @@ export default {
|
|||
"specId",
|
||||
"specValueId",
|
||||
],
|
||||
skuValVisible: true,
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -751,14 +721,16 @@ export default {
|
|||
this.logisticsTemplate = res.result;
|
||||
}
|
||||
})
|
||||
|
||||
// 编辑商品
|
||||
if (this.$route.query.id) {
|
||||
this.activestep = 1;
|
||||
this.goodsId = this.$route.query.id;
|
||||
this.GET_GoodData();
|
||||
this.selectGoodsType = false;
|
||||
|
||||
}
|
||||
//编辑模版
|
||||
// 编辑模板
|
||||
else if (this.$route.query.draftId) {
|
||||
this.draftId = this.$route.query.draftId;
|
||||
this.activestep = 1;
|
||||
|
@ -777,7 +749,6 @@ export default {
|
|||
defaultBaseInfo() {
|
||||
this.baseInfoForm = {
|
||||
salesModel: "RETAIL",
|
||||
goodsParamsList: [],
|
||||
weight: "",
|
||||
goodsGalleryFiles: [],
|
||||
release: "true",
|
||||
|
@ -793,13 +764,21 @@ export default {
|
|||
updateSku: true,
|
||||
regeneratorSkuFlag: false,
|
||||
templateId: 0,
|
||||
goodsParamsDTOList: [],
|
||||
};
|
||||
this.activestep = 0;
|
||||
this.isPublish = true;
|
||||
this.GET_GoodsTemplate();
|
||||
this.GET_NextLevelCategory();
|
||||
},
|
||||
|
||||
// 获取已选模板
|
||||
checkedTemplate () {
|
||||
if(this.goodsTemplates.length) {
|
||||
return this.goodsTemplates.find(item=>{return item.id == this.draftId}).goodsName
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
},
|
||||
// 选择商品模板
|
||||
handleClickGoodsTemplate(val) {
|
||||
this.draftId = val.id;
|
||||
|
@ -849,6 +828,47 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 选择参数
|
||||
* @paramsGroup 参数分组
|
||||
* @groupIndex 参数分组下标
|
||||
* @params 参数选项
|
||||
* @paramIndex 参数下标值
|
||||
* @value 参数选项值
|
||||
*/
|
||||
selectParams(paramsGroup, groupIndex, params, paramsIndex, value) {
|
||||
console.log(params.id);
|
||||
if (!this.baseInfoForm.goodsParamsDTOList[groupIndex]) {
|
||||
this.baseInfoForm.goodsParamsDTOList[groupIndex] = {
|
||||
groupId:'',
|
||||
groupName:'',
|
||||
goodsParamsItemDTOList:[]
|
||||
}
|
||||
}
|
||||
//赋予分组id
|
||||
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupId = paramsGroup.groupId
|
||||
//赋予分组名称
|
||||
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupName = paramsGroup.groupName
|
||||
//参数详细为空,则赋予
|
||||
if (!this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex]) {
|
||||
this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex]={
|
||||
paramName: '',
|
||||
paramValue: '',
|
||||
isIndex: '',
|
||||
required: '',
|
||||
paramId: ''
|
||||
}
|
||||
}
|
||||
this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex]={
|
||||
paramName: params.paramName,
|
||||
paramValue: value,
|
||||
isIndex: params.isIndex,
|
||||
required: params.required,
|
||||
paramId: params.id
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 编辑sku图片
|
||||
editSkuPicture(row) {
|
||||
console.log(row);
|
||||
|
@ -937,7 +957,7 @@ export default {
|
|||
}
|
||||
return !check;
|
||||
},
|
||||
|
||||
// 跳转商品列表
|
||||
gotoGoodsList() {
|
||||
this.$router.push({name: "goods"});
|
||||
},
|
||||
|
@ -952,6 +972,7 @@ export default {
|
|||
}
|
||||
);
|
||||
},
|
||||
// 获取商品单位
|
||||
GET_GoodsUnit() {
|
||||
API_GOODS.getGoodsUnitList().then((res) => {
|
||||
if (res.success) {
|
||||
|
@ -959,6 +980,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 获取当前店铺分类
|
||||
GET_ShopGoodsLabel() {
|
||||
API_GOODS.getShopGoodsLabelListSeller().then((res) => {
|
||||
if (res.success) {
|
||||
|
@ -981,6 +1003,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 编辑时获取商品信息
|
||||
async GET_GoodData() {
|
||||
let response = {};
|
||||
if (this.draftId) {
|
||||
|
@ -1006,6 +1029,8 @@ export default {
|
|||
this.activeCategoryName3 = response.result.categoryName[2];
|
||||
|
||||
this.baseInfoForm.categoryId = response.result.categoryPath.split(",");
|
||||
|
||||
|
||||
if (
|
||||
response.result.goodsGalleryList &&
|
||||
response.result.goodsGalleryList.length > 0
|
||||
|
@ -1019,6 +1044,8 @@ export default {
|
|||
|
||||
this.categoryId = this.baseInfoForm.categoryId[2];
|
||||
|
||||
this.Get_SkuInfoByCategory(this.categoryId)
|
||||
|
||||
this.renderGoodsDetailSku(response.result.skuList);
|
||||
|
||||
/** 查询品牌列表 */
|
||||
|
@ -1029,7 +1056,7 @@ export default {
|
|||
this.GET_ShopGoodsLabel();
|
||||
this.GET_GoodsUnit();
|
||||
},
|
||||
|
||||
// 渲染sku数据
|
||||
renderGoodsDetailSku(skuList) {
|
||||
let skus = [];
|
||||
let skusInfo = [];
|
||||
|
@ -1091,47 +1118,46 @@ export default {
|
|||
this.renderTableData();
|
||||
this.skuTableData = skus;
|
||||
},
|
||||
/** 查询商品参数 */
|
||||
|
||||
/** 根据当前分类id查询商品应包含的参数 */
|
||||
GET_GoodsParams() {
|
||||
API_GOODS.getCategoryParamsListDataSeller(this.categoryId).then(
|
||||
(response) => {
|
||||
this.goodsParams = response;
|
||||
this.collapseVal = this.goodsParams.map((key) => {
|
||||
if (key.groupId) {
|
||||
return key.groupId;
|
||||
}
|
||||
});
|
||||
if (!response || response.length <= 0) {
|
||||
return;
|
||||
}
|
||||
this.goodsParams.forEach((key) => {
|
||||
if (key && key.params) {
|
||||
key.params.forEach((elem) => {
|
||||
if (
|
||||
!this.baseInfoForm.goodsParamsList.find(
|
||||
(ij) => ij.paramName === elem.paramName
|
||||
this.goodsParams = response;
|
||||
|
||||
//展开选项卡
|
||||
this.goodsParams.forEach(item => {
|
||||
this.params_panel.push(item.groupName)
|
||||
}
|
||||
)
|
||||
) {
|
||||
elem.optionList = elem.options.split(",");
|
||||
this.baseInfoForm.goodsParamsList.push(elem);
|
||||
if (this.baseInfoForm.goodsParamsDTOList) {
|
||||
// 已选值集合
|
||||
const paramsArr = []
|
||||
this.baseInfoForm.goodsParamsDTOList.forEach(group =>{
|
||||
group.goodsParamsItemDTOList.forEach(param => {
|
||||
param.groupId = group.groupId
|
||||
paramsArr.push(param)
|
||||
console.log(param);
|
||||
})
|
||||
})
|
||||
// 循环参数分组
|
||||
this.goodsParams.forEach((parmsGroup) => {
|
||||
parmsGroup.params.forEach(param => {
|
||||
|
||||
paramsArr.forEach(arr=>{
|
||||
if(param.paramName == arr.paramName){
|
||||
param.paramValue = arr.paramValue
|
||||
}
|
||||
if (this.$route.query.id || this.draftId) {
|
||||
this.baseInfoForm.goodsParamsList =
|
||||
this.baseInfoForm.goodsParamsList.map((i) => {
|
||||
if (i.paramId === elem.id || i.id === elem.id) {
|
||||
elem.optionList = elem.options.split(",");
|
||||
i = {
|
||||
...i,
|
||||
...elem,
|
||||
};
|
||||
}
|
||||
return i;
|
||||
})
|
||||
})
|
||||
});
|
||||
return;
|
||||
console.log(this.goodsParams);
|
||||
} else {
|
||||
this.baseInfoForm.goodsParamsDTOList = []
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
|
@ -1151,16 +1177,31 @@ export default {
|
|||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
async GET_SkuSpecVal(id) {
|
||||
let specValResult = await API_GOODS.getSpecValuesListSellerData(id, {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
specVal: this.specValSelected,
|
||||
});
|
||||
if (specValResult.success && specValResult.result.records.length > 0) {
|
||||
this.skuValue = specValResult.result.records.map((i) => i.specValue);
|
||||
} else {
|
||||
this.skuValue = [];
|
||||
// 编辑规格名
|
||||
editSkuItem() {
|
||||
this.renderTableData();
|
||||
},
|
||||
// 编辑规格值
|
||||
async skuValueChange(val, index, item) {
|
||||
/** 更新skuInfo数据 */
|
||||
// let _arr = cloneObj(item);
|
||||
// this.$set(item, "name", _arr.name);
|
||||
// this.$set(this.skuInfo, index, _arr);
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
// 获取焦点时,取得规格名对应的规格值
|
||||
changeSkuVals(name) {
|
||||
if (name) {
|
||||
this.skuData.forEach((e, index) => {
|
||||
if (e === name) {
|
||||
if (this.skuVal.length != this.skuVals[index].length) {
|
||||
this.skuVal = this.skuVals[index]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 移除当前规格项 进行数据变化*/
|
||||
|
@ -1171,6 +1212,7 @@ export default {
|
|||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
// 添加规格值的验证
|
||||
validateEmpty(params) {
|
||||
let flag = true;
|
||||
params.forEach((item) => {
|
||||
|
@ -1187,16 +1229,15 @@ export default {
|
|||
},
|
||||
/** 添加当前规格项的规格值*/
|
||||
addSpec($index, item) {
|
||||
this.activeSkuItemIndex = $index;
|
||||
|
||||
if (this.validateEmpty(this.skuInfo[$index].spec_values)) {
|
||||
if (this.skuInfo[$index].spec_values.length >= 10) {
|
||||
if (this.validateEmpty(item.spec_values)) {
|
||||
if (item.spec_values.length >= 10) {
|
||||
this.$Message.error("规格值不能大于10个!");
|
||||
return;
|
||||
}
|
||||
this.$set(
|
||||
this.skuInfo[$index].spec_values,
|
||||
this.skuInfo[$index].spec_values.length,
|
||||
item.spec_values,
|
||||
item.spec_values.length,
|
||||
{
|
||||
name: item.name,
|
||||
}
|
||||
|
@ -1208,21 +1249,10 @@ export default {
|
|||
this.renderTableData();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 根据规格项名称,搜索对应的规格对象(如果是服务器设置过的话)
|
||||
*/
|
||||
findSpec(name) {
|
||||
let spec = { name: name };
|
||||
this.skuData.forEach((item) => {
|
||||
if (item.name === name) {
|
||||
spec = item;
|
||||
}
|
||||
});
|
||||
return spec;
|
||||
},
|
||||
|
||||
/** 移除当前规格值 */
|
||||
handleCloseSkuValue($index, index) {
|
||||
this.skuInfo[$index].spec_values.splice(index, 1);
|
||||
handleCloseSkuValue(item, index) {
|
||||
item.spec_values.splice(index, 1);
|
||||
|
||||
this.baseInfoForm.regeneratorSkuFlag = true;
|
||||
/**
|
||||
|
@ -1230,37 +1260,24 @@ export default {
|
|||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
/** 选择规格值时触发 */
|
||||
async skuValueChange(val, index, item) {
|
||||
this.specValSelected = val;
|
||||
await this.GET_SkuSpecVal(item.spec_id);
|
||||
/** 更新skuInfo数据 */
|
||||
let _arr = cloneObj(this.skuInfo[this.activeSkuItemIndex]);
|
||||
this.$set(this.skuInfo[this.activeSkuItemIndex], "name", _arr.name);
|
||||
this.$set(this.skuInfo, this.activeSkuItemIndex, _arr);
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 渲染table所需要的column 和 data
|
||||
*/
|
||||
renderTableData() {
|
||||
this.skuTableColumn = [];
|
||||
this.skuTableData = [];
|
||||
|
||||
let pushData = [];
|
||||
//渲染头部
|
||||
this.skuInfo.forEach((sku) => {
|
||||
//列名称
|
||||
let columnName = sku.name;
|
||||
this.skuTableColumn.push({
|
||||
pushData.push({
|
||||
title: columnName,
|
||||
key: columnName,
|
||||
});
|
||||
});
|
||||
let pushData = [];
|
||||
pushData.push(...this.skuTableColumn);
|
||||
|
||||
this.baseInfoForm.goodsType != "VIRTUAL_GOODS"
|
||||
? pushData.push({
|
||||
title: "重量",
|
||||
|
@ -1291,54 +1308,29 @@ export default {
|
|||
);
|
||||
|
||||
this.skuTableColumn = pushData;
|
||||
|
||||
console.log(this.skuTableColumn);
|
||||
//克隆所有渲染的数据
|
||||
let cloneTemp = cloneObj(this.skuInfo);
|
||||
|
||||
//数据清空一次
|
||||
this.skuTableData = [];
|
||||
//判定 是否存在规格分组
|
||||
if (cloneTemp[0]) {
|
||||
//存放最终结果
|
||||
let result = [];
|
||||
|
||||
//循环选中的 sku 数据
|
||||
cloneTemp[0].spec_values.forEach((specItem) => {
|
||||
result.push({
|
||||
[specItem.name]: specItem.value,
|
||||
[cloneTemp[0].name]: specItem.value,
|
||||
images: this.baseInfoForm.goodsGalleryFiles || [],
|
||||
});
|
||||
});
|
||||
cloneTemp.splice(0, 1);
|
||||
result = this.specIterator(result, cloneTemp);
|
||||
result = this.defaultParams(result);
|
||||
this.skuTableData = result;
|
||||
console.log(this.skuTableData);
|
||||
}
|
||||
},
|
||||
/** 自动完成表单所需方法*/
|
||||
filterMethod(value, option) {
|
||||
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
|
||||
},
|
||||
/** 根据分类id获取系统设置规格信息*/
|
||||
Get_SkuInfoByCategory() {
|
||||
if (this.baseInfoForm.categoryId) {
|
||||
API_GOODS.getGoodsSpecInfoSeller(this.baseInfoForm.categoryId, {}).then(
|
||||
(response) => {
|
||||
this.skuData = response;
|
||||
if (this.skuData.length > 0) {
|
||||
this.skuData.forEach((spec) => {
|
||||
this.skuKey.push(spec.name);
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 添加固有属性
|
||||
*/
|
||||
defaultParams(tableData) {
|
||||
return tableData;
|
||||
},
|
||||
/**
|
||||
* 迭代属性,形成表格
|
||||
* result 渲染的数据
|
||||
|
@ -1349,10 +1341,9 @@ export default {
|
|||
if (cloneTemp.length > 0) {
|
||||
let table = [];
|
||||
result.forEach((resItem) => {
|
||||
let tableItem = [];
|
||||
cloneTemp[0].spec_values.forEach((valItem) => {
|
||||
let obj = cloneObj(resItem);
|
||||
obj[valItem.name] = valItem.value;
|
||||
obj[cloneTemp[0].name] = valItem.value;
|
||||
table.push(obj);
|
||||
});
|
||||
});
|
||||
|
@ -1362,12 +1353,46 @@ export default {
|
|||
});
|
||||
//清除当前循环的分组
|
||||
cloneTemp.splice(0, 1);
|
||||
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
return this.specIterator(result, cloneTemp);
|
||||
},
|
||||
handleSpan({ row, column, rowIndex, columnIndex }) {},
|
||||
/** 根据分类id获取系统设置规格信息*/
|
||||
Get_SkuInfoByCategory(categoryId) {
|
||||
if (categoryId) {
|
||||
API_GOODS.getGoodsSpecInfoSeller(categoryId).then(res => {
|
||||
if (res.length) {
|
||||
res.forEach(e => {
|
||||
this.skuData.push(e.specName)
|
||||
const vals = e.specValue ? e.specValue.split(',') : []
|
||||
this.skuVals.push(Array.from(new Set(vals)))
|
||||
})
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
/** 自动完成表单所需方法*/
|
||||
filterMethod(value, option) {
|
||||
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
|
||||
},
|
||||
// 节流函数
|
||||
throttle (fn,time) {
|
||||
let startTime = new Date();//初始时间
|
||||
return function(){
|
||||
let time_ = (new Date() - startTime) >= time;//判断时间间隔是否大于传入的time值,返回布尔值
|
||||
if(time_){
|
||||
fn.apply(this);
|
||||
startTime = new Date();//函数执行完后更新初始时间的值
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 规格表格操作
|
||||
handleSpan({row, column, rowIndex, columnIndex}) {
|
||||
},
|
||||
/** 数据改变之后 抛出数据 */
|
||||
updateSkuTable(row, item) {
|
||||
let index = row._index;
|
||||
|
@ -1454,7 +1479,7 @@ export default {
|
|||
/** 查询品牌列表 */
|
||||
this.getGoodsBrandList();
|
||||
/** 查询分类绑定的规格信息 */
|
||||
this.Get_SkuInfoByCategory();
|
||||
this.Get_SkuInfoByCategory(this.baseInfoForm.categoryId);
|
||||
// 获取商品单位
|
||||
this.GET_GoodsUnit();
|
||||
// 获取当前店铺分类
|
||||
|
@ -1485,6 +1510,7 @@ export default {
|
|||
this.loading = false;
|
||||
if (this.activestep++ > 2) return;
|
||||
},
|
||||
// 店内分类选择
|
||||
selectTree(v) {
|
||||
if (v.length > 0) {
|
||||
// 转换null为""
|
||||
|
@ -1499,6 +1525,7 @@ export default {
|
|||
this.editTitle = menu.title;
|
||||
}
|
||||
},
|
||||
// 店内分类选中
|
||||
changeSelect(v) {
|
||||
this.selectCount = v.length;
|
||||
let ids = "";
|
||||
|
@ -1523,15 +1550,16 @@ export default {
|
|||
}
|
||||
let flag = false;
|
||||
let paramValue = "";
|
||||
this.baseInfoForm.goodsParamsList.forEach((e) => {
|
||||
if (
|
||||
(e.required === 1 && e.paramValue === null) ||
|
||||
e.paramValue === undefined
|
||||
) {
|
||||
flag = true;
|
||||
paramValue = e.paramName;
|
||||
}
|
||||
});
|
||||
// //参数校验
|
||||
// this.baseInfoForm.goodsParamsList.forEach((e) => {
|
||||
// if (
|
||||
// (e.required === 1 && e.paramValue === null) ||
|
||||
// e.paramValue === undefined
|
||||
// ) {
|
||||
// flag = true;
|
||||
// paramValue = e.paramName;
|
||||
// }
|
||||
// });
|
||||
if (flag) {
|
||||
this.$Message.error(paramValue + " 参数值不能为空");
|
||||
this.submitLoading = false;
|
||||
|
@ -1581,30 +1609,23 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
/** 保存至草稿箱 */
|
||||
saveToDraft(saveType) {
|
||||
let showType = saveType === "TEMPLATE" ? "模版" : "草稿";
|
||||
/** 保存为模板 */
|
||||
saveToDraft() {
|
||||
this.baseInfoForm.skuList = this.skuTableData;
|
||||
if (this.baseInfoForm.goodsGalleryFiles.length > 0) {
|
||||
this.baseInfoForm.goodsGalleryList =
|
||||
this.baseInfoForm.goodsGalleryFiles.map((i) => i.url);
|
||||
}
|
||||
this.baseInfoForm.categoryName = [];
|
||||
this.baseInfoForm.saveType = saveType;
|
||||
this.baseInfoForm.saveType = 'TEMPLATE';
|
||||
|
||||
if (this.draftId) {
|
||||
this.baseInfoForm.id = this.draftId;
|
||||
this.$Modal.confirm({
|
||||
title: "当前" + showType + "已存在",
|
||||
content:
|
||||
"当前" +
|
||||
showType +
|
||||
"已存在,是否保存为新" +
|
||||
showType +
|
||||
"或替换原" +
|
||||
showType,
|
||||
okText: "保存新" + showType,
|
||||
cancelText: "替换旧" + showType,
|
||||
title: "当前模板已存在",
|
||||
content: "当前模板已存在,保存为新模板或替换原模板",
|
||||
okText: "保存新模板",
|
||||
cancelText: "替换旧模板",
|
||||
closable: true,
|
||||
onOk: () => {
|
||||
delete this.baseInfoForm.id;
|
||||
|
@ -1620,7 +1641,7 @@ export default {
|
|||
}
|
||||
|
||||
this.$Modal.confirm({
|
||||
title: "保存" + showType,
|
||||
title: "保存模板",
|
||||
content: "是否确定保存",
|
||||
okText: "保存",
|
||||
closable: true,
|
||||
|
@ -1629,7 +1650,7 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
SAVE_DRAFT_GOODS() { // 保存草稿商品
|
||||
SAVE_DRAFT_GOODS() { // 保存模板
|
||||
API_GOODS.saveDraftGoods(this.baseInfoForm).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.info("保存成功!");
|
||||
|
|
|
@ -98,14 +98,14 @@ export default {
|
|||
}
|
||||
},
|
||||
created () {
|
||||
this.getImg();
|
||||
// this.getImg();
|
||||
},
|
||||
watch: {
|
||||
verifyType: {
|
||||
immediate: true,
|
||||
handler: function (v) {
|
||||
this.type = v;
|
||||
this.refresh();
|
||||
// this.refresh();
|
||||
}
|
||||
},
|
||||
show (v) {
|
||||
|
|
Loading…
Reference in New Issue