12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094 |
- <template>
- <view class="container order clearfix" :style="{paddingBottom :isIphoneX ? '190rpx' : '134rpx'}">
- <!-- 地址选择 -->
- <choice-address ref="choiceAddress" v-if="isAddress" :addressData="addressData"></choice-address>
- <!-- 商品 -->
- <seller-goodsList ref='goods' v-if="isRequest" :secondflag="secondflag" :goodsData="goodsData" @handleGoodList="handChangeInputGoodsList"></seller-goodsList>
- <!-- 返佣订单 -->
- <view class="order-return" v-if="goodsData.length==1 && secondflag">
- <view class="order-return-main" @click="handleRebateFlag">
- <view class="label">是否返佣</view>
- <view class="label-right">
- <text class="text-l">{{ rebateFeeText }}</text>
- <text class="iconfont icon-xiayibu"></text>
- </view>
- </view>
- <view class="order-return-input" v-if="confirmParam.payInfo.rebateFlag === 2">
- <input class="input" v-model="rebateFee" type="number" placeholder="请输入返佣服务费" maxlength="20">
- </view>
- </view>
- <!-- 返佣订单 -->
- <view class="Rebate" @click="handleSecondFlag" v-if="!secondflag">
- <text class="rebate-title">二手返佣订单</text>
- <text class="iconfont" :class="rebatecheck?'icon-yixuanze':'icon-weixuanze'" ></text>
- </view>
- <!-- 发票信息 -->
- <seller-invoice ref="invoice"
- v-if="isRequest"
- :invoiceDatas="invoiceData"
- @handleChoiceaInvoice="handleChoiceaInvoiceData">
- </seller-invoice>
- <!-- 优惠券选择弹窗 -->
- <sellerCoupon ref="coupon"
- v-if="isCouponShow"
- :couponList="couponList"
- @handleChoiceaCoupon="handleChoiceaCouponData">
- </sellerCoupon>
- <!-- 兑换优惠券弹窗 -->
- <sellerExchangeCoupon v-if="isExchangePopup"></sellerExchangeCoupon>
- <!-- 运费 -->
- <seller-freight ref="freight"
- v-if="isFreight"
- :freightDatas="freightData"
- @handleChoiceaFreight="handleChoiceaFreightData"
- @showFreightAlert="handFreightAlertShow">
- </seller-freight>
- <freight-alert v-if="isfreightTip" ref="csPhone"></freight-alert>
- <!-- 余额抵扣 -->
- <view class="invoice-balance" v-if="!rechargeGoods">
- <view class="balabce-t">
- <view class="balabce-t-le">余额抵扣</view>
- <view class="balabce-t-ri">
- <view class="money">
- <text>可用余额:</text>
- <text>¥{{ userMoney | NumFormat }}</text>
- </view>
- <view class="checkbox-box">
- <button class="checkbox iconfont"
- hover-class="btn-hover"
- v-if="userMoney!=0"
- @click.stop="checkedBalabce"
- :class="[ischecked ?'icon-yixuanze':'icon-weixuanze']"
- >
- </button>
- </view>
- </view>
- </view>
- <view class="balabce-b" :class="{'balabce-b--hide':!ischecked}">
- <view class="balabce-b-text animation"
- :style="{'transform':ischecked?'translateY(0)':'translateY(-50%)','-webkit-transform':ischecked?'translateY(0)':'translateY(-50%)'}">
- <text>当前使用:¥{{deductMoney | NumFormat}},剩余:¥{{ surplusMoney | NumFormat }}</text>
- </view>
- </view>
- </view>
- <!-- 选择对机构是否可见 -->
- <sellerClubVisible ref="clubVisible" v-if="isRequest" @handleClubVisible="handleClubVisibleData"></sellerClubVisible>
- <!-- 售后条例 -->
- <seller-regulations ref="regulations"
- v-if="isRequest && seconDepositFlg"
- :regulaDatas="clauseList"
- @handleData="handleClauseData">
- </seller-regulations>
- <regula-alert v-if="isregulaTip" ref="csPhone"></regula-alert>
- <!-- 底部 -->
- <view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
- <view class="footer-le">
- <view class="footer-count">
- <text>共{{ totalCount }}件商品</text>
- </view>
- <view class="footer-price">
- <view class="sum" :class="totalDiscountAmount == 0 ? 'none' : ''">
- 总价:<text class="price">¥{{orderShouldPayFee | NumFormat}}</text>
- </view>
- <view class="sum-none" v-if="totalDiscountAmount > 0">
- <text class="money-reduced">共减<text>¥{{ totalDiscountAmount | NumFormat}}</text></text>
- </view>
- </view>
- </view>
- <view class="footer-submit" @click.stop="orderSubmitMit">
- <view class="btn" :class="isSubLoading ? 'disabled' : ''">提交订单</view>
- </view>
- </view>
- <!-- 优惠券 -->
- <view class="coupon-content-model" v-if="isCouponModel">
- <view class="coupon-alert-content">
- <view class="coupon">
- <view class="coupon-list">
- <view class="list-cell-tags">{{ ExchangeCouponData.couponType | TypeFormat }}</text></view>
- <view class="list-cell-le">
- <view class="coupon-maxMoney">
- <text class="small">¥</text>
- {{ ExchangeCouponData.couponAmount }}
- </view>
- <view class="coupon-minMoney">
- <text class="txt">满{{ ExchangeCouponData.touchPrice }}可用</text>
- </view>
- </view>
- <view class="list-cell-ri">
- <view class="list-cell-top">
- <text v-if="ExchangeCouponData.couponType == 0">
- {{ ExchangeCouponData.productType && ExchangeCouponData.productType == 1 ? '全商城商品通用' : '仅可购买指定商品' }}
- </text>
- <text v-if="ExchangeCouponData.couponType == 1">
- {{ ExchangeCouponData.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}
- </text>
- <text v-if="ExchangeCouponData.couponType == 3">仅限购买店铺【{{ ExchangeCouponData.shopName }}】的商品</text>
- <text v-if="ExchangeCouponData.couponType == 4 || ExchangeCouponData.couponType == 2">全商城商品通用</text>
- </view>
- <view class="list-cell-time">{{ ExchangeCouponData.startDate }} - {{ ExchangeCouponData.endDate }}</view>
- </view>
- </view>
- <view class="coupon-btn" @click.stop="handleClickCancel">立即收下</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>
- </template>
- <script>
- import freightAlert from '@/components/cm-module/modelAlert/freightAlert.vue'
- import choiceAddress from './components/sellerAddress'
- import sellerGoodsList from './components/sellerGoodsList'
- import sellerInvoice from './components/sellerInvoice'
- import sellerFreight from './components/sellerFreight'
- import sellerCoupon from './components/sellerCoupon'
- import sellerExchangeCoupon from './components/sellerExchangeCoupon'
- import sellerClubVisible from './components/sellerClubVisible'
- import sellerRegulations from './components/sellerRegulations.vue'
-
- export default {
- components:{
- choiceAddress,
- sellerGoodsList,
- sellerInvoice,
- sellerFreight,
- sellerCoupon,
- sellerExchangeCoupon,
- sellerClubVisible,
- freightAlert,
- sellerRegulations
- },
- data() {
- return {
- isSubLoading:false,
- modalButton: [
- {
- text: '再想一想',
- type: 'gray',
- plain: true //是否空心
- },
- {
- text: '继续提交',
- customStyle: {
- color: '#fff',
- bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)'
- },
- plain: false
- }
- ],
- contentModalText: '', //操作文字提示语句
- modal: false,
- showModalstauts:1,
- isIphoneX:this.$store.state.isIphoneX,
- cartParam: {// 购物车立即结算确认订单参数
- skuIds:0, // 商品Id(逗号隔开)
- serviceProviderId:0,// 协销Id
- clubId:0 // 机构Id
- },
- productParam: {// 商品立即购买确认订单参数
- productCount:0, // 商品数量
- productId:0, // 商品Id
- serviceProviderId:0,// 协销Id
- clubId:0 // 机构Id
- },
- postageParam: {// 邮费计算参数
- skuIds:0, // 商品Id(逗号隔开)
- userId:0, // 用户Id
- townId:0 // 地区Id
- },
- confirmParam: {// 提交订单参数
- cartType:3, // 购买类型:(1自主下单, 3协销下单)
- orderMiniType:0, // 订单提交状态 0初始提交 1 继续提交
- orderSource:6, // 订单来源 1WWW 6小程序[采美,星范]
- addressId:0, // 收货地址Id
- clubCouponId:0, // 关联优惠券Id
- clubId:0, // 机构Id
- orderInfo:[], // 订单商品数据
- orderInvoice:{type:0}, // 订单发票信息
- orderSeen:1, // 订单对机构可见度 1可见 2不可见
- payInfo:{ // 订单金额数据
- isColdChina:0, //是否勾选冷链费
- orderShouldPayFee: 0, // 订单最终支付金额
- balancePayFlag: 0, // 勾选余额的状态(1使用,0不使用)
- clauseId:0, // 条款Id
- postage: 0, // 运费金额
- postageFlag: 0, // 运费类型
- userBeans: 0, // 抵扣采美豆数量
- rebateFee:0, // 返佣服务费
- rebateFlag:0 // 是否返佣订单
- },
- unionId:uni.getStorageSync('unionId'),// 用户unionId
- },
- rebateFee:'',
- rebateFeeText:'否',
- confirmType:1,
- submitState:'', // 提交状态
- totalCount:0, // 订单提交总数量
- reducedPrice:0, // 满减金额
- couponAmount:0, // 优惠券金额
- totalDiscountAmount:0, // 共减金额
- orderShouldPayFee:0.00, // 订单提交总金额
- allPrice:0.00, // 订单总金额
- surplusMoney:0.00, // 显示勾选后的剩余抵扣
- userMoney:0.00, // 显示可使用余额
- deductMoney:0.00, // 显示已使用的余额
- isRequest:false, // 是否加载完成渲染子组件
- isFreight:false, // 是否加载完成渲染子组件
- isAddress:false, // 是否加载完成地址
- isExchangePopup:false, // 控制兑换优惠券弹窗
- isfreightTip:false, // 控制邮费弹窗
- ischecked:false, // 是否勾选余额
- addressData:{}, // 初始化地址信息
- goodsData:[], // 初始化商品信息
- couponList:[], // 初始化优惠券信息
- invoiceData:{type:0}, // 初始化发票信息
- freightData:{}, // 邮费数据
- handleFreightData:{}, // 监听邮费数据
- orderInfo:[], // 提交的商品信息
- payInfo:{}, // 订单信息
- rechargeGoods:false,
- clauseList:[],
- seconDepositFlg:true,
- rebatecheck:false,
- isCouponShow:false, // 是否显示可选优惠券
- secondflag:true,
- isCouponModel:false, // 兑换优惠券成功提示
- ExchangeCouponData:{}, // 兑换优惠券信息
- }
- },
- onLoad(option){//商品数据
- this.initStorage(option)
- },
- filters:{
- NumFormat(value) {//处理金额
- return Number(value).toFixed(2)
- },
- },
- methods: {
- async initStorage(option){
- const data = JSON.parse(option.data)
- const clubInfo = await this.$api.getComStorage('orderUserInfo')
- const userInfo = await this.$api.getStorage()
- this.productParam.clubId = this.cartParam.clubId = this.confirmParam.clubId = clubInfo.clubId ? clubInfo.clubId : 0
- this.postageParam.userId = clubInfo.userId ? clubInfo.userId : 0
- this.productParam.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
- this.cartParam.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
- this.confirmParam.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
- if(option.type =='prodcut'){
- this.confirmType = 1
- this.productParam.productCount = data.data.productCount
- this.productParam.productId = data.data.productIds
- this.getInitProdcutCrearOrder()
- }else{
- this.confirmType = 2
- this.cartParam.skuIds = data.data.skuIds
- this.getInitCrearOrder()
- }
- },
- getInitCrearOrder(){//协销购物车跳转确认订单初始化信息
- this.SellerService.SellerSettlement(this.cartParam).then(response =>{
- let data = response.data
- this.isRequest = true
- this.goodsData = data.list
- this.userMoney = data.userMoney
- this.couponList = data.couponList
- this.reducedPrice = data.reducedPrice
- this.totalCount = data.totalCount
- this.allPrice = data.totalPrice
- this.rechargeGoods = data.includeRecharge
- this.clauseList = data.clauseList
- this.postageParam.skuIds = this.getProductIds(data.list)
- this.isCouponShow = true
- if(this.couponList.length>0){
- this.couponAmount = data.couponList[0].couponAmount
- this.confirmParam.clubCouponId = data.couponList[0].clubCouponId
- }
- this.orderShouldPayFee = this.allPrice - this.couponAmount
- this.totalDiscountAmount = this.reducedPrice + this.couponAmount
- this.getAddressData()
- }).catch(error =>{
- this.$util.msg(error.msg,2000)
- })
- },
- getInitProdcutCrearOrder(){//二手下单初始化查询
- this.seconDepositFlg = false
- this.SellerService.GetSettlementBySencondProduct(this.productParam).then(response =>{
- const data = response.data
- this.isRequest = true
- this.goodsData = data.list
- this.userMoney = data.userMoney
- this.totalCount = data.totalCount
- this.allPrice = data.totalPrice
- this.orderShouldPayFee = this.allPrice
- this.isCouponShow = false
- this.secondflag = false
- this.getAddressData()
- }).catch(error =>{
- this.$util.msg(error.msg,2000)
- })
- },
- getProductIds(list){// 获取订单商品id列表
- let skuId = []
- list.forEach(function(supplier){
- supplier.cartList.forEach(function(product){
- skuId.push(product.skuId)
- })
- })
- return skuId.join(',')
- },
- getFreightData(){//获取邮费信息
- this.OrderService.GetOrderPostage(this.postageParam).then(response =>{
- let data = response.data
- this.freightData = data
- this.handleFreightData = data
- this.isFreight = true
- if(data.postageFlag== 1){
- this.orderShouldPayFee = this.allPrice + data.postage
- this.attributePallPrice()
- }else{
- this.orderShouldPayFee = this.allPrice
- this.attributePallPrice()
- }
- })
- },
- async getAddressData(){//获取地址信息
- const clubInfo = await this.$api.getComStorage('orderUserInfo')
- this.UserService.QueryAddressList(
- {
- pageNum:1,
- pageSize:1,
- userId:clubInfo.userId,
- }
- ).then(response =>{
- let data = response.data
- this.isAddress = true
- this.addressData = {}
- if(response.data.results != ''){
- this.confirmParam.addressId = data.list[0].addressId
- this.postageParam.townId = data.list[0].townId
- this.addressData = data.list[0]
- this.getFreightData()
- }else{
- this.addressData = this.addressData
- }
- })
- },
- handChangeInputGoodsList(data){//对应供应商的留言信息
- this.goodsData = data
- },
- handleChoiceaInvoiceData(data){//获取发票信息
- this.confirmParam.orderInvoice = data
- },
- handleChoiceaFreightData(data){//获取运费信息
- console.log('编辑运费信息',data)
- if(data.postageFlag == 1){
- this.handleFreightData = data
- this.orderShouldPayFee = this.allPrice + parseInt(data.postage)
- this.attributePallPrice()
- }else{
- this.handleFreightData = data
- this.orderShouldPayFee = this.allPrice
- this.attributePallPrice()
- }
- },
- handleClauseData(clauseId){// 条款Id
- this.confirmParam.payInfo.clauseId = parseInt(clauseId)
- },
- handleChoiceaCouponData(data){// 勾选使用优惠券
- console.log('优惠券信息',data)
- this.couponAmount = data.couponAmount
- this.totalDiscountAmount = this.reducedPrice + this.couponAmount
- this.confirmParam.clubCouponId = data.clubCouponId
- this.attributePallPrice()
- },
- handleClubVisibleData(data){// 订单对机构是否可见
- console.log('对机构是否可见',data)
- this.confirmParam.orderSeen = Number(data)
- },
- checkedBalabce(){//勾选使用余额
- if(this.rebatecheck){
- this.$util.msg('返佣订单不能使用余额抵扣',2000)
- }else{
- if(this.userMoney > 0){
- this.ischecked = !this.ischecked
- if(this.ischecked){
- this.confirmParam.payInfo.balancePayFlag = 1
- this.attributePallPrice()
- }else{
- this.confirmParam.payInfo.balancePayFlag = 0
- if( this.handleFreightData.postageFlag == 1 ){
- this.orderShouldPayFee = this.allPrice + parseInt(this.handleFreightData.postage) - this.couponAmount
- }else{
- this.orderShouldPayFee = this.allPrice - this.couponAmount
- }
- }
- console.log('最终订单支付金额',this.orderShouldPayFee)
- console.log('优惠券金额',this.couponAmount)
- }else{
- return
- }
- }
- },
- attributePallPrice(){//计算价格
- if( this.handleFreightData.postageFlag == 1){
- this.attributeHashfreight(this.handleFreightData.postage)
- }else{
- this.attributeNofreight()
- }
- },
- attributeNofreight(){//计算没有邮费的支付价格
- if(this.ischecked){
- let totalAmount = this.allPrice - this.couponAmount//计算不包邮的价格 总价等于商品价格+邮费
- if(this.userMoney > totalAmount){
- this.orderShouldPayFee = 0.00
- this.deductMoney = this.allPrice - this.couponAmount // 勾选后使用抵余额
- this.surplusMoney = this.userMoney - this.deductMoney // 勾选后的剩余抵扣
- }else{
- this.orderShouldPayFee = this.allPrice - this.userMoney - this.couponAmount //勾选后的总价
- this.deductMoney = this.userMoney // 勾选后使用抵余额
- this.surplusMoney = this.userMoney - this.deductMoney // 勾选后的剩余抵扣
- }
- }else{
- this.orderShouldPayFee = this.allPrice - this.couponAmount
- this.deductMoney = 0.00
- this.surplusMoney = this.userMoney
- }
- console.log('最终订单支付金额',this.orderShouldPayFee)
- console.log('优惠券金额',this.couponAmount)
- },
- attributeHashfreight(postage){//计算需要邮费的支付价格
- let totalAmount = this.allPrice + parseInt(postage) - this.couponAmount//计算不包邮的价格 总价等于商品价格+邮费
- if(this.ischecked){
- if(this.userMoney > totalAmount ){ //余额大于支付金额
- this.orderShouldPayFee = 0.00
- this.deductMoney = this.allPrice + parseInt(postage) - this.couponAmount //勾选后使用抵余额
- this.surplusMoney = this.userMoney - this.deductMoney //勾选后的剩余抵扣
- }else{
- this.orderShouldPayFee = this.allPrice + parseInt(postage) - this.userMoney - this.couponAmount //勾选后的总价
- this.deductMoney = this.userMoney //勾选后使用抵余额
- this.surplusMoney = this.userMoney - this.deductMoney //勾选后的剩余抵扣
- }
- }else{
- this.orderShouldPayFee = this.allPrice + parseInt(postage) - this.couponAmount
- this.deductMoney = 0.00
- this.surplusMoney = this.userMoney
- }
- console.log('最终订单支付金额',this.orderShouldPayFee)
- console.log('优惠券金额',this.couponAmount)
- },
- orderSubmitMit(){//提交订单
- if(this.confirmParam.addressId == ''){
- this.$util.msg('请先添加收货地址~',2000)
- return
- }
- if(this.confirmParam.payInfo.rebateFlag ===2){
- if(this.rebateFee == 0){
- this.$util.msg('请输入返佣服务费',2000)
- return
- }
- this.confirmParam.payInfo.rebateFee = Number(this.rebateFee).toFixed(2)
- }
- this.modal = true
- this.contentModalText = '请仔细确认订单是否为返佣订单后再提交订单'
- },
- SellerCreateOrderSubmit(){
- //提交订单
- if(this.isSubLoading){ return }
- this.confirmParam.orderInfo = this.goodsData.map(el => {
- let productInfo = []
- el.cartList.forEach(pros => {
- productInfo.push({
- skuId:pros.skuId,
- productNum:pros.number,
- presentNum:0,
- productType:pros.giftType
- })
- })
- return {splitCode:el.splitCode,shopId:el.shopId,note:el.note?el.note:'',productInfo:productInfo}
- })
- this.confirmParam.payInfo.postage = parseInt(this.handleFreightData.postage).toFixed(2)
- this.confirmParam.payInfo.postageFlag = parseInt(this.handleFreightData.postageFlag)
- this.confirmParam.payInfo.orderShouldPayFee = this.orderShouldPayFee.toFixed(2)
- this.confirmParam.payInfo = JSON.stringify(this.confirmParam.payInfo)
- this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
- this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
- this.isSubLoading = true
- this.hanldeOrderSubmit(this.confirmParam)
- },
- hanldeOrderSubmit(params){// 提交订单
- this.SellerService.SellerCreateOrderSubmit(params).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.handleError(error)
- })
- },
- handleError(data){// 提交订单异常处理
- this.formatConfirmParam()
- const buttonMap = {
- 1:{
- contentModalText : '订单内存在械字号三类商品,需要拥有医疗执业许可证的医美机构才能购买。建议升级医美机构后再下单,否则会导致订单退款或影响发货。',
- modalButton : [
- { text: '取消', type: 'gray', plain: true },
- { text: '继续提交', customStyle: { color: '#fff', bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)' },plain: false }
- ]
- }
- }
- if(data.code === -6){// 非医美机构下三类商品订单
- this.modal = true
- this.showModalstauts = 2
- this.contentModalText = buttonMap[1].contentModalText
- this.modalButton= buttonMap[1].modalButton
- }else{
- this.$util.msg(error.msg,3000)
- }
- },
- formatConfirmParam(){// 还原提交订单参数格式
- this.confirmParam.payInfo = JSON.parse(this.confirmParam.payInfo)
- this.confirmParam.orderInfo = JSON.parse(this.confirmParam.orderInfo)
- this.confirmParam.orderInvoice = JSON.parse(this.confirmParam.orderInvoice)
- },
- handleRebateFlag(){// 普通订单返佣
- let self = this
- uni.showActionSheet({
- itemList: ['返佣订单', '普通订单,存在返佣服务费','否'],
- success: (e) => {
- switch(e.tapIndex){
- case 0:
- self.confirmParam.payInfo.rebateFlag = 1
- self.rebateFeeText = '返佣订单'
- break
- case 1:
- self.confirmParam.payInfo.rebateFlag = 2
- self.rebateFeeText = '普通订单,存在返佣服务费'
- break
- case 2:
- self.confirmParam.payInfo.rebateFlag = 0
- self.rebateFeeText = '否'
- break
- }
- }
- })
- if(this.confirmParam.payInfo.rebateFlag ===1){
- this.confirmParam.payInfo.balancePayFlag = 0
- this.couponAmount = 0
- this.confirmParam.clubCouponId = 0
- this.confirmParam.orderSeen = 2
- this.$refs.clubVisible.orderVisibleText = '不可见'
- this.$refs.clubVisible.current = 1
- this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage) - this.couponAmount
- this.totalDiscountAmount = this.reducedPrice + this.couponAmount
- this.$refs.coupon.coupon.couponAmount = 0
- this.$refs.freight.infoData(this.freightData)
- this.$refs.freight.freightData = this.freightData
- this.handleFreightData = this.freightData
- }else{
- this.confirmParam.orderSeen = 1
- this.$refs.clubVisible.orderVisibleText = '可见'
- if(this.couponList.length>0){
- this.confirmParam.clubCouponId = this.couponList[0].clubCouponId
- this.$refs.coupon.coupon.couponAmount = this.couponAmount = this.couponList[0].couponAmount
- }
- this.totalDiscountAmount = this.reducedPrice + this.couponAmount
- this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage) - this.couponAmount
- }
- },
- handleClick(e){
- //确认提交
- if (e.index == 1) {
- if(this.showModalstauts == 2){
- this.confirmParam.orderMiniType = 2
- this.SellerCreateOrderSubmit()
- }else{
- this.SellerCreateOrderSubmit()
- }
- }
- this.confirmParam.orderMiniType = 0
- this.modal = false
- },
- handleSecondFlag(){// 二手订单勾选返佣
- this.rebatecheck = !this.rebatecheck
- if(this.rebatecheck){
- this.ischecked = false
- this.confirmParam.payInfo.rebateFlag=1
- this.confirmParam.payInfo.balancePayFlag = 0
- this.confirmParam.clubCouponId = 0
- this.confirmParam.orderSeen = 2
- this.$refs.clubVisible.orderVisibleText = '不可见'
- this.$refs.clubVisible.current = 1
- this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage)
- this.$refs.freight.infoData(this.freightData)
- this.$refs.freight.freightData = this.freightData
- this.handleFreightData = this.freightData
- }else{
- this.confirmParam.orderSeen = 1
- this.$refs.clubVisible.orderVisibleText = '可见'
- this.confirmParam.payInfo.rebateFlag=0
- this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage)
- }
- },
- handFreightAlertShow(){//显示邮费弹窗
- this.isfreightTip = true
- },
- handleClickCancel(){// 关闭优惠券弹窗
- this.isCouponModel = false
- this.getInitCrearOrder()
- },
- hideFreight(){//关闭邮费弹窗
- this.isfreightTip = false
- },
- hideMobel() {
- this.modal = false
- },
- },
- onShow() {
- let pages = getCurrentPages()
- let currPage = pages[pages.length-1]
- if(currPage.data.select =='select'){
- this.isAddress = true
- let SelectData = uni.getStorageSync('selectAddress')
- this.confirmParam.addressId = SelectData.addressId
- this.postageParam.townId = SelectData.townId
- this.addressData = SelectData
- this.getFreightData()
- }else{
- this.getAddressData()
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- height: auto;
- background:#F7F7F7;
- }
- .btn-hover{
- background: #FFFFFF;
- }
- .animation{
- /* transition: transform 0.3s ease;*/
- transition-property: transform;
- transition-duration: 0.3s;
- transition-timing-function: ease;
- }
- .invoice-freight{
- width: 702rpx;
- padding: 0 24rpx;
- height: 86rpx;
- line-height: 86rpx;
- font-size: $font-size-28;
- color: $text-color;
- background: #FFFFFF;
- float: left;
- font-weight: bold;
- .freight-left{
- float: left;
- .icon-yunfeishuoming{
- height: 100%;
- padding: 0 15rpx;
- color: $color-system;
- font-weight: normal;
- }
- }
- .freight-right{
- float: right;
- color: #2A81FF;
- }
- }
- .invoice-balance{
- width: 702rpx;
- height: auto;
- padding:0 24rpx;
- background: #FFFFFF;
- float: left;
- margin-top: 24rpx;
- margin-bottom: 24rpx;
- .balabce-t{
- width: 100%;
- height: 86rpx;
- line-height: 86rpx;
- font-size: $font-size-28;
- color: $text-color;
- float: left;
- .balabce-t-le{
- float: left;
- font-weight: bold;
- }
- .balabce-t-ri{
- float: right;
- display: flex;
- align-items: center;
- .money{
- display: flex;
- float: left;
- }
- .checkbox-box{
- display: flex;
- width: 60rpx;
- float: left;
- height: 100%;
- font-size: $font-size-24;
- .checkbox{
- width: 40rpx;
- text-align: right;
- box-sizing: border-box;
- text-align: center;
- text-decoration: none;
- border-radius: 0;
- -webkit-tap-highlight-color: transparent;
- overflow: hidden;
- color: $color-system;
- padding: 5rpx;
- }
- }
- }
- }
- .balabce-b{
- width: 100%;
- float: left;
- overflow: hidden;
- .balabce-b-text{
- width: 100%;
- line-height: 58rpx;
- font-size: $font-size-24;
- color: #FF2A2A;
- text-align: right;
- float: right;
- }
- &.balabce-b--hide {
- padding: 0 0;
- height: 0px;
- line-height: 0px;
- }
- }
- }
- .footer{
- position: fixed;
- left: 0;
- bottom: 0;
- display: flex;
- align-items: center;
- width: 100%;
- height: 110rpx;
- line-height: 110rpx;
- justify-content: space-between;
- font-size: $font-size-28;
- background-color: #FFFFFF;
- z-index: 990;
- color: $text-color;
- .footer-le{
- width:570rpx;
- height:100%;
- float: left;
- }
- .footer-count{
- float: left;
- padding-left: 24rpx;
- width:190rpx;
- box-sizing: border-box;
- font-size: $font-size-26;
- }
- .footer-price{
- width:370rpx;
- float: right;
- text-align: right;
- color: $text-color;
- padding: 10rpx 20rpx 10rpx 0;
- box-sizing: border-box;
- .sum-none{
- width: 100%;
- height: 45rpx;
- line-height: 45rpx;
- color: $text-color;
- float: left;
- text-align: right;
- .money{
- font-size: $font-size-26;
- color: #999999;
- text-decoration: line-through;
- }
- .money-sign{
- font-size: $font-size-26;
- color: #999999;
- text-decoration: line-through;
- }
- .money-reduced{
- margin-left: 10rpx;
- font-size: $font-size-26;
- color:$color-system;
- }
- }
- .sum{
- width: 100%;
- height: 45rpx;
- line-height: 45rpx;
- float: left;
- &.none{
- height: 90rpx;
- line-height: 90rpx;
- }
- .price{
- font-size: $font-size-32;
- color: #FF2A2A;
- }
- }
-
- }
- .footer-submit{
- display:flex;
- align-items:center;
- justify-content: center;
- width: 180rpx;
- height: 100%;
- box-sizing: border-box;
- padding: 15rpx 5rpx;
- .btn{
- width: 100%;
- height: 100%;
- color: #FFFFFF;
- background:linear-gradient(90deg, #FF9300 0%, #FF5B00 100%);
- font-size: $font-size-26;
- text-align: center;
- line-height: 80rpx;
- border-radius: 40rpx;
- &.disabled{
- background: #e4e8eb;
- color: #999999;
- }
- }
- }
- }
- .order-return{
- width: 100%;
- height: auto;
- box-sizing: border-box;
- padding: 0 24rpx;
- background: #FFFFFF;
- float: left;
- margin: 24rpx 0;
- .order-return-main{
- width:100%;
- height: 86rpx;
- line-height: 86rpx;
- .label{
- float: left;
- font-weight: bold;
- color: #333333;
- font-size: $font-size-28;
- }
- .label-right{
- float: right;
- color: #2A81FF;
- .text-l{
- font-size: 28rpx;
- font-weight: bold;
- margin-right: 20rpx;
- }
- .icon-xiayibu{
- line-height: 88rpx;
- color: #999999;
- font-weight: normal;
- }
- }
-
- }
- .order-return-input{
- width: 100%;
- height: 86rpx;
- padding-bottom: 20rpx;
- box-sizing: border-box;
- .input{
- width: 100%;
- height: 66rpx;
- font-size: $font-size-26;
- border: 1px solid #e1e1e1;
- line-height: 66rpx;
- color: #333333;
- border-radius: 4rpx;
- box-sizing: border-box;
- padding: 0 20rpx;
- }
- }
- }
- .Rebate{
- width: 702rpx;
- height: auto;
- padding: 0 24rpx;
- background: #FFFFFF;
- float: left;
- margin-bottom: 24rpx;
- margin-top: 24rpx;
- line-height: 86rpx;
- .rebate-title{
- float: left;
- font-weight: bold;
- color: #333333;
- font-size: $font-size-28;
- }
- .iconfont{
- float: right;
- color: #b2b2b2;
- font-size: 40rpx;
- &.icon-yixuanze{
- color: $color-system;
- }
- }
- }
- .coupon-content-model{
- width: 100%;
- height: 100%;
- background: rgba(0,0,0,.5);
- position: fixed;
- top: 0;
- left: 0;
- z-index: 8888;
- transition: all 0.4s;
- .coupon-alert-content{
- width: 600rpx;
- height: 612rpx;
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
- margin: auto;
- box-sizing: border-box;
- padding-top: 92rpx;
- .coupon{
- width: 600rpx;
- height: 522rpx;
- background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbg@2x.png);
- background-size: cover;
- box-sizing: border-box;
- padding: 230rpx 40rpx 0 40rpx;
- .coupon-list{
- width: 100%;
- height: 147rpx;
- margin-bottom: 32rpx;
- box-sizing: border-box;
- background: url(https://static.caimei365.com/app/img/icon/icon-coupon-bg@2x.png);
- background-size: cover;
- position: relative;
- .list-cell-tags{
- display: inline-block;
- padding: 0 10rpx;
- height: 32rpx;
- line-height: 32rpx;
- background-color: #f94b4b;
- color: #FFFFFF;
- font-size: 18rpx;
- border-radius: 16rpx 0 16rpx 0;
- text-align: center;
- position: absolute;
- top: 0;
- left: 0;
- }
- .list-cell-le{
- width: 154rpx;
- height: 100%;
- box-sizing: border-box;
- padding: 30rpx 0;
- float: left;
- .coupon-maxMoney{
- width: 100%;
- height: 54rpx;
- line-height: 54rpx;
- font-size: 42rpx;
- color: #f94b4b;
- text-align: center;
- margin-top: 10rpx;
- .small{
- font-size: $font-size-20;
- }
- }
- .coupon-minMoney{
- width: 100%;
- height: 28rpx;
- float: left;
- box-sizing: border-box;
- padding-left: 24rpx;
- .txt{
- display: block;
- height: 28rpx;
- line-height: 28rpx;
- font-size: 16rpx;
- color: #f94b4b;
- text-align: center;
- padding: 0 5rpx;
- background-color: #fff1eb;
- border-radius: 4rpx;
- float: left;
- }
- }
- }
- .list-cell-ri{
- width: 366rpx;
- height: 100%;
- box-sizing: border-box;
- padding:30rpx 20rpx;
- float: left;
- .list-cell-top{
- width: 100%;
- height: 64rpx;
- line-height: 64rpx;
- font-size: $font-size-26;
- color: #333333;
- float: left;
- text-overflow:ellipsis;
- display: -webkit-box;
- word-break: break-all;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 1;
- overflow: hidden;
- }
- .list-cell-time{
- width: 100%;
- height: 28rpx;
- line-height: 28rpx;
- text-align: left;
- font-size: $font-size-20;
- color: #999999;
- }
- }
- }
- .coupon-btn{
- width: 100%;
- height: 78rpx;
- background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbtnbg@2x.png);
- background-size: cover;
- line-height: 78rpx;
- text-align: center;
- color: #FFFFFF;
- font-size: $font-size-36;
- }
- }
- }
- }
- </style>
|