index.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  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.todayIncome}}</text>
  48. </view>
  49. <view class="">
  50. <text>总资产</text>
  51. <text>{{statistic.totalAccount}}</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.todayMemberIn}}</text>
  66. </view>
  67. <view class="">
  68. <text>会员总数</text>
  69. <text>{{statistic.memberCount}}</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 mode="heightFix" style="height: 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-select @confirm="shopConfirm" v-model="shopShow" value-name="id" label-name="name" :list="shopList"></u-select>
  100. </view>
  101. </template>
  102. <script>
  103. export default {
  104. data() {
  105. return {
  106. //下拉选择商铺
  107. shopShow:false,
  108. //我的商铺列表
  109. shopList:[],
  110. //选中的商铺id
  111. shopId:'',
  112. //选中的商铺labe
  113. shopLable:'',
  114. labelIds:'',
  115. labelNames:'',
  116. //选中的商铺所属的商场
  117. mallId:'',
  118. //统计数据
  119. statistic:{},
  120. menuList: [{
  121. icon: '/static/icon/scan.png',
  122. name: '扫一扫',
  123. },
  124. {
  125. icon: '/static/icon/pay.png',
  126. name: '收款码',
  127. },
  128. {
  129. icon: '/static/icon/card.png',
  130. name: '卡包',
  131. }
  132. ],
  133. marketList: [{
  134. icon: '/static/icon/faqi.png',
  135. name: '发起活动',
  136. background: "background-image:linear-gradient(#FF9549,#FCB07B)",
  137. path: '/pages/publish/publish',
  138. count: 0
  139. },
  140. {
  141. icon: '/static/icon/qingdan.png',
  142. name: '活动清单',
  143. background: "background-image:linear-gradient(#5892F7,#67BBF9)",
  144. path: '/pages/activity/activity',
  145. count: 0
  146. },
  147. ],
  148. systemList: [{
  149. icon: '/static/icon/system1.png',
  150. name: '外卖平台',
  151. path: '/pages/mine/card/card'
  152. },
  153. {
  154. icon: '/static/icon/system2.png',
  155. name: '预约系统',
  156. path: '/pages/mine/card/card'
  157. },
  158. {
  159. icon: '/static/icon/system3.png',
  160. name: 'ERP系统',
  161. path: '/pages/mine/card/card'
  162. },
  163. {
  164. icon: '/static/icon/system4.png',
  165. name: '线上商城',
  166. path: '/pages/mine/card/card'
  167. },
  168. {
  169. icon: '/static/icon/system5.png',
  170. name: '门店管理',
  171. path: '/pages/mine/card/card'
  172. },
  173. {
  174. icon: '/static/icon/add.png',
  175. name: '添加服务',
  176. path: '/pages/mine/card/card'
  177. },
  178. ]
  179. }
  180. },
  181. onLoad() {
  182. this.init()
  183. },
  184. onShow() {
  185. if (this.canReset) {
  186. this.getStatistic()
  187. }
  188. this.canReset=true
  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:1 //审核通过
  204. }
  205. let res=await this.$api.shop.list(params)
  206. this.shopList=res.data.records
  207. let item=this.shopList[0]
  208. this.shopId = item.id
  209. this.shopLable = item.name
  210. this.labelIds = item.labelIds
  211. this.labelNames = item.labelNames
  212. this.mallId=item.mallId
  213. this.cacheSelectedShop()
  214. //获取统计数据
  215. this.getStatistic()
  216. },
  217. getStatistic(){
  218. this.$api.shop.statistic(this.shopId).then(res=>{
  219. this.statistic=res.data
  220. })
  221. },
  222. cacheSelectedShop(item){
  223. let selectedShop={
  224. id:this.shopId,
  225. label:this.shopLable,
  226. labelIds:this.labelIds,
  227. labelNames:this.labelNames
  228. }
  229. this.$cache.put("selectedShop",selectedShop)
  230. this.$u.vuex('vuex_shopId',this.shopId)
  231. this.$u.vuex('vuex_mallId',this.mallId)
  232. },
  233. shopConfirm(e){
  234. this.shopId=e[0].value
  235. this.shopLable=e[0].label
  236. let item = this.shopList.filter((item)=>{
  237. if(this.shopId==item.id){
  238. return true
  239. }
  240. })
  241. this.labelIds = item.labelIds
  242. this.labelNames = item.labelNames
  243. this.cacheSelectedShop()
  244. //获取统计数据
  245. this.getStatistic()
  246. },
  247. operate(index){
  248. if (index==0) {
  249. this.$jump('/pages/pay/pay')
  250. }else if (index==1) {
  251. this.$jump('/pages/checkstand/pay-qrcode')
  252. }else if (index==2) {
  253. this.$jump('/pages/card/card')
  254. }
  255. },
  256. }
  257. }
  258. </script>
  259. <style lang="scss" scoped>
  260. .cu-list.grid>.cu-item .cu-tag {
  261. right: auto;
  262. left: 54%;
  263. margin-left: 20rpx;
  264. }
  265. .title {
  266. display: flex;
  267. .icon {
  268. background-color: #FFFFFF;
  269. border-radius: 50%;
  270. display: flex;
  271. justify-content: center;
  272. align-items: center;
  273. width: 50rpx;
  274. height: 50rpx;
  275. image {
  276. width: 36rpx;
  277. height: 36rpx;
  278. }
  279. }
  280. text {
  281. font-weight: 800;
  282. font-size: 32rpx;
  283. color: #303030;
  284. }
  285. }
  286. .top-menu {
  287. border-radius: 20rpx;
  288. margin-top: 20rpx;
  289. background-image: linear-gradient(to right, #FBA33D, #FF8D32);
  290. }
  291. .menu-list {
  292. display: flex;
  293. justify-content: space-between;
  294. padding-top: 20rpx;
  295. .menu {
  296. width: 48.8%;
  297. color: #FFFFFF;
  298. display: flex;
  299. flex-direction: column;
  300. align-items: center;
  301. border-radius: 14rpx;
  302. padding: 30rpx 20rpx;
  303. .menu-top {
  304. display: flex;
  305. image {
  306. width: 70rpx;
  307. height: 70rpx;
  308. }
  309. }
  310. .menu-bottom {
  311. padding-top: 20rpx;
  312. font-size: 30rpx;
  313. display: flex;
  314. justify-content: space-around;
  315. width: 100%;
  316. view {
  317. display: flex;
  318. flex-direction: column;
  319. text-align: center;
  320. text:first-child {
  321. margin-bottom: 10rpx;
  322. font-size: 26rpx;
  323. color: #E0E2F6;
  324. }
  325. }
  326. }
  327. }
  328. .menu1 {
  329. background-color: #5C6186;
  330. }
  331. .menu2 {
  332. background-color: #E19D5B;
  333. }
  334. }
  335. .market {
  336. margin-top: 20rpx;
  337. border-radius: 20rpx;
  338. background-color: #FFFFFF;
  339. padding: 30rpx 50rpx 20rpx;
  340. .title {
  341. font-weight: 800;
  342. }
  343. }
  344. .system {
  345. margin-top: 20rpx;
  346. border-radius: 20rpx;
  347. background-color: #FFFFFF;
  348. padding: 30rpx 50rpx 20rpx;
  349. .title {
  350. font-weight: 800;
  351. }
  352. }
  353. .btn{
  354. margin-right: -30rpx;
  355. display: flex;
  356. .image{
  357. display: flex;
  358. justify-content: center;
  359. align-items: center;
  360. border-radius: 50%;
  361. background-color: #FFFFFF;
  362. padding: 8rpx;
  363. image{
  364. width: 20rpx;
  365. height: 20rpx;
  366. }
  367. }
  368. color: #FFFFFF;
  369. border-radius: 50rpx 0 0 50rpx;
  370. padding:8rpx 10rpx 8rpx 35rpx;
  371. background-image: linear-gradient(to right,#FFD67B,#F99200);
  372. }
  373. .money{
  374. font-size: 80rpx;
  375. color: $u-type-warning;
  376. position: relative;
  377. .close{
  378. position: absolute;
  379. top: 20rpx;
  380. right: 20rpx;
  381. line-height: 28rpx;
  382. font-size: 28rpx;
  383. }
  384. }
  385. </style>