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
03f91822aa
@ -479,19 +479,20 @@ export const goodsmessage = (productCode) => {
|
||||
|
||||
|
||||
//微信支付
|
||||
export const generateOrderWX = (list) => {
|
||||
var data = [{
|
||||
|
||||
|
||||
}]
|
||||
return fetch('generateOrderWX', list, 'POST' )
|
||||
export const generateOrderWX = (list,isH5Pay) => {
|
||||
if(!isH5Pay)
|
||||
return fetch('generateOrderWX', list, 'POST' )
|
||||
else
|
||||
return fetch('generateOrderWXH5', list, 'POST' )
|
||||
}
|
||||
|
||||
//再次支付
|
||||
export const repayOrde = (ordernumber) => {
|
||||
console.log(ordernumber);
|
||||
return fetch('repayOrderWX?orderNo='+ordernumber,'', 'POST' )
|
||||
}
|
||||
export const repayOrde = (ordernumber,isH5Pay) => {
|
||||
if(!isH5Pay)
|
||||
return fetch('repayOrderWX?orderNo='+ordernumber,'', 'POST' )
|
||||
else
|
||||
return fetch('repayOrderWXH5?orderNo='+ordernumber,'', 'POST' )
|
||||
}
|
||||
//用户所有的优惠券
|
||||
export const allConfig = (memberId,channelSecurity,mobile) => {
|
||||
var data = {
|
||||
|
64
rc-busness/ajax/util.js
Normal file
64
rc-busness/ajax/util.js
Normal file
@ -0,0 +1,64 @@
|
||||
/*
|
||||
export const isMobile = () => {
|
||||
var sUserAgent = navigator.userAgent.toLowerCase();
|
||||
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
|
||||
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
|
||||
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
|
||||
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
|
||||
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
|
||||
var bIsAndroid = sUserAgent.match(/android/i) == "android";
|
||||
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
|
||||
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
|
||||
if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
export default {
|
||||
isMobile :false
|
||||
}
|
||||
|
||||
/*
|
||||
export default {
|
||||
isMobile(){
|
||||
var sUserAgent = navigator.userAgent.toLowerCase();
|
||||
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
|
||||
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
|
||||
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
|
||||
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
|
||||
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
|
||||
var bIsAndroid = sUserAgent.match(/android/i) == "android";
|
||||
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
|
||||
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
|
||||
if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
function isMobile() {
|
||||
var sUserAgent = navigator.userAgent.toLowerCase();
|
||||
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
|
||||
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
|
||||
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
|
||||
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
|
||||
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
|
||||
var bIsAndroid = sUserAgent.match(/android/i) == "android";
|
||||
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
|
||||
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
|
||||
if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export { isMobile }
|
||||
*/
|
@ -543,7 +543,11 @@ picture {
|
||||
.rc-top {
|
||||
margin-top: 124px;
|
||||
}
|
||||
|
||||
|
||||
.useruantity{
|
||||
margin: 1rem 0rem;
|
||||
}
|
||||
|
||||
.ts-product-list {
|
||||
text-align: left;
|
||||
//display:block;
|
||||
|
@ -6,6 +6,12 @@ ul li ol li em strong i {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ts-button-container {
|
||||
cursor: pointer;
|
||||
display:flex;
|
||||
flex-direction:row;
|
||||
}
|
||||
//手机端
|
||||
@media screen and (max-width: 768px) {
|
||||
.online{
|
||||
@ -36,6 +42,11 @@ ul li ol li em strong i {
|
||||
|
||||
}
|
||||
}
|
||||
.ts-button-container {
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
box-shadow: 0px -5px 6px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
//快递列表
|
||||
.delivery {
|
||||
display: flex;
|
||||
@ -103,34 +114,6 @@ ul li ol li em strong i {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.rc-margin-y--md{
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px -5px 6px rgba(0, 0, 0, 0.1);
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
margin: 0;
|
||||
.ts-standard-btn{
|
||||
width: 155px;
|
||||
height: 48px;
|
||||
background: #E2001A;
|
||||
border-radius: 30px;
|
||||
color: #FFFFFF;
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
.rc-main {
|
||||
.rc-userbottom{
|
||||
display: none;
|
||||
@ -326,8 +309,15 @@ margin-right: 20px;
|
||||
|
||||
|
||||
//pc端
|
||||
@media screen and (min-width: 768px){
|
||||
@media screen and (min-width: 769px){
|
||||
|
||||
.ts-button-container{
|
||||
.ts-standard-btn{
|
||||
&:first-child{
|
||||
margin-right:1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
//快递列表
|
||||
.delivery {
|
||||
display: flex;
|
||||
@ -369,9 +359,6 @@ margin-right: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.rc-margin-y--md{
|
||||
display: none;
|
||||
}
|
||||
.rc-main {
|
||||
margin: 0 auto;
|
||||
margin-top: 90px;
|
||||
@ -501,17 +488,18 @@ margin-right: 20px;
|
||||
display: none;
|
||||
}
|
||||
.rc-usercenter{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
em {
|
||||
font-style: normal;
|
||||
display: block;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-top: 17px;
|
||||
color: #e1001a;
|
||||
}
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
em {
|
||||
font-style: normal;
|
||||
display: block;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-top: 17px;
|
||||
color: #e1001a;
|
||||
width:16rem;
|
||||
}
|
||||
}
|
||||
|
||||
display: flex;
|
||||
@ -678,21 +666,6 @@ margin-right: 20px;
|
||||
font-size: 26px;
|
||||
|
||||
}
|
||||
span{
|
||||
display: block;
|
||||
width: 164px;
|
||||
margin-top: 36px;
|
||||
background: #E2001A;
|
||||
line-height: 48px;
|
||||
text-align: center;
|
||||
color: white;
|
||||
font-size: 16px;
|
||||
|
||||
height: 48px;
|
||||
|
||||
border-radius: 30px;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -364,6 +364,7 @@ export default {
|
||||
let usernot=this.$store.state.userInfo;
|
||||
//console.log(usernot);
|
||||
if(usernot){
|
||||
window._hmt.push(['_setUserId', usernot.data.mobile]);
|
||||
this.loginornot=false
|
||||
}else{
|
||||
this.loginornot=true
|
||||
|
@ -4,7 +4,7 @@ export default {
|
||||
|
||||
// Global page headers: https://go.nuxtjs.dev/config-head
|
||||
head: {
|
||||
title: '皇家官方商城',
|
||||
title: '皇家宠物食品官方商城',
|
||||
|
||||
htmlAttrs: {
|
||||
lang: 'zh-cn',
|
||||
|
@ -19,8 +19,7 @@
|
||||
}}</em>
|
||||
<span>{{ orderstatus }}</span>
|
||||
</div>
|
||||
<div class="online bold">
|
||||
</div>
|
||||
<div class="online bold"></div>
|
||||
<div class="delivery useruantity" v-if="isshow">
|
||||
<div class="to-delivery">
|
||||
<img src="../../static/images/delivery.png" alt="">
|
||||
@ -36,7 +35,7 @@
|
||||
<img :src="leftico" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="online bold">
|
||||
<div class="online bold" v-if="isshow">
|
||||
</div>
|
||||
<div class="mypersonal useruantity">
|
||||
<div class="my-delivery">
|
||||
@ -72,12 +71,7 @@
|
||||
<div class="rc-userbottom">
|
||||
<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-userbottomm">
|
||||
<i>¥{{ item.userprice }}</i>
|
||||
@ -115,19 +109,19 @@
|
||||
<div class="rc-payment">
|
||||
<ul>
|
||||
<li>
|
||||
<span>订单编号::</span>
|
||||
<span>订单编号:</span>
|
||||
<i>{{ item.orderNumber }}</i>
|
||||
</li>
|
||||
<li>
|
||||
<span>下单时间::</span>
|
||||
<span>下单时间:</span>
|
||||
<i>{{ logisticsDate }}</i>
|
||||
</li>
|
||||
<li>
|
||||
<span>付款方式::</span>
|
||||
<i>{{ information.paymentmethod }}</i>
|
||||
<span>付款方式:</span>
|
||||
<i>{{ information.paytype }}</i>
|
||||
</li>
|
||||
<li>
|
||||
<span>配送方式::</span>
|
||||
<span>配送方式:</span>
|
||||
<i>{{ information.distribution }}</i>
|
||||
</li>
|
||||
<li>
|
||||
@ -142,21 +136,23 @@
|
||||
|
||||
<div class="rc-foot">
|
||||
<div class="rc-foo">
|
||||
<div style="padding-top: 55px">
|
||||
<div style="">
|
||||
<i>合计金额:</i>
|
||||
<em>¥{{ usersalesAmount }}</em>
|
||||
</div>
|
||||
<div style="padding-bottom: 40px; cursor: pointer">
|
||||
<span @click="onceagain(item)"> {{ payorsucess }}</span>
|
||||
<div class="rc-md-up ts-button-container rc-padding-y--md">
|
||||
<span class="ts-standard-btn ts-standard-btn--two" @click="userpay(item)">{{ customer }}</span>
|
||||
<span class="ts-standard-btn" @click="onceagain(item)"> {{ payorsucess }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rc-full-width rc-margin-y--md">
|
||||
<div class="rc-full-width rc-md-down ts-button-container rc-padding-y--md rc-margin-top--md">
|
||||
<span class="ts-standard-btn ts-standard-btn--two" @click="userpay(item)">{{ customer }}</span>
|
||||
<i
|
||||
class="ts-standard-btn ts-standard-btn--two center"
|
||||
class="ts-standard-btn"
|
||||
@click="onceagain()"
|
||||
>
|
||||
{{ payorsucess }}
|
||||
@ -170,15 +166,16 @@
|
||||
<script>
|
||||
import Myheader from "~/components/header.vue";
|
||||
import { mapMutations } from "vuex";
|
||||
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 {
|
||||
userin,
|
||||
selectaddress,
|
||||
canceldanhao,
|
||||
generateOrderWX,
|
||||
repayOrde
|
||||
} from "../../ajax/getData";
|
||||
|
||||
export default {
|
||||
@ -211,17 +208,15 @@ export default {
|
||||
useralllist: [],
|
||||
delivery: [],
|
||||
|
||||
useraddress: [],
|
||||
|
||||
goldmedal: [],
|
||||
shopprice: {},
|
||||
information: {
|
||||
reference: "1111111111111111",
|
||||
ordertime: "2012-12-01 11:20:00",
|
||||
paymentmethod: "微信支付",
|
||||
distribution: "快递",
|
||||
trackingnumber: "11111111111111",
|
||||
catimage: require("../../assets/image/rc-left.png"),
|
||||
useraddress: [],
|
||||
shopprice: {},
|
||||
information: {
|
||||
reference: "1111111111111111",
|
||||
ordertime: "2012-12-01 11:20:00",
|
||||
paytype: "微信支付",
|
||||
distribution: "快递",
|
||||
trackingnumber: "11111111111111",
|
||||
catimage: require("../../assets/image/rc-left.png"),
|
||||
},
|
||||
};
|
||||
},
|
||||
@ -250,9 +245,10 @@ export default {
|
||||
}
|
||||
},
|
||||
userpay() {
|
||||
console.log("---");
|
||||
if (this.goldastates == 0) {
|
||||
this.canceldanhao();
|
||||
if(confirm('确认要取消该订单嘛?')) {
|
||||
this.canceldanhao();
|
||||
}
|
||||
} else if ((this.customer = "联系客服申请售后")) {
|
||||
var option = {
|
||||
customer: {
|
||||
@ -267,72 +263,81 @@ export default {
|
||||
}
|
||||
},
|
||||
//订单支付和再次购买
|
||||
onceagain(item) {
|
||||
console.log(this.payorsucess);
|
||||
if (this.payorsucess == "立即支付") {
|
||||
console.log("----");
|
||||
this.getwei(item);
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: "/productdetails/producted",
|
||||
query: {
|
||||
stype: 1,
|
||||
productCode: this.userproductId,
|
||||
},
|
||||
});
|
||||
console.log("不是立即支付");
|
||||
}
|
||||
},
|
||||
onceagain(item) {
|
||||
if (this.payorsucess == "立即支付") {
|
||||
this.getwei(item);
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: "/productdetails/producted",
|
||||
query: {
|
||||
stype: 1,
|
||||
productCode: this.userproductId,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
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.goldmedal = data;
|
||||
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.paytype = (this.goldmedal[i].paytype=="1"?'微信支付':'支付宝');
|
||||
}
|
||||
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),
|
||||
},
|
||||
});
|
||||
let data = await this.repayOrde(this.orderNumber);
|
||||
if(data.code==1) {
|
||||
let userPayData = {
|
||||
userprice: this.usersalesAmount,
|
||||
orderId: this.orderNumber,
|
||||
userinformation: this.addressUserName + " " + this.addressPhoneNumber,
|
||||
wxPay:data.msg
|
||||
};
|
||||
|
||||
this.$router.push({
|
||||
path: "/personal/userpay",
|
||||
query: {
|
||||
userData: this.orderNumber,
|
||||
stype: 1,
|
||||
userPayData: JSON.stringify(userPayData),
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "订单数据错误,请联系客服进行处理",
|
||||
});
|
||||
}
|
||||
},
|
||||
async repayOrde(ordernumber) {
|
||||
let mobileResult = this.isMobile();
|
||||
let res = await repayOrde(ordernumber, mobileResult);
|
||||
if (res) {
|
||||
return res;
|
||||
}
|
||||
},
|
||||
async editaddress(user) {
|
||||
// user.data.id=844350;
|
||||
let data = await selectaddress(this.userid);
|
||||
@ -348,11 +353,26 @@ export default {
|
||||
|
||||
// console.log(this.list);
|
||||
},
|
||||
isMobile () {
|
||||
var sUserAgent = navigator.userAgent.toLowerCase();
|
||||
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
|
||||
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
|
||||
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
|
||||
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
|
||||
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
|
||||
var bIsAndroid = sUserAgent.match(/android/i) == "android";
|
||||
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
|
||||
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
|
||||
if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.checkIsLogin();
|
||||
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;
|
||||
@ -367,7 +387,6 @@ export default {
|
||||
this.userisdelivery = "待发货";
|
||||
this.customer = "联系客服申请售后";
|
||||
this.payorsucess = "再次购买";
|
||||
console.log(this.orderstatus);
|
||||
} else if (this.addressstype == 0) {
|
||||
this.orderstatus = "您的订单还未付款,请尽快付款!";
|
||||
this.isshow = false;
|
||||
@ -387,7 +406,6 @@ export default {
|
||||
this.customer = "联系客服申请售后";
|
||||
this.payorsucess = "再次购买";
|
||||
}
|
||||
console.log(this.addressstype);
|
||||
},
|
||||
components: {
|
||||
Myheader,
|
||||
@ -397,6 +415,5 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import url("../../assets/css/global.less");
|
||||
@import url("../../assets/css/usertion.less");
|
||||
</style>
|
@ -608,6 +608,9 @@ ul li ol li em strong i {
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
div:first-child {
|
||||
text-align: left;;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -588,7 +588,8 @@ export default {
|
||||
// // },
|
||||
// // },
|
||||
// ];
|
||||
let res = await generateOrderWX(postData);
|
||||
let isMobile = this.isMobile();
|
||||
let res = await generateOrderWX(postData,isMobile);
|
||||
if (res.success) {
|
||||
let userPayData = {
|
||||
orderId: res.data.orderNumber,
|
||||
@ -599,7 +600,7 @@ export default {
|
||||
postData[0].orderAddress.addressPhoneNumber,
|
||||
// wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
|
||||
// wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
|
||||
wxPay: res.msg,
|
||||
wxPay: (res.msg?res.msg:''),
|
||||
};
|
||||
this.$router.push({
|
||||
path: "/personal/userpay",
|
||||
@ -617,6 +618,22 @@ export default {
|
||||
async canceldanhao(orderNumber) {
|
||||
let data = await userin(orderNumber);
|
||||
},
|
||||
isMobile () {
|
||||
var sUserAgent = navigator.userAgent.toLowerCase();
|
||||
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
|
||||
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
|
||||
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
|
||||
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
|
||||
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
|
||||
var bIsAndroid = sUserAgent.match(/android/i) == "android";
|
||||
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
|
||||
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
|
||||
if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.goldmedal = JSON.parse(this.$route.query.list);
|
||||
|
@ -396,16 +396,18 @@ export default {
|
||||
|
||||
userpay(item, index) {
|
||||
if (item.status == 0) {
|
||||
this.canceldanhao(item.orderNumber);
|
||||
setTimeout(() => {
|
||||
this.indet(this.userdata);
|
||||
this.useralllist=[];
|
||||
this.alllist=[];
|
||||
this.allmessage=[];
|
||||
this.obligation=[];
|
||||
this.receiving=[];
|
||||
this.pending=[];
|
||||
}, 500);
|
||||
if(confirm('确认取消该订单嘛?')){
|
||||
this.canceldanhao(item.orderNumber);
|
||||
setTimeout(() => {
|
||||
this.indet(this.userdata);
|
||||
this.useralllist=[];
|
||||
this.alllist=[];
|
||||
this.allmessage=[];
|
||||
this.obligation=[];
|
||||
this.receiving=[];
|
||||
this.pending=[];
|
||||
}, 500);
|
||||
}
|
||||
} else if(item.status == 1) { //确认收货
|
||||
|
||||
}
|
||||
|
@ -42,16 +42,27 @@
|
||||
:key="index"
|
||||
@click="selectGoods(item, index)"
|
||||
:class="activeIndex == index ? 'active' : ''"
|
||||
v-if="(!disableAlipay || (disableAlipay && item.type!='alipay'))"
|
||||
>
|
||||
<img :src="item.payimage" alt="" />
|
||||
<span>{{ item.paytype }}支付</span>
|
||||
|
||||
<div style="display:flex;">
|
||||
<img :src="item.payimage" alt="" />
|
||||
<span>{{ item.paytype }}支付</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="paycord">
|
||||
<div class="qrcode"><vue-qr :text="qrtext" :size="260"></vue-qr></div>
|
||||
|
||||
<div class="payconfirm rc-padding-y--md" v-if="disableQrcode">
|
||||
<span class="ts-standard-btn ts-standard-btn--two center" @click="goPayH5">
|
||||
确认支付
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="paycord" v-if="!disableQrcode">
|
||||
<div class="qrcode"><vue-qr :text="qrtext" :size="260"></vue-qr></div>
|
||||
<span>{{ paytype }}扫一扫立即支付</span>
|
||||
</div>
|
||||
|
||||
@ -65,7 +76,8 @@
|
||||
<div class="line_dashed"></div>
|
||||
<div class="userer">
|
||||
<div class="qrcode">
|
||||
<img src="/images/paysucess.jpg">
|
||||
|
||||
<img src="/images/qrcode-wxgroup.jpg">
|
||||
</div>
|
||||
<p>微信扫一扫,识别二维码</p>
|
||||
<p class="tips">加入社群0元试用商品随单发放</p>
|
||||
@ -89,50 +101,108 @@ import Myheader from "~/components/header.vue";
|
||||
import tabs from "@/components/tabs.vue";
|
||||
import vueQr from 'vue-qr'
|
||||
|
||||
|
||||
import { generateOrderAlipay, updateOrderWX, monitorOrderNotify,repayOrde } from "../../ajax/getData";
|
||||
//import { isMobile } from "@/ajax/util";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeIndex: 0,
|
||||
paymentTimer:undefined,
|
||||
isSucess: false,
|
||||
dialogSuccess: true,
|
||||
|
||||
dialogSuccess: false,
|
||||
paytype: "微信",
|
||||
userpaystype: [
|
||||
{
|
||||
paytype: "微信",
|
||||
payimage: require("../../assets/pay/wx.png"),
|
||||
type:'wechat'
|
||||
},
|
||||
/*
|
||||
|
||||
{
|
||||
paytype: "支付宝",
|
||||
payimage: require("../../assets/pay/zfb.png"),
|
||||
type:'alipay'
|
||||
},
|
||||
*/
|
||||
|
||||
],
|
||||
dialogFail: false,
|
||||
userPayData: {},
|
||||
qrtext:'',
|
||||
userData:'',
|
||||
disableAlipay:true,
|
||||
disableQrcode:false,
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
|
||||
created(){
|
||||
|
||||
},
|
||||
mounted() {
|
||||
let stype=this.$route.query.stype;
|
||||
console.log(stype)
|
||||
if(stype==1){
|
||||
this.userData = this.$route.query.userData;
|
||||
this.repayOrde(this.userData);
|
||||
this.userPayData = JSON.parse(this.$route.query.userPayData);
|
||||
console.log(this.userPayData);
|
||||
}else{
|
||||
this.userPayData = JSON.parse(this.$route.query.userPayData);
|
||||
console.log(this.userPayData);
|
||||
}
|
||||
this.qrtext=this.userPayData.wxPay
|
||||
this.payOrderWX();
|
||||
|
||||
this.userPayData = JSON.parse(this.$route.query.userPayData);
|
||||
this.defaultHandlePayment();
|
||||
},
|
||||
methods: {
|
||||
defaultHandlePayment() {
|
||||
let isMobile = this.isMobile();
|
||||
let isWx = this.isWX();
|
||||
if(isWx && this.userPayData.wxPay && this.userPayData.wxPay.length>4) {
|
||||
//Desktop, use native pay
|
||||
this.disableQrcode=false;
|
||||
this.qrtext=this.userPayData.wxPay;
|
||||
} else if(isWx) {
|
||||
throw new Error("订单信息错误,请删除商品后再次购买");
|
||||
}
|
||||
|
||||
if(!isWx) {
|
||||
if(this.userPayData.wxPay && !isMobile) {
|
||||
//Desktop, use native pay
|
||||
this.qrtext=this.userPayData.wxPay;
|
||||
this.payOrderWX();
|
||||
this.disableQrcode=false;
|
||||
} else if (this.userPayData.wxPay && isMobile) {
|
||||
//Mobile, use H5 pay
|
||||
this.disableQrcode=true;
|
||||
} else if(!this.userPayData.wxPay || this.userPayData.wxPay.length<=4) {
|
||||
throw new Error("订单信息错误,请删除商品后再次购买");
|
||||
}
|
||||
}
|
||||
},
|
||||
goPayH5() {
|
||||
let isMobile = this.isMobile();
|
||||
if(this.userPayData.wxPay && isMobile) {
|
||||
window.location.href=this.userPayData.wxPay;
|
||||
this.disableQrcode=true;
|
||||
} else {
|
||||
throw new Error("订单信息错误,请删除商品后再次购买");
|
||||
}
|
||||
},
|
||||
|
||||
isMobile () {
|
||||
var sUserAgent = navigator.userAgent.toLowerCase();
|
||||
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
|
||||
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
|
||||
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
|
||||
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
|
||||
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
|
||||
var bIsAndroid = sUserAgent.match(/android/i) == "android";
|
||||
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
|
||||
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
|
||||
if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
/**/
|
||||
isWX(){
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
return (/micromessenger/.test(ua)) ? true : false;
|
||||
},
|
||||
closeDialogSuccess() {
|
||||
this.qrtext = '';
|
||||
this.$router.push({
|
||||
@ -149,27 +219,22 @@ export default {
|
||||
// path: "/personal/useraddress",
|
||||
// });
|
||||
},
|
||||
|
||||
async repayOrde(ordernumber) {
|
||||
let res = await repayOrde(ordernumber);
|
||||
console.log(ordernumber);
|
||||
if (res) {
|
||||
console.log(res)
|
||||
this.qrtext=res.msg
|
||||
console.log(this.qrtext);
|
||||
}
|
||||
},
|
||||
|
||||
async selectGoods(item, index) {
|
||||
this.activeIndex = index;
|
||||
this.paytype = item.paytype;
|
||||
if (index == 1) {
|
||||
//支付宝
|
||||
let res = await generateOrderAlipay(this.userPayData.orderId);
|
||||
this.qrtext = '';
|
||||
if (res.success) {
|
||||
this.qrtext=res.data
|
||||
|
||||
this.qrtext=res.data;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
this.userPayData = JSON.parse(this.$route.query.userPayData);
|
||||
this.qrtext=this.userPayData.wxPay
|
||||
}
|
||||
},
|
||||
//支付监听
|
||||
|
||||
@ -181,13 +246,15 @@ export default {
|
||||
|
||||
} else if (res.fail) {
|
||||
this.dialogFail = true;
|
||||
}else{
|
||||
|
||||
} else {
|
||||
let _self = this;
|
||||
this.paymentTimer = setTimeout(function(){
|
||||
_self.payOrderWX()
|
||||
},5000);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Myheader,
|
||||
@ -297,6 +364,13 @@ export default {
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
.payconfirm{
|
||||
position:fixed;
|
||||
bottom:0;
|
||||
left:0;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.ph_hidden {
|
||||
display: none;
|
||||
}
|
||||
@ -320,7 +394,8 @@ export default {
|
||||
justify-content: left;
|
||||
&.active {
|
||||
border: none;
|
||||
border-bottom: 1px solid #d7d7d7;
|
||||
|
||||
border-bottom: 4px solid #e2001a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
BIN
rc-busness/static/images/qrcode-wxgroup.jpg
Normal file
BIN
rc-busness/static/images/qrcode-wxgroup.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
Loading…
Reference in New Issue
Block a user