index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  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/dianpu.png" mode=""></image>
  9. </view>
  10. <view class="center margin-left-10">
  11. <view @click="shopShow=true">
  12. <text class="name">{{shopLable}}</text>
  13. <u-icon v-if="shopShow" name="arrow-up-fill" style="margin-left: 10rpx;"></u-icon>
  14. <u-icon v-else name="arrow-down-fill" style="margin-left: 10rpx;"></u-icon>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="btn">
  19. <view class="image">
  20. <image src="@/static/icon/logout.png" mode=""></image>
  21. </view>
  22. <view @click="logout" class="center padding-left-10">
  23. <text>退出</text>
  24. <text class="cuIcon-right"></text>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="cu-list grid col-3 no-border top-menu">
  29. <view class="cu-item" @click="operate(index)" v-for="(item,index) in menuList" :key="index">
  30. <view class="grid-icon margin-top-20">
  31. <image style="width: 66rpx;height: 66rpx;" :src="item.icon" />
  32. </view>
  33. <text style="color: #fff;font-size: 26rpx;">{{item.name}}</text>
  34. </view>
  35. </view>
  36. <view class="menu-list">
  37. <view @click="$jump('/pages/bill/bill')" class="menu menu1">
  38. <view class="menu-top">
  39. <image src="@/static/icon/bill.png"></image>
  40. <view class="center padding-left-20">
  41. <text class="text-lg">我的账单</text>
  42. </view>
  43. </view>
  44. <view class="menu-bottom">
  45. <view class="">
  46. <text>今日营收</text>
  47. <text>{{statistic.todayCharge || 0}}</text>
  48. </view>
  49. <view class="">
  50. <text>总资产</text>
  51. <text>{{statistic.totalValue || 0}}</text>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="menu menu2" @click="$jump('/pages/member/member')">
  56. <view class="menu-top">
  57. <image src="@/static/icon/center.png"></image>
  58. <view class="center padding-left-20">
  59. <text class="text-lg">会员中心</text>
  60. </view>
  61. </view>
  62. <view class="menu-bottom" style="color: #FFFFFF;">
  63. <view class="">
  64. <text>新增会员</text>
  65. <text>{{statistic.newMember || 0}}</text>
  66. </view>
  67. <view class="">
  68. <text>会员总数</text>
  69. <text>{{statistic.allMembers || 0}}</text>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="market">
  75. <text class="title">营销管理</text>
  76. <view class="cu-list grid col-2 no-border margin-top-30">
  77. <view class="cu-item" @click="$jump(item.path)" v-for="(item,index) in marketList" :key="index">
  78. <view class="grid-icon">
  79. <image style="width: 120rpx;height: 120rpx;" :src="item.icon" />
  80. </view>
  81. <text style="color: #222222;font-size: 26rpx;margin-top: 20rpx;">{{item.name}}</text>
  82. <view class="cu-tag bg-red badge" v-if="item.count>0">{{item.count}}</view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="system">
  87. <text class="title">数字化系统</text>
  88. <view class="cu-list grid col-4 no-border margin-top-30" style="border-radius:20rpx ;">
  89. <view class="cu-item" @click="$jump(item.path)" v-for="(item,index) in systemList" :key="index">
  90. <view class="grid-icon">
  91. <image style="height: 56rpx;width: 56rpx;" :src="item.icon" />
  92. </view>
  93. <text style="color: #222222;font-size: 26rpx;">{{item.name}}</text>
  94. <view class="cu-tag bg-red badge" v-if="item.count>0">{{item.count}}</view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <u-modal @confirm="$jump('/pages/member/member')" :show-cancel-button="true" confirm-color="#ff9447" confirm-text="立即开启" cancel-text="暂不开启" v-model="isOpenMemberShow" content="请先创建会员中心"></u-modal>
  100. <u-select @confirm="shopConfirm" v-model="shopShow" value-name="id" label-name="name" :list="shopList">
  101. </u-select>
  102. </view>
  103. </template>
  104. <script>
  105. export default {
  106. data() {
  107. return {
  108. //下拉选择商铺
  109. shopShow: false,
  110. //我的商铺列表
  111. shopList: [],
  112. //选中的商铺id
  113. shopId: '',
  114. //选中的商铺labe
  115. shopLable: '',
  116. labelIds: '',
  117. labelNames: '',
  118. //选中的商铺所属的商场
  119. mallId: '',
  120. //统计数据
  121. statistic: {},
  122. //菜单
  123. menuList: [{
  124. icon: '/static/icon/scan.png',
  125. name: '扫一扫',
  126. },
  127. {
  128. icon: '/static/icon/pay.png',
  129. name: '收款码',
  130. },
  131. {
  132. icon: '/static/icon/card.png',
  133. name: '卡包',
  134. }
  135. ],
  136. marketList: [{
  137. icon: '/static/icon/faqi.png',
  138. name: '发起活动',
  139. background: "background-image:linear-gradient(#FF9549,#FCB07B)",
  140. path: '/pages/publish/publish',
  141. count: 0
  142. },
  143. {
  144. icon: '/static/icon/qingdan.png',
  145. name: '活动清单',
  146. background: "background-image:linear-gradient(#5892F7,#67BBF9)",
  147. path: '/pages/activity/activity',
  148. count: 0
  149. },
  150. ],
  151. systemList: [
  152. {
  153. icon: '/static/icon/system5.png',
  154. name: '添加门店',
  155. path: '/pages/shop-info/shop-info?phone='+this.$cache.get('phone')
  156. },{
  157. icon: '/static/icon/system1.png',
  158. name: '外卖平台',
  159. path: ''
  160. },
  161. {
  162. icon: '/static/icon/system2.png',
  163. name: '预约系统',
  164. path: ''
  165. },
  166. {
  167. icon: '/static/icon/system3.png',
  168. name: 'ERP系统',
  169. path: ''
  170. },
  171. {
  172. icon: '/static/icon/system4.png',
  173. name: '线上商城',
  174. path: ''
  175. },
  176. {
  177. icon: '/static/icon/add.png',
  178. name: '添加服务',
  179. path: ''
  180. },
  181. ],
  182. //是否开启会员中心
  183. isOpenMember:false,
  184. isOpenMemberShow:false,
  185. }
  186. },
  187. onShow() {
  188. this.init()
  189. },
  190. methods: {
  191. logout() {
  192. this.$dialog.showModal('确定要退出吗?').then(res => {
  193. uni.clearStorage()
  194. uni.reLaunch({
  195. url: "../login/account-login"
  196. })
  197. })
  198. },
  199. async init() {
  200. let phone = this.$cache.get('phone')
  201. let params = {
  202. personTel: phone,
  203. auditStatus: this.$global.SHOP_AUDIT.PASS //审核通过
  204. }
  205. let res = await this.$api.shop.list(params)
  206. if (this.$isEmpty(res.data.records)) {
  207. this.$dialog.showModal('找不到商户信息',false).then(()=>{
  208. this.$cache.clear()
  209. uni.reLaunch({
  210. url:"/pages/login/account-login"
  211. })
  212. })
  213. }
  214. this.shopList = res.data.records
  215. let item = this.shopList[0]
  216. this.shopId = item.id
  217. this.shopLable = item.name
  218. this.labelIds = item.labelIds
  219. this.labelNames = item.labelNames
  220. this.mallId = item.mallId
  221. this.cacheSelectedShop(item)
  222. //获取统计数据
  223. this.getStatistic()
  224. },
  225. getStatistic() {
  226. this.$api.shop.statistic({shopId:this.shopId}).then(res => {
  227. this.statistic = res.data
  228. })
  229. },
  230. cacheSelectedShop(item) {
  231. let selectedShop = {
  232. id: this.shopId,
  233. label: this.shopLable,
  234. labelIds: this.labelIds,
  235. labelNames: this.labelNames
  236. }
  237. this.$cache.put("selectedShop", Object.assign(item, selectedShop))
  238. this.$u.vuex('vuex_shopId', this.shopId)
  239. this.$u.vuex('vuex_mallId', this.mallId)
  240. this.$u.vuex('vuex_isOpenMember',item.isOpenMember==1?true:false)
  241. },
  242. shopConfirm(e) {
  243. this.shopId = e[0].value
  244. this.shopLable = e[0].label
  245. let item = this.shopList.filter((item) => {
  246. if (this.shopId == item.id) {
  247. return true
  248. }
  249. })
  250. this.labelIds = item.labelIds
  251. this.labelNames = item.labelNames
  252. this.cacheSelectedShop(item[0])
  253. //获取统计数据
  254. this.getStatistic()
  255. },
  256. operate(index) {
  257. if (!this.vuex_isOpenMember && (index== 0 || index==1)) {
  258. this.isOpenMemberShow=true
  259. return
  260. }
  261. if (index == 0) {
  262. this.$jump('/pages/pay/pay')
  263. } else if (index == 1) {
  264. this.$jump('/pages/checkstand/pay-qrcode')
  265. } else if (index == 2) {
  266. this.$jump('/pages/card/card')
  267. }
  268. },
  269. }
  270. }
  271. </script>
  272. <style lang="scss" scoped>
  273. .cu-list.grid>.cu-item .cu-tag {
  274. right: auto;
  275. left: 54%;
  276. margin-left: 20rpx;
  277. }
  278. .title {
  279. display: flex;
  280. .icon {
  281. background-color: #FFFFFF;
  282. border-radius: 50%;
  283. display: flex;
  284. justify-content: center;
  285. align-items: center;
  286. width: 50rpx;
  287. height: 50rpx;
  288. image {
  289. width: 36rpx;
  290. height: 36rpx;
  291. }
  292. }
  293. text {
  294. font-weight: 800;
  295. font-size: 32rpx;
  296. color: #303030;
  297. }
  298. }
  299. .top-menu {
  300. border-radius: 20rpx;
  301. margin-top: 20rpx;
  302. background-image: linear-gradient(to right, #FBA33D, #FF8D32);
  303. }
  304. .menu-list {
  305. display: flex;
  306. justify-content: space-between;
  307. padding-top: 20rpx;
  308. .menu {
  309. width: 48.8%;
  310. color: #FFFFFF;
  311. display: flex;
  312. flex-direction: column;
  313. align-items: center;
  314. border-radius: 14rpx;
  315. padding: 30rpx 20rpx;
  316. .menu-top {
  317. display: flex;
  318. image {
  319. width: 70rpx;
  320. height: 70rpx;
  321. }
  322. }
  323. .menu-bottom {
  324. padding-top: 20rpx;
  325. font-size: 30rpx;
  326. display: flex;
  327. justify-content: space-around;
  328. width: 100%;
  329. view {
  330. display: flex;
  331. flex-direction: column;
  332. text-align: center;
  333. text:first-child {
  334. margin-bottom: 10rpx;
  335. font-size: 26rpx;
  336. color: #E0E2F6;
  337. }
  338. }
  339. }
  340. }
  341. .menu1 {
  342. background-color: #5C6186;
  343. }
  344. .menu2 {
  345. background-color: #E19D5B;
  346. }
  347. }
  348. .market {
  349. margin-top: 20rpx;
  350. border-radius: 20rpx;
  351. background-color: #FFFFFF;
  352. padding: 30rpx 50rpx 20rpx;
  353. .title {
  354. font-weight: 800;
  355. }
  356. }
  357. .system {
  358. margin-top: 20rpx;
  359. border-radius: 20rpx;
  360. background-color: #FFFFFF;
  361. padding: 30rpx 50rpx 20rpx;
  362. .title {
  363. font-weight: 800;
  364. }
  365. }
  366. .btn {
  367. margin-right: -30rpx;
  368. display: flex;
  369. .image {
  370. display: flex;
  371. justify-content: center;
  372. align-items: center;
  373. border-radius: 50%;
  374. background-color: #FFFFFF;
  375. padding: 8rpx;
  376. image {
  377. width: 20rpx;
  378. height: 20rpx;
  379. }
  380. }
  381. color: #FFFFFF;
  382. border-radius: 50rpx 0 0 50rpx;
  383. padding:8rpx 10rpx 8rpx 35rpx;
  384. background-image: linear-gradient(to right, #FFD67B, #F99200);
  385. }
  386. .money {
  387. font-size: 80rpx;
  388. color: $u-type-warning;
  389. position: relative;
  390. .close {
  391. position: absolute;
  392. top: 20rpx;
  393. right: 20rpx;
  394. line-height: 28rpx;
  395. font-size: 28rpx;
  396. }
  397. }
  398. </style>