Merge branch 'feature/task1.0.0' into feature/task1.0.0-0507-zz

merge-requests/88/head
张征 3 years ago
commit 67176fa1fb

@ -4,6 +4,7 @@ WORKDIR /workload
COPY nuxt.config.js /workload/nuxt.config.js
COPY package.json /workload/package.json
COPY .nuxt /workload/.nuxt
COPY static /workload/static
RUN npm config set registry https://registry.npm.taobao.org \
&& npm install

@ -152,7 +152,7 @@ export default {
};
},
computed: {
...mapState(["userInfo", "token","unreadCount"]),
...mapState(["userInfo", "token", "unreadCount"]),
menuIcon() {
return this.menuVisible
? require("~/assets/img/layout/icon-up-light.png")
@ -160,7 +160,7 @@ export default {
},
},
mounted() {
this.$startWebSockets()
this.$startWebSockets();
},
methods: {
onLoginClick() {
@ -248,7 +248,7 @@ export default {
height: 30px;
color: #999999;
background: #f1f1f1;
border-radius: 0px 0px 0px 0px;
font-size: 12px;
.info-bar-header-wrap {
height: 100%;
@include layout-box;
@ -270,6 +270,8 @@ export default {
position: relative;
padding: 0 18px;
height: 30px;
font-size: 12px;
color: #999999;
cursor: pointer;
.content-login-info__logo {
width: 8px;

@ -62,11 +62,8 @@
<div class="default-bar-header">
<div class="bar-header-box">
<div class="bar-header-box__wrap flex flex-between flex-middle">
<div @click="onOpenHomePage">
<img
class="header-box-wrap__logo"
src="~/assets/img/layout/logo.png"
/>
<div class="header-box-wrap__logo" @click="onOpenHomePage">
<img src="~/assets/img/layout/logo.png" />
</div>
<div class="header-box-wrap__right flex flex-middle">
<div class="box-wrap-right__search flex">
@ -203,7 +200,10 @@ export default {
window.open(`${location.origin}/cart`);
},
onOpenHomePage() {
this.$router.push("/");
if (this.$route.path === "/") {
return;
}
window.open(`${location.origin}/`);
},
},
};
@ -308,7 +308,7 @@ export default {
@include layout-box;
background: #ffffff;
.bar-header-box__wrap {
height: 42px;
height: 40px;
font-size: 14px;
margin-bottom: 38px;
padding-right: 50px;

@ -104,11 +104,7 @@
<div class="main__details-msg">
<div class="main__details-msg--price flex flex-middle">
<span class="msg-txt">售价</span>
<strong class="msg-price">{{
detailData.productActivityVO.isStartActivity
? detailData.productActivityVO.activityPrice
: detailData.startingPrice
}}</strong>
<strong class="msg-price">{{ getPrice }}</strong>
<div
v-if="
detailData.productActivityVO.isActivity &&
@ -272,14 +268,17 @@ export default {
let res1 = await ApiGetGoodsDetail({ id });
let res2 = await ApiGetGoodsSkus({ productId: id });
let res3 = await ApiGetGoodsList({
length: 3,
pageIndex: 1,
name: "",
categoryId: "",
order: "",
});
length: 3,
pageIndex: 1,
name: "",
categoryId: "",
order: "",
});
vm.detailData = res1.result;
vm.skuData = res2.result;
vm.skuData = res2.result.map(i => {
i.attributeSymbolList = i.attributeSymbolList.split(',')
return i;
});
vm.recommendedData = res3.result.records;
vm.pageLoading = false;
if (
@ -311,7 +310,7 @@ export default {
curSku() {
return (
this.skuData.find(
(i) => i.attributeSymbolList === this.selectedSymbol.join(",")
(i) => i.attributeSymbolList.join(',') === this.selectedSymbol.join(",")
) || {}
);
},
@ -320,9 +319,9 @@ export default {
return this.detailData.attributeGroupList
.map((item) => {
const activeAttr = item.attributes.find((i) => i.active);
return activeAttr ? activeAttr.symbol : ".";
return activeAttr?.symbol;
})
.filter((i) => i); //.sort();
.filter((i) => i).sort();
},
/**
* 最大可购买数量
@ -334,6 +333,15 @@ export default {
const stock = this.curSku.stock;
return singleBuyLimit ? Math.min(singleBuyLimit, stock || 1) : stock;
},
getPrice() {
if (this.curSku.sellPrice) {
return this.curSku.sellPrice;
} else {
return this.detailData.productActivityVO.isStartActivity
? this.detailData.productActivityVO.activityPrice
: this.detailData.startingPrice;
}
},
},
methods: {
onShowService() {
@ -425,26 +433,6 @@ export default {
vm.activeImg++;
}
},
/**
* 设置默认选中规格
*/
setDefaultAttr() {
let vm = this;
const curSku = vm.skuData.find((i) => i.stock > 0);
if (!curSku) {
return false;
}
vm.detailData.attributeGroupList.forEach((item, index) => {
for (let i of item.attributes) {
if (curSku.attributeSymbolList.includes(i.symbol)) {
this.$set(i, "active", true);
this.setDisabledItem(i, index, true);
break;
}
}
});
this.$emit("input", this.curSku);
},
/**
* 点击属性项设置选中和禁用项
*/
@ -473,26 +461,43 @@ export default {
setDisabledItem(item, groupIndex) {
let vm = this;
vm.detailData.attributeGroupList.forEach((group, idx) => {
//
let symbolCache = Object.assign([], this.selectedSymbol);
//
if (groupIndex === idx) return false;
//
group.attributes.forEach((item) => {
//
symbolCache[idx] = item.symbol;
const reg = new RegExp(symbolCache.join(","));
// SKU
const res = vm.skuData
.filter((i) => reg.test(i.attributeSymbolList))
.find((i) => i.stock > 0);
if (res) {
item.disabled = false;
} else {
item.disabled = true;
}
});
});
// if(groupIndex === idx) return false;
//
group.attributes.forEach( item => {
let symbolCache = Object.assign([],vm.selectedSymbol);
symbolCache.push(item.symbol);
symbolCache.sort();
const res = vm.skuData.filter(item =>
symbolCache.map(i => item.attributeSymbolList.includes(i.toString())).every(i => i)
).find(i => i.stock > 0);
if(res){
item.disabled = false;
}else{
item.disabled = true;
}
});
})
// vm.detailData.attributeGroupList.forEach((group, idx) => {
// //
// let symbolCache = Object.assign([], this.selectedSymbol);
// //
// if (groupIndex === idx) return false;
// //
// group.attributes.forEach((item) => {
// //
// symbolCache[idx] = item.symbol;
// const reg = new RegExp(symbolCache.join(","));
// // SKU
// const res = vm.skuData
// .filter((i) => reg.test(i.attributeSymbolList))
// .find((i) => i.stock > 0);
// if (res) {
// item.disabled = false;
// } else {
// item.disabled = true;
// }
// });
// });
},
buyNow() {
if (!this.$isLoginValidate()) {

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-05-04 17:30:58
* @LastEditors: ch
* @LastEditTime: 2022-05-16 16:01:17
* @LastEditTime: 2022-05-17 16:44:30
* @Description: file content
-->
@ -18,7 +18,7 @@
<h3 class="title">确认商品信息</h3>
<OrderInfo :products="orderInfo.products" />
<Message :orderInfo="orderInfo" :message.sync="userMessage"/>
<Amount :amount="orderInfo.payAmount" :address="address"/>
<Amount :amount="orderInfo.productAmount" :address="address"/>
<div class="pay">
<UiButton radius type="red_panel" @click="submit"></UiButton>
</div>

Loading…
Cancel
Save