index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  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: '/pagesGoods/pages/order/order',
  152. count: 0
  153. },
  154. {
  155. icon: '/static/index/notice2.png',
  156. name: '通知公告',
  157. path: '/pages/notice/list',
  158. count: 0
  159. },
  160. ],
  161. systemList: [{
  162. icon: '/static/index/shangcheng.png',
  163. name: '线上商城',
  164. path: '/pagesGoods/pages/menu/menu'
  165. }, {
  166. icon: '/static/index/mendian.png',
  167. name: '门店管理',
  168. path: ''
  169. }, {
  170. icon: '/static/index/waimai.png',
  171. name: '外卖平台',
  172. path: ''
  173. },
  174. {
  175. icon: '/static/index/yuyue.png',
  176. name: '预约系统',
  177. path: ''
  178. },
  179. {
  180. icon: '/static/index/erp.png',
  181. name: 'ERP系统',
  182. path: ''
  183. },
  184. {
  185. icon: '/static/index/add.png',
  186. name: '添加服务',
  187. path: ''
  188. },
  189. ],
  190. //是否开启会员中心
  191. isOpenMember: false,
  192. isOpenMemberShow: false,
  193. //流程节点信息
  194. taskDetail: {}
  195. }
  196. },
  197. onShow() {
  198. this.init()
  199. },
  200. methods: {
  201. showShop() {
  202. if (this.$isEmpty(this.shopLable)) {
  203. uni.navigateTo({
  204. url: "/pages/shop-info/shop-info?phone=" + this.$cache.get('phone')
  205. })
  206. } else {
  207. this.shopShow = !this.shopShow
  208. }
  209. },
  210. async init() {
  211. let phone = this.$cache.get('phone')
  212. let params = {
  213. personTel: phone,
  214. }
  215. let res = await this.$api.shop.list(params)
  216. if (this.$isEmpty(res.data.records)) {
  217. this.$u.vuex('vuex_shopStatus', false)
  218. return
  219. }
  220. if (this.$cache.get('defaultValue')) {
  221. this.defaultValue = this.$cache.get('defaultValue')
  222. }
  223. this.shopList = res.data.records
  224. let item = this.shopList[this.defaultValue[0]]
  225. this.shopId = item.id
  226. this.shopLable = item.name
  227. this.labelIds = item.labelIds
  228. this.labelNames = item.labelNames
  229. this.mallId = item.mallId
  230. this.cacheSelectedShop(item)
  231. this.getTaskDetail()
  232. if (!this.isFirst) {
  233. this.handelShopStatus()
  234. }
  235. this.isFirst = true
  236. //获取统计数据
  237. this.getStatistic()
  238. },
  239. getStatistic() {
  240. if (this.$isEmpty(this.vuex_merchantNo)) {
  241. return
  242. }
  243. this.$api.shop.statistic({
  244. shopId: this.shopId
  245. }).then(res => {
  246. this.statistic = res.data
  247. })
  248. },
  249. cacheSelectedShop(item) {
  250. let selectedShop = {
  251. id: this.shopId,
  252. label: this.shopLable,
  253. labelIds: this.labelIds,
  254. labelNames: this.labelNames
  255. }
  256. this.$cache.put("selectedShop", Object.assign(item, selectedShop))
  257. this.$u.vuex('vuex_shopStatus', item.auditStatus)
  258. this.$u.vuex('vuex_shopId', this.shopId)
  259. this.$u.vuex('vuex_merchantNo', item.merchantNo)
  260. this.$u.vuex('vuex_mallId', this.mallId)
  261. this.$u.vuex('vuex_isOpenMember', item.isOpenMember == 1 ? true : false)
  262. },
  263. shopConfirm(e) {
  264. this.shopId = e[0].value
  265. this.shopLable = e[0].label
  266. let item = this.shopList.filter((item, index) => {
  267. if (this.shopId == item.id) {
  268. this.defaultValue = [index]
  269. this.$cache.put('defaultValue', this.defaultValue)
  270. return true
  271. }
  272. })
  273. this.labelIds = item.labelIds
  274. this.labelNames = item.labelNames
  275. this.cacheSelectedShop(item[0])
  276. this.getTaskDetail()
  277. this.handelShopStatus()
  278. //获取统计数据
  279. this.getStatistic()
  280. },
  281. jump(path) {
  282. let flag = this.handelShopStatus()
  283. if (this.$isNotEmpty(flag)) {
  284. this.$jump(path)
  285. }
  286. },
  287. operate(index) {
  288. if (index == 2) {
  289. this.$jump('/pages/card/card')
  290. return
  291. }
  292. let flag = this.handelShopStatus()
  293. if (this.$isEmpty(flag)) {
  294. return
  295. }
  296. //审核通过,校验是否开启会员中心
  297. if (!this.vuex_isOpenMember && (index == 0 || index == 1)) {
  298. this.isOpenMemberShow = true
  299. return
  300. }
  301. if (index == 0) {
  302. this.$jump('/pages/pay/pay')
  303. } else if (index == 1) {
  304. this.$jump('/pages/checkstand/pay-qrcode')
  305. }
  306. },
  307. handelShopStatus() {
  308. let _this = this
  309. //商户审核通过
  310. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.PASS) {
  311. return true
  312. }
  313. //未完善商户资料
  314. if (!this.vuex_shopStatus) {
  315. uni.showModal({
  316. cancelText: '暂不完善',
  317. confirmText: '去完善',
  318. confirmColor: '#FF9447',
  319. cancelColor: '#606266',
  320. showCancel: true,
  321. title: '提示',
  322. content: '商户资料未完善',
  323. success: (res) => {
  324. if (res.confirm) {
  325. this.$jump('/pages/shop-info/shop-info?phone' + this.$cache.get('phone'))
  326. }
  327. }
  328. })
  329. return
  330. }
  331. //审核失败
  332. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.FAIL) {
  333. this.$dialog.showModal('商户资料审核失败,请重新申请', true).then(res => {
  334. let params = {
  335. isFail: true,
  336. shopId: this.vuex_shopId
  337. }
  338. uni.navigateTo({
  339. url: "/pages/shop-info/shop-info" + this.$u.queryParams(params)
  340. })
  341. })
  342. return
  343. }
  344. //商户已停用
  345. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.STOP) {
  346. this.$dialog.showModal('该商户已停用', false)
  347. return
  348. }
  349. //待审核中
  350. if (this.vuex_shopStatus.includes('WAITING')) {
  351. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.WAITING_SIGN) {
  352. //待签约状态,去签约
  353. uni.showModal({
  354. title: '提示',
  355. content: '商户资料审核通过,请进行签约?',
  356. cancelText: '暂不签约',
  357. confirmColor: '#FF9447',
  358. confirmText: '去签约',
  359. success: function(res) {
  360. if (res.confirm) {
  361. _this.$jump('/pages/webView/webView?url=' + _this.taskDetail.variables
  362. .signUrl)
  363. }
  364. }
  365. });
  366. return
  367. }
  368. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.WAITING_AUTH) {
  369. //待商户认证状态
  370. uni.showModal({
  371. title: '提示',
  372. content: '商户资料审核通过,请进行认证?',
  373. cancelText: '暂不认证',
  374. confirmColor: '#FF9447',
  375. confirmText: '去认证',
  376. success: function(res) {
  377. if (res.confirm) {
  378. _this.$jump('/pages/auth/auth?src=' + _this.taskDetail.variables
  379. .qrcodeUrl)
  380. }
  381. }
  382. });
  383. return
  384. }
  385. //待商场审核,待平台审核,待易宝审核状态下,去审核流程详情页
  386. uni.showModal({
  387. title: '提示',
  388. content: '商户资料审核中,查看审核流程?',
  389. cancelText: '暂不查看',
  390. confirmColor: '#FF9447',
  391. confirmText: '查看',
  392. success: function(res) {
  393. if (res.confirm) {
  394. _this.$jump('/pages/flow/flow')
  395. }
  396. }
  397. });
  398. }
  399. },
  400. /**
  401. * 获取流程节点信息
  402. */
  403. async getTaskDetail() {
  404. let audit = (await this.$api.audit.detail({
  405. entityId: this.vuex_shopId
  406. })).data
  407. if (this.$isEmpty(audit)) {
  408. return
  409. }
  410. let params = {
  411. assignee: '$INITIATOR',
  412. processInstanceId: audit.processInstanceId
  413. }
  414. this.$api.flow.getTaskId(params).then(res => {
  415. this.taskDetail = res.data.records[0]
  416. })
  417. },
  418. }
  419. }
  420. </script>
  421. <style lang="scss" scoped>
  422. .cu-list.grid>.cu-item .cu-tag {
  423. right: auto;
  424. left: 54%;
  425. margin-left: 20rpx;
  426. }
  427. .cu-list.grid.no-border {
  428. padding: 10rpx;
  429. }
  430. .title {
  431. display: flex;
  432. .icon {
  433. background-color: #FFFFFF;
  434. border-radius: 50%;
  435. display: flex;
  436. justify-content: center;
  437. align-items: center;
  438. width: 50rpx;
  439. height: 50rpx;
  440. image {
  441. width: 36rpx;
  442. height: 36rpx;
  443. }
  444. }
  445. text {
  446. font-weight: 800;
  447. font-size: 32rpx;
  448. color: #303030;
  449. }
  450. }
  451. .top-menu {
  452. border-radius: 20rpx;
  453. margin-top: 20rpx;
  454. background-image: linear-gradient(to right, #FBA33D, #FF8D32);
  455. }
  456. .menu-list {
  457. display: flex;
  458. justify-content: space-between;
  459. padding-top: 20rpx;
  460. .menu {
  461. background-color: #FFFFFF;
  462. width: 49%;
  463. display: flex;
  464. flex-direction: column;
  465. align-items: center;
  466. border-radius: 16rpx;
  467. padding: 30rpx 15rpx;
  468. .menu-top {
  469. display: flex;
  470. image {
  471. width: 60rpx;
  472. height: 60rpx;
  473. }
  474. }
  475. .menu-bottom {
  476. padding-top: 20rpx;
  477. font-size: 30rpx;
  478. display: flex;
  479. justify-content: space-around;
  480. width: 100%;
  481. view {
  482. display: flex;
  483. flex-direction: column;
  484. text-align: center;
  485. text:first-child {
  486. margin-bottom: 10rpx;
  487. font-size: 26rpx;
  488. color: #303030;
  489. font-weight: 400;
  490. }
  491. text:last-child {
  492. margin-bottom: 10rpx;
  493. font-size: 28rpx;
  494. color: #FF8D32;
  495. font-weight: 500;
  496. }
  497. }
  498. }
  499. }
  500. }
  501. .market {
  502. margin-top: 20rpx;
  503. border-radius: 20rpx;
  504. background-color: #FFFFFF;
  505. padding: 30rpx 30rpx 20rpx;
  506. .title {
  507. font-size: 32rpx;
  508. font-weight: 800;
  509. }
  510. }
  511. .system {
  512. margin-top: 20rpx;
  513. border-radius: 20rpx;
  514. background-color: #FFFFFF;
  515. padding: 30rpx 50rpx 20rpx;
  516. .title {
  517. font-size: 32rpx;
  518. font-weight: 800;
  519. }
  520. }
  521. .btn {
  522. margin-right: -30rpx;
  523. display: flex;
  524. .image {
  525. display: flex;
  526. justify-content: center;
  527. align-items: center;
  528. border-radius: 50%;
  529. background-color: #FFFFFF;
  530. padding: 8rpx;
  531. image {
  532. width: 20rpx;
  533. height: 20rpx;
  534. }
  535. }
  536. color: #FFFFFF;
  537. border-radius: 50rpx 0 0 50rpx;
  538. padding:8rpx 10rpx 8rpx 35rpx;
  539. background-image: linear-gradient(to right, #FFD67B, #F99200);
  540. }
  541. .money {
  542. font-size: 80rpx;
  543. color: $u-type-warning;
  544. position: relative;
  545. .close {
  546. position: absolute;
  547. top: 20rpx;
  548. right: 20rpx;
  549. line-height: 28rpx;
  550. font-size: 28rpx;
  551. }
  552. }
  553. </style>