| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891 |
- <template>
- <view class="page" >
- <view class="state ">
- <view class="flex-row justify-center">
- <u-icon name="cut" color="#93D21A" size="18"></u-icon>
- <text>{{order.orderStatusDesc}}</text>
- </view>
- <view class="box_4 flex-row justify-center">
- <text>{{order.orderDesc}}</text>
- </view>
- </view>
- <view class="detail">
- <view :class="order.serviceAttribute == 1? 'serviceAttrDesc':'serviceAttrDesc1'">
- <text>{{order.serviceAttrDesc}}</text>
- </view>
- <view class="flex-row justify-start">
- <u-icon name="/static/index/u217.png" color="#93D21A" size="18"></u-icon>
- <text class="key">订单编号:</text>
- <text class="value">{{order.orderNo}}</text>
- </view>
- <!-- <view>-->
- <!-- <text class="serviceType">{{order.serviceType}}</text>-->
- <!-- </view>-->
- <view class="flex-row justify-between jishi">
- <view class="flex-col ">
- <view class=" flex-row">
- <u-icon name="/static/order/ud1.png" color="#93D21A" size="18"></u-icon>
- <text class="key">服务对象:</text>
- <text class="value">{{order.serviceObjectName || ''}}</text>
- </view>
- <view class="flex-row">
- <u-icon name="/static/order/ud2.png" color="#93D21A" size="18"></u-icon>
- <text class="key">服务门店:</text>
- <text class="value">{{order.storeName}}</text>
- </view>
- <view class="flex-row">
- <u-icon name="clock" size="16"></u-icon>
- <text class="key">下单时间:</text>
- <text class="value">{{order.createTime}}</text>
- </view>
- </view>
- </view>
- <view class="flex-row justify-between yuyue " v-if="order.serviceAttribute == 2">
- <view class="flex-col justify-center ">
- <view class=" flex-row">
- <u-icon name="clock" size="16"></u-icon>
- <text class="key">服务日期:</text>
- <text class="value">{{order.serviceDate}}</text>
- </view>
- <view class="flex-row">
- <u-icon name="/static/order/ud2.png" color="#93D21A" size="18"></u-icon>
- <text class="key">服务时段:</text>
- <text class="value">{{order.serviceStartTime}}</text>
- </view>
- <view class="flex-row">
- <u-icon name="/static/order/ud3.png" color="#93D21A" size="18"></u-icon>
- <text class="key">服务人员:</text>
- <text class="value">{{order.servicePersonName}}</text>
- </view>
- </view>
- </view>
- <view class="flex-row justify-center" v-if="order.canScanCode">
- <view class="scan flex-row justify-center" @click="scanCodeOrder(order)">
- <u-icon name="scan" size="18"></u-icon>
- <text>扫码</text>
- </view>
- </view>
- <view class="line"></view>
- <view class="flex-row justify-between borderBottom" v-for="(item,index) in order.child" :key="index">
- <!-- <view class="flex-col justify-center" v-if="order.orderStatus != 3">-->
- <!-- <u-icon v-if="item.tick" name="checkmark-circle-fill" color="#38db38" size="20" @click="tick(item,index)"></u-icon>-->
- <!-- <u-icon v-else name="/static/order/ud9.png" color="green" size="20" @click="tick(item,index)"></u-icon>-->
- <!-- </view>-->
- <view class="flex-col right">
- <view class="flex-row justify-between">
- <text class="serviceType">{{item.serviceName}}</text>
- <view class="flex-row justify-start">
- <text class="projectState">{{item.statusDesc}}</text>
- <view class="flex-row justify-center" style="margin-left: 20rpx" v-if="item.status === 8 || item.status === 1" @click="appeal(item.orderServiceId)">
- <u-icon name="/static/order/ud17.png" color="#93D21A" size="14"></u-icon>
- <text class="ss_key">申诉</text>
- </view>
- </view>
- </view>
- <view class="flex-row justify-between">
- <view class="flex-col justify-around">
- <view class="flex-row">
- <u-icon name="server-man" size="16"></u-icon>
- <text class="key">服务人员:</text>
- <text class="value">{{item.servicePerson || ''}}</text>
- </view>
- <view class="flex-row">
- <u-icon name="clock" size="16"></u-icon>
- <text class="key">服务时间:</text>
- <text class="value">{{item.serviceTime || ''}}</text>
- </view>
- <view class="flex-row" v-if="item.discountAmount > 0">
- <u-icon name="red-packet" size="16"></u-icon>
- <text class="key">服务金额:</text>
- <text class="projectMoney">¥{{item.payAmount}}</text>
- <text class="lineMoney">¥{{item.servicePrice}}</text>
- </view>
- <view class="flex-row" v-else>
- <u-icon name="red-packet" size="16"></u-icon>
- <text class="key">服务金额:</text>
- <text class="projectMoney">¥{{item.servicePrice}}</text>
- </view>
- </view>
- <view class="flex-col justify-around">
- <view class="flex-col justify-center " v-if="item.planNumber">
- <view class="planNumber flex-row justify-center">
- <text>{{item.planNumber}}</text>
- </view>
- <view class="plan flex-row justify-center">
- <text class="plan">排号</text>
- </view>
- <!-- <view class="plan flex-row justify-center" v-if="order.serviceAttribute == 2">-->
- <!-- <text class="plan">预约号</text>-->
- <!-- </view>-->
- </view>
- </view>
- </view>
- <view class="flex-row justify-start key">
- <view class="flex-row">
- <u-icon size="16" name="coupon"></u-icon>
- <text>优惠选择:</text>
- </view>
- <view class="flex-row justify-start value" style="height: 100%" @click="openCoupon(item,index)">
- <text v-if="item.suggestType == 0">选择优惠券或权益卡</text>
- <text v-if="item.suggestType == 1">{{ item.suggestCoupon.name }} </text>
- <text v-if="item.suggestType == 2">{{ item.suggestEquityCard.equityCardName }} </text>
- <view class="flex-col justify-center">
- <u-icon v-if="order.orderStatus != 1 || order.orderStatus != 3" size="12" name="arrow-right"></u-icon>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="bottomHeight"></view>
- <view class="bottom1 flex-col" v-if="order.canPay ">
- <text class="allMoney"></text>
- <view class="bottomBtn flex-row justify-between">
- <view class=" flex-row">
- <text class="unpaid">合计</text>
- <text class="preferentialPrice">¥{{order.payAmount}}</text>
- <!-- <text class="unpaid">已优惠</text>-->
- <!-- <text class="originalPrice">¥{{totalDiscount}}</text>-->
- <!-- <text class="priceDetail">价格明细</text>-->
- </view>
- <view class="btn" @click="qenPayInfo">
- <text class="text_33">提交</text>
- </view>
- <!-- <view v-else class="btn" @click="orderFinish">-->
- <!-- <text class="text_33">结束订单</text>-->
- <!-- </view>-->
- </view>
- </view>
- <uni-popup ref="appealPopup" :animation="false" :catchtouchmove="true">
- <view class="appealView flex-col justify-around">
- <view class="popupTitle">
- <text>请输入申诉理由</text>
- </view>
- <view class="lex-row justify-center">
- <textarea class="textarea" v-model="appealReason" placeholder="请输入申诉理由"></textarea>
- </view>
- <view class="flex-row justify-around">
- <view class="leftBtn" @click="appealPopupClose">
- <text>取消</text>
- </view>
- <view class="rightBtn" @click="commitAppeal">
- <text>确定</text>
- </view>
- </view>
- </view>
- </uni-popup>
- <uni-popup ref="popup" :catchtouchmove="true" :animation="false" type="bottom">
- <view class="payView">
- <view class="flex-row justify-between">
- <text class="payType">请选择支付方式</text>
- <image class="x" src="/static/common/ox.png" @click="closePayPopup"></image>
- </view>
- <!-- <view class="payTitle">-->
- <!-- <text>选择微信支付或余额支付</text>-->
- <!-- </view>-->
- <view v-if="loveCardList.length>0" class="payItem flex-row" >
- <u-icon name="/static/me/familyCard_icon.png" color="#38db38" size="36"></u-icon>
- <view class="payName flex-col justify-center flex-grow">
- <text>亲情卡支付</text>
- <scroll-view scroll-y class="loveCard" :show-scrollbar="true">
- <view class="flex-row justify-between loveCardItem " v-for="(item,index) in loveCardList" :key="index" @click="payLoveItem(0,index,item)">
- <view class="select flex-col" >
- <text>{{item.presentUserName}}({{item.relation}})</text>
- <!-- <text class="balance">本月剩余额度:{{item.totalBalance}}</text>-->
- </view>
- <view class="flex-col justify-center">
- <u-icon v-if="curServiceTab === 0 && item.select" name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
- <u-icon v-else name="/static/order/ud9.png" color="green" size="25"></u-icon>
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
- <view class="payItem flex-row justify-between" @click="payItem(1)">
- <view class="flex-row">
- <u-icon name="/static/me/u701.png" color="#38db38" size="36"></u-icon>
- <view class="payName flex-col justify-center">
- <text>余额支付</text>
- <text class="balance">可用余额{{userInfo.balance || 0}}</text>
- </view>
- </view>
- <view class="flex-col justify-center">
- <view v-if="curServiceTab === 1" >
- <u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
- </view>
- <view v-else>
- <u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
- </view>
- </view>
- </view>
- <view class="payItem flex-row justify-between" @click="payItem(2)">
- <view class="flex-row">
- <u-icon name="weixin-circle-fill" color="#38db38" size="36"></u-icon>
- <view class="payName flex-col justify-center">
- <text>微信支付</text>
- </view>
- </view>
- <view class="flex-col justify-center">
- <view v-if="curServiceTab === 2" >
- <u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
- </view>
- <view v-else>
- <u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
- </view>
- </view>
- </view>
- <view class="commitBtn" @click="commonGeneralOrder">
- <text>确定</text>
- </view>
- </view>
- </uni-popup>
- <uni-popup ref="passwordPopup">
- <view class="passwordView flex-col">
- <view class="flex-row justify-center">
- <text>请输入交易密码</text>
- </view>
- <view class="h-tab-bar flex-row justify-center">
- <u-code-input v-model="password" mode="box" dot></u-code-input>
- </view>
- <view class="flex-row justify-center">
- <view class="h-operate-btn flex-row justify-center" @click="balancePay">
- <text>确定</text>
- </view>
- </view>
- </view>
- </uni-popup>
- <uni-popup ref="couponPopup" :catchtouchmove="true" :animation="false" type="bottom">
- <view class="couponView flex-col">
- <view class="flex-row justify-center">
- <text>优惠选择</text>
- </view>
- <view class="flex-row justify-center">
- <view class="couponTabs flex-col justify-center" :class="[couponTabs == 0 ? '' : 'couponTabs1']" @click="changeCouponTabs(0)" >
- <text>我的</text>
- </view>
- <view class="couponTabs flex-col justify-center" :class="[couponTabs == 1 ? '' : 'couponTabs1']" @click="changeCouponTabs(1)">
- <text>亲情卡优惠券</text>
- </view>
- </view>
- <scroll-view v-if="couponTabs == 0" scroll-y style="height: 700rpx">
- <view class="flex-row justify-between coupon1">
- <view class="flex-row justify-start">
- <view class="flex-col justify-center icon1">
- <text>0</text>
- </view>
- <view class="flex-col justify-center couponMsg">
- <view class="flex-col justify-center couponName">
- <text>不选择优惠</text>
- </view>
- </view>
- </view>
- <view class="flex-col justify-center " style="margin-right: 30rpx">
- <text class="couponBtn" @click="use(item,0)">选择</text>
- </view>
- </view>
- <view class="flex-row justify-center" style="margin-top: 30rpx" v-if="availableCouponList.length > 0">
- <view class="flex-col justify-center flex1">
- <view class="couponLine"></view>
- </view>
- <text class="couponType">优惠券</text>
- <view class="flex-col justify-center flex1">
- <view class="couponLine"></view>
- </view>
- </view>
- <view class="flex-row justify-start" :class="[item.canUse? 'coupon2' : 'coupon3']" v-for="(item,index) in availableCouponList" :key="index">
- <view class="flex-row justify-start">
- <view class="flex-col justify-center " :class="[item.canUse? 'icon2' : 'icon3']">
- <text v-if="item.discountsType == 1">减{{item.discountsPrice}}</text>
- <text v-if="item.discountsType == 2">{{item.discount}}折</text>
- <text class="reachPrice">满{{item.reachPrice}}可用</text>
- </view>
- <view class="flex-col justify-center couponMsg">
- <view class="flex-col justify-center couponName">
- <text>{{item.name}}</text>
- </view>
- <view class="flex-col justify-center couponValue">
- <text>使用项目:{{item.useServiceDesc}}</text>
- </view>
- <view class="flex-col justify-center couponValue">
- <text>可用门店:{{item.useStoreDesc}}</text>
- </view>
- <view class="flex-col justify-center couponValue" v-if="!item.canUse">
- <text>不可用原因:{{item.unavailabilityReason}}</text>
- </view>
- </view>
- </view>
- <view class="flex-col justify-center" v-if="item.canUse">
- <text class="couponBtn" @click="use(item,1)">立即使用</text>
- </view>
- <view class="flex-col justify-center" v-else>
- <text class="couponBtn1">不可用</text>
- </view>
- </view>
- <view class="flex-row justify-center" style="margin-top: 30rpx" v-if="availableEquityCardList.length > 0">
- <view class="flex-col justify-center flex1">
- <view class="couponLine"></view>
- </view>
- <text class="couponType">权益卡</text>
- <view class="flex-col justify-center flex1">
- <view class="couponLine"></view>
- </view>
- </view>
- <view class="flex-row justify-start " :class="[item.canUse? 'coupon2' : 'coupon3']" v-for="(item,index) in availableEquityCardList" :key="index">
- <view class="flex-row justify-start">
- <view class="flex-col justify-center" :class="[item.canUse? 'icon2' : 'icon3']">
- <text>{{item.faceValue}}</text>
- </view>
- <view class="flex-col justify-center couponMsg">
- <view class="flex-col justify-center couponName">
- <text>{{item.equityCardName}}</text>
- </view>
- <view class="flex-col justify-center couponValue">
- <text>适用项目:{{item.serviceProjectName || ''}}</text>
- </view>
- <view class="flex-col justify-center couponValue">
- <text>适用门店:{{ item.useStoreDesc || '' }}</text>
- </view>
- <view class="flex-col justify-center couponValue">
- <text>绑定对象:{{item.serviceObjectName}}</text>
- </view>
- <view class="flex-col justify-center couponValue">
- <text>结束期限:{{item.effectiveEndTime.substring(0,10)}}</text>
- </view>
- <view class="flex-col justify-center couponValue" v-if="!item.canUse">
- <text>不可用原因:{{item.unavailabilityReason}}</text>
- </view>
- </view>
- </view>
- <view class="flex-col justify-center" v-if="item.canUse">
- <text class="couponBtn" @click="use(item,2)">立即使用</text>
- </view>
- <view class="flex-col justify-center" v-else>
- <text class="couponBtn1">不可用</text>
- </view>
- </view>
- </scroll-view>
- <scroll-view v-if="couponTabs == 1" scroll-y style="height: 700rpx">
- <view class="flex-row justify-between coupon1">
- <view class="flex-row justify-start">
- <view class="flex-col justify-center icon1">
- <text>0</text>
- </view>
- <view class="flex-col justify-center couponMsg">
- <view class="flex-col justify-center couponName">
- <text>不选择优惠</text>
- </view>
- </view>
- </view>
- <view class="flex-col justify-center " style="margin-right: 30rpx">
- <text class="couponBtn" @click="use(item,0)">选择</text>
- </view>
- </view>
- <view class="flex-row justify-start" :class="[item.canUse? 'coupon4' : 'coupon3']" v-for="(item,index) in couponByLoveCardList" :key="index">
- <view class="flex-row justify-start">
- <view class="flex-col justify-center " :class="[item.canUse? 'icon4' : 'icon3']">
- <text v-if="item.discountsType == 1">减{{item.discountsPrice}}</text>
- <text v-if="item.discountsType == 2">{{item.discount}}折</text>
- <text class="reachPrice">满{{item.reachPrice}}可用</text>
- </view>
- <view class="flex-col justify-center couponMsg">
- <view class="flex-col justify-center couponName">
- <text>{{item.name}}</text>
- </view>
- <view class="flex-col justify-center couponValue">
- <text>使用项目:{{item.useServiceDesc}}</text>
- </view>
- <view class="flex-col justify-center couponValue">
- <text>可用门店:{{item.useStoreDesc}}</text>
- </view>
- <view class="flex-col justify-center couponValue" v-if="!item.canUse">
- <text>不可用原因:{{item.unavailabilityReason}}</text>
- </view>
- </view>
- </view>
- <view class="flex-col justify-center" v-if="item.canUse">
- <text class="couponBtn" @click="use(item,1)">立即使用</text>
- </view>
- <view class="flex-col justify-center" v-else>
- <text class="couponBtn1">不可用</text>
- </view>
- </view>
- </scroll-view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import UniPopup from "../../uni_modules/uni-popup/components/uni-popup/uni-popup";
- export default {
- components: {
- UniPopup
- },
- data() {
- return {
- title: 'Hello',
- tabIndex: 3,
- order:{},
- allPrice:0,
- totalDiscount:0,
- appealId:'',
- appealReason:'',
- orderId:'',
- curServiceTab:2,
- userInfo:{},
- tradeNo:'',
- password:'',
- requestStatus : false,
- loveCardId:'',
- loveCardList:[],
- availableCouponList:[],
- availableEquityCardList:[],
- couponByLoveCardList:[],
- availableChild:null,
- availableIndex:null,
- couponTabs:0
- }
- },
- onLoad(e) {
- this.orderId = e.id
- this.getUserInfo();
- },
- onShow(){
- this.getOrderDetailByOrderId(this.orderId )
- this.getMyReceiveList()
- },
- methods: {
- changeCouponTabs(couponTabs){
- this.couponTabs = couponTabs
- },
- use(item,suggestType){
- console.log(item)
- console.log(suggestType)
- if (suggestType == 1){
- //使用优惠券
- this.availableChild.suggestEquityCard = null
- this.availableChild.suggestType = 1
- this.availableChild.suggestCoupon = item
- if (item.discountsType == 1){
- //满减优惠券
- this.availableChild.discountAmount = item.discountsPrice
- this.availableChild.payAmount = (this.availableChild.servicePrice - item.discountsPrice).toFixed(2)
- }else {
- //折扣券
- this.availableChild.discountAmount = (this.availableChild.servicePrice * (item.discounts / 10).toFixed(2)).toFixed(2)
- this.availableChild.payAmount = (this.availableChild.servicePrice - this.availableChild.discountAmount).toFixed(2)
- }
- }else if (suggestType == 2){
- //使用权益卡
- this.availableChild.suggestCoupon = null
- this.availableChild.suggestType = 2
- this.availableChild.suggestEquityCard = item
- this.availableChild.discountAmount = (this.availableChild.servicePrice - item.faceValue).toFixed(2)
- this.availableChild.payAmount = item.faceValue
- }else {
- //不使用优惠
- this.availableChild.suggestType = 0
- this.availableChild.suggestCoupon = null
- this.availableChild.suggestEquityCard = null
- this.availableChild.discountAmount = 0
- this.availableChild.payAmount = ( this.availableChild.servicePrice - 0 ).toFixed(2)
- }
- this.$set(this.order.child,this.availableIndex,this.availableChild)
- let payAmount = 0 //计算订单总支付金额
- let discountAmount = 0 //计算订单总优惠金额
- for (const child of this.order.child) {
- if (child.status == 1 || child.status == 8){
- payAmount += child.payAmount ? child.payAmount - 0 : child.servicePrice -0
- discountAmount += child.discountAmount - 0
- }
- }
- this.order.payAmount = payAmount.toFixed(2)
- this.order.discountAmount = discountAmount.toFixed(2)
- this.availableChild = null
- this.availableIndex = null
- this.availableCouponList = []
- this.availableEquityCardList = []
- this.$refs.couponPopup.close()
- },
- openCoupon(item,index){
- if (this.order.orderStatus == 1 || this.order.orderStatus == 3){
- return
- }
- console.log(item)
- this.availableIndex = index
- this.availableChild = item
- this.availableCoupons(item)
- this.availableEquityCards(item)
- this.getCouponByLoveCard(item)
- this.$refs.couponPopup.open()
- },
- getCouponByLoveCard(item){
- this.$api.getCouponByLoveCard({
- orderServiceId:item.orderServiceId
- }).then(res=>{
- this.couponByLoveCardList = res.data.data
- })
- },
- availableEquityCards(item){
- this.$api.availableEquityCards({
- orderServiceId:item.orderServiceId
- }).then(res=>{
- this.availableEquityCardList = res.data.data
- })
- },
- availableCoupons(item){
- this.$api.availableCoupons({
- orderServiceId:item.orderServiceId
- }).then(res=>{
- this.availableCouponList = res.data.data
- })
- },
- getMyReceiveList(){
- this.$api.getMyReceiveList().then(res=>{
- this.loveCardList = res.data.data
- })
- },
- getUserInfo() {
- this.$api.getUserInfo().then(res => {
- this.userInfo = res.data.data
- uni.setStorageSync('userInfo', res.data.data);
- });
- },
- familyCardPay(){
- let that = this;
- this.$api.familyCardTradePay({
- tradeNo:this.tradeNo,
- loveCardId:this.loveCardId,
- storeId:this.order.storeId
- }).then(res=>{
- this.requestStatus=false
- uni.hideLoading();
- uni.showToast({
- title: '支付成功!'
- });
- that.getOrderDetailByOrderId(that.orderId)
- }).catch((err) =>{
- this.requestStatus=false
- uni.showToast({
- title: err.msg,
- icon:'error',
- duration:3000
- })
- });
- },
- balancePay(){
- let that = this;
- // if(this.password.length< 6 ){
- // uni.showToast({
- // title: "交易密码不能小于6位"
- // })
- // return ;
- // }
- // this.$refs.passwordPopup.close()
- this.$api.trade({
- tradeNo: this.tradeNo,
- password: ''
- }).then((res)=>{
- this.requestStatus=false
- uni.hideLoading();
- uni.showToast({
- title: '支付成功!'
- });
- that.getOrderDetailByOrderId(that.orderId)
- }).catch((err)=>{
- this.requestStatus=false
- uni.hideLoading();
- uni.showToast({
- title: err.msg,
- icon:'error'
- })
- })
- },
- scanCodeOrder(order){
- uni.scanCode({
- scanType: ['qrCode'],
- success: function (res) {
- let json = JSON.parse(res.result)
- if(json.storeId != order.storeId){
- uni.showToast({
- icon: 'error',
- duration: 3000,
- title: '请扫描订单门店二维码'
- });
- return
- }
- uni.navigateTo({
- url:'/orderPages/serviceItems/index?serviceStationId='+ json.stationId + '&orderId='+order.orderId + '&serviceObjectId=' + order.serviceObjectId
- })
- }
- })
- },
- commonGeneralOrder(){
- if(this.requestStatus){
- return;
- }
- this.requestStatus=true
- uni.showLoading({
- title: '支付中'
- });
- this.$refs.popup.close()
- let that =this
- if (this.curServiceTab===0){
- this.familyCardPay()
- }
- if (this.curServiceTab===1){
- // that.password = '';
- // this.$refs.popup.close()
- // this.$refs.passwordPopup.open()
- this.balancePay()
- }
- if (this.curServiceTab===2){
- this.$api.wechatPayTradeNo({tradeNo:this.tradeNo}).then(res=>{
- var param = res.data.data;
- uni.requestPayment({
- appId: param.appid,
- timeStamp: param.timestamp+"",
- nonceStr: param.noncestr,
- package: "prepay_id="+param.prepayid,
- signType: "RSA",
- paySign: param.sign,
- success: res => {
- this.requestStatus=false
- uni.hideLoading();
- uni.showToast({
- title: '支付成功!'
- });
- that.getOrderDetailByOrderId(that.orderId)
- },
- fail: res => {
- this.requestStatus=false
- uni.hideLoading();
- uni.showModal({
- content: '支付失败',
- showCancel: false
- });
- }
- });
- })
- }
- },
- orderFinish(){
- this.$api.orderFinish(this.order.orderNo).then((res)=>{
- uni.$u.toast('操作成功')
- this.getOrderDetailByOrderId(this.order.orderId)
- })
- },
- qenPayInfo(){
- let childArr = []
- for (const child of this.order.child) {
- console.log('+++++++++++++++++++++',child)
- let c = {
- orderServiceId:child.orderServiceId,
- couponId: child.suggestCoupon ? child.suggestCoupon.id : null,
- equityCardId: child.suggestEquityCard ? child.suggestEquityCard.id : null,
- }
- childArr.push(c)
- }
- this.$api.oneClickPayV2({
- orderId:this.order.orderId,
- serviceChildren:childArr
- }).then(res=>{
- this.tradeNo = res.data.data.tradeNo
- this.$refs.popup.open()
- })
- },
- commitAppeal(){
- this.$api.appeal({
- childOrderId:this.appealId,
- appealReason:this.appealReason
- }).then(res=>{
- this.appealReason=''
- uni.$u.toast('申诉已提交')
- this.$refs.appealPopup.close()
- this.getOrderDetailByOrderId(this.orderId)
- })
- },
- appealPopupClose(){
- this.appealReason=''
- this.$refs.appealPopup.close()
- },
- appeal(id){
- this.appealId = id
- this.$refs.appealPopup.open()
- },
- // 原来的计算价格逻辑 选择的时候计算
- // tick(item,index){
- //
- // if (item.status === 1 || item.status === 4){
- // this.allPrice = 0
- // this.totalDiscount = 0;
- // item.tick = !item.tick
- // this.$set(this.order.child,index,item)
- // this.order.child.forEach(i=>{
- // if (i.tick){
- // this.totalDiscount += i.discountAmount * 1;
- // this.allPrice += i.payAmount *1;
- // }
- // })
- // this.allPrice = this.allPrice.toFixed(2)
- // this.totalDiscount = this.totalDiscount.toFixed(2)
- // }
- // },
- //新的价格计算逻辑 订单加载或刷新的时候计算
- calculatePrice(){
- this.allPrice = 0
- this.totalDiscount = 0;
- this.order.child.forEach(i=>{
- if (i.status !=5){ //不在申诉的子订单
- this.totalDiscount += i.discountAmount * 1;
- this.allPrice += i.payAmount *1;
- }
- })
- this.allPrice = this.allPrice.toFixed(2)
- this.totalDiscount = this.totalDiscount.toFixed(2)
- },
- getOrderDetailByOrderId(id){
- this.$api.getOrderDetailByOrderId({
- id:id
- }).then(res=>{
- for (const child of res.data.data.child) {
- if (child.suggestCoupon){
- child.suggestType = 1
- }else if (child.suggestEquityCard){
- child.suggestType = 2
- }else {
- child.suggestType = 0
- }
- }
- this.order= res.data.data
- // this.calculatePrice()
- })
- },
- payLoveItem(num,index,loveCard){
- // if (loveCard.totalBalance*1 < this.order.payAmount*1 && num == 0){
- // uni.$u.toast('余额不足')
- // return
- // }
- this.curServiceTab = num
- this.loveCardList.forEach(item=>{
- item.select = false
- })
- loveCard.select=true
- this.loveCardId = loveCard.id
- this.$set(this.loveCardList,index,loveCard)
- },
- payItem(num){
- if (this.userInfo.balance*1 < this.order.payAmount*1 && num == 1){
- uni.$u.toast('余额不足')
- return
- }
- this.curServiceTab = num
- },
- closePayPopup(){
- this.$refs.popup.close()
- },
- }
- }
- </script>
- <style>
- @import '/common/css/common.css';
- @import './index.rpx.scss';
- </style>
|