Просмотр исходного кода

分包处理&销售页面优化

mws 4 месяцев назад
Родитель
Сommit
d487d6c99f

+ 25 - 0
api/hexiao.js

@@ -262,6 +262,31 @@ export function areaList(keyword){
     })
 }
 
+
+export function getStoreSalesSummary(startDate,endDate,storeId){
+    return request({
+        url: `/ywy/storeSalesSummary`,
+        method: 'post',
+        params: {
+            startDate:startDate,
+            endDate:endDate,
+            storeId:storeId
+        }
+    })
+}
+
+export function getStoreSalesTrend(startDate,endDate,storeId){
+    return request({
+        url: `/ywy/storeSalesTrend`,
+        method: 'post',
+        params: {
+            startDate:startDate,
+            endDate:endDate,
+            storeId:storeId
+        }
+    })
+}
+
 export function addYwy(data){
     return request({
         url: `/jxs/jxsSaveRetail`,

+ 330 - 314
pages.json

@@ -9,331 +9,347 @@
 				"navigationBarTitleText": "加载中",
 				"navigationStyle": "custom"
 			}
-		},
-		{
-			"path" : "pages/lgz/index/index",
-			"style" :
-			{
-				"navigationBarTitleText" : "梅山古镇",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/lgz/record/record",
-			"style" :
-			{
-				"navigationBarTitleText" : "扫码记录",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/cjx/record/record",
-			"style" :
-			{
-				"navigationBarTitleText" : "扫码记录",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/lgz/traceability/traceability",
-			"style" :
-			{
-				"navigationBarTitleText" : "溯源信息",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/cjx/traceability/traceability",
-			"style" :
-			{
-				"navigationBarTitleText" : "溯源信息",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/lgz/feedback/feedback",
-			"style" :
-			{
-				"navigationBarTitleText" : "意见反馈",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/cjx/feedback/feedback",
-			"style" :
-			{
-				"navigationBarTitleText" : "意见反馈",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/lgz/introduction/introduction",
-			"style" :
-			{
-				"navigationBarTitleText" : "公司简介",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/cjx/introduction/introduction",
-			"style" :
-			{
-				"navigationBarTitleText" : "公司简介",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/lgz/index/claim",
-			"style" :
-			{
-				"navigationBarTitleText" : "中奖记录",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/cjx/index/claim",
-			"style" :
-			{
-				"navigationBarTitleText" : "中奖记录",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/lgz/index/rules",
-			"style" :
-			{
-				"navigationBarTitleText" : "活动规则",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/cjx/index/rules",
-			"style" :
-			{
-				"navigationBarTitleText" : "活动规则",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/lgz/error",
-			"style" :
-			{
-				"navigationBarTitleText" : "梅干古筝",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/lgz/address/address",
-			"style" :
-			{
-				"navigationBarTitleText" : "",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/lgz/my/my",
-			"style" :
-			{
-				"navigationBarTitleText" : "",
-				"navigationStyle": "custom"
-			}
-		},
+		}
+	],
 
-		{
-			"path" : "pages/lgz/index/winPrize",
-			"style" :
-			{
-				"navigationBarTitleText" : "",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/lgz/index/unWinPrize",
-			"style" :
-			{
-				"navigationBarTitleText" : "",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/cjx/index/index",
-			"style" :
-			{
-				"navigationBarTitleText" : "",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/cjx/index/authCode",
-			"style" :
-			{
-				"navigationBarTitleText" : "",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/cjx/my/my",
-			"style" :
-			{
-				"navigationBarTitleText" : "",
-				"navigationStyle": "custom"
-			}
-		},
+	"subPackages": [{
+		"root": "pages/cjx",
+		"pages": [
+			{
+				"path" : "index/rules",
+				"style" :
+				{
+					"navigationBarTitleText" : "活动规则",
+					"navigationStyle": "custom"
+				}
+			},
+			{
+				"path" : "record/record",
+				"style" :
+				{
+					"navigationBarTitleText" : "扫码记录",
+					"navigationStyle": "custom"
+				}
+			},
+			{
+				"path" : "index/index",
+				"style" :
+				{
+					"navigationBarTitleText" : "",
+					"navigationStyle": "custom"
+				}
+			},
+			{
+				"path" : "index/authCode",
+				"style" :
+				{
+					"navigationBarTitleText" : "",
+					"navigationStyle": "custom"
+				}
+			},
+			{
+				"path" : "my/my",
+				"style" :
+				{
+					"navigationBarTitleText" : "",
+					"navigationStyle": "custom"
+				}
+			},
 
-		{
-			"path" : "pages/cjx/hexiao/ywy/index",
-			"style" :
-			{
-				"navigationBarTitleText" : "首页",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/cjx/hexiao/ywy/retail",
-			"style" :
-			{
-				"navigationBarTitleText" : "门店",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/cjx/hexiao/ywy/my",
-			"style" :
-			{
-				"navigationBarTitleText" : "我的",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/cjx/hexiao/ywy/scan_code",
-			"style" :
-			{
-				"navigationBarTitleText" : "上货扫描",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/cjx/hexiao/ywy/add_retail",
-			"style" :
-			{
-				"navigationBarTitleText" : "门店信息",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/cjx/hexiao/ywy/add_goods_record",
-			"style" :
-			{
-				"navigationBarTitleText" : "上货记录",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/cjx/hexiao/jxs/index",
-			"style" :
-			{
-				"navigationBarTitleText" : "",
-				"navigationStyle": "custom"
-			}
-		},{
-			"path" : "pages/cjx/hexiao/jxs/my",
-			"style" :
-			{
-				"navigationBarTitleText" : "我的",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/cjx/hexiao/jxs/ywy_list",
-			"style" :
 			{
-				"navigationBarTitleText" : "业务员管理",
-				"enablePullDownRefresh" : false
-			}
-		},
-	{
-		"path" : "pages/cjx/hexiao/jxs/hexiao_record",
-		"style" :
-		{
-			"navigationBarTitleText" : "核销记录",
-			"enablePullDownRefresh" : false
-		}
-	},
-	{
-		"path" : "pages/cjx/hexiao/jxs/hexiao_detail",
-		"style" :
-		{
-			"navigationBarTitleText" : "核销详情",
-			"enablePullDownRefresh" : false
-		}
-	},
-		{
-			"path" : "pages/cjx/hexiao/jxs/add_ywy",
-			"style" :
-			{
-				"navigationBarTitleText" : "业务员信息",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/cjx/hexiao/login",
-			"style" :
-			{
-				"navigationBarTitleText" : "",
-				"navigationStyle": "custom"
+				"path" : "hexiao/ywy/index",
+				"style" :
+				{
+					"navigationBarTitleText" : "首页",
+					"navigationStyle": "custom"
+				}
+			},
+			{
+				"path" : "hexiao/ywy/retail",
+				"style" :
+				{
+					"navigationBarTitleText" : "门店",
+					"enablePullDownRefresh" : false
+				}
+
+			},
+			{
+				"path" : "hexiao/ywy/my",
+				"style" :
+				{
+					"navigationBarTitleText" : "我的",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/ywy/scan_code",
+				"style" :
+				{
+					"navigationBarTitleText" : "上货扫描",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/ywy/add_retail",
+				"style" :
+				{
+					"navigationBarTitleText" : "门店信息",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/ywy/add_goods_record",
+				"style" :
+				{
+					"navigationBarTitleText" : "上货记录",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/jxs/index",
+				"style" :
+				{
+					"navigationBarTitleText" : "",
+					"navigationStyle": "custom"
+				}
+			},{
+				"path" : "hexiao/jxs/my",
+				"style" :
+				{
+					"navigationBarTitleText" : "我的",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/jxs/ywy_list",
+				"style" :
+				{
+					"navigationBarTitleText" : "业务员管理",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/jxs/hexiao_record",
+				"style" :
+				{
+					"navigationBarTitleText" : "核销记录",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/jxs/hexiao_detail",
+				"style" :
+				{
+					"navigationBarTitleText" : "核销详情",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/jxs/add_ywy",
+				"style" :
+				{
+					"navigationBarTitleText" : "业务员信息",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/login",
+				"style" :
+				{
+					"navigationBarTitleText" : "",
+					"navigationStyle": "custom"
+
+				}
+			},
 
-			}
-		},
-		{
-			"path" : "pages/cjx/xiaoshou/index",
-			"style" :
 			{
-				"navigationBarTitleText" : "",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path" : "pages/cjx/shop/shop",
-			"style" :
+				"path" : "xiaoshou/index",
+				"style" :
+				{
+					"navigationBarTitleText" : "",
+					"navigationStyle": "custom"
+				}
+			},
+			 {
+			 	"path" : "shop/shop",
+			 	"style" :
+			 	{
+			 		"navigationBarTitleText" : "商城",
+			 		"enablePullDownRefresh" : false
+			 	}
+			 },
+			{
+				"path" : "hexiao/ywy/add_patrol",
+				"style" :
+				{
+					"navigationBarTitleText" : "巡店记录",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/ywy/patrol_record",
+				"style" :
+				{
+					"navigationBarTitleText" : "巡店记录",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/ywy/hexiao_record",
+				"style" :
+				{
+					"navigationBarTitleText" : "",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/ywy/hexiao_detail",
+				"style" :
+				{
+					"navigationBarTitleText" : "核销详情",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "index/claim",
+				"style" :
+				{
+					"navigationBarTitleText" : "中奖记录",
+					"navigationStyle": "custom"
+				}
+			},
+			{
+				"path" : "introduction/introduction",
+				"style" :
+				{
+					"navigationBarTitleText" : "公司简介",
+					"navigationStyle": "custom"
+				}
+			},
+			{
+				"path" : "feedback/feedback",
+				"style" :
+				{
+					"navigationBarTitleText" : "意见反馈",
+					"navigationStyle": "custom"
+				}
+			},
+			{
+				"path" : "traceability/traceability",
+				"style" :
+				{
+					"navigationBarTitleText" : "溯源信息",
+					"navigationStyle": "custom"
+				}
+			}
+		]
+	}, {
+		"root": "pages/lgz",
+		"pages": [
+			{
+				"path" : "index/index",
+				"style" :
+				{
+					"navigationBarTitleText" : "梅山古镇",
+					"navigationStyle": "custom"
+				}
+			},
+			{
+				"path" : "record/record",
+				"style" :
+				{
+					"navigationBarTitleText" : "扫码记录",
+					"navigationStyle": "custom"
+				}
+			},
+
 			{
-				"navigationBarTitleText" : "商城",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/cjx/hexiao/ywy/add_patrol",
-			"style" :
+				"path" : "traceability/traceability",
+				"style" :
+				{
+					"navigationBarTitleText" : "溯源信息",
+					"navigationStyle": "custom"
+				}
+			},
+
 			{
-				"navigationBarTitleText" : "巡店记录",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/cjx/hexiao/ywy/patrol_record",
-			"style" :
+				"path" : "feedback/feedback",
+				"style" :
+				{
+					"navigationBarTitleText" : "意见反馈",
+					"navigationStyle": "custom"
+				}
+			},
+
 			{
-				"navigationBarTitleText" : "巡店记录",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/cjx/hexiao/ywy/hexiao_record",
-			"style" :
+				"path" : "introduction/introduction",
+				"style" :
+				{
+					"navigationBarTitleText" : "公司简介",
+					"navigationStyle": "custom"
+				}
+			},
+
 			{
-				"navigationBarTitleText" : "",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/cjx/hexiao/ywy/hexiao_detail",
-			"style" : 
+				"path" : "index/claim",
+				"style" :
+				{
+					"navigationBarTitleText" : "中奖记录",
+					"navigationStyle": "custom"
+				}
+			},
+
 			{
-				"navigationBarTitleText" : "核销详情",
-				"enablePullDownRefresh" : false
-			}
-		}
+				"path" : "index/rules",
+				"style" :
+				{
+					"navigationBarTitleText" : "活动规则",
+					"navigationStyle": "custom"
+				}
+			},
+			{
+				"path" : "error",
+				"style" :
+				{
+					"navigationBarTitleText" : "梅干古筝",
+					"navigationStyle": "custom"
+				}
+			},
+			{
+				"path" : "address/address",
+				"style" :
+				{
+					"navigationBarTitleText" : "",
+					"navigationStyle": "custom"
+				}
+			},
+			{
+				"path" : "my/my",
+				"style" :
+				{
+					"navigationBarTitleText" : "",
+					"navigationStyle": "custom"
+				}
+			},
 
-	],
+			{
+				"path" : "index/winPrize",
+				"style" :
+				{
+					"navigationBarTitleText" : "",
+					"navigationStyle": "custom"
+				}
+			},
+			{
+				"path" : "index/unWinPrize",
+				"style" :
+				{
+					"navigationBarTitleText" : "",
+					"navigationStyle": "custom"
+				}
+			}
+		]
+	}],
 
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 4 - 2
pages/cjx/hexiao/jxs/index.vue

@@ -9,7 +9,7 @@
     </view>
 
     <view class="content-grid">
-      <view class="card large-card" style="background: none;background-color: #54CFAB" @click="build">
+      <view class="card large-card" style="background: none;background-color: #54CFAB" @click="openXS">
         <view class="large-card-text">
           <view class="card-title" style="font-size: 40rpx">销售查询</view>
           <view class="card-subtitle">销售数据一览</view>
@@ -101,7 +101,9 @@ export default {
   },
   methods: {
     // 监听从抽屉组件传来的 select 事件
-
+    openXS(){
+      uni.navigateTo({ url: '/pages/cjx/xiaoshou/index?type=3' });
+    },
     onStoreSelect(store) {
       console.log('在首页接收到选中的门店:', store);
       this.selectedStore = store;

+ 4 - 1
pages/cjx/hexiao/jxs/ywy_list.vue

@@ -158,7 +158,10 @@ export default {
 
 
     },
-    viewSalesData(id) { console.log('查看销售数据 ID:', id); this.build() },
+    viewSalesData(id) {
+      console.log('查看销售数据 ID:', id);
+      uni.navigateTo({ url: '/pages/cjx/xiaoshou/index?type=2&ywyId='+id });
+    },
     editSalesperson(id) {
       uni.navigateTo({ url: '/pages/cjx/hexiao/jxs/add_ywy?id='+id });
       console.log('编辑业务员 ID:', id); },

+ 101 - 53
pages/cjx/xiaoshou/index.vue

@@ -8,7 +8,7 @@
         <u-row customStyle="margin-bottom: 10px" gutter="20">
           <u-col span="9">
             <u--input
-                @focus="show = true"
+                @focus="timeShow = true"
                 v-model="startTimeXd"
                 placeholder="开始日期 ~ 结束日期"
                 prefixIcon="calendar"
@@ -16,7 +16,7 @@
             ></u--input>
           </u-col>
           <u-col span="3">
-            <view class="query-btn" @click="show = !show">
+            <view class="query-btn" @click="timeShow = !timeShow">
               <view class="query-btn-icon">
               </view>
               <view class="query-btn-text">筛选</view>
@@ -28,28 +28,28 @@
         <view class="item-one">
           <view class="type-icon-hexiao"></view>
           <view class="type-data">
-            <view class="number">0</view>
+            <view class="number">{{hexiaoNumber}}</view>
             <view class="text">核销</view>
           </view>
         </view>
-        <view class="item-one"  v-show="type == 2">
+        <view class="item-one"  v-if="type === 2">
           <view class="type-icon-xundian"></view>
           <view class="type-data">
-            <view class="number">0</view>
+            <view class="number">{{ xundianNumber}}</view>
             <view class="text">巡店</view>
           </view>
         </view>
-        <view class="item-one">
+        <view class="item-one" v-if="type !== 3">
           <view class="type-icon-shanghuo"></view>
           <view class="type-data">
-            <view class="number">0</view>
+            <view class="number">{{ shangHuoNumber}}</view>
             <view class="text">上货</view>
           </view>
         </view>
-        <view class="item-one" v-show="type == 3">
+        <view class="item-one" v-if="type === 3">
           <view class="type-icon-xiadan"></view>
           <view class="type-data">
-            <view class="number">0</view>
+            <view class="number">{{xiaDanNumber}}</view>
             <view class="text">下单</view>
           </view>
         </view>
@@ -135,17 +135,21 @@
       </view>
 
     </u-popup>
-    <u-calendar :show="timeShow" :mode="mode" @confirm="confirm"></u-calendar>
+    <u-calendar :minDate="minDate"  :monthNumber="6"  :show="timeShow" :mode="mode" @confirm="confirm" @close="timeShow = false"></u-calendar>
 
   </view>
 
 </template>
 
 <script>
-import {getSalesTotal,getSalesTrend,getSalesmanSalesTotal,getSalesmanSalesTrend,getSalesmanVisitTrend} from "../../../api/hexiao";
+import {getSalesTotal,getSalesTrend,getSalesmanSalesTotal,getSalesmanSalesTrend,getSalesmanVisitTrend,getStoreSalesSummary,getStoreSalesTrend} from "../../../api/hexiao";
 export default {
   data() {
     return {
+      storeId: 0,
+	    ywyId:0,
+      minDate: new Date(new Date().setMonth(new Date().getMonth() - 2)),
+      maxDate: new Date(),
       hexiaoNumber: 0,
       xundianNumber: 0,
       shangHuoNumber: 0,
@@ -185,48 +189,97 @@ export default {
     };
   },
   onLoad: function(options) {
-	  options.id = 2;
     //门店
-    if (options.id == 1){
+    if (options.type == 1){
       this.title = '门店销售数据';
       this.type = 1;
+      this.storeId = options.storeId;
       this.initMenDian();
     }
     //业务员
-    if (options.id == 2){
+    if (options.type == 2){
       this.title = '业务员销售数据';
       this.type = 2;
-      this.initYWY(options.ywyId);
+      this.ywyId = options.ywyId;
+      console.log(this.type);
+      this.initYWY();
     }
     //经销商
-    if (options.id == 3){
+    if (options.type == 3){
       this.title = '经销商销售数据';
       this.type = 3;
       this.initJXS();
     }
   },
   onReady() {
-    this.getXdData();
   },
   methods: {
     initMenDian() {
+      let  that = this;
+      getStoreSalesSummary(this.startTime,this.endTime,this.storeId).then(res => {
+        if (res.code === 0){
+          that.hexiaoNumber = res.data.verificationTotal;
+          that.shangHuoNumber = res.data.activateTotal;
+        }
+      }).catch(err => {
+      });
+      getStoreSalesTrend(this.startTime,this.endTime,this.storeId).then(resData => {
+        if (resData.code === 0){
+          let apiResponse = resData.data;
+          // 提取日期列表并排序
+          let categories = apiResponse.map(item => {
+            // 从日期中提取月日,例如 "2025-08-01" -> "08-01" -> "8/1" 或者只显示日 "1"
+            return item.date.split("-")[2]; // 这里提取日期中的日部分
+          });
+
+          // 排序日期列表
+          categories.sort((a, b) => {
+            return a.localeCompare(b);
+          })
+
+          // 按日期排序数据
+          let sortedData = apiResponse.sort((a, b) => new Date(a.date) - new Date(b.date));
+
+          // 提取核销数据和上货数据
+          let verificationData = sortedData.map(item => item.verificationCount);
+          let activateData = sortedData.map(item => item.activateCount);
+          // 构造图表需要的格式
+          let resTb = {
+            categories: categories,
+            series: [
+              {
+                name: "核销",
+                data: verificationData
+              },
+              {
+                name: "上货",
+                data: activateData
+              }
+            ]
+          };
+          this.chartData = JSON.parse(JSON.stringify(resTb));
+        }
+      })
 
     },
-    initYWY(ywyId) {
-        getSalesmanSalesTotal(this.startTime,this.endTime,ywyId).then(res => {
+    initYWY() {
+        let  that = this;
+        getSalesmanSalesTotal(this.startTime,this.endTime,this.ywyId).then(res => {
           if (res.code === 0){
-            this.hexiaoNumber = res.data.verificationTotal;
-            this.xundianNumber = res.data.visitTotal;
-            this.shangHuoNumber = res.data.activateTotal;
+            console.log(res.data);
+            that.hexiaoNumber = res.data.verificationTotal;
+            that.xundianNumber = res.data.visitTotal;
+            that.shangHuoNumber = res.data.activateTotal;
           }
         }).catch(err => {
 
         });
-        getSalesmanSalesTrend(this.startTime,this.endTime,ywyId).then(res => {
+        getSalesmanSalesTrend(this.startTime,this.endTime,this.ywyId).then(res => {
            if (res.code === 0){
+             console.log(res.data);
              let apiResponse = res.data;
              // 提取日期列表并排序
-             let categories = apiResponse.data.map(item => {
+             let categories = apiResponse.map(item => {
                // 从日期中提取月日,例如 "2025-08-01" -> "08-01" -> "8/1" 或者只显示日 "1"
                return item.date.split("-")[2]; // 这里提取日期中的日部分
              });
@@ -235,14 +288,14 @@ export default {
              categories.sort((a, b) => parseInt(a) - parseInt(b));
 
              // 按日期排序数据
-             let sortedData = apiResponse.data.sort((a, b) => new Date(a.date) - new Date(b.date));
+             let sortedData = apiResponse.sort((a, b) => new Date(a.date) - new Date(b.date));
 
              // 提取核销数据和上货数据
              let verificationData = sortedData.map(item => item.verificationCount);
              let activateData = sortedData.map(item => item.activateCount);
 
              // 构造图表需要的格式
-             let res = {
+             let resTb = {
                categories: categories,
                series: [
                  {
@@ -256,12 +309,12 @@ export default {
                ]
              };
 
-             this.chartData = JSON.parse(JSON.stringify(res));
+             this.chartData = JSON.parse(JSON.stringify(resTb));
           }
         }).catch(err => {
 
         });
-      getSalesmanVisitTrend(this.startTime,this.endTime,ywyId).then(res => {
+      getSalesmanVisitTrend(this.startTime,this.endTime,this.ywyId).then(res => {
         if (res.code === 0){
           // 处理巡店趋势数据
           let apiResponse = res.data;
@@ -298,23 +351,23 @@ export default {
     initJXS() {
       getSalesTotal(this.startTime,this.endTime).then(res => {
             if (res.code === 0){
-              this.hexiaoNumber = res.data.verificationTotal;
-              this.xundianNumber = res.data.visitTotal;
+              this.hexiaoNumber = res.data.orderTotal;
+              this.xiaDanNumber = res.data.verificationTotal;
             }
       }).catch(err => {
 
       });
-      getSalesTrend(this.startTime,this.endTime).then(res => {
-          if (res.code === 0){
-            let apiResponse = res.data;
+      getSalesTrend(this.startTime,this.endTime).then(data => {
+          if (data.code === 0){
+            let apiResponse = data.data;
             // 提取日期列表并排序
-            let categories = apiResponse.data.map(item => {
+            let categories = apiResponse.map(item => {
               // 从日期中提取月日,例如 "2025-08-01" -> "08-01" -> "8/1" 或者只显示日 "1"
               return item.date.split("-")[2];
             })
             categories.sort((a, b) => parseInt(a) - parseInt(b));
             // 按日期排序数据
-            let sortedData = apiResponse.data.sort((a, b) => new Date(a.date) - new Date(b.date));
+            let sortedData = apiResponse.sort((a, b) => new Date(a.date) - new Date(b.date));
             let verificationData = sortedData.map(item => item.verificationCount);
             let orderCountData = sortedData.map(item => item.orderCount);
             let res = {
@@ -337,24 +390,19 @@ export default {
     },
     confirm(e) {
       this.startTime = e[0];
-      this.endTime = e[1];
-      this.startTimeXd = e[0]+' ~ '+e[1];
+      this.endTime = e[e.length -1];
+      this.startTimeXd = e[0]+' ~ '+e[e.length -1];
       this.timeShow = false;
-
+      if (this.type == 1){
+        this.initMenDian();
+      }
+      if (this.type == 2){
+        this.initYWY();
+      }
+      if (this.type == 3){
+        this.initJXS();
+      }
     },
-    getXdData() {
-      //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
-      let res = {
-        categories: ["7","8","9","10","11","12"],
-        series: [
-          {
-            name: "巡店",
-            data: [35,8,25,37,4,20]
-          },
-        ]
-      };
-      this.chartDataXd = JSON.parse(JSON.stringify(res));
-    }
   }
 };
 </script>
@@ -373,8 +421,8 @@ export default {
   font-size: 18px;
   color: #102A3C;
   text-align: center;
-  height: 10vh;
-  line-height: 10vh;
+  height: 12vh;
+  line-height: 16vh;
 }
   /* 请根据实际需求修改父元素尺寸,组件自动识别宽高 */
   .charts-box {

+ 9 - 3
pages/lgz/index/index.vue

@@ -111,8 +111,7 @@
 							</image>
 						</view>
 						<view class="">
-							你比我大,
-							为什么我出生那天你没来看我!
+              {{ randomText }}
 						</view>
 					</view>
 				</view>
@@ -126,6 +125,7 @@
 </template>
 
 <script>
+import { randomTexts } from '../../../utils/randomTexts.js';
 	import CustomTabbar from '@/components/tabbar.vue';
 	import {
 		addWinDetail,
@@ -247,10 +247,12 @@
 				saveData: {},
 				scanCode: '',
 				saveStatus: true,
-				fankaStatu:false
+				fankaStatu:false,
+        randomText: ""
 			}
 		},
 		onLoad() {
+      this.setRandomText();
 			let scanDetail = uni.getStorageSync('scanDetail');
 			this.scanCode = uni.getStorageSync('scanCode');
 			this.model1.userInfo.qrcodeId = this.scanCode;
@@ -270,6 +272,10 @@
 			}
 		},
 		methods: {
+      setRandomText() {
+        const randomIndex = Math.floor(Math.random() * randomTexts.length);
+        this.randomText = randomTexts[randomIndex];
+      },
 			initCardData(clickJson) {
 				let list = JSON.parse(clickJson);
 				for (let i = 0; i < this.cards.length; i++) {

+ 15 - 3
pages/lgz/index/unWinPrize.vue

@@ -30,12 +30,11 @@
             <image src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/prize/unWinPrize_1.png" mode="heightFix"
                    class="prize_image_1"></image>
           </view>
-          <view>
+          <view style="margin: 40rpx;">
             <image src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/prize/unWinPrize_2.png" mode="heightFix"
                    class="prize_image_2"></image>
           </view>
-          <view>你比我大,</view>
-          <view>为什么我出生那天你没来看我!</view>
+          <view>{{ randomText }}</view>
         </view>
 
       </view>
@@ -49,10 +48,23 @@
 </template>
 
 <script>
+import { randomTexts } from '../../../utils/randomTexts.js';
 export default {
+  data() {
+    return {
+      randomText: ""
+    }
+  },
+  mounted() {
+    this.setRandomText();
+  },
   methods: {
     goBack() {
       uni.navigateBack();
+    },
+    setRandomText() {
+      const randomIndex = Math.floor(Math.random() * randomTexts.length);
+      this.randomText = randomTexts[randomIndex];
     }
   }
 }

+ 3 - 2
pages/login.vue

@@ -20,7 +20,7 @@
  	export default {
  		data() {
  			return {
- 				scanCode: 'a77ef7cc629d8400',
+ 				scanCode: 'a37d38ad0e1f3472',
  				path: '',
  				status: false
  			}
@@ -41,7 +41,6 @@
  		methods: {
  			login() {
  				let that = this;
- 				console.log("111111111111")
  				if (this.scanCode == '' || this.scanCode == undefined) {
  					this.status = true;
  				}
@@ -65,9 +64,11 @@
  							})
  						} else {
  							console.log('登录失败!' + res.errMsg);
+              uni.showToast({ title: res.msg || '登录失败', icon: 'none' });
  						}
  					},
  					fail(err) {
+            uni.showToast({ title: err.msg || '登录失败', icon: 'none' });
  						console.log('登录失败', err);
  					}
  				});

+ 105 - 0
utils/randomTexts.js

@@ -0,0 +1,105 @@
+// utils/randomTexts.js
+export const randomTexts = [
+    "茫茫人海,相识一场也算报应。",
+    "纯爱已经满足不了我了,纯金可以。",
+    "努力不一定被看见,但休息一定会。",
+    "轻舟已过万重山,低头一看没上船。",
+    "自从疯了以后,感觉事情好办多了。",
+    "有些人一旦错过,真的是谢天谢地。",
+    "女人一定要身材好吗?胃口好不行吗?",
+    "万事开头难,对不起,我不开这个头。",
+    "多我一个暴发户,是不会破坏生态平衡吗?",
+    "重新爱上自已的理由,仅仅是洗了个头。",
+    "不上班,活不下去,上班了,不想活下去。",
+    "没得到过一真情,给点泼天的富贵怎么了。",
+    "自从学会了胡说八道,我的精神状态稳定多了。",
+    "现在不努力,以后别人壁咚的墙都是你搬的砖。",
+    "大晚上的就别发情感问题了吧,笑得人睡不着觉。",
+    "私信喜欢的人了,应该是个卖菜的,问我是哪根葱。",
+    "处对象吗?我分享欲很强,一日三餐都发代付给你。",
+    "能困住我的只有贫穷,爱算什么,上不了台面的东西。",
+    "这个世界不围着我转就算了,把我耍的团团转是几个意思?",
+    "当你觉得不行的时候,走到斑马线上,你就会变成一个行人。",
+    "如果早起对我有利我希望是宾利",
+    "上午疯下午疯晚上疯感觉人生到达了巅峰",
+    "强者从不抱怨环境,但我是弱者。我不但抱怨环境还抱怨强者",
+    "躺又躺不平卷又卷不赢仰卧起坐腰又不行",
+    "本来今年想咸鱼翻身结果粘锅了",
+    "没出息没关系还有气息已经很棒了",
+    "人际交往技巧:热情礼貌一问三不知",
+    "社会的边角料妈妈的小骄傲",
+    "一定要身材好吗胃口好不行吗",
+    "别担心一切都不会过去的0.",
+    "永远年轻永远半夜发神经",
+    "以后各走各的路咱们香水不犯洁厕灵",
+    "生在南方为什么还能喝到西北风我不理解",
+    "成功拿下一套房我的破房",
+    "从此转型变成没你不行",
+    "纯爱没有名字如果有那一定是金牛座",
+    "晚上一闭眼你猜怎么着嘿睡不着",
+    "见我真人的时候记得下载国家反诈app",
+    "与其虚寒问暖不如来笔巨款",
+    "我站在地上就是给世界的一根中指",
+    "今天开始轻断食轻轻地咬断食物。",
+    "生活咬碎我发现我哏啾啾的",
+    "钻进了生活的圈套好幸福原来是在上吊",
+    "不开心告诉我好吗让我知道你也有今天",
+    "话到嘴边又咽了下去,每天以此获得饱腹感",
+    "世界以痛吻你,你扇他巴掌啊",
+    "我最擅长的有氧运动:忍气吞声",
+    "退一万步来说..退一万步腿会很累",
+    "破碎感我没有破产感我倒是有一点",
+    "那天我用花洒打你的电话你为什么不接",
+    "其实我也是龙族我是熬夜",
+    "歇斯底里是崩溃,底里歇斯是美味",
+    "前途一片阴暗,好凉快",
+    "人生一波三折,好便宜",
+    "生活千疮百孔,好透气",
+    "话到嘴边又咽了下去,每天以此获得饱腹感",
+    "人生的阴影太多了….嘿嘿嘿好凉快啊",
+    "拼xx你不是说我是最幸运的人吗",
+    "生活就像一把刀插在我胳肢窝里,有点疼还有点想笑",
+    "财务自由时有时无",
+    "当一天和尚撞一天钟打一天破工发一天疯,",
+    "强子开门我是甜妹",
+    "没出息也没关系还有气息已经很厉害了",
+    "爱国诚信不敬业看情况友善",
+    "脏话不说藏在心里心就脏了",
+    "劝别人一套又一套劝自己只想绳子一套",
+    "摆烂23小时59分55秒愧疚5秒",
+    "又饿了果然漂亮不能当饭吃",
+    "怕什么世界只不过是我的游乐场罢了",
+    "如果世界是个群我想退了",
+    "年轻人你记住你别管记住什么你就记住",
+    "吃得苦中苦就会有吃不完的苦",
+    "今天不开心没关系反正明天也不会好过",
+    "头好烫感觉有人在我脑袋里吃火锅",
+    "我太脆弱了我上辈子一定是一片海苔",
+    "太累了抽一位幸运观众为我扛下所有",
+    "今年的脑子会比去年的好使吗?",
+    "这个点起床多少沾点前程似锦了",
+    "头晕乎乎的感觉缺点维生素RMB",
+    "告诉桃花不用开了请发财树开一下谢谢",
+    "谢谢你小手机除了你都没人跟我玩",
+    "那些打不死我的一直在打我",
+    "生活试图把我嚼碎结果发现我入口即化",
+    "摆烂归摆烂到了饭点还是要吃饭",
+    "生活乱套还不去睡觉",
+    "为情所困不是我奥特曼的作风",
+    "告诉桃花不用开了老衲我出家了",
+    "一定要长得好看吗穿的暖和不行吗",
+    "我的生活好苦,我求老天加点糖,怎么全是荒唐",
+    "为何幸福如驴肉薄饼",
+    "想变成章鱼一下子能扇八个人",
+    "大师七情六欲我怎么只剩下食欲了",
+    "人不能低下高贵的头但捡钱时例外",
+    "秋天太可爱了吧打个喷嚏都是爱秋",
+    "很喜欢下班,有种刑满释放的感觉",
+    "早上刚起床就有一股想睡午觉的冲动",
+    "没有什么困难是战胜不了我的",
+    "Y头这张卡你拿着密码是六个零余额也是",
+    "生活没有一点甜头,好减脂",
+    "人生一眼望到头,好视力",
+    "前途一片黑暗,好适合熬夜",
+    "这几年,我窝襄过,也窝襄过,也窝过,也襄过,也窝囊过......这是一百天随机文案,要求放在js中"
+];