index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. <template>
  2. <view class="">
  3. <u-navbar :is-back="false" title="联兑通商户版"></u-navbar>
  4. <view class="margin-30">
  5. <view class="flex justify-between">
  6. <view class="title ">
  7. <view class="icon">
  8. <image src="@/static/icon/dianpu6.png" mode=""></image>
  9. </view>
  10. <view class="center margin-left-10">
  11. <view @click="showShop">
  12. <text class="name">{{shopLable || '去完善商户资料'}}</text>
  13. <u-icon size="25" v-if="shopShow" name="arrow-up-fill" style="margin-left: 10rpx;"></u-icon>
  14. <u-icon size="25" v-else name="arrow-down-fill" style="margin-left: 10rpx;"></u-icon>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="cu-list grid col-3 no-border top-menu" style="padding: 20rpx 10rpx;">
  20. <view class="cu-item" @click="operate(index)" v-for="(item,index) in menuList" :key="index">
  21. <view class="grid-icon margin-top-20">
  22. <image style="width: 62rpx;height: 62rpx;" :src="item.icon" />
  23. </view>
  24. <text style="color: #fff;font-size: 26rpx;font-weight: 500;">{{item.name}}</text>
  25. </view>
  26. </view>
  27. <view class="menu-list">
  28. <view @click="jump('/pages/my-bills/my-bills')" class="menu">
  29. <view class="menu-top">
  30. <image src="@/static/index/bills.png"></image>
  31. <view class="center padding-left-10">
  32. <text class="text-lg text-bold" style="color: #303030;">我的账单</text>
  33. </view>
  34. </view>
  35. <view class="menu-bottom">
  36. <view class="">
  37. <text>今日营收</text>
  38. <text>{{statistic.todayCharge || 0}}</text>
  39. </view>
  40. <view class="">
  41. <text>总收益</text>
  42. <text>{{statistic.totalValue || 0}}</text>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="menu" @click="jump('/pages/member/member')">
  47. <view class="menu-top">
  48. <image src="@/static/index/huiyuan.png"></image>
  49. <view class="center padding-left-10">
  50. <text class="text-lg text-bold" style="color: #303030;">会员中心</text>
  51. </view>
  52. </view>
  53. <view class="menu-bottom" style="color: #FFFFFF;">
  54. <view class="">
  55. <text>新增会员</text>
  56. <text style="color: #3D72EA;">{{statistic.newMember || 0}}</text>
  57. </view>
  58. <view class="">
  59. <text>会员总数</text>
  60. <text style="color: #3D72EA;">{{statistic.allMembers || 0}}</text>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="market">
  66. <text class="title">商家工具</text>
  67. <view class="cu-list grid col-4 no-border margin-top-30">
  68. <view class="cu-item" @click="jump(item.path)" v-for="(item,index) in marketList" :key="index">
  69. <view class="grid-icon">
  70. <image style="width: 80rpx;height: 80rpx;" :src="item.icon" />
  71. </view>
  72. <text style="color: #222222;font-size: 26rpx;margin-top: 20rpx;">{{item.name}}</text>
  73. <view class="cu-tag bg-red badge" v-if="item.count>0">{{item.count}}</view>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="market">
  78. <text class="title">数字化系统</text>
  79. <view class="cu-list grid col-4 no-border margin-top-30">
  80. <view class="cu-item" @click="jump(item.path)" v-for="(item,index) in systemList" :key="index">
  81. <view class="grid-icon">
  82. <image style="width: 80rpx;height: 80rpx;" :src="item.icon" />
  83. </view>
  84. <text style="color: #222222;font-size: 26rpx;margin-top: 20rpx;">{{item.name}}</text>
  85. <view class="cu-tag bg-red badge" v-if="item.count>0">{{item.count}}</view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <u-modal @confirm="$jump('/pages/member/member')" :show-cancel-button="true" confirm-color="#ff9447"
  91. confirm-text="立即开启" cancel-text="暂不开启" v-model="isOpenMemberShow" content="请先创建会员中心"></u-modal>
  92. <u-select confirm-color="#EF9944" @confirm="shopConfirm" :default-value="defaultValue" v-model="shopShow"
  93. value-name="id" label-name="name" :list="shopList">
  94. </u-select>
  95. </view>
  96. </template>
  97. <script>
  98. export default {
  99. data() {
  100. return {
  101. //下拉选择商铺
  102. shopShow: false,
  103. //我的商铺列表
  104. shopList: [],
  105. defaultValue: [0],
  106. //选中的商铺id
  107. shopId: '',
  108. //选中的商铺labe
  109. shopLable: '',
  110. labelIds: '',
  111. labelNames: '',
  112. //选中的商铺所属的商场
  113. mallId: '',
  114. //统计数据
  115. statistic: {},
  116. //菜单
  117. menuList: [{
  118. icon: '/static/icon/scan.png',
  119. name: '扫一扫',
  120. },
  121. {
  122. icon: '/static/icon/pay.png',
  123. name: '收款码',
  124. },
  125. {
  126. icon: '/static/icon/card.png',
  127. name: '卡包',
  128. }
  129. ],
  130. marketList: [{
  131. icon: '/static/index/faqi.png',
  132. name: '发起活动',
  133. path: '/pages/publish/publish',
  134. count: 0
  135. },
  136. {
  137. icon: '/static/index/qingdan.png',
  138. name: '活动清单',
  139. path: '/pages/activity/activity',
  140. count: 0
  141. },
  142. {
  143. icon: '/static/index/mendian-add.png',
  144. name: '添加门店',
  145. path: '/pages/shop-info/shop-info',
  146. count: 0
  147. },
  148. {
  149. icon: '/static/index/dingdan3.png',
  150. name: '订单中心',
  151. path: '/pages/order/order',
  152. count: 0
  153. },
  154. ],
  155. systemList: [{
  156. icon: '/static/index/shangcheng.png',
  157. name: '线上商城',
  158. path: '/pagesGoods/pages/menu/menu'
  159. }, {
  160. icon: '/static/index/mendian.png',
  161. name: '门店管理',
  162. path: ''
  163. }, {
  164. icon: '/static/index/waimai.png',
  165. name: '外卖平台',
  166. path: ''
  167. },
  168. {
  169. icon: '/static/index/yuyue.png',
  170. name: '预约系统',
  171. path: ''
  172. },
  173. {
  174. icon: '/static/index/erp.png',
  175. name: 'ERP系统',
  176. path: ''
  177. },
  178. {
  179. icon: '/static/index/add.png',
  180. name: '添加服务',
  181. path: ''
  182. },
  183. ],
  184. //是否开启会员中心
  185. isOpenMember: false,
  186. isOpenMemberShow: false,
  187. //流程节点信息
  188. taskDetail: {}
  189. }
  190. },
  191. onShow() {
  192. this.init()
  193. },
  194. methods: {
  195. showShop() {
  196. if (this.$isEmpty(this.shopLable)) {
  197. uni.navigateTo({
  198. url: "/pages/shop-info/shop-info?phone=" + this.$cache.get('phone')
  199. })
  200. } else {
  201. this.shopShow = !this.shopShow
  202. }
  203. },
  204. async init() {
  205. let phone = this.$cache.get('phone')
  206. let params = {
  207. personTel: phone,
  208. }
  209. let res = await this.$api.shop.list(params)
  210. if (this.$isEmpty(res.data.records)) {
  211. this.$u.vuex('vuex_shopStatus', false)
  212. return
  213. }
  214. if (this.$cache.get('defaultValue')) {
  215. this.defaultValue = this.$cache.get('defaultValue')
  216. }
  217. this.shopList = res.data.records
  218. let item = this.shopList[this.defaultValue[0]]
  219. this.shopId = item.id
  220. this.shopLable = item.name
  221. this.labelIds = item.labelIds
  222. this.labelNames = item.labelNames
  223. this.mallId = item.mallId
  224. this.cacheSelectedShop(item)
  225. this.getTaskDetail()
  226. if (!this.isFirst) {
  227. this.handelShopStatus()
  228. }
  229. this.isFirst = true
  230. //获取统计数据
  231. this.getStatistic()
  232. },
  233. getStatistic() {
  234. if (this.$isEmpty(this.vuex_merchantNo)) {
  235. return
  236. }
  237. this.$api.shop.statistic({
  238. shopId: this.shopId
  239. }).then(res => {
  240. this.statistic = res.data
  241. })
  242. },
  243. cacheSelectedShop(item) {
  244. let selectedShop = {
  245. id: this.shopId,
  246. label: this.shopLable,
  247. labelIds: this.labelIds,
  248. labelNames: this.labelNames
  249. }
  250. this.$cache.put("selectedShop", Object.assign(item, selectedShop))
  251. this.$u.vuex('vuex_shopStatus', item.auditStatus)
  252. this.$u.vuex('vuex_shopId', this.shopId)
  253. this.$u.vuex('vuex_merchantNo', item.merchantNo)
  254. this.$u.vuex('vuex_mallId', this.mallId)
  255. this.$u.vuex('vuex_isOpenMember', item.isOpenMember == 1 ? true : false)
  256. },
  257. shopConfirm(e) {
  258. this.shopId = e[0].value
  259. this.shopLable = e[0].label
  260. let item = this.shopList.filter((item, index) => {
  261. if (this.shopId == item.id) {
  262. this.defaultValue = [index]
  263. this.$cache.put('defaultValue', this.defaultValue)
  264. return true
  265. }
  266. })
  267. this.labelIds = item.labelIds
  268. this.labelNames = item.labelNames
  269. this.cacheSelectedShop(item[0])
  270. this.getTaskDetail()
  271. this.handelShopStatus()
  272. //获取统计数据
  273. this.getStatistic()
  274. },
  275. jump(path) {
  276. let flag = this.handelShopStatus()
  277. if (this.$isNotEmpty(flag)) {
  278. this.$jump(path)
  279. }
  280. },
  281. operate(index) {
  282. if (index == 2) {
  283. this.$jump('/pages/card/card')
  284. return
  285. }
  286. let flag = this.handelShopStatus()
  287. if (this.$isEmpty(flag)) {
  288. return
  289. }
  290. //审核通过,校验是否开启会员中心
  291. if (!this.vuex_isOpenMember && (index == 0 || index == 1)) {
  292. this.isOpenMemberShow = true
  293. return
  294. }
  295. if (index == 0) {
  296. this.$jump('/pages/pay/pay')
  297. } else if (index == 1) {
  298. this.$jump('/pages/checkstand/pay-qrcode')
  299. }
  300. },
  301. handelShopStatus() {
  302. let _this = this
  303. //商户审核通过
  304. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.PASS) {
  305. return true
  306. }
  307. //未完善商户资料
  308. if (!this.vuex_shopStatus) {
  309. uni.showModal({
  310. cancelText: '暂不完善',
  311. confirmText: '去完善',
  312. confirmColor: '#FF9447',
  313. cancelColor: '#606266',
  314. showCancel: true,
  315. title: '提示',
  316. content: '商户资料未完善',
  317. success: (res) => {
  318. if (res.confirm) {
  319. this.$jump('/pages/shop-info/shop-info?phone' + this.$cache.get('phone'))
  320. }
  321. }
  322. })
  323. return
  324. }
  325. //审核失败
  326. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.FAIL) {
  327. this.$dialog.showModal('商户资料审核失败,请重新申请', true).then(res => {
  328. let params = {
  329. isFail: true,
  330. shopId: this.vuex_shopId
  331. }
  332. uni.navigateTo({
  333. url: "/pages/shop-info/shop-info" + this.$u.queryParams(params)
  334. })
  335. })
  336. return
  337. }
  338. //商户已停用
  339. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.STOP) {
  340. this.$dialog.showModal('该商户已停用', false)
  341. return
  342. }
  343. //待审核中
  344. if (this.vuex_shopStatus.includes('WAITING')) {
  345. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.WAITING_SIGN) {
  346. //待签约状态,去签约
  347. uni.showModal({
  348. title: '提示',
  349. content: '商户资料审核通过,请进行签约?',
  350. cancelText: '暂不签约',
  351. confirmColor: '#FF9447',
  352. confirmText: '去签约',
  353. success: function(res) {
  354. if (res.confirm) {
  355. _this.$jump('/pages/webView/webView?url=' + _this.taskDetail.variables
  356. .signUrl)
  357. }
  358. }
  359. });
  360. return
  361. }
  362. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.WAITING_AUTH) {
  363. //待商户认证状态
  364. uni.showModal({
  365. title: '提示',
  366. content: '商户资料审核通过,请进行认证?',
  367. cancelText: '暂不认证',
  368. confirmColor: '#FF9447',
  369. confirmText: '去认证',
  370. success: function(res) {
  371. if (res.confirm) {
  372. _this.$jump('/pages/webView/webView?url=' + _this.taskDetail.variables
  373. .qrcodeUrl)
  374. }
  375. }
  376. });
  377. return
  378. }
  379. //待商场审核,待平台审核,待易宝审核状态下,去审核流程详情页
  380. uni.showModal({
  381. title: '提示',
  382. content: '商户资料审核中,查看审核流程?',
  383. cancelText: '暂不查看',
  384. confirmColor: '#FF9447',
  385. confirmText: '查看',
  386. success: function(res) {
  387. if (res.confirm) {
  388. _this.$jump('/pages/flow/flow')
  389. }
  390. }
  391. });
  392. }
  393. },
  394. /**
  395. * 获取流程节点信息
  396. */
  397. async getTaskDetail() {
  398. let audit = (await this.$api.audit.detail({
  399. entityId: this.vuex_shopId
  400. })).data
  401. if (this.$isEmpty(audit)) {
  402. return
  403. }
  404. let params = {
  405. assignee: '$INITIATOR',
  406. processInstanceId: audit.processInstanceId
  407. }
  408. this.$api.flow.getTaskId(params).then(res => {
  409. this.taskDetail = res.data.records[0]
  410. })
  411. },
  412. }
  413. }
  414. </script>
  415. <style lang="scss" scoped>
  416. .cu-list.grid>.cu-item .cu-tag {
  417. right: auto;
  418. left: 54%;
  419. margin-left: 20rpx;
  420. }
  421. .cu-list.grid.no-border {
  422. padding: 10rpx;
  423. }
  424. .title {
  425. display: flex;
  426. .icon {
  427. background-color: #FFFFFF;
  428. border-radius: 50%;
  429. display: flex;
  430. justify-content: center;
  431. align-items: center;
  432. width: 50rpx;
  433. height: 50rpx;
  434. image {
  435. width: 36rpx;
  436. height: 36rpx;
  437. }
  438. }
  439. text {
  440. font-weight: 800;
  441. font-size: 32rpx;
  442. color: #303030;
  443. }
  444. }
  445. .top-menu {
  446. border-radius: 20rpx;
  447. margin-top: 20rpx;
  448. background-image: linear-gradient(to right, #FBA33D, #FF8D32);
  449. }
  450. .menu-list {
  451. display: flex;
  452. justify-content: space-between;
  453. padding-top: 20rpx;
  454. .menu {
  455. background-color: #FFFFFF;
  456. width: 49%;
  457. display: flex;
  458. flex-direction: column;
  459. align-items: center;
  460. border-radius: 16rpx;
  461. padding: 30rpx 15rpx;
  462. .menu-top {
  463. display: flex;
  464. image {
  465. width: 60rpx;
  466. height: 60rpx;
  467. }
  468. }
  469. .menu-bottom {
  470. padding-top: 20rpx;
  471. font-size: 30rpx;
  472. display: flex;
  473. justify-content: space-around;
  474. width: 100%;
  475. view {
  476. display: flex;
  477. flex-direction: column;
  478. text-align: center;
  479. text:first-child {
  480. margin-bottom: 10rpx;
  481. font-size: 26rpx;
  482. color: #303030;
  483. font-weight: 400;
  484. }
  485. text:last-child {
  486. margin-bottom: 10rpx;
  487. font-size: 28rpx;
  488. color: #FF8D32;
  489. font-weight: 500;
  490. }
  491. }
  492. }
  493. }
  494. }
  495. .market {
  496. margin-top: 20rpx;
  497. border-radius: 20rpx;
  498. background-color: #FFFFFF;
  499. padding: 30rpx 30rpx 20rpx;
  500. .title {
  501. font-size: 32rpx;
  502. font-weight: 800;
  503. }
  504. }
  505. .system {
  506. margin-top: 20rpx;
  507. border-radius: 20rpx;
  508. background-color: #FFFFFF;
  509. padding: 30rpx 50rpx 20rpx;
  510. .title {
  511. font-size: 32rpx;
  512. font-weight: 800;
  513. }
  514. }
  515. .btn {
  516. margin-right: -30rpx;
  517. display: flex;
  518. .image {
  519. display: flex;
  520. justify-content: center;
  521. align-items: center;
  522. border-radius: 50%;
  523. background-color: #FFFFFF;
  524. padding: 8rpx;
  525. image {
  526. width: 20rpx;
  527. height: 20rpx;
  528. }
  529. }
  530. color: #FFFFFF;
  531. border-radius: 50rpx 0 0 50rpx;
  532. padding:8rpx 10rpx 8rpx 35rpx;
  533. background-image: linear-gradient(to right, #FFD67B, #F99200);
  534. }
  535. .money {
  536. font-size: 80rpx;
  537. color: $u-type-warning;
  538. position: relative;
  539. .close {
  540. position: absolute;
  541. top: 20rpx;
  542. right: 20rpx;
  543. line-height: 28rpx;
  544. font-size: 28rpx;
  545. }
  546. }
  547. </style>