index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  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 == 8">
  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. use(item,suggestType){
  373. if (suggestType == 1){
  374. this.availableChild.suggestType = 1
  375. this.availableChild.suggestCoupon = item
  376. this.availableChild.discountAmount = item.discountsPrice
  377. this.availableChild.payAmount = this.availableChild.servicePrice - item.discountsPrice
  378. }else if (suggestType == 2){
  379. this.availableChild.suggestType = 2
  380. this.availableChild.suggestEquityCard = item
  381. this.availableChild.discountAmount = item.faceValue
  382. this.availableChild.payAmount = this.availableChild.servicePrice - item.faceValue
  383. }else {
  384. this.availableChild.suggestType = 0
  385. this.availableChild.suggestCoupon = []
  386. this.availableChild.suggestEquityCard = []
  387. this.availableChild.discountAmount = 0
  388. this.availableChild.payAmount = this.availableChild.servicePrice
  389. }
  390. this.$set(this.order.child,this.availableIndex,this.availableChild)
  391. let payAmount = 0 //计算订单总支付金额
  392. let discountAmount = 0 //计算订单总优惠金额
  393. for (const child of this.order.child) {
  394. if (child.status == 1){
  395. payAmount += child.payAmount - 0
  396. discountAmount += child.discountAmount - 0
  397. }
  398. }
  399. this.order.payAmount = payAmount
  400. this.order.discountAmount = discountAmount
  401. this.availableChild = null
  402. this.availableIndex = null
  403. this.availableCouponList = []
  404. this.availableEquityCardList = []
  405. this.$refs.couponPopup.close()
  406. },
  407. openCoupon(item,index){
  408. console.log(item)
  409. this.availableIndex = index
  410. this.availableChild = item
  411. this.availableCoupons(item)
  412. this.availableEquityCards(item)
  413. this.$refs.couponPopup.open()
  414. },
  415. availableEquityCards(item){
  416. this.$api.availableEquityCards({
  417. orderServiceId:item.orderServiceId
  418. }).then(res=>{
  419. this.availableEquityCardList = res.data.data
  420. })
  421. },
  422. availableCoupons(item){
  423. this.$api.availableCoupons({
  424. orderServiceId:item.orderServiceId
  425. }).then(res=>{
  426. this.availableCouponList = res.data.data
  427. })
  428. },
  429. getMyReceiveList(){
  430. this.$api.getMyReceiveList().then(res=>{
  431. this.loveCardList = res.data.data
  432. })
  433. },
  434. getUserInfo() {
  435. this.$api.getUserInfo().then(res => {
  436. this.userInfo = res.data.data
  437. uni.setStorageSync('userInfo', res.data.data);
  438. });
  439. },
  440. familyCardPay(){
  441. let that = this;
  442. this.$api.familyCardTradePay({
  443. tradeNo:this.tradeNo,
  444. loveCardId:this.loveCardId,
  445. storeId:this.order.storeId
  446. }).then(res=>{
  447. this.requestStatus=false
  448. uni.hideLoading();
  449. uni.showToast({
  450. title: '支付成功!'
  451. });
  452. that.getOrderDetailByOrderId(that.orderId)
  453. }).catch((err) =>{
  454. this.requestStatus=false
  455. uni.showToast({
  456. title: err.msg,
  457. icon:'error',
  458. duration:3000
  459. })
  460. });
  461. },
  462. balancePay(){
  463. let that = this;
  464. // if(this.password.length< 6 ){
  465. // uni.showToast({
  466. // title: "交易密码不能小于6位"
  467. // })
  468. // return ;
  469. // }
  470. // this.$refs.passwordPopup.close()
  471. this.$api.trade({
  472. tradeNo: this.tradeNo,
  473. password: ''
  474. }).then((res)=>{
  475. this.requestStatus=false
  476. uni.hideLoading();
  477. uni.showToast({
  478. title: '支付成功!'
  479. });
  480. that.getOrderDetailByOrderId(that.orderId)
  481. }).catch((err)=>{
  482. this.requestStatus=false
  483. uni.hideLoading();
  484. uni.showToast({
  485. title: err.msg,
  486. icon:'error'
  487. })
  488. })
  489. },
  490. scanCodeOrder(order){
  491. uni.scanCode({
  492. scanType: ['qrCode'],
  493. success: function (res) {
  494. let json = JSON.parse(res.result)
  495. if(json.storeId != order.storeId){
  496. uni.showToast({
  497. icon: 'error',
  498. duration: 3000,
  499. title: '请扫描订单门店二维码'
  500. });
  501. return
  502. }
  503. uni.navigateTo({
  504. url:'/orderPages/serviceItems/index?serviceStationId='+ json.stationId + '&orderId='+order.orderId + '&serviceObjectId=' + order.serviceObjectId
  505. })
  506. }
  507. })
  508. },
  509. commonGeneralOrder(){
  510. if(this.requestStatus){
  511. return;
  512. }
  513. this.requestStatus=true
  514. uni.showLoading({
  515. title: '支付中'
  516. });
  517. this.$refs.popup.close()
  518. let that =this
  519. if (this.curServiceTab===0){
  520. this.familyCardPay()
  521. }
  522. if (this.curServiceTab===1){
  523. // that.password = '';
  524. // this.$refs.popup.close()
  525. // this.$refs.passwordPopup.open()
  526. this.balancePay()
  527. }
  528. if (this.curServiceTab===2){
  529. this.$api.wechatPayTradeNo({tradeNo:this.tradeNo}).then(res=>{
  530. var param = res.data.data;
  531. uni.requestPayment({
  532. appId: param.appid,
  533. timeStamp: param.timestamp+"",
  534. nonceStr: param.noncestr,
  535. package: "prepay_id="+param.prepayid,
  536. signType: "RSA",
  537. paySign: param.sign,
  538. success: res => {
  539. this.requestStatus=false
  540. uni.hideLoading();
  541. uni.showToast({
  542. title: '支付成功!'
  543. });
  544. that.getOrderDetailByOrderId(that.orderId)
  545. },
  546. fail: res => {
  547. this.requestStatus=false
  548. uni.hideLoading();
  549. uni.showModal({
  550. content: '支付失败',
  551. showCancel: false
  552. });
  553. }
  554. });
  555. })
  556. }
  557. },
  558. orderFinish(){
  559. this.$api.orderFinish(this.order.orderNo).then((res)=>{
  560. uni.$u.toast('操作成功')
  561. this.getOrderDetailByOrderId(this.order.orderId)
  562. })
  563. },
  564. qenPayInfo(){
  565. //
  566. // for(let i=0;i<this.order.child.length;i++){
  567. // if (this.order.child[i].status==3){
  568. // uni.$u.toast('子订单未审核结束')
  569. // return
  570. // }
  571. // }
  572. // let orderServiceIds = []
  573. // this.order.child.forEach(i=>{
  574. // if (i.status !=5){ //排除审核通过的子订单
  575. // orderServiceIds.push(i.orderServiceId)
  576. // }
  577. // })
  578. this.$api.oneClickPay({
  579. orderId:this.order.orderId
  580. }).then(res=>{
  581. this.tradeNo = res.data.data.tradeNo
  582. this.$refs.popup.open()
  583. })
  584. // this.$api.qenPayInfo({
  585. // orderServiceIds:orderServiceIds,
  586. // orderNo:this.order.orderNo
  587. // }).then(res=>{
  588. // this.tradeNo=res.data.data.tradeNo
  589. // this.$refs.popup.open()
  590. // })
  591. },
  592. commitAppeal(){
  593. this.$api.appeal({
  594. childOrderId:this.appealId,
  595. appealReason:this.appealReason
  596. }).then(res=>{
  597. this.appealReason=''
  598. uni.$u.toast('申诉已提交')
  599. this.$refs.appealPopup.close()
  600. this.getOrderDetailByOrderId(this.orderId)
  601. })
  602. },
  603. appealPopupClose(){
  604. this.appealReason=''
  605. this.$refs.appealPopup.close()
  606. },
  607. appeal(id){
  608. this.appealId = id
  609. this.$refs.appealPopup.open()
  610. },
  611. // 原来的计算价格逻辑 选择的时候计算
  612. // tick(item,index){
  613. //
  614. // if (item.status === 1 || item.status === 4){
  615. // this.allPrice = 0
  616. // this.totalDiscount = 0;
  617. // item.tick = !item.tick
  618. // this.$set(this.order.child,index,item)
  619. // this.order.child.forEach(i=>{
  620. // if (i.tick){
  621. // this.totalDiscount += i.discountAmount * 1;
  622. // this.allPrice += i.payAmount *1;
  623. // }
  624. // })
  625. // this.allPrice = this.allPrice.toFixed(2)
  626. // this.totalDiscount = this.totalDiscount.toFixed(2)
  627. // }
  628. // },
  629. //新的价格计算逻辑 订单加载或刷新的时候计算
  630. calculatePrice(){
  631. this.allPrice = 0
  632. this.totalDiscount = 0;
  633. this.order.child.forEach(i=>{
  634. if (i.status !=5){ //不在申诉的子订单
  635. this.totalDiscount += i.discountAmount * 1;
  636. this.allPrice += i.payAmount *1;
  637. }
  638. })
  639. this.allPrice = this.allPrice.toFixed(2)
  640. this.totalDiscount = this.totalDiscount.toFixed(2)
  641. },
  642. getOrderDetailByOrderId(id){
  643. this.$api.getOrderDetailByOrderId({
  644. id:id
  645. }).then(res=>{
  646. for (const child of res.data.data.child) {
  647. if (child.suggestCoupon){
  648. child.suggestType = 1
  649. }else if (child.suggestEquityCard){
  650. child.suggestType = 2
  651. }else {
  652. child.suggestType = 0
  653. }
  654. }
  655. this.order= res.data.data
  656. // this.calculatePrice()
  657. })
  658. },
  659. payLoveItem(num,index,loveCard){
  660. // if (loveCard.totalBalance*1 < this.order.payAmount*1 && num == 0){
  661. // uni.$u.toast('余额不足')
  662. // return
  663. // }
  664. this.curServiceTab = num
  665. this.loveCardList.forEach(item=>{
  666. item.select = false
  667. })
  668. loveCard.select=true
  669. this.loveCardId = loveCard.id
  670. this.$set(this.loveCardList,index,loveCard)
  671. },
  672. payItem(num){
  673. if (this.userInfo.balance*1 < this.order.payAmount*1 && num == 1){
  674. uni.$u.toast('余额不足')
  675. return
  676. }
  677. this.curServiceTab = num
  678. },
  679. closePayPopup(){
  680. this.$refs.popup.close()
  681. },
  682. }
  683. }
  684. </script>
  685. <style>
  686. @import '/common/css/common.css';
  687. @import './index.rpx.scss';
  688. </style>