Merge branch 'sit-Carl' into sit-Leung

This commit is contained in:
Vion 2022-01-24 22:36:48 +08:00
commit eed41ae763
20 changed files with 576 additions and 366 deletions

View File

@ -10,6 +10,7 @@ body {
border:unset;
}
.rc-menu--xs .rc-screen-reader{
left:28%;
}
@ -148,6 +149,9 @@ picture {
margin-left: auto;
margin-right: auto;
}
.useruantity{
margin: 1rem 1.25rem;
}
.ts-remove {
text-decoration: line-through;

View File

@ -279,7 +279,7 @@
align-items: center;
height: 164px;
.rc-usercenter{
width: 25%;
width: 27%;
em{
font-size: 18px;
}
@ -329,7 +329,7 @@
display: flex;
justify-content: space-between;
align-items: center;
width: 58%;
width: 56%;
font-size: 20px;
color: #E1001A;
font-weight: bold;

View File

@ -2,8 +2,110 @@ ul li ol li em strong i {
list-style: none;
font-style: normal;
}
.rc-main{
margin: 0;
padding: 0;
}
//手机端
@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{
width: 100%;
height: 80px;
@ -39,83 +141,7 @@ margin-right: 20px;
.rc-foo{
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 {
display: flex;
@ -207,14 +233,16 @@ margin-right: 20px;
.rc-merchandise {
width: 100%;
margin-top: 32px;
margin-top: 24px;
padding-right: 0.7rem;
padding-left: 0.7rem;
ul {
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
line-height: 26px;
line-height: 30px;
i {
font-style: normal;
color: #666666;
@ -240,10 +268,15 @@ margin-right: 20px;
}
}
}
.useruantity{
padding-right: 20px;
}
}
.rc-payment{
padding-right: 0.7rem;
padding-left: 0.7rem;
width: 100%;
margin-top: 32px;
.u-trackingnumber{
@ -293,7 +326,49 @@ margin-right: 20px;
//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{
display: none;
}
@ -329,7 +404,6 @@ margin-right: 20px;
.delivery {
display: flex;
flex-direction: column;
height: 140px;
display: flex;
justify-content: center;
.viewdetails{

View File

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

View File

@ -41,14 +41,14 @@
</div>
<div class="rc-right">
<i :style='usercolor'>
{{ item.couponName }}
{{ item.couponDesc }}
</i>
<div class="rc-userfont">
<strong>有效期</strong>
<span>{{item.validFrom}}</span>
<em>{{item.validTo}}</em>
</div>
<nuxt-link :to="`/productdetails/productlist`">
<nuxt-link :to="`/productdetails/productlist`" v-if="activeIndex==0">
<div class="ts-standard-btn">
立即使用
</div>

View File

@ -44,23 +44,23 @@
</div>
<div class="rc-usermain" >
<div class="rc-image">
<img src="../../static/images/default.jpg" alt="" />
<img :src= item.picFile alt="" />
</div>
<div class="rc-right" @click="usertiaozhuan(item)">
<div class="rc-usercenter">
<em>{{ item.usereat }}</em>
<em>{{ item.productName }}</em>
<div class="rc-userright">
<span>规格:{{ item.num }}</span>
<span>规格:{{ item.specifications }}</span>
</div>
</div>
<div class="rc-userbottom">
<span>数量:{{ item.pcs }}</span>
<i>10</i>
<i>{{item.ecPrice}}</i>
</div>
<div class="rc-userbottomm">
<i>{{ item.userprice }}</i>
<span>{{ item.orderstype }}</span>
<i>{{ item.userprice }}</i>
<i>{{ item.ecPrice }}</i>
<span>{{ item.pcs }}</span>
<i>{{ item.salesAmount }}</i>
</div>
</div>
@ -320,8 +320,14 @@ export default {
this.useralllist[i].orderNumber = this.goldmedal[i].orderNumber;
this.useralllist[i].status = this.goldmedal[i].status;
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].picFile = this.goldmedal[i].picFile; //
// this.useralllist[i].productName=this.goldmedal[i].productName;//
// this.useralllist[i].ecPrice=this.goldmedal[i].ecPrice//
// this.useralllist[i].pcs=this.goldmedal[i].pcs//
this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length
}
console.log(this.obligation)

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -0,0 +1,28 @@
//时间戳转化成格式时间
import Vue from 'vue';
Vue.prototype.formatConversion = function (te){
if(te == ''){
return '';
}else if(te.length == 10){
var time = new Date(te * 1000); //时间戳为10位需*1000时间戳为13位的话不需乘1000
var y = time.getFullYear();
var m = time.getMonth() < 9 ? '0' + (time.getMonth() + 1) : time.getMonth() + 1;
var d = time.getDate() < 10 ? '0' + time.getDate() : time.getDate();
var h = time.getHours() < 10 ? '0' + time.getHours() : time.getHours();
var mm = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
var s = time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds();
var timedate = y + '-' + m + '-' + d + ' ' + h + ':' + mm + ':' + s;
return timedate;
}else{
var time = new Date(te);
var y = time.getFullYear();
var m = time.getMonth() < 9 ? '0' + (time.getMonth() + 1) : time.getMonth() + 1;
var d = time.getDate() < 10 ? '0' + time.getDate() : time.getDate();
var h = time.getHours() < 10 ? '0' + time.getHours() : time.getHours();
var mm = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
var s = time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds();
var timedate = y + '-' + m + '-' + d + ' ' + h + ':' + mm + ':' + s;
return timedate;
}
}

View File

@ -44,6 +44,7 @@ public class ResponseDTO<T> {
this.success = responseCodeConst.isSuccess();
}
private ResponseDTO(ResponseCodeConst responseCodeConst) {
this.code = responseCodeConst.getCode();
this.msg = responseCodeConst.getMsg();
@ -64,6 +65,8 @@ public class ResponseDTO<T> {
return new ResponseDTO(ResponseCodeConst.SUCCESS, data, msg);
}
public static <T> ResponseDTO<T> succData(T data) {
return new ResponseDTO(ResponseCodeConst.SUCCESS, data);
}

View File

@ -12,6 +12,8 @@ import net.lab1024.smartadmin.constant.SwaggerTagConst;
import net.lab1024.smartadmin.module.system.alipay.AliPayService;
import net.lab1024.smartadmin.module.system.alipay.alipayModel.AliPayEntity;
import net.lab1024.smartadmin.module.system.alipay.conf.AlipayConfig;
import net.lab1024.smartadmin.module.system.royalcanin.CouponService;
import net.lab1024.smartadmin.module.system.royalcanin.coupon.CouponGetAllEntity;
import net.lab1024.smartadmin.module.system.royalcanin.good.constant.OrderResponseCodeConst;
import net.lab1024.smartadmin.module.system.royalcanin.good.model.OrderAddress;
import net.lab1024.smartadmin.module.system.royalcanin.good.model.OrderEntity;
@ -51,10 +53,13 @@ public class OrderController {
@Autowired
private CartService cartService;
@Autowired
private CouponService couponService;
@ApiOperation(value = "微信支付订单", notes = "生成订单")
@PostMapping("royalcanin/generateOrderWX")
public ResponseDTO<String> generateOrderWX(@RequestBody List<OrdersEntity> ordersEntityList) throws Exception {
public ResponseDTO<Map<String, String>> generateOrderWX(@RequestBody List<OrdersEntity> ordersEntityList) throws Exception {
StringBuffer productId = new StringBuffer();
StringBuffer productName = new StringBuffer();
String memberId = "";
@ -76,10 +81,18 @@ public class OrderController {
orderDatilListEntity.setEcPrice(ordersEntitys.getPayAmount());
orderDatilListJson.add(orderDatilListEntity);
if(ordersEntitys.getCouponCode() != "" && ordersEntitys.getCouponCode() != null) {
ordersEntity.setCouponAmount(ordersEntitys.getCouponAmount());
ordersEntity.setCouponCode(ordersEntitys.getCouponCode());
ordersEntity.setCouponName(ordersEntitys.getCouponName());
ordersEntity.setCouponId(ordersEntitys.getCouponId());
CouponGetAllEntity couponGetAllEntity = new CouponGetAllEntity ();
couponGetAllEntity.setMemberId(ordersEntitys.getMemberId());
couponGetAllEntity.setCouponCode(ordersEntitys.getCouponCode());
String couponInfo = couponService.couponGetAll(couponGetAllEntity);
JSONObject jsonObject = JSONObject.parseObject(couponInfo);
com.alibaba.fastjson.JSONArray jsonArray = JSONObject.parseArray(jsonObject.getString("data"));
JSONObject jsonObjectData = (JSONObject)jsonArray.get(0);
ordersEntity.setCouponAmount(jsonObjectData.getString("couponAmount") == null ?jsonObjectData.getString("discount"):jsonObjectData.getString("couponAmount"));
ordersEntity.setCouponCode(jsonObjectData.getString("couponCode"));
ordersEntity.setCouponName(jsonObjectData.getString("couponName"));
ordersEntity.setCouponId(jsonObjectData.getString("couponId"));
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() ;
@ -112,7 +125,10 @@ public class OrderController {
wxPayEntity.setProduct_id(ordersEntity.getProductCode());
wxPayEntity.setTotal_fee(StringUtil.toString(total_fee));
wxPayEntity.setOut_trade_no(ordersEntity.getOrderNo());
return ResponseDTO.succData(ordersEntity.getOrderNo(),wxpayService.generateQRCode(wxPayEntity));
Map<String, String> returnMap = new HashMap<>();
returnMap.put("orderNumber",ordersEntity.getOrderNo());
returnMap.put("orderAmount",ordersEntity.getOrderAmount());
return ResponseDTO.succData(returnMap,wxpayService.generateQRCode(wxPayEntity));
}
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_FAIL);
}
@ -171,7 +187,6 @@ public class OrderController {
ordersEntity.setBuyCount(buyCount);
ordersEntity.setOrderNo(GenerateSequenceUtil.generateSequenceNo());
ordersEntity.setOrderStatus("0");
if(orderService.generateOrder(ordersEntity,orderDatilListJson) == 1){
wxPayEntity.setProduct_id(ordersEntity.getProductCode());
wxPayEntity.setTotal_fee(StringUtil.toString(total_fee));
@ -252,7 +267,7 @@ public class OrderController {
AliPayEntity aliPayEntity = new AliPayEntity();
ordersEntity.setPayType("2");
ordersEntity.setOrderStatus("0");
if (orderService.updateOrder(ordersEntity) == 1) {
if (orderService.updateOrder(ordersEntity.getOrderNo()) == 1) {
aliPayEntity.setProduct_code(ordersEntity.getProductCode());
aliPayEntity.setTotal_amount(ordersEntity.getOrderAmount());
aliPayEntity.setOut_trade_no(ordersEntity.getOrderNo());

View File

@ -22,4 +22,6 @@ public interface OrdersDao extends BaseMapper<OrderEntity> {
Integer cancelOrder(String out_trade_no);
int updateByOrderNumber (@Param("orderNumber")String orderNumber);
}

View File

@ -41,6 +41,6 @@ public class OrdersEntity {
private OrderAddress orderAddress;
private Double basePoint;
private Double basePoint = 0.0;
}

View File

@ -281,7 +281,7 @@ public class OrderService {
}
public int updateOrder(OrderEntity orderEntity){
return ordersDao.updateById(orderEntity);
public int updateOrder(String orderNumber){
return ordersDao.updateByOrderNumber(orderNumber);
}
}

View File

@ -11,8 +11,8 @@ import java.io.*;
@Component
public class MyConfig implements WXPayConfig {
// private String path ="C:/Users/Administrator/IdeaProjects/smart-admin/smart-admin-service/smart-admin-api/src/main/resources/wxpay/";
private String path ="/home/royalcanin-dev/cert/";
// private String path ="C:/Users/Administrator/IdeaProjects/smart-admin/smart-admin-service/smart-admin-api/src/main/resources/wxpay/pro/";
private String path ="/home/royalcanin-dev/cert/pro/";
// public String notify_url = "http://47.96.75.242:10086/smart-admin-api/royalcanin/updateOrderWX";
@ -34,18 +34,22 @@ public class MyConfig implements WXPayConfig {
certStream.close();
}
public String getAppID() {
return "wx3c51c14272f63a64";
return "wxa9a0ae603bbe6ceb";
}
//wxa9a0ae603bbe6ceb
//wx3c51c14272f63a64
public String getMchID() {
return "1315161001";
// public String getMchID() {
// return "16717629989";
// }
public String getMchID() {
return "1523977801";
}
// 16717629989
//1315161001
public String getKey() {
return "b69497999e8fd1f8f1f0a9591b24eb72";
return "indexphpcorecertapicert201903200";
}
//indexphpcorecertapicert201903200
//b69497999e8fd1f8f1f0a9591b24eb72
public InputStream getCertStream() {
ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);

View File

@ -1,6 +1,7 @@
package net.lab1024.smartadmin.module.system.wxpay;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.oss.internal.SignUtils;
import net.lab1024.smartadmin.common.heartbeat.StringUtil;
import net.lab1024.smartadmin.module.system.royalcanin.MemberAccountService;
import net.lab1024.smartadmin.module.system.royalcanin.good.model.OrderEntity;

View File

@ -22,4 +22,10 @@
</update>
<update id="updateByOrderNumber" >
update t_good_orders
set pay_type ='2'
where order_no = #{orderNumber}
</update>
</mapper>

View File

@ -0,0 +1,23 @@
-----BEGIN CERTIFICATE-----
MIID6TCCAtGgAwIBAgIUMO4qJG/XR9oQeHQphVQ7usz5/0YwDQYJKoZIhvcNAQEL
BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT
FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg
Q0EwHhcNMjIwMTI0MDgxMTA3WhcNMjcwMTIzMDgxMTA3WjB7MRMwEQYDVQQDDAox
NTIzOTc3ODAxMRswGQYDVQQKDBLlvq7kv6HllYbmiLfns7vnu58xJzAlBgNVBAsM
HuS4iua1t+aHi+avheWVhui0uOaciemZkOWFrOWPuDELMAkGA1UEBgwCQ04xETAP
BgNVBAcMCFNoZW5aaGVuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
yRnwfm/9lHyq16cAJjx8/7x9WQF+/mKry6MvJIquaXUXBQKDO3d4deBLq8By7dXD
xi7S7bPFeUkjXhgxs/WD15xyzNZj4qpKmXuEaFi0g1VLNUs3RmlWaR9OX0On+G2X
vj4Zw1bi7sbefA1UrgNB7CH6nAaIVVWDdggxnUeX18F1y7BUBjPBh64Trbi0n011
U/m738gyH37tfcSZCMM7aBO4/8BqRmRmNr58Owci8ee7G2yybGbRyVpT/3Y7cWLt
k4pyOavIjpmaIo/CPbwMC5hOR4fxwyZUaTpyZh7foQFytz05UHvxp35hKZLnxI2d
U+0wtymYYx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