Merge branch 'feature/task1.0.0' into msb_test

merge-requests/69/merge
张征 2 years ago
commit e636883bd6

@ -93,9 +93,9 @@
:class="!isAccount ? 'flex-column' : ''"
>
<el-checkbox v-model="defaultAddress"></el-checkbox>
<div class="address__edit--btns flex flex-middle">
<div class="address__edit--btns flex flex-middle" :class="isAccount?'clearmargin':''">
<UiButton
v-if="addressList && addressList.length && !isAccount"
v-if="addressList[0].id && !isAccount"
type="grey"
@click="isOperation = false"
>取消</UiButton
@ -221,15 +221,13 @@ export default {
if (res.result && res.result.length) {
vm.isOperation = false;
vm.addressList = res.result;
if (!vm.addressList.length) {
vm.defaultAddress = true;
}
let curIndex = vm.addressList.findIndex((item) => item.isDefault);
vm.curAddressListItem =
curIndex > -1 ? vm.addressList[curIndex] : vm.addressList[0];
vm.$emit("getList", vm.addressList);
vm.$emit("emitAddress", vm.curAddressListItem);
} else {
vm.defaultAddress = true;
vm.isOperation = true;
}
console.log("获取收货地址", res);
@ -410,6 +408,9 @@ export default {
margin-right: 38px;
}
}
.clearmargin{
margin: 0 0 0 20px;
}
}
}

