mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 02:06:38 +08:00
修复
1.修复购物车数量NAN问题 2.添加订单详情支付也需要二维码
This commit is contained in:
parent
eb9d820c1b
commit
6f776b4327
@ -7,6 +7,12 @@ ul li ol li em strong i {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.qrcode{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.ts-button-container {
|
.ts-button-container {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<div class="rc-jia">
|
<div class="rc-jia">
|
||||||
<img src="../../assets/image/userjian.png" alt="" @click="sub(item.buyCount, index)" />
|
<img src="../../assets/image/userjian.png" alt="" @click="sub(item.buyCount, index)" />
|
||||||
<input type="text" v-model="item.buyCount" @blur="saveCartNumber(item)" />
|
<input type="text" v-model="item.buyCount" @blur="saveCartNumber(item,index)" />
|
||||||
<img src="../../assets/image/userjia.png" alt="" @click="plus(item.buyCount, index)" />
|
<img src="../../assets/image/userjia.png" alt="" @click="plus(item.buyCount, index)" />
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@ -211,7 +211,7 @@ export default {
|
|||||||
let data = await isexistCart(user.id);
|
let data = await isexistCart(user.id);
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
let item = data[i];
|
let item = data[i];
|
||||||
data.startBuyCount = item.buyCount;
|
item.startBuyCount = item.buyCount;
|
||||||
}
|
}
|
||||||
this.cartData = data;
|
this.cartData = data;
|
||||||
// this.goldmedal = data;
|
// this.goldmedal = data;
|
||||||
@ -312,8 +312,9 @@ export default {
|
|||||||
this.saveCartNumber(this.cartData[index])
|
this.saveCartNumber(this.cartData[index])
|
||||||
},
|
},
|
||||||
/* 保存购物车数量 */
|
/* 保存购物车数量 */
|
||||||
async saveCartNumber(cartInfo){
|
async saveCartNumber(cartInfo,index){
|
||||||
if(!cartInfo.buyCount || cartInfo.buyCount <= 0){
|
if(!cartInfo.buyCount || cartInfo.buyCount <= 0){
|
||||||
|
this.cartData[index].buyCount = Number(cartInfo.startBuyCount);
|
||||||
return this.$messageToast('数量不正确','error');
|
return this.$messageToast('数量不正确','error');
|
||||||
}
|
}
|
||||||
if (cartInfo.buyCount >= cartInfo.leftAllotment) {
|
if (cartInfo.buyCount >= cartInfo.leftAllotment) {
|
||||||
|
@ -113,7 +113,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="rc-foot">
|
<div class="rc-foot">
|
||||||
<div class="rc-foo">
|
<div class="rc-foo">
|
||||||
<div class="online bold "></div>
|
<div class="online bold "></div>
|
||||||
@ -142,6 +142,7 @@
|
|||||||
<h3>温馨提示</h3>
|
<h3>温馨提示</h3>
|
||||||
<span class="">{{ paytypeWarning.message }}</span>
|
<span class="">{{ paytypeWarning.message }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="qrcode rc-center"><vue-qr :text="qrtext" :size="200"></vue-qr></div>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<MyFooter></MyFooter>
|
<MyFooter></MyFooter>
|
||||||
@ -157,7 +158,7 @@ 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 { userin, selectaddress, canceldanhao, generateOrderWX, repayOrde } from '../../ajax/getData';
|
import { userin, selectaddress, canceldanhao, generateOrderWX, repayOrde } from '../../ajax/getData';
|
||||||
|
import vueQr from 'vue-qr';
|
||||||
import util from '@/ajax/util';
|
import util from '@/ajax/util';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -170,7 +171,7 @@ export default {
|
|||||||
userproductId: '',
|
userproductId: '',
|
||||||
logisticsDate: '',
|
logisticsDate: '',
|
||||||
addressPhoneNumber: '',
|
addressPhoneNumber: '',
|
||||||
|
qrtext: '', //支付二维码内容
|
||||||
logisticsNumber: '',
|
logisticsNumber: '',
|
||||||
customer: '', //联系客服或者取消订单
|
customer: '', //联系客服或者取消订单
|
||||||
payorsucess: '', //立即支付或者再次购买,
|
payorsucess: '', //立即支付或者再次购买,
|
||||||
@ -200,12 +201,12 @@ export default {
|
|||||||
distribution: '快递',
|
distribution: '快递',
|
||||||
catimage: require('../../assets/image/rc-left.png')
|
catimage: require('../../assets/image/rc-left.png')
|
||||||
},
|
},
|
||||||
crumbs : [
|
crumbs: [
|
||||||
{
|
{
|
||||||
path: '/personal/useraddress'
|
path: '/personal/useraddress'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title : '订单详情'
|
title: '订单详情'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
@ -253,7 +254,34 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
//订单支付和再次购买
|
//订单支付和再次购买
|
||||||
onceagain(item) {
|
async onceagain(item) {
|
||||||
|
console.log(item);
|
||||||
|
let orderDetail = item.orderDetailList[0];
|
||||||
|
let { msg } = await generateOrderWX(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
basePoint: item.basePoint,
|
||||||
|
productName: orderDetail.productName,
|
||||||
|
buyCount: orderDetail.pcs,
|
||||||
|
productCode: orderDetail.productCode,
|
||||||
|
payAmount: orderDetail.ecPrice,
|
||||||
|
memberId: this.userdata.id,
|
||||||
|
phoneNumber: item.phoneNumber,
|
||||||
|
orderAddress: {
|
||||||
|
addressPhoneNumber: item.addressPhoneNumber,
|
||||||
|
addressUserName: item.addressUserName,
|
||||||
|
addressProvinceName: item.addressProvinceName,
|
||||||
|
addressCityName: item.addressCityName,
|
||||||
|
addressCountyName: item.addressCountyName,
|
||||||
|
addressDetailInfo: item.addressDetailInfo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
1
|
||||||
|
);
|
||||||
|
|
||||||
|
this.qrtext = msg;
|
||||||
|
|
||||||
this.paytypeWarning = this.util.checkPaytypeValidated(this.paytype);
|
this.paytypeWarning = this.util.checkPaytypeValidated(this.paytype);
|
||||||
this.showPaytypeWarning = !this.paytypeWarning.result;
|
this.showPaytypeWarning = !this.paytypeWarning.result;
|
||||||
if (this.paytypeWarning.result) {
|
if (this.paytypeWarning.result) {
|
||||||
@ -396,8 +424,8 @@ export default {
|
|||||||
this.payorsucess = '再次购买';
|
this.payorsucess = '再次购买';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resetData(){
|
resetData() {
|
||||||
if(this.userdata && this.loginState){
|
if (this.userdata && this.loginState) {
|
||||||
this.editaddress(this.userid);
|
this.editaddress(this.userid);
|
||||||
this.orderNumber = this.$route.query.orderNumber;
|
this.orderNumber = this.$route.query.orderNumber;
|
||||||
this.orderquantity(this.orderNumber);
|
this.orderquantity(this.orderNumber);
|
||||||
@ -419,19 +447,20 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
Myheader,
|
Myheader,
|
||||||
MyFooter,
|
MyFooter,
|
||||||
tabs
|
tabs,
|
||||||
|
vueQr
|
||||||
},
|
},
|
||||||
computed : {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
userdata : state => state.user.userInfo,
|
userdata: state => state.user.userInfo,
|
||||||
usermessage : state => state.user.userInfo,
|
usermessage: state => state.user.userInfo,
|
||||||
userid : state => state.user.userInfo.id,
|
userid: state => state.user.userInfo.id,
|
||||||
userphone : state => state.user.userInfo.mobile,
|
userphone: state => state.user.userInfo.mobile,
|
||||||
loginState : state => state.login.loginState,
|
loginState: state => state.login.loginState
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
watch : {
|
watch: {
|
||||||
userdata(){
|
userdata() {
|
||||||
this.resetData();
|
this.resetData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -274,7 +274,7 @@ export default {
|
|||||||
let orderDetail = item.orderDetailList[0];
|
let orderDetail = item.orderDetailList[0];
|
||||||
this.useralllist[y].payInfo = [
|
this.useralllist[y].payInfo = [
|
||||||
{
|
{
|
||||||
basePoint: item.item,
|
basePoint: item.basePoint,
|
||||||
productName: orderDetail.productName,
|
productName: orderDetail.productName,
|
||||||
buyCount: orderDetail.pcs,
|
buyCount: orderDetail.pcs,
|
||||||
productCode: orderDetail.productCode,
|
productCode: orderDetail.productCode,
|
||||||
@ -307,7 +307,6 @@ export default {
|
|||||||
let filterArr = this.useralllist.filter(val => {
|
let filterArr = this.useralllist.filter(val => {
|
||||||
return val != undefined;
|
return val != undefined;
|
||||||
});
|
});
|
||||||
console.log(this.useralllist,'2222');
|
|
||||||
this.useralllist = filterArr;
|
this.useralllist = filterArr;
|
||||||
},
|
},
|
||||||
//订单立即支付
|
//订单立即支付
|
||||||
@ -430,7 +429,7 @@ export default {
|
|||||||
let orderDetail = item.orderDetailList[0];
|
let orderDetail = item.orderDetailList[0];
|
||||||
this.useralllist[y].payInfo = [
|
this.useralllist[y].payInfo = [
|
||||||
{
|
{
|
||||||
basePoint: item.item,
|
basePoint: item.basePoint,
|
||||||
productName: orderDetail.productName,
|
productName: orderDetail.productName,
|
||||||
buyCount: orderDetail.pcs,
|
buyCount: orderDetail.pcs,
|
||||||
productCode: orderDetail.productCode,
|
productCode: orderDetail.productCode,
|
||||||
|
Loading…
Reference in New Issue
Block a user