order-club-details.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. <template>
  2. <view class="container details clearfix" :style="{ paddingBottom: isIphoneX ? 130 + 68 + 'rpx' : '130rpx' }">
  3. <!-- 自定义返回 -->
  4. <header-back :systeminfo="systeminfo" :navbar-data="nvabarData" :headerBtnPosi="headerBtnPosi" :isShare="isOrderShare" />
  5. <view class="container-details" :style="{ paddingTop: navbarHeight + 'px' }">
  6. <view class="status-text">
  7. <view class="view-type">{{ information.status | TextFormat }}</view>
  8. <view class="status-visible"> {{ information.orderSeen == 2 ? '订单对机构不可见' : '订单对机构可见' }} </view>
  9. <view class="Rebate " v-if="information.rebateFlag == 1">返佣</view>
  10. <text class="bage-name" v-if="information.serviceName">【{{ information.serviceName ? information.serviceName : '' }}】</text>
  11. <text class="bage-buss btn" v-if="information.orderSubmitType == 3 || information.orderSubmitType == 4"
  12. >服务商</text
  13. >
  14. <text
  15. class="bage-auto btn"
  16. v-if="
  17. information.orderSubmitType == 0 ||
  18. information.orderSubmitType == 1 ||
  19. information.orderSubmitType == 2
  20. "
  21. >自主</text
  22. >
  23. </view>
  24. <!-- 地址选择 -->
  25. <cm-address-temp ref="orderAddress" v-if="isRequest && !rechargeGoods" :addressData="addressData" />
  26. <!-- 特殊商品退货须知 -->
  27. <view class="return-instructions" v-if="returnGoodsStutas" v-html="helpContent"></view>
  28. <!-- 商品 -->
  29. <cm-goods-temp ref="goods" v-if="isRequest" :shopOrderData="shopOrderData" :information="information" @popupClick="hanldePopupFn" />
  30. <!-- 订单信息 -->
  31. <cm-order-temp ref="information" v-if="isRequest" :information="information"/>
  32. <!-- 发票信息 -->
  33. <cm-invice-temp ref="invoice" v-if="isRequest" :orderInvoice="orderInvoice" />
  34. <!-- 支付记录 -->
  35. <cm-payment-temp ref="payment" v-if="isRequest" :discernReceiptList="discernReceiptList" :receiptAmount="receiptAmount" />
  36. <!-- 退款记录 -->
  37. <cm-refund-temp ref="refund" v-if="isRequest" :returnedPurchaseList="returnedPurchaseList" :returnedPurchaseFee="returnedPurchaseFee" />
  38. <!-- 支付凭证记录 -->
  39. <cm-voucher-temp ref="voucher" v-if="skeletonShow && voucherList.length > 0" :list="voucherList" />
  40. <view
  41. class="clause"
  42. v-if="information.secondHandOrderFlag != 1"
  43. @click="openclauseConten(clauseData.id)"
  44. :class="clauseData.name == '无条款' ? 'noclick' : ''"
  45. >
  46. 售后条款:<label class="text" :class="clauseData.name == '无条款' ? 'color-bg' : ''">{{
  47. clauseData.name
  48. }}</label>
  49. </view>
  50. </view>
  51. <!-- 分享弹窗 -->
  52. <cm-share-popup :orderId="orderId" :shareType="isShareType" v-if="isShareModal" @shareConfirm="onShareAppMessage" />
  53. <!-- 促销活动弹窗 -->
  54. <cm-promote-popup :Promotion="handlerPros" :popupShow="popupShow" />
  55. </view>
  56. </template>
  57. <script>
  58. import { mapState, mapMutations } from 'vuex'
  59. import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
  60. import cmAddressTemp from './components/details/cm-address-temp' //地址信息
  61. import cmGoodsTemp from './components/details/cm-goods-temp' //商品列表
  62. import cmOrderTemp from './components/details/cm-order-temp' //订单信息
  63. import cmInviceTemp from './components/details/cm-invice-temp' //发票信息
  64. import cmPaymentTemp from './components/details/cm-payment-temp' //支付记录
  65. import cmRefundTemp from './components/details/cm-refund-temp' //退款记录
  66. import cmVoucherTemp from './components/details/cm-voucher-temp' //退款记录
  67. import cmDetailsButton from './components/cm-details-button' //底部按钮
  68. import cmSharePopup from './components/cm-share-popup' //分享弹窗
  69. import cmPromotePopup from './components/details/cm-promote-popup' //促销活动弹窗
  70. export default {
  71. components: {
  72. headerBack,
  73. cmAddressTemp,
  74. cmGoodsTemp,
  75. cmOrderTemp,
  76. cmInviceTemp,
  77. cmPaymentTemp,
  78. cmRefundTemp,
  79. cmVoucherTemp,
  80. cmDetailsButton,
  81. cmSharePopup,
  82. cmPromotePopup
  83. },
  84. data() {
  85. return {
  86. nvabarData: {
  87. //顶部自定义导航
  88. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示
  89. title: '订单详情' // 导航栏 中间的标题
  90. },
  91. state: 0,
  92. userId: '',
  93. orderId: '',
  94. clubUserId: 0,
  95. serviceProviderId: '', //服务商ID
  96. shareCode: '', //分享码
  97. shareType: '', //分享登录页过来记录的状态
  98. cellPhone: '', //客服电话
  99. payStatus: 0,
  100. btnStatus: 0, //按钮组件状态
  101. isRequest: false, //是否加载完成渲染子组件
  102. isOrderShare: false,
  103. isShareModal: false,
  104. isShareType:2,
  105. isPayModel: false,
  106. modelType: 0,
  107. ableUserMoney: '', //机构余额
  108. payModelData: {},
  109. addressData: {}, //地址信息初始化
  110. information: {}, //订单信息初始化
  111. shopOrderData: {}, //商品信息初始化
  112. orderInvoice: {}, //发票信息初始化
  113. returnedPurchaseList: {}, //退款信息初始化
  114. discernReceiptList: {}, //支付信息初始化
  115. receiptAmount: 0, //支付金额
  116. returnedPurchaseFee: 0, //退款金额
  117. navbarHeight: '',
  118. rechargeGoods: false,
  119. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  120. systeminfo: this.setSysteminfo(), //获取设备信息
  121. isIphoneX: this.$store.state.isIphoneX,
  122. CustomBar: this.CustomBar, // 顶部导航栏高度
  123. popupShow: false,
  124. handlerPros: {},
  125. clauseData: {},
  126. showAgan: false,
  127. failList: [], // 再来一单可购买商品
  128. promptitle: '',
  129. aganOrderId: 0 // 再来一单商品id
  130. }
  131. },
  132. onLoad(option) {
  133. console.log(option)
  134. this.shareType = option.type
  135. this.orderId = option.orderId
  136. this.clubUserId = option.userId
  137. if (this.shareType === 'share') {
  138. this.listType = 0
  139. this.isOrderShare = true
  140. } else if (option.type === 'confim' || option.type === 'search' || option.type === 'cash') {
  141. this.listType = 0
  142. } else {
  143. this.listType = option.listType
  144. }
  145. this.getHeaderTopHeight()
  146. this.initOrderDetaileData()
  147. },
  148. filters: {
  149. NumFormat(value) {
  150. //处理金额
  151. return Number(value).toFixed(2)
  152. },
  153. TextFormat(status) {
  154. //处理金额
  155. let HtmlText,
  156. typeTextObject = {
  157. 0: '待确认',
  158. 2: '交易完成',
  159. 4: '已关闭',
  160. 5: '交易全退',
  161. 11: '待付款待发货',
  162. 12: '待付款部分发货',
  163. 13: '待付款已发货',
  164. 21: '部分付款待发货',
  165. 22: '部分付款部分发货',
  166. 23: '部分付款已发货',
  167. 31: '已付款待发货',
  168. 32: '已付款部分发货',
  169. 33: '已付款已发货'
  170. }
  171. Object.keys(typeTextObject).forEach(key => {
  172. if (key == status) {
  173. HtmlText = typeTextObject[key]
  174. }
  175. })
  176. return HtmlText
  177. }
  178. },
  179. computed: {
  180. ...mapState(['isManage'])
  181. },
  182. methods: {
  183. openclauseConten(id) {
  184. this.$api.navigateTo(`/pages/service/sellconten?clauseId=${id}`)
  185. },
  186. initOrderDetaileData() {
  187. //初始化页面数据@参数:订单ID
  188. this.OrderService.QueryOrderDetails({
  189. orderId: this.orderId,
  190. userId: this.clubUserId
  191. })
  192. .then(response => {
  193. let data = response.data
  194. this.isRequest = true
  195. this.userId = data.order.userId
  196. this.shareCode = data.shareCode
  197. this.addressData = data.userInfo
  198. this.information = data.order
  199. this.rechargeGoods = data.order.rechargeGoods
  200. this.btnStatus = data.order.status
  201. this.payStatus = data.order.payStatus
  202. this.shopOrderData = data.shopOrderList
  203. this.orderInvoice = data.orderInvoice
  204. this.returnedPurchaseList = data.returnedPurchaseList
  205. this.discernReceiptList = data.discernReceiptList
  206. this.receiptAmount = data.order.receiptAmount
  207. this.returnedPurchaseFee = data.order.returnedPurchaseFee
  208. this.ableUserMoney = data.ableUserMoney
  209. this.clauseData = data.clause
  210. if (this.clauseData && this.clauseData.name.length > 10) {
  211. this.clauseData.name = this.clauseData.name.substr(0, 10) + '...'
  212. }
  213. })
  214. .catch(error => {
  215. this.$util.modal('提示', '订单查询失败,请稍后重试~', '确定', '', false, () => {
  216. this.$api.switchTabTo('/pages/seller/index/index')
  217. })
  218. })
  219. },
  220. hanldePopupFn(data) {
  221. //监听活动内容
  222. this.popupShow = true
  223. this.handlerPros = data
  224. },
  225. onShareAppMessage(res) {
  226. //分享转发
  227. this.isShareModal = false
  228. if (res.from === 'button') {
  229. // 来自页面内转发按钮
  230. }
  231. return {
  232. title: '您有新的订单,请点击查看~',
  233. path: `/pages/user/order/order-sharelogin?orderId=${this.orderId}&userId=${
  234. this.userId
  235. }&serviceProviderId=${this.serviceProviderId}`,
  236. imageUrl: 'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  237. }
  238. },
  239. getHeaderTopHeight() {
  240. let statusBarHeight = this.systeminfo.statusBarHeight // 状态栏高度
  241. let headerPosi = this.headerBtnPosi
  242. let btnPosi = {
  243. // 胶囊实际位置,坐标信息不是左上角原点
  244. height: headerPosi.height,
  245. width: headerPosi.width,
  246. // 胶囊top - 状态栏高度
  247. top: headerPosi.top - statusBarHeight,
  248. // 胶囊bottom - 胶囊height - 状态栏height (现胶囊bottom 为距离导航栏底部的长度)
  249. bottom: headerPosi.bottom - headerPosi.height - statusBarHeight,
  250. // 屏幕宽度 - 胶囊right
  251. right: this.systeminfo.screenWidth - headerPosi.right
  252. }
  253. this.navbarHeight = headerPosi.bottom + btnPosi.bottom // 原胶囊bottom + 现胶囊bottom
  254. },
  255. setHeaderBtnPosi() {
  256. // 获得胶囊按钮位置信息
  257. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  258. return headerBtnPosi
  259. },
  260. setSysteminfo() {
  261. let systeminfo
  262. uni.getSystemInfo({
  263. // 获取设备信息
  264. success: res => {
  265. systeminfo = res
  266. }
  267. })
  268. return systeminfo
  269. }
  270. },
  271. onShow() {
  272. this.$api.getStorage().then(resolve => {
  273. this.serviceProviderId = resolve.serviceProviderId ? resolve.serviceProviderId : 0
  274. })
  275. }
  276. }
  277. </script>
  278. <style lang="scss">
  279. page {
  280. height: auto;
  281. background: #f7f7f7;
  282. }
  283. .btn-hover {
  284. background: #ffffff;
  285. }
  286. .animation {
  287. /* transition: transform 0.3s ease;*/
  288. transition-property: transform;
  289. transition-duration: 0.3s;
  290. transition-timing-function: ease;
  291. }
  292. .invoice-balance {
  293. width: 702rpx;
  294. height: auto;
  295. padding: 0 24rpx;
  296. background: #ffffff;
  297. float: left;
  298. margin-top: 24rpx;
  299. margin-bottom: 24rpx;
  300. .balabce-t {
  301. width: 100%;
  302. height: 86rpx;
  303. line-height: 86rpx;
  304. font-size: $font-size-28;
  305. color: $text-color;
  306. float: left;
  307. .balabce-t-le {
  308. float: left;
  309. font-weight: bold;
  310. }
  311. .balabce-t-ri {
  312. float: right;
  313. display: flex;
  314. align-items: center;
  315. .money {
  316. display: flex;
  317. float: left;
  318. }
  319. .checkbox-box {
  320. display: flex;
  321. width: 60rpx;
  322. float: left;
  323. height: 100%;
  324. font-size: $font-size-24;
  325. .checkbox {
  326. width: 40rpx;
  327. text-align: right;
  328. box-sizing: border-box;
  329. text-align: center;
  330. text-decoration: none;
  331. border-radius: 0;
  332. -webkit-tap-highlight-color: transparent;
  333. overflow: hidden;
  334. }
  335. }
  336. }
  337. }
  338. .balabce-b {
  339. width: 100%;
  340. float: left;
  341. overflow: hidden;
  342. .balabce-b-text {
  343. width: 100%;
  344. line-height: 58rpx;
  345. font-size: $font-size-24;
  346. color: #ff2a2a;
  347. text-align: right;
  348. float: right;
  349. }
  350. &.balabce-b--hide {
  351. padding: 0 0;
  352. height: 0px;
  353. line-height: 0px;
  354. }
  355. }
  356. }
  357. .clause {
  358. float: right;
  359. font-size: 24rpx;
  360. color: #999999;
  361. margin-top: 60rpx;
  362. margin-right: 24rpx;
  363. &.noclick {
  364. pointer-events: none;
  365. }
  366. .text {
  367. color: #1890f9;
  368. &.color-bg {
  369. color: #333333;
  370. }
  371. }
  372. }
  373. .status-text {
  374. overflow: hidden;
  375. padding: 24rpx;
  376. background: #fff;
  377. font-size: $font-size-26;
  378. .view-type {
  379. float: left;
  380. color: #ff2a2a;
  381. }
  382. .status-visible{
  383. float: left;
  384. color: #999999;
  385. margin-left: 20rpx;
  386. }
  387. .bage-buss {
  388. display: inline-block;
  389. width: 72rpx;
  390. height: 32rpx;
  391. background: rgb(223, 240, 255);
  392. color: rgb(126, 172, 213);
  393. border-radius: 4rpx;
  394. line-height: 32rpx;
  395. text-align: center;
  396. float: right;
  397. font-size: 22rpx;
  398. }
  399. .bage-auto {
  400. display: inline-block;
  401. width: 72rpx;
  402. height: 32rpx;
  403. background: #7fba4f;
  404. color: #ffffff;
  405. border-radius: 4rpx;
  406. line-height: 32rpx;
  407. text-align: center;
  408. float: right;
  409. font-size: 22rpx;
  410. }
  411. .bage-name{
  412. line-height: 32rpx;
  413. display: inline-block;
  414. color: #999999;
  415. float: right;
  416. font-size: 22rpx;
  417. }
  418. .Rebate {
  419. display: inline-block;
  420. width: 72rpx;
  421. height: 32rpx;
  422. background: #ff7a51;
  423. border-radius: 6rpx;
  424. line-height: 32rpx;
  425. text-align: center;
  426. color: #ffffff;
  427. float: right;
  428. font-size: $font-size-24;
  429. margin-left: 20rpx;
  430. }
  431. }
  432. .aganBj {
  433. position: fixed;
  434. left: 0;
  435. top: 0;
  436. bottom: 0;
  437. width: 100%;
  438. height: 100%;
  439. background-color: rgba(0, 0, 0, 0.5);
  440. z-index: 999999;
  441. .alertAgan {
  442. position: absolute;
  443. top: 50%;
  444. left: 50%;
  445. transform: translate(-50%, -50%);
  446. width: 580rpx;
  447. background-color: #fff;
  448. border-radius: 16rpx;
  449. .title {
  450. font-size: 30rpx;
  451. color: #333333;
  452. line-height: 42rpx;
  453. padding: 30rpx;
  454. display: block;
  455. }
  456. .goods {
  457. padding: 0 30rpx;
  458. .list {
  459. padding: 10px 0;
  460. border-bottom: 1rpx solid #e1e1e1;
  461. margin: 10rpx 0;
  462. .image-left {
  463. width: 86rpx;
  464. height: 86rpx;
  465. border: 2rpx solid #e1e1e1;
  466. border-radius: 6rpx;
  467. display: inline-block;
  468. vertical-align: middle;
  469. }
  470. .name-right {
  471. display: inline-block;
  472. width: 416rpx;
  473. margin-left: 15rpx;
  474. font-size: 26rpx;
  475. color: #666666;
  476. vertical-align: middle;
  477. word-break: break-all;
  478. overflow: hidden;
  479. text-overflow: ellipsis;
  480. display: -webkit-inline-box;
  481. -webkit-line-clamp: 2;
  482. -webkit-box-orient: vertical;
  483. }
  484. }
  485. }
  486. .BtnAll {
  487. margin-top: 30rpx;
  488. .btn {
  489. display: inline-block;
  490. width: 290rpx;
  491. height: 90rpx;
  492. line-height: 90rpx;
  493. text-align: center;
  494. &.closebtn {
  495. border-radius: 0px 0px 0px 10px;
  496. color: #999999;
  497. background: #efefef;
  498. }
  499. &.cancel {
  500. border-radius: 0px 0px 8px 0px;
  501. background: $btn-confirm;
  502. color: #fff;
  503. }
  504. }
  505. }
  506. }
  507. }
  508. </style>