Merge branch 'feature/task1.0.0' into msb_test

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

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

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

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

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

@ -49,8 +49,8 @@ export default {
...mapState(["token"]), ...mapState(["token"]),
}, },
mounted() { 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 = `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`; // let url = `wss://k8s-horse-gateway.mashibing.cn/ws?client=${this.token}&type=1`;
this.socket(url); this.socket(url);
}, },
methods: { methods: {

@ -1,14 +1,51 @@
<template> <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"> <nav class="nav flex flex-middle flex-center">
<p class="nav__crumbs"> <p class="nav__crumbs">
全部商品 全部商品
<i class="el-icon-arrow-right"></i> <i class="el-icon-arrow-right"></i>
开发书籍 {{ detailData.name }}
<i class="el-icon-arrow-right"></i>
后端书籍
<i class="el-icon-arrow-right"></i>
Java从入门到项目实战
</p> </p>
</nav> </nav>
<main class="main flex" v-if="detailData.isEnable"> <main class="main flex" v-if="detailData.isEnable">
@ -192,7 +229,9 @@
</div> </div>
</section> </section>
<div class="flex flex-center"> <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> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -212,6 +251,7 @@ export default {
componetns: { UiMoney, UiButton, UiGoodsItem, BsChosen }, componetns: { UiMoney, UiButton, UiGoodsItem, BsChosen },
data() { data() {
return { return {
pageLoading: true,
curBuyNum: 1, curBuyNum: 1,
activeImg: 0, activeImg: 0,
recommendedData: [], recommendedData: [],
@ -237,6 +277,7 @@ export default {
vm.detailData = res1.result; vm.detailData = res1.result;
vm.skuData = res2.result; vm.skuData = res2.result;
vm.recommendedData = res3.result; vm.recommendedData = res3.result;
vm.pageLoading = false;
if ( if (
vm.detailData.productActivityVO.isActivity && vm.detailData.productActivityVO.isActivity &&
!vm.detailData.productActivityVO.isStartActivity && !vm.detailData.productActivityVO.isStartActivity &&

@ -7,7 +7,35 @@
--> -->
<template> <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"> <main class="main" v-if="listData && listData.length">
<nav class="main__nav"> <nav class="main__nav">
<p class="main__nav-crumbs"> <p class="main__nav-crumbs">
@ -70,7 +98,7 @@
<img class="main-none-img" src="@/assets/img/goods/none.png" alt="" /> <img class="main-none-img" src="@/assets/img/goods/none.png" alt="" />
<p class="main-none-txt">没有搜到你想要的商品哦换个关键词试试</p> <p class="main-none-txt">没有搜到你想要的商品哦换个关键词试试</p>
</main> </main>
<BsChosen></BsChosen> <BsChosen v-if="!listData || !listData.length"></BsChosen>
</div> </div>
</template> </template>
<script> <script>
@ -81,11 +109,12 @@ import {
} from "@/plugins/api/goods"; } from "@/plugins/api/goods";
import Sort from "./module/SortItem.vue"; import Sort from "./module/SortItem.vue";
import UiGoodsItem from "@/components/UiGoodsItem.vue"; import UiGoodsItem from "@/components/UiGoodsItem.vue";
import BsChosen from '@/components/BsChosen.vue'; import BsChosen from "@/components/BsChosen.vue";
export default { export default {
components: { Sort, UiGoodsItem, BsChosen }, components: { Sort, UiGoodsItem, BsChosen },
data() { data() {
return { return {
pageloading: true,
navActive: 0, navActive: 0,
levelActive: 0, levelActive: 0,
listData: [], listData: [],
@ -104,7 +133,7 @@ export default {
}, },
}; };
}, },
async created() { created() {
this.init(); this.init();
}, },
methods: { methods: {
@ -168,6 +197,7 @@ export default {
vm.params.categoryId = vm.categoryOneList[vm.levelActive].id; vm.params.categoryId = vm.categoryOneList[vm.levelActive].id;
} }
let res = await ApiGetGoodsList(vm.params); let res = await ApiGetGoodsList(vm.params);
vm.pageloading = false;
if (res.error) { if (res.error) {
vm.$message.error(res.error.message); vm.$message.error(res.error.message);
return false; return false;
@ -286,5 +316,4 @@ export default {
color: #999999; color: #999999;
} }
} }
</style> </style>

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

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

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

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

Loading…
Cancel
Save