|
|
@@ -15,14 +15,71 @@
|
|
|
<!-- 顶部标题 -->
|
|
|
<view class="text-xl font-bold text-center py-3 bg-white">达州农机优惠券</view>
|
|
|
|
|
|
- <wd-swiper
|
|
|
+ <!-- 数据统计卡片 -->
|
|
|
+ <view class="grid grid-cols-2 gap-3 mb-4">
|
|
|
+ <!-- 总销售额 -->
|
|
|
+ <statistics-card
|
|
|
+ title="总销售额"
|
|
|
+ :value="statisticsData[0]"
|
|
|
+ suffix="万元"
|
|
|
+ color="blue"
|
|
|
+ :duration="2000"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 总订单数 -->
|
|
|
+ <statistics-card
|
|
|
+ title="总订单数"
|
|
|
+ :value="statisticsData[1]"
|
|
|
+ suffix="单"
|
|
|
+ color="amber"
|
|
|
+ :duration="4000"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 本季度销售额 -->
|
|
|
+ <statistics-card
|
|
|
+ title="本季度销售额"
|
|
|
+ :value="statisticsData[2]"
|
|
|
+ suffix="万元"
|
|
|
+ color="emerald"
|
|
|
+ :duration="4000"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 本季度订单数 -->
|
|
|
+ <statistics-card
|
|
|
+ title="本季度订单数"
|
|
|
+ :value="statisticsData[3]"
|
|
|
+ suffix="单"
|
|
|
+ color="indigo"
|
|
|
+ :duration="4000"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 本月销售额 -->
|
|
|
+ <statistics-card
|
|
|
+ title="本月销售额"
|
|
|
+ :value="statisticsData[4]"
|
|
|
+ suffix="万元"
|
|
|
+ color="purple"
|
|
|
+ :duration="4000"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 本月订单数 -->
|
|
|
+ <statistics-card
|
|
|
+ title="本月订单数"
|
|
|
+ :value="statisticsData[5]"
|
|
|
+ suffix="单"
|
|
|
+ color="rose"
|
|
|
+ :duration="2000"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- <wd-swiper
|
|
|
:list="swiperList"
|
|
|
autoplay
|
|
|
v-model:current="current"
|
|
|
:indicator="{ type: 'dots-bar' } as any"
|
|
|
@click="handleSwiperClick"
|
|
|
@change="handleSwiperChange"
|
|
|
- ></wd-swiper>
|
|
|
+ ></wd-swiper> -->
|
|
|
|
|
|
<view class="pb-4">
|
|
|
<!-- 网点地址标题 -->
|
|
|
@@ -91,18 +148,23 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import banner1 from '@/static/banner1.png'
|
|
|
+// import banner1 from '@/static/banner1.png'
|
|
|
import { ref } from 'vue'
|
|
|
import { useUserStore } from '@/store/user'
|
|
|
import { useAppStore } from '@/store/app'
|
|
|
+import { useDictStore } from '@/store/dict'
|
|
|
import { useMessage } from 'wot-design-uni'
|
|
|
import dayjs from 'dayjs'
|
|
|
+import StatisticsCard from '@/components/StatisticsCard.vue'
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
const appStore = useAppStore()
|
|
|
+const dictStore = useDictStore()
|
|
|
const message = useMessage()
|
|
|
-const current = ref<number>(0)
|
|
|
-const swiperList = ref([banner1, banner1, banner1])
|
|
|
+// const current = ref<number>(0)
|
|
|
+// const swiperList = ref([banner1, banner1, banner1])
|
|
|
+
|
|
|
+const statisticsData = ref({})
|
|
|
|
|
|
// 获取安全区域距离
|
|
|
const { safeAreaInsets } = uni.getWindowInfo()
|
|
|
@@ -221,9 +283,19 @@ const showCompleteDialog = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 获取统计数据
|
|
|
+const getStatisticsData = async () => {
|
|
|
+ const configList = await dictStore.getConfigList('mini_program_index_sumary')
|
|
|
+ if (configList.length > 0) {
|
|
|
+ // 将字符串分割后转换为数字类型
|
|
|
+ statisticsData.value = configList[0].substance.split(',').map((item) => Number(item))
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
onShow(() => {
|
|
|
getUserList()
|
|
|
showCompleteDialog()
|
|
|
+ getStatisticsData()
|
|
|
})
|
|
|
</script>
|
|
|
|