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;
|
||||
}
|
||||
|
||||
.qrcode{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ts-button-container {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
|
@ -49,7 +49,7 @@
|
||||
<li>
|
||||
<div class="rc-jia">
|
||||
<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)" />
|
||||
</div>
|
||||
</li>
|
||||
@ -211,7 +211,7 @@ export default {
|
||||
let data = await isexistCart(user.id);
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
let item = data[i];
|
||||
data.startBuyCount = item.buyCount;
|
||||
item.startBuyCount = item.buyCount;
|
||||
}
|
||||
this.cartData = data;
|
||||
// this.goldmedal = data;
|
||||
@ -312,8 +312,9 @@ export default {
|
||||
this.saveCartNumber(this.cartData[index])
|
||||
},
|
||||
/* 保存购物车数量 */
|
||||
async saveCartNumber(cartInfo){
|
||||
async saveCartNumber(cartInfo,index){
|
||||
if(!cartInfo.buyCount || cartInfo.buyCount <= 0){
|
||||
this.cartData[index].buyCount = Number(cartInfo.startBuyCount);
|
||||
return this.$messageToast('数量不正确','error');
|
||||
}
|
||||
if (cartInfo.buyCount >= cartInfo.leftAllotment) {
|
||||
|
@ -142,6 +142,7 @@
|
||||
<h3>温馨提示</h3>
|
||||
<span class="">{{ paytypeWarning.message }}</span>
|
||||
</div>
|
||||
<div class="qrcode rc-center"><vue-qr :text="qrtext" :size="200"></vue-qr></div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<MyFooter></MyFooter>
|
||||
@ -157,7 +158,7 @@ import Vue from 'vue';
|
||||
let vm = new Vue();
|
||||
import formatConversion from '../../static/js/date';
|
||||
import { userin, selectaddress, canceldanhao, generateOrderWX, repayOrde } from '../../ajax/getData';
|
||||
|
||||
import vueQr from 'vue-qr';
|
||||
import util from '@/ajax/util';
|
||||
|
||||
export default {
|
||||
@ -170,7 +171,7 @@ export default {
|
||||
userproductId: '',
|
||||
logisticsDate: '',
|
||||
addressPhoneNumber: '',
|
||||
|
||||
qrtext: '', //支付二维码内容
|
||||
logisticsNumber: '',
|
||||
customer: '', //联系客服或者取消订单
|
||||
payorsucess: '', //立即支付或者再次购买,
|
||||
@ -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.showPaytypeWarning = !this.paytypeWarning.result;
|
||||
if (this.paytypeWarning.result) {
|
||||
@ -419,7 +447,8 @@ export default {
|
||||
components: {
|
||||
Myheader,
|
||||
MyFooter,
|
||||
tabs
|
||||
tabs,
|
||||
vueQr
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
@ -427,7 +456,7 @@ export default {
|
||||
usermessage: state => state.user.userInfo,
|
||||
userid: state => state.user.userInfo.id,
|
||||
userphone: state => state.user.userInfo.mobile,
|
||||
loginState : state => state.login.loginState,
|
||||
loginState: state => state.login.loginState
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
|
@ -274,7 +274,7 @@ export default {
|
||||
let orderDetail = item.orderDetailList[0];
|
||||
this.useralllist[y].payInfo = [
|
||||
{
|
||||
basePoint: item.item,
|
||||
basePoint: item.basePoint,
|
||||
productName: orderDetail.productName,
|
||||
buyCount: orderDetail.pcs,
|
||||
productCode: orderDetail.productCode,
|
||||
@ -307,7 +307,6 @@ export default {
|
||||
let filterArr = this.useralllist.filter(val => {
|
||||
return val != undefined;
|
||||
});
|
||||
console.log(this.useralllist,'2222');
|
||||
this.useralllist = filterArr;
|
||||
},
|
||||
//订单立即支付
|
||||
@ -430,7 +429,7 @@ export default {
|
||||
let orderDetail = item.orderDetailList[0];
|
||||
this.useralllist[y].payInfo = [
|
||||
{
|
||||
basePoint: item.item,
|
||||
basePoint: item.basePoint,
|
||||
productName: orderDetail.productName,
|
||||
buyCount: orderDetail.pcs,
|
||||
productCode: orderDetail.productCode,
|
||||
|
Loading…
Reference in New Issue
Block a user