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

This commit is contained in:
Carl 2022-01-25 16:41:39 +08:00
commit 217afb123f
16 changed files with 710 additions and 421 deletions

View File

@ -91,7 +91,6 @@ export const monitorOrderNotify = (OrderNumber) => {
* 删除购物车 * 删除购物车
*/ */
export const deleteCart = ( productCode) => { export const deleteCart = ( productCode) => {
debugger;
var data = { var data = {
productCode productCode
} }

View File

@ -4,18 +4,13 @@ body {
line-height: 1.5; line-height: 1.5;
color: #666; color: #666;
} }
div[data-js-modal-menu] {
display:none;
}
aside div[data-js-modal-menu] {
display:block;
}
.el-message-box .el-button--primary{ .el-message-box .el-button--primary{
background-color: #e1001a !important; background-color: #e1001a !important;
color:#fff; color:#fff;
border:unset; border:unset;
} }
.rc-menu--xs .rc-screen-reader{ .rc-menu--xs .rc-screen-reader{
left:28%; left:28%;
} }
@ -154,6 +149,9 @@ picture {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
.useruantity{
margin: 1rem 1.25rem;
}
.ts-remove { .ts-remove {
text-decoration: line-through; text-decoration: line-through;
@ -330,7 +328,7 @@ picture {
height: auto; height: auto;
position: fixed; position: fixed;
right: 0; right: 0;
top: 40%; top: 56vh;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.16); box-shadow: 0 0 10px rgba(0, 0, 0, 0.16);
border-radius: .25rem; border-radius: .25rem;
@ -532,7 +530,12 @@ picture {
max-width: 768px; max-width: 768px;
margin: 0 auto; margin: 0 auto;
} }
div[data-js-modal-menu] {
display:none;
}
aside div[data-js-modal-menu] {
display:block;
}
html { html {
font-size: 16px; font-size: 16px;
} }

View File

@ -451,7 +451,6 @@
} }
span { span {
font-size: 45px; font-size: 45px;
font-weight: bold;
} }
strong { strong {
font-style: normal; font-style: normal;

View File

@ -341,6 +341,7 @@ border-radius: 100px;
font-size: 18px; font-size: 18px;
color: #333333; color: #333333;
font-weight: bold; font-weight: bold;
margin-top:1rem;
} }
.ts-scrollable{ .ts-scrollable{
margin-top: 1rem; margin-top: 1rem;

View File

@ -236,6 +236,7 @@ color: #333333;
font-style: normal; font-style: normal;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: baseline;
span { span {
font-size: 14px; font-size: 14px;
@ -251,6 +252,10 @@ color: #333333;
} }
} }
} }
.ts-right-arr {
line-height:1rem;
height:1.5rem;
}
} }

View File

