index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  1. <template>
  2. <view class="container">
  3. <view class="userinfo-card">
  4. <view class="card-box">
  5. <view class="user-section">
  6. <view class="left">
  7. <view class="avatar-wrap">
  8. <image class="avatar" :src="storeInfo.avatar"></image>
  9. </view>
  10. <view class="portrait-box">
  11. <view class="info-box">
  12. <text class="username"
  13. @click="goLogin">{{ storeInfo.storeName ? storeInfo.storeName : '游客' }}</text>
  14. </view>
  15. <!-- <view class="tuan" v-if="storeInfo.consortiaContent">
  16. <view class="ma">{{storeInfo.consortiaContent}}</view>
  17. </view> -->
  18. </view>
  19. </view>
  20. <!-- <view class="right">
  21. <view class="btn" @tap="editStoreInfo">
  22. 修改店铺信息
  23. </view>
  24. </view> -->
  25. </view>
  26. <view class="balance-card-wrap">
  27. <view class="balance-card">
  28. <view class="left">
  29. <view class="tit">可提现金额(元)</view>
  30. <view class="num">
  31. <text>¥</text>{{ storeInfo.moneys }}
  32. </view>
  33. </view>
  34. <view class="right">
  35. <view @click="withdrawNow()" class="withdraw-btn">立即提现</view>
  36. </view>
  37. </view>
  38. <view class="shouyi-card">
  39. <view class="show-content">
  40. <view class="view-category" @click="navToLogin('/my/wallet/teammoneydetail')">
  41. <view class="num">¥{{ storeInfo.moneys }}</view>
  42. <view class="text">总收益额</view>
  43. </view>
  44. <view class="line"></view>
  45. <view class="view-category">
  46. <view class="num">{{ storeInfo.counts }}</view>
  47. <view class="text">总订单数</view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="main">
  55. <view class="tool-card">
  56. <view class="tool-item" @click="navToLogin('/my/gonghui/therapist?consortiaId=' + consortiaId)">
  57. <view class="item-right">
  58. <view class="view-text">商家技师</view>
  59. <image src="/static/images/index/right.png" class="view-image-right"></image>
  60. </view>
  61. </view>
  62. <view class="tool-item" @click="navToLogin('/my/wallet/teammoneydetail')">
  63. <view class="item-right">
  64. <view class="view-text">商家收益</view>
  65. <image src="/static/images/index/right.png" class="view-image-right"></image>
  66. </view>
  67. </view>
  68. <!-- <view class="tool-item" @click="navToLogin('/pages/merchant/walletList')">
  69. <view class="item-right">
  70. <view class="view-text">钱包明细</view>
  71. <image src="/static/images/index/right.png" class="view-image-right"></image>
  72. </view>
  73. </view> -->
  74. <!-- <view class="tool-item" @click="goChat">
  75. <view class="item-right">
  76. <view class="view-text">联系客服</view>
  77. <image src="/static/images/index/right.png" class="view-image-right"></image>
  78. </view>
  79. </view> -->
  80. </view>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. export default {
  86. data() {
  87. return {
  88. page: 1,
  89. limit: 10,
  90. orderList: [],
  91. top: 0,
  92. storeStatus: null,
  93. storeInfo: {
  94. storeName: "游客",
  95. avatar: "../../static/logo.png",
  96. consortiaContent: '',
  97. moneys: "0",
  98. counts: 0,
  99. todayEarnings: "0", //今日收益
  100. earningsThisMonth: "0", //本月收益
  101. NumWriteOffPieces: "0", //核销件数
  102. },
  103. wxWithdrawal: "否",
  104. aliWithdrawal: "否",
  105. modal4: false,
  106. button4: [{
  107. text: '微信',
  108. type: 'green',
  109. plain: true
  110. },
  111. {
  112. text: '支付宝',
  113. plain: true
  114. },
  115. ],
  116. };
  117. },
  118. onLoad() {
  119. let that = this;
  120. this.getUserInfo();
  121. },
  122. onShow() {
  123. let that = this;
  124. this.getUserInfo();
  125. },
  126. methods: {
  127. goChat() {
  128. let kefu = this.$queue.getData('kefu'); // 用户端联系方式 1 手机号 2企业微信
  129. let kefuPhone = this.$queue.getData('kefuPhone');
  130. let userId = this.$queue.getData('userId');
  131. if (userId) {
  132. if (kefu == 1) {
  133. uni.makePhoneCall({
  134. phoneNumber: kefuPhone //仅为示例
  135. });
  136. } else if (kefu == 3) {
  137. uni.navigateTo({
  138. url: '/my/setting/customer'
  139. });
  140. } else {
  141. // #ifdef MP-WEIXIN
  142. let that = this
  143. try {
  144. wx.openCustomerServiceChat({
  145. extInfo: {
  146. url: that.$queue.getData('kefuUrl')
  147. },
  148. corpId: that.$queue.getData('kefuAppId'),
  149. success(res) {},
  150. fail(res) {
  151. console.error(res)
  152. }
  153. })
  154. } catch (error) {
  155. console.error("catchcatch" + error)
  156. uni.showToast({
  157. title: '请更新至微信最新版本'
  158. });
  159. }
  160. // #endif
  161. // #ifndef MP-WEIXIN
  162. let url = this.$queue.getData('kefuUrl');
  163. if (url.indexOf('/pages/') !== -1 || url.indexOf('/my/') !== -1) {
  164. uni.navigateTo({
  165. url
  166. });
  167. } else {
  168. //#ifndef H5
  169. uni.navigateTo({
  170. url: '/pages/index/webView?url=' + url
  171. });
  172. //#endif
  173. //#ifdef H5
  174. window.location.href = url;
  175. //#endif
  176. }
  177. // #endif
  178. }
  179. } else {
  180. uni.showModal({
  181. title: '提示',
  182. content: '您还未登录,请先登录',
  183. success: function(res) {
  184. if (res.confirm) {
  185. console.log('用户点击确定');
  186. uni.navigateTo({
  187. url: '/pages/public/login'
  188. })
  189. } else if (res.cancel) {
  190. console.log('用户点击取消');
  191. }
  192. }
  193. })
  194. }
  195. },
  196. saveImgss(imgs, index) {
  197. console.log(imgs, index)
  198. // let that = this
  199. let imgArr = imgs
  200. // this.imgArr.push(imgs);
  201. // console.log(this.imgArr)
  202. // //预览图片
  203. uni.previewImage({
  204. urls: imgArr,
  205. current: imgArr[index]
  206. });
  207. },
  208. saveImgs(imgs) {
  209. let imgArr = [];
  210. imgArr.push(imgs);
  211. // //预览图片
  212. uni.previewImage({
  213. urls: imgArr,
  214. current: 0
  215. });
  216. },
  217. getlist() {
  218. let userId = this.$queue.getData('userId');
  219. let index = 2
  220. let data = {
  221. page: this.page,
  222. limit: this.limit,
  223. consortiaId: this.consortiaId,
  224. shopId: userId
  225. }
  226. // console.log(data)
  227. this.$Request.get("/app/consortia/selectUserListByConsortiaId", data).then(res => {
  228. if (res.code == 0) {
  229. if (this.page == 1) {
  230. this.orderList = res.data.list
  231. } else {
  232. this.orderList = [...this.orderList, ...res.data.list]
  233. }
  234. }
  235. uni.stopPullDownRefresh();
  236. })
  237. },
  238. getUserInfo() {
  239. this.$Request.get("/app/user/selectUserById").then(res => {
  240. if (res.code == 0) {
  241. this.consortiaId = res.data.consortiaId
  242. uni.setStorageSync('avatar', res.data.avatar)
  243. uni.setStorageSync('userName', res.data.userName)
  244. uni.setStorageSync('invitationCode', res.data.invitationCode)
  245. uni.setStorageSync('zhiFuBao', res.data.zhiFuBao)
  246. uni.setStorageSync('zhiFuBaoName', res.data.zhiFuBaoName)
  247. this.initStoreInfo();
  248. this.getlist();
  249. }
  250. });
  251. },
  252. initNavigation(e) {
  253. this.top = e.top;
  254. },
  255. back() {
  256. uni.navigateBack();
  257. },
  258. //获取商户信息
  259. initStoreInfo() {
  260. let that = this;
  261. let userId = that.$queue.getData('userId');
  262. this.$Request.getT('/app/consortia/selectConsortiaByUserId?consortiaId=' + this.consortiaId).then(res => {
  263. if (res.code == 0) {
  264. this.storeInfo.avatar = res.data.logo;
  265. this.storeInfo.storeName = res.data.consortiaName;
  266. this.storeInfo.consortiaContent = res.data.consortiaContent;
  267. }
  268. });
  269. this.$Request.getT('/app/consortia/selectConsortiaMoney?shopId=' + userId).then(res => {
  270. if (res.code == 0) {
  271. this.storeInfo.moneys = res.data ? res.data : 0;
  272. }
  273. });
  274. this.$Request.getT('/app/artificer/selectOrdersLists?page=1&limit=10&shopId=' + userId).then(res => {
  275. if (res.code == 0) {
  276. this.storeInfo.counts = res.data.totalCount ? res.data.totalCount : 0;
  277. }
  278. });
  279. },
  280. /**
  281. * 统一跳转接口,拦截未登录路由
  282. * navigator标签现在默认没有转场动画,所以用view
  283. */
  284. navToLogin(urlPath) {
  285. let that = this,
  286. url,
  287. userId = that.$queue.getData('userId');
  288. if (userId) {
  289. url = urlPath;
  290. } else {
  291. url = '/pages/member/login';
  292. }
  293. uni.navigateTo({
  294. url
  295. });
  296. },
  297. navTo(index) {
  298. uni.navigateTo({
  299. url: "/pages/merchant/order?index=" + index
  300. });
  301. },
  302. // 是否绑定支付宝账号,未绑定跳转绑定,已绑定可发起提现
  303. withdrawNow() {
  304. uni.navigateTo({
  305. url: '/my/wallet/index?tabIndex=1'
  306. });
  307. }
  308. }
  309. };
  310. </script>
  311. <style lang="scss" scoped>
  312. page {
  313. background: #F2F3F7;
  314. }
  315. page {
  316. background-color: #F7F7F7;
  317. }
  318. .zz_view {
  319. // width: 220upx;
  320. background: #e8fdf6;
  321. color: #73c2a2;
  322. font-size: 24rpx;
  323. padding: 6rpx 10rpx;
  324. border-radius: 10rpx;
  325. }
  326. .zpmore_view {
  327. background: #2FB57A;
  328. width: 120upx;
  329. text-align: center;
  330. border-radius: 10rpx;
  331. height: 42rpx;
  332. line-height: 42rpx;
  333. font-size: 24rpx;
  334. color: #FFFFFF;
  335. margin-left: 10rpx;
  336. }
  337. .byy_view {
  338. // background: #2FB57A;
  339. width: 120upx;
  340. text-align: center;
  341. border-radius: 50rpx;
  342. height: 46rpx;
  343. line-height: 46rpx;
  344. font-size: 24rpx;
  345. color: #999999;
  346. border: 3upx solid #999999;
  347. margin-top: 6rpx;
  348. }
  349. .kyy_view {
  350. background: #2FB57A;
  351. width: 120upx;
  352. text-align: center;
  353. border-radius: 50rpx;
  354. height: 46rpx;
  355. line-height: 46rpx;
  356. font-size: 24rpx;
  357. color: #FFFFFF;
  358. margin-top: 6rpx;
  359. }
  360. .bg {
  361. background: #FFFFFF;
  362. }
  363. .container {
  364. .header-box {
  365. width: 100%;
  366. position: fixed;
  367. top: 0;
  368. padding: 0 30rpx;
  369. display: flex;
  370. align-items: center;
  371. height: 32px;
  372. transform: translateZ(0);
  373. z-index: 99999;
  374. box-sizing: border-box;
  375. .header-title {
  376. display: flex;
  377. font-size: 38upx;
  378. }
  379. }
  380. .userinfo-card {
  381. .card-box {
  382. width: 100%;
  383. /* #ifdef H5 */
  384. height: 476upx;
  385. /* #endif */
  386. /* #ifdef MP-WEIXIN */
  387. height: 406upx;
  388. /* #endif */
  389. position: relative;
  390. z-index: 0;
  391. .user-section {
  392. position: absolute;
  393. top: 0;
  394. z-index: 10;
  395. width: 100%;
  396. /* #ifdef H5 */
  397. padding: 50upx 30upx 210upx;
  398. /* #endif */
  399. /* #ifdef MP-WEIXIN */
  400. padding: 0 30upx 140upx;
  401. /* #endif */
  402. background-color: #05C25C;
  403. display: flex;
  404. justify-content: space-between;
  405. .left {
  406. display: flex;
  407. .avatar-wrap {
  408. width: 100upx;
  409. height: 100upx;
  410. border-radius: 10upx;
  411. overflow: hidden;
  412. .avatar {
  413. width: 100%;
  414. height: 100%;
  415. }
  416. }
  417. .portrait-box {
  418. margin-left: 18upx;
  419. display: flex;
  420. flex-direction: column;
  421. justify-content: space-between;
  422. .info-box {
  423. font-size: 38upx;
  424. font-family: PingFang SC;
  425. font-weight: bold;
  426. color: #FFF;
  427. margin-top: 20rpx;
  428. }
  429. .tuan {
  430. display: flex;
  431. align-items: center;
  432. width: 560rpx;
  433. .ma {
  434. font-size: 24upx;
  435. font-family: PingFang SC;
  436. font-weight: 500;
  437. color: #FFF;
  438. }
  439. }
  440. }
  441. }
  442. .right {
  443. display: flex;
  444. align-items: center;
  445. justify-content: center;
  446. .btn {
  447. width: 180upx;
  448. height: 58upx;
  449. background: #FFFFFF;
  450. text-align: center;
  451. font-size: 24upx;
  452. color: #333;
  453. line-height: 58upx;
  454. border-radius: 29upx 0upx 0upx 29upx;
  455. margin-right: -30upx;
  456. }
  457. }
  458. }
  459. .balance-card-wrap {
  460. width: 100%;
  461. height: 276upx;
  462. padding: 0 20upx;
  463. position: absolute;
  464. bottom: 0;
  465. z-index: 10;
  466. display: flex;
  467. flex-direction: column;
  468. .balance-card {
  469. width: 100%;
  470. height: 140upx;
  471. background-color: #fff;
  472. border-radius: 20upx 20upx 0 0;
  473. padding: 30upx 30upx 0 30upx;
  474. border-bottom: 1upx solid #f2f2f2;
  475. display: flex;
  476. justify-content: space-between;
  477. .left {
  478. .tit {
  479. font-size: 24upx;
  480. font-family: PingFang SC;
  481. font-weight: 500;
  482. color: #999999;
  483. }
  484. .num {
  485. font-size: 40upx;
  486. font-family: DINPro;
  487. font-weight: 500;
  488. color: #333333;
  489. text {
  490. font-size: 36upx;
  491. }
  492. }
  493. }
  494. .right {
  495. .withdraw-btn {
  496. background: #05C25C;
  497. border-radius: 25px;
  498. width: 150upx;
  499. height: 50upx;
  500. line-height: 50upx;
  501. text-align: center;
  502. font-size: 24upx;
  503. font-family: PingFang SC;
  504. font-weight: 500;
  505. color: #FFF;
  506. }
  507. }
  508. }
  509. .shouyi-card {
  510. width: 100%;
  511. flex: 1;
  512. background-color: #fff;
  513. border-radius: 0 0 20upx 20upx;
  514. display: flex;
  515. align-items: center;
  516. .show-content {
  517. width: 100%;
  518. display: flex;
  519. justify-content: space-around;
  520. align-items: center;
  521. .view-category {
  522. display: flex;
  523. flex-direction: column;
  524. align-items: center;
  525. justify-content: center;
  526. .num {
  527. font-size: 38upx;
  528. font-family: PingFang SC;
  529. font-weight: 800;
  530. color: #333333;
  531. }
  532. .text {
  533. font-size: 24upx;
  534. font-family: PingFang SC;
  535. font-weight: 500;
  536. color: #999999;
  537. }
  538. }
  539. .line {
  540. width: 1px;
  541. height: 65upx;
  542. background-color: #E6E6E6;
  543. }
  544. }
  545. }
  546. }
  547. }
  548. }
  549. .main {
  550. padding: 20upx;
  551. .income-card {
  552. width: 100%;
  553. background-color: #fff;
  554. border-radius: 20upx;
  555. padding: 30upx;
  556. margin-top: 20upx;
  557. .tit {
  558. display: flex;
  559. align-items: center;
  560. justify-content: space-between;
  561. font-size: 32upx;
  562. line-height: 32upx;
  563. font-family: PingFang SC;
  564. font-weight: bold;
  565. color: #333333;
  566. image {
  567. width: 10upx;
  568. height: 21upx;
  569. }
  570. }
  571. .show-content {
  572. display: flex;
  573. justify-content: space-between;
  574. align-items: center;
  575. margin-top: 40upx;
  576. padding: 0 10upx;
  577. .view-category {
  578. display: flex;
  579. flex-direction: column;
  580. align-items: center;
  581. justify-content: center;
  582. image {
  583. width: 48upx;
  584. }
  585. .text {
  586. font-size: 24upx;
  587. font-family: PingFang SC;
  588. font-weight: 500;
  589. color: #999999;
  590. margin-top: 15upx;
  591. }
  592. }
  593. }
  594. }
  595. .tool-card {
  596. background-color: #ffffff;
  597. width: 100%;
  598. padding: 0 30upx;
  599. border-radius: 20upx;
  600. .tool-item {
  601. display: flex;
  602. flex-direction: row;
  603. width: 100%;
  604. height: 100upx;
  605. align-items: center;
  606. justify-content: space-between;
  607. .view-image-left {
  608. width: 44upx;
  609. }
  610. .item-right {
  611. flex: 1;
  612. display: flex;
  613. flex-direction: row;
  614. align-items: center;
  615. justify-content: space-between;
  616. button {
  617. flex: 1;
  618. padding: 0;
  619. margin: 0;
  620. border: none;
  621. background: transparent;
  622. text-align: left;
  623. }
  624. button::after {
  625. border: none;
  626. }
  627. button::before {
  628. border: none;
  629. }
  630. .view-text {
  631. font-size: 28upx;
  632. font-family: PingFang SC;
  633. font-weight: bold;
  634. color: #1A1A1A;
  635. }
  636. .view-image-right {
  637. width: 10upx;
  638. height: 21upx;
  639. }
  640. }
  641. }
  642. }
  643. }
  644. .back-user {
  645. width: 100upx;
  646. height: 100upx;
  647. border-radius: 50%;
  648. background: #FFF;
  649. color: #000000;
  650. line-height: 100upx;
  651. text-align: center;
  652. position: fixed;
  653. right: 30upx;
  654. bottom: 5%;
  655. }
  656. }
  657. </style>