Quellcode durchsuchen

修改监听是否登录

YY vor 3 Jahren
Ursprung
Commit
25069c04dc

+ 24 - 3
pages/apply_examine/index.js

@@ -11,8 +11,7 @@ Page({
       infoHeight: '',
       // 采购申请审核
       list: [
-         { id: '001', user_name: '法外狂徒张三', user_phone: '12345678901', examine_name: '李四', examine_date: '111', status_name: '待审', status: '0', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], },
-         { id: '002', user_name: '小红帽', user_phone: '98765432109', examine_date: '222', examine_name: '赵五', status_name: '待审', status: '0', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], }
+
       ],
       // 弹框
       dialog: { title: '详细信息', show: false, type: '1' },
@@ -87,9 +86,32 @@ Page({
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
+      this.watchLogin();
       // 计算高度
       this.searchHeight();
    },
+   // 监听用户是否登录
+   watchLogin: function () {
+      let data = [
+         { id: '001', user_name: '法外狂徒张三', user_phone: '12345678901', examine_name: '李四', examine_date: '111', status_name: '待审', status: '0', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], },
+         { id: '002', user_name: '小红帽', user_phone: '98765432109', examine_date: '222', examine_name: '赵五', status_name: '待审', status: '0', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], }
+      ]
+      this.setData({ list: data })
+      // wx.getStorage({
+      // key: 'user',
+      // success: res => {
+      //   if (res.data) {
+      //     // 查询菜单
+      //     if (res.data) this.searchRouter(res.data);
+      //     res.data.type = type.find((i) => i.value == res.data.type).label;
+      //     if (res.data) this.setData({ userInfo: res.data });
+      //     if (res.data && res.data.avatarUrl) this.setData({ avatarUrl: res.data.avatarUrl });
+      //   } else {
+      //     wx.redirectTo({ url: '/pages/login/index', })
+      //   }
+      // }
+      // })
+   },
    // 计算高度
    searchHeight: function () {
       let frameStyle = this.data.frameStyle;
@@ -112,7 +134,6 @@ Page({
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
-      this.search();
    },
 
    /**

+ 24 - 2
pages/apply_review/index.js

@@ -11,8 +11,7 @@ Page({
       infoHeight: '',
       // 采购申请
       list: [
-         { id: '001', user_name: '法外狂徒张三', user_phone: '12345678901', examine_name: '李四', examine_date: '111', status_name: '待审', status: '1', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], },
-         { id: '002', user_name: '小红帽', user_phone: '98765432109', examine_date: '222', examine_name: '赵五', status_name: '待审', status: '1', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], }
+
       ],
       // 弹框
       dialog: { title: '详细信息', show: false, type: '1' },
@@ -55,9 +54,32 @@ Page({
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
+      this.watchLogin();
       // 计算高度
       this.searchHeight();
    },
+   // 监听用户是否登录
+   watchLogin: function () {
+      let data = [
+         { id: '001', user_name: '法外狂徒张三', user_phone: '12345678901', examine_name: '李四', examine_date: '111', status_name: '待审', status: '1', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], },
+         { id: '002', user_name: '小红帽', user_phone: '98765432109', examine_date: '222', examine_name: '赵五', status_name: '待审', status: '1', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], }
+      ]
+      this.setData({ list: data })
+      // wx.getStorage({
+      // key: 'user',
+      // success: res => {
+      //   if (res.data) {
+      //     // 查询菜单
+      //     if (res.data) this.searchRouter(res.data);
+      //     res.data.type = type.find((i) => i.value == res.data.type).label;
+      //     if (res.data) this.setData({ userInfo: res.data });
+      //     if (res.data && res.data.avatarUrl) this.setData({ avatarUrl: res.data.avatarUrl });
+      //   } else {
+      //     wx.redirectTo({ url: '/pages/login/index', })
+      //   }
+      // }
+      // })
+   },
    // 计算高度
    searchHeight: function () {
       let frameStyle = this.data.frameStyle;

+ 18 - 0
pages/market/detail.js

@@ -95,11 +95,29 @@ Page({
     */
    onLoad: function (options) {
       this.setData({ 'form.mech_name': this.data.userInfo.name, 'form.mech_id': this.data.userInfo.id, })
+      this.watchLogin();
       //验证规则函数
       this.initValidate()
       // 计算高度
       this.searchHeight()
    },
+   // 监听用户是否登录
+   watchLogin: function () {
+      // wx.getStorage({
+      // key: 'user',
+      // success: res => {
+      //   if (res.data) {
+      //     // 查询菜单
+      //     if (res.data) this.searchRouter(res.data);
+      //     res.data.type = type.find((i) => i.value == res.data.type).label;
+      //     if (res.data) this.setData({ userInfo: res.data });
+      //     if (res.data && res.data.avatarUrl) this.setData({ avatarUrl: res.data.avatarUrl });
+      //   } else {
+      //     wx.redirectTo({ url: '/pages/login/index', })
+      //   }
+      // }
+      // })
+   },
    // 计算高度
    searchHeight: function () {
       let frameStyle = this.data.frameStyle;

+ 24 - 5
pages/market/index.js

@@ -10,11 +10,7 @@ Page({
       // 主体高度
       infoHeight: '',
       // 商品列表
-      list: [
-         { name: '喜羊羊', type_name: '羊肉', money: '22', status: '1', brief: '一份' },
-         { name: '喜羊羊', type_name: '羊肉', money: '22', status: '0', brief: '一份' },
-         { name: '喜羊羊', type_name: '羊肉', money: '22', status: '1', brief: '一份' },
-      ],
+      list: [],
       // 弹框
       dialog: { title: '详细信息', show: false, type: '1' },
       // 详细信息
@@ -49,9 +45,32 @@ Page({
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
+      this.watchLogin();
       // 计算高度
       this.searchHeight();
    },
+   // 监听用户是否登录
+   watchLogin: function () {
+      let data = [
+         { name: '喜羊羊', type_name: '羊肉', money: '22', status: '1', brief: '一份' },
+         { name: '喜羊羊', type_name: '羊肉', money: '22', status: '0', brief: '一份' },
+         { name: '喜羊羊', type_name: '羊肉', money: '22', status: '1', brief: '一份' },]
+      this.setData({ list: data })
+      // wx.getStorage({
+      // key: 'user',
+      // success: res => {
+      //   if (res.data) {
+      //     // 查询菜单
+      //     if (res.data) this.searchRouter(res.data);
+      //     res.data.type = type.find((i) => i.value == res.data.type).label;
+      //     if (res.data) this.setData({ userInfo: res.data });
+      //     if (res.data && res.data.avatarUrl) this.setData({ avatarUrl: res.data.avatarUrl });
+      //   } else {
+      //     wx.redirectTo({ url: '/pages/login/index', })
+      //   }
+      // }
+      // })
+   },
    // 计算高度
    searchHeight: function () {
       let frameStyle = this.data.frameStyle;

+ 23 - 4
pages/market_buy/index.js

@@ -11,7 +11,7 @@ Page({
       // 主体高度
       infoHeight: '',
       // 采买列表
-      list: [{ order_num: 'Hgj4757945hdFueu', receive_user_name: '胡图图', mech_name: '翻斗幼儿园-小豆班', status_name: '待供货单位确认', status: '1', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', order: [{ name: '小洋人', num: '123', money: '3000' }, { name: '娃哈哈', num: '123', money: '344' }] }],
+      list: [],
       // 弹框
       dialog: { title: '详细信息', show: false, type: '1' },
       // 详细信息
@@ -81,11 +81,30 @@ Page({
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
+      this.watchLogin();
       // 计算高度
       this.searchHeight();
    },
-   search: function (data) {
-
+   // 监听用户是否登录
+   watchLogin: function () {
+      let data = [
+         { order_num: 'Hgj4757945hdFueu', receive_user_name: '胡图图', mech_name: '翻斗幼儿园-小豆班', status_name: '待供货单位确认', status: '1', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', order: [{ name: '小洋人', num: '123', money: '3000' }, { name: '娃哈哈', num: '123', money: '344' }] }
+      ]
+      this.setData({ list: data })
+      // wx.getStorage({
+      // key: 'user',
+      // success: res => {
+      //   if (res.data) {
+      //     // 查询菜单
+      //     if (res.data) this.searchRouter(res.data);
+      //     res.data.type = type.find((i) => i.value == res.data.type).label;
+      //     if (res.data) this.setData({ userInfo: res.data });
+      //     if (res.data && res.data.avatarUrl) this.setData({ avatarUrl: res.data.avatarUrl });
+      //   } else {
+      //     wx.redirectTo({ url: '/pages/login/index', })
+      //   }
+      // }
+      // })
    },
    // 计算高度
    searchHeight: function () {
@@ -109,7 +128,7 @@ Page({
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
-      this.search();
+
    },
 
    /**

+ 23 - 2
pages/order/index.js

@@ -14,8 +14,7 @@ Page({
       shoopingtext: '',
       // 采购申请审核
       list: [
-         { order_num: 'Ygj4757945hdFueu', receive_user_name: '胡英俊', mech_name: '翻斗幼儿园-小豆班', status_name: '待供货单位确认', status: '0', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', },
-         { order_num: 'Hgj4757945hdFueu', receive_user_name: '胡图图', mech_name: '翻斗幼儿园-小豆班', status_name: '待供货单位确认', status: '1', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', order: [{ name: '小洋人', num: '123', money: '3000' }, { name: '娃哈哈', num: '123', money: '344' }] }
+
       ],
       // 弹框
       dialog: { title: '详细信息', show: false, type: '1' },
@@ -49,9 +48,31 @@ Page({
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
+      this.watchLogin();
       // 计算高度
       this.searchHeight();
    },
+   // 监听用户是否登录
+   watchLogin: function () {
+      let data = [
+         { order_num: 'Ygj4757945hdFueu', receive_user_name: '胡英俊', mech_name: '翻斗幼儿园-小豆班', status_name: '待供货单位确认', status: '0', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', },
+         { order_num: 'Hgj4757945hdFueu', receive_user_name: '胡图图', mech_name: '翻斗幼儿园-小豆班', status_name: '待供货单位确认', status: '1', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', order: [{ name: '小洋人', num: '123', money: '3000' }, { name: '娃哈哈', num: '123', money: '344' }] }]
+      this.setData({ list: data })
+      // wx.getStorage({
+      // key: 'user',
+      // success: res => {
+      //   if (res.data) {
+      //     // 查询菜单
+      //     if (res.data) this.searchRouter(res.data);
+      //     res.data.type = type.find((i) => i.value == res.data.type).label;
+      //     if (res.data) this.setData({ userInfo: res.data });
+      //     if (res.data && res.data.avatarUrl) this.setData({ avatarUrl: res.data.avatarUrl });
+      //   } else {
+      //     wx.redirectTo({ url: '/pages/login/index', })
+      //   }
+      // }
+      // })
+   },
    // 计算高度
    searchHeight: function () {
       let frameStyle = this.data.frameStyle;

+ 24 - 2
pages/payment/index.js

@@ -11,8 +11,7 @@ Page({
       infoHeight: '',
       // 采购申请审核
       list: [
-         { order_num: 'Ygj4757945hdFueu', receive_user_name: '胡英俊', mech_name: '翻斗幼儿园-小豆班', status_name: '待财务确认', status: '3', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', },
-         { order_num: 'Hgj4757945hdFueu', receive_user_name: '胡图图', mech_name: '翻斗幼儿园-小豆班', status_name: '待财务确认', status: '3', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', order: [{ name: '小洋人', num: '123', money: '3000' }, { name: '娃哈哈', num: '123', money: '344' }] },
+
       ],
    },
    back: function () {
@@ -40,9 +39,32 @@ Page({
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
+      this.watchLogin();
       // 计算高度
       this.searchHeight();
    },
+   // 监听用户是否登录
+   watchLogin: function () {
+      let data = [
+         { order_num: 'Ygj4757945hdFueu', receive_user_name: '胡英俊', mech_name: '翻斗幼儿园-小豆班', status_name: '待财务确认', status: '3', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', },
+         { order_num: 'Hgj4757945hdFueu', receive_user_name: '胡图图', mech_name: '翻斗幼儿园-小豆班', status_name: '待财务确认', status: '3', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', order: [{ name: '小洋人', num: '123', money: '3000' }, { name: '娃哈哈', num: '123', money: '344' }] },
+      ]
+      this.setData({ list: data })
+      // wx.getStorage({
+      // key: 'user',
+      // success: res => {
+      //   if (res.data) {
+      //     // 查询菜单
+      //     if (res.data) this.searchRouter(res.data);
+      //     res.data.type = type.find((i) => i.value == res.data.type).label;
+      //     if (res.data) this.setData({ userInfo: res.data });
+      //     if (res.data && res.data.avatarUrl) this.setData({ avatarUrl: res.data.avatarUrl });
+      //   } else {
+      //     wx.redirectTo({ url: '/pages/login/index', })
+      //   }
+      // }
+      // })
+   },
    // 计算高度
    searchHeight: function () {
       let frameStyle = this.data.frameStyle;