store.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <view class="shop">
  3. <view style="height: 85rpx" />
  4. <view class="shop__data">
  5. <view class="shop__data--left">
  6. <view class="text-title">店铺分</view>
  7. <view class="text-num">{{ listScore.score || '--' }}</view>
  8. </view>
  9. <view class="shop__data--right">
  10. <view>
  11. <view class="text-title">今日收入(元)</view>
  12. <view class="text-num">{{ listScore.amount || '0' }}</view>
  13. </view>
  14. <view class="line"></view>
  15. <view>
  16. <view class="text-title">今日订单(单)</view>
  17. <view class="text-num">{{ listScore.orderCount || '0' }}</view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="shop__note">
  22. <u-notice-bar :text="text1"></u-notice-bar>
  23. </view>
  24. <view class="shop__tools">
  25. <u-grid :border="false" col="5">
  26. <u-grid-item v-for="(listItem, listIndex) in list" :key="listIndex" @click="handlerSkip(listItem, listIndex)">
  27. <image src="@/static/tools.jpg" />
  28. <text class="grid-text">{{ listItem.title }}</text>
  29. </u-grid-item>
  30. </u-grid>
  31. </view>
  32. <view class="shop__note" style="background-color: #fff">
  33. <u-cell-group>
  34. <u-cell size="large" :border="false" title="规制中心" isLink url=""></u-cell>
  35. </u-cell-group>
  36. </view>
  37. <view>
  38. <u-tabs :list="list1" lineWidth="40" lineColor="$uni-bg-color-primary" :activeStyle="{
  39. color: '#000',
  40. fontWeight: 'bold',
  41. fontSize: '32rpx',
  42. transform: 'scale(1.05)',
  43. marginBottom: '15rpx',
  44. }" :inactiveStyle="{
  45. color: '#333',
  46. fontSize: '30rpx',
  47. transform: 'scale(1)',
  48. marginBottom: '15rpx',
  49. }" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;"></u-tabs>
  50. <view style="background-color: #fff; height: 400rpx; margin-top: 20rpx"> 1111111111 </view>
  51. </view>
  52. <tabbar currentTab="merchantStore" />
  53. </view>
  54. </template>
  55. <script>
  56. import {
  57. getOrderQuantityApi
  58. } from '@/api/merchant/order';
  59. export default {
  60. data() {
  61. return {
  62. text1: 'uView UI众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让您快速集成,开箱即用',
  63. list1: [{
  64. name: '商家社区',
  65. },
  66. {
  67. name: '活动中心',
  68. },
  69. {
  70. name: '商品优惠',
  71. },
  72. ],
  73. list: [{
  74. title: '店铺管理',
  75. },
  76. {
  77. title: '顾客评价',
  78. },
  79. {
  80. title: '商品核销',
  81. },
  82. {
  83. title: '商品优惠',
  84. },
  85. {
  86. title: '经营数据',
  87. },
  88. {
  89. title: '我的团队',
  90. },
  91. {
  92. title: '活动中心',
  93. },
  94. {
  95. title: '当前佣金',
  96. },
  97. {
  98. title: '商家社区',
  99. },
  100. {
  101. title: '预约列表',
  102. },
  103. ],
  104. listScore: {},
  105. merchantId: '',
  106. };
  107. },
  108. created() {
  109. // 获取商家id
  110. let merchantInfo = this.$store.state.data.merchantInfo;
  111. this.merchantId = merchantInfo.merchant.id;
  112. },
  113. mounted() {
  114. // 查商家端查询订单量以及今日收入
  115. this.getOrderQuantity(this.merchantId);
  116. },
  117. methods: {
  118. // 点击跳转
  119. handlerSkip(item, index) {
  120. console.log('index', index);
  121. switch (index) {
  122. case 0:
  123. uni.navigateTo({
  124. url: '/pages/merchant/store/shopManage',
  125. });
  126. break;
  127. case 1:
  128. uni.navigateTo({
  129. url: '/pages/merchant/store/evaluateManagement',
  130. });
  131. break;
  132. case 3:
  133. uni.navigateTo({
  134. url: '/pages/merchant/store/couponManage',
  135. });
  136. break;
  137. case 5:
  138. uni.navigateTo({
  139. url: '/pages/merchant/store/myTeam',
  140. });
  141. break;
  142. case 9:
  143. uni.navigateTo({
  144. url: '/pages/merchant/store/appointList',
  145. });
  146. break;
  147. }
  148. },
  149. async getOrderQuantity(id) {
  150. let res = await getOrderQuantityApi(id);
  151. if (res.code === "OK") {
  152. this.listScore = res.data
  153. }
  154. },
  155. },
  156. };
  157. </script>
  158. <style lang="scss" scoped>
  159. .text-title {
  160. font-size: 28rpx;
  161. color: #333;
  162. margin-bottom: 20rpx;
  163. }
  164. .text-num {
  165. font-size: 40rpx;
  166. font-weight: bold;
  167. color: $uni-bg-color-primary;
  168. }
  169. .shop {
  170. min-height: calc(100vh - 80rpx);
  171. background-color: $uni-bg-color-page;
  172. padding-top: 80rpx;
  173. &__data {
  174. display: flex;
  175. text-align: center;
  176. &--left {
  177. flex: 1;
  178. padding: 30rpx 20rpx;
  179. background-color: $uni-bg-color;
  180. margin-right: 20rpx;
  181. border-radius: $uni-border-radius-base;
  182. }
  183. &--right {
  184. flex: 3;
  185. display: flex;
  186. justify-content: space-around;
  187. padding: 30rpx 20rpx;
  188. background-color: $uni-bg-color;
  189. border-radius: $uni-border-radius-base;
  190. .line {
  191. width: 2rpx;
  192. height: 65%;
  193. margin-top: 35rpx;
  194. background-color: #f5f5f5;
  195. }
  196. }
  197. }
  198. &__note {
  199. margin: 30rpx 0;
  200. }
  201. /* 工具 */
  202. &__tools {
  203. padding: 20rpx 10rpx;
  204. background-color: $uni-bg-color;
  205. border-radius: $uni-border-radius-base;
  206. image {
  207. width: 100rpx;
  208. height: 100rpx;
  209. display: block;
  210. margin: 15rpx 0 25rpx 0;
  211. }
  212. }
  213. }
  214. ::v-deep .u-cell__title-text {
  215. border: 0;
  216. font-weight: bold;
  217. font-size: 36rpx;
  218. }
  219. </style>