index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  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" value-name="id" label-name="name" :list="shopList">
  93. </u-select>
  94. </view>
  95. </template>
  96. <script>
  97. export default {
  98. data() {
  99. return {
  100. //下拉选择商铺
  101. shopShow: false,
  102. //我的商铺列表
  103. shopList: [],
  104. defaultValue:[0],
  105. //选中的商铺id
  106. shopId: '',
  107. //选中的商铺labe
  108. shopLable: '',
  109. labelIds: '',
  110. labelNames: '',
  111. //选中的商铺所属的商场
  112. mallId: '',
  113. //统计数据
  114. statistic: {},
  115. //菜单
  116. menuList: [{
  117. icon: '/static/icon/scan.png',
  118. name: '扫一扫',
  119. },
  120. {
  121. icon: '/static/icon/pay.png',
  122. name: '收款码',
  123. },
  124. {
  125. icon: '/static/icon/card.png',
  126. name: '卡包',
  127. }
  128. ],
  129. marketList: [{
  130. icon: '/static/index/faqi.png',
  131. name: '发起活动',
  132. path: '/pages/publish/publish',
  133. count: 0
  134. },
  135. {
  136. icon: '/static/index/qingdan.png',
  137. name: '活动清单',
  138. path: '/pages/activity/activity',
  139. count: 0
  140. },
  141. {
  142. icon: '/static/index/mendian-add.png',
  143. name: '添加门店',
  144. path: '/pages/shop-info/shop-info',
  145. count: 0
  146. },
  147. {
  148. icon: '/static/index/dingdan3.png',
  149. name: '订单中心',
  150. path: '/pages/order/order',
  151. count: 0
  152. },
  153. ],
  154. systemList: [{
  155. icon: '/static/index/shangcheng.png',
  156. name: '线上商城',
  157. path: '/pagesGoods/pages/menu/menu'
  158. }, {
  159. icon: '/static/index/mendian.png',
  160. name: '门店管理',
  161. path: ''
  162. }
  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. let flag=this.handelShopStatus()
  283. if (this.$isEmpty(flag)) {
  284. return
  285. }
  286. //审核通过,校验是否开启会员中心
  287. if (!this.vuex_isOpenMember && (index == 0 || index == 1)) {
  288. this.isOpenMemberShow = true
  289. return
  290. }
  291. if (index == 0) {
  292. this.$jump('/pages/pay/pay')
  293. } else if (index == 1) {
  294. this.$jump('/pages/checkstand/pay-qrcode')
  295. } else if (index == 2) {
  296. this.$jump('/pages/card/card')
  297. }
  298. },
  299. handelShopStatus() {
  300. let _this=this
  301. //商户审核通过
  302. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.PASS) {
  303. return true
  304. }
  305. //未完善商户资料
  306. if (!this.vuex_shopStatus) {
  307. uni.showModal({
  308. cancelText:'暂不完善',
  309. confirmText:'去完善',
  310. confirmColor:'#FF9447',
  311. cancelColor:'#606266',
  312. showCancel:true,
  313. title:'提示',
  314. content:'商户资料未完善',
  315. success: (res) => {
  316. if (res.confirm) {
  317. this.$jump('/pages/shop-info/shop-info?phone'+ this.$cache.get('phone'))
  318. }
  319. }
  320. })
  321. return
  322. }
  323. //审核失败
  324. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.FAIL) {
  325. this.$dialog.showModal('商户资料审核失败,请重新申请', true).then(res => {
  326. let params = {
  327. isFail: true,
  328. shopId: this.vuex_shopId
  329. }
  330. uni.navigateTo({
  331. url: "/pages/shop-info/shop-info" + this.$u.queryParams(params)
  332. })
  333. })
  334. return
  335. }
  336. //商户已停用
  337. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.STOP) {
  338. this.$dialog.showModal('该商户已停用',false)
  339. return
  340. }
  341. //待审核中
  342. if (this.vuex_shopStatus.includes('WAITING')) {
  343. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.WAITING_SIGN) {
  344. //待签约状态,去签约
  345. uni.showModal({
  346. title: '提示',
  347. content: '商户资料审核通过,请进行签约?',
  348. cancelText:'暂不签约',
  349. confirmColor:'#FF9447',
  350. confirmText:'去签约',
  351. success: function (res) {
  352. if (res.confirm) {
  353. _this.$jump('/pages/webView/webView?url=' + _this.taskDetail.variables.signUrl)
  354. }
  355. }
  356. });
  357. return
  358. }
  359. if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.WAITING_AUTH) {
  360. //待商户认证状态
  361. uni.showModal({
  362. title: '提示',
  363. content: '商户资料审核通过,请进行认证?',
  364. cancelText:'暂不认证',
  365. confirmColor:'#FF9447',
  366. confirmText:'去认证',
  367. success: function (res) {
  368. if (res.confirm) {
  369. _this.$jump('/pages/webView/webView?url=' + _this.taskDetail.variables.qrcodeUrl)
  370. }
  371. }
  372. });
  373. return
  374. }
  375. //待商场审核,待平台审核,待易宝审核状态下,去审核流程详情页
  376. uni.showModal({
  377. title: '提示',
  378. content: '商户资料审核中,查看审核流程?',
  379. cancelText:'暂不查看',
  380. confirmColor:'#FF9447',
  381. confirmText:'查看',
  382. success: function (res) {
  383. if (res.confirm) {
  384. _this.$jump('/pages/flow/flow')
  385. }
  386. }
  387. });
  388. }
  389. },
  390. /**
  391. * 获取流程节点信息
  392. */
  393. async getTaskDetail() {
  394. let audit = (await this.$api.audit.detail({
  395. entityId: this.vuex_shopId
  396. })).data
  397. if (this.$isEmpty(audit)) {
  398. return
  399. }
  400. let params = {
  401. assignee: '$INITIATOR',
  402. processInstanceId: audit.processInstanceId
  403. }
  404. this.$api.flow.getTaskId(params).then(res => {
  405. this.taskDetail = res.data.records[0]
  406. })
  407. },
  408. }
  409. }
  410. </script>
  411. <style lang="scss" scoped>
  412. .cu-list.grid>.cu-item .cu-tag {
  413. right: auto;
  414. left: 54%;
  415. margin-left: 20rpx;
  416. }
  417. .cu-list.grid.no-border {
  418. padding: 10rpx;
  419. }
  420. .title {
  421. display: flex;
  422. .icon {
  423. background-color: #FFFFFF;
  424. border-radius: 50%;
  425. display: flex;
  426. justify-content: center;
  427. align-items: center;
  428. width: 50rpx;
  429. height: 50rpx;
  430. image {
  431. width: 36rpx;
  432. height: 36rpx;
  433. }
  434. }
  435. text {
  436. font-weight: 800;
  437. font-size: 32rpx;
  438. color: #303030;
  439. }
  440. }
  441. .top-menu {
  442. border-radius: 20rpx;
  443. margin-top: 20rpx;
  444. background-image: linear-gradient(to right, #FBA33D, #FF8D32);
  445. }
  446. .menu-list {
  447. display: flex;
  448. justify-content: space-between;
  449. padding-top: 20rpx;
  450. .menu {
  451. background-color: #FFFFFF;
  452. width: 49%;
  453. display: flex;
  454. flex-direction: column;
  455. align-items: center;
  456. border-radius: 16rpx;
  457. padding: 30rpx 15rpx;
  458. .menu-top {
  459. display: flex;
  460. image {
  461. width: 60rpx;
  462. height: 60rpx;
  463. }
  464. }
  465. .menu-bottom {
  466. padding-top: 20rpx;
  467. font-size: 30rpx;
  468. display: flex;
  469. justify-content: space-around;
  470. width: 100%;
  471. view {
  472. display: flex;
  473. flex-direction: column;
  474. text-align: center;
  475. text:first-child {
  476. margin-bottom: 10rpx;
  477. font-size: 26rpx;
  478. color: #303030;
  479. font-weight: 400;
  480. }
  481. text:last-child {
  482. margin-bottom: 10rpx;
  483. font-size: 28rpx;
  484. color: #FF8D32;
  485. font-weight: 500;
  486. }
  487. }
  488. }
  489. }
  490. }
  491. .market {
  492. margin-top: 20rpx;
  493. border-radius: 20rpx;
  494. background-color: #FFFFFF;
  495. padding: 30rpx 30rpx 20rpx;
  496. .title {
  497. font-size: 32rpx;
  498. font-weight: 800;
  499. }
  500. }
  501. .system {
  502. margin-top: 20rpx;
  503. border-radius: 20rpx;
  504. background-color: #FFFFFF;
  505. padding: 30rpx 50rpx 20rpx;
  506. .title {
  507. font-size: 32rpx;
  508. font-weight: 800;
  509. }
  510. }
  511. .btn {
  512. margin-right: -30rpx;
  513. display: flex;
  514. .image {
  515. display: flex;
  516. justify-content: center;
  517. align-items: center;
  518. border-radius: 50%;
  519. background-color: #FFFFFF;
  520. padding: 8rpx;
  521. image {
  522. width: 20rpx;
  523. height: 20rpx;
  524. }
  525. }
  526. color: #FFFFFF;
  527. border-radius: 50rpx 0 0 50rpx;
  528. padding:8rpx 10rpx 8rpx 35rpx;
  529. background-image: linear-gradient(to right, #FFD67B, #F99200);
  530. }
  531. .money {
  532. font-size: 80rpx;
  533. color: $u-type-warning;
  534. position: relative;
  535. .close {
  536. position: absolute;
  537. top: 20rpx;
  538. right: 20rpx;
  539. line-height: 28rpx;
  540. font-size: 28rpx;
  541. }
  542. }
  543. </style>