@ -2,8 +2,110 @@ ul li ol li em strong i {
list-style: none; list-style: none;
font-style: normal; font-style: normal;
} }
.rc-main{
margin: 0;
padding: 0;
}
//手机端 //手机端
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.online{
margin: 0;
&.bold{
height: 0.5rem;
}
}
// 订单状态
.rc-receiving {
width: 100%;
display: flex;
align-items: center;
// margin: 1rem 1.25rem;
em {
font-style: normal;
color: #e1001a;
font-size: 1.375rem;
font-weight: bold;
}
span {
color: #666666;
font-size: 0.875rem;
display: block;
margin-left: 1.125rem;
width: 62%;
margin-top: 0.5rem;
}
}
//快递列表
.delivery {
display: flex;
flex-direction: column;
margin: 1rem 1.25rem;
.to-delivery {
img{
width: 1rem;
height: 1rem;
object-fit: contain;
}
display: flex;
align-items: center;
font-style: normal;
span {
display: block;
margin-left: 0.18rem;
color: #333333;
font-size: 1rem;
font-weight: 500;
}
i {
font-style: normal;
margin-left: 0.5rem;
display: block;
color: #999999;
font-size: 0.75rem;
margin-top: 0.31rem;
}
}
.bo-delivery {
span {
font-size: 0.87rem;
color: #666666;
display: block;
margin-top: 0.5rem;
}
}
}
//地址列表
.mypersonal{
.my-delivery {
display: flex;
align-items: center;
font-style: normal;
span {
display: block;
font-size: 0.87rem;
color: #333333;
}
i {
font-style: normal;
display: block;
font-size: 0.87rem;
color: #333333;
margin-left: .5rem;
}
}
.per-delivery {
span {
font-size:0.875rem;
color: #666666;
display: block;
margin-top: 0.43rem;
}
}
}
.rc-margin-y--md{ .rc-margin-y--md{
width: 100%; width: 100%;
height: 80px; height: 80px;
@ -39,83 +141,7 @@ margin-right: 20px;
.rc-foo{ .rc-foo{
display: none; display: none;
} }
.rc-receiving {
width: 100%;
height: 80px;
display: flex;
align-items: center;
em {
font-style: normal;
color: #e1001a;
font-size: 22px;
font-weight: bold;
}
span {
color: #666666;
font-size: 12px;
display: block;
margin-left: 18px;
width: 62%;
}
}
.delivery {
display: flex;
flex-direction: column;
height: 80px;
.to-delivery {
display: flex;
align-items: center;
font-style: normal;
span {
display: block;
margin-left: 3px;
}
i {
font-style: normal;
margin-left: 8px;
display: block;
}
}
.bo-delivery {
span {
font-size: 14px;
color: #666666;
display: block;
margin-top: 8px;
}
}
}
.mypersonal {
display: flex;
flex-direction: column;
height: 80px;
.my-delivery {
display: flex;
align-items: center;
font-style: normal;
span {
display: block;
margin-left: 3px;
}
i {
font-style: normal;
margin-left: 8px;
display: block;
}
}
.per-delivery {
span {
font-size: 14px;
color: #666666;
display: block;
margin-top: 8px;
}
}
}
.rc-usermain { .rc-usermain {
display: flex; display: flex;
@ -207,14 +233,16 @@ margin-right: 20px;
.rc-merchandise { .rc-merchandise {
width: 100%; width: 100%;
margin-top: 32px; margin-top: 24px;
padding-right: 0.7rem;
padding-left: 0.7rem;
ul { ul {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
line-height: 26px; line-height: 30px;
i { i {
font-style: normal; font-style: normal;
color: #666666; color: #666666;
@ -240,10 +268,15 @@ margin-right: 20px;
} }
} }
} }
.useruantity{
padding-right: 20px;
}
} }
.rc-payment{ .rc-payment{
padding-right: 0.7rem;
padding-left: 0.7rem;
width: 100%; width: 100%;
margin-top: 32px; margin-top: 32px;
.u-trackingnumber{ .u-trackingnumber{
@ -293,7 +326,49 @@ margin-right: 20px;
//pc端 //pc端
@media screen and (min-width: 768px) { @media screen and (min-width: 768px){
//快递列表
.delivery {
display: flex;
flex-direction: column;
margin: 1rem 1.25rem;
.to-delivery {
margin-top: 20px;
img{
width: 24px;
height: 24px;
object-fit: contain;
}
display: flex;
align-items: center;
font-style: normal;
span {
display: block;
margin-left: 16px;
color: #333333;
font-size: 18px;
font-weight: 500;
}
i {
font-style: normal;
margin-left: 0.5rem;
display: block;
color: #999999;
font-size: 0.75rem;
margin-top: 0.31rem;
}
}
.bo-delivery {
margin-top: 16px;
span {
font-size: 0.87rem;
color: #666666;
display: block;
margin-top: 16px;
}
}
}
.rc-margin-y--md{ .rc-margin-y--md{
display: none; display: none;
} }
@ -329,7 +404,6 @@ margin-right: 20px;
.delivery { .delivery {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 140px;
display: flex; display: flex;
justify-content: center; justify-content: center;
.viewdetails{ .viewdetails{

View File

@ -2,45 +2,65 @@
<div class="user-main"> <div class="user-main">
<Myheader></Myheader> <Myheader></Myheader>
<div class="rc-top"></div> <div class="rc-top"></div>
<div class="rc-main" v-for="(item,index) in goldmedal" :key="item.id" > <div class="rc-main" v-for="(item, index) in goldmedal" :key="item.id">
<div class="rc-receiving" > <div class="online bold">
<em>{{item.status=='0'?'待付款':item.status=='1'?'待收货':item.status=='2'?'已完成':item.status=='3'?'已取消':'异常订单'}}</em>
<span>{{orderstatus}}</span>
</div> </div>
<div class="delivery" v-if="isshow" > <div class="rc-receiving useruantity">
<em>{{
item.status == "0"
? "待付款"
: item.status == "1"
? "待收货"
: item.status == "2"
? "已完成"
: item.status == "3"
? "已取消"
: "异常订单"
}}</em>
<span>{{ orderstatus }}</span>
</div>
<div class="online bold">
</div>
<div class="delivery useruantity" v-if="isshow">
<div class="to-delivery"> <div class="to-delivery">
<span>{{ trackingstates}}</span> <img src="../../static/images/delivery.png" alt="">
<span>{{ trackingstates }}</span>
<!-- <i>2021-1-21</i> -->
</div> </div>
<div class="bo-delivery"> <div class="bo-delivery">
<span>{{ logisticsCompany }}</span> <!-- <span> 广州天河刘某某15124617917正在派送中</span> -->
<!-- {{ logisticsCompany }} -->
</div> </div>
<div class="viewdetails"> <div class="viewdetails">
<span>查看详情</span> <span>查看详情</span>
<img :src="leftico" alt="" /> <img :src="leftico" alt="" />
</div> </div>
</div> </div>
<div class="online bold">
<div </div>
class="mypersonal" <div class="mypersonal useruantity">
v-for="(datddress, index) in useraddress"
:key="datddress.id"
>
<div class="my-delivery"> <div class="my-delivery">
<span>{{ datddress.recipient }}</span> <span>{{ item.addressUserName }}</span>
<i>{{ datddress.recipientPhone }}</i> <i>{{ item.addressPhoneNumber }}</i>
</div> </div>
<div class="per-delivery"> <div class="per-delivery">
<span>{{ datddress.provinceName }}{{datddress.cityName}}{{datddress.districtName}}{{datddress.detailAddress}}</span> <span
>{{ item.addressProvinceName }}{{ item.addressCityName
}}{{ item.addressCountyName }}</span
>
</div> </div>
</div> </div>
<div class="online bold"></div>
<div>
<div >
<div class="rc-center"> <div class="rc-center">
<div class="rc-usermain" v-for="(userlist,index) in item.orderDetailList" :key="index"> <div
class="rc-usermain useruantity"
v-for="(userlist, index) in item.orderDetailList"
:key="index"
>
<div class="rc-image"> <div class="rc-image">
<img :src= userlist.picFile alt="" /> <img :src="userlist.picFile" alt="" />
</div> </div>
<div class="rc-right"> <div class="rc-right">
<div class="rc-usercenter"> <div class="rc-usercenter">
@ -53,11 +73,11 @@
<span>数量:{{ userlist.pcs }}</span> <span>数量:{{ userlist.pcs }}</span>
<i>{{ userlist.ecPrice }}</i> <i>{{ userlist.ecPrice }}</i>
<div class="rc-bottom"> <div class="rc-bottom">
<span @click="userpay()">{{customer}}</span> <span @click="userpay()">{{ customer }}</span>
</div> </div>
</div> </div>
<div class="rc-bottomm"> <div class="rc-bottomm">
<span @click="userpay()">{{customer}}</span> <span @click="userpay()">{{ customer }}</span>
</div> </div>
<!-- <div class="rc-userbottomm"> <!-- <div class="rc-userbottomm">
<i>{{ item.userprice }}</i> <i>{{ item.userprice }}</i>
@ -66,8 +86,10 @@
</div> --> </div> -->
</div> </div>
</div> </div>
<div class="online bold"></div>
</div> </div>
<div class="rc-merchandise"> <div class="rc-merchandise ">
<div class="rc-merchandise ">
<ul> <ul>
<li> <li>
<span>商品总价:</span> <span>商品总价:</span>
@ -87,7 +109,9 @@
</li> </li>
</ul> </ul>
</div> </div>
</div>
<div class="rc-payment">
<div class="rc-payment"> <div class="rc-payment">
<ul> <ul>
<li> <li>
@ -109,34 +133,34 @@
<li> <li>
<span>快递单号:</span> <span>快递单号:</span>
<div class="u-trackingnumber"> <div class="u-trackingnumber">
<i>{{ logisticsNumber }} <i>{{ logisticsNumber }} </i>
</i>
<!-- <img :src="information.catimage" alt=""> --> <!-- <img :src="information.catimage" alt=""> -->
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
<div class="rc-foot"> <div class="rc-foot">
<div class="rc-foo"> <div class="rc-foo">
<div style="padding-top:55px"> <div style="padding-top: 55px">
<i>合计金额:</i> <i>合计金额:</i>
<em>{{usersalesAmount}}</em> <em>{{ usersalesAmount }}</em>
</div>
<div style="padding-bottom: 40px; cursor: pointer">
<span @click="onceagain(item)"> {{ payorsucess }}</span>
</div> </div>
<div style="padding-bottom:40px">
<span @click="onceagain()">再次购买</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="rc-full-width rc-margin-y--md"> <div class="rc-full-width rc-margin-y--md">
<i class="ts-standard-btn ts-standard-btn--two center" @click="onceagain()"> <i
{{payorsucess}} class="ts-standard-btn ts-standard-btn--two center"
@click="onceagain()"
>
{{ payorsucess }}
</i> </i>
</div> </div>
<MyFooter></MyFooter> <MyFooter></MyFooter>
@ -146,53 +170,51 @@
<script> <script>
import Myheader from "~/components/header.vue"; import Myheader from "~/components/header.vue";
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
import { userin} from "../../ajax/getData"; import { userin } from "../../ajax/getData";
import MyFooter from '~/components/rc-footer.vue'; import MyFooter from "~/components/rc-footer.vue";
import Vue from 'vue'; import Vue from "vue";
let vm = new Vue(); let vm = new Vue();
import formatConversion from '../../static/js/date' import formatConversion from "../../static/js/date";
import {selectaddress,canceldanhao,generateOrderWX} from "../../ajax/getData"; import {
selectaddress,
canceldanhao,
generateOrderWX,
} from "../../ajax/getData";
export default { export default {
data() { data() {
return { return {
goldmedal:[], goldmedal: [],
userproductId:'', userproductId: "",
logisticsDate:'', logisticsDate: "",
userphone:'', addressPhoneNumber: "",
logisticsNumber:'', userphone: "",
customer:'',// logisticsNumber: "",
payorsucess:'', // customer: "", //
payorsucess: "", //
addressstype: null, addressstype: null,
addressUserName:'', addressUserName: "",
logisticsCompany:'',// logisticsCompany: "", //
orderstatus: '', orderstatus: "",
goldastates:'', goldastates: "",
userisdelivery:'待收货',
userisdelivery: "待收货",
userdelivery: "派送中", userdelivery: "派送中",
isshow:true, isshow: true,
usersalesAmount:'', usersalesAmount: "",
leftico: require("../../assets/image/rc-left.png"), leftico: require("../../assets/image/rc-left.png"),
orderNumber:'', orderNumber: "",
userdata:"", userdata: "",
usermessage:null, usermessage: null,
userid: null, userid: null,
trackingstates:'',// trackingstates: "", //
useralllist:[], useralllist: [],
delivery: [ delivery: [],
], useraddress: [],
useraddress: [ goldmedal: [],
shopprice: {},
],
goldmedal: [
],
shopprice: {
},
information: { information: {
reference: "1111111111111111", reference: "1111111111111111",
ordertime: "2012-12-01 11:20:00", ordertime: "2012-12-01 11:20:00",
@ -204,14 +226,14 @@ export default {
}; };
}, },
methods: { methods: {
...mapMutations(["checkIsLogin"]), ...mapMutations(["checkIsLogin"]),
refreshDesktopNav:function(){ refreshDesktopNav: function () {
RCDL.navigation.currentState=null; RCDL.navigation.currentState = null;
RCDL.navigation.rebuild(); RCDL.navigation.rebuild();
}, },
// //
async canceldanhao(orderNumber) { async canceldanhao(orderNumber) {
let data = await canceldanhao(this.userphone,this.orderNumber); let data = await canceldanhao(this.userphone, this.orderNumber);
if (data) { if (data) {
this.$message({ this.$message({
type: "warning", type: "warning",
@ -225,156 +247,145 @@ export default {
}, },
}); });
}, 500); }, 500);
} }
}, },
userpay(){ userpay() {
console.log('---'); console.log("---");
if(this.goldastates==0){ if (this.goldastates == 0) {
this.canceldanhao(); this.canceldanhao();
} } else if ((this.customer = "联系客服申请售后")) {
else if( this.customer='联系客服申请售后'){
var option = { var option = {
customer: {id: '', name: '', email: '', mobile: '', memberId: this.userdata.data.id} customer: {
} id: "",
name: "",
email: "",
mobile: "",
memberId: this.userdata.data.id,
},
};
dis_livchat(option); dis_livchat(option);
} }
}, },
// //
onceagain(){ onceagain(item) {
console.log(this.payorsucess); console.log(this.payorsucess);
if(this.payorsucess=='立即支付'){ if (this.payorsucess == "立即支付") {
console.log('----') console.log("----");
this.getwei(); this.getwei(item);
} else {
}else{
this.$router.push({ this.$router.push({
path: "/productdetails/producted", path: "/productdetails/producted",
query: { query: {
stype: 1, stype: 1,
productCode: this.userproductId productCode: this.userproductId,
}, },
}); });
console.log('不是立即支付'); console.log("不是立即支付");
} }
}, },
async orderquantity(orderNumber){ async orderquantity(orderNumber) {
let data = await userin(orderNumber);
let data=await userin(orderNumber); if (data) {
if(data){ this.goldmedal = data;
this.goldmedal=data;
console.log(this.goldmedal); console.log(this.goldmedal);
for(let i=0;i<this.goldmedal.length;i++){ for (let i = 0; i < this.goldmedal.length; i++) {
this.goldastates=this.goldmedal[i].status; this.goldastates = this.goldmedal[i].status;
this.userproductId=this.goldmedal[i].orderDetailList[0].productId;
this.logisticsNumber=this.goldmedal[i].orderDetailList[0].logisticsNumber; //
this.trackingstates=this.goldmedal[i].orderDetailList[0].status//
if( this.trackingstates==0){ this.userproductId = this.goldmedal[i].orderDetailList[0].productId;
this.trackingstates='运输中' this.logisticsNumber =
}else if(this.trackingstates==1){ this.goldmedal[i].orderDetailList[0].logisticsNumber; //
this.trackingstates='已签收' this.trackingstates = this.goldmedal[i].orderDetailList[0].status; //
if (this.trackingstates == 0) {
this.trackingstates = "运输中";
} else if (this.trackingstates == 1) {
this.trackingstates = "已签收";
} else if (this.trackingstates == 2) {
this.trackingstates = "未发货";
} }
else if(this.trackingstates==2){ this.logisticsDate = this.formatConversion(
this.trackingstates='未发货' this.goldmedal[i].orderDate
); //
this.logisticsCompany =
this.goldmedal[i].orderDetailList[0].logisticsCompany; //
this.orderNumber = this.goldmedal[i].orderNumber;
this.usersalesAmount = this.goldmedal[i].salesAmount;
this.addressUserName = this.goldmedal[i].addressUserName;
this.addressPhoneNumber = this.goldmedal[i].addressPhoneNumber;
} }
this.logisticsDate=this.formatConversion(this.goldmedal[i].orderDate)// console.log(this.goldmedal, this.userproductId, this.usersalesAmount);
this.logisticsCompany=this.goldmedal[i].orderDetailList[0].logisticsCompany; //
this.orderNumber=this.goldmedal[i].orderNumber
this.usersalesAmount=this.goldmedal[i].salesAmount;
this.addressUserName=this.goldmedal[i].addressUserName;
} }
console.log(this.goldmedal,this.userproductId,this.usersalesAmount); },
}
},
// //
async getwei(user) { async getwei(user) {
console.log(user); console.log(user);
let userPayData = { let userPayData = {
userprice: this.usersalesAmount, userprice: this.usersalesAmount,
orderId:this.orderNumber, orderId: this.orderNumber,
userinformation:this.useraddress[0].recipient + userinformation: this.addressUserName + " " + this.addressPhoneNumber,
" "+this.userphone
}; };
this.$router.push({ this.$router.push({
path: "/personal/userpay", path: "/personal/userpay",
query: { query: {
userData:this.orderNumber, userData: this.orderNumber,
stype:1, stype: 1,
userPayData: JSON.stringify(userPayData), userPayData: JSON.stringify(userPayData),
}, },
}); });
// this.$router.push({
// path: "/personal/userpay",
// query: {
// },
// });
}, },
async editaddress(user) { async editaddress(user) {
// user.data.id=844350; // user.data.id=844350;
let data = await selectaddress(this.userid); let data = await selectaddress(this.userid);
let list=[] let list = [];
this.useraddress=data.data; this.useraddress = data.data;
for(let i =0;i<this.useraddress.length;i++){ for (let i = 0; i < this.useraddress.length; i++) {
if(this.useraddress[i].isDefault==true){ if (this.useraddress[i].isDefault == true) {
list.push(this.useraddress[i]); list.push(this.useraddress[i]);
} }
} }
this.useraddress=list; this.useraddress = list;
console.log( this.useraddress[0].recipient); console.log(this.useraddress[0].recipient);
// console.log(this.list); // console.log(this.list);
}, },
}, },
mounted() { mounted() {
this.checkIsLogin(); this.checkIsLogin();
this.userdata=this.$store.state.userInfo; this.userdata = this.$store.state.userInfo;
console.log(this.userdata); console.log(this.userdata);
this.usermessage = JSON.parse(localStorage.getItem("userInfo")); this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
this.userid = this.usermessage.data.id; this.userid = this.usermessage.data.id;
this.userphone=this.usermessage.data.mobile; this.userphone = this.usermessage.data.mobile;
this.editaddress(this.userid); this.editaddress(this.userid);
this.addressstype = this.$route.query.stype; this.addressstype = this.$route.query.stype;
this.orderNumber=this.$route.query.orderNumber; this.orderNumber = this.$route.query.orderNumber;
this.orderquantity(this.orderNumber) this.orderquantity(this.orderNumber);
if(this.addressstype==2){ if (this.addressstype == 2) {
this.orderstatus='您的订单已完成'; this.orderstatus = "您的订单已完成";
this.isshow=false; this.isshow = false;
this.userisdelivery='待发货'; this.userisdelivery = "待发货";
this.customer='联系客服申请售后' this.customer = "联系客服申请售后";
this.payorsucess='再次购买' this.payorsucess = "再次购买";
console.log( this.orderstatus); console.log(this.orderstatus);
}else if(this.addressstype==0){ } else if (this.addressstype == 0) {
this.orderstatus='您的订单还未付款,请尽快付款!'; this.orderstatus = "您的订单还未付款,请尽快付款!";
this.isshow=false; this.isshow = false;
this.userisdelivery='待付款'; this.userisdelivery = "待付款";
this.customer='取消订单' this.customer = "取消订单";
this.payorsucess='立即支付' this.payorsucess = "立即支付";
} } else if (this.addressstype == 1) {
else if(this.addressstype==1){ this.orderstatus = "您的订单已发出,请耐心等候。";
this.orderstatus='您的订单已发出,请耐心等候。'; this.isshow = true;
this.isshow=true; this.userisdelivery = "待收货";
this.userisdelivery='待收货'; this.customer = "联系客服申请售后";
this.customer='联系客服申请售后' this.payorsucess = "再次购买";
this.payorsucess='再次购买' } else if (this.addressstype == 3) {
} this.orderstatus = "您的订单已取消!";
else if(this.addressstype==3){ this.isshow = false;
this.orderstatus='您的订单已取消!'; this.userisdelivery = "已取消";
this.isshow=false; this.customer = "联系客服申请售后";
this.userisdelivery='已取消'; this.payorsucess = "再次购买";
this.customer='联系客服申请售后'
this.payorsucess='再次购买'
} }
console.log(this.addressstype); console.log(this.addressstype);
}, },
@ -388,5 +399,4 @@ console.log(this.userdata);
<style lang="less" scoped> <style lang="less" scoped>
@import url("../../assets/css/global.less"); @import url("../../assets/css/global.less");
@import url("../../assets/css/usertion.less"); @import url("../../assets/css/usertion.less");
</style> </style>

View File

@ -34,7 +34,7 @@
</i> </i>
<span> <span>
{{item.couponTypeId=='4'?parseInt(((item.discount)*10))+'折':item.couponAmount}} {{ item.couponAmount?item.couponAmount:(parseInt((item.discount)*10)+'折') }}
</span> </span>
</div> </div>
<strong>{{ item.couponName }}</strong> <strong>{{ item.couponName }}</strong>
@ -48,7 +48,7 @@
<span>{{item.validFrom}}</span> <span>{{item.validFrom}}</span>
<em>{{item.validTo}}</em> <em>{{item.validTo}}</em>
</div> </div>
<nuxt-link :to="`/productdetails/productlist`"> <nuxt-link :to="`/productdetails/productlist`" v-if="activeIndex==0">
<div class="ts-standard-btn"> <div class="ts-standard-btn">
立即使用 立即使用
</div> </div>
@ -231,6 +231,5 @@ import Myheader from "~/components/header.vue";
<style lang="less" scoped> <style lang="less" scoped>
// //
@import url("../../assets/css/global.less");
@import url("../../assets/css/discount.less"); @import url("../../assets/css/discount.less");
</style> </style>

View File

@ -8,7 +8,16 @@ ul li ol li em strong i {
} }
.settlement { .settlement {
} }
.rc-merchandise {
li {
align-items: baseline;
}
}
.discountInfo {
i,em {
font-size:.875rem;
}
}
.rc-discount { .rc-discount {
position: relative; position: relative;
width: 100%; width: 100%;
@ -38,7 +47,7 @@ ul li ol li em strong i {
font-size: 12px; font-size: 12px;
} }
span { span {
font-size: 26px; font-size: 45px;
} }
strong { strong {
font-style: normal; font-style: normal;
@ -417,8 +426,8 @@ ul li ol li em strong i {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
flex-direction: column; flex-direction: column;
align-items: self-end; align-items: flex-end;
text-align: right;
i { i {
font-style: normal; font-style: normal;
color: #333333; color: #333333;
@ -430,6 +439,14 @@ ul li ol li em strong i {
font-style: normal; font-style: normal;
color: #e1001a; color: #e1001a;
font-size: 26px; font-size: 26px;
display:inline-block;
min-width:6rem;
}
.discountInfo {
i,em {
font-size:1rem;
}
} }
span { span {

View File

@ -52,7 +52,7 @@
<div class="rc-userbottom"> <div class="rc-userbottom">
<p>{{ item.productPrice }}</p> <p>{{ item.productPrice }}</p>
<p>X{{ item.buyCount }}</p> <p>X{{ item.buyCount }}</p>
<p class="price">{{ item.productPrice }}</p> <p class="price">{{ item.productPrice * item.buyCount }}</p>
</div> </div>
</div> </div>
</div> </div>
@ -88,8 +88,12 @@
<div class="rc-foot"> <div class="rc-foot">
<div class="rc-foo"> <div class="rc-foo">
<div> <div>
<div class="discountInfo" v-if="discountAmount">
<i>优惠金额:</i>
<em>{{ discountAmount }}</em>
</div>
<i>合计金额:</i> <i>合计金额:</i>
<em>{{ sumPrice }}</em> <em>{{ finalAmount }}</em>
</div> </div>
<div style="font-weight: bold"> <div style="font-weight: bold">
<span @click="preJiesuan()">提交订单</span> <span @click="preJiesuan()">提交订单</span>
@ -147,7 +151,7 @@
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="dialogInfo1" class="pop_coupon"> <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="ts-no-data" v-if="drawlist.length<=0">您还没有优惠券可在商品的详情页面中领取</div>
<div class="rs-dis"> <div class="rs-dis">
<div <div
@ -157,18 +161,25 @@
> >
<img :src="userimage" alt="" /> <img :src="userimage" alt="" />
<div class="rc-contair"> <div class="rc-contair">
<div class="rc-left"> <div class="rc-left" :style='usercolor'>
<div v-if="item.couponAmount"> <div>
<i></i><span>{{ item.couponAmount }}</span> <i v-if="(item.couponTypeId!='4' && item.couponAmount>0)">
</i>
<span>
{{ item.couponAmount?item.couponAmount:(parseInt((item.discount)*10)+'折') }}
</span>
</div> </div>
<strong>{{ item.couponName }}</strong>
</div> </div>
<div class="rc-right"> <div class="rc-right">
<i> <i :style='usercolor'>
{{ item.couponDesc }} {{ item.couponName }}
</i> </i>
<div v-show="item.validTo"> <div class="rc-userfont">
<span>有效期</span> <strong>有效期</strong>
<em>{{ item.validTo }}</em> <span>{{item.validFrom}}</span>
<em>{{item.validTo}}</em>
</div> </div>
<div class="rc-footer"> <div class="rc-footer">
<span @click="pickCoupon(item)">立即使用</span> <span @click="pickCoupon(item)">立即使用</span>
@ -201,6 +212,7 @@ export default {
path:'/personal/settlement' path:'/personal/settlement'
} }
], ],
usercolor:{color:'#e1001a'},
userimage: require("../../assets/image/unused.png"), userimage: require("../../assets/image/unused.png"),
curCoupon:{couponName:'未选择可用优惠券'}, curCoupon:{couponName:'未选择可用优惠券'},
drawlist:[], drawlist:[],
@ -239,18 +251,113 @@ export default {
promotion: "¥167.00", promotion: "¥167.00",
payment: "¥0.00 ", payment: "¥0.00 ",
}, },
discountAmount:0,
finalAmount:0,
discountedProductCode:undefined,
}; };
}, },
computed: { computed: {
//
sumPrice() { sumPrice() {
return this.goldmedal.reduce((pre, cur) => { return this.goldmedal.reduce((pre, cur) => {
return pre + cur.buyCount * cur.productPrice; return pre + cur.buyCount * cur.productPrice;
}, 0); }, 0);
}, },
//
}, },
methods: { methods: {
...mapMutations(["checkIsLogin"]), ...mapMutations(["checkIsLogin"]),
discountedSumPrice() {
let total = 0;
if(this.curCoupon.productCodes)
this.finalAmount = this.qualifiedProductDiscount();
else
this.finalAmount = this.wholeOrderDiscount();
this.finalAmount = parseFloat(this.finalAmount).toFixed(2);
this.discountAmount = parseFloat(this.discountAmount).toFixed(2);
},
wholeOrderDiscount(){
this.discountedItemIndex = 0;
let checkResult = true;
if(this.curCoupon.minPrice && this.curCoupon.minPrice > this.sumPrice) {
checkResult = false;
}
if(this.curCoupon.couponAmount && this.curCoupon.couponAmount > this.sumPrice) {
checkResult = false;
}
if(checkResult) {
if(this.curCoupon.couponAmount && this.curCoupon.couponAmount>0) {
this.discountAmount = this.curCoupon.couponAmount;
return this.sumPrice - this.curCoupon.couponAmount;
} else if(this.curCoupon.discount && this.curCoupon.discount>0) {
this.discountAmount = this.sumPrice*this.curCoupon.discount;
return this.sumPrice * (1-this.curCoupon.discount);
}
} else {
return this.sumPrice;
}
},
qualifiedProductDiscount(){
this.discountedItemIndex = 0;
let total = 0;
let couponUsed = false;
let tmpShoppingCartList = this.arrSort(this.goldmedal);
for(let itemInCart of tmpShoppingCartList) {
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;
this.discountedProductCode = itemInCart.productCode;
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;
this.discountedProductCode = itemInCart.productCode;
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);
this.discountedProductCode = itemInCart.productCode;
couponUsed=true;
break;
default:
total += itemInCart.productPrice * itemInCart.buyCount;
break;
}
//Into coupon discount calculation end
}
} else {
total += itemInCart.productPrice * itemInCart.buyCount;
}
}
return total;
},
arrSort(arr) {
let userarr=[]
let a=[];
for(let i in arr){
arr[i].total=arr[i].productPrice*arr[i].buyCount;
if(arr[i].total){
userarr.push(arr[i]);
}
}
return userarr.sort((n1,n2)=>{
return n2.total-n1.total;
});
},
async getAddressList() { async getAddressList() {
let memberId = JSON.parse(localStorage.getItem("userInfo")).data.id; let memberId = JSON.parse(localStorage.getItem("userInfo")).data.id;
let { data } = await memberAddress("getAll", { memberId: memberId }); let { data } = await memberAddress("getAll", { memberId: memberId });
@ -278,19 +385,51 @@ export default {
async userdraw(mobile) { async userdraw(mobile) {
let data = await getdraw(mobile); let data = await getdraw(mobile);
let _self = this; let _self = this;
let curTime = new Date().getTime();
let valDateFromTime=0;
let valDateToTime=0;
let dateChecked=true;
if (data) { if (data) {
//TODO check status = 0
this.drawlist=[]; this.drawlist=[];
data.data.forEach((item) => { for(let itemInCart of this.goldmedal) {
if(item.status==0) { let tmpIndex=0;
_self.drawlist.push(item); 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(myCoupon.minQuantity && myCoupon.minQuantity>itemInCart.buyCount) {
dateChecked=false;
}
if(myCoupon.minPrice && myCoupon.minPrice>this.sumPrice) {
dateChecked=false;
}
if(dateChecked && myCoupon.activityId != 10 && myCoupon.status == 0 && (!myCoupon.productCodes || myCoupon.productCodes.indexOf(itemInCart.productCode)>-1)) {
data.data.splice(tmpIndex,1);
_self.drawlist.push(myCoupon);
}
tmpIndex++;
}
} }
});
} }
}, },
pickCoupon(item){ pickCoupon(item){
this.curCoupon = item; this.curCoupon = item;
this.dialogInfo1 = false; this.dialogInfo1 = false;
this.discountedSumPrice();
}, },
editAddress(item) { editAddress(item) {
this.dialogAddTitle = "修改收货地址"; this.dialogAddTitle = "修改收货地址";
@ -370,6 +509,7 @@ export default {
return; return;
} }
let postData = []; let postData = [];
let tmpCounter=0;
this.goldmedal.forEach((item) => { this.goldmedal.forEach((item) => {
let basePoint = (item.basePoint?item.basePoint:0); let basePoint = (item.basePoint?item.basePoint:0);
let oneProduct = { let oneProduct = {
@ -394,7 +534,7 @@ export default {
addressDetailInfo: orderAddress[0].detailAddress, addressDetailInfo: orderAddress[0].detailAddress,
}, },
}; };
if(this.curCoupon.couponId) { if(this.curCoupon.couponId && item.productCode == this.discountedProductCode) {
oneProduct.couponId = this.curCoupon.couponId; oneProduct.couponId = this.curCoupon.couponId;
oneProduct.couponTypeId = this.curCoupon.couponTypeId; oneProduct.couponTypeId = this.curCoupon.couponTypeId;
oneProduct.couponName = this.curCoupon.couponName; oneProduct.couponName = this.curCoupon.couponName;
@ -402,6 +542,7 @@ export default {
oneProduct.couponAmount = (this.curCoupon.couponAmount?this.curCoupon.couponAmount:this.curCoupon.discount); oneProduct.couponAmount = (this.curCoupon.couponAmount?this.curCoupon.couponAmount:this.curCoupon.discount);
} }
postData.push(oneProduct); postData.push(oneProduct);
tmpCounter++;
}); });
// let postData = [ // let postData = [
// { // {
@ -450,8 +591,8 @@ export default {
let res = await generateOrderWX(postData); let res = await generateOrderWX(postData);
if (res.success) { if (res.success) {
let userPayData = { let userPayData = {
orderId: res.data, orderId: res.data.orderNumber,
userprice: this.sumPrice, userprice: parseFloat(res.data.orderAmount).toFixed(2),
userinformation: userinformation:
postData[0].orderAddress.addressUserName + postData[0].orderAddress.addressUserName +
" " + " " +
@ -481,6 +622,7 @@ export default {
this.goldmedal = JSON.parse(this.$route.query.list); this.goldmedal = JSON.parse(this.$route.query.list);
this.getAddressList(); this.getAddressList();
this.checkIsLogin(); this.checkIsLogin();
this.finalAmount = this.sumPrice;
// this.addressstype = this.$route.query.stype; // this.addressstype = this.$route.query.stype;
// this.orderNumber = this.$route.query.orderNumber; // this.orderNumber = this.$route.query.orderNumber;
// this.canceldanhao(this.orderNumber); // this.canceldanhao(this.orderNumber);

View File

@ -320,7 +320,7 @@ export default {
this.useralllist[i].orderNumber = this.goldmedal[i].orderNumber; this.useralllist[i].orderNumber = this.goldmedal[i].orderNumber;
this.useralllist[i].status = this.goldmedal[i].status; this.useralllist[i].status = this.goldmedal[i].status;
this.useralllist[i].addressUserName = this.goldmedal[i].addressUserName; this.useralllist[i].addressUserName = this.goldmedal[i].addressUserName;
this.useralllist[i].phoneNumber = this.goldmedal[i].phoneNumber; this.useralllist[i].phoneNumber = this.goldmedal[i].addressPhoneNumber;
this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount; this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount;
// this.useralllist[i].picFile = this.goldmedal[i].picFile; // // this.useralllist[i].picFile = this.goldmedal[i].picFile; //
// this.useralllist[i].productName=this.goldmedal[i].productName;// // this.useralllist[i].productName=this.goldmedal[i].productName;//

View File

@ -19,7 +19,7 @@
<el-col :span="6" class="ready_right"> <el-col :span="6" class="ready_right">
<div class="inline_right"> <div class="inline_right">
<p>付款金额:</p> <p>付款金额:</p>
<p class="price">{{ userPayData.userprice }}</p> <p class="price" v-if="userPayData.userprice">{{ userPayData.userprice }}</p>
</div> </div>
<div class="inline_right"> <div class="inline_right">
<p>收货信息:</p> <p>收货信息:</p>
@ -64,7 +64,9 @@
<p>您的商品我们正在抓紧打包请耐心等候</p> <p>您的商品我们正在抓紧打包请耐心等候</p>
<div class="line_dashed"></div> <div class="line_dashed"></div>
<div class="userer"> <div class="userer">
<div class="qrcode"><vue-qr :text="qrtext" :size="260"></vue-qr></div> <div class="qrcode">
<img src="/images/qrcode-aichong.jpg">
</div>
<p>微信扫一扫识别二维码</p> <p>微信扫一扫识别二维码</p>
<p class="tips">加入社群0元试用商品随单发放</p> <p class="tips">加入社群0元试用商品随单发放</p>
</div> </div>
@ -94,7 +96,7 @@ export default {
activeIndex: 0, activeIndex: 0,
paymentTimer:undefined, paymentTimer:undefined,
isSucess: false, isSucess: false,
dialogSuccess: false, dialogSuccess: true,
paytype: "微信", paytype: "微信",
userpaystype: [ userpaystype: [
{ {

View File

@ -4,7 +4,7 @@
<Myheader></Myheader> <Myheader></Myheader>
<div class="rc-top"></div> <div class="rc-top"></div>
<tabs :crumbs="crumbs"></tabs> <tabs :crumbs="crumbs"></tabs>
<div class="online" id="fixed-catbar-seperator rc-margin--none"></div> <div class="online rc-margin--none" id="fixed-catbar-seperator"></div>
<div class="rc-top"></div> <div class="rc-top"></div>
<div <div
class=" class="
@ -187,7 +187,7 @@
<li> <li>
<span <span
><i class="ts-row-title">商品编号</i ><i class="ts-row-title">商品编号</i
><i>{{ curItem.brandCode }}</i></span ><i>{{ curItem.productCode }}</i></span
> >
</li> </li>
</ul> </ul>
@ -208,8 +208,8 @@
<FixRight></FixRight> <FixRight></FixRight>
<Myfooter v-on:litentop="showmesg"></Myfooter> <Myfooter v-on:litentop="showmesg"></Myfooter>
</div> </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="ts-no-data" v-if="usernewlist.length<=0">目前还没有可用的优惠券</div>
<div class="rs-dis"> <div class="rs-dis">
<div <div
class="rc-discount" class="rc-discount"
@ -219,17 +219,24 @@
<img :src="userimage" alt="" /> <img :src="userimage" alt="" />
<div class="rc-contair"> <div class="rc-contair">
<div class="rc-left"> <div class="rc-left">
<div v-if="item.couponAmount"> <div>
<i></i><span>{{ item.couponAmount }}</span> <i v-if="(item.couponTypeId!='4' && item.couponAmount>0)">
</i>
<span>
{{ item.couponAmount?item.couponAmount:(parseInt((item.discount)*10)+'折') }}
</span>
</div> </div>
<strong>{{ item.couponName }}</strong>
</div> </div>
<div class="rc-right"> <div class="rc-right">
<i> <i>
{{ item.couponDesc }} {{ item.couponName }}
</i> </i>
<div v-show="item.validTo"> <div class="rc-userfont">
<span>有效期</span> <strong>有效期</strong>
<em>{{ item.validTo }}</em> <span>{{item.validFrom}}</span>
<em>{{item.validTo}}</em>
</div> </div>
<div class="rc-footer"> <div class="rc-footer">
<span @click="usergetconf(item)">立即领取</span> <span @click="usergetconf(item)">立即领取</span>
@ -472,6 +479,7 @@ export default {
userclose() { userclose() {
this.userlist = []; this.userlist = [];
this.dialogInfo1=false;
}, },
async userquery() { async userquery() {
let data = await goodsmessage(this.productCode); let data = await goodsmessage(this.productCode);
@ -518,7 +526,7 @@ export default {
let alllist = []; let alllist = [];
this.userlist = this.alldraw.data; this.userlist = this.alldraw.data;
this.userlist.forEach((element, index) => { this.userlist.forEach((element, index) => {
if (typeof element.productCodes == "string") { if (typeof element.productCodes == "string" || !element.productCodes) {
userlist.push(element); userlist.push(element);
// let s=element.productCodes.split(','); // let s=element.productCodes.split(',');
// console.log(s.indexOf(this.productCode) != -1 ) // console.log(s.indexOf(this.productCode) != -1 )
@ -527,12 +535,36 @@ export default {
}); });
let menualist = []; let menualist = [];
userlist.filter((item) => { userlist.filter((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 && item.activityId!=10) {
if(!item.productCodes) {
menualist.push(item);
} else {
item.productCodes = item.productCodes.split(","); item.productCodes = item.productCodes.split(",");
item.productCodes.forEach((element) => { item.productCodes.forEach((element) => {
if (element == this.curItem.productCode && item.activityId !== 10) { if (element == this.curItem.productCode) {
menualist.push(item); menualist.push(item);
} }
}); });
}
} else {
//Expired coupons
}
}); });
this.usernewlist = menualist; this.usernewlist = menualist;
} }
@ -561,6 +593,8 @@ export default {
// let userid=JSON.parse(location.getItem('userInfo')); // let userid=JSON.parse(location.getItem('userInfo'));
// let mobile=JSON.parse(location.getItem('userInfo')); // let mobile=JSON.parse(location.getItem('userInfo'));
// console.log(userid,mobile); // console.log(userid,mobile);
let basePoint = item.basePoint;
basePoint = basePoint?basePoint:0;
let data = await postCourseId( let data = await postCourseId(
item.productCode, item.productCode,
this.sales_num, this.sales_num,
@ -571,7 +605,7 @@ export default {
item.ecPrice, item.ecPrice,
item.specifications, item.specifications,
item.leftAllotment, item.leftAllotment,
item.basePoint basePoint
); );
if (data) { if (data) {
this.productlist = data; this.productlist = data;
@ -623,7 +657,7 @@ export default {
this.dialogInfo2 = true; this.dialogInfo2 = true;
return; return;
} else { } else {
this.userdraw(this.usermessage.data.mobile); //this.userdraw(this.usermessage.data.mobile);
this.alldrawlist(this.usermessage.data.id); this.alldrawlist(this.usermessage.data.id);
this.dialogInfo1 = true; this.dialogInfo1 = true;
} }

View File

@ -110,7 +110,7 @@
</div> </div>
<div class="rc-column"> <div class="rc-column">
<div class="rc-click" @click="selectproduce(item)"> <div class="rc-click" @click="selectproduce(item)">
<span>{{ item.categoryName }}</span> <span>{{ item.name }}</span>
<i>{{ item.ecPrice?("¥"+item.ecPrice):'' }}</i> <i>{{ item.ecPrice?("¥"+item.ecPrice):'' }}</i>
</div> </div>
<strong <strong

View File

@ -256,10 +256,14 @@ export default {
else{ else{
//let user= JSON.parse(localStorage.getItem("userInfo")); //let user= JSON.parse(localStorage.getItem("userInfo"));
let data = await this.vadmsg(); let data = await this.vadmsg();
if(data.code=="1") console.log(data.code)
if(data.code=1)
{ {
console.log('---');
data=await useredit(this.tel); data=await useredit(this.tel);
if(data.code=='1'){ console.log(this.tel);
console.log(data);
if(data.code=1){
let couponId='0000000123'; let couponId='0000000123';
this.serdiscount(this.tel,couponId); this.serdiscount(this.tel,couponId);
setTimeout(() => { setTimeout(() => {

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB