diff --git a/rc-busness/ajax/getData.js b/rc-busness/ajax/getData.js
index 8f4e0e21..f09f02a3 100644
--- a/rc-busness/ajax/getData.js
+++ b/rc-busness/ajax/getData.js
@@ -672,6 +672,12 @@ export const changeCartNumber = (data) => {
}
+//获取订单支付二维码
+export const getOrderQrCode = (orderNo) => {
+ return fetch('generateQrCode', orderNo, 'POST')
+}
+
+
//支付宝支付二维码
@@ -690,3 +696,5 @@ export const generateOrderAlipay = (orderNo, payType) => {
//ret = JSON.parse(ret);
//return ret;
}
+
+
diff --git a/rc-busness/ajax/util.js b/rc-busness/ajax/util.js
index 4671e8b7..22ee78e3 100644
--- a/rc-busness/ajax/util.js
+++ b/rc-busness/ajax/util.js
@@ -56,13 +56,14 @@ let util = {
message = '请返回支付宝继续当前订单的支付';
break;
case "3":
- message = '请返回手机网页端继续当前订单的支付或扫描二维码进行支付';
+ // message = '请返回手机网页端继续当前订单的支付或扫描二维码进行支付';
+ message = '请使用微信扫描下方二维码,即可完成支付!';
break;
default:
message = '订单已过期,请重新下单';
break;
}
- return {'result':false,'message':message};
+ return {'result':false,'message':message,paytype : $paytype};
},
getTextByPaytype(paytype){
//Dictionary : 1:WX native pay, 2:Alipay, 3:WX H5 pay
diff --git a/rc-busness/assets/css/orderquantity.less b/rc-busness/assets/css/orderquantity.less
index 076a1efe..0c238eeb 100644
--- a/rc-busness/assets/css/orderquantity.less
+++ b/rc-busness/assets/css/orderquantity.less
@@ -3,6 +3,13 @@
.usercontshow{
min-height: 70vh;
}
+
+.qrcode{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
@media screen and (max-width:768px){
.online{
margin: 0;
@@ -280,6 +287,7 @@
height: 164px;
.rc-usercenter{
width: 27%;
+ cursor : pointer;
em{
font-size: 18px;
}
diff --git a/rc-busness/components/header.vue b/rc-busness/components/header.vue
index 5c4d5677..79351787 100644
--- a/rc-busness/components/header.vue
+++ b/rc-busness/components/header.vue
@@ -387,7 +387,6 @@ export default {
this.loginornot = true;
this.usermessage = this.userInfo;
}
- console.log('22222show');
// this.refreshMobileNav();
/* 全局刷新 */
if (isInitialized) location.reload();
diff --git a/rc-busness/config/async/env.js b/rc-busness/config/async/env.js
index f0a8185f..acaf52c8 100644
--- a/rc-busness/config/async/env.js
+++ b/rc-busness/config/async/env.js
@@ -8,7 +8,7 @@
let baseUrl = 'http://47.96.75.242:10086/royalcanin/royalcanin/'
if (process.env.NODE_ENV === 'development') {
baseUrl = 'http://47.96.75.242:10086/royalcanin/royalcanin/';
- // baseUrl = 'http://192.168.10.127:10086/royalcanin/royalcanin/';
+ // baseUrl = 'http://192.168.10.122:10086/royalcanin/royalcanin/';
} else if (process.env.NODE_ENV === 'production') {
baseUrl = 'https://shop.royalcanin.com.cn/royalcanin/royalcanin/royalcanin/';
}
diff --git a/rc-busness/pages/myorder/usertion.vue b/rc-busness/pages/myorder/usertion.vue
index b6642b11..cc94cc04 100644
--- a/rc-busness/pages/myorder/usertion.vue
+++ b/rc-busness/pages/myorder/usertion.vue
@@ -142,7 +142,7 @@
-
+
+
-
{{ item.productName }}
+
{{ pro.productName }}
- 规格:{{ item.specifications }}
+ 规格:{{ pro.specifications }}
- 数量:{{ item.pcs }}件
- ¥{{ item.ecPrice }}
+ 数量:{{ pro.pcs }}件
+ ¥{{ pro.ecPrice }}
+
- ¥{{ item.ecPrice }}
- {{ item.pcs }}
+ ¥{{ pro.ecPrice }}
+ {{ pro.pcs }}
¥{{ item.salesAmount }}
-
-
- {{
- item.status == '0'
- ? '取消订单'
- : item.status == '1'
- ? '确认收货'
- : item.status == '2'
- ? '再次购买'
- : item.status == '3'
- ? '再次购买'
- : '异常订单'
- }}
-
-
- {{
- item.status == '0'
- ? '立即支付'
- : item.status == '1'
- ? '查看订单'
- : item.status == '2'
- ? '查看订单'
- : item.status == '3'
- ? '查看订单'
- : '异常订单'
- }}
-
+
+
+ {{
+ item.status == '0'
+ ? '取消订单'
+ : item.status == '1'
+ ? '确认收货'
+ : item.status == '2'
+ ? '再次购买'
+ : item.status == '3'
+ ? '再次购买'
+ : '异常订单'
+ }}
+
+
+ {{
+ item.status == '0'
+ ? '立即支付'
+ : item.status == '1'
+ ? '查看订单'
+ : item.status == '2'
+ ? '查看订单'
+ : item.status == '3'
+ ? '查看订单'
+ : '异常订单'
+ }}
+
+
+
数量:
- 共{{ item.lengthnum }}件商品
+ 共{{ item.orderDetailList.length }}件商品
总计:
@@ -110,7 +113,7 @@
温馨提示
{{ paytypeWarning.message }}
-
+
@@ -122,7 +125,7 @@ import Myheader from '~/components/header.vue';
import MyFooter from '~/components/rc-footer.vue';
import tabs from '~/components/tabs.vue';
import util from '@/ajax/util';
-import { customerorders, userindent, canceldanhao, repayOrde, generateOrderWX } from '../../ajax/getData';
+import { customerorders, userindent, canceldanhao, repayOrde, generateOrderWX,getOrderQrCode } from '../../ajax/getData';
import { mapMutations, mapState } from 'vuex';
import vueQr from 'vue-qr';
export default {
@@ -215,7 +218,7 @@ export default {
mounted() {
// this.checkIsLogin();
- this.userstype = this.$route.query.stype;
+ this.userstype = this.$route.query.stype || 0;
this.resetData();
// this.userdata = user.data.mobile;
},
@@ -229,56 +232,30 @@ export default {
...mapMutations(['changemessage', 'checkIsLogin']),
async indet(mobile, stype) {
let data = await userindent(mobile, undefined, 1, 100);
- this.activeIndex = stype;
+ this.activeIndex = stype || 0;
this.goldmedal = data;
this.alllist = [];
this.allmessage = [];
this.useralllist = [];
- this.obligation = [];
- this.receiving = [];
- this.pending = [];
- for (let i = 0; i < this.goldmedal.length; i++) {
- if (!this.goldmedal[i].orderDetailList.length) continue;
- this.useralllist.push(this.goldmedal[i].orderDetailList[0]);
- this.alllist.push(this.goldmedal[i].orderDetailList[0]);
- this.allmessage.push(this.goldmedal[i].orderDetailList[0]);
- if (this.goldmedal[i].status == 0) {
- this.obligation.push(this.goldmedal[i].orderDetailList[0]);
- } else if (this.goldmedal[i].status == 1) {
- this.receiving.push(this.goldmedal[i].orderDetailList[0]);
- } else if (this.goldmedal[i].status == 2) {
- this.pending.push(this.goldmedal[i].orderDetailList[0]);
+ this.obligation = []; //待付款
+ this.receiving = []; //待发货
+ this.pending = []; //已完成
+ // console.log(data,'22');
+ // this.goldmedal = data.filter(val=> val.orderDetailList.length);
+ let filterData = [];
+ for (var i = 0; i < data.length; i++) {
+ let item = data[i];
+ if(!item.orderDetailList.length){
+ continue;
}
- }
- for (let y = 0; y < this.goldmedal.length; y++) {
- if (!this.useralllist[y]) {
- this.useralllist[y] = {};
- }
- if (!this.goldmedal[y].orderDetailList) continue;
-
- // let item = {
- // ...this.useralllist[y],
- // ...this.goldmedal[y],
- // phoneNumber : this.goldmedal[y].addressPhoneNumber,
- // lengthnum : this.goldmedal[y].orderDetailList.length
- // }
- // this.useralllist[y] = item;
- this.useralllist[y].orderNumber = this.goldmedal[y].orderNumber;
- this.useralllist[y].status = this.goldmedal[y].status;
- this.useralllist[y].addressUserName = this.goldmedal[y].addressUserName;
- this.useralllist[y].phoneNumber = this.goldmedal[y].addressPhoneNumber;
- this.useralllist[y].paytype = this.goldmedal[y].paytype;
- this.useralllist[y].salesAmount = this.goldmedal[y].salesAmount;
- this.useralllist[y].lengthnum = this.goldmedal[y].orderDetailList.length;
- let item = this.goldmedal[y];
let orderDetail = item.orderDetailList[0];
- this.useralllist[y].payInfo = [
+ item.payInfo = [
{
basePoint: item.basePoint,
productName: orderDetail.productName,
- buyCount: orderDetail.pcs,
+ buyCount: 1,
productCode: orderDetail.productCode,
- payAmount: orderDetail.ecPrice,
+ payAmount: orderDetail.salesAmount,
memberId: this.userInfo.id,
phoneNumber: item.phoneNumber,
orderAddress: {
@@ -291,21 +268,95 @@ export default {
}
}
]
+ filterData.push(item);
}
+ this.goldmedal = filterData;
+ this.filterCurrentData();
+ // 0:待付款,1:待收货,2:已完成,3:已取消,4:异常订单
+ return false;
+ // for (let i = 0; i < this.goldmedal.length; i++) {
+ // if (!this.goldmedal[i].orderDetailList.length) continue;
+ // this.useralllist.push(this.goldmedal[i].orderDetailList[0]);
+ // this.alllist.push(this.goldmedal[i].orderDetailList[0]);
+ // this.allmessage.push(this.goldmedal[i].orderDetailList[0]);
+ // if (this.goldmedal[i].status == 0) {
+ // this.obligation.push(this.goldmedal[i].orderDetailList[0]);
+ // } else if (this.goldmedal[i].status == 1) {
+ // this.receiving.push(this.goldmedal[i].orderDetailList[0]);
+ // } else if (this.goldmedal[i].status == 2) {
+ // this.pending.push(this.goldmedal[i].orderDetailList[0]);
+ // }
+ // }
+ // for (let y = 0; y < this.goldmedal.length; y++) {
+ // if (!this.useralllist[y]) {
+ // this.useralllist[y] = {};
+ // }
+ // if (!this.goldmedal[y].orderDetailList) continue;
+
+ // // let item = {
+ // // ...this.useralllist[y],
+ // // ...this.goldmedal[y],
+ // // phoneNumber : this.goldmedal[y].addressPhoneNumber,
+ // // lengthnum : this.goldmedal[y].orderDetailList.length
+ // // }
+ // // this.useralllist[y] = item;
+ // this.useralllist[y].orderNumber = this.goldmedal[y].orderNumber;
+ // this.useralllist[y].status = this.goldmedal[y].status;
+ // this.useralllist[y].addressUserName = this.goldmedal[y].addressUserName;
+ // this.useralllist[y].phoneNumber = this.goldmedal[y].addressPhoneNumber;
+ // this.useralllist[y].paytype = this.goldmedal[y].paytype;
+ // this.useralllist[y].salesAmount = this.goldmedal[y].salesAmount;
+ // this.useralllist[y].lengthnum = this.goldmedal[y].orderDetailList.length;
+ // let item = this.goldmedal[y];
+ // let orderDetail = item.orderDetailList[0];
+ // if(orderDetail){
+ // this.useralllist[y].payInfo = [
+ // {
+ // basePoint: item.basePoint,
+ // productName: orderDetail.productName,
+ // buyCount: orderDetail.pcs,
+ // productCode: orderDetail.productCode,
+ // payAmount: orderDetail.ecPrice,
+ // memberId: this.userInfo.id,
+ // phoneNumber: item.phoneNumber,
+ // orderAddress: {
+ // addressPhoneNumber: item.addressPhoneNumber,
+ // addressUserName: item.addressUserName,
+ // addressProvinceName: item.addressProvinceName,
+ // addressCityName: item.addressCityName,
+ // addressCountyName:item.addressCountyName,
+ // addressDetailInfo: item.addressDetailInfo,
+ // }
+ // }
+ // ]
+ // }
+ // }
- if (this.userstype == 1) {
- this.useralllist = this.obligation;
- } else if (this.userstype == 2) {
- this.useralllist = this.pending;
- } else if (this.userstype == 0) {
- this.useralllist = this.allmessage;
- } else if (this.userstype == 3) {
- this.useralllist = this.receiving;
- }
- /* 过滤空的数据 */
- let filterArr = this.useralllist.filter(val => {
- return val != undefined;
+ // if (this.userstype == 1) {
+ // this.useralllist = this.obligation;
+ // } else if (this.userstype == 2) {
+ // this.useralllist = this.pending;
+ // } else if (this.userstype == 0) {
+ // this.useralllist = this.allmessage;
+ // } else if (this.userstype == 3) {
+ // this.useralllist = this.receiving;
+ // }
+ // /* 过滤空的数据 */
+ // let filterArr = this.useralllist.filter(val => {
+ // return val != undefined;
+ // });
+ // this.useralllist = filterArr;
+ },
+ /* 过滤当前的显示的数据 */
+ async filterCurrentData(){
+ /* 根据切换 过滤对应的数据显示 */
+ let filterArr = this.goldmedal.filter(val=>{
+ if(this.activeIndex == 0){
+ return val.status >= 0;
+ }else{
+ return val.status == this.activeIndex - 1;
+ }
});
this.useralllist = filterArr;
},
@@ -407,51 +458,52 @@ export default {
selectGoods(item, index) {
let list = [];
this.activeIndex = index;
- if (item.title == '待付款') {
- list = this.obligation;
- } else if (item.title == '待收货') {
- list = this.receiving;
- } else if (item.title == '待发货') {
- this.useralllist = this.pending;
- list = this.pending;
- } else if (item.title == '全部') {
- list = this.alllist;
- }
- this.useralllist = [];
- for (var i = 0; i < this.useralllist.length; i++) {
- 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].salesAmount = this.goldmedal[i].salesAmount;
- this.useralllist[i].lengthnum = this.goldmedal[i].orderDetailList.length;
- let item = this.goldmedal[i];
- let orderDetail = item.orderDetailList[0];
- this.useralllist[y].payInfo = [
- {
- basePoint: item.basePoint,
- productName: orderDetail.productName,
- buyCount: orderDetail.pcs,
- productCode: orderDetail.productCode,
- payAmount: orderDetail.ecPrice,
- memberId: this.userInfo.id,
- phoneNumber: item.phoneNumber,
- orderAddress: {
- addressPhoneNumber: item.addressPhoneNumber,
- addressUserName: item.addressUserName,
- addressProvinceName: item.addressProvinceName,
- addressCityName: item.addressCityName,
- addressCountyName:item.addressCountyName,
- addressDetailInfo: item.addressDetailInfo,
- }
- }
- ]
+ this.filterCurrentData();
+ // if (item.title == '待付款') {
+ // list = this.obligation;
+ // } else if (item.title == '待收货') {
+ // list = this.receiving;
+ // } else if (item.title == '待发货') {
+ // this.useralllist = this.pending;
+ // list = this.pending;
+ // } else if (item.title == '全部') {
+ // list = this.alllist;
+ // }
+ // this.useralllist = [];
+ // for (var i = 0; i < this.useralllist.length; i++) {
+ // 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].salesAmount = this.goldmedal[i].salesAmount;
+ // this.useralllist[i].lengthnum = this.goldmedal[i].orderDetailList.length;
+ // let item = this.goldmedal[i];
+ // let orderDetail = item.orderDetailList[0];
+ // this.useralllist[y].payInfo = [
+ // {
+ // basePoint: item.basePoint,
+ // productName: orderDetail.productName,
+ // buyCount: orderDetail.pcs,
+ // productCode: orderDetail.productCode,
+ // payAmount: orderDetail.ecPrice,
+ // memberId: this.userInfo.id,
+ // phoneNumber: item.phoneNumber,
+ // orderAddress: {
+ // addressPhoneNumber: item.addressPhoneNumber,
+ // addressUserName: item.addressUserName,
+ // addressProvinceName: item.addressProvinceName,
+ // addressCityName: item.addressCityName,
+ // addressCountyName:item.addressCountyName,
+ // addressDetailInfo: item.addressDetailInfo,
+ // }
+ // }
+ // ]
- }
- this.useralllist = list.filter(val => {
- return val != undefined;
- });
+ // }
+ // this.useralllist = list.filter(val => {
+ // return val != undefined;
+ // });
},
async userfind(item) {
// let params = [
@@ -475,11 +527,12 @@ export default {
// ];
// console.log(item,'222');
// return false;
- let { msg } = await generateOrderWX(item.payInfo, 1);
- this.qrtext = msg;
+
+
// return false;
this.paytypeWarning = this.util.checkPaytypeValidated(item.paytype);
this.showPaytypeWarning = !this.paytypeWarning.result;
+ this.qrtext = '';
let user = this.userInfo;
if (this.paytypeWarning.result) {
if (item.status == 0) {
@@ -502,6 +555,15 @@ export default {
});
}
} else {
+ if(item.payInfo && this.paytypeWarning.paytype != 0){
+ // console.log(item);
+ // ;
+ let { msg } = await getOrderQrCode({
+ orderNo : item.orderNumber
+ }, '1');
+ // let { msg } = await generateOrderWX(item.payInfo,1);
+ this.qrtext = msg;
+ };
_hmt.push([
'_trackCustomEvent',
'order_repay',
diff --git a/rc-busness/pages/productdetails/producted.vue b/rc-busness/pages/productdetails/producted.vue
index 09d3eae3..37aa55a0 100644
--- a/rc-busness/pages/productdetails/producted.vue
+++ b/rc-busness/pages/productdetails/producted.vue
@@ -255,7 +255,7 @@ import tabs from '@/components/tabs.vue';
import FixRight from '~/components/fixed-right.vue';
import unlogin from '~/components/unlogin.vue';
import Myfooter from '~/components/rc-footer.vue';
-import { mapMutations,mapState } from 'vuex';
+import { mapMutations, mapState } from 'vuex';
import util from '@/ajax/util';
const settings = require('@/config');
import { goodsmessage, getConfig, postCourseId, getdraw, alldiscount, oncequery, biaomessage, productQuery } from '../../ajax/getData';
@@ -359,22 +359,22 @@ export default {
productAttachmentList: [],
usernewlist: [
- {
- price: '30',
- pricestype: '新客优惠券',
- special: '全场每满299-30',
- period: '有效期',
- starttime: '2021.11.29-2022.01.28',
- catimage: require('../../assets/image/unused.png')
- },
- {
- price: '30',
- pricestype: '新客优惠券',
- special: '全场每满299-30',
- period: '有效期',
- starttime: '2021.11.29-2022.01.28',
- catimage: require('../../assets/image/unused.png')
- }
+ // {
+ // price: '30',
+ // pricestype: '新客优惠券',
+ // special: '全场每满299-30',
+ // period: '有效期',
+ // starttime: '2021.11.29-2022.01.28',
+ // catimage: require('../../assets/image/unused.png')
+ // },
+ // {
+ // price: '30',
+ // pricestype: '新客优惠券',
+ // special: '全场每满299-30',
+ // period: '有效期',
+ // starttime: '2021.11.29-2022.01.28',
+ // catimage: require('../../assets/image/unused.png')
+ // }
],
newlist: [
@@ -475,8 +475,20 @@ export default {
}
]);
+ var u = navigator.userAgent,
+ app = navigator.appVersion;
+ var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
+ var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
+
setTimeout(function() {
- window.open(_self.curItem.curGoodUrl, '_blank');
+ if (isAndroid) {
+ console.log('安卓手机');
+ window.open(_self.curItem.curGoodUrl, '_blank');
+ }
+ if (isIOS) {
+ location.href = _self.curItem.curGoodUrl
+ }
+
}, 1000);
},
//获取用户领取的优惠券
@@ -543,11 +555,13 @@ export default {
let paramsToAPI = {
productCode: this.curItem.productCode
};
- if (storeCode) paramsToAPI.stroeCode = stroeCode;
+ if (storeCode) {
+ paramsToAPI.storeCode = storeCode;
+ }
let data = await alldiscount(paramsToAPI);
let userlist = [];
let menulsit = [];
- if (data) {
+ if (data.data) {
this.alldraw = data;
// console.log(this.alldraw.data);
let alllist = [];
@@ -728,8 +742,8 @@ export default {
path: '/personal/settlement',
query: {
list: JSON.stringify(list),
- type : 'product',
- pathQuery : JSON.stringify(this.$route.query),
+ type: 'product',
+ pathQuery: JSON.stringify(this.$route.query)
}
});
}
@@ -755,16 +769,15 @@ export default {
this.crumbs.push({ title: item.productName });
}
},
- computed:{
+ computed: {
...mapState({
- userInfo : state => state.user.userInfo,
+ userInfo: state => state.user.userInfo
})
}
-
};