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 nuxt.config.js /workload/nuxt.config.js
COPY package.json /workload/package.json COPY package.json /workload/package.json
COPY .nuxt /workload/.nuxt COPY .nuxt /workload/.nuxt
COPY static /workload/static
RUN npm config set registry https://registry.npm.taobao.org \ RUN npm config set registry https://registry.npm.taobao.org \
&& npm install && npm install

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

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

@ -104,11 +104,7 @@
<div class="main__details-msg"> <div class="main__details-msg">
<div class="main__details-msg--price flex flex-middle"> <div class="main__details-msg--price flex flex-middle">
<span class="msg-txt">售价</span> <span class="msg-txt">售价</span>
<strong class="msg-price">{{ <strong class="msg-price">{{ getPrice }}</strong>
detailData.productActivityVO.isStartActivity
? detailData.productActivityVO.activityPrice
: detailData.startingPrice
}}</strong>
<div <div
v-if=" v-if="
detailData.productActivityVO.isActivity && detailData.productActivityVO.isActivity &&
@ -272,14 +268,17 @@ export default {
let res1 = await ApiGetGoodsDetail({ id }); let res1 = await ApiGetGoodsDetail({ id });
let res2 = await ApiGetGoodsSkus({ productId: id }); let res2 = await ApiGetGoodsSkus({ productId: id });
let res3 = await ApiGetGoodsList({ let res3 = await ApiGetGoodsList({
length: 3, length: 3,
pageIndex: 1, pageIndex: 1,
name: "", name: "",
categoryId: "", categoryId: "",
order: "", order: "",
}); });
vm.detailData = res1.result; 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.recommendedData = res3.result.records;
vm.pageLoading = false; vm.pageLoading = false;
if ( if (
@ -311,7 +310,7 @@ export default {
curSku() { curSku() {
return ( return (
this.skuData.find( 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 return this.detailData.attributeGroupList
.map((item) => { .map((item) => {
const activeAttr = item.attributes.find((i) => i.active); 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; const stock = this.curSku.stock;
return singleBuyLimit ? Math.min(singleBuyLimit, stock || 1) : 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: { methods: {
onShowService() { onShowService() {
@ -425,26 +433,6 @@ export default {
vm.activeImg++; 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) { setDisabledItem(item, groupIndex) {
let vm = this; let vm = this;
vm.detailData.attributeGroupList.forEach((group, idx) => { vm.detailData.attributeGroupList.forEach((group, idx) => {
// // if(groupIndex === idx) return false;
let symbolCache = Object.assign([], this.selectedSymbol); //
// group.attributes.forEach( item => {
if (groupIndex === idx) return false; let symbolCache = Object.assign([],vm.selectedSymbol);
// symbolCache.push(item.symbol);
group.attributes.forEach((item) => { symbolCache.sort();
// const res = vm.skuData.filter(item =>
symbolCache[idx] = item.symbol; symbolCache.map(i => item.attributeSymbolList.includes(i.toString())).every(i => i)
const reg = new RegExp(symbolCache.join(",")); ).find(i => i.stock > 0);
// SKU if(res){
const res = vm.skuData item.disabled = false;
.filter((i) => reg.test(i.attributeSymbolList)) }else{
.find((i) => i.stock > 0); item.disabled = true;
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() { buyNow() {
if (!this.$isLoginValidate()) { if (!this.$isLoginValidate()) {

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

Loading…
Cancel
Save