xiaohaizhao 2 роки тому
батько
коміт
78c8db2284

+ 3 - 3
packageA/invoice/update.js

@@ -35,7 +35,7 @@ Page({
             error: false,
             errMsg: "",
             type: "text",
-            value: "",
+            value: "王蒋霞",
             placeholder: "发票复核人",
             valueName: "invoicechecker",
             required: false
@@ -44,7 +44,7 @@ Page({
             error: false,
             errMsg: "",
             type: "text",
-            value: "",
+            value: "孙惠吉",
             placeholder: "发票收款人",
             valueName: "invoicepayee",
             required: false
@@ -53,7 +53,7 @@ Page({
             error: false,
             errMsg: "",
             type: "text",
-            value: "",
+            value: "冯云霞",
             placeholder: "发票开票员",
             valueName: "invoiceclerk",
             required: false

+ 0 - 4
packageA/shopping/modules/base.scss

@@ -90,10 +90,6 @@
 	}
 }
 
-/* .icon-class {
-	margin-top: -80rpx !important;
-} */
-
 .footer {
 	width: 100vw;
 	min-height: 130rpx;

+ 3 - 9
packageA/shopping/modules/standard/index.js

@@ -178,9 +178,8 @@ Component({
         computeSum() {
             let results = this.data.results,
                 sum = 0,
-                deteleList = [],
                 classList = [];
-            if (results.length) results.forEach((v, i) => {
+            if (results.length) results = results.filter(v => {
                 let item = this.data.list.find(va => va.sa_shoppingcartid == v);
                 if (item) {
                     sum = currency(sum).add(currency(item.qty).multiply(item.oldprice)).value;
@@ -197,15 +196,10 @@ Component({
                         classList[index].name = classList[index].type + `(${classList[index].list.length}件商品)`
                     }
                 } else {
-                    deteleList.push(i)
+                    getApp().globalData.num = getApp().globalData.num - 1;
                 }
+                return item
             });
-            if (deteleList.length) {
-                deteleList.forEach(v => {
-                    results.splice(v, 1);
-                });
-                getApp().globalData.num = getApp().globalData.num - deteleList.length;
-            };
             let sa_brandid = results.length ? this.data.sa_brandid : null;
             wx.setStorageSync('shopping', {
                 results,

+ 3 - 9
packageA/shopping/modules/tool/index.js

@@ -173,9 +173,8 @@ Component({
         computeSum() {
             let results = this.data.results,
                 sum = 0,
-                deteleList = [],
                 classList = [];
-            if (results.length) results.forEach((v, i) => {
+            if (results.length) results = results.filter(v => {
                 let item = this.data.list.find(va => va.sa_shoppingcartid == v);
                 if (item) {
                     sum = currency(sum).add(currency(item.qty).multiply(item.oldprice)).value;
@@ -192,15 +191,10 @@ Component({
                         classList[index].name = classList[index].type + `(${classList[index].list.length}件商品)`
                     }
                 } else {
-                    deteleList.push(i)
+                    getApp().globalData.num = getApp().globalData.num - 1;
                 }
+                return item
             });
-            if (deteleList.length) {
-                deteleList.forEach(v => {
-                    results.splice(v, 1);
-                });
-                getApp().globalData.num = getApp().globalData.num - deteleList.length;
-            };
             let sa_brandid = results.length ? this.data.sa_brandid : null;
             wx.setStorageSync('shopping_tool', {
                 results,

+ 147 - 146
pages/tabbar/mine/index.js

@@ -1,150 +1,151 @@
 const _Http = getApp().globalData.http;
 let downCount = null;
 Page({
-    data: {
-        userMsg: {},
-        pathList: [], //功能权限
-        teamAuth: '', //团队管理权限列表 JSON字符串 用于传递
-    },
-    onLoad(options) {
-        this.queryUserMsg();
-        let authlist = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心']);
-        let pathList = [{
-            name: "修改登录密码",
-            icon: "icon-a-wodeguanyuyingyong",
-            color: "var(--warning)",
-            path: `/pages/tabbar/mine/changePassword/index`
-        }]
-        if (authlist.length != 0) authlist[0].apps.forEach(v => {
-            switch (v.name) {
-                case "teamManagement":
-                    console.log(v)
-                    pathList.unshift({
-                        name: "团队管理",
-                        icon: "icon-a-wodetuanduiguanli",
-                        color: "var(--assist)",
-                        path: `/${v.path}`
-                    })
-                    this.setData({
-                        teamAuth: JSON.stringify(v.meta.auth)
-                    })
-                    break;
-            }
-        });
-        this.setData({
-            pathList
-        })
-    },
-    /* 查询用户信息 */
-    queryUserMsg() {
-        _Http.basic({
-            "classname": "common.usercenter.usercenter",
-            "method": "queryUserMsg",
-            "content": {
-                "nocache": true
-            }
-        }).then(res => {
-            if (res.msg != '成功') return wx.showToast({
-                title: res.msg,
-                icon: "none"
-            })
-            this.setData({
-                userMsg: res.data
-            })
-        })
-    },
-    onShow() {
-        this.getTabBar().init();
-    },
-    /* 退出登录 */
-    outLogin() {
-        clearTimeout(downCount);
-        wx.showLoading({
-            title: '正在退出...',
-        })
-        downCount = setTimeout(() => {
-            _Http.logout().then(res => {
-                wx.showToast({
-                    title: '退出成功'
-                });
-                let loginMsg = wx.getStorageSync("loginMsg");
-                wx.clearStorageSync();
-                wx.setStorageSync('loginMsg', loginMsg)
-                setTimeout(() => {
-                    wx.reLaunch({
-                        url: '/pages/login/phone',
-                    })
-                }, 300)
-            })
-        }, 300);
-    },
-    /* 去修改用户信息 */
-    changeUserMsg() {
-        let {
-            name,
-            phonenumber,
-            attinfos,
-            hr
-        } = this.data.userMsg;
-        wx.navigateTo({
-            url: `./userMsg/index?attinfos=${JSON.stringify(attinfos)}&name=${name}&phonenumber=${phonenumber}&email=${hr.email}`
-        })
-    },
-    /* 绑定或解绑微信 */
-    bindingWechat(e) {
-        if (this.data.userMsg.iswechatbinding) {
-            let that = this;
-            wx.showModal({
-                title: "提示",
-                content: "是否解除绑定",
-                success: (res) => {
-                    if (res.confirm) that.handleBDWechat(0);
-                }
-            })
-        } else {
-            this.handleBDWechat(1);
-        }
-    },
-    handleBDWechat(isbinging) {
-        let that = this;
-        wx.getUserProfile({
-            desc: '用于完善用户资料',
-            success: ({
-                userInfo
-            }) => {
-                wx.login({
-                    success(res) {
-                        if (res.code) _Http.basic({
-                            "classname": "common.usercenter.usercenter",
-                            "method": "WechatBinding",
-                            content: {
-                                "wechat_code": res.code,
-                                isbinging, // 0解绑 1绑定
-                                wechatuserinfo: userInfo
-                            }
-                        }).then(s => {
-                            if (s.msg != '成功') return wx.showToast({
-                                title: s.data,
-                                icon: "none"
-                            });
-                            setTimeout(() => {
-                                wx.showToast({
-                                    title: isbinging == 0 ? '解除成功' : '绑定成功',
-                                    icon: "none"
-                                })
-                            }, 100);
-                            that.queryUserMsg();
-                        })
-                    }
-                })
-            },
-            fail: () => {
-                wx.showToast({
-                    title: '操作失败,未获得授权',
-                    icon: "none"
-                })
-            }
-        })
-    },
-    onShareAppMessage() {}
+	data: {
+		userMsg: {},
+		pathList: [], //功能权限
+		teamAuth: '', //团队管理权限列表 JSON字符串 用于传递
+	},
+	onLoad(options) {
+		this.queryUserMsg();
+		let authlist = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心']);
+		let pathList = [{
+			name: "修改登录密码",
+			icon: "icon-a-wodeguanyuyingyong",
+			color: "var(--warning)",
+			path: `/pages/tabbar/mine/changePassword/index`
+		}]
+		if (authlist.length != 0) authlist[0].apps.forEach(v => {
+			switch (v.name) {
+				case "teamManagement":
+					console.log(v)
+					pathList.unshift({
+						name: "团队管理",
+						icon: "icon-a-wodetuanduiguanli",
+						color: "var(--assist)",
+						path: `/${v.path}`
+					})
+					this.setData({
+						teamAuth: JSON.stringify(v.meta.auth)
+					})
+					break;
+			}
+		});
+		this.setData({
+			pathList
+		})
+	},
+	/* 查询用户信息 */
+	queryUserMsg() {
+		_Http.basic({
+			"classname": "common.usercenter.usercenter",
+			"method": "queryUserMsg",
+			"content": {
+				"nocache": true
+			}
+		}).then(res => {
+			if (res.msg != '成功') return wx.showToast({
+				title: res.msg,
+				icon: "none"
+			})
+			this.setData({
+				userMsg: res.data
+			})
+		})
+	},
+	onShow() {
+		this.getTabBar().init();
+	},
+	/* 退出登录 */
+	outLogin() {
+		clearTimeout(downCount);
+		wx.showLoading({
+			title: '正在退出...',
+		})
+		downCount = setTimeout(() => {
+			_Http.logout().then(res => {
+				wx.showToast({
+					title: '退出成功'
+				});
+				let loginMsg = wx.getStorageSync("loginMsg");
+				wx.clearStorageSync();
+				wx.setStorageSync('loginMsg', loginMsg)
+				setTimeout(() => {
+					wx.reLaunch({
+						url: '/pages/login/phone',
+					})
+				}, 300)
+			})
+		}, 300);
+	},
+	/* 去修改用户信息 */
+	changeUserMsg() {
+		let {
+			name,
+			phonenumber,
+			attinfos,
+			hr
+		} = this.data.userMsg;
+		wx.navigateTo({
+			url: `./userMsg/index?attinfos=${JSON.stringify(attinfos)}&name=${name}&phonenumber=${phonenumber}&email=${hr.email}`
+		})
+	},
+	/* 绑定或解绑微信 */
+	bindingWechat(e) {
+		if (this.data.userMsg.iswechatbinding) {
+			let that = this;
+			wx.showModal({
+				title: "提示",
+				content: "是否解除绑定",
+				success: (res) => {
+					if (res.confirm) that.handleBDWechat(0);
+				}
+			})
+		} else {
+			this.handleBDWechat(1);
+		}
+	},
+	handleBDWechat(isbinging) {
+		let that = this;
+		wx.getUserProfile({
+			desc: '用于完善用户资料',
+			success: ({
+				userInfo
+			}) => {
+				wx.login({
+					success(res) {
+						if (res.code) _Http.basic({
+							"classname": "common.usercenter.usercenter",
+							"method": "WechatBinding",
+							content: {
+								"wechat_code": res.code,
+								isbinging, // 0解绑 1绑定
+								wechatuserinfo: userInfo,
+								appid: "wxc1b6ae925ac1d06a"
+							}
+						}).then(s => {
+							if (s.msg != '成功') return wx.showToast({
+								title: s.data,
+								icon: "none"
+							});
+							setTimeout(() => {
+								wx.showToast({
+									title: isbinging == 0 ? '解除成功' : '绑定成功',
+									icon: "none"
+								})
+							}, 100);
+							that.queryUserMsg();
+						})
+					}
+				})
+			},
+			fail: () => {
+				wx.showToast({
+					title: '操作失败,未获得授权',
+					icon: "none"
+				})
+			}
+		})
+	},
+	onShareAppMessage() {}
 })

BIN
static/image/logo.png