Browse Source

完结0.1

0714Star 9 months ago
parent
commit
8bf68e2c53

+ 1 - 1
uniapp/components/my-userinfo/my-userinfo.vue

@@ -39,7 +39,7 @@
       <view class="panel">
         <view class="panel-title" style="font-family: 'Montserrat', sans-serif;font-weight: bolder">我的订单</view>
         <view class="panel-body">
-          <view class="panel-item" @click="toOrders(StaticState().ORDER.UNPAY)">
+          <view class="panel-item" @click="toOrders(StaticState().ORDER.ALL)">
             <van-icon name="gold-coin-o" size="28"/>
             <text>代付款</text>
           </view><view class="panel-item" @click="toOrders(StaticState().ORDER.UNRECEIVE)">

+ 9 - 1
uniapp/components/order-list/order-list.vue

@@ -2,7 +2,7 @@
   <view class="order-list">
     <view class="order-item" v-for="order in orders" :key="order.id">
       <view class="order-header">
-        <image class="user-avatar" :src="order.user.avatar" mode="aspectFill" />
+        <image class="user-avatar" :src="storeIconById[order.storeId]" mode="aspectFill" />
         <view class="order-info">
           <view class="order-number">订单编号:{{ order.transCode }}</view>
           <view class="order-remark">备注:{{ order.orderRemark||"" }}</view>
@@ -40,6 +40,14 @@ export default {
       required: true
     }
   },
