|
@@ -5,16 +5,16 @@
|
|
|
<!-- 地址选择 -->
|
|
|
<choice-address ref="choiceAddress" v-if="isAddress" :addressData="addressData"></choice-address>
|
|
|
<!-- 商品 -->
|
|
|
- <seller-goodsList ref='goods' v-if="isRequest" :goodsData="goodsData" @handleGoodList="handChangeInputGoodsList"></seller-goodsList>
|
|
|
+ <goodsList ref='goods' v-if="isRequest" :goodsData="goodsData" @handleGoodList="handChangeInputGoodsList"></goodsList>
|
|
|
<!-- 发票信息 -->
|
|
|
<seller-invoice ref="invoice"
|
|
|
- v-if="isRequest && isDepositFlg"
|
|
|
+ v-if="isRequest"
|
|
|
:invoiceDatas="invoiceData"
|
|
|
@handleChoiceaInvoice="handleChoiceaInvoiceData">
|
|
|
</seller-invoice>
|
|
|
<!-- 运费 -->
|
|
|
<seller-freight ref="freight"
|
|
|
- v-if="isFreight && isDepositFlg"
|
|
|
+ v-if="isFreight"
|
|
|
:freightDatas="freightData"
|
|
|
@handleChoiceaFreight="handleChoiceaFreightData"
|
|
|
@showFreightAlert="handFreightAlertShow">
|
|
@@ -27,11 +27,6 @@
|
|
|
<text>共{{allCount}}件商品</text>
|
|
|
</view>
|
|
|
<view class="footer-price">
|
|
|
- <view class="sum-none" v-if="reducedPrice > 0">
|
|
|
- <text class="money-sign">¥</text>
|
|
|
- <text class="money">{{ totalOriginalPrice | NumFormat }}</text>
|
|
|
- <text class="money-reduced">减<text>¥{{ reducedPrice | NumFormat}}</text></text>
|
|
|
- </view>
|
|
|
<view class="sum" :class="reducedPrice == 0 ? 'none' : ''">总价:<text class="price">¥{{payAllPrice | NumFormat}}</text></view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -43,8 +38,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import choiceAddress from '@/components/cm-module/creatOrder/sellerAddress'
|
|
|
- import sellerGoodsList from '@/components/cm-module/creatOrder/sellerGoodsList'
|
|
|
+ import choiceAddress from '@/components/cm-module/creatOrder/address'
|
|
|
+ import goodsList from '@/components/cm-module/creatOrder/goodsList'
|
|
|
import sellerInvoice from '@/components/cm-module/creatOrder/sellerInvoice'
|
|
|
import sellerFreight from '@/components/cm-module/creatOrder/sellerFreight'
|
|
|
import freightAlert from '@/components/cm-module/modelAlert/freightAlert.vue'
|
|
@@ -52,7 +47,7 @@
|
|
|
export default {
|
|
|
components:{
|
|
|
choiceAddress,
|
|
|
- sellerGoodsList,
|
|
|
+ goodsList,
|
|
|
sellerInvoice,
|
|
|
sellerFreight,
|
|
|
freightAlert,
|
|
@@ -62,20 +57,19 @@
|
|
|
return {
|
|
|
modallayer:false,
|
|
|
orderID:0,
|
|
|
- clubID:'',
|
|
|
+ userId:'',
|
|
|
productIds:'', //获取上一级页面商品信息
|
|
|
productCount:'', //获取上一级页面商品数量
|
|
|
classifyIDS:'', //获取上一级页面商品分类
|
|
|
serviceProviderId:'', //协销ID
|
|
|
- cartType:3, //购买类型(1购物车提交,2直接购买提交,3协销下单)
|
|
|
submitState:'', //提交状态
|
|
|
allCount:1, //订单提交总数量
|
|
|
totalOriginalPrice:0, //订单总原价(划线部分)
|
|
|
reducedPrice:0, //满减金额
|
|
|
payAllPrice:0.00, //订单提交总金额
|
|
|
allPrice:0.00, //订单总金额
|
|
|
- addressID:'', //地址ID
|
|
|
- townID:'', //区ID
|
|
|
+ addressId:'', //地址ID
|
|
|
+ townId:'', //区ID
|
|
|
isRequest:false, //是否加载完成渲染子组件
|
|
|
isFreight:false, //是否加载完成渲染子组件
|
|
|
isAddress:false, //是否加载完成地址
|
|
@@ -95,20 +89,10 @@
|
|
|
onLoad(option){//商品数据
|
|
|
let data = JSON.parse(option.data);
|
|
|
this.allPrice = data.data.allPrice;
|
|
|
- this.allCount = data.data.allCount;
|
|
|
- this.payAllPrice = this.allPrice;
|
|
|
- this.clubId = data.data.clubId
|
|
|
- this.productCount = data.data.productCount
|
|
|
+ this.payAllPrice = this.totalPrice;
|
|
|
+ this.userId = data.data.userId
|
|
|
this.productIds = data.data.productID
|
|
|
- if(option.type =='prodcut'){
|
|
|
- this.getInitProdcutCrearOrder();
|
|
|
- }else{
|
|
|
- this.getInitCrearOrder();
|
|
|
- }
|
|
|
-
|
|
|
- this.$api.getComStorage('orderUserInfo').then((resolve) =>{
|
|
|
- this.clubUserId = resolve.userID
|
|
|
- })
|
|
|
+ this.getInitCrearOrder();
|
|
|
},
|
|
|
filters:{
|
|
|
NumFormat(value) {//处理金额
|
|
@@ -116,70 +100,52 @@
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
- getInitProdcutCrearOrder(option){//二手下单初始化查询
|
|
|
- this.$api.getStorage().then((resolve) =>{
|
|
|
- this.serviceProviderId = resolve.serviceProviderID
|
|
|
- let params ={clubId:this.clubId,serviceProviderId:this.serviceProviderId,productCount:this.productCount,productId:this.productIds}
|
|
|
- this.SellerService.GetSettlementBySencondProduct(params).then(response =>{
|
|
|
- let resData = response.data
|
|
|
- this.isRequest = true
|
|
|
- this.goodsData = resData.shopList
|
|
|
- }).catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000)
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- getInitCrearOrder(option){//协销购物车跳转确认订单初始化信息
|
|
|
- this.$api.getStorage().then((resolve) =>{
|
|
|
- this.serviceProviderId = resolve.serviceProviderID
|
|
|
- let params ={clubId:this.clubId,serviceProviderId:this.serviceProviderId,count:this.productCount,productIds:this.productIds}
|
|
|
- this.SellerService.SellerSettlement(params).then(response =>{
|
|
|
+ getInitCrearOrder(option){//确认订单初始化信息
|
|
|
+ let params ={userId:this.userId,productIds:this.productIds}
|
|
|
+ this.OrderService.QueryOrderConfirm(params)
|
|
|
+ .then(response =>{
|
|
|
let data = response.data
|
|
|
let productIds = []
|
|
|
this.isRequest = true
|
|
|
this.goodsData = data.shopList
|
|
|
- this.userMoney = data.userMoney
|
|
|
this.reducedPrice = data.reducedPrice
|
|
|
this.totalOriginalPrice = data.reducedPrice + data.totalAmount
|
|
|
- this.allPrice = this.payAllPrice = data.totalAmount
|
|
|
- }).catch(error =>{
|
|
|
+ this.allPrice = this.payAllPrice = data.totalPrice
|
|
|
+ })
|
|
|
+ .catch(error =>{
|
|
|
this.$util.msg(error.msg,2000)
|
|
|
})
|
|
|
- })
|
|
|
},
|
|
|
getFreightData(){//获取邮费信息
|
|
|
- this.$api.getComStorage('orderUserInfo').then((resolve) =>{
|
|
|
- let params ={
|
|
|
- userId:resolve.userID,
|
|
|
- productIds:this.productIds,
|
|
|
- totalPrice:this.allPrice,
|
|
|
- townId:this.addressData.townID
|
|
|
- }
|
|
|
- this.OrderService.GetOrderPostage(params).then(response =>{
|
|
|
- this.isFreight = true
|
|
|
- this.freightData = response.data
|
|
|
- if(response.data.freePostFlag== 1){
|
|
|
- this.payAllPrice = this.allPrice+response.data.freight
|
|
|
- }else{
|
|
|
- this.payAllPrice = this.allPrice
|
|
|
- }
|
|
|
- })
|
|
|
+ let params ={
|
|
|
+ userId:this.userId,
|
|
|
+ productIds:this.productIds,
|
|
|
+ totalPrice:this.allPrice,
|
|
|
+ townId:this.addressData.townId
|
|
|
+ }
|
|
|
+ this.OrderService.GetOrderPostage(params).then(response =>{
|
|
|
+ this.isFreight = true
|
|
|
+ this.freightData = response.data
|
|
|
+ if(response.data.freePostFlag== 1){
|
|
|
+ this.payAllPrice = this.allPrice+response.data.freight
|
|
|
+ }else{
|
|
|
+ this.payAllPrice = this.allPrice
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
getAddressData(){//获取地址信息
|
|
|
- this.$api.getComStorage('orderUserInfo').then((resolve) =>{
|
|
|
- this.UserService.QueryAddressList({pageNum:1,pageSize:1,userID:resolve.userID}).then(response =>{
|
|
|
- this.isAddress = true
|
|
|
- this.addressData = {}
|
|
|
- if(response.data.results != ''){
|
|
|
- this.addressID = response.data.results[0].addressID;
|
|
|
- this.townID = response.data.results[0].townID;
|
|
|
- this.addressData = response.data.results[0];
|
|
|
- this.getFreightData()
|
|
|
- }else{
|
|
|
- this.addressData = this.addressData;
|
|
|
- }
|
|
|
- })
|
|
|
+ this.UserService.QueryAddressList({pageNum:1,pageSize:1,userId:this.userId})
|
|
|
+ .then(response =>{
|
|
|
+ this.isAddress = true
|
|
|
+ this.addressData = {}
|
|
|
+ if(response.data.list != ''){
|
|
|
+ this.addressId = response.data.list[0].addressId;
|
|
|
+ this.townId = response.data.list[0].townId;
|
|
|
+ this.addressData = response.data.list[0];
|
|
|
+ this.getFreightData()
|
|
|
+ }else{
|
|
|
+ this.addressData = this.addressData;
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
handChangeInputGoodsList(data){//对应供应商的留言信息
|
|
@@ -230,18 +196,18 @@
|
|
|
}
|
|
|
},
|
|
|
orderSubmitMit(){//提交订单
|
|
|
- if(this.addressID == ''){
|
|
|
+ if(this.addressId == ''){
|
|
|
this.$util.msg('请先添加收货地址~',2000)
|
|
|
return
|
|
|
}
|
|
|
// 处理商品信息及留言
|
|
|
this.orderInfo = this.goodsData.map(el => {
|
|
|
let productInfo = [];
|
|
|
- el.productsList.forEach(item => {
|
|
|
+ el.productList.forEach(item => {
|
|
|
productInfo.push({
|
|
|
productId:item.productID,
|
|
|
productNum:item.productCount,
|
|
|
- productType:item.giftType ? Number(item.giftType) : 0,
|
|
|
+ productType:item.productType ? Number(item.productType) : 0,
|
|
|
presentNum:0,
|
|
|
})
|
|
|
})
|
|
@@ -252,60 +218,33 @@
|
|
|
orderShouldPayFee:this.payAllPrice.toFixed(2),//提交的总价
|
|
|
balancePayFlag:this.balanceDeductionFlag,//余额抵扣的状态
|
|
|
freight:parseInt(this.freightData.freight).toFixed(2),//邮费
|
|
|
- freePostFlag:parseInt(this.freightData.freePostFlag),//运费形式
|
|
|
- clauseId:this.clauseId,//售后条款
|
|
|
- rebateFlag:this.rebateFlag,//返佣
|
|
|
+ freePostFlag:parseInt(this.freightData.freePostFlag)//运费形式
|
|
|
}
|
|
|
console.log(this.payInfo)
|
|
|
let params = {
|
|
|
- orderSource:6, //提交来源
|
|
|
- clubUserId:this.clubUserId, //机构UserID
|
|
|
- cartType:this.cartType, //从购物车提交
|
|
|
- serviceProviderId:this.serviceProviderId,//帮下单协销ID
|
|
|
- addressId:this.addressID, //地址ID
|
|
|
+ clubUserId:this.userId,
|
|
|
+ addressId:this.addressId, //地址ID
|
|
|
orderInfo:this.orderInfo, //商品信息
|
|
|
payInfo:this.payInfo, //订单信息
|
|
|
orderInvoice:this.invoiceData //发票信息
|
|
|
}
|
|
|
this.modalLayer = true;
|
|
|
- if(this.rebateFlag == 1){
|
|
|
- this.$util.modal('','确定该订单为返佣订单吗?点击确定按钮继续提交订单','确定','取消',true,() =>{
|
|
|
- this.SellerService.SellerCreateOrderSubmit({'params':JSON.stringify(params)}).then(response =>{
|
|
|
- const data = response.data;
|
|
|
- if(data.code === '1'){
|
|
|
- this.$util.msg('支付成功',2000,true,'success')
|
|
|
- setTimeout(() =>{
|
|
|
- this.$api.redirectTo(`/seller/pages/order/order-details?type=cash&orderID=${data.orderID}`)
|
|
|
- },2000)
|
|
|
- }else{
|
|
|
- this.$util.msg('订单提交成功',2000,true,'success')
|
|
|
- setTimeout(()=>{
|
|
|
- this.$api.redirectTo(`/seller/pages/order/order-details?type=cash&orderID=${data.orderID}`)
|
|
|
- },2000)
|
|
|
- }
|
|
|
- }).catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000);
|
|
|
- })
|
|
|
- })
|
|
|
- return
|
|
|
- }else{
|
|
|
- this.SellerService.SellerCreateOrderSubmit({'params':JSON.stringify(params)}).then(response =>{
|
|
|
- const data = response.data;
|
|
|
- if(data.code === '1'){
|
|
|
- this.$util.msg('支付成功',2000,true,'success')
|
|
|
- setTimeout(() =>{
|
|
|
- this.$api.redirectTo(`/seller/pages/order/order-details?type=cash&orderID=${data.orderID}`)
|
|
|
- },2000)
|
|
|
- }else{
|
|
|
- this.$util.msg('订单提交成功',2000,true,'success')
|
|
|
- setTimeout(()=>{
|
|
|
- this.$api.redirectTo(`/seller/pages/order/order-details?type=cash&orderID=${data.orderID}`)
|
|
|
- },2000)
|
|
|
- }
|
|
|
- }).catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000);
|
|
|
- })
|
|
|
- }
|
|
|
+ this.OrderService.CreatedOrderSubmit({'params':JSON.stringify(params)}).then(response =>{
|
|
|
+ const data = response.data;
|
|
|
+ if(data.code === '1'){
|
|
|
+ this.$util.msg('支付成功',2000,true,'success')
|
|
|
+ setTimeout(() =>{
|
|
|
+ this.$api.redirectTo(`/seller/pages/order/order-details?type=cash&orderId=${data.orderId}`)
|
|
|
+ },2000)
|
|
|
+ }else{
|
|
|
+ this.$util.msg('订单提交成功',2000,true,'success')
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.$api.redirectTo(`/seller/pages/order/order-details?type=cash&orderId=${data.orderId}`)
|
|
|
+ },2000)
|
|
|
+ }
|
|
|
+ }).catch(error =>{
|
|
|
+ this.$util.msg(error.msg,2000);
|
|
|
+ })
|
|
|
},
|
|
|
handFreightAlertShow(){//显示邮费弹窗
|
|
|
this.isfreightTip = true;
|
|
@@ -315,13 +254,13 @@
|
|
|
},
|
|
|
},
|
|
|
onShow() {
|
|
|
- // this.addressID = ''
|
|
|
+ // this.addressId = ''
|
|
|
let pages = getCurrentPages();
|
|
|
let currPage = pages[pages.length-1];
|
|
|
if(currPage.data.select =='select'){
|
|
|
this.isAddress = true
|
|
|
let SelectData = uni.getStorageSync('selectAddress');
|
|
|
- this.addressID = SelectData.addressID;
|
|
|
+ this.addressId = SelectData.addressId;
|
|
|
this.addressData = SelectData
|
|
|
this.getFreightData()
|
|
|
}else{
|
|
@@ -464,7 +403,6 @@
|
|
|
font-size: $font-size-26;
|
|
|
}
|
|
|
.footer-price{
|
|
|
- width:370rpx;
|
|
|
float: right;
|
|
|
text-align: right;
|
|
|
color: $text-color;
|
|
@@ -513,7 +451,7 @@
|
|
|
display:flex;
|
|
|
align-items:center;
|
|
|
justify-content: center;
|
|
|
- width: 180rpx;
|
|
|
+ width: 200rpx;
|
|
|
height: 100%;
|
|
|
box-sizing: border-box;
|
|
|
padding: 15rpx 5rpx;
|
|
@@ -521,7 +459,7 @@
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
color: #FFFFFF;
|
|
|
- background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
|
|
|
+ background:#ff2a2a;
|
|
|
font-size: $font-size-26;
|
|
|
text-align: center;
|
|
|
line-height: 80rpx;
|