添加:立即进货 - 下单及支付流程

This commit is contained in:
wuhui_zzw 2024-03-01 22:04:03 +08:00
parent 21b1340734
commit 76a1221880
4 changed files with 111 additions and 74 deletions

View File

@ -74,8 +74,8 @@ export function integralOrderPay(id,data){
/**
* 订单统计数据
*/
export function orderData(){
return request.get('order/number')
export function orderData(data){
return request.get('order/number',data)
}
/**

View File

@ -10,7 +10,10 @@
</view>
</view>
<!--顶部提示-->
<view class="top-tips">请添加你需要的商品进行进货</view>
<view class="top-tips">
请添加你需要的商品进行进货
<view class="record-btn" @click="withGoodsRecord">进货记录</view>
</view>
<!--商品列表-->
<view class="list">
<view class="item" v-for="(item,index) in Object.values(list)" :key="index">
@ -154,7 +157,7 @@ export default {
return spec.cart_num || 0;
},
...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor','shopToken', 'shopIsLogin', 'shopMerId'])
...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor', 'shopIsLogin', 'shopMerId'])
},
data() {
return {
@ -540,13 +543,21 @@ export default {
}
//
uni.navigateTo({
url: '/pages/users/order_confirm/index?cartId=' + data.join(',')
url: '/pages/users/order_confirm/index?is_with_goods=1&cartId=' + data.join(',')
});
}
}).catch(err => {
_this.$util.Tips({title: err});
});
},
//
withGoodsRecord(){
uni.navigateTo({
url: '/pages/users/order_list/index?is_with_goods=1'
});
}
},
//
onReachBottom() {
@ -608,6 +619,19 @@ export default {
width: 100%;
height: 80rpx;
line-height: 80rpx;
position: relative;
.record-btn{
position: absolute;
top: calc((80rpx - 40rpx) / 2);
right: 0;
font-size: 26rpx;
padding: 0 15rpx;
border: 2rpx solid #813d40;
height: 40rpx;
line-height: 40rpx;
border-radius: 6rpx;
margin-right: 15rpx;
}
}
//
.list{

View File

@ -297,7 +297,7 @@
<view class='tip'>
{{item.title}}
<block v-if="item.value == 'balance'">
{{userInfo.now_money}}
{{ is_with_goods ? (withGoodsMerInfo.mer_money || 0.00) : userInfo.now_money }}
</block>
</view>
</view>
@ -313,7 +313,7 @@
<view class='tip'>
{{item.title}}
<block v-if="item.value == 'balance'">
{{userInfo.now_money}}
{{ is_with_goods ? (withGoodsMerInfo.mer_money || 0.00) : userInfo.now_money }}
</block>
</view>
</view>
@ -422,33 +422,11 @@
<script>
let app = getApp();
import {
orderConfirm,
getOrderConfirm,
getCouponsOrderPrice,
orderCreate,
createOrder
} from '@/api/order.js';
import {
getAddressDefault,
getAddressDetail,
getAddressList,
getUserInfo,
getAgreementApi
} from '@/api/user.js';
import {
openPaySubscribe
} from '@/utils/SubscribeMessage.js';
import {
presellAgreement
} from '@/api/activity.js';
import {
storeListApi
} from '@/api/store.js';
import {
CACHE_LONGITUDE,
CACHE_LATITUDE
} from '@/config/cache.js';
import {createOrder, getOrderConfirm} from '@/api/order.js';
import {getAddressDetail, getAddressList, getAgreementApi, getUserInfo} from '@/api/user.js';
import {openPaySubscribe} from '@/utils/SubscribeMessage.js';
import {presellAgreement} from '@/api/activity.js';
import {storeListApi,getStoreDetail} from '@/api/store.js';
import couponListWindow from '@/components/orderCoupon';
import addressWindow from '@/components/addressWindow';
import orderGoods from '@/components/orderGoods';
@ -460,6 +438,7 @@
import authorize from '@/components/Authorize';
import {configMap} from '@/utils';
import {HTTP_REQUEST_URL} from '@/config/app';
export default {
components: {
couponListWindow,
@ -643,10 +622,13 @@
order_key: '',
is_take: '',
domain: HTTP_REQUEST_URL,
//
is_with_goods: 0,// 0=1=
withGoodsMerInfo: {},
};
},
computed: {
...mapGetters(['isLogin','viewColor']),
...mapGetters(['isLogin','viewColor', 'shopIsLogin', 'shopMerId']),
...configMap(['hide_mer_status', 'alipay_open', 'yue_pay_status']),
},
watch: {
@ -660,6 +642,12 @@
onReady() {},
mounted: function() {},
onLoad: function(options) {
this.is_with_goods = options.is_with_goods || 0;
if(this.is_with_goods){
getStoreDetail(this.shopMerId).then(res => {
this.withGoodsMerInfo = res.data;
});
}
this.seckillId = options.seckillId
// #ifdef H5
this.from = this.$wechat.isWeixin() ? 'weixin' : 'h5'
@ -1016,6 +1004,8 @@
use_integral: that.use_integral,
// use_mer_integral: that.use_mer_integral,
// use_platform_integral: that.use_platform_integral,
is_with_goods: that.is_with_goods || 0,
with_goods_mer_id: that.shopMerId || 0
}).then(res => {
//
that.is_take = false
@ -1177,6 +1167,8 @@
},
payment: function(data) {
let that = this;
data.is_with_goods = that.is_with_goods || 0;
data.with_goods_mer_id = that.shopMerId || 0;
createOrder(data).then(res => {
let status = res.data.status,
orderId = res.data.result.order_id,

View File

@ -125,7 +125,7 @@
<text class='money p-color'>{{item.pay_price}}</text>
</view>
<view class='bottom acea-row row-right row-middle'>
<view class='bnt b-color' @click.stop='goPay(item.pay_price,item.group_order_id)'>立即付款</view>
<view class='bnt b-color' @click.stop='goPay(item)'>立即付款</view>
</view>
</view>
</view>
@ -279,6 +279,8 @@
import emptyPage from '@/components/emptyPage.vue';
import { configMap } from '@/utils'
import { HTTP_REQUEST_URL } from '@/config/app';
import {getStoreDetail} from '@/api/store.js';
export default {
components: {
payment,
@ -333,16 +335,20 @@
invoice: {
invoice: false,
add: false,
}
},
//
user_balance: 0.00,
mer_balance: 0.00,
is_with_goods: 0,
};
},
onLoad(options) {
onLoad: function(options) {
this.is_with_goods = options.is_with_goods || 0;
//
if(options.spread) spread(options.spread, this.isLogin)
},
computed: {
...mapGetters(['isLogin','uid','viewColor']),
...mapGetters(['isLogin','uid','viewColor', 'shopIsLogin', 'shopMerId']),
...configMap(['hide_mer_status', 'community_status', 'alipay_open', 'yue_pay_status']),
},
watch: {
@ -407,8 +413,14 @@
getUserInfo: function() {
let that = this;
getUserInfo().then(res => {
that.user_balance = res.data.now_money || 0.00;
that.payMode[2].number = res.data.now_money;
});
if(that.shopIsLogin){
getStoreDetail(that.shopMerId).then(res => {
that.mer_balance = res.data.mer_money || 0.00;
});
}
},
/**
* 关闭支付组件
@ -421,6 +433,7 @@
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.is_with_goods = options.is_with_goods || 0;
if (options.status) this.orderStatus = options.status;
},
/**
@ -429,7 +442,10 @@
*/
getOrderData: function() {
let that = this;
orderData().then(res => {
orderData({
is_with_goods: that.is_with_goods || 0,
with_goods_mer_id: that.shopMerId || 0,
}).then(res => {
that.$set(that, 'orderData', res.data);
})
},
@ -458,15 +474,16 @@
});
});
},
/**
* 打开支付组件
*
*/
goPay: function(pay_price, order_id) {
//
goPay: function(item) {
//
if(item.activity_type == 35) this.payMode[2].number = this.mer_balance || 0.00;
else this.payMode[2].number = this.user_balance || 0.00;
//
this.$set(this, 'pay_close', true);
this.order_id = order_id;
this.pay_order_id = order_id.toString()
this.$set(this, 'totalPrice', pay_price);
this.order_id = item.group_order_id;
this.pay_order_id = item.group_order_id.toString()
this.$set(this, 'totalPrice', item.pay_price);
},
/**
* 支付成功回调
@ -586,6 +603,8 @@
groupOrderList({
page: that.page,
limit: that.limit,
is_with_goods: that.is_with_goods || 0,
with_goods_mer_id: that.shopMerId || 0,
}).then(res => {
that.isReady = true;
let list = res.data.list || [];
@ -605,6 +624,8 @@
status: that.orderStatus - 1,
page: that.page,
limit: that.limit,
is_with_goods: that.is_with_goods || 0,
with_goods_mer_id: that.shopMerId || 0,
}).then(res => {
let list = res.data.list || [];
let loadend = list.length < that.limit;