mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 10:16:38 +08:00
Merge branch 'sit-Leung' into sit-jiamin-v2
This commit is contained in:
commit
03f91822aa
@ -479,18 +479,19 @@ export const goodsmessage = (productCode) => {
|
|||||||
|
|
||||||
|
|
||||||
//微信支付
|
//微信支付
|
||||||
export const generateOrderWX = (list) => {
|
export const generateOrderWX = (list,isH5Pay) => {
|
||||||
var data = [{
|
if(!isH5Pay)
|
||||||
|
|
||||||
|
|
||||||
}]
|
|
||||||
return fetch('generateOrderWX', list, 'POST' )
|
return fetch('generateOrderWX', list, 'POST' )
|
||||||
|
else
|
||||||
|
return fetch('generateOrderWXH5', list, 'POST' )
|
||||||
}
|
}
|
||||||
|
|
||||||
//再次支付
|
//再次支付
|
||||||
export const repayOrde = (ordernumber) => {
|
export const repayOrde = (ordernumber,isH5Pay) => {
|
||||||
console.log(ordernumber);
|
if(!isH5Pay)
|
||||||
return fetch('repayOrderWX?orderNo='+ordernumber,'', 'POST' )
|
return fetch('repayOrderWX?orderNo='+ordernumber,'', 'POST' )
|
||||||
|
else
|
||||||
|
return fetch('repayOrderWXH5?orderNo='+ordernumber,'', 'POST' )
|
||||||
}
|
}
|
||||||
//用户所有的优惠券
|
//用户所有的优惠券
|
||||||
export const allConfig = (memberId,channelSecurity,mobile) => {
|
export const allConfig = (memberId,channelSecurity,mobile) => {
|
||||||
|
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 }
|
||||||
|
*/
|
@ -544,6 +544,10 @@ picture {
|
|||||||
margin-top: 124px;
|
margin-top: 124px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.useruantity{
|
||||||
|
margin: 1rem 0rem;
|
||||||
|
}
|
||||||
|
|
||||||
.ts-product-list {
|
.ts-product-list {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
//display:block;
|
//display:block;
|
||||||
|
@ -6,6 +6,12 @@ ul li ol li em strong i {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ts-button-container {
|
||||||
|
cursor: pointer;
|
||||||
|
display:flex;
|
||||||
|
flex-direction:row;
|
||||||
|
}
|
||||||
//手机端
|
//手机端
|
||||||
@media screen and (max-width: 768px) {
|
@media screen and (max-width: 768px) {
|
||||||
.online{
|
.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 {
|
.delivery {
|
||||||
display: flex;
|
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-main {
|
||||||
.rc-userbottom{
|
.rc-userbottom{
|
||||||
display: none;
|
display: none;
|
||||||
@ -326,8 +309,15 @@ margin-right: 20px;
|
|||||||
|
|
||||||
|
|
||||||
//pc端
|
//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 {
|
.delivery {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -369,9 +359,6 @@ margin-right: 20px;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.rc-margin-y--md{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.rc-main {
|
.rc-main {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-top: 90px;
|
margin-top: 90px;
|
||||||
@ -511,6 +498,7 @@ margin-right: 20px;
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-top: 17px;
|
margin-top: 17px;
|
||||||
color: #e1001a;
|
color: #e1001a;
|
||||||
|
width:16rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -678,21 +666,6 @@ margin-right: 20px;
|
|||||||
font-size: 26px;
|
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;
|
let usernot=this.$store.state.userInfo;
|
||||||
//console.log(usernot);
|
//console.log(usernot);
|
||||||
if(usernot){
|
if(usernot){
|
||||||
|
window._hmt.push(['_setUserId', usernot.data.mobile]);
|
||||||
this.loginornot=false
|
this.loginornot=false
|
||||||
}else{
|
}else{
|
||||||
this.loginornot=true
|
this.loginornot=true
|
||||||
|
@ -4,7 +4,7 @@ export default {
|
|||||||
|
|
||||||
// Global page headers: https://go.nuxtjs.dev/config-head
|
// Global page headers: https://go.nuxtjs.dev/config-head
|
||||||
head: {
|
head: {
|
||||||
title: '皇家官方商城',
|
title: '皇家宠物食品官方商城',
|
||||||
|
|
||||||
htmlAttrs: {
|
htmlAttrs: {
|
||||||
lang: 'zh-cn',
|
lang: 'zh-cn',
|
||||||
|
@ -19,8 +19,7 @@
|
|||||||
}}</em>
|
}}</em>
|
||||||
<span>{{ orderstatus }}</span>
|
<span>{{ orderstatus }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="online bold">
|
<div class="online bold"></div>
|
||||||
</div>
|
|
||||||
<div class="delivery useruantity" v-if="isshow">
|
<div class="delivery useruantity" v-if="isshow">
|
||||||
<div class="to-delivery">
|
<div class="to-delivery">
|
||||||
<img src="../../static/images/delivery.png" alt="">
|
<img src="../../static/images/delivery.png" alt="">
|
||||||
@ -36,7 +35,7 @@
|
|||||||
<img :src="leftico" alt="" />
|
<img :src="leftico" alt="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="online bold">
|
<div class="online bold" v-if="isshow">
|
||||||
</div>
|
</div>
|
||||||
<div class="mypersonal useruantity">
|
<div class="mypersonal useruantity">
|
||||||
<div class="my-delivery">
|
<div class="my-delivery">
|
||||||
@ -72,12 +71,7 @@
|
|||||||
<div class="rc-userbottom">
|
<div class="rc-userbottom">
|
||||||
<span>数量:{{ userlist.pcs }}件</span>
|
<span>数量:{{ userlist.pcs }}件</span>
|
||||||
<i>¥{{ userlist.ecPrice }}</i>
|
<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>
|
||||||
<!-- <div class="rc-userbottomm">
|
<!-- <div class="rc-userbottomm">
|
||||||
<i>¥{{ item.userprice }}</i>
|
<i>¥{{ item.userprice }}</i>
|
||||||
@ -115,19 +109,19 @@
|
|||||||
<div class="rc-payment">
|
<div class="rc-payment">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<span>订单编号::</span>
|
<span>订单编号:</span>
|
||||||
<i>{{ item.orderNumber }}</i>
|
<i>{{ item.orderNumber }}</i>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span>下单时间::</span>
|
<span>下单时间:</span>
|
||||||
<i>{{ logisticsDate }}</i>
|
<i>{{ logisticsDate }}</i>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span>付款方式::</span>
|
<span>付款方式:</span>
|
||||||
<i>{{ information.paymentmethod }}</i>
|
<i>{{ information.paytype }}</i>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span>配送方式::</span>
|
<span>配送方式:</span>
|
||||||
<i>{{ information.distribution }}</i>
|
<i>{{ information.distribution }}</i>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -142,21 +136,23 @@
|
|||||||
|
|
||||||
<div class="rc-foot">
|
<div class="rc-foot">
|
||||||
<div class="rc-foo">
|
<div class="rc-foo">
|
||||||
<div style="padding-top: 55px">
|
<div style="">
|
||||||
<i>合计金额:</i>
|
<i>合计金额:</i>
|
||||||
<em>¥{{ usersalesAmount }}</em>
|
<em>¥{{ usersalesAmount }}</em>
|
||||||
</div>
|
</div>
|
||||||
<div style="padding-bottom: 40px; cursor: pointer">
|
<div class="rc-md-up ts-button-container rc-padding-y--md">
|
||||||
<span @click="onceagain(item)"> {{ payorsucess }}</span>
|
<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>
|
</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
|
<i
|
||||||
class="ts-standard-btn ts-standard-btn--two center"
|
class="ts-standard-btn"
|
||||||
@click="onceagain()"
|
@click="onceagain()"
|
||||||
>
|
>
|
||||||
{{ payorsucess }}
|
{{ payorsucess }}
|
||||||
@ -170,15 +166,16 @@
|
|||||||
<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 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 {
|
import {
|
||||||
|
userin,
|
||||||
selectaddress,
|
selectaddress,
|
||||||
canceldanhao,
|
canceldanhao,
|
||||||
generateOrderWX,
|
generateOrderWX,
|
||||||
|
repayOrde
|
||||||
} from "../../ajax/getData";
|
} from "../../ajax/getData";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -212,13 +209,11 @@ export default {
|
|||||||
delivery: [],
|
delivery: [],
|
||||||
|
|
||||||
useraddress: [],
|
useraddress: [],
|
||||||
|
|
||||||
goldmedal: [],
|
|
||||||
shopprice: {},
|
shopprice: {},
|
||||||
information: {
|
information: {
|
||||||
reference: "1111111111111111",
|
reference: "1111111111111111",
|
||||||
ordertime: "2012-12-01 11:20:00",
|
ordertime: "2012-12-01 11:20:00",
|
||||||
paymentmethod: "微信支付",
|
paytype: "微信支付",
|
||||||
distribution: "快递",
|
distribution: "快递",
|
||||||
trackingnumber: "11111111111111",
|
trackingnumber: "11111111111111",
|
||||||
catimage: require("../../assets/image/rc-left.png"),
|
catimage: require("../../assets/image/rc-left.png"),
|
||||||
@ -250,9 +245,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
userpay() {
|
userpay() {
|
||||||
console.log("---");
|
|
||||||
if (this.goldastates == 0) {
|
if (this.goldastates == 0) {
|
||||||
|
if(confirm('确认要取消该订单嘛?')) {
|
||||||
this.canceldanhao();
|
this.canceldanhao();
|
||||||
|
}
|
||||||
} else if ((this.customer = "联系客服申请售后")) {
|
} else if ((this.customer = "联系客服申请售后")) {
|
||||||
var option = {
|
var option = {
|
||||||
customer: {
|
customer: {
|
||||||
@ -268,9 +264,7 @@ export default {
|
|||||||
},
|
},
|
||||||
//订单支付和再次购买
|
//订单支付和再次购买
|
||||||
onceagain(item) {
|
onceagain(item) {
|
||||||
console.log(this.payorsucess);
|
|
||||||
if (this.payorsucess == "立即支付") {
|
if (this.payorsucess == "立即支付") {
|
||||||
console.log("----");
|
|
||||||
this.getwei(item);
|
this.getwei(item);
|
||||||
} else {
|
} else {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
@ -280,22 +274,18 @@ export default {
|
|||||||
productCode: this.userproductId,
|
productCode: this.userproductId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
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);
|
|
||||||
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.userproductId = this.goldmedal[i].orderDetailList[0].productId;
|
||||||
this.logisticsNumber =
|
this.logisticsNumber =
|
||||||
this.goldmedal[i].orderDetailList[0].logisticsNumber; //物流单号
|
this.goldmedal[i].orderDetailList[0].logisticsNumber; //物流单号
|
||||||
this.trackingstates = this.goldmedal[i].orderDetailList[0].status; //运输状态
|
this.trackingstates = this.goldmedal[i].orderDetailList[0].status; //运输状态
|
||||||
|
|
||||||
if (this.trackingstates == 0) {
|
if (this.trackingstates == 0) {
|
||||||
this.trackingstates = "运输中";
|
this.trackingstates = "运输中";
|
||||||
} else if (this.trackingstates == 1) {
|
} else if (this.trackingstates == 1) {
|
||||||
@ -306,24 +296,26 @@ export default {
|
|||||||
this.logisticsDate = this.formatConversion(
|
this.logisticsDate = this.formatConversion(
|
||||||
this.goldmedal[i].orderDate
|
this.goldmedal[i].orderDate
|
||||||
); //时间戳
|
); //时间戳
|
||||||
this.logisticsCompany =
|
this.logisticsCompany = this.goldmedal[i].orderDetailList[0].logisticsCompany; //物流公司
|
||||||
this.goldmedal[i].orderDetailList[0].logisticsCompany; //物流公司
|
|
||||||
this.orderNumber = this.goldmedal[i].orderNumber;
|
this.orderNumber = this.goldmedal[i].orderNumber;
|
||||||
this.usersalesAmount = this.goldmedal[i].salesAmount;
|
this.usersalesAmount = this.goldmedal[i].salesAmount;
|
||||||
this.addressUserName = this.goldmedal[i].addressUserName;
|
this.addressUserName = this.goldmedal[i].addressUserName;
|
||||||
this.addressPhoneNumber = this.goldmedal[i].addressPhoneNumber;
|
this.addressPhoneNumber = this.goldmedal[i].addressPhoneNumber;
|
||||||
|
this.paytype = (this.goldmedal[i].paytype=="1"?'微信支付':'支付宝');
|
||||||
}
|
}
|
||||||
console.log(this.goldmedal, this.userproductId, this.usersalesAmount);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//订单立即支付
|
//订单立即支付
|
||||||
async getwei(user) {
|
async getwei(user) {
|
||||||
console.log(user);
|
let data = await this.repayOrde(this.orderNumber);
|
||||||
|
if(data.code==1) {
|
||||||
let userPayData = {
|
let userPayData = {
|
||||||
userprice: this.usersalesAmount,
|
userprice: this.usersalesAmount,
|
||||||
orderId: this.orderNumber,
|
orderId: this.orderNumber,
|
||||||
userinformation: this.addressUserName + " " + this.addressPhoneNumber,
|
userinformation: this.addressUserName + " " + this.addressPhoneNumber,
|
||||||
|
wxPay:data.msg
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: "/personal/userpay",
|
path: "/personal/userpay",
|
||||||
query: {
|
query: {
|
||||||
@ -332,6 +324,19 @@ export default {
|
|||||||
userPayData: JSON.stringify(userPayData),
|
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) {
|
async editaddress(user) {
|
||||||
// user.data.id=844350;
|
// user.data.id=844350;
|
||||||
@ -348,11 +353,26 @@ export default {
|
|||||||
|
|
||||||
// console.log(this.list);
|
// 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() {
|
mounted() {
|
||||||
this.checkIsLogin();
|
this.checkIsLogin();
|
||||||
this.userdata = this.$store.state.userInfo;
|
this.userdata = this.$store.state.userInfo;
|
||||||
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;
|
||||||
@ -367,7 +387,6 @@ export default {
|
|||||||
this.userisdelivery = "待发货";
|
this.userisdelivery = "待发货";
|
||||||
this.customer = "联系客服申请售后";
|
this.customer = "联系客服申请售后";
|
||||||
this.payorsucess = "再次购买";
|
this.payorsucess = "再次购买";
|
||||||
console.log(this.orderstatus);
|
|
||||||
} else if (this.addressstype == 0) {
|
} else if (this.addressstype == 0) {
|
||||||
this.orderstatus = "您的订单还未付款,请尽快付款!";
|
this.orderstatus = "您的订单还未付款,请尽快付款!";
|
||||||
this.isshow = false;
|
this.isshow = false;
|
||||||
@ -387,7 +406,6 @@ export default {
|
|||||||
this.customer = "联系客服申请售后";
|
this.customer = "联系客服申请售后";
|
||||||
this.payorsucess = "再次购买";
|
this.payorsucess = "再次购买";
|
||||||
}
|
}
|
||||||
console.log(this.addressstype);
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Myheader,
|
Myheader,
|
||||||
@ -397,6 +415,5 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@import url("../../assets/css/global.less");
|
|
||||||
@import url("../../assets/css/usertion.less");
|
@import url("../../assets/css/usertion.less");
|
||||||
</style>
|
</style>
|
@ -608,6 +608,9 @@ ul li ol li em strong i {
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 10px;
|
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) {
|
if (res.success) {
|
||||||
let userPayData = {
|
let userPayData = {
|
||||||
orderId: res.data.orderNumber,
|
orderId: res.data.orderNumber,
|
||||||
@ -599,7 +600,7 @@ export default {
|
|||||||
postData[0].orderAddress.addressPhoneNumber,
|
postData[0].orderAddress.addressPhoneNumber,
|
||||||
// wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
|
// wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
|
||||||
// wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
|
// wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
|
||||||
wxPay: res.msg,
|
wxPay: (res.msg?res.msg:''),
|
||||||
};
|
};
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: "/personal/userpay",
|
path: "/personal/userpay",
|
||||||
@ -617,6 +618,22 @@ export default {
|
|||||||
async canceldanhao(orderNumber) {
|
async canceldanhao(orderNumber) {
|
||||||
let data = await userin(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() {
|
mounted() {
|
||||||
this.goldmedal = JSON.parse(this.$route.query.list);
|
this.goldmedal = JSON.parse(this.$route.query.list);
|
||||||
|
@ -396,6 +396,7 @@ export default {
|
|||||||
|
|
||||||
userpay(item, index) {
|
userpay(item, index) {
|
||||||
if (item.status == 0) {
|
if (item.status == 0) {
|
||||||
|
if(confirm('确认取消该订单嘛?')){
|
||||||
this.canceldanhao(item.orderNumber);
|
this.canceldanhao(item.orderNumber);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.indet(this.userdata);
|
this.indet(this.userdata);
|
||||||
@ -406,6 +407,7 @@ export default {
|
|||||||
this.receiving=[];
|
this.receiving=[];
|
||||||
this.pending=[];
|
this.pending=[];
|
||||||
}, 500);
|
}, 500);
|
||||||
|
}
|
||||||
} else if(item.status == 1) { //确认收货
|
} else if(item.status == 1) { //确认收货
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -42,15 +42,26 @@
|
|||||||
:key="index"
|
:key="index"
|
||||||
@click="selectGoods(item, index)"
|
@click="selectGoods(item, index)"
|
||||||
:class="activeIndex == index ? 'active' : ''"
|
:class="activeIndex == index ? 'active' : ''"
|
||||||
|
v-if="(!disableAlipay || (disableAlipay && item.type!='alipay'))"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<div style="display:flex;">
|
||||||
<img :src="item.payimage" alt="" />
|
<img :src="item.payimage" alt="" />
|
||||||
<span>{{ item.paytype }}支付</span>
|
<span>{{ item.paytype }}支付</span>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="paycord">
|
|
||||||
|
<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>
|
<div class="qrcode"><vue-qr :text="qrtext" :size="260"></vue-qr></div>
|
||||||
<span>{{ paytype }}扫一扫立即支付</span>
|
<span>{{ paytype }}扫一扫立即支付</span>
|
||||||
</div>
|
</div>
|
||||||
@ -65,7 +76,8 @@
|
|||||||
<div class="line_dashed"></div>
|
<div class="line_dashed"></div>
|
||||||
<div class="userer">
|
<div class="userer">
|
||||||
<div class="qrcode">
|
<div class="qrcode">
|
||||||
<img src="/images/paysucess.jpg">
|
|
||||||
|
<img src="/images/qrcode-wxgroup.jpg">
|
||||||
</div>
|
</div>
|
||||||
<p>微信扫一扫,识别二维码</p>
|
<p>微信扫一扫,识别二维码</p>
|
||||||
<p class="tips">加入社群0元试用商品随单发放</p>
|
<p class="tips">加入社群0元试用商品随单发放</p>
|
||||||
@ -89,50 +101,108 @@ import Myheader from "~/components/header.vue";
|
|||||||
import tabs from "@/components/tabs.vue";
|
import tabs from "@/components/tabs.vue";
|
||||||
import vueQr from 'vue-qr'
|
import vueQr from 'vue-qr'
|
||||||
|
|
||||||
|
|
||||||
import { generateOrderAlipay, updateOrderWX, monitorOrderNotify,repayOrde } from "../../ajax/getData";
|
import { generateOrderAlipay, updateOrderWX, monitorOrderNotify,repayOrde } from "../../ajax/getData";
|
||||||
|
//import { isMobile } from "@/ajax/util";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeIndex: 0,
|
activeIndex: 0,
|
||||||
paymentTimer:undefined,
|
paymentTimer:undefined,
|
||||||
isSucess: false,
|
isSucess: false,
|
||||||
dialogSuccess: true,
|
|
||||||
|
dialogSuccess: false,
|
||||||
paytype: "微信",
|
paytype: "微信",
|
||||||
userpaystype: [
|
userpaystype: [
|
||||||
{
|
{
|
||||||
paytype: "微信",
|
paytype: "微信",
|
||||||
payimage: require("../../assets/pay/wx.png"),
|
payimage: require("../../assets/pay/wx.png"),
|
||||||
|
type:'wechat'
|
||||||
},
|
},
|
||||||
/*
|
|
||||||
{
|
{
|
||||||
paytype: "支付宝",
|
paytype: "支付宝",
|
||||||
payimage: require("../../assets/pay/zfb.png"),
|
payimage: require("../../assets/pay/zfb.png"),
|
||||||
|
type:'alipay'
|
||||||
},
|
},
|
||||||
*/
|
|
||||||
],
|
],
|
||||||
dialogFail: false,
|
dialogFail: false,
|
||||||
userPayData: {},
|
userPayData: {},
|
||||||
qrtext:'',
|
qrtext:'',
|
||||||
userData:'',
|
userData:'',
|
||||||
|
disableAlipay:true,
|
||||||
|
disableQrcode:false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
|
||||||
|
created(){
|
||||||
|
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
let stype=this.$route.query.stype;
|
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);
|
this.userPayData = JSON.parse(this.$route.query.userPayData);
|
||||||
console.log(this.userPayData);
|
this.defaultHandlePayment();
|
||||||
}else{
|
|
||||||
this.userPayData = JSON.parse(this.$route.query.userPayData);
|
|
||||||
console.log(this.userPayData);
|
|
||||||
}
|
|
||||||
this.qrtext=this.userPayData.wxPay
|
|
||||||
this.payOrderWX();
|
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
closeDialogSuccess() {
|
||||||
this.qrtext = '';
|
this.qrtext = '';
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
@ -149,26 +219,21 @@ export default {
|
|||||||
// path: "/personal/useraddress",
|
// 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) {
|
async selectGoods(item, index) {
|
||||||
this.activeIndex = index;
|
this.activeIndex = index;
|
||||||
this.paytype = item.paytype;
|
this.paytype = item.paytype;
|
||||||
if (index == 1) {
|
if (index == 1) {
|
||||||
//支付宝
|
//支付宝
|
||||||
let res = await generateOrderAlipay(this.userPayData.orderId);
|
let res = await generateOrderAlipay(this.userPayData.orderId);
|
||||||
|
this.qrtext = '';
|
||||||
if (res.success) {
|
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) {
|
} else if (res.fail) {
|
||||||
this.dialogFail = true;
|
this.dialogFail = true;
|
||||||
}else{
|
|
||||||
|
} else {
|
||||||
let _self = this;
|
let _self = this;
|
||||||
this.paymentTimer = setTimeout(function(){
|
this.paymentTimer = setTimeout(function(){
|
||||||
_self.payOrderWX()
|
_self.payOrderWX()
|
||||||
},5000);
|
},5000);
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Myheader,
|
Myheader,
|
||||||
@ -297,6 +364,13 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media screen and (max-width: 768px) {
|
@media screen and (max-width: 768px) {
|
||||||
|
.payconfirm{
|
||||||
|
position:fixed;
|
||||||
|
bottom:0;
|
||||||
|
left:0;
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
|
||||||
.ph_hidden {
|
.ph_hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -320,7 +394,8 @@ export default {
|
|||||||
justify-content: left;
|
justify-content: left;
|
||||||
&.active {
|
&.active {
|
||||||
border: none;
|
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