+  data	(){
+	return {
+		storeIconById:{
+			1:"http://localhost:2441/files/1714889318659-scenes.png",
+			2:"http://localhost:2441/files/1714889474353-head2.jpg"
+		}
+	}  
+  },
   methods: {
     handleOrderDetail(order) {
       console.log(this.orders)

+ 2 - 2
uniapp/manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "uniapp",
+    "name" : "农妙果蔬通",
     "appid" : "__UNI__5DC0FBB",
     "description" : "",
     "versionName" : "1.0.0",
@@ -51,7 +51,7 @@
     /* 小程序特有相关 */
     "mp-weixin" : {
         "appid" : "wx2012fb43a1019634",
-		"requiredPrivateInfos" : [ "chooseLocation", "getLocation" ],
+        "requiredPrivateInfos" : [ "chooseLocation", "getLocation" ],
         "setting" : {
             "urlCheck" : false
         },

+ 1 - 1
uniapp/pages.json

@@ -3,7 +3,7 @@
 		{
 			"path": "pages/index/index",
 			"style": {
-				"navigationBarTitleText": "uni-app"
+				"navigationBarTitleText": "果蔬农贸点单小程序"
 			}
 		},
 		{

BIN
uniapp/static/vedio/1.mp4


+ 2 - 2
uniapp/store/order.js

@@ -28,7 +28,7 @@ export default{
                 console.log(response,"什么吗是什么三十年")
                 if (response.data && response.data.code === '200') {
                     // 如果请求成功并且返回的数据中包含 code 为 '200',则提交 mutation 更新店面数据
-                    commit('setShops', response.data.data);
+                    // commit('setShops', response.data.data);
                     console.log(response.data.data,"aaa")
                 } else {
                     console.error('请求失败或返回的数据不符合预期');
@@ -38,7 +38,7 @@ export default{
             }
 
             state.orders=[...state.orders,order]
-            this.commit('m_user/saveOrderToStorage')
+            // this.commit('m_user/saveOrderToStorage')
         },
         setOrders(state,orders){
             state.orders=orders

+ 1 - 1
uniapp/subpkg/payment/payment.vue

@@ -139,7 +139,7 @@ export default {
           let data =[]
           for(let i=0;i<this.cart.length;i++){
             data.push(
-                {productId:this.cart[i].goods_id,
+                {id:this.cart[i].goods_id, // TODO productId
                   count:this.cart[i].goods_count,
                   productName:this.cart[i].goods_name,
                   amount:this.cart[i].goods_price*this.cart[i].goods_count

+ 2 - 2
uniapp/subpkg/shopdetail/shopdetail.vue

@@ -5,7 +5,7 @@
       <view class="head">
         <view class="info">
         <view class="title">{{shop.storeName|truncate(10)}}</view>
-        <view class="address">{{shop.address.address|truncate(15)}}</view>
+        <view class="address">{{!shop.address || shop.address.address|truncate(15)}}</view>
         </view>
         <image class="shopIcon" :src="shop.storePicUrl"></image>
 <!--        <view class="card">-->
@@ -474,7 +474,7 @@ page {
 .head{
   display: flex;
   align-items: center;
-  justify-content: center;
+  justify-content: space-around;
   .info{
     //上下布局
     display: flex;

File diff suppressed because it is too large
+ 0 - 0
uniapp/unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map


File diff suppressed because it is too large
+ 0 - 0
uniapp/unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


File diff suppressed because it is too large
+ 0 - 0
uniapp/unpackage/dist/dev/.sourcemap/mp-weixin/components/my-login/my-login.js.map


File diff suppressed because it is too large
+ 0 - 0
uniapp/unpackage/dist/dev/.sourcemap/mp-weixin/components/my-userinfo/my-userinfo.js.map


File diff suppressed because it is too large
+ 0 - 0
uniapp/unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/home.js.map


File diff suppressed because it is too large
+ 0 - 0
uniapp/unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map


File diff suppressed because it is too large
+ 0 - 0
uniapp/unpackage/dist/dev/.sourcemap/mp-weixin/subpkg/login/login.js.map


File diff suppressed because it is too large
+ 0 - 0
uniapp/unpackage/dist/dev/.sourcemap/mp-weixin/subpkg/order/order.js.map


+ 10 - 11
uniapp/unpackage/dist/dev/mp-weixin/common/vendor.js

@@ -776,7 +776,7 @@ function populateParameters(result) {
 
   var parameters = {
     appId: "__UNI__5DC0FBB",
-    appName: "uniapp",
+    appName: "农妙果蔬通",
     appVersion: "1.0.0",
     appVersionCode: "100",
     appLanguage: getAppLanguage(hostLanguage),
@@ -875,7 +875,7 @@ var getAppBaseInfo = {
     var hostLanguage = language.replace('_', '-');
     result = sortObject(Object.assign(result, {
       appId: "__UNI__5DC0FBB",
-      appName: "uniapp",
+      appName: "农妙果蔬通",
       appVersion: "1.0.0",
       appVersionCode: "100",
       appLanguage: getAppLanguage(hostLanguage),
@@ -1557,7 +1557,7 @@ function initData(vueOptions, context) {
     try {
       data = data.call(context); // 支持 Vue.prototype 上挂的数据
     } catch (e) {
-      if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"uniapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
+      if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"农妙果蔬通","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
         console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
       }
     }
@@ -8934,7 +8934,7 @@ function type(obj) {
 
 function flushCallbacks$1(vm) {
     if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
-        if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"uniapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
+        if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"农妙果蔬通","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
             var mpInstance = vm.$scope;
             console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
                 ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
@@ -8955,14 +8955,14 @@ function nextTick$1(vm, cb) {
     //1.nextTick 之前 已 setData 且 setData 还未回调完成
     //2.nextTick 之前存在 render watcher
     if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
-        if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"uniapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
+        if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"农妙果蔬通","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
             var mpInstance = vm.$scope;
             console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
                 ']:nextVueTick');
         }
         return nextTick(cb, vm)
     }else{
-        if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"uniapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
+        if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"农妙果蔬通","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
             var mpInstance$1 = vm.$scope;
             console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
                 ']:nextMPTick');
@@ -9058,7 +9058,7 @@ var patch = function(oldVnode, vnode) {
     });
     var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
     if (Object.keys(diffData).length) {
-      if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"uniapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
+      if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"农妙果蔬通","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
         console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
           ']差量更新',
           JSON.stringify(diffData));
@@ -12023,7 +12023,6 @@ var _default = {
   mutations: {
     //更新收货地址
     putOrder: function putOrder(state, order) {
-      var _this = this;
       return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
         var response;
         return _regenerator.default.wrap(function _callee$(_context) {
@@ -12046,7 +12045,7 @@ var _default = {
                 console.log(response, "什么吗是什么三十年");
                 if (response.data && response.data.code === '200') {
                   // 如果请求成功并且返回的数据中包含 code 为 '200',则提交 mutation 更新店面数据
-                  commit('setShops', response.data.data);
+                  // commit('setShops', response.data.data);
                   console.log(response.data.data, "aaa");
                 } else {
                   console.error('请求失败或返回的数据不符合预期');
@@ -12059,8 +12058,8 @@ var _default = {
                 console.error('请求失败:', _context.t0);
               case 11:
                 state.orders = [].concat((0, _toConsumableArray2.default)(state.orders), [order]);
-                _this.commit('m_user/saveOrderToStorage');
-              case 13:
+                // this.commit('m_user/saveOrderToStorage')
+              case 12:
               case "end":
                 return _context.stop();
             }

+ 1 - 1
uniapp/unpackage/dist/dev/mp-weixin/components/my-userinfo/my-userinfo.js

@@ -85,7 +85,7 @@ var render = function () {
   var m1 = _vm.getUserName()
   if (!_vm._isMounted) {
     _vm.e0 = function ($event) {
-      _vm.toOrders(_vm.StaticState().ORDER.UNPAY)
+      _vm.toOrders(_vm.StaticState().ORDER.ALL)
     }
     _vm.e1 = function ($event) {
       _vm.toOrders(_vm.StaticState().ORDER.UNRECEIVE)

+ 1 - 1
uniapp/unpackage/dist/dev/mp-weixin/pages/index/index.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "uni-app",
+  "navigationBarTitleText": "果蔬农贸点单小程序",
   "usingComponents": {
     "shop-card": "/components/shop-card/shop-card"
   }

+ 1 - 1
uniapp/unpackage/dist/dev/mp-weixin/project.config.json

@@ -20,7 +20,7 @@
     "compileType": "miniprogram",
     "libVersion": "3.3.4",
     "appid": "wx2012fb43a1019634",
-    "projectname": "uniapp",
+    "projectname": "农妙果蔬通",
     "condition": {},
     "editorSetting": {
         "tabIndent": "insertSpaces",

+ 12 - 1
vue/src/utils/DateUtil.js

@@ -69,6 +69,17 @@ function getCurrentDate() {
     return formattedDate;
 }
 
+/**
+ * 获取明天的日期
+ * @returns {string}
+ */
+function getTomorrowDate() {
+    var tomorrow = new Date();
+    tomorrow.setDate(tomorrow.getDate() + 1); // 将日期设置为明天
+    var formattedDate = formatDate(tomorrow);
+    return formattedDate;
+}
+
 /**
  * 获取前i个月前的月初日期
  * @param i
@@ -130,5 +141,5 @@ function formatDate(date) {
     return year + '-' + month + '-' + day;
 }
 
-export  { getCurrentDate, getLastMonthStartDate, getLastMonthEndDate, getLastYearStartDate, getLastYearEndDate,
+export  { getCurrentDate,getTomorrowDate, getLastMonthStartDate, getLastMonthEndDate, getLastYearStartDate, getLastYearEndDate,
     getPreviousMonthStartDate,getPreviousMonthEndDate};

+ 6 - 2
vue/src/views/Manager.vue

@@ -126,7 +126,10 @@ export default {
       this.$router.push('/login')
     }
     // TODO 计时器
-    this.timer =  setInterval(this.getUnfinishedNums, 1000)
+    setTimeout(()=>{
+      this.timer =  setInterval(this.getUnfinishedNums, 1000)
+
+    },500)
   },
   unmounted() {
     clearTimeout(this.timer)
@@ -147,7 +150,8 @@ export default {
       this.$request.get("/orders/getnums/"+this.user?.storeId).then(res=>{
         if(res.data>this.ordersCount){
           // console.log(this.$refs.audioPlayer)
-          // this.$refs.audioPlayer.play(); // 播放音效
+          this.$refs.audioPlayer.play(); // 播放音效
+          // this.$emit("UpdateShopData")
         }
         this.ordersCount = res.data==0?null:res.data
       })

+ 61 - 37
vue/src/views/manager/AI/CorpGrown.vue

@@ -56,7 +56,7 @@
             ></i>
             <ul>
               <li>
-                <span>{{ item.value }}</span>
+                <span>{{ item.value }}</span>
               </li>
               <li>{{ item.name }}</li>
             </ul>
@@ -100,43 +100,9 @@ export default {
       todayData:[], // 当天的订单列表
       factData:[],
       pieData:[],
+      ordersDataToday:{ordersCount:"", ordersAmount:"",ordersUnfinished:""},// 本日信息
+      ordersDataMonth:{ordersCount:"", ordersAmount:"",ordersUnfinished:""},// 本月信息
       countData: [
-        {
-          name: "今日支付订单",
-          value: "1234",
-          icon: "success",
-          color: "#2ec7c9",
-        },
-        {
-          name: "今日收藏订单",
-          value: "210",
-          icon: "star-on",
-          color: "#ffb980",
-        },
-        {
-          name: "今日未支付订单",
-          value: "1234",
-          icon: "s-goods",
-          color: "#5ab1ef",
-        },
-        {
-          name: "本月支付订单",
-          value: "1234",
-          icon: "success",
-          color: "#2ec7c9",
-        },
-        {
-          name: "本月收藏订单",
-          value: "210",
-          icon: "star-on",
-          color: "#ffb980",
-        },
-        {
-          name: "本月未支付订单",
-          value: "1234",
-          icon: "s-goods",
-          color: "#5ab1ef",
-        },
       ],
       timer:null,
       time:Date.now(),
@@ -399,6 +365,51 @@ export default {
         that.XYData.barCurMonthCount = curMonth.map(item=>item.count);
         that.XYData.barProductNames=lastMonth.map(item=>item.productName);
         console.log(lastMonth)
+
+        const {resMonth,resToday,unfinishedCount} = await that.loadStoreStatement()//
+
+        that.ordersDataMonth.ordersCount = 0//resMonth.length || 0;
+        that.ordersDataToday.ordersCount = 0//resToday.length || 0;
+
+        that.ordersDataMonth.ordersUnfinished = 0//unfinishedCount || 0;
+        that.ordersDataToday.ordersUnfinished = 0//unfinishedCount || 0;
+        that.countData.push(
+            {
+              name: "今日完成订单", // TODO
+              value: (resToday.length ||0)+"个",//this.ordersDataToday.ordersCount ,
+              icon: "success",
+              color: "#2ec7c9",
+            },
+            {
+              name: "今日未完成订单", // TODO
+              value: unfinishedCount+"个",//this.ordersDataToday.ordersUnfinished,
+              icon: "star-on",
+              color: "#ffb980",
+            },
+            {
+              name: "今日完成金额",//  TODO
+              value: "¥"+(resToday.reduce((before,cur)=>{return before + cur.amount},0) || 0),//"123",//this.ordersDataToday.ordersAmount,
+              icon: "s-goods",
+              color: "#5ab1ef",
+            },
+            {
+              name: "本月完成订单", // TODO
+              value: (resMonth.length || "0")+"个",//this.ordersDataMonth.ordersCount,
+              icon: "success",
+              color: "#2ec7c9",
+            },
+            {
+              name: "本月未完成订单",// TODO
+              value: (unfinishedCount ||"0")+"个",//this.ordersDataMonth.ordersUnfinished,
+              icon: "star-on",
+              color: "#ffb980",
+            },
+            {
+              name: "本月金额", // TODO
+              value: "¥"+(resMonth.reduce((before,cur)=>{return before + cur.amount},0) || "0") ,//"123",//this.ordersDataMonth.ordersAmount,
+              icon: "s-goods",
+              color: "#5ab1ef",
+            })
       }
 
       await f1();
@@ -454,6 +465,19 @@ export default {
         }})
       console.log(res)
       return res.data
+    },
+    async loadStoreStatement(){ // 加载店铺当天的报表和上月的报表数据
+      const resToday= await this.$request.get(`/saleStatement/getShopPdAccount/${this.user?.storeId}`,{params:{
+          "timeStart": DateUtil.getCurrentDate(),
+          "timeOver": DateUtil.getTomorrowDate()
+        }})
+      const resMonth= await this.$request.get(`/saleStatement/getShopPdAccount/${this.user?.storeId}`,{params:{
+          "timeStart": DateUtil.getLastMonthStartDate(),
+          "timeOver": DateUtil.getLastMonthEndDate()
+        }})
+      console.log("resToday-resMonth",resToday,resMonth)
+      const unfinishedCount = await this.$request.get(`/orders/getnums/${this.user?.storeId}`);
+      return { resToday:resToday.data,resMonth:resMonth.data,unfinishedCount :unfinishedCount.data}
     }
     ,
     /** 随机left ~ right 范围内的数字 @param left @param right @returns {*} */

+ 2 - 1
vue/src/views/manager/Shop/ShopOrders.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div @UpdateShopData="load()">
     <div class="search">
       <el-input placeholder="请输入关键字查询" style="width: 200px" v-model="username"></el-input>
       <el-button type="info" plain style="margin-left: 10px" @click="load(1)">查询</el-button>
@@ -232,6 +232,7 @@ import Vue from "vue";
 
 export default {
   name: "Orders",
+  // props{},
   data() {
     return {
       tableData: [],  // 所有的数据

Some files were not shown because too many files changed in this diff