mall-deal-detail.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>详情-订单-创业帮</title>
  6. <meta name="keywords" content="详情-订单-创业帮">
  7. <meta name="description" content="详情-订单-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="详情-订单-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. <style>
  17. .van-radio__icon--checked .van-icon{color:#333;}
  18. .fractionalcell{height:1.28rem;line-height:1.28rem;}
  19. .mb{font-weight:500;}
  20. .fractionbtn{width:100vw;padding:0 .4267rem;box-sizing:border-box;bottom:.2933rem;}
  21. .fractionbtn button .van-button__text{color:#333 !important; font-size:.4267rem;font-weight:500;}
  22. .paynow .van-cell__value span{color:#FF4C4C; border:1px solid #ff4c4c;padding:4px 6px; border-radius:.1333rem;}
  23. .paynow{line-height:28px !important;}
  24. .paypanel{padding:0 .3733rem;}
  25. .paypanel .van-cell::after{display: none;}
  26. .f30{font-size:.8rem;}
  27. .mall-bottom{padding:0 .3733rem;height:54px;}
  28. .mall-bottom button{border-radius:999px !important; height:80% !important;}
  29. </style>
  30. </head>
  31. <body class="bgc-back pt0" style="padding-top:0;">
  32. <div id="app" v-cloak>
  33. <van-nav-bar class="user_rank_explan_title user_title_normal f16 rightbtn" title="订单详情" @click-left="goback" left-arrow v-if="toptitleisshow" v-cloak>
  34. <template #left> <img src="./static/images/icon-comback@2x.png" alt=""></template>
  35. </van-nav-bar>
  36. <div class="deal-detail" v-cloak>
  37. <van-cell class="deal-status" title="等待付款" center :border="false" v-if="orderinfo.Status === 0"></van-cell>
  38. <van-cell class="deal-status" title="付款成功" center :border="false" v-if="orderinfo.Status === 1"></van-cell>
  39. <van-cell class="deal-status" title="交易完成" center :border="false" v-if="orderinfo.Status === 2"></van-cell>
  40. <van-cell class="deal-address bb8f7f7f7" :label="orderinfo.Areas + orderinfo.Address" icon="location" center :border="false" v-if="orderinfo.DeliveryType === 1 &amp;&amp; !isnews">
  41. <template #title><span class="mr12">{{orderinfo.RealName}}</span><span>{{orderinfo.Mobile}}</span></template>
  42. </van-cell>
  43. <van-cell class="deal-address bb8f7f7f7" icon="location" center :border="false" v-if="orderinfo.DeliveryType === 2 &amp;&amp; !isnews">
  44. <template #title><span class="mr12">上门自提</span></template>
  45. </van-cell>
  46. <van-cell-group :border="false">
  47. <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>
  48. <template #footer v-if="index === orderinfo.Products.length - 1">
  49. <div class="tr van-hairline--top pt8 mt8"><span class="f12 c666">共{{orderinfo.BuyCount}}件商品 实付金额:</span><span class="f14 c333">¥{{orderinfo.TotalPrice | tofixed2}}</span></div>
  50. </template>
  51. </van-card>
  52. </van-cell-group>
  53. <van-cell-group class="bb8f7f7f7 bt8f7f7f7" :border="false">
  54. <van-cell title="发货状态" :value="orderinfo.PayDate !== '' ? '已发货':'未发货'" :border="false"></van-cell>
  55. <van-cell title="订单编号" :border="false">
  56. <template #right-icon>
  57. <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>
  58. </template>
  59. </van-cell>
  60. <van-cell title="下单时间" :value="orderinfo.CreateDate" :border="false"></van-cell>
  61. <van-cell title="付款时间" :value="orderinfo.PayDate" :border="false" v-if="orderinfo.PayDate !== ''"></van-cell>
  62. <van-cell class="spcell" title="兑换券码" :value="orderinfo.PayDate" :border="false" v-if="orderinfo.PayDate !== '' &amp;&amp; isnews">
  63. <template #default>
  64. <div v-for="item,index in codearr" @click="checkitem(index)">
  65. <div class="f14 c333">{{item[0]}} - {{item[item.length -1]}}
  66. <van-icon name="arrow-down" v-if="checkindex !== index"></van-icon>
  67. <van-icon name="arrow-up" v-if="checkindex === index"></van-icon>
  68. </div>
  69. <div class="f14 c333" v-for="item in codearr[checkindex]" v-if="checkindex === index">{{item}}</div>
  70. </div>
  71. </template>
  72. </van-cell>
  73. </van-cell-group>
  74. <van-cell-group class="bb8f7f7f7" :border="false" v-for="(item,index) in sonlist" :key="index" v-if="ischoose">
  75. <van-cell :value="Boolean(item.PayStatus) !== false ? '已支付':'立即付款'" :class="item.PayStatus !== 0 ? '':'paynow'" :border="false" @click="paynow(item.ProductPrice,item.Id,Boolean(item.PayStatus))">
  76. <template #title>
  77. <div class="df">
  78. <div class="c333" style="margin-right:40px;">{{"子订单" + (index + 1)}}</div>
  79. <div class="c999">¥{{item.ProductPrice | tofixed2}}</div>
  80. </div>
  81. </template>
  82. </van-cell>
  83. <van-cell title="订单编号" :border="false">
  84. <template #right-icon>
  85. <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>
  86. </template>
  87. </van-cell>
  88. <van-cell title="下单时间" :value="item.CreateDate" :border="false"></van-cell>
  89. <van-cell title="付款时间" :value="item.PayDate" :border="false" v-if="orderinfo.PayDate !== ''"></van-cell>
  90. </van-cell-group>
  91. <van-radio-group v-model="typeResult" v-if="!ischoose &amp;&amp; Number(orderinfo.TotalPrice) &gt;= 60000 &amp;&amp; orderinfo.Status === 0" v-cloak>
  92. <van-cell-group class="bb8f7f7f7" :border="false">
  93. <van-cell class="machine-list" clickable value-class="f14" center @click="typeResult = 1">
  94. <template #title>
  95. <div class="f14 c333 tl"><span class="vm pr16 disable">一次性支付</span></div>
  96. </template>
  97. <template #icon>
  98. <van-radio class="mr16" :name="1" ref="radios" checked-color="#FFD500"> </van-radio>
  99. </template>
  100. </van-cell>
  101. <van-cell class="machine-list" clickable value-class="f14" center @click="typeResult = 2">
  102. <template #title>
  103. <div class="df">
  104. <van-radio class="mr16" :name="2" ref="radios" checked-color="#FFD500"> </van-radio>
  105. <div class="f14 c333 tl"><span class="vm pr16 disable">分次支付</span></div>
  106. </div>
  107. </template>
  108. <template #label v-if="typeResult === 2">
  109. <div class="f14 tl df jcsb aic" style="margin-top:20px;" @click="fractional"><span class="vm pr16 disable c333">分次数量</span>
  110. <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>
  111. <van-icon name="arrow"></van-icon>
  112. </div>
  113. </div>
  114. </template>
  115. </van-cell>
  116. </van-cell-group>
  117. </van-radio-group>
  118. <van-cell-group :border="false" v-if="!isnews">
  119. <van-cell title="发货仓库" :border="false">
  120. <template #right-icon>
  121. <div class="f12 dib c999 mr12">{{orderinfo.StoreContact}}</div>
  122. <div class="f12 dib c999 mr12">{{orderinfo.StoreContactMobile}}</div>
  123. <van-button class="c999" plain size="mini" @click="takephone(orderinfo.StoreContactMobile)">拨号</van-button>
  124. </template>
  125. </van-cell>
  126. <van-cell title="提货方式" :value="orderinfo.DeliveryType === 1 ? '邮寄到付':'上门自提'" :border="false"></van-cell>
  127. <van-cell title="提货仓库" :value="orderinfo.StoreName" :border="false"></van-cell>
  128. </van-cell-group>
  129. </div>
  130. <van-goods-action class="mall-bottom" v-if="orderinfo.Status === 0 &amp;&amp; !ischoose">
  131. <van-goods-action-button class="kxs-btn" type="default" color="#FFD500" style="color:#333;" text="继续完成支付" @click="onClickButton"></van-goods-action-button>
  132. </van-goods-action>
  133. <van-popup class="payTypePop bgcfff" v-model="payTypePop" position="bottom" round closeable :style="{ height: '50%' }">
  134. <div class="tc pt16 rel">
  135. <div class="f18 c333">确认支付</div>
  136. </div>
  137. <div class="pt32 pb32 tc">
  138. <div class="f30 c333"><span class="f16">¥</span>{{orderinfo.TotalPrice | tofixed2}}</div>
  139. </div>
  140. <van-radio-group v-model="radio">
  141. <van-cell-group class="paypanel" :border="false">
  142. <van-cell title="支付宝" clickable @click="radio = 1" icon="alipay">
  143. <template #right-icon>
  144. <van-radio :name="1"></van-radio>
  145. </template>
  146. </van-cell>
  147. <van-cell clickable @click="radio = 4" v-if="((orderinfo.Products.length !== 0 &amp;&amp; orderinfo.Products[0].ProductName === '电签购机券') || (orderinfo.Products.length !== 0 &amp;&amp; orderinfo.Products[0].ProductName === '大POS购机券')) &amp;&amp; (LeaderLevel === 1 || LeaderLevel === 2)">
  148. <template #title>
  149. <div>盟主储蓄金 <span class="ml16 c999">可用余额: ( ¥{{LeaderReserve}} )</span></div>
  150. </template>
  151. <template #right-icon>
  152. <van-radio :name="4"></van-radio>
  153. </template>
  154. <template #icon><img src="./static/images/pay-savings.png" style="height:24px;margin-right:.266667rem;"></template>
  155. </van-cell>
  156. <van-cell title="余额" clickable @click="radio = 3" icon="gold-coin">
  157. <template #title>
  158. <div>余额 <span class="ml16 c999">可用余额: ( ¥{{balance}} )</span></div>
  159. </template>
  160. <template #right-icon>
  161. <van-radio :name="3"></van-radio>
  162. </template>
  163. </van-cell>
  164. </van-cell-group>
  165. </van-radio-group>
  166. <van-goods-action class="mall-bottom ovh" style="margin:0 .4267rem;border-radius:999px;bottom:.1333rem;">
  167. <van-goods-action-button type="default" color="#FFD500" style="color:#333;" text="确认购买" @click="gotoInputPwd"></van-goods-action-button>
  168. </van-goods-action>
  169. </van-popup>
  170. <van-popup class="payTypePop bgcfff" v-model="paysonTypePop" position="bottom" round closeable :style="{ height: '50%' }">
  171. <div class="tc pt16 rel">
  172. <div class="f18 c333">确认支付</div>
  173. </div>
  174. <div class="pt32 pb32 tc">
  175. <div class="f30 c333"><span class="f16">¥</span>{{sonorderprice | tofixed2}}</div>
  176. </div>
  177. <van-radio-group v-model="radio">
  178. <van-cell-group class="paypanel" :border="false">
  179. <van-cell title="支付宝" clickable @click="radio = 1" icon="alipay">
  180. <template #right-icon>
  181. <van-radio :name="1"></van-radio>
  182. </template>
  183. </van-cell>
  184. <van-cell clickable @click="radio = 4" v-if="((orderinfo.Products.length !== 0 &amp;&amp; orderinfo.Products[0].ProductName === '电签购机券') || (orderinfo.Products.length !== 0 &amp;&amp; orderinfo.Products[0].ProductName === '大POS购机券')) &amp;&amp; (LeaderLevel === 1 || LeaderLevel === 2)">
  185. <template #title>
  186. <div>盟主储蓄金 <span class="ml16 c999">可用余额: ( ¥{{LeaderReserve}} )</span></div>
  187. </template>
  188. <template #right-icon>
  189. <van-radio :name="4"></van-radio>
  190. </template>
  191. <template #icon><img src="./static/images/pay-savings.png" style="height:24px;margin-right:.266667rem;"></template>
  192. </van-cell>
  193. <van-cell title="余额" clickable @click="radio = 3" icon="gold-coin">
  194. <template #title>
  195. <div>余额 <span class="ml16 c999">可用余额: ( ¥{{balance}} )</span></div>
  196. </template>
  197. <template #right-icon>
  198. <van-radio :name="3"></van-radio>
  199. </template>
  200. </van-cell>
  201. </van-cell-group>
  202. </van-radio-group>
  203. <van-goods-action class="mall-bottom ovh" style="margin:0 .4267rem;border-radius:999px;bottom:.1333rem;">
  204. <van-goods-action-button type="default" color="#FFD500" style="color:#333;" text="确认购买" @click="gotosonInputPwd"></van-goods-action-button>
  205. </van-goods-action>
  206. </van-popup>
  207. <van-popup v-model="fracshow" closeable round position="bottom" @close="onfracHide" :style="{ height: '38%' }">
  208. <div class="f16 c333 fractionalcell tc mb">分次数量</div>
  209. <van-radio-group v-model="choosefractional">
  210. <van-cell-group :border="false">
  211. <van-cell class="machine-list" clickable value-class="f14" center @click="choosefractional = 4">
  212. <template #title>
  213. <div class="f14 c999 tl"><span class="vm pr16 disable" :class="choosefractional === 4 ? 'c333':''">4次(单笔2万以内)</span></div>
  214. </template>
  215. <template #right-icon>
  216. <van-radio :name="4" ref="radios" checked-color="#FFD500"> </van-radio>
  217. </template>
  218. </van-cell>
  219. <van-cell class="machine-list" clickable value-class="f14" center @click="choosefractional = 6">
  220. <template #title>
  221. <div class="f14 c999 tl"><span class="vm pr16 disable" :class="choosefractional === 6 ? 'c333':''">6次(单笔1.5万以内)</span></div>
  222. </template>
  223. <template #right-icon>
  224. <van-radio :name="6" ref="radios" checked-color="#FFD500"> </van-radio>
  225. </template>
  226. </van-cell>
  227. <van-cell class="machine-list" clickable value-class="f14" center @click="choosefractional = 8">
  228. <template #title>
  229. <div class="f14 c999 tl"><span class="vm pr16 disable" :class="choosefractional === 8 ? 'c333':''">8次(单笔1万以内)</span></div>
  230. </template>
  231. <template #right-icon>
  232. <van-radio :name="8" ref="radios" checked-color="#FFD500"> </van-radio>
  233. </template>
  234. </van-cell>
  235. </van-cell-group>
  236. </van-radio-group>
  237. <div class="abs fractionbtn">
  238. <van-button type="primary" block color="#FFD500" @click="surefraction" round>确认</van-button>
  239. </div>
  240. </van-popup>
  241. <van-popup class="pwdPop" v-model="pwdPop" position="bottom" @close="onKeyboardHide" closeable close-icon-position="top-left" :style="{ height: '60%' }">
  242. <div class="tc pt16 rel">
  243. <div class="f18 c333">输入密码</div>
  244. <div class="pop-forgetpwd abs f14 c666"></div>
  245. </div>
  246. <div class="pt8">
  247. <van-password-input class="mt8" :value="value" :info="pwdInfo" :error-info="errorInfo" :focused="showKeyboard" @focus="showKeyboard = true"></van-password-input>
  248. </div>
  249. <van-number-keyboard v-model="value" :show="true" maxlength="6"></van-number-keyboard>
  250. </van-popup>
  251. </div>
  252. <script src="./static/js/clipboard.min.js"></script>
  253. <script src="./static/js/klm-vv.min.js"></script>
  254. <script src="./static/js/appfunc.min.js"></script>
  255. <script src="./static/js/klm-axios-config.js"></script>
  256. <script src="./static/js/publicfn.js"></script>
  257. <script>
  258. //- function OnStart(){
  259. //- app.getorderinfo();
  260. //- PublicLib.ShowMsg({Title:'标题', Message:'OnStart'});
  261. //- };
  262. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  263. // 可以通过下面的方式手动注册
  264. Vue.use(vant.Lazyload);
  265. // 在 #app 标签下渲染一个按钮组件
  266. let app = new Vue({
  267. el: '#app',
  268. data() {
  269. return {
  270. browsernum:'',
  271. LeaderLevel:0,
  272. activeshutdown:true,
  273. ischoose:false,
  274. fracshow:false,
  275. //- 兑换码列表
  276. choosefractional:4,
  277. unchoosefractional:4,
  278. typeResult:1,
  279. codearr:[[]],
  280. checkindex:-1,
  281. isnews:false,
  282. toptitleisshow:false,
  283. payTypePop: false,
  284. paysonTypePop: false,
  285. pwdPop: false,
  286. chosenAddressId: 1,
  287. orderinfo:{
  288. Status: '', //状态
  289. OrderNo: "", //订单号
  290. RealName: "", //姓名
  291. Mobile: "", //手机号
  292. TotalPrice: 0, //总价
  293. Areas: "", //所在地区
  294. Address: "", //详细地址
  295. BuyCount: 0, //下单数量
  296. SendStatus: 0, //1已发货0未发货发货状态
  297. CreateDate: "", //创建时间
  298. PayDate: "", //付款时间
  299. DeliveryType: 1, //提货类型1邮寄到付2自提
  300. StoreContact: "", //仓库联系人
  301. StoreContactMobile: "", //仓库联系人电话
  302. StoreName: "", //提货仓库
  303. Products:[
  304. {
  305. ProductName:'商品名称',
  306. ProductPrice:'0.00',
  307. ProductCount:'0',
  308. ProductPhoto:'',
  309. }
  310. ]
  311. },
  312. balance:0,
  313. LeaderReserve:0,
  314. value: '',
  315. errorInfo: '',
  316. showKeyboard: true,
  317. radio: 1,
  318. pwdInfo: '密码为 6 位数字',
  319. flag:true,
  320. sonlist:[],
  321. isson:false,
  322. sonorderid:'',
  323. sonorderprice:0,
  324. };
  325. },
  326. watch: {
  327. async value(value) {
  328. if(value.length === 6){
  329. //- 验证原支付密码
  330. const Id = PublicLib.getCookieInfo('userId');
  331. const res = await getRequest('api/v1/users/checkpaypwd?t='+Math.random(6),JSON.stringify({Id,PayPwd:this.value}));
  332. if(res.status === '1'){
  333. this.pwdInfo = '密码正确';
  334. const that = this;
  335. if(this.isson){
  336. this.paysonfn();
  337. }else{
  338. this.payfn();
  339. };
  340. this.getorderinfo();
  341. setTimeout(function(){
  342. that.value = '';
  343. },2000);
  344. }else{
  345. this.errorInfo = '密码错误';
  346. const that = this;
  347. setTimeout(function(){
  348. that.value = '';
  349. },800);
  350. };
  351. } else if(value.length === 0){
  352. this.errorInfo = '';
  353. this.pwdInfo = '密码为 6 位数字';
  354. } else{
  355. this.errorInfo = '';
  356. this.pwdInfo = '再输入' + (6 - value.length) + '位密码';
  357. }
  358. },
  359. },
  360. async created(){
  361. //- this.browsernum = PublicLib.GetAppVersion();
  362. this.browsernum = '1.5.0';
  363. this.toptitleisshow = toptitleisshow;
  364. this.getorderinfo();
  365. this.getNoun();
  366. //- this.getuserinfo();
  367. },
  368. mounted(){
  369. },
  370. beforeUpdate(){
  371. //- this.$nextTick(() => {
  372. //- console.log(this.$refs.copy)
  373. //- },10);
  374. },
  375. methods: {
  376. onfracHide(){
  377. this.choosefractional = this.unchoosefractional;
  378. },
  379. paynow(price,Id,status){
  380. if(status){
  381. return;
  382. };
  383. this.sonorderid = Id;
  384. this.sonorderprice = price;
  385. this.paysonTypePop = true;
  386. },
  387. async surefraction(){
  388. this.activeshutdown = false;
  389. this.fracshow = false;
  390. this.unchoosefractional = this.choosefractional;
  391. },
  392. async getsonorder(Id){
  393. const UserId = PublicLib.getCookieInfo('userId');
  394. const res = await getRequest('api/v1/orders/Detailv2?t='+Math.random(6),JSON.stringify({UserId,Id}));
  395. if(res.status !== '1'){
  396. tips(res.info)
  397. }else{
  398. this.sonlist = res.data.ChileOrders;
  399. if(res.data.ChileOrders.length !== 0){
  400. this.ischoose = true;
  401. };
  402. };
  403. },
  404. fractional(){
  405. //- if(this.typeResult !== 2){
  406. //- return;
  407. //- };
  408. this.fracshow = true;
  409. },
  410. typeToggle(item) {
  411. this.typeResult = item;
  412. },
  413. checkitem(index){
  414. if(index !== this.checkindex){
  415. this.checkindex = index;
  416. }else{this.checkindex = -1};
  417. },
  418. async getorderinfo(){
  419. const UserId = PublicLib.getCookieInfo('userId');
  420. const Id = PublicLib.getCookieInfo('mallorderId');
  421. const res = await getRequest('api/v1/orders/detail2?t='+Math.random(6),JSON.stringify({UserId,Id}));
  422. if(res.status !== '1') return tips('获取订单详情失败,请重试!');
  423. let ind = 0;
  424. res.data.ExchangeCodeList.forEach((item,index)=>{
  425. this.codearr[ind].push(item);
  426. if(index % 100 === 0 && index !== 0){
  427. this.codearr.push([]);
  428. ind++;
  429. };
  430. });
  431. this.orderinfo = res.data;
  432. if(res.data.Products.length !== 0 && res.data.Products[0].ProductName){
  433. if(res.data.Products[0].ProductName === '电签购机券' || res.data.Products[0].ProductName === '大POS购机券'){
  434. this.radio = 4;
  435. };
  436. };
  437. if(res.data.DeliveryType === 0){
  438. this.isnews = true;
  439. }else{
  440. this.isnews = false;
  441. };
  442. this.getsonorder(Id);
  443. this.getuserinfo();
  444. },
  445. //余额查询
  446. async getNoun(){
  447. const UserId = PublicLib.getCookieInfo('userId');
  448. const res = await getRequest('api/v1/useraccount/myaccount?t='+Math.random(6),JSON.stringify({UserId}));
  449. this.balance = tofixed2(res.data.BalanceAmount);
  450. this.LeaderReserve = tofixed2(res.data.LeaderReserve);
  451. },
  452. giveToast(str){
  453. vant.Toast(str);
  454. },
  455. copyCode(){
  456. clipboard = new ClipboardJS(this.$refs.copy);
  457. const that = this;
  458. this.$nextTick(() => {
  459. clipboard.on('success', function(e) {
  460. that.giveToast('复制成功');
  461. });
  462. clipboard.on('error', function(e) {
  463. that.giveToast('复制失败,请手动选择复制!');
  464. });
  465. });
  466. },
  467. async onClickButton() {
  468. if(this.typeResult === 2){
  469. const UserId = PublicLib.getCookieInfo('userId');
  470. const OrderId = PublicLib.getCookieInfo('mallorderId');
  471. const res = await postRequest('api/v1/orders/payreserve?t='+Math.random(6),JSON.stringify({UserId,OrderId,OpMode:2,Times:this.unchoosefractional}));
  472. if(res.status !== '1'){
  473. tips(res.info)
  474. }else{
  475. const Id = PublicLib.getCookieInfo('mallorderId');
  476. this.getsonorder(Id);
  477. };
  478. }else{
  479. this.payTypePop = true;
  480. };
  481. },
  482. //- 子订单支付
  483. async paysonfn(){
  484. const UserId = PublicLib.getCookieInfo('userId');
  485. const res = await postRequest('api/v1/orders/pay?t='+Math.random(6),JSON.stringify({UserId,PayMode:this.radio,Id:this.sonorderid}));
  486. if(res.status !== '1')return tips(res.info)
  487. //- if(this.radio === 2) {
  488. //- PublicLib.RequestWechatPay({
  489. //- OrderInfo: res.data.PayData,
  490. //- SuccessUrl:'mall-deal-detail-finished',
  491. //- FailUrl:'mall-deal-detail-finished'
  492. //- });
  493. //- this.flag = false;
  494. //- }else
  495. if(this.radio === 1) {
  496. PublicLib.RequestAlipay({
  497. OrderInfo: res.data.PayData,
  498. SuccessUrl:'mall-deal-detail',
  499. FailUrl:'mall-deal-detail'
  500. });
  501. this.flag = false;
  502. } else if(this.radio === 3){
  503. tips('支付成功!');
  504. setTimeout(()=>{
  505. this.pwdPop = false;
  506. this.getorderinfo();
  507. },2000)
  508. }else if(this.radio === 4){
  509. tips('支付成功!');
  510. setTimeout(()=>{
  511. this.pwdPop = false;
  512. this.getorderinfo();
  513. },2000)
  514. }
  515. },
  516. //- 订单支付
  517. async payfn(){
  518. const Id = PublicLib.getCookieInfo('mallorderId');
  519. const UserId = PublicLib.getCookieInfo('userId');
  520. const res = await postRequest('api/v1/orders/pay?t='+Math.random(6),JSON.stringify({UserId,PayMode:this.radio,Id}));
  521. if(res.status !== '1')return tips(res.info)
  522. //- if(this.radio === 2) {
  523. //- PublicLib.RequestWechatPay({
  524. //- OrderInfo: res.data.PayData,
  525. //- SuccessUrl:'mall-deal-detail-finished',
  526. //- FailUrl:'mall-deal-detail-finished'
  527. //- });
  528. //- this.flag = false;
  529. //- }else
  530. if(this.radio === 1) {
  531. PublicLib.RequestAlipay({
  532. OrderInfo: res.data.PayData,
  533. SuccessUrl:'mall-deal-detail',
  534. FailUrl:'mall-deal-detail'
  535. });
  536. this.flag = false;
  537. } else if(this.radio === 3){
  538. tips('支付成功!');
  539. setTimeout(()=>{
  540. this.pwdPop = false;
  541. this.getorderinfo();
  542. },2000)
  543. }else if(this.radio === 4){
  544. tips('支付成功!');
  545. setTimeout(()=>{
  546. this.pwdPop = false;
  547. this.getorderinfo();
  548. },2000)
  549. }
  550. },
  551. //- 点击确认支付
  552. async gotoInputPwd() {
  553. this.isson = false;
  554. if(Number(this.orderinfo.TotalPrice)>Number(this.balance) && this.radio === 3){ return tips('余额不足,请更换付款方式')};
  555. if(Number(this.orderinfo.TotalPrice)>Number(this.LeaderReserve) && this.radio === 4){ return tips('余额不足,请更换付款方式')};
  556. this.paydata = '';
  557. this.payTypePop = false;
  558. let Id,res;
  559. switch(this.radio){
  560. case 3:
  561. Id = PublicLib.getCookieInfo('userId');
  562. res = await getRequest('api/v1/users/existpaypwd?t='+Math.random(6),JSON.stringify({Id}));
  563. if(res.status !== '1') return PublicLib.Goto({Url:'user-setpaypwd-1'});
  564. this.pwdPop = true;
  565. break;
  566. case 1:
  567. this.payfn();
  568. break;
  569. case 2:
  570. //- this.payfn();
  571. break;
  572. case 4:
  573. Id = PublicLib.getCookieInfo('userId');
  574. res = await getRequest('api/v1/users/existpaypwd?t='+Math.random(6),JSON.stringify({Id}));
  575. if(res.status !== '1') return PublicLib.Goto({Url:'user-setpaypwd-1'});
  576. this.pwdPop = true;
  577. break;
  578. };
  579. },
  580. //- 点击子订单确认支付
  581. async gotosonInputPwd() {
  582. this.isson = true;
  583. if(Number(this.sonorderprice)>Number(this.balance) && this.radio === 3){ return tips('余额不足,请更换付款方式')};
  584. if(Number(this.sonorderprice)>Number(this.LeaderReserve) && this.radio === 4){ return tips('余额不足,请更换付款方式')};
  585. this.paydata = '';
  586. this.paysonTypePop = false;
  587. let Id,res;
  588. switch(this.radio){
  589. case 3:
  590. Id = PublicLib.getCookieInfo('userId');
  591. res = await getRequest('api/v1/users/existpaypwd?t='+Math.random(6),JSON.stringify({Id}));
  592. if(res.status !== '1') return PublicLib.Goto({Url:'user-setpaypwd-1'});
  593. this.pwdPop = true;
  594. break;
  595. case 1:
  596. this.paysonfn();
  597. break;
  598. case 2:
  599. //- this.payfn();
  600. break;
  601. case 4:
  602. Id = PublicLib.getCookieInfo('userId');
  603. res = await getRequest('api/v1/users/existpaypwd?t='+Math.random(6),JSON.stringify({Id}));
  604. if(res.status !== '1') return PublicLib.Goto({Url:'user-setpaypwd-1'});
  605. this.pwdPop = true;
  606. break;
  607. };
  608. },
  609. onKeyboardHide(){
  610. this.value = '';
  611. },
  612. //- 获取用户个人信息
  613. async getuserinfo(){
  614. const userId = PublicLib.getCookieInfo('userId');
  615. const res = await getRequest('api/v1/users/personalinfo?t='+Math.random(6),JSON.stringify({Id:userId}));
  616. if(res.status === '1') {
  617. this.LeaderLevel = res.data.LeaderLevel;
  618. if(res.data.LeaderLevel === 0){
  619. this.radio = 1;
  620. };
  621. };
  622. },
  623. //- 拨打电话
  624. takephone(phonenum){
  625. PublicLib.PhoneCall(phonenum);
  626. },
  627. goback(){
  628. if(this.flag){
  629. PublicLib.GoBack({Level:1});
  630. }else{
  631. PublicLib.GoBack({Level:2});
  632. }
  633. }
  634. }
  635. });
  636. </script>
  637. </body>
  638. </html>