index.vue 7.6 KB

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