mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 02:06:38 +08:00
Merge branch 'sit-Leung' into sit-jiamin-v2
This commit is contained in:
commit
fb61b06bde
@ -21,12 +21,10 @@ body {
|
||||
.fade-leave-active {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.ts-no-data {
|
||||
text-align: center;
|
||||
margin: 3rem 0;
|
||||
}
|
||||
|
||||
.ts-mask {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@ -38,7 +36,15 @@ body {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 99;
|
||||
|
||||
.ts-mask-close{
|
||||
position:absolute;
|
||||
top:1rem;
|
||||
right:1rem;
|
||||
width:1rem;
|
||||
height:1rem;
|
||||
background: url("../image/btn-close.png") center center no-repeat;
|
||||
background-size:contain;
|
||||
}
|
||||
.ts-mask-bg {
|
||||
background-color: #000;
|
||||
opacity: .6;
|
||||
@ -54,10 +60,11 @@ input[type=checkbox]{
|
||||
position:relative;
|
||||
cursor: pointer;
|
||||
border:none;
|
||||
border: 1px solid #d7d7d7;
|
||||
//border: 1px solid #d7d7d7;
|
||||
border-radius: 3px;
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
-webkit-appearance:none;
|
||||
&:before {
|
||||
top: 0;
|
||||
left: 0;
|
||||
@ -327,12 +334,12 @@ picture {
|
||||
border-radius: .25rem;
|
||||
z-index:11;
|
||||
ul{
|
||||
width: 60px;
|
||||
height: 181px;
|
||||
width: 3.75rem;
|
||||
height: 11.3rem;
|
||||
background-color: white;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
justify-content: space-between;
|
||||
li {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
@ -354,7 +361,7 @@ picture {
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 0.12rem;
|
||||
font-size: .75rem;
|
||||
}
|
||||
|
||||
.tuntop {
|
||||
@ -415,7 +422,7 @@ picture {
|
||||
}
|
||||
label {
|
||||
input[type=checkbox] {
|
||||
top:.25rem;
|
||||
top:0rem;
|
||||
}
|
||||
}
|
||||
.rc-header__nav--primary{
|
||||
@ -523,7 +530,12 @@ picture {
|
||||
max-width: 768px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
div[data-js-modal-menu] {
|
||||
display:none;
|
||||
}
|
||||
aside div[data-js-modal-menu] {
|
||||
display:block;
|
||||
}
|
||||
html {
|
||||
font-size: 16px;
|
||||
}
|
||||
@ -808,7 +820,11 @@ picture {
|
||||
margin: 0 auto;
|
||||
.el-dialog{
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
.el-dialog__body{
|
||||
max-height:50vh;
|
||||
overflow-x:hidden;
|
||||
overflow-y:auto;
|
||||
}
|
||||
}
|
||||
#tns2-iw {
|
||||
|
@ -20,6 +20,14 @@
|
||||
}
|
||||
.ts-position-identifier{
|
||||
|
||||
}
|
||||
.ts-mobile-player-container {
|
||||
video {
|
||||
width:100%;
|
||||
height:auto;
|
||||
position: relative;
|
||||
z-index:2;
|
||||
}
|
||||
}
|
||||
.ul-zhuan,.ul-dog{
|
||||
li{
|
||||
@ -83,6 +91,7 @@
|
||||
}
|
||||
li{
|
||||
margin-top:1.875rem;
|
||||
margin-left:0;
|
||||
}
|
||||
}
|
||||
.ts-banner-swiper-container{
|
||||
@ -211,9 +220,29 @@
|
||||
width: 100%;
|
||||
height:auto;
|
||||
display: block;
|
||||
video{
|
||||
max-width:100%;
|
||||
max-height:100%;
|
||||
position:relative;
|
||||
z-index:0;
|
||||
&:before{
|
||||
content:"";
|
||||
background:#000;
|
||||
opacity:.6;
|
||||
position:absolute;
|
||||
width:100%;
|
||||
height:100%;
|
||||
left:0;
|
||||
top:0;
|
||||
z-index:1;
|
||||
}
|
||||
&:after{
|
||||
content:"";
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
width:100%;
|
||||
height:100%;
|
||||
background:url("../image/btn-play.png") center center no-repeat;
|
||||
background-size:90px 90px;
|
||||
z-index:2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -225,19 +254,32 @@
|
||||
align-items: center;
|
||||
border: 1px solid #d7d7d7;
|
||||
border-radius:4px;
|
||||
img{
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
z-index:0;
|
||||
}
|
||||
.rc-click{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
img{
|
||||
width: 100%;
|
||||
height: auto;
|
||||
position:relative;
|
||||
}
|
||||
}
|
||||
img{
|
||||
width: 10rem;
|
||||
height: 10rem;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
margin-top: 2.5rem;
|
||||
.click-zone{
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
img{
|
||||
width: 10rem;
|
||||
height: 10rem;
|
||||
margin-top: 2.5rem;
|
||||
}
|
||||
}
|
||||
span{
|
||||
font-size: 1.125rem;
|
||||
@ -348,13 +390,13 @@
|
||||
// }
|
||||
}
|
||||
.active {
|
||||
font-size: 0.14rem;
|
||||
font-size: .875rem;
|
||||
img{
|
||||
border-width: 1px;
|
||||
}
|
||||
}
|
||||
.unactive {
|
||||
font-size: 0.14rem;
|
||||
font-size: .875rem;
|
||||
img{
|
||||
border-width: 1px;
|
||||
}
|
||||
|
@ -253,6 +253,9 @@ ul li ol li em strong i {
|
||||
width: 440px;
|
||||
height: 652px;
|
||||
}
|
||||
.ts-crumbs {
|
||||
padding-left:.25rem;
|
||||
}
|
||||
.ts-mypersonal{
|
||||
margin-left:0;
|
||||
.rc-column{
|
||||
|
@ -288,12 +288,12 @@
|
||||
border: 1px solid #D8D8D8;
|
||||
margin-left: 40px;
|
||||
|
||||
img {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
display: block;
|
||||
|
||||
}
|
||||
img {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
display: block;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
|
||||
.rc-right {
|
||||
|
@ -451,7 +451,6 @@
|
||||
}
|
||||
span {
|
||||
font-size: 45px;
|
||||
font-weight: bold;
|
||||
}
|
||||
strong {
|
||||
font-style: normal;
|
||||
|
@ -289,7 +289,7 @@ border-radius: 100px;
|
||||
.rc-bottom{
|
||||
position: fixed;
|
||||
background: white;
|
||||
height: 617px;
|
||||
height: 21.875rem;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 9;
|
||||
|
@ -236,6 +236,7 @@ color: #333333;
|
||||
font-style: normal;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: baseline;
|
||||
span {
|
||||
font-size: 14px;
|
||||
|
||||
@ -251,6 +252,10 @@ color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
.ts-right-arr {
|
||||
line-height:1rem;
|
||||
height:1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -152,10 +152,11 @@ ul li ol li em strong i {
|
||||
|
||||
|
||||
}
|
||||
.rc-value{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.rc-value{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.usermember{
|
||||
|
@ -326,7 +326,7 @@ margin-right: 20px;
|
||||
|
||||
|
||||
//pc端
|
||||
@media screen and (min-width: 768px) and (max-width: 1920px) {
|
||||
@media screen and (min-width: 768px){
|
||||
|
||||
//快递列表
|
||||
.delivery {
|
||||
@ -518,7 +518,7 @@ margin-right: 20px;
|
||||
|
||||
width: 100%;
|
||||
margin-left: 16px;
|
||||
|
||||
justify-content: end;
|
||||
|
||||
}
|
||||
.rc-userright {
|
||||
|
BIN
rc-busness/assets/image/btn-close.png
Normal file
BIN
rc-busness/assets/image/btn-close.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
rc-busness/assets/image/btn-play.png
Normal file
BIN
rc-busness/assets/image/btn-play.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
@ -304,7 +304,7 @@
|
||||
<div class="rc-column rc-padding-x--none">
|
||||
<ul class="rc-list rc-list--blank rc-list--align rc-btn-offset--top" role="menu">
|
||||
<li class="rc-list__item">
|
||||
<a class="rc-list__link rc-icon ts-login--xs rc-iconography--xs" role="menuitem" href="javascript:void();" @click="turnlogin">
|
||||
<a class="rc-list__link rc-icon ts-login--xs rc-iconography--xs" role="menuitem" @click="turnlogin">
|
||||
个人中心
|
||||
<em class="rc-screen-reader" v-if="loginornot"></em>
|
||||
</a>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<div v-if='error.statusCode!=404'>
|
||||
<h2>{{ error.statusCode }} 发现未知错误</h2>
|
||||
<div>
|
||||
<nuxt-link to="/">返回首页</nuxt-link>
|
||||
<a href="/">返回首页</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -97,17 +97,16 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="sw-center" >
|
||||
<div class="rc-click" @click="selectproduce(item,index)">
|
||||
<div class="uservideo">
|
||||
<video controls="controls" :poster=item.catimage preload="none">
|
||||
<source :src= item.video type="video/ogg">
|
||||
</video>
|
||||
<div class="rc-click">
|
||||
<div class="uservideo" @click="playMobileVideo(item)">
|
||||
<img :src="item.catimage">
|
||||
</div>
|
||||
<div class='click-zone' @click="selectproduce(item,index)">
|
||||
<img :src=item.productimage alt="">
|
||||
<span>{{item.title}}</span>
|
||||
<p>{{item.detail}}</p>
|
||||
<em>{{item.price}}</em>
|
||||
</div>
|
||||
|
||||
<img :src=item.productimage alt="">
|
||||
<span>{{item.title}}</span>
|
||||
<p>{{item.detail}}</p>
|
||||
<em>{{item.price}}</em>
|
||||
</div>
|
||||
<div class="rc-full-width rc-margin-y--md">
|
||||
<i @click="selectproduce(item,index)" class="ts-standard-btn ts-standard-btn--two center">立即购买</i>
|
||||
@ -331,17 +330,16 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="sw-center" >
|
||||
<div class="rc-click" @click="selectproduce(item,index)">
|
||||
<div class="uservideo">
|
||||
<video controls="controls" preload="none" :poster="item.catimage">
|
||||
<source :src= item.video type="video/ogg">
|
||||
</video>
|
||||
<div class="rc-click" >
|
||||
<div class="uservideo" @click="playMobileVideo(item)">
|
||||
<img :src="item.catimage">
|
||||
</div>
|
||||
<div class='click-zone' @click="selectproduce(item,index)">
|
||||
<img :src=item.productimage alt="">
|
||||
<span>{{item.title}}</span>
|
||||
<p>{{item.detail}}</p>
|
||||
<em>{{item.price}}</em>
|
||||
</div>
|
||||
|
||||
<img :src=item.productimage alt="">
|
||||
<span>{{item.title}}</span>
|
||||
<p>{{item.detail}}</p>
|
||||
<em>{{item.price}}</em>
|
||||
</div>
|
||||
<div class="rc-full-width rc-margin-y--md">
|
||||
<i @click="selectproduce(item,index)" class="ts-standard-btn ts-standard-btn--two center">立即购买</i>
|
||||
@ -694,8 +692,11 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ts-mask ts-mobile-player-container" v-show="mobileVideoPlaying">
|
||||
<div class="ts-mask-bg"></div>
|
||||
<div class="ts-mask-close" @click="closeMobileVideo"></div>
|
||||
<video controls="controls" ref="mobile-video-player"></video>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
@ -752,7 +753,7 @@
|
||||
fixedHeader:false,
|
||||
dataLoaded:true,
|
||||
useraindex:0,
|
||||
|
||||
mobileVideoPlaying:false,
|
||||
usertitle:'明星猫粮',
|
||||
dogtitle:'明星犬粮',
|
||||
processinformation:[],
|
||||
@ -1096,7 +1097,7 @@
|
||||
}
|
||||
},
|
||||
catStarProductswiperOption: {
|
||||
loop: true,
|
||||
//loop: true,
|
||||
slidesPerView: 'auto',
|
||||
centeredSlides: true,
|
||||
speed:1000,
|
||||
@ -1120,7 +1121,7 @@
|
||||
}
|
||||
},
|
||||
dogStarProductswiperOption: {
|
||||
loop: true,
|
||||
//loop: true,
|
||||
slidesPerView: 'auto',
|
||||
centeredSlides: true,
|
||||
speed:1000,
|
||||
@ -1177,6 +1178,19 @@
|
||||
window.removeEventListener('scroll', this.scrollToTop);
|
||||
},
|
||||
methods:{
|
||||
playMobileVideo(item){
|
||||
let videoPath=item.video;
|
||||
let player = this.$refs['mobile-video-player'];
|
||||
let _self = this;
|
||||
player.src=videoPath;
|
||||
player.play();
|
||||
this.mobileVideoPlaying = true;
|
||||
},
|
||||
closeMobileVideo(){
|
||||
this.mobileVideoPlaying = false;
|
||||
let player = this.$refs['mobile-video-player'];
|
||||
player.pause();
|
||||
},
|
||||
ifAdoid(item,index){
|
||||
//console.log(index);
|
||||
this.userindex=index;
|
||||
|
@ -231,6 +231,5 @@ import Myheader from "~/components/header.vue";
|
||||
|
||||
<style lang="less" scoped>
|
||||
// 手机端
|
||||
@import url("../../assets/css/global.less");
|
||||
@import url("../../assets/css/discount.less");
|
||||
</style>
|
@ -3,7 +3,7 @@
|
||||
<Myheader></Myheader>
|
||||
<!-- <tabs></tabs> -->
|
||||
<div class="rc-top"></div>
|
||||
<tabs :crumbs="crumbs" :crumbStyle="`padding-left:0;`"></tabs>
|
||||
<tabs :crumbs="crumbs"></tabs>
|
||||
<div class="rc-layout-container rc-one-column rc-full-width ts-mypersonal">
|
||||
<div class="rc-column">
|
||||
<!-- <div class="rc-title">
|
||||
|
@ -6,13 +6,98 @@ ul li ol li em strong i {
|
||||
.rc-header {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.settlement {
|
||||
|
||||
}
|
||||
|
||||
.rc-merchandise {
|
||||
li {
|
||||
align-items: baseline;
|
||||
}
|
||||
}
|
||||
.discountInfo {
|
||||
i,em {
|
||||
font-size:.875rem;
|
||||
}
|
||||
}
|
||||
.rc-discount {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.rc-contair {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.rc-left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #e1001a;
|
||||
width: 34%;
|
||||
float: left;
|
||||
height: 100%;
|
||||
i {
|
||||
font-style: normal;
|
||||
font-size: 12px;
|
||||
}
|
||||
span {
|
||||
font-size: 45px;
|
||||
}
|
||||
strong {
|
||||
font-style: normal;
|
||||
font-size: 12px;
|
||||
display: block;
|
||||
margin-top: 8px;
|
||||
}
|
||||
}
|
||||
.rc-right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 5px 10px;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
i {
|
||||
font-style: normal;
|
||||
font-size: 16px;
|
||||
color: #e1001a;
|
||||
}
|
||||
.rc-main {
|
||||
color: #999999;
|
||||
font-size: 12px;
|
||||
}
|
||||
span {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
}
|
||||
em {
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
.rc-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-right: 10px;
|
||||
span {
|
||||
width: 72px;
|
||||
height: 25px;
|
||||
background: #e2001a;
|
||||
text-align: center;
|
||||
line-height: 25px;
|
||||
font-size: 12px;
|
||||
color: #ffffff;
|
||||
margin-bottom: 8px;
|
||||
border-radius: 100px;
|
||||
margin-right: 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rc-main {
|
||||
width: 92%;
|
||||
@ -255,7 +340,7 @@ ul li ol li em strong i {
|
||||
}
|
||||
|
||||
ul {
|
||||
width: 25%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
@ -342,7 +427,7 @@ ul li ol li em strong i {
|
||||
justify-content: flex-end;
|
||||
flex-direction: column;
|
||||
align-items: self-end;
|
||||
|
||||
text-align: right;
|
||||
i {
|
||||
font-style: normal;
|
||||
color: #333333;
|
||||
@ -354,7 +439,15 @@ ul li ol li em strong i {
|
||||
font-style: normal;
|
||||
color: #e1001a;
|
||||
font-size: 26px;
|
||||
display:inline-block;
|
||||
width:5rem;
|
||||
}
|
||||
|
||||
.discountInfo {
|
||||
i,em {
|
||||
font-size:1rem;
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
display: block;
|
||||
|
@ -65,12 +65,12 @@
|
||||
<span>配送方式:</span>
|
||||
<i>{{ shopprice.price }}</i>
|
||||
</li>
|
||||
<!--
|
||||
|
||||
<li>
|
||||
<span> 活动促销:</span>
|
||||
<i>{{ shopprice.distribution }}</i>
|
||||
<i class="ts-right-arr ts-right-arr--two" @click="userget()">{{ curCoupon.couponName }}</i>
|
||||
</li>
|
||||
-->
|
||||
|
||||
<li>
|
||||
<span>商品总价:</span>
|
||||
<i class="red">{{ sumPrice }}</i>
|
||||
@ -88,8 +88,12 @@
|
||||
<div class="rc-foot">
|
||||
<div class="rc-foo">
|
||||
<div>
|
||||
<div class="discountInfo" v-if="discountAmount">
|
||||
<i>优惠金额:</i>
|
||||
<em>{{ discountAmount }}</em>
|
||||
</div>
|
||||
<i>合计金额:</i>
|
||||
<em>{{ sumPrice }}</em>
|
||||
<em>{{ discountedSumPrice }}</em>
|
||||
</div>
|
||||
<div style="font-weight: bold">
|
||||
<span @click="preJiesuan()">提交订单</span>
|
||||
@ -147,12 +151,50 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogInfo1" class="pop_coupon" :close-on-click-modal="false">
|
||||
<div class="ts-no-data" v-if="drawlist.length<=0">您还没有优惠券,可在商品的详情页面中领取</div>
|
||||
<div class="rs-dis">
|
||||
<div
|
||||
class="rc-discount"
|
||||
v-for="(item, index) in drawlist"
|
||||
:key="index"
|
||||
>
|
||||
<img :src="userimage" alt="" />
|
||||
<div class="rc-contair">
|
||||
<div class="rc-left" :style='usercolor'>
|
||||
<div>
|
||||
<i v-if="(item.couponTypeId!='4' && item.couponAmount>0)">
|
||||
¥
|
||||
</i>
|
||||
<span>
|
||||
{{item.couponTypeId=='4'?parseInt(((item.discount)*10))+'折':item.couponAmount}}
|
||||
</span>
|
||||
</div>
|
||||
<strong>{{ item.couponName }}</strong>
|
||||
</div>
|
||||
<div class="rc-right">
|
||||
<i :style='usercolor'>
|
||||
{{ item.couponName }}
|
||||
</i>
|
||||
<div class="rc-userfont">
|
||||
<strong>有效期</strong>
|
||||
<span>{{item.validFrom}}至</span>
|
||||
<em>{{item.validTo}}</em>
|
||||
</div>
|
||||
<div class="rc-footer">
|
||||
<span @click="pickCoupon(item)">立即使用</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Myheader from "~/components/header.vue";
|
||||
import { userin, memberAddress, generateOrderWX } from "../../ajax/getData";
|
||||
import { userin, memberAddress, generateOrderWX, getdraw } from "../../ajax/getData";
|
||||
import tabs from "@/components/tabs.vue";
|
||||
import myAddress from "~/components/address.vue";
|
||||
import { mapMutations } from "vuex";
|
||||
@ -170,6 +212,11 @@ export default {
|
||||
path:'/personal/settlement'
|
||||
}
|
||||
],
|
||||
usercolor:{color:'#e1001a'},
|
||||
userimage: require("../../assets/image/unused.png"),
|
||||
curCoupon:{couponName:'未选择可用优惠券'},
|
||||
drawlist:[],
|
||||
dialogInfo1:false,
|
||||
goldmedal: [],
|
||||
dialogAddTitle: "",
|
||||
addressstype: null,
|
||||
@ -204,15 +251,71 @@ export default {
|
||||
promotion: "¥167.00",
|
||||
payment: "¥0.00 ",
|
||||
},
|
||||
discountAmount:0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// 总价计算
|
||||
sumPrice() {
|
||||
return this.goldmedal.reduce((pre, cur) => {
|
||||
console.log(pre);
|
||||
return pre + cur.buyCount * cur.productPrice;
|
||||
}, 0);
|
||||
sumPrice() {
|
||||
return this.goldmedal.reduce((pre, cur) => {
|
||||
return pre + cur.buyCount * cur.productPrice;
|
||||
}, 0);
|
||||
},
|
||||
// 折扣计算
|
||||
discountedSumPrice() {
|
||||
let total = 0;
|
||||
if(this.curCoupon.couponId) {
|
||||
//Coupon Calculation
|
||||
let couponUsed=false;
|
||||
for(let itemInCart of this.goldmedal) {
|
||||
if((!this.curCoupon.productCodes || this.curCoupon.productCodes.indexOf(itemInCart.productCode)>-1) && !couponUsed) {
|
||||
if(this.curCoupon.minQuantity && this.curCoupon.minQuantity>itemInCart.buyCount) {
|
||||
//Check minQuantity
|
||||
total+=(itemInCart.buyCount * itemInCart.productPrice);
|
||||
} else if(this.curCoupon.minPrice && this.curCoupon.minPrice > (itemInCart.buyCount * itemInCart.productPrice)) {
|
||||
//Check minPrice
|
||||
total+=(itemInCart.buyCount * itemInCart.productPrice);
|
||||
} else {
|
||||
//Into coupon discount calculation
|
||||
switch(this.curCoupon.couponTypeId) {
|
||||
case 1: //Amount deduct
|
||||
total = total + (itemInCart.productPrice * itemInCart.buyCount - this.curCoupon.couponAmount);
|
||||
this.discountAmount = this.curCoupon.couponAmount;
|
||||
couponUsed=true;
|
||||
break;
|
||||
case 2: //Amount deduct with minPrice restriction
|
||||
case 6:
|
||||
total = total + (itemInCart.productPrice * itemInCart.buyCount) - this.curCoupon.couponAmount;
|
||||
this.discountAmount = this.curCoupon.couponAmount;
|
||||
couponUsed=true;
|
||||
break;
|
||||
case 3: //Limited product % discount
|
||||
case 4: //% discount
|
||||
total = total + (itemInCart.productPrice * itemInCart.buyCount) * this.curCoupon.discount;
|
||||
this.discountAmount = (itemInCart.productPrice * itemInCart.buyCount) * ( 1 - this.curCoupon.discount);
|
||||
couponUsed=true;
|
||||
break;
|
||||
default:
|
||||
total += itemInCart.productPrice * itemInCart.buyCount;
|
||||
break;
|
||||
}
|
||||
//Into coupon discount calculation end
|
||||
}
|
||||
} else {
|
||||
total += itemInCart.productPrice * itemInCart.buyCount;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//Normal Calculation
|
||||
total=this.goldmedal.reduce((pre, cur) => {
|
||||
return pre + cur.buyCount * cur.productPrice;
|
||||
}, 0);
|
||||
}
|
||||
if(this.discountAmount)
|
||||
this.discountAmount = this.discountAmount.toFixed(2);
|
||||
if(!total)
|
||||
total=0;
|
||||
total = total.toFixed(2);
|
||||
return total;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
@ -229,6 +332,55 @@ export default {
|
||||
});
|
||||
this.useraddress = data;
|
||||
},
|
||||
userget(){
|
||||
let user = this.$store.state.userInfo;
|
||||
if (user) {
|
||||
this.userdraw(user.data.mobile);
|
||||
this.dialogInfo1 = true;
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: "/userlogin/login",
|
||||
});
|
||||
}
|
||||
},
|
||||
//获取用户领取的优惠券
|
||||
async userdraw(mobile) {
|
||||
let data = await getdraw(mobile);
|
||||
let _self = this;
|
||||
let curTime = new Date().getTime();
|
||||
let valDateFromTime=0;
|
||||
let valDateToTime=0;
|
||||
let dateChecked=true;
|
||||
if (data) {
|
||||
this.drawlist=[];
|
||||
for(let itemInCart of this.goldmedal) {
|
||||
for(let myCoupon of data.data) {
|
||||
valDateFromTime=0;
|
||||
valDateToTime=0;
|
||||
dateChecked=true;
|
||||
if(myCoupon.fValidFrom) {
|
||||
valDateFromTime = new Date(myCoupon.fValidFrom).getTime();
|
||||
}
|
||||
if(myCoupon.fValidTo) {
|
||||
valDateToTime = new Date(myCoupon.fValidTo).getTime();
|
||||
}
|
||||
if(valDateFromTime && curTime < valDateFromTime) {
|
||||
dateChecked=false;
|
||||
}
|
||||
if(valDateToTime && curTime > valDateToTime) {
|
||||
dateChecked=false;
|
||||
}
|
||||
if(dateChecked && myCoupon.status == 0 && (myCoupon.productCodes.indexOf(itemInCart.productCode)>-1 || !myCoupon.productCodes)) {
|
||||
_self.drawlist.push(myCoupon);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
pickCoupon(item){
|
||||
this.curCoupon = item;
|
||||
this.dialogInfo1 = false;
|
||||
},
|
||||
editAddress(item) {
|
||||
this.dialogAddTitle = "修改收货地址";
|
||||
this.editAddressData = {
|
||||
@ -313,7 +465,7 @@ export default {
|
||||
basePoint:basePoint,
|
||||
productName: item.productName,
|
||||
buyCount: item.buyCount,
|
||||
productId: item.productCode,
|
||||
productCode: item.productCode,
|
||||
payAmount: item.productPrice,
|
||||
memberId: userInfo.data.id,
|
||||
phoneNumber: userInfo.data.mobile,
|
||||
@ -331,6 +483,13 @@ export default {
|
||||
addressDetailInfo: orderAddress[0].detailAddress,
|
||||
},
|
||||
};
|
||||
if(this.curCoupon.couponId) {
|
||||
oneProduct.couponId = this.curCoupon.couponId;
|
||||
oneProduct.couponTypeId = this.curCoupon.couponTypeId;
|
||||
oneProduct.couponName = this.curCoupon.couponName;
|
||||
oneProduct.couponCode = this.curCoupon.couponCode;
|
||||
oneProduct.couponAmount = (this.curCoupon.couponAmount?this.curCoupon.couponAmount:this.curCoupon.discount);
|
||||
}
|
||||
postData.push(oneProduct);
|
||||
});
|
||||
// let postData = [
|
||||
@ -380,8 +539,8 @@ export default {
|
||||
let res = await generateOrderWX(postData);
|
||||
if (res.success) {
|
||||
let userPayData = {
|
||||
orderId: res.data,
|
||||
userprice: this.sumPrice,
|
||||
orderId: res.data.orderNumber,
|
||||
userprice: parseFloat(res.data.orderAmount).toFixed(2),
|
||||
userinformation:
|
||||
postData[0].orderAddress.addressUserName +
|
||||
" " +
|
||||
@ -405,9 +564,6 @@ export default {
|
||||
},
|
||||
async canceldanhao(orderNumber) {
|
||||
let data = await userin(orderNumber);
|
||||
console.log(data);
|
||||
// this.goldmedal=data;
|
||||
console.log(this.goldmedal);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
@ -486,6 +486,5 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import url("../../assets/css/global.less");
|
||||
@import url("../../assets/css/orderquantity.less");
|
||||
</style>
|
@ -4,46 +4,42 @@
|
||||
<div class="rc-top"></div>
|
||||
<tabs :crumbs="crumbs"></tabs>
|
||||
<div class="rc-full-width rc-max-width--xl rc-padding-bottom--lg">
|
||||
<div class="rc-main">
|
||||
|
||||
<div class="rc-center" >
|
||||
<van-swipe @change="onChange">
|
||||
<van-swipe-item v-for="(banner, index) in banners" :key="index">
|
||||
<img :src="banner.src" class="useraimg"/>
|
||||
</van-swipe-item>
|
||||
</van-swipe>
|
||||
<!-- <img :src='userimage' /> -->
|
||||
</div>
|
||||
<div class="rc-order">
|
||||
<span>当前等级:{{userorder}}</span>
|
||||
</div>
|
||||
<div class="rc-cordd">
|
||||
<span>距离升级还差:{{ rcvalue }} </span>
|
||||
<div class="block">
|
||||
<div class="r-block" ref="userblock"></div>
|
||||
|
||||
<!-- <el-slider v-model="value" range show-stops :max="10"> </el-slider> -->
|
||||
|
||||
|
||||
</div>
|
||||
<div class="rc-value">
|
||||
<span>新手铲屎官</span>
|
||||
<span>资深铲屎官</span>
|
||||
<span>金牌铲屎官</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rc-layout-container">
|
||||
<div class="usermember rc-column" v-for="(item,index) in newlist" :key="index">
|
||||
<div class="rc-image">
|
||||
<img :src="item.catimage" alt="" />
|
||||
<div class="rc-main">
|
||||
<div class="rc-center" >
|
||||
<van-swipe @change="onChange">
|
||||
<van-swipe-item v-for="(banner, index) in banners" :key="index">
|
||||
<img :src="banner.src" class="useraimg"/>
|
||||
</van-swipe-item>
|
||||
</van-swipe>
|
||||
<!-- <img :src='userimage' /> -->
|
||||
</div>
|
||||
<div class="rc-userorder">
|
||||
<em>{{item.title}}</em>
|
||||
<span>{{item.usereat}}</span>
|
||||
<div class="rc-order">
|
||||
<span>当前等级:{{userorder}}</span>
|
||||
</div>
|
||||
<div class="rc-cordd">
|
||||
<span>距离升级还差:{{ rcvalue }} </span>
|
||||
<div class="block">
|
||||
<div class="r-block" ref="userblock"></div>
|
||||
<!-- <el-slider v-model="value" range show-stops :max="10"> </el-slider> -->
|
||||
</div>
|
||||
<div class="rc-value">
|
||||
<span class="rc-styled-link" @click="onChange(0)">新手铲屎官</span>
|
||||
<span class="rc-styled-link" @click="onChange(1)">资深铲屎官</span>
|
||||
<span class="rc-styled-link" @click="onChange(2)">金牌铲屎官</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rc-layout-container">
|
||||
<div class="usermember rc-column" v-for="(item,index) in newlist" :key="index">
|
||||
<div class="rc-image">
|
||||
<img :src="item.catimage" alt="" />
|
||||
</div>
|
||||
<div class="rc-userorder">
|
||||
<em>{{item.title}}</em>
|
||||
<span>{{item.usereat}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Myfooter></Myfooter>
|
||||
@ -246,17 +242,17 @@ data(){
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
onChange(index){
|
||||
console.log(index);
|
||||
if(index==0){
|
||||
this.newlist=this.newlista;
|
||||
}else if(index==1){
|
||||
this.newlist=this.senior
|
||||
}else if(index==2){
|
||||
this.newlist=this.goldmedal
|
||||
}
|
||||
console.log(this.newlist)
|
||||
}
|
||||
onChange(index){
|
||||
console.log(index);
|
||||
if(index==0){
|
||||
this.newlist=this.newlista;
|
||||
}else if(index==1){
|
||||
this.newlist=this.senior
|
||||
}else if(index==2){
|
||||
this.newlist=this.goldmedal
|
||||
}
|
||||
console.log(this.newlist)
|
||||
}
|
||||
|
||||
},
|
||||
components:{
|
||||
|
@ -19,7 +19,7 @@
|
||||
<el-col :span="6" class="ready_right">
|
||||
<div class="inline_right">
|
||||
<p>付款金额:</p>
|
||||
<p class="price">¥{{ userPayData.userprice }}</p>
|
||||
<p class="price" v-if="userPayData.userprice">¥{{ userPayData.userprice }}</p>
|
||||
</div>
|
||||
<div class="inline_right">
|
||||
<p>收货信息:</p>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<Myheader></Myheader>
|
||||
<div class="rc-top"></div>
|
||||
<tabs :crumbs="crumbs"></tabs>
|
||||
<div class="online" id="fixed-catbar-seperator"></div>
|
||||
<div class="online" id="fixed-catbar-seperator rc-margin--none"></div>
|
||||
<div class="rc-top"></div>
|
||||
<div
|
||||
class="
|
||||
@ -147,7 +147,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="rc-main">
|
||||
<div class="rc-produnnum">
|
||||
<div class="rc-produnnum" v-if="(userbuy && curItem.leftAllotment>0)">
|
||||
<div><i class="ts-row-title">商品数量:</i></div>
|
||||
<img
|
||||
src="../../assets/image/userjian.png"
|
||||
@ -208,7 +208,8 @@
|
||||
<FixRight></FixRight>
|
||||
<Myfooter v-on:litentop="showmesg"></Myfooter>
|
||||
</div>
|
||||
<el-dialog :visible.sync="dialogInfo1" @close="userclose" class="pop_coupon">
|
||||
<el-dialog :visible.sync="dialogInfo1" @close="userclose" class="pop_coupon" :close-on-click-modal="false">
|
||||
<div class="ts-no-data" v-if="usernewlist.length<=0">目前还没有可用的优惠券</div>
|
||||
<div class="rs-dis">
|
||||
<div
|
||||
class="rc-discount"
|
||||
@ -216,25 +217,32 @@
|
||||
:key="index"
|
||||
>
|
||||
<img :src="userimage" alt="" />
|
||||
<div class="rc-contair">
|
||||
<div class="rc-left">
|
||||
<div v-if="item.couponAmount">
|
||||
<i>¥</i><span>{{ item.couponAmount }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rc-right">
|
||||
<i>
|
||||
{{ item.couponDesc }}
|
||||
</i>
|
||||
<div>
|
||||
<span>有效期</span>
|
||||
<em>{{ item.validTo }}</em>
|
||||
</div>
|
||||
<div class="rc-footer">
|
||||
<span @click="usergetconf(item)">立即领取</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rc-contair">
|
||||
<div class="rc-left">
|
||||
<div>
|
||||
<i v-if="(item.couponTypeId!='4' && item.couponAmount>0)">
|
||||
¥
|
||||
</i>
|
||||
<span>
|
||||
{{item.couponTypeId=='4'?parseInt(((item.discount)*10))+'折':item.couponAmount}}
|
||||
</span>
|
||||
</div>
|
||||
<strong>{{ item.couponName }}</strong>
|
||||
</div>
|
||||
<div class="rc-right">
|
||||
<i>
|
||||
{{ item.couponName }}
|
||||
</i>
|
||||
<div class="rc-userfont">
|
||||
<strong>有效期</strong>
|
||||
<span>{{item.validFrom}}至</span>
|
||||
<em>{{item.validTo}}</em>
|
||||
</div>
|
||||
<div class="rc-footer">
|
||||
<span @click="usergetconf(item)">立即领取</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -471,6 +479,7 @@ export default {
|
||||
|
||||
userclose() {
|
||||
this.userlist = [];
|
||||
this.dialogInfo1=false;
|
||||
},
|
||||
async userquery() {
|
||||
let data = await goodsmessage(this.productCode);
|
||||
@ -517,7 +526,7 @@ export default {
|
||||
let alllist = [];
|
||||
this.userlist = this.alldraw.data;
|
||||
this.userlist.forEach((element, index) => {
|
||||
if (typeof element.productCodes == "string") {
|
||||
if (typeof element.productCodes == "string" || !element.productCodes) {
|
||||
userlist.push(element);
|
||||
// let s=element.productCodes.split(',');
|
||||
// console.log(s.indexOf(this.productCode) != -1 )
|
||||
@ -526,14 +535,36 @@ export default {
|
||||
});
|
||||
let menualist = [];
|
||||
userlist.filter((item) => {
|
||||
item.productCodes = item.productCodes.split(",");
|
||||
item.productCodes.forEach((element) => {
|
||||
if (element == this.productCode && item.activityId !== 10) {
|
||||
console.log(element);
|
||||
console.log(this.productCode);
|
||||
menualist.push(item);
|
||||
}
|
||||
});
|
||||
let valDateFromTime=0;
|
||||
let valDateToTime=0;
|
||||
let curTime = new Date().getTime();
|
||||
let dateChecked=true;
|
||||
if(item.fValidFrom) {
|
||||
valDateFromTime = new Date(item.fValidFrom).getTime();
|
||||
}
|
||||
if(item.fValidTo) {
|
||||
valDateToTime = new Date(item.fValidTo).getTime();
|
||||
}
|
||||
if(valDateFromTime && curTime < valDateFromTime) {
|
||||
dateChecked=false;
|
||||
}
|
||||
if(valDateToTime && curTime > valDateToTime) {
|
||||
dateChecked=false;
|
||||
}
|
||||
if(dateChecked) {
|
||||
if(!item.productCodes) {
|
||||
menualist.push(item);
|
||||
} else {
|
||||
item.productCodes = item.productCodes.split(",");
|
||||
item.productCodes.forEach((element) => {
|
||||
if (element == this.curItem.productCode && item.activityId !== 10) {
|
||||
menualist.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
//Expired coupons
|
||||
}
|
||||
});
|
||||
this.usernewlist = menualist;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user