index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <view class="">
  3. <view style="position: relative;">
  4. <image src="../../static/icon/bg.png" style="width: 100vw;height: 400rpx"></image>
  5. <view class="card-top" >
  6. <view class="top">
  7. <view @click="mallShow=true">
  8. <text class="name" >{{mallLable}}</text>
  9. <u-icon v-if="mallShow" name="arrow-up-fill" style="margin-left: 10rpx;"></u-icon>
  10. <u-icon v-else name="arrow-down-fill" style="margin-left: 10rpx;"></u-icon>
  11. </view>
  12. <view class="btn">
  13. <view class="image">
  14. <image src="@/static/icon/logout.png" mode=""></image>
  15. </view>
  16. <view @click="logout" class="center padding-left-10" >
  17. <text>退出</text>
  18. <text class="cuIcon-right"></text>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="menu-list">
  23. <view @click="$jump('/pages/stores/stores')" class="menu menu1">
  24. <view class="menu-top">
  25. <image src="../../static/icon/mendian.png"></image>
  26. <view class="center padding-left-20">
  27. <text class="text-lg">我的门店</text>
  28. </view>
  29. </view>
  30. <view class="padding-top-20 text-df">
  31. <text>门店数量</text>
  32. <text class="padding-left-20">{{statistic.shopCount}}</text>
  33. </view>
  34. </view>
  35. <view class="menu menu2" @click="$jump('/pages/member-center/member-center')">
  36. <view class="menu-top">
  37. <image src="../../static/icon/huiyuan.png"></image>
  38. <view class="center padding-left-20">
  39. <text class="text-lg">会员中心</text>
  40. </view>
  41. </view>
  42. <view class="padding-top-20 text-df">
  43. <text>会员总数</text>
  44. <text class="padding-left-20">{{statistic.memberCount}}</text>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="cu-list grid col-3 no-border" style="border-radius:20rpx ;">
  49. <view class="cu-item" >
  50. <text style="color: #FF9447;font-size: 34rpx;font-weight: 800;">{{statistic.todayIncome}}</text>
  51. <text style="color: #242424;font-size: 26rpx;" >今日营收</text>
  52. </view>
  53. <view class="cu-item" >
  54. <text style="color: #FF9447;font-size: 34rpx;font-weight: 800;">{{statistic.todayOrderCount}}</text>
  55. <text style="color: #242424;font-size: 26rpx;" >交易笔数</text>
  56. </view>
  57. <view class="cu-item" >
  58. <text style="color: #FF9447;font-size: 34rpx;font-weight: 800;">{{statistic.todayMemberIn}}</text>
  59. <text style="color: #242424;font-size: 26rpx;" >新增会员</text>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="market" >
  65. <text class="title">营销管理</text>
  66. <view class="cu-list grid col-2 no-border margin-top-30" >
  67. <view class="cu-item" @click="$jump(item.path)" v-for="(item,index) in marketList" :key="index">
  68. <view class="center">
  69. <view class="icon" :style="item.background">
  70. <image :src="item.icon" mode=""></image>
  71. </view>
  72. </view>
  73. <text style="color: #222222;font-size: 26rpx;margin-top: 20rpx;" >{{item.name}}</text>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="mall">
  78. <view class="flex justify-between">
  79. <text class="title">商场管理</text>
  80. <view class="" style="color: #A3A3A3;font-size: 24rpx;">
  81. <text >查看全部</text>
  82. <text class="cuIcon-right" style="margin-left: 4rpx;"></text>
  83. </view>
  84. </view>
  85. <view class="cu-list grid col-4 no-border" style="border-radius:20rpx;margin-top: 50rpx;">
  86. <view class="cu-item" @click="$jump(item.path)" v-for="(item,index) in mallMenuList" :key="index">
  87. <view class="grid-icon" >
  88. <image style="width: 60rpx;height: 60rpx" :src="item.icon"/>
  89. </view>
  90. <text style="color: #222222;font-size: 26rpx;" >{{item.name}}</text>
  91. </view>
  92. </view>
  93. </view>
  94. <view class="" style="height: 60rpx;" v-if="safeAreaBottom == 0"></view>
  95. <u-select @confirm="mallConfirm" v-model="mallShow" value-name="id" label-name="name" :list="mallList"></u-select>
  96. </view>
  97. </template>
  98. <script>
  99. export default {
  100. data() {
  101. return {
  102. mallShow:false,
  103. mallList:[],
  104. mallId:'',
  105. mallLable:'',
  106. //统计数据
  107. statistic:{},
  108. marketList:[
  109. {
  110. icon:'/static/icon/publish.png',
  111. name:'发起活动',
  112. background:"background-image:linear-gradient(#FF9549,#FCB07B)",
  113. path:'/pages/publish/publish'
  114. },
  115. {
  116. icon:'/static/icon/list.png',
  117. name:'活动清单',
  118. background:"background-image:linear-gradient(#5892F7,#67BBF9)",
  119. path:'/pages/activity/activity'
  120. },
  121. ],
  122. mallMenuList:[
  123. {
  124. icon:'/static/icon/mall.png',
  125. name:'商家管理',
  126. path:''
  127. },
  128. {
  129. icon:'/static/icon/shanghu.png',
  130. name:'商户审核',
  131. path:''
  132. },
  133. {
  134. icon:'/static/icon/tag.png',
  135. name:'标签管理',
  136. path:''
  137. },
  138. {
  139. icon:'/static/icon/audit.png',
  140. name:'活动审核',
  141. path:''
  142. },
  143. ]
  144. }
  145. },
  146. onLoad() {
  147. this.init()
  148. },
  149. methods: {
  150. logout(){
  151. uni.clearStorage()
  152. this.$jump('/pages/login/account-login')
  153. },
  154. init(){
  155. this.mallList=this.$cache.get('mallList')
  156. this.mallId=this.mallList[0].id
  157. this.mallLable=this.mallList[0].name
  158. this.cacheSelectedMall()
  159. this.getStatistic()
  160. },
  161. getStatistic(){
  162. this.$api.mall.statistic(this.mallId).then(res=>{
  163. this.statistic=res.data
  164. })
  165. },
  166. mallConfirm(e){
  167. this.mallId=e[0].value
  168. this.mallLable=e[0].label
  169. this.cacheSelectedMall()
  170. },
  171. cacheSelectedMall(){
  172. let selectedMall={
  173. id:this.mallId,
  174. label:this.mallLable
  175. }
  176. this.$cache.put("selectedMall",selectedMall)
  177. this.$u.vuex('vuex_mallId',this.mallId)
  178. }
  179. }
  180. }
  181. </script>
  182. <style lang="scss" scoped>
  183. .icon{
  184. width: 120rpx;
  185. height: 120rpx;
  186. display: flex;
  187. justify-content: center;
  188. align-items: center;
  189. border-radius: 20rpx;
  190. padding: 20rpx;
  191. image{
  192. width: 60rpx;
  193. height: 60rpx;
  194. }
  195. }
  196. .card-top{
  197. height: 400rpx;
  198. position: relative;
  199. margin: -236rpx 20rpx 0;
  200. border-radius: 20rpx;
  201. background-color: #FFFFFF;
  202. .top{
  203. padding: 40rpx 0 30rpx 60rpx;
  204. display:flex;
  205. justify-content: space-between;
  206. .name{
  207. font-weight: 800;
  208. font-size: 32rpx;
  209. }
  210. .btn{
  211. display: flex;
  212. .image{
  213. display: flex;
  214. justify-content: center;
  215. align-items: center;
  216. border-radius: 50%;
  217. background-color: #FFFFFF;
  218. padding: 8rpx;
  219. image{
  220. width: 20rpx;
  221. height: 20rpx;
  222. }
  223. }
  224. color: #FFFFFF;
  225. border-radius: 50rpx 0 0 50rpx;
  226. padding:8rpx 10rpx 8rpx 35rpx;
  227. background-image: linear-gradient(to right,#FFD67B,#F99200);
  228. }
  229. }
  230. .menu-list{
  231. display: flex;
  232. justify-content: space-around;
  233. padding: 20rpx;
  234. .menu{
  235. width: 48%;
  236. color: #FFFFFF;
  237. display: flex;
  238. flex-direction: column;
  239. align-items: center;
  240. border-radius: 14rpx;
  241. padding:30rpx 20rpx;
  242. .menu-top{
  243. display: flex;
  244. image{
  245. width: 70rpx;
  246. height: 70rpx;
  247. }
  248. }
  249. }
  250. .menu1{
  251. background-color: #5C6186;
  252. }
  253. .menu2{
  254. background-color: #E19D5B;
  255. }
  256. }
  257. }
  258. .market{
  259. border-radius: 20rpx;
  260. margin:140rpx 20rpx 0;
  261. background-color: #FFFFFF;
  262. padding: 30rpx 50rpx 20rpx;
  263. .title{
  264. font-weight: 800;
  265. }
  266. }
  267. .mall{
  268. border-radius: 20rpx;
  269. margin:30rpx 20rpx 0;
  270. background-color: #FFFFFF;
  271. padding: 30rpx 10rpx 20rpx 50rpx;
  272. .title{
  273. font-weight: 800;
  274. }
  275. }
  276. </style>