index.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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/password.png',
  125. name:'修改密码',
  126. path:'/pages/login/updatePassword'
  127. },
  128. {
  129. icon:'/static/icon/mall.png',
  130. name:'商家管理',
  131. path:'/pages/stores/stores'
  132. },
  133. {
  134. icon:'/static/icon/shanghu.png',
  135. name:'商户审核',
  136. path:'/pages/shopAudit/shopAudit'
  137. },
  138. {
  139. icon:'/static/icon/tag.png',
  140. name:'标签管理',
  141. path:'/pages/index/tag-manage'
  142. },
  143. {
  144. icon:'/static/icon/audit.png',
  145. name:'活动审核',
  146. path:'/pages/acitvityAudit/acitvityAudit'
  147. },
  148. ]
  149. }
  150. },
  151. onLoad() {
  152. this.init()
  153. },
  154. methods: {
  155. logout(){
  156. this.$dialog.showModal('确定退出?').then(res=>{
  157. uni.clearStorage()
  158. this.$jump('/pages/login/account-login')
  159. })
  160. },
  161. async init(){
  162. let phone=this.$cache.get('phone')
  163. let res=await this.$api.mall.getListByPhone({personTel:phone})
  164. this.mallList=res.data
  165. this.mallId=this.mallList[0].id
  166. this.mallLable=this.mallList[0].name
  167. this.cacheSelectedMall(this.mallList[0])
  168. //获取统计数据
  169. this.getStatistic()
  170. },
  171. getStatistic(){
  172. this.$api.mall.statistic(this.mallId).then(res=>{
  173. this.statistic=res.data
  174. })
  175. },
  176. mallConfirm(e){
  177. this.mallId=e[0].value
  178. this.mallLable=e[0].label
  179. let item = this.shopList.filter((item) => {
  180. if (this.mallId == item.id) {
  181. return true
  182. }
  183. })
  184. this.cacheSelectedMall(item[0])
  185. this.getStatistic()
  186. },
  187. cacheSelectedMall(item){
  188. let selectedMall={
  189. id:this.mallId,
  190. label:this.mallLable
  191. }
  192. this.$cache.put("selectedMall", Object.assign(item, selectedMall))
  193. this.$u.vuex('vuex_mallId',this.mallId)
  194. }
  195. }
  196. }
  197. </script>
  198. <style lang="scss" scoped>
  199. .icon{
  200. width: 120rpx;
  201. height: 120rpx;
  202. display: flex;
  203. justify-content: center;
  204. align-items: center;
  205. border-radius: 20rpx;
  206. padding: 20rpx;
  207. image{
  208. width: 60rpx;
  209. height: 60rpx;
  210. }
  211. }
  212. .card-top{
  213. height: 400rpx;
  214. position: relative;
  215. margin: -236rpx 20rpx 0;
  216. border-radius: 20rpx;
  217. background-color: #FFFFFF;
  218. .top{
  219. padding: 40rpx 0 30rpx 60rpx;
  220. display:flex;
  221. justify-content: space-between;
  222. .name{
  223. font-weight: 800;
  224. font-size: 32rpx;
  225. }
  226. .btn{
  227. display: flex;
  228. .image{
  229. display: flex;
  230. justify-content: center;
  231. align-items: center;
  232. border-radius: 50%;
  233. background-color: #FFFFFF;
  234. padding: 8rpx;
  235. image{
  236. width: 20rpx;
  237. height: 20rpx;
  238. }
  239. }
  240. color: #FFFFFF;
  241. border-radius: 50rpx 0 0 50rpx;
  242. padding:8rpx 10rpx 8rpx 35rpx;
  243. background-image: linear-gradient(to right,#FFD67B,#F99200);
  244. }
  245. }
  246. .menu-list{
  247. display: flex;
  248. justify-content: space-around;
  249. padding: 20rpx;
  250. .menu{
  251. width: 48%;
  252. color: #FFFFFF;
  253. display: flex;
  254. flex-direction: column;
  255. align-items: center;
  256. border-radius: 14rpx;
  257. padding:30rpx 20rpx;
  258. .menu-top{
  259. display: flex;
  260. image{
  261. width: 70rpx;
  262. height: 70rpx;
  263. }
  264. }
  265. }
  266. .menu1{
  267. background-color: #5C6186;
  268. }
  269. .menu2{
  270. background-color: #E19D5B;
  271. }
  272. }
  273. }
  274. .market{
  275. border-radius: 20rpx;
  276. margin:140rpx 20rpx 0;
  277. background-color: #FFFFFF;
  278. padding: 30rpx 50rpx 20rpx;
  279. .title{
  280. font-weight: 800;
  281. }
  282. }
  283. .mall{
  284. border-radius: 20rpx;
  285. margin:30rpx 20rpx 0;
  286. background-color: #FFFFFF;
  287. padding: 30rpx 10rpx 20rpx 50rpx;
  288. .title{
  289. font-weight: 800;
  290. }
  291. }
  292. </style>