Merge branch 'sit-Carl' of gitee.com:carl_Ming_1/smart-admin into sit-Leung

This commit is contained in:
Admin 2022-01-22 07:24:35 +00:00 committed by Gitee
commit 791bca1277
6 changed files with 793 additions and 360 deletions

View File

@ -73,9 +73,7 @@ export const postCourseId = (productCode,buyCount,memberId, mobile,productImg,pr
* 是否存在购物车 * 是否存在购物车
*/ */
export const isexistCart = (id, pet,address) => { export const isexistCart = (id, pet,address) => {
var data = { var data = { }
memberId: id,
}
return fetch('getCartProductInfo?memberId='+id,data,'POST') return fetch('getCartProductInfo?memberId='+id,data,'POST')
} }

View File

@ -1,6 +1,6 @@
/*Body*/ /*Body*/
body{ body {
font-family: DINPro,'PingFang SC',miui,'Hiragino Sans GB','Microsoft Yahei',sans-serif; font-family: DINPro, 'PingFang SC', miui, 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
line-height: 1.5; line-height: 1.5;
color: #666; color: #666;
} }
@ -14,31 +14,33 @@ body{
.fade-leave-active { .fade-leave-active {
opacity: 0; opacity: 0;
} }
.ts-no-data{
.ts-no-data {
text-align: center; text-align: center;
margin:3rem 0; margin: 3rem 0;
} }
.ts-mask{
width:100%; .ts-mask {
height:100%; width: 100%;
height: 100%;
position: fixed; position: fixed;
top:0; top: 0;
left:0; left: 0;
display:flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index:99; z-index: 99;
.ts-mask-bg{ .ts-mask-bg {
background-color:#000; background-color: #000;
opacity:.6; opacity: .6;
width:100%; width: 100%;
height:100%; height: 100%;
z-index:0; z-index: 0;
position:absolute; position: absolute;
left:0; left: 0;
top:0; top: 0;
} }
} }
input[type=checkbox]{ input[type=checkbox]{
@ -77,24 +79,25 @@ label {
background-size: contain; background-size: contain;
height: 3.12rem; height: 3.12rem;
animation: rolling 4s infinite; animation: rolling 4s infinite;
-webkit-animation:rolling 4s infinite; -webkit-animation: rolling 4s infinite;
} }
@keyframe rolling @keyframe rolling {
{ from {
from{
transform: rotateZ(0deg); transform: rotateZ(0deg);
} }
to{
to {
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
@-webkit-keyframes rolling
{ @-webkit-keyframes rolling {
from{ from {
transform: rotateZ(0deg); transform: rotateZ(0deg);
} }
to{
to {
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
@ -103,8 +106,9 @@ label {
.fade-leave-active { .fade-leave-active {
transition: opacity 0.5s; transition: opacity 0.5s;
} }
//用户光点 //用户光点
.rc-screen-reader{ .rc-screen-reader {
width: 0.81rem; width: 0.81rem;
height: 0.81rem; height: 0.81rem;
border-radius: 50%; border-radius: 50%;
@ -116,42 +120,48 @@ label {
width: 0.37rem; width: 0.37rem;
height: 0.37rem; height: 0.37rem;
} }
img, picture {
img,
picture {
display: block; display: block;
max-width: 100%; max-width: 100%;
height: auto; height: auto;
} }
.rc-main { .rc-main {
padding-left:1.25rem; padding-left: 1.25rem;
padding-right:1.25rem; padding-right: 1.25rem;
box-sizing:border-box; box-sizing: border-box;
margin-left:auto; margin-left: auto;
margin-right:auto; margin-right: auto;
} }
.ts-remove { .ts-remove {
text-decoration: line-through; text-decoration: line-through;
} }
.ts-product-list{
.ts-product-list {
text-align: center; text-align: center;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-evenly; justify-content: space-evenly;
&:after{
} &:after {}
li{
li {
border: 1px solid #D7D7D7; border: 1px solid #D7D7D7;
display: inline-flex; display: inline-flex;
border-radius: 4px; border-radius: 4px;
flex-direction: column; flex-direction: column;
max-width:10rem; max-width: 10rem;
.rc-column
{ .rc-column {
text-align:center; text-align: center;
padding:0 1rem; padding: 0 1rem;
box-sizing: border-box; box-sizing: border-box;
span{
height:2.75rem; span {
height: 2.75rem;
font-size: 1rem; font-size: 1rem;
text-overflow: -o-ellipsis-lastline; text-overflow: -o-ellipsis-lastline;
overflow: hidden; overflow: hidden;
@ -162,9 +172,10 @@ img, picture {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
word-break: break-all; word-break: break-all;
white-space: normal; white-space: normal;
color:#E2001A; color: #E2001A;
} }
i{
i {
font-style: normal; font-style: normal;
font-size: 1.125rem; font-size: 1.125rem;
margin-top: .5rem; margin-top: .5rem;
@ -181,22 +192,26 @@ img, picture {
margin: 0 auto; margin: 0 auto;
height: auto; height: auto;
} }
.active{
.active {
color: #E2001A; color: #E2001A;
cursor: pointer; cursor: pointer;
} }
.unactive{
color:#999999; .unactive {
color: #999999;
cursor: pointer; cursor: pointer;
} }
} }
.rc-container { .rc-container {
height: 100%; height: 100%;
max-width: 1400px; max-width: 1400px;
background-color: #fff; background-color: #fff;
margin: auto; margin: auto;
} }
.ts-standard-btn{
.ts-standard-btn {
font-style: normal; font-style: normal;
width: 8.125rem; width: 8.125rem;
height: 2.5rem; height: 2.5rem;
@ -209,22 +224,25 @@ img, picture {
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
background: #E2001A; background: #E2001A;
&.center{
margin-left:auto; &.center {
margin-right:auto; margin-left: auto;
margin-right: auto;
} }
&.ts-standard-btn--two{
&.ts-standard-btn--two {
background-color: transparent; background-color: transparent;
color: #e2001a; color: #e2001a;
border-color: #e2001a; border-color: #e2001a;
} }
&.ts-standard-btn--max-width{
width:100%; &.ts-standard-btn--max-width {
width: 100%;
} }
} }
.rc-mubu{ .rc-mubu {
height: 100%; height: 100%;
background: #333333; background: #333333;
opacity: 0.6; opacity: 0.6;
@ -233,54 +251,62 @@ img, picture {
width: 100%; width: 100%;
z-index: 8; z-index: 8;
} }
.ts-scrollable-container{
.ts-scrollable-container {
display: flex; display: flex;
align-items: center; align-items: center;
h2{
margin:0; h2 {
margin: 0;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.ts-scrollable{
overflow-y:hidden; .ts-scrollable {
overflow-x:auto; overflow-y: hidden;
overflow-x: auto;
white-space: nowrap; white-space: nowrap;
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: nowrap; flex-wrap: nowrap;
text-align: center; text-align: center;
width: 86%; width: 86%;
li{
li {
border-radius: 100px; border-radius: 100px;
flex-shrink:0; flex-shrink: 0;
} }
} }
.active{
.active {
color: #E2001A; color: #E2001A;
cursor: pointer; cursor: pointer;
border: 2px solid #E2001A; border: 2px solid #E2001A;
} }
.unactive{
color:#999999; .unactive {
color: #999999;
cursor: pointer; cursor: pointer;
border: 2px solid #d7d7d7; border: 2px solid #d7d7d7;
} }
} }
.online{ .online {
width:100%; width: 100%;
background:#d7d7d7; background: #d7d7d7;
margin-top:1.5rem; margin-top: 1.5rem;
height:.06rem; height: .06rem;
&.bold{
height:.32rem; &.bold {
background:#f6f6f6; height: .32rem;
} background: #f6f6f6;
} }
}
/*Body end*/ /*Body end*/
/* 头部 */ /* 头部 */
.rc-fixright{ .rc-fixright {
width: 3.75rem; width: 3.75rem;
height: auto; height: auto;
position: fixed; position: fixed;
@ -296,7 +322,8 @@ img, picture {
background-color: white; background-color: white;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
li{
li {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -304,21 +331,25 @@ img, picture {
align-items: center; align-items: center;
margin-top: 1.125rem; margin-top: 1.125rem;
} }
li:last-child{
li:last-child {
margin-bottom: 0.2rem; margin-bottom: 0.2rem;
} }
} }
img{
img {
width: 1.25rem; width: 1.25rem;
height: auto; height: auto;
display: block; display: block;
} }
span{
span {
font-size: 0.12rem; font-size: 0.12rem;
} }
.tuntop{
.tuntop {
width: 100%; width: 100%;
height:4.125rem; height: 4.125rem;
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.1); box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.1);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -328,46 +359,47 @@ img, picture {
} }
} }
.ts-max-width--460{ .ts-max-width--460 {
max-width: 460px; max-width: 460px;
margin-left: auto!important; margin-left: auto !important;
margin-right: auto!important; margin-right: auto !important;
} }
.ts-standard-input{ .ts-standard-input {
background: #F6F6F6; background: #F6F6F6;
width: 100%; width: 100%;
height: 3rem; height: 3rem;
border-radius: 4px; border-radius: 4px;
padding:.875rem 0 .875rem 1rem; padding: .875rem 0 .875rem 1rem;
&::-webkit-input-placeholder { &::-webkit-input-placeholder {
text-align: left; text-align: left;
} }
&.ts-standard-input--two{
} &.ts-standard-input--two {}
} }
.ts-right-arr { .ts-right-arr {
font-style: normal; font-style: normal;
line-height: 22px; line-height: 22px;
color: #E2001A; color: #E2001A;
font-weight:bold; font-weight: bold;
&.ts-right-arr--two:after{
&.ts-right-arr--two:after {
content: " "; content: " ";
width: .5rem; width: .5rem;
height: 1rem; height: 1rem;
background: url(../image/rc-left.png) no-repeat left top; background: url(../image/rc-left.png) no-repeat left top;
background-size: contain; background-size: contain;
display: block; display: block;
position:absolute; position: absolute;
right:0; right: 0;
top:.25rem; top: .25rem;
} }
} }
/* 手机端 */ /* 手机端 */
@media screen and (max-width: 768px) @media screen and (max-width: 768px) {
{
html { html {
//font-size:100px; //font-size:100px;
} }
@ -383,100 +415,114 @@ img, picture {
left:7%; left:7%;
top:22%; top:22%;
} }
.rc-main{
width:100%; .rc-main {
width: 100%;
} }
.rc-top{
.rc-top {
margin-top: 90px; margin-top: 90px;
} }
.rc-list__header {
} .rc-list__header {}
.ts-right-arr { .ts-right-arr {
border-bottom:1px solid #E1001A; border-bottom: 1px solid #E1001A;
padding-bottom:2px; padding-bottom: 2px;
} }
.rc-home-header{
.rc-home-header {
width: 100%; width: 100%;
.rc-main
{ .rc-main {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
height: 70px; height: 70px;
background-color: #fff; background-color: #fff;
.rc-center{
.rc-center {
display: none; display: none;
} }
} }
.c-left img{
.c-left img {
width: 19px; width: 19px;
height: 14px; height: 14px;
display: block; display: block;
} }
.c-right img{
.c-right img {
width: 97px; width: 97px;
height: 35px; height: 35px;
display: block; display: block;
} }
.rc-search img{
.rc-search img {
width: 19px; width: 19px;
height: 19px; height: 19px;
display: block; display: block;
} }
&.fixed{
position:fixed; &.fixed {
position: fixed;
top: 0; top: 0;
left: 0; left: 0;
z-index:3; z-index: 3;
} }
} }
.ts-scrollable-container{
margin-bottom:1.25rem; .ts-scrollable-container {
&:last-child{ margin-bottom: 1.25rem;
margin-bottom:0;
&:last-child {
margin-bottom: 0;
} }
h2{
h2 {
font-size: 16px; font-size: 16px;
margin-right:.1rem; margin-right: .1rem;
} }
.ts-scrollable{
li{ .ts-scrollable {
li {
width: 6rem; width: 6rem;
overflow: hidden; overflow: hidden;
padding: 0 0.62rem; padding: 0 0.62rem;
height: 1.625rem; height: 1.625rem;
margin-left: .5rem; margin-left: .5rem;
font-size:.75rem; font-size: .75rem;
text-overflow:ellipsis; text-overflow: ellipsis;
white-space:nowrap; white-space: nowrap;
line-height: 1.625rem; line-height: 1.625rem;
} }
&::-webkit-scrollbar{
display:none; &::-webkit-scrollbar {
display: none;
} }
} }
} }
} }
/* pc端 */
@media screen and (min-width: 769px)
{
/deep/.van-tabs__wrap /* pc端 */
{ @media screen and (min-width: 769px) {
/deep/.van-tabs__wrap {
max-width: 768px; max-width: 768px;
margin: 0 auto; margin: 0 auto;
} }
html { html {
font-size:16px; font-size: 16px;
} }
.rc-top{
.rc-top {
margin-top: 124px; margin-top: 124px;
} }
.ts-product-list{
.ts-product-list {
text-align: left; text-align: left;
//display:block; //display:block;
display:flex; display:flex;
@ -485,77 +531,92 @@ img, picture {
min-width:18.75rem; min-width:18.75rem;
width:22.8vw; width:22.8vw;
box-sizing: border-box; box-sizing: border-box;
.rc-column{
span{ .rc-column {
font-size:1.875rem; span {
font-size: 1.875rem;
height: 5.2rem; height: 5.2rem;
} }
} }
&:nth-child(4n+1){
margin-left:0; &:nth-child(4n+1) {
margin-left: 0;
} }
&:nth-child(4n){
&:nth-child(4n) {
//margin-right:0; //margin-right:0;
} }
} }
img{
width:100%; img {
max-width:320px; width: 100%;
min-width:160px; max-width: 320px;
min-width: 160px;
} }
} }
.ts-right-arr { .ts-right-arr {
cursor: pointer; cursor: pointer;
border-bottom : unset; border-bottom: unset;
padding-right:1rem; padding-right: 1rem;
position:relative; position: relative;
&:after{
&:after {
content: " "; content: " ";
width: .5rem; width: .5rem;
height: 1rem; height: 1rem;
background: url(../image/arr-right-red.png) no-repeat left top; background: url(../image/arr-right-red.png) no-repeat left top;
background-size: contain; background-size: contain;
display: block; display: block;
position:absolute; position: absolute;
right:0; right: 0;
top:.25rem; top: .25rem;
} }
} }
.rc-main { .rc-main {
width:100%; width: 100%;
max-width:1400px; max-width: 1400px;
} }
.rc-list--inline:not([role=tablist]):not([role=menubar]) { .rc-list--inline:not([role=tablist]):not([role=menubar]) {
-ms-flex-wrap: wrap; -ms-flex-wrap: wrap;
flex-wrap: wrap; flex-wrap: wrap;
} }
.layout-container, .rc-layout-container {
.layout-container,
.rc-layout-container {
margin-left: -1rem; margin-left: -1rem;
margin-right: -1rem; margin-right: -1rem;
} }
.rc-fixright{
width:5.5rem; .rc-fixright {
width: 5.5rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
ul{
width:100%; ul {
width: 100%;
height: 100%; height: 100%;
li{
li {
margin-top: .5rem; margin-top: .5rem;
height:4.125rem; height: 4.125rem;
cursor: pointer; cursor: pointer;
img{
width:22px; img {
height:auto; width: 22px;
height: auto;
} }
} }
} }
} }
.rc-home-header{
height:120px ; .rc-home-header {
.rc-main height: 120px;
{
.rc-main {
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
// position: fixed; // position: fixed;
@ -566,13 +627,13 @@ img, picture {
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
height: 120px; height: 120px;
ul
{ ul {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 20px; margin-bottom: 20px;
li
{ li {
margin-right: 25px; margin-right: 25px;
color: #666666; color: #666666;
cursor: pointer; cursor: pointer;
@ -580,88 +641,96 @@ img, picture {
} }
} }
} }
.c-left{
.c-left {
display: none; display: none;
} }
.rc-search{
.rc-search {
display: none; display: none;
} }
.c-left img
{ .c-left img {
width: 19px; width: 19px;
height: 14px; height: 14px;
display: block; display: block;
} }
.c-right img{
.c-right img {
width: 120px; width: 120px;
height: 45px; height: 45px;
display: block; display: block;
} }
} }
.ts-scrollable-container .ts-scrollable-container {
{ margin-top: 1.25rem;
margin-top:1.25rem;
&:last-child{ &:last-child {
margin-bottom:0; margin-bottom: 0;
} }
h2{
font-size:20px; h2 {
padding-bottom:1rem; font-size: 20px;
padding-bottom: 1rem;
} }
.ts-scrollable
{ .ts-scrollable {
padding-bottom:1rem; padding-bottom: 1rem;
scrollbar-width: thin; scrollbar-width: thin;
li
{ li {
margin-left: 30px; margin-left: 30px;
width: 8.125rem; width: 8.125rem;
height: 2.5rem; height: 2.5rem;
//line-height: 40px; //line-height: 40px;
font-size: .875rem; font-size: .875rem;
padding:.375rem; padding: .375rem;
} }
&::-webkit-scrollbar{ &::-webkit-scrollbar {
height: 6px; height: 6px;
width:50%; width: 50%;
background:transparent; background: transparent;
} }
&::-webkit-scrollbar-thumb{
background-color:#d7d7d7; &::-webkit-scrollbar-thumb {
border-radius:10px; background-color: #d7d7d7;
width:50%; border-radius: 10px;
width: 50%;
} }
&::-webkit-scrollbar-track{
&::-webkit-scrollbar-track {
//background-color:#ddd; //background-color:#ddd;
background-color:transparent; background-color: transparent;
} }
&::-webkit-scrollbar-button{
background:unset; &::-webkit-scrollbar-button {
background: unset;
} }
/* */ /* */
} }
} }
} }
@media (max-width: 960px) @media (max-width: 960px) {
{
.rc-lg-up { .rc-lg-up {
display: none!important; display: none !important;
} }
} }
@media (min-width: 1024px)
{ @media (min-width: 1024px) {
.rc-xl-down { .rc-xl-down {
display: none!important; display: none !important;
} }
} }
@media screen and (min-width: 769px) and (max-width: 1370px) @media screen and (min-width: 769px) and (max-width: 1370px)
{ {
} }
.rc_contline { .rc_contline {
border-bottom: 3px solid #f6f6f6; border-bottom: 3px solid #f6f6f6;
height: 0px; height: 0px;
@ -716,27 +785,39 @@ img, picture {
.tr { .tr {
text-align: right; text-align: right;
} }
.el-dialog{
.diallog_width {
.el-dialog {
width: 90%; width: 90%;
max-width: 440px; max-width: 920px;
}
} }
#tns2-iw{ height: 90px;}
.rc-carousel:not(.rc-carousel--loaded){visibility:visible!important} #tns2-iw {
height: 90px;
}
.rc-carousel:not(.rc-carousel--loaded) {
visibility: visible !important
}
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.el-message-box{ .el-message-box {
width: 300px; width: 300px;
} }
.el-dialog{
.el-dialog {
width: 90%; width: 90%;
} }
.diallog_width{
.el-dialog{ .diallog_width {
.el-dialog {
width: 100%; width: 100%;
} }
.el-dialog__title{
.el-dialog__title {
color: #e1001a; color: #e1001a;
} }
}
} }
}

View File

@ -0,0 +1,281 @@
<template>
<div>
<div class="usercontend">
<div class="rc-max-width--xl">
<h2>{{ title }}</h2>
<div class="rc-max-width--xl rc-people">
<span>收货人:</span>
<input
type="text"
placeholder="请输入收货人姓名"
v-model="userpeople"
/>
</div>
<div class="rc-max-width--xl rc-phone">
<span>手机号码:</span>
<input
type="text"
placeholder="请输入11位手机号码"
v-model="tel"
:error-message="usertel"
/>
</div>
<div class="rc-max-width--xl rc-address">
<span>所在地区:</span>
<!-- <input type="text" placeholder="请选择所在地区"> -->
<addressInput
@getmenu="onGetMenu"
@closeDialog="handleClose1"
:dialogInfo1="dialogInfo1"
:defaultValues="defaultValues"
></addressInput>
</div>
<div class="rc-max-width--xl rc-useaddress">
<span>详细地址:</span>
<!-- <input
type="text"
placeholder="小区、门牌号等"
class="userinput"
/> -->
<textarea
rows="10"
v-model="alladdress"
cols="30"
placeholder="请输入详细地址"
></textarea>
</div>
</div>
</div>
<div class="rc-button">
<span @click="openclose()">取消</span>
<em @click="register()">确认</em>
</div>
<!-- <div class="rc-button">
<div class="rc-footbutton" @click="onAdd()">
<span>新增收货地址</span>
</div>
</div> -->
</div>
</template>
<script>
import addressInput from "~/components/addressInput.vue";
import { memberAddress } from "../ajax/getData";
export default {
data() {
return {
title: "新增收货地址",
defaultValues: [],
chosenAddressId: "1",
usermessage: null,
checked: true,
tel: "",
id: "",
alladdress: "",
userid: null,
usermessage: null,
dialogInfo1: false,
userpeople: "",
provinceId: "",
cityId: "",
districtId: "",
list: [
{
id: 1,
name: "张三",
tel: "13000000000",
address: "浙江省杭州市西湖区文三路 138 号",
isDefault: true,
},
{
id: 2,
name: "李四",
tel: "1310000000",
address: "浙江省杭州市拱墅区莫干山路 50 号",
},
{
id: 3,
name: "李四",
tel: "1310000000",
address: "浙江省杭州市拱墅区莫干山路 50 号",
},
],
};
},
props: ["editAddressData"],
methods: {
onGetMenu(values) {
// console.log(values, +"111111");
// let user = values[2].id;
// user = user.split("-");
if (this.id == "") {
this.provinceId = values[0].id;
this.cityId = values[1].id;
this.districtId = values[2].id;
} else {
let user = values[2].id;
user = user.split("-");
this.provinceId = user[0];
this.cityId = user[1];
this.districtId = user[2];
}
},
handleClose1() {
this.dialogInfo1 = false;
},
register() {
console.log(this.tel);
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
this.$message({
type: "warning",
message: "手机号码输入有误",
});
return;
} else if (this.alladdress === "") {
this.$message({
type: "warning",
message: "请输入详细地址",
});
return;
} else if (this.userpeople === "") {
this.$message({
type: "warning",
message: "请输入姓名",
});
return;
} else if (this.provinceId === "") {
this.$message({
type: "warning",
message: "请选择省区",
});
return;
} else if (this.cityId === "") {
this.$message({
type: "warning",
message: "请选择市区",
});
return;
} else if (this.districtId === "") {
this.$message({
type: "warning",
message: "请选择详细的区域",
});
return;
} else {
this.editaddress();
}
},
openclose() {
this.$emit("isClose", false);
},
//
async editaddress(item) {
let useradd = {
memberId: this.userid,
detailAddress: this.alladdress,
recipient: this.userpeople,
recipientPhone: this.tel,
provinceId: this.provinceId,
cityId: this.cityId,
districtId: this.districtId,
};
if (this.id != "") useradd["id"] = this.id;
let saveType = this.editAddressData.saveType ? "update" : "add";
let res = await memberAddress(saveType, useradd);
if (res.msg == "SUCCESS") {
let typemess = saveType == "update" ? "修改地址成功" : "地址添加成功";
this.$message({
type: "warning",
message: typemess,
});
this.$emit("isClose", false);
} else {
this.$message({
type: "warning",
message: res.msg,
});
}
},
editInfo() {
if (this.editAddressData.saveType == "edit") {
this.title = "修改收货地址";
this.tel = this.editAddressData.tel;
this.alladdress = this.editAddressData.detailAddress;
this.userid = this.editAddressData.memberId;
this.userpeople = this.editAddressData.name;
this.provinceId = this.editAddressData.provinceId;
this.cityId = this.editAddressData.cityId;
this.districtId = this.editAddressData.districtId;
this.defaultValues = [
{
id: this.provinceId,
name: this.editAddressData.provinceName,
},
{
id: this.cityId,
name: this.editAddressData.cityName,
},
{
id: this.districtId,
name: this.editAddressData.districtName,
},
];
}
},
},
components: {
addressInput,
},
computed: {
usertel() {
if (this.tel === "") {
return "";
} else if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel)) {
return "手机号格式错误";
} else {
return "";
}
},
},
created() {
this.title =
this.editAddressData.saveType == "edit" ? "修改收货地址" : "新增收货地址";
this.tel = this.editAddressData.tel;
this.alladdress = this.editAddressData.detailAddress;
this.userid = this.editAddressData.memberId;
this.userpeople = this.editAddressData.name;
this.provinceId = this.editAddressData.provinceId;
this.cityId = this.editAddressData.cityId;
this.districtId = this.editAddressData.districtId;
this.defaultValues = [
{
id: this.provinceId,
name: this.editAddressData.provinceName,
},
{
id: this.cityId,
name: this.editAddressData.cityName,
},
{
id: this.districtId,
name: this.editAddressData.districtName,
},
];
},
mounted() {
this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
this.userid = this.usermessage.data.id;
this.id = this.editAddressData.id;
},
};
</script>
<style lang="less" scoped >
@import url("../assets/css/global.less");
@import url("../assets/css/addaddress.less");
</style>

View File

@ -184,6 +184,8 @@ ul li ol li em strong i {
.rc-image { .rc-image {
border: 1px solid #d8d8d8; border: 1px solid #d8d8d8;
margin-right: 20px; margin-right: 20px;
width: 96px;
height: 96px;
img { img {
width: 96px; width: 96px;
@ -375,17 +377,34 @@ ul li ol li em strong i {
.diallog_width { .diallog_width {
width: 100%; width: 100%;
max-width: 440px; max-width: 920px;
margin: 0 auto; margin: 0 auto;
.el-dialog {
width: 100%;
}
} }
.el-dialog__header{ .el-dialog__header {
color: #e1001a; color: #e1001a;
} }
//手机端 //手机端
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.settlement { .popnewaddr{
padding-top: 0; position: absolute;
bottom: -14px;
left: 0;
width: 100%;
.btn{
display: block;
background: #e2001a;
line-height: 48px;
text-align: center;
color: white;
font-size: 16px;
border-radius: 30px;
}
} }
.diallog_width { .diallog_width {
width: 100%; width: 100%;
@ -401,17 +420,44 @@ ul li ol li em strong i {
} }
.pop_list { .pop_list {
p{ padding: 0; margin: 0; line-height: 180%;} p {
padding: 0;
margin: 0;
line-height: 180%;
}
.mypersonal { .mypersonal {
border-bottom: 1px solid #d8d8d8; border-bottom: 1px solid #d8d8d8;
padding: 15px 0; padding: 15px 0;
} }
input,.el-icon-edit{
input,
.el-icon-edit {
margin-top: 20px; margin-top: 20px;
} }
} }
.settlement {
.rc-main { .rc-main {
padding-top: 0;
.rc-usermain {
h3,
p {
padding: 0;
margin: 0;
}
.rc-usercenter h3 {
margin-top: 0;
}
}
}
.rc-main {
width: 100%;
.address-list { .address-list {
display: contents; display: contents;
@ -463,6 +509,7 @@ ul li ol li em strong i {
flex-direction: row; flex-direction: row;
align-items: self-end; align-items: self-end;
position: fixed; position: fixed;
left: 0;
bottom: 0; bottom: 0;
background: #fff; background: #fff;
width: 100%; width: 100%;
@ -470,5 +517,6 @@ ul li ol li em strong i {
} }
} }
} }
}
} }

View File

@ -1,8 +1,9 @@
<template> <template>
<div class="settlement"> <div class="settlement">
<Myheader></Myheader> <Myheader></Myheader>
<div class="rc-main">
<tabs></tabs> <tabs></tabs>
</div>
<div class="rc_contline"></div> <div class="rc_contline"></div>
<div class="rc-main"> <div class="rc-main">
<div class="address-list"> <div class="address-list">
@ -110,17 +111,16 @@
width="'100%" width="'100%"
title="选择收货地址" title="选择收货地址"
> >
<div class="tc dl_cont"> <div class="tc dl_cont" style="padding-bottom: 50px;position: relative;">
<div class="pop_list"> <div class="pop_list">
<el-row <el-row
class="mypersonal" class="mypersonal"
v-for="(item, index) in useraddress" v-for="(item, index) in useraddress"
:key="index" :key="index"
:class="item.isDefault ? 'active' : ''" :class="item.isDefault ? 'active' : ''"
@click="selectAddress(item)"
> >
<el-col :span="4" <el-col :span="4"
><input type="checkbox" v-model="item.checked" ><input type="checkbox" v-model="item.checked" @click="selectPopAddress(item)"
/></el-col> /></el-col>
<el-col :span="16" class="tl"> <el-col :span="16" class="tl">
<div > <div >
@ -130,9 +130,12 @@
<p> {{ item.address }}</p> <p> {{ item.address }}</p>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<i class="el-icon-edit"></i> <i @click="editAddress(item)" class="el-icon-edit"></i>
</el-col> </el-col>
</el-row> </el-row>
<div class="popnewaddr">
<span class="btn" @click="addAddress">新增收货地址</span>
</div>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
@ -143,7 +146,7 @@
import Myheader from "~/components/header.vue"; import Myheader from "~/components/header.vue";
import { userin, memberAddress, generateOrderWX } from "../../ajax/getData"; import { userin, memberAddress, generateOrderWX } from "../../ajax/getData";
import tabs from "@/components/tabs.vue"; import tabs from "@/components/tabs.vue";
import myAddress from "../address/address.vue"; import myAddress from "~/components/address.vue";
import itemMixin from "../../../smart-admin-web/src/components/main/components/side-menu/item-mixin"; import itemMixin from "../../../smart-admin-web/src/components/main/components/side-menu/item-mixin";
export default { export default {
@ -215,8 +218,12 @@ export default {
tel: item.recipientPhone, tel: item.recipientPhone,
detailAddress: item.detailAddress, detailAddress: item.detailAddress,
id: item.id, id: item.id,
city: item.cityName, cityId: item.cityId,
districtId: item.districtName, districtId: item.districtId,
provinceId:item.provinceId,
provinceName: item.provinceName,
cityName: item.cityName,
districtName: item.districtName,
saveType: "edit", saveType: "edit",
}; };
this.dialogAdd = true; this.dialogAdd = true;
@ -229,7 +236,20 @@ export default {
this.useraddress.forEach((item) => { this.useraddress.forEach((item) => {
if (item.id == cur.id) { if (item.id == cur.id) {
item.isDefault = true; item.isDefault = true;
item.checked=true
} else { } else {
item.checked=false
item.isDefault = false;
}
});
},
selectPopAddress(cur) {
this.useraddress.forEach((item) => {
if (item.id == cur.id) {
item.isDefault = true;
item.checked=true
} else {
item.checked=false
item.isDefault = false; item.isDefault = false;
} }
}); });

View File

@ -75,6 +75,9 @@ public class OrderController {
ordersEntity.setCouponCode(ordersEntitys.getCouponCode()); ordersEntity.setCouponCode(ordersEntitys.getCouponCode());
ordersEntity.setCouponName(ordersEntitys.getCouponName()); ordersEntity.setCouponName(ordersEntitys.getCouponName());
ordersEntity.setCouponId(ordersEntitys.getCouponId()); ordersEntity.setCouponId(ordersEntitys.getCouponId());
total_fee = total_fee + orderService.couponTotal(ordersEntitys.getCouponTypeId(),Double.parseDouble(ordersEntitys.getCouponAmount()),Double.parseDouble(ordersEntitys.getPayAmount()),ordersEntitys.getBuyCount());
}else{
total_fee = total_fee + Double.parseDouble(ordersEntitys.getPayAmount()) * ordersEntitys.getBuyCount() ;
} }
orderAddress.setAddressCityName(ordersEntitys.getOrderAddress().getAddressCityName()); orderAddress.setAddressCityName(ordersEntitys.getOrderAddress().getAddressCityName());
orderAddress.setAddressCountyName(ordersEntitys.getOrderAddress().getAddressCountyName()); orderAddress.setAddressCountyName(ordersEntitys.getOrderAddress().getAddressCountyName());
@ -84,7 +87,6 @@ public class OrderController {
orderAddress.setAddressProvinceName(ordersEntitys.getOrderAddress().getAddressProvinceName()); orderAddress.setAddressProvinceName(ordersEntitys.getOrderAddress().getAddressProvinceName());
productId.append(ordersEntitys.getProductCode()+","); productId.append(ordersEntitys.getProductCode()+",");
productName.append(ordersEntitys.getProductName()+","); productName.append(ordersEntitys.getProductName()+",");
total_fee = total_fee + orderService.couponTotal(ordersEntitys.getCouponTypeId(),Double.parseDouble(ordersEntitys.getCouponAmount()),Double.parseDouble(ordersEntitys.getPayAmount()),ordersEntitys.getBuyCount());
memberId = ordersEntitys.getMemberId(); memberId = ordersEntitys.getMemberId();
mobile = ordersEntitys.getPhoneNumber(); mobile = ordersEntitys.getPhoneNumber();
buyCount = buyCount + ordersEntitys.getBuyCount(); buyCount = buyCount + ordersEntitys.getBuyCount();
@ -136,6 +138,9 @@ public class OrderController {
ordersEntity.setCouponCode(ordersEntitys.getCouponCode()); ordersEntity.setCouponCode(ordersEntitys.getCouponCode());
ordersEntity.setCouponName(ordersEntitys.getCouponName()); ordersEntity.setCouponName(ordersEntitys.getCouponName());
ordersEntity.setCouponId(ordersEntitys.getCouponId()); ordersEntity.setCouponId(ordersEntitys.getCouponId());
total_fee = total_fee + orderService.couponTotal(ordersEntitys.getCouponTypeId(),Double.parseDouble(ordersEntitys.getCouponAmount()),Double.parseDouble(ordersEntitys.getPayAmount()),ordersEntitys.getBuyCount());
}else{
total_fee = total_fee + Double.parseDouble(ordersEntitys.getPayAmount()) * ordersEntitys.getBuyCount() ;
} }
orderAddress.setAddressCityName(ordersEntitys.getOrderAddress().getAddressCityName()); orderAddress.setAddressCityName(ordersEntitys.getOrderAddress().getAddressCityName());
orderAddress.setAddressCountyName(ordersEntitys.getOrderAddress().getAddressCountyName()); orderAddress.setAddressCountyName(ordersEntitys.getOrderAddress().getAddressCountyName());
@ -145,7 +150,7 @@ public class OrderController {
orderAddress.setAddressProvinceName(ordersEntitys.getOrderAddress().getAddressProvinceName()); orderAddress.setAddressProvinceName(ordersEntitys.getOrderAddress().getAddressProvinceName());
productId.append(ordersEntitys.getProductCode()+","); productId.append(ordersEntitys.getProductCode()+",");
productName.append(ordersEntitys.getProductName()+","); productName.append(ordersEntitys.getProductName()+",");
total_fee = total_fee + orderService.couponTotal(ordersEntitys.getCouponTypeId(),Double.parseDouble(ordersEntitys.getCouponAmount()),Double.parseDouble(ordersEntitys.getPayAmount()),ordersEntitys.getBuyCount());
memberId = ordersEntitys.getMemberId(); memberId = ordersEntitys.getMemberId();
mobile = ordersEntitys.getPhoneNumber(); mobile = ordersEntitys.getPhoneNumber();
buyCount = buyCount + ordersEntitys.getBuyCount(); buyCount = buyCount + ordersEntitys.getBuyCount();