浏览代码

Merge branch 'master' of http://git.cc-lotus.info/Free-canteen/smart-canteen

zs 1 年之前
父节点
当前提交
e7f6bbb1a2

+ 25 - 24
app.js

@@ -6,39 +6,39 @@ import * as httpUtil from "./utils/httpUtil";
 App({
   onLaunch() {
     // 展示本地存储能力
-    const logs = wx.getStorageSync('logs') || []
-    logs.unshift(Date.now())
-    wx.setStorageSync('logs', logs)
+    const logs = wx.getStorageSync('logs') || [];
+    logs.unshift(Date.now());
+    wx.setStorageSync('logs', logs);
     wx.login({
-      success: res => {
-        const app = getApp()
-        const { code: js_code } = res
+      success: (res) => {
+        const app = getApp();
+        const { code: js_code } = res;
         // 发送 res.code 到后台换取 openId, sessionKey, unionId
         wx.request({
           url: `${app.globalData.publicUrl}/st/api/weixin/appAuth?js_code=` + js_code,
-          method: "get",
-          success: res => {
-            const { errcode, data } = res.data
+          method: 'get',
+          success: (res) => {
+            const { errcode, data } = res.data;
             if (errcode === 0) {
               app.globalData.wxInfo = data;
             }
           },
-          error: err => {
+          error: (err) => {
             wx.showToast({
               title: err.msg,
-              icon: 'error'
-            })
-          }
-        })
-      }
-    })
+              icon: 'error',
+            });
+          },
+        });
+      },
+    });
     //获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度
     wx.getSystemInfo({
       success: (res) => {
-        this.globalData.height = res.statusBarHeight
-        this.globalData.windowHeight = res.windowHeight
-      }
-    })
+        this.globalData.height = res.statusBarHeight;
+        this.globalData.windowHeight = res.windowHeight;
+      },
+    });
   },
   globalData: {
     // 微信用户基本信息
@@ -50,14 +50,15 @@ App({
     // 手机页面高度
     windowHeight: 0,
     // 请求接口
-    publicUrl: 'http://192.168.1.197:9902',
+    // publicUrl: 'http://192.168.1.197:9901',
+    publicUrl: 'https://broadcast.waityou24.cn',
     // publicUrl: 'https://www.waityou24.cn',
     // 图片请求接口
-    fileUrl: "http://broadcast.waityou24.cn",
+    fileUrl: 'https://broadcast.waityou24.cn',
   },
   // 微信openid回调
   toLogin: login.toLogin,
-  ...httpUtil
-})
+  ...httpUtil,
+});
 
 

+ 1 - 1
commpents/newsList/index.js

@@ -19,7 +19,7 @@ Component({
    */
   methods: {
     detail: function (e) {
-      this.triggerEvent('detail', { id: e.currentTarget.dataset.id })
+      this.triggerEvent('detail', { id: e.currentTarget.dataset.id });
     }
   }
 })

+ 1 - 1
commpents/newsList/index.wxml

@@ -1,5 +1,5 @@
 <view class="main">
-  <view class="list" wx:key="item" wx:for="{{list}}" bindtap="detail" data-id="{{item.id}}">
+  <view class="list" wx:key="item" wx:for="{{list}}" bindtap="detail" data-id="{{item._id}}">
     <view class="left">
       <view class="title">
         {{item.title}}

+ 0 - 1
miniprogram_npm/vant-weapp/radio/index.js

