index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779
  1. <template>
  2. <view class="page" >
  3. <view class="state ">
  4. <view class="flex-row justify-center">
  5. <u-icon name="cut" color="#93D21A" size="18"></u-icon>
  6. <text>{{order.orderStatusDesc}}</text>
  7. </view>
  8. <view class="box_4 flex-row justify-center">
  9. <text>{{order.orderDesc}}</text>
  10. </view>
  11. </view>
  12. <view class="detail">
  13. <view :class="order.serviceAttribute == 1? 'serviceAttrDesc':'serviceAttrDesc1'">
  14. <text>{{order.serviceAttrDesc}}</text>
  15. </view>
  16. <view class="flex-row justify-start">
  17. <u-icon name="/static/index/u217.png" color="#93D21A" size="18"></u-icon>
  18. <text class="key">订单编号:</text>
  19. <text class="value">{{order.orderNo}}</text>
  20. </view>
  21. <!-- <view>-->
  22. <!-- <text class="serviceType">{{order.serviceType}}</text>-->
  23. <!-- </view>-->
  24. <view class="flex-row justify-between jishi">
  25. <view class="flex-col ">
  26. <view class=" flex-row">
  27. <u-icon name="/static/order/ud1.png" color="#93D21A" size="18"></u-icon>
  28. <text class="key">服务对象:</text>
  29. <text class="value">{{order.serviceObjectName || ''}}</text>
  30. </view>
  31. <view class="flex-row">
  32. <u-icon name="/static/order/ud2.png" color="#93D21A" size="18"></u-icon>
  33. <text class="key">服务门店:</text>
  34. <text class="value">{{order.storeName}}</text>
  35. </view>
  36. <view class="flex-row">
  37. <u-icon name="clock" size="16"></u-icon>
  38. <text class="key">下单时间:</text>
  39. <text class="value">{{order.createTime}}</text>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="flex-row justify-between yuyue " v-if="order.serviceAttribute == 2">
  44. <view class="flex-col justify-center ">
  45. <view class=" flex-row">
  46. <u-icon name="clock" size="16"></u-icon>
  47. <text class="key">服务日期:</text>
  48. <text class="value">{{order.serviceDate}}</text>
  49. </view>
  50. <view class="flex-row">
  51. <u-icon name="/static/order/ud2.png" color="#93D21A" size="18"></u-icon>
  52. <text class="key">服务时段:</text>
  53. <text class="value">{{order.serviceStartTime}}</text>
  54. </view>
  55. <view class="flex-row">
  56. <u-icon name="/static/order/ud3.png" color="#93D21A" size="18"></u-icon>
  57. <text class="key">服务人员:</text>
  58. <text class="value">{{order.servicePersonName}}</text>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="flex-row justify-center" v-if="order.canScanCode">
  63. <view class="scan flex-row justify-center" @click="scanCodeOrder(order)">
  64. <u-icon name="scan" size="18"></u-icon>
  65. <text>扫码</text>
  66. </view>
  67. </view>
  68. <view class="line"></view>
  69. <view class="flex-row justify-between borderBottom" v-for="(item,index) in order.child" :key="index">
  70. <!-- <view class="flex-col justify-center" v-if="order.orderStatus != 3">-->
  71. <!-- <u-icon v-if="item.tick" name="checkmark-circle-fill" color="#38db38" size="20" @click="tick(item,index)"></u-icon>-->
  72. <!-- <u-icon v-else name="/static/order/ud9.png" color="green" size="20" @click="tick(item,index)"></u-icon>-->
  73. <!-- </view>-->
  74. <view class="flex-col right">
  75. <view class="flex-row justify-between">
  76. <text class="serviceType">{{item.serviceName}}</text>
  77. <text class="projectState">{{item.statusDesc}}</text>
  78. </view>
  79. <view class="flex-row justify-between">
  80. <view class="flex-col justify-around">
  81. <view class="flex-row">
  82. <u-icon name="server-man" size="16"></u-icon>
  83. <text class="key">服务人员:</text>
  84. <text class="value">{{item.servicePerson || ''}}</text>
  85. </view>
  86. <view class="flex-row">
  87. <u-icon name="clock" size="16"></u-icon>
  88. <text class="key">服务时间:</text>
  89. <text class="value">{{item.serviceTime || ''}}</text>
  90. </view>
  91. <view class="flex-row" v-if="item.discountAmount > 0">
  92. <u-icon name="red-packet" size="16"></u-icon>
  93. <text class="key">服务金额:</text>
  94. <text class="projectMoney">¥{{item.payAmount}}</text>
  95. <text class="lineMoney">¥{{item.servicePrice}}</text>
  96. </view>
  97. <view class="flex-row" v-else>
  98. <u-icon name="red-packet" size="16"></u-icon>
  99. <text class="key">服务金额:</text>
  100. <text class="projectMoney">¥{{item.servicePrice}}</text>
  101. </view>
  102. </view>
  103. <view class="flex-col justify-around">
  104. <view class="flex-col justify-center " v-if="item.planNumber">
  105. <view class="planNumber flex-row justify-center">
  106. <text>{{item.planNumber}}</text>
  107. </view>
  108. <view class="plan flex-row justify-center">
  109. <text class="plan">排号</text>
  110. </view>
  111. <!-- <view class="plan flex-row justify-center" v-if="order.serviceAttribute == 2">-->
  112. <!-- <text class="plan">预约号</text>-->
  113. <!-- </view>-->
  114. </view>
  115. <view class="flex-row justify-center" v-if="item.status === 8 || item.status === 1" @click="appeal(item.orderServiceId)">
  116. <u-icon name="/static/order/ud17.png" color="#93D21A" size="14"></u-icon>
  117. <text class="ss_key">申诉</text>
  118. </view>
  119. </view>
  120. </view>
  121. <view class="flex-row justify-between key" v-if="item.status == 1 || item.status == 6">
  122. <view class="flex-row">
  123. <u-icon size="16" name="coupon"></u-icon>
  124. <text>优惠选择:</text>
  125. </view>
  126. <view class="flex-row justify-between value flex1" style="height: 100%" @click="openCoupon(item,index)">
  127. <text v-if="item.suggestType == 0">选择优惠券或权益卡</text>
  128. <text v-if="item.suggestType == 1">{{ item.suggestCoupon.name }} {{ item.suggestType }}</text>
  129. <text v-if="item.suggestType == 2">{{ item.suggestEquityCard.name }} {{ item.suggestType }}</text>
  130. <u-icon size="12" name="arrow-right"></u-icon>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. </view>
  136. <view class="bottomHeight"></view>
  137. <view class="bottom1 flex-col" v-if="order.canPay ">
  138. <text class="allMoney"></text>
  139. <view class="bottomBtn flex-row justify-between">
  140. <view class=" flex-row">
  141. <text class="unpaid">合计</text>
  142. <text class="preferentialPrice">¥{{order.payAmount}}</text>
  143. <!-- <text class="unpaid">已优惠</text>-->
  144. <!-- <text class="originalPrice">¥{{totalDiscount}}</text>-->
  145. <!-- <text class="priceDetail">价格明细</text>-->
  146. </view>
  147. <view class="btn" @click="qenPayInfo">
  148. <text class="text_33">一键付款</text>
  149. </view>
  150. <!-- <view v-else class="btn" @click="orderFinish">-->
  151. <!-- <text class="text_33">结束订单</text>-->
  152. <!-- </view>-->
  153. </view>
  154. </view>
  155. <uni-popup ref="appealPopup" :animation="false" :catchtouchmove="true">
  156. <view class="appealView flex-col justify-around">
  157. <view class="popupTitle">
  158. <text>请输入申诉理由</text>
  159. </view>
  160. <view class="lex-row justify-center">
  161. <textarea class="textarea" v-model="appealReason" placeholder="请输入申诉理由"></textarea>
  162. </view>
  163. <view class="flex-row justify-around">
  164. <view class="leftBtn" @click="appealPopupClose">
  165. <text>取消</text>
  166. </view>
  167. <view class="rightBtn" @click="commitAppeal">
  168. <text>确定</text>
  169. </view>
  170. </view>
  171. </view>
  172. </uni-popup>
  173. <uni-popup ref="popup" :catchtouchmove="true" :animation="false" type="bottom">
  174. <view class="payView">
  175. <view class="flex-row justify-between">
  176. <text class="payType">请选择支付方式</text>
  177. <image class="x" src="/static/common/ox.png" @click="closePayPopup"></image>
  178. </view>
  179. <!-- <view class="payTitle">-->
  180. <!-- <text>选择微信支付或余额支付</text>-->
  181. <!-- </view>-->
  182. <view v-if="loveCardList.length>0" class="payItem flex-row" >
  183. <u-icon name="/static/me/familyCard_icon.png" color="#38db38" size="36"></u-icon>
  184. <view class="payName flex-col justify-center flex-grow">
  185. <text>亲情卡支付</text>
  186. <scroll-view scroll-y class="loveCard" :show-scrollbar="true">
  187. <view class="flex-row justify-between loveCardItem " v-for="(item,index) in loveCardList" :key="index" @click="payLoveItem(0,index,item)">
  188. <view class="select flex-col" >
  189. <text>{{item.presentUserName}}({{item.relation}})</text>
  190. <!-- <text class="balance">本月剩余额度:{{item.totalBalance}}</text>-->
  191. </view>
  192. <view class="flex-col justify-center">
  193. <u-icon v-if="curServiceTab === 0 && item.select" name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
  194. <u-icon v-else name="/static/order/ud9.png" color="green" size="25"></u-icon>
  195. </view>
  196. </view>
  197. </scroll-view>
  198. </view>
  199. </view>
  200. <view class="payItem flex-row justify-between" @click="payItem(1)">
  201. <view class="flex-row">
  202. <u-icon name="/static/me/u701.png" color="#38db38" size="36"></u-icon>
  203. <view class="payName flex-col justify-center">
  204. <text>余额支付</text>
  205. <text class="balance">可用余额{{userInfo.balance || 0}}</text>
  206. </view>
  207. </view>
  208. <view class="flex-col justify-center">
  209. <view v-if="curServiceTab === 1" >
  210. <u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
  211. </view>
  212. <view v-else>
  213. <u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
  214. </view>
  215. </view>
  216. </view>
  217. <view class="payItem flex-row justify-between" @click="payItem(2)">
  218. <view class="flex-row">
  219. <u-icon name="weixin-circle-fill" color="#38db38" size="36"></u-icon>
  220. <view class="payName flex-col justify-center">
  221. <text>微信支付</text>
  222. </view>
  223. </view>
  224. <view class="flex-col justify-center">
  225. <view v-if="curServiceTab === 2" >
  226. <u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
  227. </view>
  228. <view v-else>
  229. <u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
  230. </view>
  231. </view>
  232. </view>
  233. <view class="commitBtn" @click="commonGeneralOrder">
  234. <text>确定</text>
  235. </view>
  236. </view>
  237. </uni-popup>
  238. <uni-popup ref="passwordPopup">
  239. <view class="passwordView flex-col">
  240. <view class="flex-row justify-center">
  241. <text>请输入交易密码</text>
  242. </view>
  243. <view class="h-tab-bar flex-row justify-center">
  244. <u-code-input v-model="password" mode="box" dot></u-code-input>
  245. </view>
  246. <view class="flex-row justify-center">
  247. <view class="h-operate-btn flex-row justify-center" @click="balancePay">
  248. <text>确定</text>
  249. </view>
  250. </view>
  251. </view>
  252. </uni-popup>
  253. <uni-popup ref="couponPopup" :catchtouchmove="true" :animation="false" type="bottom">
  254. <view class="couponView flex-col">
  255. <view class="flex-row justify-center">
  256. <text>优惠选择</text>
  257. </view>
  258. <view style="height: 700rpx;overflow: auto" >
  259. <view class="flex-row justify-between coupon1">
  260. <view class="flex-row justify-start">
  261. <view class="flex-col justify-center icon1">
  262. <text>0</text>
  263. </view>
  264. <view class="flex-col justify-center couponName">
  265. <text>不选择优惠</text>
  266. </view>
  267. </view>
  268. <view class="flex-col justify-center " >
  269. <text class="couponBtn" @click="use(item,0)">选择</text>
  270. </view>
  271. </view>
  272. <view class="flex-row justify-center" style="margin-top: 30rpx" v-if="availableCouponList.length > 0">
  273. <view class="flex-col justify-center flex1">
  274. <view class="couponLine"></view>
  275. </view>
  276. <text class="couponType">优惠券</text>
  277. <view class="flex-col justify-center flex1">
  278. <view class="couponLine"></view>
  279. </view>
  280. </view>
  281. <view class="flex-row justify-between coupon2" v-for="(item,index) in availableCouponList" :key="index">
  282. <view class="flex-row justify-start">
  283. <view class="flex-col justify-center icon2">
  284. <text>{{item.discountsPrice}}</text>
  285. </view>
  286. <view class="flex-col justify-center">
  287. <view class="flex-col justify-center couponName">
  288. <text>{{item.name}}</text>
  289. </view>
  290. <view class="flex-col justify-center couponValue">
  291. <text>使用项目:{{item.useServiceDesc}}</text>
  292. </view>
  293. <view class="flex-col justify-center couponValue">
  294. <text>使用金额:{{item.reachPrice}}</text>
  295. </view>
  296. </view>
  297. </view>
  298. <view class="flex-col justify-center" >
  299. <text class="couponBtn" @click="use(item,1)">立即使用</text>
  300. </view>
  301. </view>
  302. <view class="flex-row justify-center" style="margin-top: 30rpx" v-if="availableEquityCardList.length > 0">
  303. <view class="flex-col justify-center flex1">
  304. <view class="couponLine"></view>
  305. </view>
  306. <text class="couponType">权益卡</text>
  307. <view class="flex-col justify-center flex1">
  308. <view class="couponLine"></view>
  309. </view>
  310. </view>
  311. <view class="flex-row justify-between coupon2" v-for="(item,index) in availableEquityCardList" :key="index">
  312. <view class="flex-row justify-start">
  313. <view class="flex-col justify-center icon2">
  314. <text>{{item.faceValue}}</text>
  315. </view>
  316. <view class="flex-col justify-center">
  317. <view class="flex-col justify-center couponName">
  318. <text>{{item.title}}</text>
  319. </view>
  320. <view class="flex-col justify-center couponValue">
  321. <text>使用项目:{{item.serviceProjectName}}</text>
  322. </view>
  323. </view>
  324. </view>
  325. <view class="flex-col justify-center" >
  326. <text class="couponBtn" @click="use(item,2)">立即使用</text>
  327. </view>
  328. </view>
  329. </view>
  330. </view>
  331. </uni-popup>
  332. </view>
  333. </template>
  334. <script>
  335. import UniPopup from "../../uni_modules/uni-popup/components/uni-popup/uni-popup";
  336. export default {
  337. components: {
  338. UniPopup
  339. },
  340. data() {
  341. return {
  342. title: 'Hello',
  343. tabIndex: 3,
  344. order:{},
  345. allPrice:0,
  346. totalDiscount:0,
  347. appealId:'',
  348. appealReason:'',
  349. orderId:'',
  350. curServiceTab:2,
  351. userInfo:{},
  352. tradeNo:'',
  353. password:'',
  354. requestStatus : false,
  355. loveCardId:'',
  356. loveCardList:[],
  357. availableCouponList:[],
  358. availableEquityCardList:[],
  359. availableChild:null,
  360. availableIndex:null
  361. }
  362. },
  363. onLoad(e) {
  364. this.orderId = e.id
  365. this.getUserInfo();
  366. },
  367. onShow(){
  368. this.getOrderDetailByOrderId(this.orderId )
  369. this.getMyReceiveList()
  370. },
  371. methods: {
  372. /**
  373. *
  374. * if (child.suggestCoupon){
  375. * child.suggestType = 1
  376. * }else if (child.suggestEquityCard){
  377. * child.suggestType = 2
  378. * }else {
  379. * child.suggestType = 0
  380. * }
  381. *
  382. **/
  383. use(item,suggestType){
  384. if (suggestType == 1){
  385. this.availableChild.suggestType = 1
  386. this.availableChild.suggestCoupon = item
  387. this.availableChild.discountAmount = item.discountsPrice
  388. this.availableChild.payAmount = this.availableChild.servicePrice - item.discountsPrice
  389. }else if (suggestType == 2){
  390. this.availableChild.suggestType = 2
  391. this.availableChild.suggestEquityCard = item
  392. this.availableChild.discountAmount = item.faceValue
  393. this.availableChild.payAmount = this.availableChild.servicePrice - item.faceValue
  394. }else {
  395. this.availableChild.suggestType = 0
  396. this.availableChild.suggestCoupon = []
  397. this.availableChild.suggestEquityCard = []
  398. this.availableChild.discountAmount = 0
  399. this.availableChild.payAmount = this.availableChild.servicePrice
  400. }
  401. this.$set(this.order.child,this.availableIndex,this.availableChild)
  402. let payAmount = 0 //计算订单总支付金额
  403. let discountAmount = 0 //计算订单总优惠金额
  404. for (const child of this.order.child) {
  405. if (child.status == 1){
  406. payAmount += child.payAmount - 0
  407. discountAmount += child.discountAmount - 0
  408. }
  409. }
  410. this.order.payAmount = payAmount
  411. this.order.discountAmount = discountAmount
  412. this.availableChild = null
  413. this.availableIndex = null
  414. this.availableCouponList = []
  415. this.availableEquityCardList = []
  416. this.$refs.couponPopup.close()
  417. },
  418. openCoupon(item,index){
  419. console.log(item)
  420. this.availableIndex = index
  421. this.availableChild = item
  422. this.availableCoupons(item)
  423. this.availableEquityCards(item)
  424. this.$refs.couponPopup.open()
  425. },
  426. availableEquityCards(item){
  427. this.$api.availableEquityCards({
  428. orderServiceId:item.orderServiceId
  429. }).then(res=>{
  430. this.availableEquityCardList = res.data.data
  431. })
  432. },
  433. availableCoupons(item){
  434. this.$api.availableCoupons({
  435. orderServiceId:item.orderServiceId
  436. }).then(res=>{
  437. this.availableCouponList = res.data.data
  438. })
  439. },
  440. getMyReceiveList(){
  441. this.$api.getMyReceiveList().then(res=>{
  442. this.loveCardList = res.data.data
  443. })
  444. },
  445. getUserInfo() {
  446. this.$api.getUserInfo().then(res => {
  447. this.userInfo = res.data.data
  448. uni.setStorageSync('userInfo', res.data.data);
  449. });
  450. },
  451. familyCardPay(){
  452. let that = this;
  453. this.$api.familyCardTradePay({
  454. tradeNo:this.tradeNo,
  455. loveCardId:this.loveCardId,
  456. storeId:this.order.storeId
  457. }).then(res=>{
  458. this.requestStatus=false
  459. uni.hideLoading();
  460. uni.showToast({
  461. title: '支付成功!'
  462. });
  463. that.getOrderDetailByOrderId(that.orderId)
  464. }).catch((err) =>{
  465. this.requestStatus=false
  466. uni.showToast({
  467. title: err.msg,
  468. icon:'error',
  469. duration:3000
  470. })
  471. });
  472. },
  473. balancePay(){
  474. let that = this;
  475. // if(this.password.length< 6 ){
  476. // uni.showToast({
  477. // title: "交易密码不能小于6位"
  478. // })
  479. // return ;
  480. // }
  481. // this.$refs.passwordPopup.close()
  482. this.$api.trade({
  483. tradeNo: this.tradeNo,
  484. password: ''
  485. }).then((res)=>{
  486. this.requestStatus=false
  487. uni.hideLoading();
  488. uni.showToast({
  489. title: '支付成功!'
  490. });
  491. that.getOrderDetailByOrderId(that.orderId)
  492. }).catch((err)=>{
  493. this.requestStatus=false
  494. uni.hideLoading();
  495. uni.showToast({
  496. title: err.msg,
  497. icon:'error'
  498. })
  499. })
  500. },
  501. scanCodeOrder(order){
  502. uni.scanCode({
  503. scanType: ['qrCode'],
  504. success: function (res) {
  505. let json = JSON.parse(res.result)
  506. if(json.storeId != order.storeId){
  507. uni.showToast({
  508. icon: 'error',
  509. duration: 3000,
  510. title: '请扫描订单门店二维码'
  511. });
  512. return
  513. }
  514. uni.navigateTo({
  515. url:'/orderPages/serviceItems/index?serviceStationId='+ json.stationId + '&orderId='+order.orderId + '&serviceObjectId=' + order.serviceObjectId
  516. })
  517. }
  518. })
  519. },
  520. commonGeneralOrder(){
  521. if(this.requestStatus){
  522. return;
  523. }
  524. this.requestStatus=true
  525. uni.showLoading({
  526. title: '支付中'
  527. });
  528. this.$refs.popup.close()
  529. let that =this
  530. if (this.curServiceTab===0){
  531. this.familyCardPay()
  532. }
  533. if (this.curServiceTab===1){
  534. // that.password = '';
  535. // this.$refs.popup.close()
  536. // this.$refs.passwordPopup.open()
  537. this.balancePay()
  538. }
  539. if (this.curServiceTab===2){
  540. this.$api.wechatPayTradeNo({tradeNo:this.tradeNo}).then(res=>{
  541. var param = res.data.data;
  542. uni.requestPayment({
  543. appId: param.appid,
  544. timeStamp: param.timestamp+"",
  545. nonceStr: param.noncestr,
  546. package: "prepay_id="+param.prepayid,
  547. signType: "RSA",
  548. paySign: param.sign,
  549. success: res => {
  550. this.requestStatus=false
  551. uni.hideLoading();
  552. uni.showToast({
  553. title: '支付成功!'
  554. });
  555. that.getOrderDetailByOrderId(that.orderId)
  556. },
  557. fail: res => {
  558. this.requestStatus=false
  559. uni.hideLoading();
  560. uni.showModal({
  561. content: '支付失败',
  562. showCancel: false
  563. });
  564. }
  565. });
  566. })
  567. }
  568. },
  569. orderFinish(){
  570. this.$api.orderFinish(this.order.orderNo).then((res)=>{
  571. uni.$u.toast('操作成功')
  572. this.getOrderDetailByOrderId(this.order.orderId)
  573. })
  574. },
  575. qenPayInfo(){
  576. //
  577. // for(let i=0;i<this.order.child.length;i++){
  578. // if (this.order.child[i].status==3){
  579. // uni.$u.toast('子订单未审核结束')
  580. // return
  581. // }
  582. // }
  583. // let orderServiceIds = []
  584. // this.order.child.forEach(i=>{
  585. // if (i.status !=5){ //排除审核通过的子订单
  586. // orderServiceIds.push(i.orderServiceId)
  587. // }
  588. // })
  589. this.$api.oneClickPay({
  590. orderId:this.order.orderId
  591. }).then(res=>{
  592. this.tradeNo = res.data.data.tradeNo
  593. this.$refs.popup.open()
  594. })
  595. // this.$api.qenPayInfo({
  596. // orderServiceIds:orderServiceIds,
  597. // orderNo:this.order.orderNo
  598. // }).then(res=>{
  599. // this.tradeNo=res.data.data.tradeNo
  600. // this.$refs.popup.open()
  601. // })
  602. },
  603. commitAppeal(){
  604. this.$api.appeal({
  605. childOrderId:this.appealId,
  606. appealReason:this.appealReason
  607. }).then(res=>{
  608. this.appealReason=''
  609. uni.$u.toast('申诉已提交')
  610. this.$refs.appealPopup.close()
  611. this.getOrderDetailByOrderId(this.orderId)
  612. })
  613. },
  614. appealPopupClose(){
  615. this.appealReason=''
  616. this.$refs.appealPopup.close()
  617. },
  618. appeal(id){
  619. this.appealId = id
  620. this.$refs.appealPopup.open()
  621. },
  622. // 原来的计算价格逻辑 选择的时候计算
  623. // tick(item,index){
  624. //
  625. // if (item.status === 1 || item.status === 4){
  626. // this.allPrice = 0
  627. // this.totalDiscount = 0;
  628. // item.tick = !item.tick
  629. // this.$set(this.order.child,index,item)
  630. // this.order.child.forEach(i=>{
  631. // if (i.tick){
  632. // this.totalDiscount += i.discountAmount * 1;
  633. // this.allPrice += i.payAmount *1;
  634. // }
  635. // })
  636. // this.allPrice = this.allPrice.toFixed(2)
  637. // this.totalDiscount = this.totalDiscount.toFixed(2)
  638. // }
  639. // },
  640. //新的价格计算逻辑 订单加载或刷新的时候计算
  641. calculatePrice(){
  642. this.allPrice = 0
  643. this.totalDiscount = 0;
  644. this.order.child.forEach(i=>{
  645. if (i.status !=5){ //不在申诉的子订单
  646. this.totalDiscount += i.discountAmount * 1;
  647. this.allPrice += i.payAmount *1;
  648. }
  649. })
  650. this.allPrice = this.allPrice.toFixed(2)
  651. this.totalDiscount = this.totalDiscount.toFixed(2)
  652. },
  653. getOrderDetailByOrderId(id){
  654. this.$api.getOrderDetailByOrderId({
  655. id:id
  656. }).then(res=>{
  657. for (const child of res.data.data.child) {
  658. if (child.suggestCoupon){
  659. child.suggestType = 1
  660. }else if (child.suggestEquityCard){
  661. child.suggestType = 2
  662. }else {
  663. child.suggestType = 0
  664. }
  665. }
  666. this.order= res.data.data
  667. // this.calculatePrice()
  668. })
  669. },
  670. payLoveItem(num,index,loveCard){
  671. // if (loveCard.totalBalance*1 < this.order.payAmount*1 && num == 0){
  672. // uni.$u.toast('余额不足')
  673. // return
  674. // }
  675. this.curServiceTab = num
  676. this.loveCardList.forEach(item=>{
  677. item.select = false
  678. })
  679. loveCard.select=true
  680. this.loveCardId = loveCard.id
  681. this.$set(this.loveCardList,index,loveCard)
  682. },
  683. payItem(num){
  684. if (this.userInfo.balance*1 < this.order.payAmount*1 && num == 1){
  685. uni.$u.toast('余额不足')
  686. return
  687. }
  688. this.curServiceTab = num
  689. },
  690. closePayPopup(){
  691. this.$refs.popup.close()
  692. },
  693. }
  694. }
  695. </script>
  696. <style>
  697. @import '/common/css/common.css';
  698. @import './index.rpx.scss';
  699. </style>