@ -125,13 +125,9 @@ export default {
onCategoryClick(id, levelType) {
this.categroyVisible = false;
this.categroyTwoVisible = false;
this.$router.push({
path: "/goods/list",
query: {
id,
levelType,
},
});
window.open(
`${location.origin}/goods/list?id=${id}&levelType=${levelType}`
);
},
//
handleCategoryChange(val) {

@ -138,10 +138,10 @@ export default {
handleCommandClick(event) {
switch (event) {
case MENU_VALUE.PERSONAL:
this.$router.push("/account/home");
window.open(`${location.origin}/account/home`);
break;
case MENU_VALUE.ADDRESS:
this.$router.push("/account/address");
window.open(`${location.origin}/account/address`);
break;
case MENU_VALUE.LOGON_OUT:
this.$store.dispatch("logout");
@ -153,7 +153,7 @@ export default {
if (!this.$isLoginValidate()) {
return;
}
this.$router.push(`/account/${path}`);
window.open(`${location.origin}/account/${path}`);
},
},
};
@ -162,7 +162,7 @@ export default {
.header-info-bar__dropdown,
.header-info-bar__popover {
.popper__arrow {
display: none;
display: none !important;
}
}
</style>

@ -30,7 +30,7 @@
src="~/assets/img/layout/icon-search-sticky.png"
@click="$router.push('/goods/list')"
/>
<div class="header-wrap-icons__shop" @click="$router.push('/cart')">
<div class="header-wrap-icons__shop" @click="onOpenCartPage">
<img src="~/assets/img/layout/icon-shop-sticky.png" />
<div
v-if="cartCount > 0"
@ -74,10 +74,14 @@
v-model="searchContent"
clearable
placeholder="请输入商品名称"
></el-input>
@keyup.enter.native="onSearch"
>
</el-input>
</div>
<div
slot="suffix"
class="search-icon flex flex-center flex-middle"
@keyup.enter.native="onSearch"
@click="onSearch"
>
<img src="~/assets/img/layout/icon-search.png" />
@ -175,7 +179,7 @@ export default {
onTabSelect(value) {
this.tabPath = value;
this.searchContent = "";
this.$router.push({ path: value });
window.open(`${location.origin}${value}`);
},
onSearch() {
this.$router.push({
@ -185,6 +189,9 @@ export default {
},
});
},
onOpenCartPage() {
window.open(`${location.origin}/cart`);
},
},
};
</script>

@ -49,8 +49,8 @@ export default {
...mapState(["token"]),
},
mounted() {
// let url = `ws://192.168.10.93:8090/ws?client=eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjQwNzA4ODAwMDAsImlkIjoyLCJ0aW1lIjoxNjUyNDQyMDIyMjE4fQ.ybPvJ-pkywqzBgAK9Lv_7yme50cGhtTvzVcfp-kLyjlzKpsgcvQrhd_FhCHZo-eUEN-OuotoLblU94UMa_oKZ1TU78gjzPWeUpUO9LZVOs0HKIxeFmPbJTe0js5Ckw79p8uTNyO6p9DmZTb3TsX9OmoNoeTDkZLMiJsIXEi9eRU&type=1`;
let url = `wss://k8s-horse-gateway.mashibing.cn/ws?client=${this.token}&type=1`;
let url = `ws://192.168.10.93:8090/ws?client=${this.token}&type=1`;
// let url = `wss://k8s-horse-gateway.mashibing.cn/ws?client=${this.token}&type=1`;
this.socket(url);
},
methods: {

@ -1,14 +1,51 @@
<template>
<div>
<div v-if="pageLoading">
<main class="main">
<el-skeleton style="width: 100%; padding: 40px" :loading="true" animated>
<template slot="template">
<div class="flex">
<el-skeleton-item
variant="image"
style="width: 456px; height: 456px"
/>
<div style="flex: 1; padding: 0 20px">
<el-skeleton-item variant="h1" style="width: 100%" />
<el-skeleton-item
variant="h2"
style="width: 100%; height: 130px; margin-top: 20px"
/>
<el-skeleton-item
variant="h3"
style="margin-top: 34px; width: 90%"
/>
<el-skeleton-item
variant="h3"
style="margin-top: 34px; width: 70%"
/>
<el-skeleton-item
variant="h3"
style="margin-top: 34px; width: 50%"
/>
<el-skeleton-item
variant="h3"
style="margin-top: 34px; width: 50%"
/>
<el-skeleton-item
variant="h3"
style="margin-top: 34px; width: 100%"
/>
</div>
</div>
</template>
</el-skeleton>
</main>
</div>
<div v-else>
<nav class="nav flex flex-middle flex-center">
<p class="nav__crumbs">
全部商品
<i class="el-icon-arrow-right"></i>
开发书籍
<i class="el-icon-arrow-right"></i>
后端书籍
<i class="el-icon-arrow-right"></i>
Java从入门到项目实战
{{ detailData.name }}
</p>
</nav>
<main class="main flex" v-if="detailData.isEnable">
@ -192,7 +229,9 @@
</div>
</section>
<div class="flex flex-center">
<UiButton type="yellow_panel service-btn" @click="showService=false;"></UiButton>
<UiButton type="yellow_panel service-btn" @click="showService = false"
>确定</UiButton
>
</div>
</el-dialog>
</div>
@ -212,6 +251,7 @@ export default {
componetns: { UiMoney, UiButton, UiGoodsItem, BsChosen },
data() {
return {
pageLoading: true,
curBuyNum: 1,
activeImg: 0,
recommendedData: [],
@ -237,6 +277,7 @@ export default {
vm.detailData = res1.result;
vm.skuData = res2.result;
vm.recommendedData = res3.result;
vm.pageLoading = false;
if (
vm.detailData.productActivityVO.isActivity &&
!vm.detailData.productActivityVO.isStartActivity &&

@ -7,7 +7,35 @@
-->
<template>
<div :class="listData && listData.length ? 'page' : ''">
<div v-if="pageloading" class="main flex">
<el-skeleton
v-for="item in 5"
:key="item"
style="width: 230px;margin-right:20px;"
:loading="true"
animated
>
<template slot="template">
<el-skeleton-item variant="image" style="width: 240px; height: 240px" />
<div style="padding: 14px">
<el-skeleton-item variant="h3" style="width: 50%" />
<div
style="
display: flex;
align-items: center;
justify-items: space-between;
margin-top: 16px;
height: 16px;
"
>
<el-skeleton-item variant="text" style="margin-right: 16px" />
<el-skeleton-item variant="text" style="width: 30%" />
</div>
</div>
</template>
</el-skeleton>
</div>
<div v-else :class="listData && listData.length ? 'page' : ''">
<main class="main" v-if="listData && listData.length">
<nav class="main__nav">
<p class="main__nav-crumbs">
@ -70,7 +98,7 @@
<img class="main-none-img" src="@/assets/img/goods/none.png" alt="" />
<p class="main-none-txt">没有搜到你想要的商品哦换个关键词试试</p>
</main>
<BsChosen></BsChosen>
<BsChosen v-if="!listData || !listData.length"></BsChosen>
</div>
</template>
<script>
@ -81,11 +109,12 @@ import {
} from "@/plugins/api/goods";
import Sort from "./module/SortItem.vue";
import UiGoodsItem from "@/components/UiGoodsItem.vue";
import BsChosen from '@/components/BsChosen.vue';
import BsChosen from "@/components/BsChosen.vue";
export default {
components: { Sort, UiGoodsItem,BsChosen },
components: { Sort, UiGoodsItem, BsChosen },
data() {
return {
pageloading: true,
navActive: 0,
levelActive: 0,
listData: [],
@ -104,7 +133,7 @@ export default {
},
};
},
async created() {
created() {
this.init();
},
methods: {
@ -168,6 +197,7 @@ export default {
vm.params.categoryId = vm.categoryOneList[vm.levelActive].id;
}
let res = await ApiGetGoodsList(vm.params);
vm.pageloading = false;
if (res.error) {
vm.$message.error(res.error.message);
return false;
@ -286,5 +316,4 @@ export default {
color: #999999;
}
}
</style>

@ -9,12 +9,12 @@
<template>
<div class="home-banner">
<el-carousel height="360px" indicator-position="outside">
<el-carousel-item
v-for="item in bannerList"
:key="item.id"
@click="onBannerClick(item.id)"
>
<el-image :src="item.url" fit="cover"></el-image>
<el-carousel-item v-for="item in bannerList" :key="item.id">
<el-image
@click="onBannerClick(item.id)"
:src="item.url"
fit="cover"
></el-image>
</el-carousel-item>
</el-carousel>
</div>
@ -46,7 +46,7 @@ export default {
},
methods: {
onBannerClick(goodsId) {
window.open(`${location.href}/detail/${goodsId}`);
window.open(`${location.origin}/goods/detail/${goodsId}`);
},
},
};
@ -75,6 +75,7 @@ export default {
.el-image {
width: 100%;
height: 100%;
cursor: pointer;
}
}
}

@ -12,7 +12,7 @@
<div class="home-pick-recommend__products flex flex-middle flex-between">
<!-- 左侧商品一 -->
<div
@click="onJumpGoodsDetal(recommendGoodsOne.id)"
@click="onJumpGoodsDetail(recommendGoodsOne.id)"
class="pick-recommend-products__left"
>
<strong class="home-pick-recommend--title">{{
@ -45,7 +45,7 @@
<div
v-for="(item, index) in recommendArray"
:key="index"
@click="onJumpGoodsDetal(item.id)"
@click="onJumpGoodsDetail(item.id)"
class="recommend-products-right__item"
>
<strong class="home-pick-recommend--title">{{ item.title }}</strong>
@ -84,7 +84,7 @@
<div class="home-pick-new__products flex">
<!-- 左侧商品 -->
<div
@click="onJumpGoodsDetal(newGoodsOne.id)"
@click="onJumpGoodsDetail(newGoodsOne.id)"
class="pick-new-products__left"
>
<img
@ -102,7 +102,7 @@
<div
v-for="(item, index) in newArray"
:key="index"
@click="onJumpGoodsDetal(item.id)"
@click="onJumpGoodsDetail(item.id)"
class="new-products-right__wrap flex flex-middle"
>
<div class="products-right-wrap__cover">
@ -172,11 +172,11 @@ export default {
},
},
methods: {
onJumpGoodsDetal(id) {
this.$router.push(`/goods/detail/${id}`);
onJumpGoodsDetail(id) {
window.open(`${location.origin}/goods/detail/${id}`);
},
onJumpGoodsList(type) {
this.$router.push(`/goods/list?id=${type}`);
window.open(`${location.origin}/goods/list?id=${type}`);
},
},
};
@ -184,6 +184,7 @@ export default {
<style lang="scss" scoped>
.home-pick {
color: #333333;
margin-top: 30px;
&--label {
font-size: 24px;
margin-bottom: 16px;

@ -36,7 +36,6 @@
<div
v-for="(itemChild, indexChild) in item"
:key="itemChild.productId"
@click.stop="onJumpGoodsDetail(itemChild.productId)"
class="carousel-goods-box flex flex-middle"
>
<div
@ -174,10 +173,7 @@ export default {
}, 1e3);
},
onJumpSeckill() {
this.$router.push("/seckill");
},
onJumpGoodsDetail(id) {
this.$router.push(`/goods/detail/${id}`);
window.open(`${location.origin}/seckill`);
},
},
};

@ -260,7 +260,7 @@ export default {
});
},
onJumpGoodsDetail(id) {
this.$router.push(`/goods/detail/${id}`);
window.open(`${location.origin}/goods/detail/${id}`);
},
handleCurrentChange(page) {
this.query.pageIndex = page;

Loading…
Cancel
Save