|
@@ -1,7 +1,5 @@
|
|
<template>
|
|
<template>
|
|
<view class="container order clearfix" :style="{paddingBottom :isIphoneX ? '170rpx' : '134rpx'}">
|
|
<view class="container order clearfix" :style="{paddingBottom :isIphoneX ? '170rpx' : '134rpx'}">
|
|
- <!-- 透明模态层 -->
|
|
|
|
- <modal-layer v-if='modallayer'></modal-layer>
|
|
|
|
<!-- 地址选择 -->
|
|
<!-- 地址选择 -->
|
|
<choice-address ref="choiceAddress" v-if="isAddress" :addressData="addressData"></choice-address>
|
|
<choice-address ref="choiceAddress" v-if="isAddress" :addressData="addressData"></choice-address>
|
|
<!-- 商品 -->
|
|
<!-- 商品 -->
|
|
@@ -83,7 +81,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="footer-submit" @click.stop="orderSubmitMit">
|
|
<view class="footer-submit" @click.stop="orderSubmitMit">
|
|
- <view class="btn">提交订单</view>
|
|
|
|
|
|
+ <view class="btn" :class="isSubLoading ? 'disabled' : ''">提交订单</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 优惠券 -->
|
|
<!-- 优惠券 -->
|
|
@@ -119,6 +117,19 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <!-- 弹窗提示 -->
|
|
|
|
+ <tui-modal
|
|
|
|
+ :show="modal"
|
|
|
|
+ @click="handleClick"
|
|
|
|
+ @cancel="hideMobel"
|
|
|
|
+ :content="contentModalText"
|
|
|
|
+ :button="modalButton"
|
|
|
|
+ color="#333"
|
|
|
|
+ :size="32"
|
|
|
|
+ shape="circle"
|
|
|
|
+ :maskClosable="false"
|
|
|
|
+ >
|
|
|
|
+ </tui-modal>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -131,24 +142,23 @@
|
|
import sellerCoupon from '@/components/cm-module/creatOrder/sellerCoupon'
|
|
import sellerCoupon from '@/components/cm-module/creatOrder/sellerCoupon'
|
|
import sellerExchangeCoupon from '@/components/cm-module/creatOrder/sellerExchangeCoupon'
|
|
import sellerExchangeCoupon from '@/components/cm-module/creatOrder/sellerExchangeCoupon'
|
|
import sellerRegulations from '@/components/cm-module/creatOrder/sellerRegulations.vue'
|
|
import sellerRegulations from '@/components/cm-module/creatOrder/sellerRegulations.vue'
|
|
- import modalLayer from "@/components/modal-layer"
|
|
|
|
|
|
|
|
const defaultProductParam = {
|
|
const defaultProductParam = {
|
|
productCount:0, // 商品数量
|
|
productCount:0, // 商品数量
|
|
productId:0, // 商品Id
|
|
productId:0, // 商品Id
|
|
serviceProviderId:0,// 协销Id
|
|
serviceProviderId:0,// 协销Id
|
|
clubId:0 // 机构Id
|
|
clubId:0 // 机构Id
|
|
- };
|
|
|
|
|
|
+ }
|
|
const defaultCartParam = {
|
|
const defaultCartParam = {
|
|
productIds:0, // 商品Id(逗号隔开)
|
|
productIds:0, // 商品Id(逗号隔开)
|
|
serviceProviderId:0,// 协销Id
|
|
serviceProviderId:0,// 协销Id
|
|
clubId:0 // 机构Id
|
|
clubId:0 // 机构Id
|
|
- };
|
|
|
|
|
|
+ }
|
|
const defaultPostageParam = {
|
|
const defaultPostageParam = {
|
|
productIds:0, // 商品Id(逗号隔开)
|
|
productIds:0, // 商品Id(逗号隔开)
|
|
userId:0, // 用户Id
|
|
userId:0, // 用户Id
|
|
townId:0 // 地区Id
|
|
townId:0 // 地区Id
|
|
- };
|
|
|
|
|
|
+ }
|
|
const defaultConfirmParam = {
|
|
const defaultConfirmParam = {
|
|
cartType:3, // 购买类型:(1自主下单, 3协销下单)
|
|
cartType:3, // 购买类型:(1自主下单, 3协销下单)
|
|
orderSource:6, // 订单来源 1WWW 6小程序[采美,星范]
|
|
orderSource:6, // 订单来源 1WWW 6小程序[采美,星范]
|
|
@@ -167,7 +177,7 @@
|
|
rebateFlag:0 // 是否返佣订单
|
|
rebateFlag:0 // 是否返佣订单
|
|
},
|
|
},
|
|
unionId:uni.getStorageSync('unionId'),// 用户unionId
|
|
unionId:uni.getStorageSync('unionId'),// 用户unionId
|
|
- };
|
|
|
|
|
|
+ }
|
|
export default {
|
|
export default {
|
|
components:{
|
|
components:{
|
|
choiceAddress,
|
|
choiceAddress,
|
|
@@ -177,12 +187,28 @@
|
|
sellerCoupon,
|
|
sellerCoupon,
|
|
sellerExchangeCoupon,
|
|
sellerExchangeCoupon,
|
|
freightAlert,
|
|
freightAlert,
|
|
- modalLayer,
|
|
|
|
sellerRegulations
|
|
sellerRegulations
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- modallayer:false,
|
|
|
|
|
|
+ isSubLoading:false,
|
|
|
|
+ modalButton: [
|
|
|
|
+ {
|
|
|
|
+ text: '再想一想',
|
|
|
|
+ type: 'gray',
|
|
|
|
+ plain: true //是否空心
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '继续提交',
|
|
|
|
+ customStyle: {
|
|
|
|
+ color: '#fff',
|
|
|
|
+ bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'
|
|
|
|
+ },
|
|
|
|
+ plain: false
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ contentModalText: '', //操作文字提示语句
|
|
|
|
+ modal: false,
|
|
isIphoneX:this.$store.state.isIphoneX,
|
|
isIphoneX:this.$store.state.isIphoneX,
|
|
cartParam: Object.assign({}, defaultCartParam), // 购物车立即结算确认订单参数
|
|
cartParam: Object.assign({}, defaultCartParam), // 购物车立即结算确认订单参数
|
|
productParam: Object.assign({}, defaultProductParam), // 二手商品立即购买确认订单参数
|
|
productParam: Object.assign({}, defaultProductParam), // 二手商品立即购买确认订单参数
|
|
@@ -231,7 +257,7 @@
|
|
},
|
|
},
|
|
filters:{
|
|
filters:{
|
|
NumFormat(value) {//处理金额
|
|
NumFormat(value) {//处理金额
|
|
- return Number(value).toFixed(2);
|
|
|
|
|
|
+ return Number(value).toFixed(2)
|
|
},
|
|
},
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -287,7 +313,7 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getInitProdcutCrearOrder(){//二手下单初始化查询
|
|
getInitProdcutCrearOrder(){//二手下单初始化查询
|
|
- this.seconDepositFlg = false;
|
|
|
|
|
|
+ this.seconDepositFlg = false
|
|
this.SellerService.GetSettlementBySencondProduct(this.productParam).then(response =>{
|
|
this.SellerService.GetSettlementBySencondProduct(this.productParam).then(response =>{
|
|
const data = response.data
|
|
const data = response.data
|
|
this.isRequest = true
|
|
this.isRequest = true
|
|
@@ -329,17 +355,17 @@
|
|
this.isAddress = true
|
|
this.isAddress = true
|
|
this.addressData = {}
|
|
this.addressData = {}
|
|
if(response.data.results != ''){
|
|
if(response.data.results != ''){
|
|
- this.confirmParam.addressId = data.list[0].addressId;
|
|
|
|
- this.postageParam.townId = data.list[0].townId;
|
|
|
|
- this.addressData = data.list[0];
|
|
|
|
|
|
+ this.confirmParam.addressId = data.list[0].addressId
|
|
|
|
+ this.postageParam.townId = data.list[0].townId
|
|
|
|
+ this.addressData = data.list[0]
|
|
this.getFreightData()
|
|
this.getFreightData()
|
|
}else{
|
|
}else{
|
|
- this.addressData = this.addressData;
|
|
|
|
|
|
+ this.addressData = this.addressData
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
handChangeInputGoodsList(data){//对应供应商的留言信息
|
|
handChangeInputGoodsList(data){//对应供应商的留言信息
|
|
- this.goodsData = data;
|
|
|
|
|
|
+ this.goodsData = data
|
|
},
|
|
},
|
|
handleChoiceaInvoiceData(data){//获取发票信息
|
|
handleChoiceaInvoiceData(data){//获取发票信息
|
|
this.confirmParam.orderInvoice = data
|
|
this.confirmParam.orderInvoice = data
|
|
@@ -356,12 +382,12 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
handleClauseData(clauseId){// 条款Id
|
|
handleClauseData(clauseId){// 条款Id
|
|
- this.confirmParam.payInfo.clauseId = parseInt(clauseId);
|
|
|
|
|
|
+ this.confirmParam.payInfo.clauseId = parseInt(clauseId)
|
|
},
|
|
},
|
|
handleChoiceaCouponData(data){// 勾选使用优惠券
|
|
handleChoiceaCouponData(data){// 勾选使用优惠券
|
|
console.log('优惠券信息',data)
|
|
console.log('优惠券信息',data)
|
|
this.couponAmount = data.couponAmount
|
|
this.couponAmount = data.couponAmount
|
|
- this.totalDiscountAmount = this.reducedPrice + this.couponAmount;
|
|
|
|
|
|
+ this.totalDiscountAmount = this.reducedPrice + this.couponAmount
|
|
this.clubCouponId = data.clubCouponId
|
|
this.clubCouponId = data.clubCouponId
|
|
this.attributePallPrice()
|
|
this.attributePallPrice()
|
|
},
|
|
},
|
|
@@ -405,7 +431,7 @@
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 勾选后的剩余抵扣
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 勾选后的剩余抵扣
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- this.orderShouldPayFee = this.allPrice - this.couponAmount;
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice - this.couponAmount
|
|
this.deductMoney = 0.00
|
|
this.deductMoney = 0.00
|
|
this.surplusMoney = this.userMoney
|
|
this.surplusMoney = this.userMoney
|
|
}
|
|
}
|
|
@@ -433,12 +459,25 @@
|
|
console.log('优惠券金额',this.couponAmount)
|
|
console.log('优惠券金额',this.couponAmount)
|
|
},
|
|
},
|
|
orderSubmitMit(){//提交订单
|
|
orderSubmitMit(){//提交订单
|
|
|
|
+ this.modal = true
|
|
|
|
+ this.contentModalText = '请仔细确认订单是否为返佣订单后再提交订单'
|
|
|
|
+ },
|
|
|
|
+ handleClick(e){
|
|
|
|
+ //确认提交
|
|
|
|
+ if (e.index == 1) {
|
|
|
|
+ this.SellerCreateOrderSubmit()
|
|
|
|
+ }
|
|
|
|
+ this.modal = false
|
|
|
|
+ },
|
|
|
|
+ SellerCreateOrderSubmit(){
|
|
|
|
+ //提交订单
|
|
|
|
+ if(this.isSubLoading){ return }
|
|
if(this.confirmParam.addressId == ''){
|
|
if(this.confirmParam.addressId == ''){
|
|
this.$util.msg('请先添加收货地址~',2000)
|
|
this.$util.msg('请先添加收货地址~',2000)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.confirmParam.orderInfo = this.goodsData.map(el => {
|
|
this.confirmParam.orderInfo = this.goodsData.map(el => {
|
|
- let productInfo = [];
|
|
|
|
|
|
+ let productInfo = []
|
|
el.cartList.forEach(item => {
|
|
el.cartList.forEach(item => {
|
|
productInfo.push({
|
|
productInfo.push({
|
|
productId:item.productId,
|
|
productId:item.productId,
|
|
@@ -456,53 +495,57 @@
|
|
this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
|
|
this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
|
|
this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
|
|
this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
|
|
console.log(this.confirmParam)
|
|
console.log(this.confirmParam)
|
|
- this.modalLayer = true;
|
|
|
|
- this.$util.modal('','请仔细确认订单是否为返佣订单后再提交订单','继续提交','再想一想',true,() =>{
|
|
|
|
- this.SellerService.SellerCreateOrderSubmit(this.confirmParam).then(response =>{
|
|
|
|
- const data = response.data;
|
|
|
|
- if(data.code === 1){
|
|
|
|
- this.$util.msg('支付成功',2000,true,'success')
|
|
|
|
- setTimeout(() =>{
|
|
|
|
- this.$api.redirectTo(`/pages/seller/order/order-details?type=cash&orderId=${data.orderId}&userId=${this.postageParam.userId}`)
|
|
|
|
- },2000)
|
|
|
|
- }else{
|
|
|
|
- this.$util.msg('订单提交成功',2000,true,'success')
|
|
|
|
- setTimeout(()=>{
|
|
|
|
- this.$api.redirectTo(`/pages/seller/order/order-details?type=cash&orderId=${data.orderId}&userId=${this.postageParam.userId}`)
|
|
|
|
- },2000)
|
|
|
|
- }
|
|
|
|
- }).catch(error =>{
|
|
|
|
- this.$util.msg(error.msg,2000);
|
|
|
|
- })
|
|
|
|
|
|
+ this.isSubLoading = true
|
|
|
|
+ this.SellerService.SellerCreateOrderSubmit(this.confirmParam).then(response =>{
|
|
|
|
+ const data = response.data
|
|
|
|
+ if(data.code === 1){
|
|
|
|
+ this.$util.msg('支付成功',2000,true,'success')
|
|
|
|
+ setTimeout(() =>{
|
|
|
|
+ this.isSubLoading = false
|
|
|
|
+ this.$api.redirectTo(`/pages/seller/order/order-details?type=cash&orderId=${data.orderId}&userId=${this.postageParam.userId}`)
|
|
|
|
+ },2000)
|
|
|
|
+ }else{
|
|
|
|
+ this.$util.msg('订单提交成功',2000,true,'success')
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.isSubLoading = false
|
|
|
|
+ this.$api.redirectTo(`/pages/seller/order/order-details?type=cash&orderId=${data.orderId}&userId=${this.postageParam.userId}`)
|
|
|
|
+ },2000)
|
|
|
|
+ }
|
|
|
|
+ }).catch(error =>{
|
|
|
|
+ this.isSubLoading = false
|
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
RebateChang(){// 返佣订单勾选
|
|
RebateChang(){// 返佣订单勾选
|
|
- this.rebatecheck = !this.rebatecheck;
|
|
|
|
|
|
+ this.rebatecheck = !this.rebatecheck
|
|
if(this.rebatecheck){
|
|
if(this.rebatecheck){
|
|
- this.confirmParam.payInfo.rebateFlag=1;
|
|
|
|
|
|
+ this.confirmParam.payInfo.rebateFlag=1
|
|
}else{
|
|
}else{
|
|
- this.confirmParam.payInfo.rebateFlag=0;
|
|
|
|
|
|
+ this.confirmParam.payInfo.rebateFlag=0
|
|
}
|
|
}
|
|
console.log(this.confirmParam.payInfo.rebateFlag)
|
|
console.log(this.confirmParam.payInfo.rebateFlag)
|
|
},
|
|
},
|
|
handFreightAlertShow(){//显示邮费弹窗
|
|
handFreightAlertShow(){//显示邮费弹窗
|
|
- this.isfreightTip = true;
|
|
|
|
|
|
+ this.isfreightTip = true
|
|
},
|
|
},
|
|
handleClickCancel(){// 关闭优惠券弹窗
|
|
handleClickCancel(){// 关闭优惠券弹窗
|
|
- this.isCouponModel = false;
|
|
|
|
- this.getInitCrearOrder();
|
|
|
|
|
|
+ this.isCouponModel = false
|
|
|
|
+ this.getInitCrearOrder()
|
|
},
|
|
},
|
|
hideFreight(){//关闭邮费弹窗
|
|
hideFreight(){//关闭邮费弹窗
|
|
- this.isfreightTip = false;
|
|
|
|
|
|
+ this.isfreightTip = false
|
|
|
|
+ },
|
|
|
|
+ hideMobel() {
|
|
|
|
+ this.modal = false
|
|
},
|
|
},
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
- let pages = getCurrentPages();
|
|
|
|
- let currPage = pages[pages.length-1];
|
|
|
|
|
|
+ let pages = getCurrentPages()
|
|
|
|
+ let currPage = pages[pages.length-1]
|
|
if(currPage.data.select =='select'){
|
|
if(currPage.data.select =='select'){
|
|
this.isAddress = true
|
|
this.isAddress = true
|
|
- let SelectData = uni.getStorageSync('selectAddress');
|
|
|
|
- this.confirmParam.addressId = SelectData.addressId;
|
|
|
|
|
|
+ let SelectData = uni.getStorageSync('selectAddress')
|
|
|
|
+ this.confirmParam.addressId = SelectData.addressId
|
|
this.postageParam.townId = SelectData.townId
|
|
this.postageParam.townId = SelectData.townId
|
|
this.addressData = SelectData
|
|
this.addressData = SelectData
|
|
this.getFreightData()
|
|
this.getFreightData()
|
|
@@ -707,6 +750,10 @@
|
|
text-align: center;
|
|
text-align: center;
|
|
line-height: 80rpx;
|
|
line-height: 80rpx;
|
|
border-radius: 40rpx;
|
|
border-radius: 40rpx;
|
|
|
|
+ &.disabled{
|
|
|
|
+ background: #e4e8eb;
|
|
|
|
+ color: #999999;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|