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

merge-requests/26/head
ch 2 years ago
commit 8704cf0839

@ -115,7 +115,7 @@ this.$store.commit('setLoginOut')
this.$store.state.userInfo
// 登录拦截
// 示例:点击购买课程前需要判断当前用户是否登录
// 示例:点击购买课程前需要判断当前用户是否登录,未登录则弹出登录弹窗
function onPurchaseCourse() {
if (!this.$isLoginValidate()) {
return;

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Before

Width:  |  Height:  |  Size: 369 B

After

Width:  |  Height:  |  Size: 369 B

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Before

Width:  |  Height:  |  Size: 375 B

After

Width:  |  Height:  |  Size: 375 B

Before

Width:  |  Height:  |  Size: 134 B

After

Width:  |  Height:  |  Size: 134 B

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 133 B

Before

Width:  |  Height:  |  Size: 135 B

After

Width:  |  Height:  |  Size: 135 B

Before

Width:  |  Height:  |  Size: 135 B

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 351 B

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

Before

Width:  |  Height:  |  Size: 215 B

After

Width:  |  Height:  |  Size: 215 B

Before

Width:  |  Height:  |  Size: 567 B

After

Width:  |  Height:  |  Size: 567 B

Before

Width:  |  Height:  |  Size: 542 B

After

Width:  |  Height:  |  Size: 542 B

Before

Width:  |  Height:  |  Size: 372 B

After

Width:  |  Height:  |  Size: 372 B

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Before

Width:  |  Height:  |  Size: 846 B

After

Width:  |  Height:  |  Size: 846 B

Before

Width:  |  Height:  |  Size: 611 B

After

Width:  |  Height:  |  Size: 611 B

Before

Width:  |  Height:  |  Size: 237 B

After

Width:  |  Height:  |  Size: 237 B

Before

Width:  |  Height:  |  Size: 237 B

After

Width:  |  Height:  |  Size: 237 B

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Before

Width:  |  Height:  |  Size: 706 B

After

Width:  |  Height:  |  Size: 706 B

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

@ -1,20 +1,358 @@
<template>
<div>
<div class="address"></div>
<div class="address flex flex-middle" v-if="!isEdit">
<article class="address__msg">
<div class="address__msg-line flex flex-middle">
<img src="@/assets/img/goods/point.png" alt="收货地址" />
<span class="address__msg-line--txt">默认地址</span>
<UiButton type="yellow_panel">修改</UiButton>
</div>
<div class="address__msg-line flex flex-middle">
<span class="address__msg-line--type">收货地址:</span>
<span class="address__msg-line--txt">{{
curAddressListItem.area +
curAddressListItem.city +
curAddressListItem.province +
curAddressListItem.detailAddress
}}</span>
</div>
<div class="address__msg-line flex flex-middle">
<span class="address__msg-line--type"> :</span>
<span class="address__msg-line--txt">{{
curAddressListItem.name
}}</span>
</div>
<div class="address__msg-line flex flex-middle">
<span class="address__msg-line--type">手机号码:</span>
<span class="address__msg-line--txt">{{
curAddressListItem.phone
}}</span>
</div>
</article>
<div class="hr"></div>
<div class="address__operation flex flex-column flex-middle">
<UiButton type="grey" class="flex flex-middle" @click="onSwtich">
<img
class="icon"
src="@/assets/img/goods/switch.png"
alt="切换地址"
/>
切换地址
</UiButton>
<UiButton type="grey" @click="isEdit = true" class="flex flex-middle">
<img class="icon" src="@/assets/img/goods/add.png" alt="新建地址" />
新建地址
</UiButton>
</div>
</div>
<div class="address flex flex-middle" v-else>
<article class="address__msg">
<div class="address__msg-line flex flex-middle">
<span class="address__msg-line--type">所在区域</span>
<no-ssr><v-distpicker @selected="onSelected"></v-distpicker></no-ssr>
</div>
<div class="address__msg-line flex flex-middle">
<span class="address__msg-line--type">详细地址</span>
<el-input
v-model="detailAddress"
type="textarea"
:rows="3"
class="max-ipt"
></el-input>
</div>
<div class="address__msg-line flex flex-middle">
<span class="address__msg-line--type">收货人</span>
<el-input v-model="addressUser" class="min-ipt"></el-input>
<span class="address__msg-line--type">手机号码</span>
<el-input
v-model="addressPhone"
oninput="value=value.replace(/[^\d]/g,'')"
class="min-ipt"
></el-input>
</div>
</article>
<div class="hr"></div>
<div class="address__operation flex flex-column flex-middle">
<el-checkbox v-model="defaultAddress"></el-checkbox>
<div>
<UiButton
v-if="addressList && addressList.length"
type="grey"
@click="isEdit = false"
>取消</UiButton
>
<UiButton type="yellow_panel" @click="onAddAddress"
>保存地址</UiButton
>
</div>
</div>
</div>
<el-dialog
title="选择地址"
center
:visible.sync="dialogVisible"
width="380px"
>
<div class="address__list">
<section
@click="onAddressItem(item)"
class="address__list--item"
v-for="item in addressList"
:key="item.id"
>
<div>收货人{{ item.name }}</div>
<div>手机号码{{ item.phone }}</div>
<div>收货地址{{ item.detailAddress }}</div>
</section>
</div>
<span slot="footer" class="dialog-footer flex flex-between">
<UiButton type="grey" @click="onCancel"></UiButton>
<UiButton type="yellow_panel">确认</UiButton>
</span>
</el-dialog>
</div>
</template>
<script>
import UiButton from "@/components/UiButton.vue";
import { ApiGetAddress, ApiPostAddress } from "@/plugins/api/base";
export default {
components: { UiButton },
props: {
addressData: {
type: Object,
default: () => {},
},
},
model: {
prop: "addressData",
event: "emitAddress",
},
data() {
return {};
return {
isEdit: false,
dialogVisible: false,
detailAddress: "",
addressUser: "",
addressPhone: "",
defaultAddress: true,
selectData: {},
addressList: [{}],
curAddressListItem: 0,
};
},
created() {
this.getAddressData();
},
methods: {
async getAddressData() {
let vm = this;
let res = await ApiGetAddress();
if (res.result && res.result.length) {
vm.isEdit = false;
vm.addressList = res.result;
let curIndex = vm.addressList.findIndex((item) => item.id == 3);
vm.curAddressListItem =
curIndex > -1 ? vm.addressList[curIndex] : vm.addressList[0];
vm.$emit("emitAddress", vm.curAddressListItem);
} else {
vm.isEdit = true;
}
console.log("获取收货地址", res);
},
onSwtich() {
this.dialogVisible = true;
},
onCancel() {
this.dialogVisible = false;
},
onSelected(data) {
console.log(data);
this.selectData = data;
},
async onAddAddress() {
let vm = this;
if (!vm.selectData?.area?.code) {
vm.$message.error("请选择所在区域~");
return;
}
if (!vm.detailAddress) {
vm.$message.error("请输入详细地址~");
return;
}
if (!vm.addressUser) {
vm.$message.error("请输入收货人~");
return;
}
if (!vm.addressPhone) {
vm.$message.error("请输入收货人手机号码~");
return;
}
let params = {
area: vm.selectData.area.value,
areaCode: vm.selectData.area.code,
city: vm.selectData.city.value,
cityCode: vm.selectData.city.code,
detailAddress: vm.detailAddress,
isDefault: vm.defaultAddress,
name: vm.addressUser,
phone: vm.addressPhone,
province: vm.selectData.province.value,
provinceCode: vm.selectData.province.code,
};
let res = await ApiPostAddress(params);
if (!res.error) {
vm.$message.success("添加成功!");
vm.getAddressData();
}
console.log(res);
},
onAddressItem(item) {
let vm = this;
vm.curAddressListItem = item;
vm.$emit("emitAddress", item);
vm.dialogVisible = false;
},
},
methods: {},
};
</script>
<style lang="scss" scoped>
.address {
width: 1200px;
height: 189px;
@include layout-box;
min-height: 189px;
border: 1px solid #dddddd;
padding: 28px 34px 8px;
&__msg {
width: 776px;
&-line {
margin-bottom: 20px;
img {
width: 20px;
height: 24px;
margin-right: 14px;
}
&--type {
width: 70px;
font-size: 14px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #999999;
}
&--txt {
font-size: 14px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #333333;
}
/deep/.ui-button__yellow_panel {
width: 62px;
height: 30px;
color: #ff875b;
background: rgba(255, 135, 91, 0.1);
border-radius: 4px 4px 4px 4px;
margin-left: 54px;
}
.max-ipt {
width: 450px;
}
.min-ipt {
width: 164px;
margin-right: 50px;
/deep/.el-input__inner {
width: 164px;
height: 28px;
background: #ffffff;
border-radius: 2px;
border: 1px solid rgba(0, 0, 0, 0.15);
}
}
}
}
.hr {
width: 2px;
height: 107px;
background: #eeeeee;
}
&__operation {
flex: 1;
/deep/.ui-button__grey {
width: 114px;
font-size: 14px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #666666;
&:nth-child(1) {
margin-bottom: 30px;
}
}
.icon {
width: 18px;
height: 18px;
margin-right: 10px;
}
}
}
.address__list {
height: 265px;
overflow-y: auto;
//
overflow-y: auto;
scrollbar-width: none;
&::-webkit-scrollbar {
width: 4px;
}
/*定义滚动条轨道 内阴影+圆角*/
&::-webkit-scrollbar-track {
border-radius: 10px;
background-color: #fff;
}
/*定义滑块 内阴影+圆角*/
&::-webkit-scrollbar-thumb {
border-radius: 10px;
background-color: #eeeeee;
}
&--item {
width: 320px;
height: 120px;
border: 1px solid #dddddd;
margin-bottom: 24px;
}
}
.dialog-footer {
/deep/.ui-button {
width: 150px;
height: 36px;
background: #ffffff;
border-radius: 2px 2px 2px 2px;
border: 1px solid #eeeeee;
font-size: 14px;
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
font-weight: 400;
color: #000;
}
/deep/.ui-button__yellow_panel {
background: #ff875b;
color: #fff;
}
}
/deep/.distpicker-address-wrapper {
select {
width: 164px;
height: 28px;
background: #ffffff;
border-radius: 2px 2px 2px 2px;
border: 1px solid rgba(0, 0, 0, 0.15);
font-size: 14px;
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
font-weight: 400;
color: #333333;
padding: 0;
}
}
</style>

@ -10,7 +10,7 @@
<div class="bs-login-wrap">
<img
class="bs-login-wrap__logo"
src="@/static/images/login/icon-logo.png"
src="~/assets/img/login/icon-logo.png"
/>
<div class="bs-login-wrap__content">
<el-form :model="form" :rules="rules" ref="ruleForm">
@ -43,7 +43,7 @@
<img
v-if="isAcceptAgreement"
class="icon-choose"
src="@/static/images/login/icon-accept.png"
src="~/assets/img/login/icon-accept.png"
/>
<span v-else class="icon-unchoose"></span>
</div>
@ -53,7 +53,7 @@
</div>
</div>
<div class="bs-login-wrap__btn--close" @click="onClose">
<img src="@/static/images/login/icon-close.png" />
<img src="~/assets/img/login/icon-close.png" />
</div>
</div>
</el-dialog>

@ -27,19 +27,19 @@ export default {
promiseList: [
{
label: "马士兵严选",
icon: require("@/static/images/layout/footer-1.png"),
icon: require("~/assets/img/layout/footer-1.png"),
},
{
label: "马士兵严选",
icon: require("@/static/images/layout/footer-2.png"),
icon: require("~/assets/img/layout/footer-2.png"),
},
{
label: "马士兵严选",
icon: require("@/static/images/layout/footer-3.png"),
icon: require("~/assets/img/layout/footer-3.png"),
},
{
label: "马士兵严选",
icon: require("@/static/images/layout/footer-4.png"),
icon: require("~/assets/img/layout/footer-4.png"),
},
],
};

@ -32,7 +32,7 @@
:command="item.value"
>
<span> {{ item.label }}</span>
<img src="@/static/images/layout/icon-arrow.png" />
<img src="~/assets/img/layout/icon-arrow.png" />
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@ -50,7 +50,7 @@
class="header-wrap-content__common flex flex-middle"
@click="onJumpPersonalPage('message')"
>
<img src="@/static/images/layout/icon-message.png" />
<img src="~/assets/img/layout/icon-message.png" />
<span>消息</span>
<div class="wrap-content-message__tip">33</div>
</div>
@ -60,12 +60,12 @@
class="header-wrap-content__common flex flex-middle"
@click="onJumpPersonalPage('order/list')"
>
<img src="@/static/images/layout/icon-order.png" />
<img src="~/assets/img/layout/icon-order.png" />
<span>我的订单</span>
</div>
<div class="header-wrap-content--line"></div>
<div class="header-wrap-content__common flex flex-middle">
<img src="@/static/images/layout/icon-phone.png" />
<img src="~/assets/img/layout/icon-phone.png" />
<span>下载app</span>
</div>
</div>
@ -105,8 +105,8 @@ export default {
...mapState(["userInfo", "token"]),
menuIcon() {
return this.menuVisible
? require("@/static/images/layout/icon-up-light.png")
: require("@/static/images/layout/icon-up.png");
? require("~/assets/img/layout/icon-up-light.png")
: require("~/assets/img/layout/icon-up.png");
},
},
methods: {

@ -6,7 +6,7 @@
<div class="flex flex-middle">
<img
class="bar-header-wrap__logo"
src="@/static/images/layout/logo-sticky.png"
src="~/assets/img/layout/logo-sticky.png"
/>
<el-menu
:default-active="tabPath"
@ -22,9 +22,9 @@
</el-menu>
</div>
<div class="bar-header-wrap__icons flex flex-middle">
<img src="@/static/images/layout/icon-search-sticky.png" />
<img src="~/assets/img/layout/icon-search-sticky.png" />
<div class="header-wrap-icons__shop">
<img src="@/static/images/layout/icon-shop-sticky.png" />
<img src="~/assets/img/layout/icon-shop-sticky.png" />
<span class="">3</span>
</div>
<div v-if="token" class="header-wrap-icons__login">
@ -48,7 +48,7 @@
<div class="bar-header-box__wrap flex flex-between flex-middle">
<img
class="header-box-wrap__logo"
src="@/static/images/layout/logo.png"
src="~/assets/img/layout/logo.png"
/>
<div class="header-box-wrap__right flex flex-middle">
<div class="box-wrap-right__search flex">
@ -62,14 +62,14 @@
class="search-icon flex flex-center flex-middle"
@click="onSearch"
>
<img src="@/static/images/layout/icon-search.png" />
<img src="~/assets/img/layout/icon-search.png" />
</div>
</div>
<div
class="box-wrap-right__cart flex flex-middle"
@click="onJumpCart"
>
<img src="@/static/images/layout/icon-shop.png" />
<img src="~/assets/img/layout/icon-shop.png" />
<span>购物车</span>
<div class="wrap-right-cart__tip">3</div>
</div>
@ -83,7 +83,7 @@
@mouseleave="handleCategoryChange(false)"
>
<div class="tab-category__label flex flex-center flex-middle">
<img src="@/static/images/layout/icon-category.png" />
<img src="~/assets/img/layout/icon-category.png" />
<span>热门分类</span>
</div>
<div

@ -43,7 +43,8 @@ export default {
'@/plugins/element-ui',
'@/plugins/axios',
'@plugins/axiosTk.js',
'@plugins/vue-inject.js'
'@plugins/vue-inject.js',
'@/plugins/v-distpicker',
],
// Auto import components: https://go.nuxtjs.dev/config-components
@ -53,6 +54,10 @@ export default {
buildModules: [
],
build: {
vendor: ['v-distpicker']
},
styleResources: {
scss: '@/assets/scss/global.scss'
},

@ -21,6 +21,7 @@
"element-ui": "^2.15.8",
"js-util-all": "^1.0.6",
"nuxt": "^2.15.8",
"v-distpicker": "^1.2.13",
"vue": "^2.6.14",
"vue-server-renderer": "^2.6.14",
"vue-template-compiler": "^2.6.14"

@ -6,9 +6,25 @@
* @Description: file content
-->
<template>
<div class="account">
<div class="account--nav">左侧栏</div>
<nuxt-child class="account--main" />
<div class="account flex">
<div class="account-nav-wrap flex flex-column flex-center flex-middle">
<ul
v-for="(item, index) in navTabs"
:key="index"
class="account-nav-wrap__ul"
>
<div class="nav-wrap-ul__title">{{ item.label }}</div>
<li
class="nav-wrap-ul__li"
:class="{ 'nav-wrap-ul__li--light': itemChild.value === $route.path }"
v-for="itemChild in item.list"
:key="itemChild.value"
>
<nuxt-link :to="itemChild.value"> {{ itemChild.label }}</nuxt-link>
</li>
</ul>
</div>
<nuxt-child class="account-main-wrap" />
</div>
</template>
<script>
@ -19,23 +35,23 @@ export default {
navTabs: [
{
label: "个人中心",
childrens: [
{ label: "我的主页", value: "/home" },
{ label: "消息通知", value: "/message" },
list: [
{ label: "我的主页", value: "/account/home" },
{ label: "消息通知", value: "/account/message" },
],
},
{
label: "订单中心",
childrens: [
{ label: "我的订单", value: "/order/lsit" },
{ label: "售后订单", value: "/order/saleAfter" },
list: [
{ label: "我的订单", value: "/account/order/list" },
{ label: "售后订单", value: "/account/order/saleAfter/list" },
],
},
{
label: "账户管理",
childrens: [
{ label: "个人资料", value: "/userInfo" },
{ label: "收货地址", value: "/address" },
list: [
{ label: "个人资料", value: "/account/userInfo" },
{ label: "收货地址", value: "/account/address" },
],
},
],
@ -46,15 +62,46 @@ export default {
<style lang="scss" scoped>
.account {
@include layout-box;
padding: 30px 0;
margin: 0 auto;
display: flex;
&--nav {
padding: 40px 0;
background: #ffffff;
.account-nav-wrap {
width: 170px;
height: 300px;
height: 402px;
border: 1px solid #ddd;
border-radius: 4px;
margin-right: 30px;
font-size: 14px;
.account-nav-wrap__ul {
&:last-child {
margin-bottom: 0;
}
margin-bottom: 30px;
.nav-wrap-ul__title {
font-size: 16px;
color: #333333;
margin-bottom: 12px;
}
.nav-wrap-ul__li--light {
a {
color: #ff875b !important;
}
}
.nav-wrap-ul__li {
margin-bottom: 14px;
a {
color: #666666;
}
cursor: pointer;
&:hover {
a {
color: #ff875b;
}
}
&:last-child {
margin-bottom: 0;
}
}
}
}
&--main {
flex: 1;

@ -7,17 +7,14 @@
-->
<template>
<div>我是个人中心首页</div>
<div class="account-home"></div>
</template>
<script>
export default {
data(){
return {
}
}
}
name: "AccountHome",
data() {
return {};
},
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

@ -21,7 +21,7 @@
<div class="main__preview-control">
<img
class="main__preview-control--left"
src="~/static/images/goods/left.png"
src="~/assets/img/goods/left.png"
alt="左侧切换"
@click="onImgLeft"
/>
@ -44,7 +44,7 @@
</div>
<img
class="main__preview-control--right"
src="~/static/images/goods/right.png"
src="~/assets/img/goods/right.png"
alt="右侧切换"
@click="onImgRight"
/>
@ -68,7 +68,7 @@
>
<img
class="msg-icon"
src="~/static/images/goods/more.png"
src="~/assets/img/goods/more.png"
alt="服务"
/>
</div>
@ -119,16 +119,17 @@
</div>
</template>
<script>
import BsAddress from "@/components/BsAddress.vue";
import UiMoney from "@/components/UiMoney.vue";
import UiButton from "@/components/UiButton.vue";
import UiGoodsItem from "@/components/UiGoodsItem.vue";
import {
ApiGetGoodsDetail,
ApiGetGoodsSkus,
ApiGetRecommendedGoodsList,
} from "@/plugins/api/goods";
import UiGoodsItem from "@/components/UiGoodsItem.vue";
export default {
componetns: { UiMoney, UiButton, UiGoodsItem },
componetns: { UiMoney, UiButton, UiGoodsItem, BsAddress },
data() {
return {
curBuyNum: 1,
@ -301,8 +302,7 @@ export default {
}
}
.main {
width: 1200px;
margin: 0 auto;
@include layout-box;
&__preview {
width: 456px;
margin-right: 30px;
@ -444,6 +444,13 @@ export default {
margin-bottom: 6px;
border-color: #ccc;
}
.attr-item__active {
border: 1px solid #FF512B;
}
.attr-item__disabled {
color: #999999;
background: #eeeeee;
}
}
}
}
@ -492,10 +499,4 @@ export default {
color: #666666;
}
}
.attr-item__active {
background: red !important;
}
.attr-item__disabled {
background: cyan !important;
}
</style>

@ -144,8 +144,7 @@ export default {
}
.main {
width: 1200px;
margin: 0 auto;
@include layout-box;
padding-top: 14px;
padding-bottom: 60px;

@ -4,22 +4,22 @@
<div class="sort-img-box">
<img
v-if="sortType === 0 || sortType === 1"
src="~/static/images/goods/sort-t1.png"
src="~/assets/img/goods/sort-t1.png"
alt="sort"
/>
<img
v-if="sortType === 2"
src="~/static/images/goods/sort-t2.png"
src="~/assets/img/goods/sort-t2.png"
alt="sort"
/>
<img
v-if="sortType === 0 || sortType === 2"
src="~/static/images/goods/sort-b1.png"
src="~/assets/img/goods/sort-b1.png"
alt="sort"
/>
<img
v-if="sortType === 1"
src="~/static/images/goods/sort-b2.png"
src="~/assets/img/goods/sort-b2.png"
alt="sort"
/>
</div>

@ -2,7 +2,7 @@ import Vue from "vue";
import { TOKEN_KEY } from "@/constants";
const injectOptions = {
// 是否需要登录拦截
// 是否需要登录拦截,如果未登录,会默认唤起登录弹窗
$isLoginValidate() {
if (this.$cookies.get(TOKEN_KEY)) {
return true;

Loading…
Cancel
Save