@@ -34,7 +34,6 @@ VantComponent({
             instance.$emit('change', value);
         },
         onChange(event) {
-            console.log(event);
             this.emitChange(this.data.name);
         },
         onClickLabel() {

+ 2 - 2
pages/calorie/index.js

@@ -15,11 +15,11 @@ Page({
   },
   // 提交
   formSubmit: function (e) {
-    console.log('form发生了submit事件,携带数据为:', e.detail.value)
+    // console.log('form发生了submit事件,携带数据为:', e.detail.value)
   },
   // 重置
   formReset: function (e) {
-    console.log('form发生了reset事件,携带数据为:', e.detail.value)
+    // console.log('form发生了reset事件,携带数据为:', e.detail.value)
     this.setData({ form: {} })
   },
   // 返回页面

+ 0 - 1
pages/food/index.js

@@ -83,7 +83,6 @@ Page({
       data.two = val.arrange.lunch.length > 0 ? 30 * val.arrange.lunch.length : 30;
       data.thr = val.arrange.dinner.length > 0 ? 30 * val.arrange.dinner.length : 30;
       data.total = data.one + data.two + data.thr;
-      console.log(data);
       this.setData({ style: data })
 
     }

+ 0 - 1
pages/home/index.js

@@ -90,7 +90,6 @@ Page({
           method: 'POST',
           data,
           success: (res) => {
-            console.log(res)
             const setpInfo = res.data?.data;
             if (stepInfo) this.setData({ step: stepInfo.step });
           },

+ 1 - 2
pages/news/detail.js

@@ -24,9 +24,8 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: async function (options) {
-    console.log(options.id);
     const res = await app.$get(`/news/${options.id}`);
-    var result = res.data.data;
+    var result = res.data;
     result.content = formatRichText(result.content);
     this.setData({ detailInfo: result });
     // wx.request({

+ 2 - 2
pages/news/index.js

@@ -42,10 +42,10 @@ Page({
   onLoad: async function (options) {
     this.searchST();
     const res = await app.$get('/news', { type: '国内新闻' });
-    let data = this.dealImg(res.data.data);
+    let data = this.dealImg(res.data);
     this.setData({ oneList: data });
     const res2 = await app.$get('/news', { type: '健康资讯' });
-    let data2 = this.dealImg(res2.data.data);
+    let data2 = this.dealImg(res2.data);
     this.setData({ twoList: data2 });
   },
   dealImg(list) {

+ 1 - 9
pages/reserve/index.js

@@ -43,7 +43,6 @@ Page({
   },
   // 选择日期
   bindDateChange: async function (e) {
-    console.log('picker发送选择改变,携带值为', e.detail.value);
     this.setData({ today: e.detail.value });
     await this.searchDate();
     await this.searchOrder();
@@ -73,17 +72,14 @@ Page({
   // 选择餐数量
   // 早餐,午餐,晚餐
   oneChange: function (e) {
-    console.log(e);
     const { data, type } = e.target.dataset;
     const { detail } = e;
     this.menuNumOpera(type, detail, data._id);
   },
   // 增加
   onePlus: function (e) {
-    console.log('增加');
     let data = e.target.dataset.data;
     let type = this.data.infoTab;
-    console.log(typeof type);
     let initMealData = { list: [], reserve: 0 };
     let meal;
     let mw;
@@ -135,10 +131,8 @@ Page({
    */
   menuNumOpera(type, num, id) {
     let list = this.data[`${type}List`];
-    console.log(list);
     const li = list.findIndex((f) => f._id === id);
     const ld = list.find((f) => f._id === id);
-    console.log(li, id);
     if (ld) {
       ld.num = num;
       list.splice(li, 1, ld);
@@ -150,7 +144,6 @@ Page({
 
   // 减少
   oneMinus: function (e) {
-    console.log('减少');
     let data = e.target.dataset.data;
     let type = this.data.infoTab;
     let initMealData = { list: [], reserve: 0 };
@@ -287,11 +280,10 @@ Page({
    * @param {Array} list 某餐的内容
    */
   dealOrderToMenu(type, list) {
-    console.log(type, list);
     if (list.length <= 0) return;
     const menu = this.data[`${type}List`];
     if (!menu) {
-      console.log('没找到菜单');
+      console.error('没找到菜单');
       return;
     }
     for (const o of list) {

+ 1 - 1
utils/httpUtil.js

@@ -1,4 +1,4 @@
-let baseUrl = 'http://192.168.1.197:9902/st/api';
+let baseUrl = 'https://broadcast.waityou24.cn/st/api';
 const $get = (uri, data) => {
     return new Promise((resolve, reject) => {
         wx.request({

+ 2 - 2
utils/login.js

@@ -20,8 +20,8 @@ module.exports = {
             error: err => {
               wx.showToast({
                 title: err.msg,
-                icon: 'error'
-              })
+                icon: 'error',
+              });
               reject('error');
             }
           })