3 Angajamente 0cf8fdc733 ... 4b47e20d94

Autor SHA1 Permisiunea de a trimite mesaje. Dacă este dezactivată, utilizatorul nu va putea trimite nici un fel de mesaj Data
  邪性 4b47e20d94 最新版 3 ani în urmă
  邪性 b2318d76c5 20211104 3 ani în urmă
  邪性 3b79be7cd7 20211023 请假管理提示修改 3 ani în urmă

+ 33 - 9
app.js

@@ -61,10 +61,22 @@ App({
     }
     user(this).then(res => login(this)).then(res => {
       this.globalData.codeSession = true;
-    }).catch(res => wx.lxd.Notify({
-      message: res,
-      icon: "warn-o"
-    }))
+    }).catch(res => {
+      if (wx.hasOwnProperty("lxd") && wx.lxd.hasOwnProprety("Notify")) {
+        wx.lxd.Notify({
+          message: res,
+          icon: "warn-o"
+        })
+      } else {
+        wx.showModal({
+          confirmText: '确认',
+          content: res,
+          showCancel: false,
+          title: '注意',
+        })
+      }
+    }
+    )
   },
   globalData: {
     // 定义tabber
@@ -104,11 +116,23 @@ App({
     hot: true,
     // 全局请求方法
     axios ({ url: _url = '', token: _token = true, method: _method = 'post', data: _data = {}, success: _success = () => { }, complete: _complete = () => { } }) {
-      let globalurl = "http://192.168.2.45:8887", error = (data) => {
-        wx.lxd.Notify({
-          message: data,
-          icon: "warn-o"
-        })
+      let globalurl = "http://192.168.2.45:8888", error = (data) => {
+        console.log(data)
+        if (wx.hasOwnProperty("lxd") && wx.lxd.hasOwnProperty("Notify")) {
+          wx.lxd.Notify({
+            message: data,
+            icon: "warn-o"
+          })
+        } else {
+          wx.showModal({
+            confirmText: '确认',
+            content: data,
+            showCancel: false,
+            title: '注意',
+          })
+        }
+
+
       };
       globalurl = "https://lsr.zzly.vip";
       let header_token = {};

+ 1 - 0
components/l-container/index.less

@@ -1,5 +1,6 @@
 // 默认
 .custom{
+  top: 0;
   z-index: 100;
 }
 .nav-custom {

+ 1 - 0
components/l-container/index.wxss

@@ -1,4 +1,5 @@
 .custom {
+  top: 0;
   z-index: 100;
 }
 .nav-custom {

+ 1 - 0
pages/addinput/addinput.js

@@ -94,6 +94,7 @@ Page({
       method: 'get',
       success (res) {
         let { data } = res.data, obj = {}, objs = [[], []];
+        if(data.length==0) return false;
         data.forEach((item, index) => {
           index == 0 ? keya = item.title : '';
           obj[item["title"]] = {};

+ 4 - 5
pages/detail/detail.js

@@ -20,9 +20,9 @@ Page({
   },
   // 点击按钮事件
   onClickButton (e) {
-    let { type } = e.currentTarget.dataset;
+    let { type, status } = e.currentTarget.dataset;
     // 点击立即购买
-    if (type == "buy") {
+    if (type == "buy" && status != 0) {
       if (!token()) {
         wx.navigateTo({
           url: '/pages/sgin/sgin',
@@ -30,7 +30,6 @@ Page({
         return false
       }
       let { id, shopdetail } = this.data;
-      console.log(id)
       wx.navigateTo({
         url: `/pages/pay/pay?data=${JSON.stringify({ id, shopdetail })}`,
       })
@@ -44,9 +43,9 @@ Page({
       url: `/commodity/wx_commodity_detail/${id}/`,
       method: "get",
       success (res) {
-        let { amount, price, days, detail_images: detaillist, introduce: desc, main_image: img, name } = res.data.data;
+        let { amount, price, days, detail_images: detaillist, introduce: desc, main_image: img, name, status } = res.data.data;
         shopdetail = {
-          name, price, detaillist, desc, img, amount, days
+          name, price, detaillist, desc, img, amount, days, status
         };
         that.setData({
           shopdetail

+ 2 - 1
pages/detail/detail.wxml

@@ -33,7 +33,8 @@
     <!-- 功能条 -->
     <van-goods-action>
       <van-goods-action-icon data-type="share" icon="share-o" text="分享" bind:click="onClickIcon" />
-      <van-goods-action-button data-type="buy" text="立即购买" bind:click="onClickButton" />
+      <van-goods-action-button color="{{shopdetail.status==0 ? 'grey' : ''}}" data-status="{{shopdetail.status}}"
+        data-type="buy" text="{{shopdetail.status==0 ? '商品已下架': '立即购买'}}" bind:click="onClickButton" />
     </van-goods-action>
   </view>
 </l-container>

+ 0 - 1
pages/detailed/detailed.js

@@ -19,7 +19,6 @@ Page({
       url: '/option/balance_log/',
       method: 'get',
       success (res) {
-        console.log(res)
         let { data } = res.data;
         datalist = [...datalist, ...data];
         that.currentPage++;

+ 1 - 1
pages/leave/leave.js

@@ -106,7 +106,7 @@ Page({
     this.totalResult = 1; this.currentPage = 1;
     this.setData({
       datalist: [],
-      notice: `请假截止时间:请假日期的前一天${user.lead_hour}:00`
+      notice: `请假截止时间:${user.lead_hour}`
     })
     this.AdddataRequest()
   },

+ 17 - 6
pages/pay/pay.js

@@ -2,17 +2,16 @@
 const app = getApp();
 const { axios } = app.globalData;
 Page({
-
-  /**
-   * 页面的初始数据
-   */
   data: {
+    nick_name:'',
     loadding: false,//正在支付中 true
     disabled: false,//支付完毕 true
     message: '',//订单备注
     paytype: "1",// 支付方式 单选
     balance: null,//余额
     result: [],//复选框
+    errmessage: '',//订单重复提示
+    show: false,//弹出框
   },
   // 请求余额
   Request () {
@@ -21,9 +20,10 @@ Page({
       url: '/option/balance/',
       method: 'get',
       success (res) {
-        let { data } = res.data;
+        let { data } = res.data, result = data["balance"] * 1 > 0 ? ["1"] : [];
         that.setData({
-          ...data[0]
+          ...data[0],
+          result
         })
       }
     })
@@ -64,6 +64,10 @@ Page({
               resolve({ type: 1, value: "支付成功" });
               return false;
             }
+            if (!!data.error_msg) {
+              that.setData({ show: true, errmessage: data.error_msg })
+              return false;
+            };
             wx.requestPayment({
               timeStamp: data.timeStamp,
               nonceStr: data.nonceStr,
@@ -95,6 +99,12 @@ Page({
       }
     );
   },
+  // 弹出框确定事件
+  confirmFunc () {
+    wx.redirectTo({
+      url: '/pages/order/order',
+    })
+  },
   // 挑选地址
   ChooseAddress () {
     wx.navigateTo({
@@ -115,6 +125,7 @@ Page({
       title: "支付", //标题
       bgc: false,//使用更改后的颜色;配合json使用
     })
+    this.setData({nick_name:app.globalData.user.nick_name})
     let { data } = options;
     if (!!data) {
       data = JSON.parse(data);

+ 1 - 0
pages/pay/pay.json

@@ -1,5 +1,6 @@
 {
   "usingComponents": {
+    "van-dialog": "@vant/weapp/dialog/index",
     "van-submit-bar": "@vant/weapp/submit-bar/index",
     "van-cell": "@vant/weapp/cell/index",
     "van-tag": "@vant/weapp/tag/index",

+ 4 - 3
pages/pay/pay.wxml

@@ -12,10 +12,10 @@
         </view>
       </view>
     </van-cell>
-    <!-- 商品清单 -->
+    <!-- 商品清单  -->
     <view class="pay-list">
       <van-cell value="{{shopdetail.name}}">
-        <view class="title" slot="title">老实人学生营养餐</view>
+        <view class="title" slot="title">{{nick_name}}</view>
       </van-cell>
       <view class="container" slot="title">
         <scroll-view scroll-x="true" class="scroll">
@@ -64,4 +64,5 @@
     <van-submit-bar disabled="{{disabled}}" loading="{{loadding}}" price="{{ shopdetail.amount*100 }}"
       button-text="提交订单" bind:submit="onSubmit" />
   </view>
-</l-container>
+</l-container>
+<van-dialog title="提示" message-align="left" show="{{ show }}" message="{{errmessage}}" bind:confirm="confirmFunc" />

+ 13 - 13
project.config.json

@@ -1,7 +1,8 @@
 {
-  "description": "项目配置文件",
+  "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
   "packOptions": {
-    "ignore": []
+    "ignore": [],
+    "include": []
   },
   "setting": {
     "urlCheck": false,
@@ -24,7 +25,7 @@
     "lazyloadPlaceholderEnable": false,
     "useMultiFrameRuntime": true,
     "useApiHook": true,
-    "useApiHostProcess": false,
+    "useApiHostProcess": true,
     "babelSetting": {
       "ignore": [],
       "disablePlugins": [],
@@ -36,21 +37,16 @@
     "packNpmManually": false,
     "packNpmRelationList": [],
     "minifyWXSS": true,
-    "showES6CompileOption": false
+    "disableUseStrict": false,
+    "minifyWXML": true,
+    "showES6CompileOption": false,
+    "useCompilerPlugins": false,
+    "useStaticServer": true
   },
   "compileType": "miniprogram",
   "libVersion": "2.19.2",
   "appid": "wx0347990f2c6f574c",
   "projectname": "%E9%A4%90%E9%A5%AE%E9%A1%B9%E7%9B%AE",
-  "debugOptions": {
-    "hidedInDevtools": []
-  },
-  "scripts": {},
-  "staticServerOptions": {
-    "baseURL": "",
-    "servePath": ""
-  },
-  "isGameTourist": false,
   "condition": {
     "search": {
       "list": []
@@ -70,5 +66,9 @@
     "miniprogram": {
       "list": []
     }
+  },
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
   }
 }

+ 7 - 12
project.private.config.json

@@ -1,15 +1,8 @@
 {
-  "setting": {},
+  "setting": {
+    "compileHotReLoad": true
+  },
   "condition": {
-    "plugin": {
-      "list": []
-    },
-    "game": {
-      "list": []
-    },
-    "gamePlugin": {
-      "list": []
-    },
     "miniprogram": {
       "list": [
         {
@@ -27,7 +20,7 @@
         {
           "name": "支付页面",
           "pathName": "pages/pay/pay",
-          "query": "data={\"id\":3}",
+          "query": "data={\"id\":4,\"shopdetail\":{\"name\":\"2021年十月份餐费\",\"price\":\"20.00\",\"detaillist\":[\"https://lsr.zzly.vip/up/commodity_image/20211017171925772741.png\"],\"desc\":\"2021年十月份餐费,请在2021年10月6日中午12:00前完成缴费\",\"img\":\"https://lsr.zzly.vip/up/commodity_image/20210928084841234721.png\",\"amount\":\"340.00\",\"days\":17}}",
           "scene": null
         },
         {
@@ -86,5 +79,7 @@
         }
       ]
     }
-  }
+  },
+  "projectname": "school_meal_wxapp",
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
 }