123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>详情-订单-创业帮</title>
- <meta name="keywords" content="详情-订单-创业帮">
- <meta name="description" content="详情-订单-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="详情-订单-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- <style>
- .van-radio__icon--checked .van-icon{color:#333;}
- .fractionalcell{height:1.28rem;line-height:1.28rem;}
- .mb{font-weight:500;}
- .fractionbtn{width:100vw;padding:0 .4267rem;box-sizing:border-box;bottom:.2933rem;}
- .fractionbtn button .van-button__text{color:#333 !important; font-size:.4267rem;font-weight:500;}
- .paynow .van-cell__value span{color:#FF4C4C; border:1px solid #ff4c4c;padding:4px 6px; border-radius:.1333rem;}
- .paynow{line-height:28px !important;}
- .paypanel{padding:0 .3733rem;}
- .paypanel .van-cell::after{display: none;}
- .f30{font-size:.8rem;}
- .mall-bottom{padding:0 .3733rem;height:54px;}
- .mall-bottom button{border-radius:999px !important; height:80% !important;}
- </style>
- </head>
- <body class="bgc-back pt0" style="padding-top:0;">
- <div id="app" v-cloak>
- <van-nav-bar class="user_rank_explan_title user_title_normal f16 rightbtn" title="订单详情" @click-left="goback" left-arrow v-if="toptitleisshow" v-cloak>
- <template #left> <img src="./static/images/icon-comback@2x.png" alt=""></template>
- </van-nav-bar>
- <div class="deal-detail" v-cloak>
- <van-cell class="deal-status" title="等待付款" center :border="false" v-if="orderinfo.Status === 0"></van-cell>
- <van-cell class="deal-status" title="付款成功" center :border="false" v-if="orderinfo.Status === 1"></van-cell>
- <van-cell class="deal-status" title="交易完成" center :border="false" v-if="orderinfo.Status === 2"></van-cell>
- <van-cell class="deal-address bb8f7f7f7" :label="orderinfo.Areas + orderinfo.Address" icon="location" center :border="false" v-if="orderinfo.DeliveryType === 1 && !isnews">
- <template #title><span class="mr12">{{orderinfo.RealName}}</span><span>{{orderinfo.Mobile}}</span></template>
- </van-cell>
- <van-cell class="deal-address bb8f7f7f7" icon="location" center :border="false" v-if="orderinfo.DeliveryType === 2 && !isnews">
- <template #title><span class="mr12">上门自提</span></template>
- </van-cell>
- <van-cell-group :border="false">
- <van-card class="suremall" v-for="item,index in orderinfo.Products" :price="item.ProductPrice | tofixed2" :title="item.ProductName" :num="item.ProductCount" :thumb="item.ProductPhoto" :key="index" :lazy-load="true" centered>
- <template #footer v-if="index === orderinfo.Products.length - 1">
- <div class="tr van-hairline--top pt8 mt8"><span class="f12 c666">共{{orderinfo.BuyCount}}件商品 实付金额:</span><span class="f14 c333">¥{{orderinfo.TotalPrice | tofixed2}}</span></div>
- </template>
- </van-card>
- </van-cell-group>
- <van-cell-group class="bb8f7f7f7 bt8f7f7f7" :border="false">
- <van-cell title="发货状态" :value="orderinfo.PayDate !== '' ? '已发货':'未发货'" :border="false"></van-cell>
- <van-cell title="订单编号" :border="false">
- <template #right-icon>
- <div class="f12 dib c999 pr16" id="dealId">{{orderinfo.OrderNo}}</div><span class="c666 f10" style="border:1px solid #eee; border-radius:2px; padding:0 2px" :data-clipboard-text="orderinfo.OrderNo" data-clipboard-action="copy" data-clipboard-target="#dealId" ref="copy" id="copy" @click="copyCode" @mouseenter="copyCode">复制</span>
- </template>
- </van-cell>
- <van-cell title="下单时间" :value="orderinfo.CreateDate" :border="false"></van-cell>
- <van-cell title="付款时间" :value="orderinfo.PayDate" :border="false" v-if="orderinfo.PayDate !== ''"></van-cell>
- <van-cell class="spcell" title="兑换券码" :value="orderinfo.PayDate" :border="false" v-if="orderinfo.PayDate !== '' && isnews">
- <template #default>
- <div v-for="item,index in codearr" @click="checkitem(index)">
- <div class="f14 c333">{{item[0]}} - {{item[item.length -1]}}
- <van-icon name="arrow-down" v-if="checkindex !== index"></van-icon>
- <van-icon name="arrow-up" v-if="checkindex === index"></van-icon>
- </div>
- <div class="f14 c333" v-for="item in codearr[checkindex]" v-if="checkindex === index">{{item}}</div>
- </div>
- </template>
- </van-cell>
- </van-cell-group>
- <van-cell-group class="bb8f7f7f7" :border="false" v-for="(item,index) in sonlist" :key="index" v-if="ischoose">
- <van-cell :value="Boolean(item.PayStatus) !== false ? '已支付':'立即付款'" :class="item.PayStatus !== 0 ? '':'paynow'" :border="false" @click="paynow(item.ProductPrice,item.Id,Boolean(item.PayStatus))">
- <template #title>
- <div class="df">
- <div class="c333" style="margin-right:40px;">{{"子订单" + (index + 1)}}</div>
- <div class="c999">¥{{item.ProductPrice | tofixed2}}</div>
- </div>
- </template>
- </van-cell>
- <van-cell title="订单编号" :border="false">
- <template #right-icon>
- <div class="f12 dib c999 pr16" id="dealId">{{item.OrderNo}}</div><span class="c666 f10" style="border:1px solid #eee; border-radius:2px; padding:0 2px" :data-clipboard-text="orderinfo.OrderNo" data-clipboard-action="copy" data-clipboard-target="#dealId" ref="copy" id="copy" @click="copyCode" @mouseenter="copyCode">复制</span>
- </template>
- </van-cell>
- <van-cell title="下单时间" :value="item.CreateDate" :border="false"></van-cell>
- <van-cell title="付款时间" :value="item.PayDate" :border="false" v-if="orderinfo.PayDate !== ''"></van-cell>
- </van-cell-group>
- <van-radio-group v-model="typeResult" v-if="!ischoose && Number(orderinfo.TotalPrice) >= 60000 && orderinfo.Status === 0" v-cloak>
- <van-cell-group class="bb8f7f7f7" :border="false">
- <van-cell class="machine-list" clickable value-class="f14" center @click="typeResult = 1">
- <template #title>
- <div class="f14 c333 tl"><span class="vm pr16 disable">一次性支付</span></div>
- </template>
- <template #icon>
- <van-radio class="mr16" :name="1" ref="radios" checked-color="#FFD500"> </van-radio>
- </template>
- </van-cell>
- <van-cell class="machine-list" clickable value-class="f14" center @click="typeResult = 2">
- <template #title>
- <div class="df">
- <van-radio class="mr16" :name="2" ref="radios" checked-color="#FFD500"> </van-radio>
- <div class="f14 c333 tl"><span class="vm pr16 disable">分次支付</span></div>
- </div>
- </template>
- <template #label v-if="typeResult === 2">
- <div class="f14 tl df jcsb aic" style="margin-top:20px;" @click="fractional"><span class="vm pr16 disable c333">分次数量</span>
- <div class="c999 aic df"><span class="vm disable" v-if="unchoosefractional === 4">4次(单笔2万以内)</span><span class="vm disable" v-if="unchoosefractional === 6">6次(单笔1.5万以内)</span><span class="vm disable" v-if="unchoosefractional === 8">8次(单笔1万以内)</span>
- <van-icon name="arrow"></van-icon>
- </div>
- </div>
- </template>
- </van-cell>
- </van-cell-group>
- </van-radio-group>
- <van-cell-group :border="false" v-if="!isnews">
- <van-cell title="发货仓库" :border="false">
- <template #right-icon>
- <div class="f12 dib c999 mr12">{{orderinfo.StoreContact}}</div>
- <div class="f12 dib c999 mr12">{{orderinfo.StoreContactMobile}}</div>
- <van-button class="c999" plain size="mini" @click="takephone(orderinfo.StoreContactMobile)">拨号</van-button>
- </template>
- </van-cell>
- <van-cell title="提货方式" :value="orderinfo.DeliveryType === 1 ? '邮寄到付':'上门自提'" :border="false"></van-cell>
- <van-cell title="提货仓库" :value="orderinfo.StoreName" :border="false"></van-cell>
- </van-cell-group>
- </div>
- <van-goods-action class="mall-bottom" v-if="orderinfo.Status === 0 && !ischoose">
- <van-goods-action-button class="kxs-btn" type="default" color="#FFD500" style="color:#333;" text="继续完成支付" @click="onClickButton"></van-goods-action-button>
- </van-goods-action>
- <van-popup class="payTypePop bgcfff" v-model="payTypePop" position="bottom" round closeable :style="{ height: '50%' }">
- <div class="tc pt16 rel">
- <div class="f18 c333">确认支付</div>
- </div>
- <div class="pt32 pb32 tc">
- <div class="f30 c333"><span class="f16">¥</span>{{orderinfo.TotalPrice | tofixed2}}</div>
- </div>
- <van-radio-group v-model="radio">
- <van-cell-group class="paypanel" :border="false">
- <van-cell title="支付宝" clickable @click="radio = 1" icon="alipay">
- <template #right-icon>
- <van-radio :name="1"></van-radio>
- </template>
- </van-cell>
- <van-cell clickable @click="radio = 4" v-if="((orderinfo.Products.length !== 0 && orderinfo.Products[0].ProductName === '电签购机券') || (orderinfo.Products.length !== 0 && orderinfo.Products[0].ProductName === '大POS购机券')) && (LeaderLevel === 1 || LeaderLevel === 2)">
- <template #title>
- <div>盟主储蓄金 <span class="ml16 c999">可用余额: ( ¥{{LeaderReserve}} )</span></div>
- </template>
- <template #right-icon>
- <van-radio :name="4"></van-radio>
- </template>
- <template #icon><img src="./static/images/pay-savings.png" style="height:24px;margin-right:.266667rem;"></template>
- </van-cell>
- <van-cell title="余额" clickable @click="radio = 3" icon="gold-coin">
- <template #title>
- <div>余额 <span class="ml16 c999">可用余额: ( ¥{{balance}} )</span></div>
- </template>
- <template #right-icon>
- <van-radio :name="3"></van-radio>
- </template>
- </van-cell>
- </van-cell-group>
- </van-radio-group>
- <van-goods-action class="mall-bottom ovh" style="margin:0 .4267rem;border-radius:999px;bottom:.1333rem;">
- <van-goods-action-button type="default" color="#FFD500" style="color:#333;" text="确认购买" @click="gotoInputPwd"></van-goods-action-button>
- </van-goods-action>
- </van-popup>
- <van-popup class="payTypePop bgcfff" v-model="paysonTypePop" position="bottom" round closeable :style="{ height: '50%' }">
- <div class="tc pt16 rel">
- <div class="f18 c333">确认支付</div>
- </div>
- <div class="pt32 pb32 tc">
- <div class="f30 c333"><span class="f16">¥</span>{{sonorderprice | tofixed2}}</div>
- </div>
- <van-radio-group v-model="radio">
- <van-cell-group class="paypanel" :border="false">
- <van-cell title="支付宝" clickable @click="radio = 1" icon="alipay">
- <template #right-icon>
- <van-radio :name="1"></van-radio>
- </template>
- </van-cell>
- <van-cell clickable @click="radio = 4" v-if="((orderinfo.Products.length !== 0 && orderinfo.Products[0].ProductName === '电签购机券') || (orderinfo.Products.length !== 0 && orderinfo.Products[0].ProductName === '大POS购机券')) && (LeaderLevel === 1 || LeaderLevel === 2)">
- <template #title>
- <div>盟主储蓄金 <span class="ml16 c999">可用余额: ( ¥{{LeaderReserve}} )</span></div>
- </template>
- <template #right-icon>
- <van-radio :name="4"></van-radio>
- </template>
- <template #icon><img src="./static/images/pay-savings.png" style="height:24px;margin-right:.266667rem;"></template>
- </van-cell>
- <van-cell title="余额" clickable @click="radio = 3" icon="gold-coin">
- <template #title>
- <div>余额 <span class="ml16 c999">可用余额: ( ¥{{balance}} )</span></div>
- </template>
- <template #right-icon>
- <van-radio :name="3"></van-radio>
- </template>
- </van-cell>
- </van-cell-group>
- </van-radio-group>
- <van-goods-action class="mall-bottom ovh" style="margin:0 .4267rem;border-radius:999px;bottom:.1333rem;">
- <van-goods-action-button type="default" color="#FFD500" style="color:#333;" text="确认购买" @click="gotosonInputPwd"></van-goods-action-button>
- </van-goods-action>
- </van-popup>
- <van-popup v-model="fracshow" closeable round position="bottom" @close="onfracHide" :style="{ height: '38%' }">
- <div class="f16 c333 fractionalcell tc mb">分次数量</div>
- <van-radio-group v-model="choosefractional">
- <van-cell-group :border="false">
- <van-cell class="machine-list" clickable value-class="f14" center @click="choosefractional = 4">
- <template #title>
- <div class="f14 c999 tl"><span class="vm pr16 disable" :class="choosefractional === 4 ? 'c333':''">4次(单笔2万以内)</span></div>
- </template>
- <template #right-icon>
- <van-radio :name="4" ref="radios" checked-color="#FFD500"> </van-radio>
- </template>
- </van-cell>
- <van-cell class="machine-list" clickable value-class="f14" center @click="choosefractional = 6">
- <template #title>
- <div class="f14 c999 tl"><span class="vm pr16 disable" :class="choosefractional === 6 ? 'c333':''">6次(单笔1.5万以内)</span></div>
- </template>
- <template #right-icon>
- <van-radio :name="6" ref="radios" checked-color="#FFD500"> </van-radio>
- </template>
- </van-cell>
- <van-cell class="machine-list" clickable value-class="f14" center @click="choosefractional = 8">
- <template #title>
- <div class="f14 c999 tl"><span class="vm pr16 disable" :class="choosefractional === 8 ? 'c333':''">8次(单笔1万以内)</span></div>
- </template>
- <template #right-icon>
- <van-radio :name="8" ref="radios" checked-color="#FFD500"> </van-radio>
- </template>
- </van-cell>
- </van-cell-group>
- </van-radio-group>
- <div class="abs fractionbtn">
- <van-button type="primary" block color="#FFD500" @click="surefraction" round>确认</van-button>
- </div>
- </van-popup>
- <van-popup class="pwdPop" v-model="pwdPop" position="bottom" @close="onKeyboardHide" closeable close-icon-position="top-left" :style="{ height: '60%' }">
- <div class="tc pt16 rel">
- <div class="f18 c333">输入密码</div>
- <div class="pop-forgetpwd abs f14 c666"></div>
- </div>
- <div class="pt8">
- <van-password-input class="mt8" :value="value" :info="pwdInfo" :error-info="errorInfo" :focused="showKeyboard" @focus="showKeyboard = true"></van-password-input>
- </div>
- <van-number-keyboard v-model="value" :show="true" maxlength="6"></van-number-keyboard>
- </van-popup>
- </div>
- <script src="./static/js/clipboard.min.js"></script>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script>
- //- function OnStart(){
- //- app.getorderinfo();
- //- PublicLib.ShowMsg({Title:'标题', Message:'OnStart'});
- //- };
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- browsernum:'',
- LeaderLevel:0,
- activeshutdown:true,
- ischoose:false,
- fracshow:false,
- //- 兑换码列表
- choosefractional:4,
- unchoosefractional:4,
- typeResult:1,
- codearr:[[]],
- checkindex:-1,
- isnews:false,
- toptitleisshow:false,
- payTypePop: false,
- paysonTypePop: false,
- pwdPop: false,
- chosenAddressId: 1,
- orderinfo:{
- Status: '', //状态
- OrderNo: "", //订单号
- RealName: "", //姓名
- Mobile: "", //手机号
- TotalPrice: 0, //总价
- Areas: "", //所在地区
- Address: "", //详细地址
- BuyCount: 0, //下单数量
- SendStatus: 0, //1已发货0未发货发货状态
- CreateDate: "", //创建时间
- PayDate: "", //付款时间
- DeliveryType: 1, //提货类型1邮寄到付2自提
- StoreContact: "", //仓库联系人
- StoreContactMobile: "", //仓库联系人电话
- StoreName: "", //提货仓库
- Products:[
- {
- ProductName:'商品名称',
- ProductPrice:'0.00',
- ProductCount:'0',
- ProductPhoto:'',
- }
- ]
- },
- balance:0,
- LeaderReserve:0,
- value: '',
- errorInfo: '',
- showKeyboard: true,
- radio: 1,
- pwdInfo: '密码为 6 位数字',
- flag:true,
- sonlist:[],
- isson:false,
- sonorderid:'',
- sonorderprice:0,
- };
- },
- watch: {
- async value(value) {
- if(value.length === 6){
- //- 验证原支付密码
- const Id = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/users/checkpaypwd?t='+Math.random(6),JSON.stringify({Id,PayPwd:this.value}));
- if(res.status === '1'){
- this.pwdInfo = '密码正确';
- const that = this;
- if(this.isson){
- this.paysonfn();
- }else{
- this.payfn();
- };
- this.getorderinfo();
- setTimeout(function(){
- that.value = '';
- },2000);
- }else{
- this.errorInfo = '密码错误';
- const that = this;
- setTimeout(function(){
- that.value = '';
- },800);
- };
- } else if(value.length === 0){
- this.errorInfo = '';
- this.pwdInfo = '密码为 6 位数字';
- } else{
- this.errorInfo = '';
- this.pwdInfo = '再输入' + (6 - value.length) + '位密码';
- }
- },
- },
- async created(){
- //- this.browsernum = PublicLib.GetAppVersion();
- this.browsernum = '1.5.0';
- this.toptitleisshow = toptitleisshow;
- this.getorderinfo();
- this.getNoun();
- //- this.getuserinfo();
- },
- mounted(){
- },
- beforeUpdate(){
- //- this.$nextTick(() => {
- //- console.log(this.$refs.copy)
- //- },10);
- },
- methods: {
- onfracHide(){
- this.choosefractional = this.unchoosefractional;
- },
- paynow(price,Id,status){
- if(status){
- return;
- };
- this.sonorderid = Id;
- this.sonorderprice = price;
- this.paysonTypePop = true;
- },
- async surefraction(){
- this.activeshutdown = false;
- this.fracshow = false;
- this.unchoosefractional = this.choosefractional;
- },
- async getsonorder(Id){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/orders/Detailv2?t='+Math.random(6),JSON.stringify({UserId,Id}));
- if(res.status !== '1'){
- tips(res.info)
- }else{
- this.sonlist = res.data.ChileOrders;
- if(res.data.ChileOrders.length !== 0){
- this.ischoose = true;
- };
- };
- },
- fractional(){
- //- if(this.typeResult !== 2){
- //- return;
- //- };
- this.fracshow = true;
- },
- typeToggle(item) {
- this.typeResult = item;
- },
- checkitem(index){
- if(index !== this.checkindex){
- this.checkindex = index;
- }else{this.checkindex = -1};
- },
- async getorderinfo(){
- const UserId = PublicLib.getCookieInfo('userId');
- const Id = PublicLib.getCookieInfo('mallorderId');
- const res = await getRequest('api/v1/orders/detail2?t='+Math.random(6),JSON.stringify({UserId,Id}));
- if(res.status !== '1') return tips('获取订单详情失败,请重试!');
- let ind = 0;
- res.data.ExchangeCodeList.forEach((item,index)=>{
- this.codearr[ind].push(item);
- if(index % 100 === 0 && index !== 0){
- this.codearr.push([]);
- ind++;
- };
- });
- this.orderinfo = res.data;
- if(res.data.Products.length !== 0 && res.data.Products[0].ProductName){
- if(res.data.Products[0].ProductName === '电签购机券' || res.data.Products[0].ProductName === '大POS购机券'){
- this.radio = 4;
- };
- };
- if(res.data.DeliveryType === 0){
- this.isnews = true;
- }else{
- this.isnews = false;
- };
- this.getsonorder(Id);
- this.getuserinfo();
- },
- //余额查询
- async getNoun(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/useraccount/myaccount?t='+Math.random(6),JSON.stringify({UserId}));
- this.balance = tofixed2(res.data.BalanceAmount);
- this.LeaderReserve = tofixed2(res.data.LeaderReserve);
- },
- giveToast(str){
- vant.Toast(str);
- },
- copyCode(){
- clipboard = new ClipboardJS(this.$refs.copy);
- const that = this;
- this.$nextTick(() => {
- clipboard.on('success', function(e) {
- that.giveToast('复制成功');
- });
- clipboard.on('error', function(e) {
- that.giveToast('复制失败,请手动选择复制!');
- });
- });
- },
- async onClickButton() {
- if(this.typeResult === 2){
- const UserId = PublicLib.getCookieInfo('userId');
- const OrderId = PublicLib.getCookieInfo('mallorderId');
- const res = await postRequest('api/v1/orders/payreserve?t='+Math.random(6),JSON.stringify({UserId,OrderId,OpMode:2,Times:this.unchoosefractional}));
- if(res.status !== '1'){
- tips(res.info)
- }else{
- const Id = PublicLib.getCookieInfo('mallorderId');
- this.getsonorder(Id);
- };
- }else{
- this.payTypePop = true;
- };
- },
- //- 子订单支付
- async paysonfn(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await postRequest('api/v1/orders/pay?t='+Math.random(6),JSON.stringify({UserId,PayMode:this.radio,Id:this.sonorderid}));
- if(res.status !== '1')return tips(res.info)
- //- if(this.radio === 2) {
- //- PublicLib.RequestWechatPay({
- //- OrderInfo: res.data.PayData,
- //- SuccessUrl:'mall-deal-detail-finished',
- //- FailUrl:'mall-deal-detail-finished'
- //- });
- //- this.flag = false;
- //- }else
- if(this.radio === 1) {
- PublicLib.RequestAlipay({
- OrderInfo: res.data.PayData,
- SuccessUrl:'mall-deal-detail',
- FailUrl:'mall-deal-detail'
- });
- this.flag = false;
- } else if(this.radio === 3){
- tips('支付成功!');
- setTimeout(()=>{
- this.pwdPop = false;
- this.getorderinfo();
- },2000)
- }else if(this.radio === 4){
- tips('支付成功!');
- setTimeout(()=>{
- this.pwdPop = false;
- this.getorderinfo();
- },2000)
- }
- },
- //- 订单支付
- async payfn(){
- const Id = PublicLib.getCookieInfo('mallorderId');
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await postRequest('api/v1/orders/pay?t='+Math.random(6),JSON.stringify({UserId,PayMode:this.radio,Id}));
- if(res.status !== '1')return tips(res.info)
- //- if(this.radio === 2) {
- //- PublicLib.RequestWechatPay({
- //- OrderInfo: res.data.PayData,
- //- SuccessUrl:'mall-deal-detail-finished',
- //- FailUrl:'mall-deal-detail-finished'
- //- });
- //- this.flag = false;
- //- }else
- if(this.radio === 1) {
- PublicLib.RequestAlipay({
- OrderInfo: res.data.PayData,
- SuccessUrl:'mall-deal-detail',
- FailUrl:'mall-deal-detail'
- });
- this.flag = false;
- } else if(this.radio === 3){
- tips('支付成功!');
- setTimeout(()=>{
- this.pwdPop = false;
- this.getorderinfo();
- },2000)
- }else if(this.radio === 4){
- tips('支付成功!');
- setTimeout(()=>{
- this.pwdPop = false;
- this.getorderinfo();
- },2000)
- }
- },
- //- 点击确认支付
- async gotoInputPwd() {
- this.isson = false;
- if(Number(this.orderinfo.TotalPrice)>Number(this.balance) && this.radio === 3){ return tips('余额不足,请更换付款方式')};
- if(Number(this.orderinfo.TotalPrice)>Number(this.LeaderReserve) && this.radio === 4){ return tips('余额不足,请更换付款方式')};
- this.paydata = '';
- this.payTypePop = false;
- let Id,res;
- switch(this.radio){
- case 3:
- Id = PublicLib.getCookieInfo('userId');
- res = await getRequest('api/v1/users/existpaypwd?t='+Math.random(6),JSON.stringify({Id}));
- if(res.status !== '1') return PublicLib.Goto({Url:'user-setpaypwd-1'});
- this.pwdPop = true;
- break;
- case 1:
- this.payfn();
- break;
- case 2:
- //- this.payfn();
- break;
- case 4:
- Id = PublicLib.getCookieInfo('userId');
- res = await getRequest('api/v1/users/existpaypwd?t='+Math.random(6),JSON.stringify({Id}));
- if(res.status !== '1') return PublicLib.Goto({Url:'user-setpaypwd-1'});
- this.pwdPop = true;
- break;
- };
- },
- //- 点击子订单确认支付
- async gotosonInputPwd() {
- this.isson = true;
- if(Number(this.sonorderprice)>Number(this.balance) && this.radio === 3){ return tips('余额不足,请更换付款方式')};
- if(Number(this.sonorderprice)>Number(this.LeaderReserve) && this.radio === 4){ return tips('余额不足,请更换付款方式')};
- this.paydata = '';
- this.paysonTypePop = false;
- let Id,res;
- switch(this.radio){
- case 3:
- Id = PublicLib.getCookieInfo('userId');
- res = await getRequest('api/v1/users/existpaypwd?t='+Math.random(6),JSON.stringify({Id}));
- if(res.status !== '1') return PublicLib.Goto({Url:'user-setpaypwd-1'});
- this.pwdPop = true;
- break;
- case 1:
- this.paysonfn();
- break;
- case 2:
- //- this.payfn();
- break;
- case 4:
- Id = PublicLib.getCookieInfo('userId');
- res = await getRequest('api/v1/users/existpaypwd?t='+Math.random(6),JSON.stringify({Id}));
- if(res.status !== '1') return PublicLib.Goto({Url:'user-setpaypwd-1'});
- this.pwdPop = true;
- break;
- };
- },
- onKeyboardHide(){
- this.value = '';
- },
- //- 获取用户个人信息
- async getuserinfo(){
- const userId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/users/personalinfo?t='+Math.random(6),JSON.stringify({Id:userId}));
- if(res.status === '1') {
- this.LeaderLevel = res.data.LeaderLevel;
- if(res.data.LeaderLevel === 0){
- this.radio = 1;
- };
- };
- },
- //- 拨打电话
- takephone(phonenum){
- PublicLib.PhoneCall(phonenum);
- },
- goback(){
- if(this.flag){
- PublicLib.GoBack({Level:1});
- }else{
- PublicLib.GoBack({Level:2});
- }
- }
- }
- });
- </script>
- </body>
- </html>
|