Selaa lähdekoodia

付费功能移植

xiaohaizhao 2 vuotta sitten
vanhempi
commit
3e61c55b0d

+ 11 - 3
app.js

@@ -2,6 +2,11 @@ import {
 	ApiModel
 } from './utils/Api';
 
+import {
+	evidence,
+	update
+} from './utils/pay';
+
 App({
 	onLaunch: function () {
 		wx.getSystemInfo({
@@ -28,8 +33,9 @@ App({
 			that.globalData.socketEstablish = true;
 		})
 		this.globalData.SocketTask.onMessage(function (res) {
-			console.log("消息", res)
-			that.globalData.socketCallback(res)
+			that.globalData.socket.callback(res)
+			let data = JSON.parse(res.data);
+			if (data.message.type == 'pay') update();
 		})
 		this.globalData.SocketTask.onError(function (res) {
 			that.globalData.socketEstablish = false;
@@ -46,6 +52,8 @@ App({
 		getCollectCount: null, // 获取购物车数量
 		socketEstablish: false, //是否已经建立socket
 		SocketTask: '', // Socket方法
-		remindchangepassword_str: ""
+		remindchangepassword_str: "",
+		refreshData: null, //保存首页更新应用信息函数
+		evidence
 	},
 })

+ 2 - 0
app.json

@@ -6,6 +6,8 @@
     "pages/teams/index",
     "pages/teams/addUsers",
     "pages/teams/addRole",
+    "pages/teams/addOrder",
+    "pages/teams/order",
     "pages/index/index",
     "pages/index/message/detail",
     "pages/address/index",

+ 12 - 2
pages/index/home/index.js

@@ -11,12 +11,22 @@ Component({
 		appid: "wx7505ddb0a1ec6146"
 	},
 	methods: {
-		openRecord(e) {
+		async openRecord(e) {
 			const {
 				it,
 				item
 			} = e.currentTarget.dataset;
-			if (it.PageCur) this.triggerEvent("cutBar", it.PageCur)
+			const res = await getApp().globalData.evidence(it);
+			console.log(res)
+			if (res) {
+				if (it.PageCur) {
+					this.triggerEvent("cutBar", it.PageCur)
+				} else {
+					wx.navigateTo({
+						url: it.PageCur ? '#' : it.path,
+					})
+				}
+			}
 		},
 		toMsg() {
 			this.triggerEvent("cutBar", 'Message')

+ 2 - 1
pages/index/home/index.wxml

@@ -14,7 +14,8 @@
 			<view class="group" wx:if="{{item.list.length}}">
 				<view class="label"><text class="work {{item.icon}}" />{{item.label}}</view>
 				<view class="main">
-					<navigator version='trial' class="item" wx:for="{{item.list}}" wx:for-item="it" wx:for-index="i" target='{{item.appid!=appid?"miniProgram":"self"}}' app-id='{{item.appid}}' path="{{it.path+'?auth='+auth+'&userMsg='+userMsg+'&site='+site}}" url="{{it.PageCur ? '#' :it.path}}" open-type="{{it.openType||'navigate'}}" wx:key="name" data-it="{{it}}" data-item="{{item}}" bindtap="openRecord">
+					<!--  path="{{it.path+'?auth='+auth+'&userMsg='+userMsg+'&site='+site}}" url="{{it.PageCur ? '#' :it.path}}" open-type="{{it.openType||'navigate'}}" -->
+					<navigator version='trial' class="item" wx:for="{{item.list}}" url="#" wx:for-item="it" wx:for-index="i" target='{{item.appid!=appid?"miniProgram":"self"}}' app-id='{{item.appid}}' wx:key="name" data-it="{{it}}" data-item="{{item}}" bindtap="openRecord">
 						<view class="icon-box" style="background-color: {{it.bColor}};">
 							<text class="work {{it.icon}}" style="color: {{it.color}};" />
 						</view>

+ 30 - 7
pages/index/index.js

@@ -1,5 +1,8 @@
 let pageInit = null,
-	_Http = getApp().globalData.http;
+	_Http = getApp().globalData.http,
+	{
+		vIndate
+	} = require("../../utils/pay");
 
 
 Page({
@@ -37,6 +40,8 @@ Page({
 				})
 			},
 		})
+		getApp().globalData.http.refreshData = this.refreshData.bind(this);
+		vIndate();
 	},
 	getAnnunciate() {
 		_Http.basic({
@@ -181,6 +186,7 @@ Page({
 							let i = paths.findIndex(k => k.name == s.meta.title);
 							if (i != -1) {
 								paths[i].index = i;
+								paths[i].isneedpay = s.isneedpay;
 								list.push(paths[i])
 							}
 						}
@@ -251,11 +257,14 @@ Page({
 			});
 			pageInit.Home = true;
 			page.selectComponent("#ListBox").setHeight(".head", page);
-
+			console.log("entrance", entrance)
+			return entrance.find(v => v.label == "E-订单").list
 		} else {
 			setTimeout(this.refreshData, 10);
 			return;
 		}
+
+
 	},
 	/* 获取通告列表 */
 	/**
@@ -313,11 +322,25 @@ Page({
 	/** 
 	 * 切换页面
 	 */
-	NavChange(e) {
-		this.cutBar({
-			detail: e.currentTarget.dataset.cur
-		});
-		if (!getApp().globalData.socketEstablish) getApp().initSocket();
+	async NavChange(e) {
+		let cur = e.currentTarget.dataset.cur;
+		if (this.data.PageCur == cur) return;
+		if (cur == 'Market' || cur == 'Collect') {
+			let app = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案"])[0].apps
+			let item = app.find(v => v.name == (cur == 'Market' ? "wmarket" : "wshoppingtrolley"))
+			const res = await getApp().globalData.evidence(item);
+			if (res) {
+				this.cutBar({
+					detail: e.currentTarget.dataset.cur
+				});
+				if (!getApp().globalData.socketEstablish) getApp().initSocket();
+			}
+		} else {
+			this.cutBar({
+				detail: e.currentTarget.dataset.cur
+			});
+			if (!getApp().globalData.socketEstablish) getApp().initSocket();
+		}
 	},
 	/** 
 	 * 切换bar

+ 9 - 2
pages/index/userCenter/index.js

@@ -12,15 +12,22 @@ Component({
 	methods: {
 		init() {
 			this.queryUserMsg();
+			let authlist = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心']);
 			let pathList = [{
 				name: "修改登录密码",
 				icon: "icon-a-wodeguanyuyingyong",
 				color: "var(--warning)",
 				path: `/pages/index/userCenter/changePassword/index`
 			}]
+			if (authlist[0].apps.some(v => v.name == "teamManagement")) pathList.unshift({
+				name: "团队管理",
+				icon: "icon-a-wodetuanduiguanli",
+				color: "var(--assist)",
+				path: `/pages/teams/index`
+			});
 			this.setData({
 				pathList
-			});
+			})
 			return true;
 		},
 		/* 查询用户信息 */
@@ -56,7 +63,7 @@ Component({
 					getApp().globalData.SocketTask.close()
 					wx.showToast({
 						title: '退出成功',
-						mask:true
+						mask: true
 					});
 					let loginMsg = wx.getStorageSync("loginMsg");
 					wx.clearStorageSync();

+ 1 - 2
pages/login/modules/login.js

@@ -97,8 +97,7 @@ function toHome() {
         url: '/pages/index/index'
     })
     getApp().initSocket();
-
-
+    wx.setStorageSync('isLeader', wx.getStorageSync('userMsg').usertype == 21)
 }
 /* 站点数据查询 */
 module.exports = {

+ 346 - 0
pages/teams/addOrder.js

@@ -0,0 +1,346 @@
+const _Http = getApp().globalData.http,
+    {
+        formatTime
+    } = require("../../utils/getTime");
+let pageNumber = 1,
+    pageTotal = 1,
+    sys_payorderid = null,
+    currency = require("../../utils/currency"),
+    CNY = value => currency(value, {
+        symbol: "¥",
+        precision: 2
+    }).format();
+Page({
+    data: {
+        users: [],
+        remarks: "",
+        showAmount: "¥0.00",
+        isDelete: true,
+        useDiscount: 0
+    },
+    onLoad(options) {
+        this.setData({
+            sys_payinstructions: wx.getStorageSync('siteP').sys_payinstructions,
+            sys_payincidence: 1,
+            opUsers: options.users ? JSON.parse(options.users) : []
+        })
+        sys_payorderid = options.sys_payorderid;
+        this.getVersions(options.vid || "");
+        this.getDiscounts();
+    },
+    /* 获取优惠卷 */
+    getDiscounts() {
+        _Http.basic({
+            "id": 20230801162402,
+            "content": {
+                nocache: true
+            }
+        }).then(res => {
+            console.log("获取优惠卷", res)
+            this.setData({
+                discounts: res.data
+            })
+        })
+    },
+    /* 保存订单进度 */
+    changeOrder() {
+        _Http.basic({
+            "classname": "system.payorder.payorder",
+            "method": "insertUsers",
+            "content": {
+                "sys_site_systempartitionid": this.data.sys_site_systempartitionid,
+                sys_payorderid,
+                "remarks": this.data.remarks,
+                "users": this.data.users.map(v => {
+                    let item = this.data.userList.find(s => {
+                        let id = this.data.sys_payincidence == 1 ? s.userid : s.sa_agentsid;
+                        return id == v
+                    })
+                    return {
+                        "isleader": item.isleader,
+                        "userid": item.userid,
+                        "sa_agentsid": item.sa_agentsid,
+                        "enddate": item.enddate[this.data.sys_site_systempartitionid] || ''
+                    }
+                })
+            }
+        }).then(res => {
+            console.log("修改订单信息", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.msg,
+                icon: "none",
+                mask: true
+            });
+            this.setData({
+                showAmount: CNY(res.data.amount),
+                orderno: res.data.orderno
+            })
+        })
+    },
+    /* 更改备注 */
+    onblur(e) {
+        console.log(e)
+        if (e.detail.value == this.data.remarks) return;
+        this.setData({
+            remarks: e.detail.value
+        });
+        this.changeOrder();
+    },
+    /* 获取版本 */
+    getVersions(vid) {
+        _Http.basic({
+            "classname": "system.payorder.payorder",
+            "method": "chooseSystemPartition",
+            "content": {
+                "pageNumber": 1,
+                "pageSize": 9999,
+                "where": {
+                    "condition": ""
+                }
+            }
+        }).then(res => {
+            console.log("版本列表", res)
+            if (res.msg != '成功') {
+                wx.showToast({
+                    title: res.msg,
+                    icon: "none",
+                    mask: true
+                })
+                setTimeout(() => {
+                    wx.navigateBack();
+                }, 1000)
+                return;
+            };
+            let sys_site_systempartitionid = res.data[0].sys_site_systempartitionid || '';
+            if (vid && res.data.some(v => v.sys_site_systempartitionid == vid)) sys_site_systempartitionid = vid - 0;
+            this.setData({
+                versionsList: res.data,
+                sys_site_systempartitionid
+            })
+            this.getUsers(true);
+        })
+    },
+    /* 切换版本 */
+    changeVer(e) {
+        const {
+            sys_site_systempartitionid
+        } = e.currentTarget.dataset.item;
+        if (this.data.sys_site_systempartitionid == sys_site_systempartitionid) return;
+        this.setData({
+            sys_site_systempartitionid
+        });
+        this.setUsers();
+    },
+    checkVer(e) {
+        const {
+            item
+        } = e.currentTarget.dataset;
+        this.selectComponent("#inventory").show(item.systemapp)
+    },
+    /* 获取可添加账号/主体 */
+    getUsers(init = false) {
+        if (init) {
+            pageNumber = 1;
+            pageTotal = 1;
+        };
+        if (pageNumber > pageTotal) return;
+        _Http.basic({
+            "classname": "system.payorder.payorder",
+            "method": "chooseUsers",
+            "content": {
+                pageNumber,
+                "pageSize": 99999,
+                "where": {
+                    "condition": ""
+                }
+            }
+        }).then(res => {
+            console.log("用户列表", res)
+            if (res.msg != '成功') {
+                wx.showToast({
+                    title: res.msg,
+                    icon: "none",
+                    mask: true
+                })
+                setTimeout(() => {
+                    wx.navigateBack();
+                }, 1000)
+                return;
+            };
+            pageTotal = res.pageTotal;
+            if (res.data.some(v => v.isleader == 1)) {
+                this.setData({
+                    userList: res.pageNumber == 1 ? res.data : this.data.userList.concat(res.data)
+                })
+                pageNumber = res.pageNumber + 1;
+                this.setUsers(this.data.opUsers.filter(id => this.data.userList.some(v => id == v.userid)));
+            } else {
+                wx.showModal({
+                    title: '提示',
+                    content: "您的团队缺少主账号无法使用,请联系客服!",
+                    showCancel: false,
+                    complete: (res) => {
+                        if (res.confirm) {
+                            wx.navigateBack()
+                        }
+                    }
+                })
+            }
+        })
+    },
+    setUsers(users = []) {
+        let list = this.data.userList,
+            idname = this.data.sys_payincidence == 1 ? 'userid' : 'sa_agentsid',
+            useDiscount = 0;
+        list.forEach(v => {
+            let date = v.enddate[this.data.sys_site_systempartitionid];
+            if (v.userid == wx.getStorageSync('userMsg').userid || v.isleader == 1) {
+                if (date) {
+                    // if (formatTime(new Date(), '-').split(" ")[0] >= date) users.push(v[idname] + '');
+                } else {
+                    if (!users.some(v => v == v[idname])) users.push(v[idname] + '');
+                }
+            }
+            if (users.some(id => id == v.userid) && v.isleader == 0) useDiscount += 1
+        });
+        this.setData({
+            users,
+            useDiscount
+        });
+        this.changeOrder();
+    },
+    onReachBottom() {
+        // this.getUsers();
+    },
+    onChange(e) {
+        const {
+            id,
+            isleader
+        } = e.currentTarget.dataset;
+        let users = this.data.users,
+            useDiscount = this.data.useDiscount;
+        if (users.some(v => v == id)) {
+            users = users.filter(s => s != id)
+            if (isleader == 0) useDiscount -= 1;
+        } else {
+            users.push(id + "")
+            if (isleader == 0) useDiscount += 1;
+        }
+        this.setData({
+            users,
+            useDiscount
+        });
+        this.changeOrder();
+    },
+    examine() {
+        return new Promise((resolve, reject) => {
+            if (currency(this.data.showAmount).value == 0) {
+                wx.showModal({
+                    title: '提示',
+                    content: '优惠后金额为0,是否确认',
+                    complete: (res) => {
+                        if (res.cancel) resolve(false)
+                        if (res.confirm) resolve(true)
+                    }
+                })
+            } else {
+                resolve(true)
+            }
+        })
+    },
+    isRenew() {
+        return new Promise((resolve, reject) => {
+            const idname = this.data.sys_payincidence == 1 ? 'userid' : 'sa_agentsid',
+                renew = this.data.users.map(v => this.data.userList.find(s => s[idname] == v)).filter(v => v.enddate[this.data.sys_site_systempartitionid]).map(v => v[this.data.sys_payincidence == 1 ? 'name' : 'agentname']).join(',');
+            if (renew) {
+                wx.showModal({
+                    title: '提示',
+                    content: `${renew}还未到期,是否继续付费`,
+                    confirmText: "继续付费",
+                    complete: (res) => {
+                        if (res.cancel) resolve(false)
+                        if (res.confirm) resolve(true)
+                    }
+                })
+            } else {
+                resolve(true)
+            }
+        })
+    },
+    /* 支付 */
+    async payment() {
+        let isRenew = await this.isRenew();
+        if (!isRenew) return;
+        let isPayment = await this.examine();
+        if (!isPayment) return;
+        let that = this;
+        that.data.isDelete = false;
+        wx.login({
+            success: (s) => {
+                _Http.basic({
+                    "classname": "system.payment.wechatpay",
+                    "method": "createWechatOrder",
+                    "content": {
+                        "orderno": that.data.orderno,
+                        "wechat_code": s.code,
+                        "trade_type": "JSAPI"
+                    }
+                }).then(res => {
+                    if (res.data == '失败') return wx.showToast({
+                        title: res.msg,
+                        icon: "none",
+                        mask: true
+                    });
+                    wx.requestPayment({
+                        timeStamp: res.data.timeStamp,
+                        nonceStr: res.data.nonceStr,
+                        package: res.data.package,
+                        signType: res.data.signType,
+                        paySign: res.data.paySign,
+                        success() {
+                            wx.showToast({
+                                title: '支付成功',
+                                mask: true
+                            })
+                        },
+                        fail(err) {
+                            if (res.msg == '成功' && currency(that.data.showAmount).value == 0) {
+                                wx.showToast({
+                                    title: '支付成功',
+                                    mask: true
+                                })
+                            } else {
+                                wx.showToast({
+                                    title: '支付失败',
+                                    icon: "error",
+                                    mask: true
+                                })
+                                console.error(err)
+                            }
+                        },
+                        complete(e) {
+                            console.log(e)
+                            setTimeout(() => {
+                                wx.redirectTo({
+                                    url: '/pages/teams/order?id=' + sys_payorderid,
+                                })
+                            }, 1000)
+                        }
+                    })
+                })
+            },
+        })
+
+    },
+    onUnload() {
+        if (this.data.isDelete) _Http.basic({
+            "classname": "system.payorder.payorder",
+            "method": "delete",
+            "content": {
+                sys_payorderid
+            }
+        }).then(res => {
+            console.log("删除订单", res)
+        })
+    }
+})

+ 10 - 0
pages/teams/addOrder.json

@@ -0,0 +1,10 @@
+{
+    "usingComponents": {
+        "van-radio-group": "@vant/weapp/radio-group/index",
+        "van-radio": "@vant/weapp/radio/index",
+        "van-checkbox": "@vant/weapp/checkbox/index",
+        "van-checkbox-group": "@vant/weapp/checkbox-group/index",
+        "inventory": "./modules/inventory"
+    },
+    "navigationBarTitleText": "订单"
+}

+ 221 - 0
pages/teams/addOrder.scss

@@ -0,0 +1,221 @@
+.head {
+    width: 750rpx;
+    background: #FFF9F2;
+    font-size: 24rpx;
+    line-height: 40rpx;
+    color: #FA8C16;
+    box-sizing: border-box;
+    padding: 12rpx 30rpx;
+}
+
+.remarks {
+    display: flex;
+    justify-content: space-between;
+    width: 750rpx;
+    background-color: #FFFFFF;
+    padding: 26rpx 0;
+
+    view {
+        font-size: 28rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #666666;
+        margin-left: 30rpx;
+    }
+
+    textarea {
+        margin-right: 30rpx;
+    }
+}
+
+.tips {
+    width: 750rpx;
+    height: 56rpx;
+    line-height: 56rpx;
+    text-align: center;
+    font-size: 24rpx;
+    font-family: PingFang SC-Regular, PingFang SC;
+    color: #999999;
+}
+
+.versions {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    width: 750rpx;
+    height: 90rpx;
+    background: #FFFFFF;
+    font-size: 30rpx;
+    font-family: PingFang SC-Bold, PingFang SC;
+    font-weight: bold;
+    color: #333333;
+    padding: 0 30rpx;
+    box-sizing: border-box;
+
+    >view {
+        font-size: 26rpx;
+        color: #3874F6;
+        padding: 0 20rpx;
+    }
+}
+
+.user-item {
+    display: flex;
+    width: 100vw;
+    box-sizing: border-box;
+    background-color: #fff;
+    padding: 20rpx 30rpx;
+    align-items: center;
+
+    .content {
+        position: relative;
+        width: 100%;
+
+        .label {
+            font-size: 30rpx;
+            font-family: PingFang SC-Bold, PingFang SC;
+            font-weight: bold;
+            color: #333333;
+            margin-top: 0;
+
+            .tag1 {
+                font-weight: normal !important;
+                margin-right: 10rpx;
+            }
+        }
+
+        view {
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #666666;
+            margin-top: 8rpx;
+        }
+
+        .tag {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            width: 100rpx;
+            height: 45rpx;
+            font-size: 30rpx;
+            border: 1px solid red;
+            position: absolute;
+            color: red;
+            right: 0;
+            top: 50%;
+            margin-top: -22.5rpx;
+            border-radius: 4rpx;
+        }
+    }
+}
+
+scroll-view {
+    min-width: 100vw;
+    background-color: #fff;
+
+    .discounts {
+        display: flex;
+        align-items: center;
+        height: 150rpx;
+        box-sizing: border-box;
+
+        .card {
+            display: flex;
+            align-items: center;
+            width: 410rpx;
+            height: 130rpx;
+            padding: 10rpx 0;
+            border-radius: 16rpx;
+            mask-composite: subtract;
+            -webkit-mask-image: radial-gradient(circle at 130rpx 4px, transparent 4px, red 4.5px), radial-gradient(closest-side circle at 50%, red 99%, transparent 100%);
+            -webkit-mask-size: 100%, 2rpx 4rpx;
+            -webkit-mask-repeat: repeat, repeat-y;
+            -webkit-mask-position: 0 -4rpx, 130rpx;
+            -webkit-mask-composite: source-out;
+            box-sizing: border-box;
+            margin-left: 15rpx;
+            flex-shrink: 0;
+
+            .card-left {
+                width: 130rpx;
+                text-align: center;
+                font-size: 24rpx;
+                font-weight: bold;
+                color: #fff;
+            }
+
+            .card-right {
+                padding: 16px 12px;
+                display: flex;
+                flex: 1;
+                flex-direction: column;
+
+                .card-info {
+                    margin: 0 0 10px 0;
+                    font-size: 14px;
+                    line-height: 20px;
+                    color: #fff;
+                }
+
+                .card-time {
+                    font-size: 12px;
+                    line-height: 16px;
+                    font-weight: normal;
+                    color: #fff;
+                    margin-top: 4px;
+                }
+            }
+        }
+    }
+
+}
+
+
+
+
+
+.footer {
+    display: flex;
+    justify-content: space-between;
+    padding: 0 30rpx;
+    position: fixed;
+    width: 100vw;
+    height: 130rpx;
+    background: #FFFFFF;
+    box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+    bottom: 0;
+    box-sizing: border-box;
+    z-index: 9999;
+    padding-top: 10rpx;
+
+    .left {
+        flex: 1;
+        display: flex;
+        justify-content: space-between;
+        font-size: 24rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #333333;
+        line-height: 86rpx;
+
+        .price {
+            font-size: 32rpx;
+            font-family: PingFang SC-Medium, PingFang SC;
+            font-weight: 500;
+            color: #FF3B30;
+            margin-right: 20rpx;
+        }
+    }
+
+
+    .but-box {
+        .but {
+            min-width: 156rpx;
+            height: 90rpx;
+            background: var(--warning);
+            border-radius: 8rpx;
+            font-size: 28rpx;
+            font-family: PingFang SC-Bold, PingFang SC;
+            font-weight: bold;
+            color: #FFFFFF;
+        }
+    }
+}

+ 84 - 0
pages/teams/addOrder.wxml

@@ -0,0 +1,84 @@
+<view wx:if="{{sys_payinstructions}}" class="head">
+    {{sys_payinstructions}}
+</view>
+<view class="remarks">
+    <view>备注</view>
+    <textarea name='value' value="{{remarks}}" placeholder="请填写" placeholder-style='font-size:14px;color:#bbb;' auto-height bindblur="onblur" />
+</view>
+<view class="tips">请选择付费版本</view>
+<van-radio-group value="{{ sys_site_systempartitionid }}">
+    <navigator class="versions" url="#" wx:for="{{versionsList}}" wx:key="sys_site_systempartitionid" data-item="{{item}}" bindtap="changeVer">
+        <van-radio name="{{item.sys_site_systempartitionid}}" icon-size="16px">版本:{{item.partitionname}}</van-radio>
+        <view data-item="{{item}}" catchtap="checkVer">
+            详情
+        </view>
+    </navigator>
+</van-radio-group>
+<block wx:if="{{discounts.length}}">
+    <view class="tips">使用抵扣劵</view>
+    <scroll-view scroll-x>
+        <view class="discounts">
+            <view class="card" wx:for="{{discounts}}" style="background: {{(index-0+1)<=useDiscount?'linear-gradient(45deg, orange, red)':'linear-gradient(45deg, grey, grey)'}};" wx:key="index">
+                <view class="card-left">抵扣一年</view>
+                <view class="card-right">
+                    <view class="card-info">{{item.type}}折扣券</view>
+                    <view class="card-time">有效期至{{item.enddate}}</view>
+                </view>
+            </view>
+        </view>
+    </scroll-view>
+</block>
+
+<view class="tips">请选择付费{{sys_payincidence==1?'账号':'主体'}}</view>
+<van-checkbox-group wx:if="{{sys_payincidence==1}}" value="{{ users }}">
+    <view class="user-item" wx:for="{{userList}}" wx:key="userid" data-id="{{item.userid}}" data-isleader="{{item.isleader}}" bindtap="{{(item.isleader && per.query(users,item.userid) && !item.enddate[sys_site_systempartitionid])?'':'onChange'}}">
+        <van-checkbox shape='square' icon-size='14' disabled="{{item.isleader && per.query(users,item.userid) && !item.enddate[sys_site_systempartitionid]}}" name="{{item.userid}}" />
+        <view class="content">
+            <view class="label">
+                {{item.name}} <van-tag custom-class='tag1' wx:if="{{item.isleader==1}}" text-color='#fff' round type="danger">主账号</van-tag>
+            </view>
+            <view>
+                账号ID:{{item.accountno}}
+            </view>
+            <view>
+                手机号:{{item.phonenumber||" --"}}
+            </view>
+            <view>
+                到期时间:{{item.enddate[sys_site_systempartitionid]||' --'}}
+            </view>
+            <view class="tag" wx:if="{{!item.enddate[sys_site_systempartitionid]}}">
+                未付费
+            </view>
+        </view>
+    </view>
+</van-checkbox-group>
+<van-checkbox-group wx:else value="{{ users }}">
+    <view class="user-item" wx:for="{{userList}}" wx:key="sa_agentsid" data-id="{{item.sa_agentsid}}" bindtap="onChange">
+        <van-checkbox shape='square' icon-size='14' name="{{item.sa_agentsid}}" />
+        <view class="content">
+            <view class="label">{{item.agentname}}</view>
+            <view>
+                联系人:{{item.name}} {{item.phonenumber||" --"}}
+            </view>
+            <view>
+                到期时间:{{item.enddate[sys_site_systempartitionid]||' --'}}
+            </view>
+        </view>
+    </view>
+</van-checkbox-group>
+<inventory id='inventory' />
+<view style="height: 130rpx;" />
+<view class="footer">
+    <view class="left">
+        <view>
+            支付数量:{{users.length}}
+        </view>
+        <view>
+            总价:<text class="price">{{showAmount}}</text>
+        </view>
+    </view>
+    <view class="but-box">
+        <van-button custom-class='but' disabled="{{users.length==0}}" bind:click="payment">确定支付</van-button>
+    </view>
+</view>
+<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

+ 9 - 18
pages/teams/addRole.js

@@ -7,8 +7,6 @@ Page({
      * 页面的初始数据
      */
     data: {
-        update: true, // 修改权限
-        userDelete: false, // 删除
         height: 0,
         roleid: -1, //角色id
         appList: [], //应用列表
@@ -34,10 +32,6 @@ Page({
         disabled: true, //按钮禁用
         loading: false, //按钮加载
     },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
     onLoad(options) {
         console.log(options)
         if (options.item) {
@@ -47,12 +41,10 @@ Page({
                 ['fromList[0].value']: item.rolename,
                 ['fromList[1].value']: item.remarks,
                 disabled: false,
-                update: options.update,
-                userDelete: options.userDelete
             });
-            console.log(this.data.userDelete)
         };
         this.query_appselect();
+        /*    */
     },
     /* 查询应用列表 */
     query_appselect() {
@@ -72,6 +64,10 @@ Page({
                 roleid: this.data.roleid == -1 ? 0 : this.data.roleid,
                 appList: res.data
             })
+            /*  this.setData({
+                 roleid: this.data.roleid == -1 ? 0 : this.data.roleid,
+                 appList: wx.getStorageSync('userauth')
+             }) */
         })
     },
     /* 提交数据 */
@@ -128,9 +124,10 @@ Page({
                 if (s.confirm) {
                     console.log('删除')
                     _Http.basic({
-                        id: '20221101132002',
+                        "classname": "sale.role.role",
+                        "method": "delete_role",
                         "content": {
-                            "roleid": [this.data.roleid]
+                            "roleid": this.data.roleid
                         }
                     }).then(res => {
                         if (res.msg != '成功') return wx.showToast({
@@ -155,13 +152,10 @@ Page({
             })
         }, 300)
     },
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
     onReady() {
         getHeight.getHeight('.module-navigation', this).then(res => {
             this.setData({
-                height: res * 2
+                height: res - 130
             })
         })
     },
@@ -174,7 +168,4 @@ Page({
             disabled: !detail
         })
     },
-    onShareAppMessage() {
-
-    }
 })

+ 4 - 5
pages/teams/addRole.wxml

@@ -7,8 +7,7 @@
 </view>
 <My_categoryListings id="myCateg" height='{{height}}' list='{{appList}}' />
 
-<view wx:if="{{update!='false' || userDelete!='false'}}" class="footer">
-    <van-button wx:if="{{userDelete!='false'}}" custom-class='delete-but' round catchtap="deleteRole">删除</van-button>
-    <van-button wx:if="{{update!='false'}}" custom-class='submit {{userDelete!="false"?"delete-sub":""}}' disabled='{{disabled}}' loading='{{loading}}' bindtap="submitRole" loading-text="保存中...">保存</van-button>
-</view>
-<!--  -->
+<view class="footer">
+    <van-button custom-class='delete-but' round catchtap="deleteRole">删除</van-button>
+    <van-button custom-class='submit delete-sub' disabled='{{disabled}}' loading='{{loading}}' bindtap="submitRole" loading-text="保存中...">保存</van-button>
+</view>

+ 28 - 8
pages/teams/addUsers.js

@@ -3,7 +3,6 @@ const _Http = getApp().globalData.http,
 
 Page({
     data: {
-        update: true, // 修改权限
         sa_agent_hrid: 0,
         remarks: "", //备注
         fromList: [{
@@ -32,7 +31,7 @@ Page({
             value: "",
             placeholder: "请填写",
             valueName: "email", //绑定的字段名称
-            required: true, //必填
+            required: false, //必填
         }, {
             label: "手机号码",
             error: false,
@@ -50,7 +49,7 @@ Page({
             value: "",
             placeholder: "请填写",
             valueName: "rolenames", //绑定的字段名称
-            required: false, //必填
+            required: true, //必填
         }],
         roleValue: [],
         roleids: [], //已选角色ID
@@ -58,6 +57,25 @@ Page({
         disabled: true, //按钮禁用
         loading: false, //按钮加载
     },
+    toOrder() {
+
+        _Http.basic({
+            "classname": "system.payorder.payorder",
+            "method": "createOrder",
+            "content": {},
+        }).then(res => {
+            console.log("新建订单", res)
+            if (res.msg != '成功') return wx.showModal({
+                title: '提示',
+                content: res.msg,
+                showCancel: false,
+            })
+
+            wx.navigateTo({
+                url: './addOrder' + '?sys_payorderid=' + res.data.sys_payorderid,
+            })
+        })
+    },
     onLoad(options) {
         if (options.item) {
             let item = JSON.parse(options.item)
@@ -71,8 +89,7 @@ Page({
                 roleValue: item.rolenames,
                 remarks: item.remarks,
                 roleids: item.roleids.map(v => v + ''),
-                disabled: true,
-                update: options.update
+                disabled: true
             })
         };
         this.queryRole();
@@ -86,6 +103,7 @@ Page({
                 "sa_agent_hrid": this.data.sa_agent_hrid
             }
         }).then(res => {
+            console.log("角色列表", res)
             if (res.msg != '成功') return wx.showToast({
                 title: res.msg,
                 icon: "none"
@@ -111,7 +129,7 @@ Page({
             returnData
         } = this.selectComponent("#form").getData();
         if (!deleteMark.CheckPhoneNumber(returnData.phonenumber.trim() - 0)) return;
-        if (!deleteMark.CheckEmail(returnData.email.trim())) return;
+        if (returnData.email.trim() && !deleteMark.CheckEmail(returnData.email.trim())) return;
         delete(returnData.rolenames);
         this.setData({
             loading: true
@@ -153,10 +171,13 @@ Page({
     getResult({
         detail
     }) {
+        let fromList = this.selectComponent("#form").getForm();
+        fromList[4].value = detail.roleids;
         this.setData({
             roleids: detail.roleids,
             roleValue: detail.rolenames
-        })
+        });
+        this.selectComponent("#form").statistics();
     },
     /* 文本域输入 */
     textareaInput(e) {
@@ -164,5 +185,4 @@ Page({
             remarks: deleteMark.queryStr(e.detail.value).trim()
         })
     },
-    onShareAppMessage(res) { }
 })

+ 13 - 3
pages/teams/addUsers.wxml

@@ -1,4 +1,4 @@
-<My_form id='form' fromList='{{fromList}}' bindCompletedOrNot='formCompletedOrNot'>
+<!-- <My_form id='form' fromList='{{fromList}}' bindCompletedOrNot='formCompletedOrNot'>
     <view class="role" slot='slot1'>
         <My_upMultiSelect class="text" title='角色配置' list='{{roleList}}' result='{{roleids}}' showText='{{roleValue}}' bind:getResult='getResult' />
     </view>
@@ -7,6 +7,16 @@
     <view class="title">备注</view>
     <textarea class="textarea" bindinput="textareaInput" placeholder="请填写" value="{{remarks}}" />
 </view>
-<!-- <view wx:if="{{update!='false'}}" style="width: 100vw;text-align: center;margin-top: 100rpx;">
+<view style="width: 100vw;text-align: center;margin-top: 100rpx;">
     <van-button disabled='{{disabled}}' loading='{{loading}}' bindtap="submitRole" loading-text="保存中..." custom-class='submit-but'>保存</van-button>
-</view> -->
+</view>
+ -->
+
+<van-cell-group>
+    <van-cell wx:for="{{fromList}}" wx:key="valueName" title="{{item.label}}" value="{{item.value || '--'}}" />
+    <!-- <van-cell title="单元格" value="内容" border="{{ false }}" /> -->
+</van-cell-group>
+
+<view style="width: 100vw;text-align: center;margin-top: 100rpx;">
+    <van-button bindtap="toOrder" custom-class='submit-but'>前去付费</van-button>
+</view>

+ 107 - 32
pages/teams/index.js

@@ -1,5 +1,6 @@
 const _Http = getApp().globalData.http;
-const getHeight = require("../../utils/GetRheRemainingHeight");
+const getHeight = require("../../utils/GetRheRemainingHeight"),
+    currency = require("../../utils/currency");
 
 Page({
     data: {
@@ -8,6 +9,7 @@ Page({
         listHeight: 0,
         butText: "", //按钮类型
         content: {
+            nocache: true,
             "pageNumber": 1,
             "pageSize": 20,
             "pageTotal": 1,
@@ -17,22 +19,59 @@ Page({
         }
     },
     onLoad(options) {
-        let auth = options.auth ? JSON.parse(options.auth) : getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心'])[0].apps[0].meta.auth,
-            authList = auth.map(v => v.optionname);
-        let tabShow = false,
-            butText = '账号';
-        if (authList.includes('查看账号') && authList.includes('查看角色')) {
-            tabShow = true;
-        } else {
-            butText = authList.includes('查看角色') ? '角色' : '账号';
-        }
+        let auth = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心'])[0].apps.find(v => v.name == 'teamManagement').meta.auth,
+            tabList = [],
+            authList = auth.map(v => {
+                if (v.option == 'account') {
+                    tabList[0] = {
+                        title: "账号列表",
+                        butText: "新建账号",
+                        classname: "sale.team.team",
+                        method: "query_teamList",
+                        url: '/pages/teams/addUsers'
+                    }
+                } else if (v.option == 'role') {
+                    tabList[1] = {
+                        title: "角色列表",
+                        butText: "新建角色",
+                        classname: "sale.role.role",
+                        method: "query_roleList",
+                        url: '/pages/teams/addRole'
+                    }
+                } else if (v.option == 'paidOrder') {
+                    tabList[2] = {
+                        title: "付费订单",
+                        butText: wx.getStorageSync('siteP').sys_payswitch ? "新建付费订单" : "",
+                        classname: "system.payorder.payorder",
+                        method: "list",
+                        url: "/pages/teams/addOrder"
+                    }
+                }
+                return v.option
+            });
+        tabList = tabList.filter(v => v);
         this.setData({
-            tabShow,
-            butText,
-            authList
+            authList,
+            tabList,
+            active: tabList[options.title ? tabList.findIndex(v => v.title == options.title) || 0 : 0]
         })
+        console.log(auth)
+        console.log(this.data.active)
+        /*   if (options.title) setTimeout(() => {
+              this.setData({
+                  active: this.data.active
+              })
+          }, 300) */
         this.getList();
     },
+    /* tab切换 */
+    tabChange(e) {
+        this.setData({
+            active: this.data.tabList[e.detail.index],
+            list: [],
+        })
+        this.getList(true);
+    },
     /* 获取列表 */
     getList(init = false) {
         if (init.detail != undefined) init = init.detail;
@@ -40,19 +79,52 @@ Page({
             ['content.pageNumber']: 1
         })
         if (this.data.content.pageNumber > this.data.content.pageTotal) return;
+        let active = this.data.active;
         _Http.basic({
-            "id": this.data.butText == '账号' ? "20221107094704" : "20221109091404",
-            "content": this.data.content
+            classname: active.classname || '',
+            method: active.method || '',
+            id: active.id || '',
+            content: this.data.content
         }).then(res => {
             this.selectComponent('#ListBox').RefreshToComplete();
             if (res.msg != '成功') return wx.showToast({
                 title: res.msg,
                 icon: "none"
             })
-            if (this.data.butText == '账号') {
+            if (active.butText == '新建账号') {
                 for (let i = 0; i < res.data.length; i++) {
                     res.data[i].attinfos = res.data[i].attinfos.filter(v => v.usetype == 'headportrait');
                 }
+            } else if (active.butText == '新建付费订单') {
+                res.data = res.data.map(v => {
+                    switch (v.ispaid) {
+                        case 0:
+                            v.color = "#FF3B30";
+                            v.status = '未付费';
+                            break;
+                        case 1:
+                            v.color = '#52C41A';
+                            v.status = '已付费';
+                            break;
+                        case 2:
+                            v.color = '#ddd';
+                            v.status = "新建";
+                            break;
+                        case 3:
+                            v.color = '#ddd';
+                            v.status = "已取消";
+                            break;
+                        case 4:
+                            v.color = '#ddd';
+                            v.status = "已退费";
+                            break;
+                    };
+                    v.amount = currency(v.amount, {
+                        symbol: "¥",
+                        precision: 2
+                    }).format();
+                    return v
+                })
             }
             this.setData({
                 list: (res.pageNumber == 1) ? res.data : this.data.list.concat(res.data),
@@ -63,24 +135,31 @@ Page({
     },
     /* 新建账号/角色 */
     newItem() {
-        if (this.data.butText == '账号') {
-            wx.navigateTo({
-                url: '/pages/teams/addUsers'
+        let url = this.data.active.url;
+        console.log(url)
+        if (!url) return;
+        if (url == '/pages/teams/addOrder') {
+            _Http.basic({
+                "classname": "system.payorder.payorder",
+                "method": "createOrder",
+                "content": {},
+            }).then(res => {
+                console.log("新建订单", res)
+                if (res.msg != '成功') return wx.showModal({
+                    title: '提示',
+                    content: res.msg,
+                    showCancel: false,
+                })
+                wx.navigateTo({
+                    url: url + '?sys_payorderid=' + res.data.sys_payorderid
+                })
             })
         } else {
             wx.navigateTo({
-                url: '/pages/teams/addRole'
+                url
             })
         }
     },
-    /* tab切换 */
-    tabChange(e) {
-        this.setData({
-            butText: e.detail.title.slice(0, 2),
-            list: [],
-        })
-        this.getList(true);
-    },
     /* 修改角色 */
     changeRole(e) {
         let {
@@ -100,9 +179,6 @@ Page({
             url: `./addUsers?item=${JSON.stringify(item)}&update=${this.data.authList.includes("账号修改")}`
         })
     },
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
     onReady() {
         getHeight.getHeight('.tabs', this).then(res => {
             this.setData({
@@ -110,5 +186,4 @@ Page({
             })
         });
     },
-    onShareAppMessage(res) {}
 })

+ 3 - 1
pages/teams/index.json

@@ -1,4 +1,6 @@
 {
     "navigationBarTitleText": "团队管理",
-    "usingComponents": {}
+    "usingComponents": {
+        "My_ListBox":"/components/Yl_ListBox/index"
+    }
 }

+ 46 - 2
pages/teams/index.scss

@@ -48,7 +48,7 @@ page {
 
     .details {
         width: 507rpx;
-        height: 130rpx;
+        min-height: 130rpx;
         margin-left: 30rpx;
 
         .user-name {
@@ -85,12 +85,16 @@ page {
 
         .base-msg {
             margin-top: 10rpx;
-            height: 34rpx;
+            min-height: 34rpx;
             line-height: 34rpx;
             font-size: 24rpx;
             font-family: PingFang SC-Regular, PingFang SC;
             color: #666666;
 
+            .tag {
+                margin-right: 4rpx;
+            }
+
             .iconfont {
                 margin-left: 60rpx;
                 color: var(--assist);
@@ -152,6 +156,46 @@ page {
     }
 }
 
+/* 订单 */
+.orderForm {
+    position: relative;
+    padding: 20rpx 30rpx;
+
+    .label {
+        line-height: 42rpx;
+        font-size: 30rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #333333;
+        margin-top: 0rpx;
+    }
+
+    view {
+        line-height: 34rpx;
+        font-size: 24rpx;
+        color: #666666;
+        margin-top: 10rpx;
+
+        .price {
+            color: #FF3B30;
+        }
+    }
+
+    .status {
+        display: block;
+        position: absolute;
+        top: 20rpx;
+        right: 30rpx;
+        width: 96rpx;
+        height: 36rpx;
+        line-height: 36rpx;
+        text-align: center;
+        border-radius: 4rpx;
+        font-size: 20rpx;
+        color: #FFFFFF;
+    }
+}
+
 /* 吸底 */
 .footer {
     position: fixed;

+ 37 - 17
pages/teams/index.wxml

@@ -1,11 +1,11 @@
-<van-tabs wx:if="{{tabShow}}" swipeable sticky title-active-color='var(--assist)' color='var(--assist)' bind:change="tabChange">
-    <van-tab title="账号列表" />
-    <van-tab title="角色列表" />
+<van-tabs wx:if="{{tabShow}}" active="{{active.title}}" swipeable sticky title-active-color='var(--assist)' color='var(--assist)' bind:change="tabChange">
+    <van-tab wx:for="{{tabList}}" wx:key="title" title="{{item.title}}" name="{{item.title}}" />
 </van-tabs>
+
 <view class="tabs" />
-<Yl_ListBox id="ListBox" height="{{listHeight}}" bind:getlist='getList'>
-    <block wx:if="{{butText=='账号'}}">
-        <navigator url="#" class="my-card user-item" wx:for="{{list}}" data-item="{{item}}" bindtap="changeUser">
+<My_ListBox id="ListBox" height="{{listHeight}}" bind:getlist='getList'>
+    <block wx:if="{{active.title=='账号列表'}}">
+        <navigator url="#" class="my-card user-item" wx:for="{{list}}" wx:key="userid" data-item="{{item}}" bindtap="changeUser">
             <view class="user-img">
                 <van-image width="96rpx" height="96rpx" fit='cover' radius='48rpx' lazy-load src="{{item.attinfos[0].url||'/static/image/user.png'}}" />
             </view>
@@ -17,15 +17,22 @@
                         <text class="iconfont icon-a-wodetiaozhuan" />
                     </view>
                 </view>
-                <view class="base-msg line-1">
-                    <!-- {{item.remarks}} -->
+                <view class="base-msg" style="display: flex;flex-wrap: wrap;">
+                    <block wx:if="{{item.partitionname.length}}">
+                        <view class='tag' wx:for="{{item.partitionname}}" wx:for-item="it" wx:for-index="i" style="{{i>1?'margin-top:4rpx':''}}">
+                            <van-tag plain type="primary">{{it.partitionname}}{{it.enddate}}</van-tag>
+                        </view>
+                    </block>
+                    <block wx:else>
+                        <van-tag plain type="danger">未付费</van-tag>
+                    </block>
                 </view>
-                <view class="base-msg">账号ID:{{item.userid}}<text class="iconfont icon-a-wodemendianxinxidianhua" />{{item.phonenumber}}</view>
+                <view class="base-msg">账号:{{item.accountno}}<text class="iconfont icon-a-wodemendianxinxidianhua" />{{item.phonenumber}}</view>
             </view>
         </navigator>
     </block>
-    <block wx:else>
-        <navigator url="#" class="my-card role-item" wx:for="{{list}}" data-item="{{item}}" bindtap="changeRole">
+    <block wx:elif="{{active.title=='角色列表'}}">
+        <navigator url="#" class="my-card role-item" wx:for="{{list}}" wx:key="roleid" data-item="{{item}}" bindtap="changeRole">
             <view class="role-l">
                 <view class="first-line">
                     <text class="label line-1">{{item.rolename}}</text>
@@ -38,11 +45,24 @@
             </view>
         </navigator>
     </block>
+    <block wx:elif="{{active.title=='付费订单'}}">
+        <navigator url="/pages/teams/order?id={{item.sys_payorderid}}" class="my-card orderForm" wx:for="{{list}}" wx:key="sys_payorderid">
+            <view class="label">订单号:{{item.orderno}}</view>
+            <view>
+                付费金额:<text class="price">{{item.amount || "0"}}</text>
+            </view>
+            <view>
+                付费时间:{{item.paytime || "未付费"}}
+            </view>
+            <view>
+                备注:{{item.remarks || " --"}}
+            </view>
+            <text class="status" style="background-color: {{item.color}};">{{item.status}}</text>
+        </navigator>
+    </block>
     <view style="height: 230rpx;" />
     <Yl_Empty wx:if="{{list.length==0}}" />
-</Yl_ListBox>
-<view class="footer" wx:if="{{per.query(authList,butText+'新增')}}">
-    <van-button custom-class='add-but' color="var(--assist)" bindtap="newItem">新建{{butText}}</van-button>
-</view>
-
-<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />
+</My_ListBox>
+<view class="footer" wx:if="{{active.butText!='新建账号'}}">
+    <van-button custom-class='add-but' color="var(--assist)" bindtap="newItem">{{active.butText}}</van-button>
+</view>

+ 1 - 1
pages/teams/modules/Pop-upMulti-select.wxml

@@ -5,7 +5,7 @@
 <van-action-sheet show="{{ show }}" title="{{title}}" safe-area-inset-bottom='{{false}}' bind:close='closeSelete'>
     <van-divider customStyle="margin-top:-5rpx; margin-bottom:-0rpx;" />
     <scroll-view class="scroll-view" scroll-y>
-        <Yl_Empty sonMarTop='70' marTop="220rpx" wx:if="{{list.length==0}}" text='暂无角色' />
+        <My_empty sonMarTop='70' marTop="220rpx" wx:if="{{list.length==0}}" text='暂无角色' />
         <van-checkbox-group value="{{ result }}" bind:change="onChange">
             <van-cell-group border='{{false}}'>
                 <van-cell border='{{false}}' wx:for="{{ list }}" title-class='title-class line-1' wx:key="index" title="{{ item.rolename }}" clickable data-index="{{ index }}" value-class='value-class' bind:click="toggle">

+ 63 - 0
pages/teams/modules/inventory.js

@@ -0,0 +1,63 @@
+Component({
+    properties: {
+
+    },
+    data: {
+        open: false
+    },
+    methods: {
+        show(e) {
+            if (e.length == 0) return wx.showToast({
+                title: '该版本数据为空',
+                icon: "none",
+                mask: true
+            })
+            let list = [];
+            e.forEach(v => {
+                let index = list.findIndex(s => s.systemclient == v.systemclient)
+                if (index == -1) {
+                    if (v.systemclient == "wechatsaletool") {
+                        list.push({
+                            name: "小程序",
+                            systemclient: "wechatsaletool",
+                            list: [v]
+                        })
+                    } else if (v.systemclient == "web") {
+                        list.push({
+                            name: "Web",
+                            systemclient: "web",
+                            list: [v]
+                        })
+                    } else {
+                        list.push({
+                            name: v.systemclient,
+                            systemclient: v.systemclient,
+                            list: [v]
+                        })
+                    }
+                } else {
+                    list[index].list.push(v)
+                }
+            })
+            this.setData({
+                open: true,
+                activeKey: 0,
+                list
+            })
+        },
+        onChange({
+            detail
+        }) {
+            this.setData({
+                activeKey: detail
+            })
+        },
+        onClose() {
+            this.setData({
+                open: false,
+                list: [],
+                activeKey: 0,
+            })
+        }
+    }
+})

+ 7 - 0
pages/teams/modules/inventory.json

@@ -0,0 +1,7 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-sidebar": "@vant/weapp/sidebar/index",
+        "van-sidebar-item": "@vant/weapp/sidebar-item/index"
+    }
+}

+ 13 - 0
pages/teams/modules/inventory.scss

@@ -0,0 +1,13 @@
+.main {
+    display: flex;
+
+    .container {
+        width: 100%;
+        view{
+            font-size: 30rpx;
+            margin-left: 15rpx;
+            padding: 30rpx 0;
+            border-bottom: 1rpx solid #ddd;
+        }
+    }
+}

+ 13 - 0
pages/teams/modules/inventory.wxml

@@ -0,0 +1,13 @@
+<van-popup show="{{ open }}" position="left" custom-style="width: 80%;height:100vh;" bind:click-overlay="onClose">
+	<view class="main">
+		<van-sidebar active-key="{{ activeKey }}" bindchange="onChange">
+			<van-sidebar-item wx:for="{{list}}" badge='{{item.list.length}}' wx:key="systemclient" title="{{item.name}}" />
+		</van-sidebar>
+		<view class="container">
+			<view wx:for="{{list[activeKey].list}}">
+				{{item.systemappname}}/{{item.systemmodulename}}
+			</view>
+			<view style="height: 150rpx; border: 0 ;" />
+		</view>
+	</view>
+</van-popup>

+ 271 - 0
pages/teams/order.js

@@ -0,0 +1,271 @@
+let sys_payorderid = null,
+    _Http = getApp().globalData.http,
+    currency = require("../../utils/currency"),
+    pageNumber = 1,
+    pageTotal = 1,
+    CNY = value => currency(value, {
+        symbol: "¥",
+        precision: 2
+    }).format();
+
+Page({
+    data: {
+        loading: true
+    },
+    onLoad(options) {
+        sys_payorderid = options.id;
+        // sys_payincidence 1账号 2主体
+        this.setData({
+            sys_payincidence: wx.getStorageSync('siteP').sys_payincidence,
+            sys_payswitch: wx.getStorageSync('siteP').sys_payswitch
+        })
+        this.getDetail();
+        this.getList(true);
+    },
+    getDetail() {
+        _Http.basic({
+            "classname": "system.payorder.payorder",
+            "method": "detail",
+            "content": {
+                nocache: true,
+                sys_payorderid
+            }
+        }).then(res => {
+            console.log("付费订单详情", res)
+            if (res.msg != '成功') {
+                wx.showToast({
+                    title: res.msg,
+                    icon: "none",
+                    mask: true
+                });
+                setTimeout(() => wx.navigateBack(), 1000)
+                return;
+            };
+            let detail = res.data;
+            detail.showAmount = CNY(detail.amount);
+            switch (detail.ispaid) {
+                case 0:
+                    detail.color = "#FF3B30";
+                    detail.status = '未付费';
+                    break;
+                case 1:
+                    detail.color = '#52C41A';
+                    detail.status = '已付费';
+                    break;
+                case 2:
+                    detail.color = '#ddd';
+                    detail.status = "新建";
+                    break;
+                case 3:
+                    detail.color = '#ddd';
+                    detail.status = "已取消";
+                    break;
+                case 4:
+                    detail.color = '#ddd';
+                    detail.status = "已退费";
+                    break;
+            };
+            this.setData({
+                detail,
+                showroom: [{
+                    label: "付费订单号",
+                    value: detail.orderno
+                }, {
+                    label: "付费状态",
+                    value: detail.status,
+                    color: detail.color,
+                }, {
+                    label: "付费金额",
+                    value: detail.showAmount,
+                    color: '#FF3B30',
+                }, {
+                    label: "付费时间",
+                    value: detail.paytime
+                }, {
+                    label: "付费版本",
+                    value: detail.partitionname,
+                    func: "viewDetails"
+                }, {
+                    label: "付费人",
+                    value: detail.createby
+                }, {
+                    label: "付费渠道",
+                    value: detail.paymode
+                }, {
+                    label: "备注",
+                    value: detail.remarks
+                }],
+                loading: false
+            });
+        })
+    },
+    /* 获取列表 */
+    getList(init = false) {
+        if (init) {
+            pageNumber = 1;
+            pageTotal = 1;
+        };
+        if (pageNumber > pageTotal) return;
+        _Http.basic({
+            "classname": "system.payorder.payorder",
+            "method": "detail_userlist",
+            "content": {
+                sys_payorderid,
+                pageNumber,
+                "where": {
+                    "condition": ""
+                }
+            }
+        }).then(res => {
+            console.log("获取付费列表", res)
+            if (res.msg != '成功') {
+                wx.showToast({
+                    title: res.msg,
+                    icon: "none",
+                    mask: true
+                });
+                setTimeout(() => wx.navigateBack(), 1000)
+                return;
+            };
+            pageNumber = res.pageNumber + 1;
+            pageTotal = res.pageTotal;
+            res.data = res.data.map(v => {
+                v.discount = v.price == 0;
+                v.price = CNY(v.price)
+                return v
+            })
+            this.setData({
+                list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+
+                total: res.total
+            })
+        })
+    },
+    /* 支付 */
+    payment() {
+        let that = this;
+        wx.login({
+            success: (s) => {
+                _Http.basic({
+                    "classname": "system.payment.wechatpay",
+                    "method": "createWechatOrder",
+                    "content": {
+                        "orderno": that.data.detail.orderno,
+                        "wechat_code": s.code,
+                        "trade_type": "JSAPI"
+                    }
+                }).then(res => {
+                    console.log("获取支付信息", res)
+                    if (res.data == '失败') return wx.showToast({
+                        title: res.msg,
+                        icon: "none",
+                        mask: true
+                    });
+                    wx.requestPayment({
+                        timeStamp: res.data.timeStamp,
+                        nonceStr: res.data.nonceStr,
+                        package: res.data.package,
+                        signType: res.data.signType,
+                        paySign: res.data.paySign,
+                        success(re) {
+                            console.log(re)
+                            wx.showToast({
+                                title: '支付成功',
+                                mask: true
+                            })
+                            that.getDetail();
+                        },
+                        fail(err) {
+                            console.error(err)
+                            wx.showToast({
+                                title: '已取消支付',
+                                icon: "none",
+                                mask: true
+                            })
+                        }
+                    })
+                })
+            },
+        })
+
+    },
+    /* 删除订单 */
+    deleteOrder() {
+        let that = this;
+        wx.showModal({
+            title: '提示',
+            content: '是否确定删除该订单',
+            complete: (s) => {
+                if (s.confirm) _Http.basic({
+                    "classname": "system.payorder.payorder",
+                    "method": "delete",
+                    "content": {
+                        "sys_payorderid": that.data.detail.sys_payorderid
+                    }
+                }).then(res => {
+                    console.log("删除订单", res)
+                    wx.showToast({
+                        title: res.msg == '成功' ? '删除成功' : res.msg,
+                        icon: "none",
+                        mask: true
+                    });
+                    if (res.msg == '成功') setTimeout(() => {
+                        wx.navigateBack()
+                    }, 500)
+                })
+            }
+        })
+    },
+    /* 查看版本 */
+    viewDetails() {
+        this.selectComponent("#inventory").show(this.data.detail.systemapp)
+    },
+    onReachBottom() {
+        this.getList();
+    },
+    onUnload() {
+        let page = getCurrentPages().find(v => v.__route__ == 'pages/teams/index');
+        if (!page) return;
+        if (page.data.active.title == '付费订单') {
+            let content = JSON.parse(JSON.stringify(page.data.content));
+            content.pageSize = (content.pageNumber - 1) * content.pageSize;
+            content.pageNumber = 1;
+            _Http.basic({
+                "classname": "system.payorder.payorder",
+                "method": "list",
+                content
+            }).then(res => {
+                console.log('更新列表数据', res)
+                res.data = res.data.map(v => {
+                    switch (v.ispaid) {
+                        case 0:
+                            v.color = "#FF3B30";
+                            v.status = '未付费';
+                            break;
+                        case 1:
+                            v.color = '#52C41A';
+                            v.status = '已付费';
+                            break;
+                        case 2:
+                            v.color = '#ddd';
+                            v.status = "新建";
+                            break;
+                        case 3:
+                            v.color = '#ddd';
+                            v.status = "已取消";
+                            break;
+                        case 4:
+                            v.color = '#ddd';
+                            v.status = "已退费";
+                            break;
+                    };
+                    v.amount = CNY(v.amount);
+                    return v
+                })
+                if (res.msg == '成功') page.setData({
+                    list: res.data
+                })
+            })
+        }
+    }
+})

+ 6 - 0
pages/teams/order.json

@@ -0,0 +1,6 @@
+{
+	"usingComponents": {
+		"inventory": "./modules/inventory"
+	},
+	"navigationBarTitleText": "订单详情"
+}

+ 130 - 0
pages/teams/order.scss

@@ -0,0 +1,130 @@
+@import "./order.skeleton.wxss";
+
+.row {
+    width: 100vw;
+    padding-left: 30rpx;
+    background-color: #fff;
+    box-sizing: border-box;
+
+    >view {
+        width: 720rpx;
+        display: flex;
+        justify-content: space-between;
+        padding: 20rpx 0;
+        border-bottom: 1rpx solid #EEEEEE;
+        font-size: 28rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+
+        .label {
+            color: #666666;
+            width: 176rpx;
+        }
+
+        .text {
+            margin-right: 30rpx;
+            max-width: 500rpx;
+        }
+    }
+}
+
+.title {
+    font-size: 28rpx;
+    color: #333333;
+    padding-top: 30rpx;
+    padding-left: 30rpx;
+}
+
+.card {
+    width: 690rpx;
+    background: #FFFFFF;
+    border-radius: 16rpx;
+    margin: 20rpx auto 0;
+    box-sizing: border-box;
+    padding: 20rpx 30rpx;
+
+    .label {
+        line-height: 42rpx;
+        font-size: 30rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #333333;
+        margin-top: 0;
+    }
+
+    >view {
+        display: flex;
+        align-items: center;
+        font-size: 24rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #666666;
+        line-height: 34rpx;
+        margin-top: 10rpx;
+    }
+
+    .price {
+        color: #FF3B30;
+    }
+
+    .tag {
+        background-color: #F59A23;
+        padding: 4rpx 8rpx;
+        color: #fff;
+        border-radius: 8rpx;
+        margin-left: 14rpx;
+        font-size: 22rpx;
+    }
+
+}
+
+
+
+.footer {
+    display: flex;
+    justify-content: space-between;
+    padding: 0 30rpx;
+    position: fixed;
+    width: 100vw;
+    height: 130rpx;
+    background: #FFFFFF;
+    box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+    bottom: 0;
+    box-sizing: border-box;
+    z-index: 9999;
+    padding-top: 10rpx;
+
+    .left {
+        flex: 1;
+        display: flex;
+        justify-content: space-between;
+        font-size: 24rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #333333;
+        line-height: 86rpx;
+
+        .price {
+            font-size: 32rpx;
+            font-family: PingFang SC-Medium, PingFang SC;
+            font-weight: 500;
+            color: #FF3B30;
+            margin-right: 20rpx;
+        }
+    }
+
+
+    .but-box {
+        .but {
+            min-width: 156rpx;
+            height: 90rpx;
+            background: var(--warning);
+            border-radius: 8rpx;
+            font-size: 28rpx;
+            font-family: PingFang SC-Bold, PingFang SC;
+            font-weight: bold;
+            color: #FFFFFF;
+        }
+
+        .delete {
+            background: var(--error) !important;
+        }
+    }
+}

+ 120 - 0
pages/teams/order.skeleton.wxml

@@ -0,0 +1,120 @@
+<!--
+此文件为开发者工具生成,生成时间: 2023/5/23下午2:56:33
+使用方法:
+在 D:\开发项目\MD_YOSwechat\pages\teams\order.wxml 引入模板
+
+```
+<import src="order.skeleton.wxml"/>
+<template is="skeleton" wx:if="{{loading}}" />
+```
+
+在 D:\开发项目\MD_YOSwechat\pages\teams\order.wxss 中引入样式
+```
+@import "./order.skeleton.wxss";
+```
+
+更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
+-->
+<template name="skeleton">
+  <view class="sk-container">
+    <navigator class="row">
+      <view>
+        <view class="lebel sk-transparent sk-text-14-2857-980 sk-text">付费订单号</view>
+        <view class="text sk-transparent sk-text-14-2857-123 sk-text" style="color: #333333;">SO202305230004</view>
+      </view>
+    </navigator>
+    <navigator class="row">
+      <view>
+        <view class="lebel sk-transparent sk-text-14-2857-364 sk-text">付费状态</view>
+        <view class="text sk-transparent sk-text-14-2857-158 sk-text" style="color: #FF3B30;">未付费</view>
+      </view>
+    </navigator>
+    <navigator class="row">
+      <view>
+        <view class="lebel sk-transparent sk-text-14-2857-910 sk-text">付费金额</view>
+        <view class="text sk-transparent sk-text-14-2857-33 sk-text" style="color: #FF3B30;">¥0.30</view>
+      </view>
+    </navigator>
+    <navigator class="row">
+      <view>
+        <view class="lebel sk-transparent sk-text-14-2857-551 sk-text">付费时间</view>
+        <view class="text sk-transparent sk-opacity" style="color: #333333;"> --</view>
+      </view>
+    </navigator>
+    <navigator class="row">
+      <view>
+        <view class="lebel sk-transparent sk-text-14-2857-468 sk-text">付费版本</view>
+        <view class="text sk-transparent sk-text-14-2857-100 sk-text" style="color: #333333;">营销宝</view>
+      </view>
+    </navigator>
+    <navigator class="row">
+      <view>
+        <view class="lebel sk-transparent sk-text-14-2857-836 sk-text">付费人</view>
+        <view class="text sk-transparent sk-text-14-2857-885 sk-text" style="color: #333333;">张翼</view>
+      </view>
+    </navigator>
+    <navigator class="row">
+      <view>
+        <view class="lebel sk-transparent sk-text-14-2857-199 sk-text">付费渠道</view>
+        <view class="text sk-transparent sk-text-14-2857-903 sk-text" style="color: #333333;">微信支付</view>
+      </view>
+    </navigator>
+    <navigator class="row">
+      <view>
+        <view class="lebel sk-transparent sk-text-14-2857-66 sk-text">备注</view>
+        <view class="text sk-transparent sk-text-14-2857-698 sk-text" style="color: #333333;">111</view>
+      </view>
+    </navigator>
+    <view class="title sk-transparent sk-text-14-2857-294 sk-text">
+      付费订单列表
+    </view>
+    <view class="card">
+      <view class="label sk-transparent sk-text-14-2857-93 sk-text">账号名称:崔晓珊</view>
+      <view class="sk-transparent sk-text-14-7059-887 sk-text">账号:006991</view>
+      <view class="sk-transparent">单价(元):
+        <text class="price sk-transparent sk-text-14-7059-50 sk-text">¥0.15</text>
+      </view>
+      <view class="sk-transparent sk-text-14-7059-182 sk-text">生效时间:2023-05-23</view>
+      <view class="sk-transparent sk-text-14-7059-918 sk-text">到期时间:2024-05-23</view>
+    </view>
+    <view class="card">
+      <view class="label sk-transparent sk-text-14-2857-6 sk-text">账号名称:验证3</view>
+      <view class="sk-transparent sk-text-14-7059-970 sk-text">账号:006994</view>
+      <view class="sk-transparent">单价(元):
+        <text class="price sk-transparent sk-text-14-7059-591 sk-text">¥0.15</text>
+      </view>
+      <view class="sk-transparent sk-text-14-7059-34 sk-text">生效时间:2023-05-23</view>
+      <view class="sk-transparent sk-text-14-7059-511 sk-text">到期时间:2024-05-23</view>
+    </view>
+    <view style="height: 65px;"></view>
+    <view class="footer">
+      <view class="left">
+        <view class="sk-transparent">
+          总价:
+          <text class="price sk-transparent sk-text-31-3953-69 sk-text">¥0.30</text>
+        </view>
+      </view>
+      <view class="but-box">
+       <!--  <view is="miniprogram_npm/@vant/weapp/button/index">
+          <button app-parameter="true" business-id="true" class="but delete van-button button-index--van-button van-button--default button-index--van-button--default van-button--normal button-index--van-button--normal sk-button sk-pseudo sk-pseudo-circle"
+            data-detail="null" form-type="true" hover-class="van-button--active hover-class" lang="true" open-type="true" send-message-img="true" send-message-path="true" send-message-title="true" session-from="true" style="true">
+            <view class="van-button__text button-index--van-button__text sk-transparent sk-text-15-0000-528 sk-text" style="background-position-x: 50%;">删除订单</view>
+          </button>
+        </view> -->
+        <view is="miniprogram_npm/@vant/weapp/button/index">
+          <button app-parameter="true" business-id="true" class="but van-button button-index--van-button van-button--default button-index--van-button--default van-button--normal button-index--van-button--normal sk-button sk-pseudo sk-pseudo-circle" data-detail="null"
+            form-type="true" hover-class="van-button--active hover-class" lang="true" open-type="true" send-message-img="true" send-message-path="true" send-message-title="true" session-from="true" style="true">
+            <view class="van-button__text button-index--van-button__text sk-transparent sk-text-15-0000-836 sk-text" style="background-position-x: 50%;">继续支付</view>
+          </button>
+        </view>
+      </view>
+    </view>
+    <view is="pages/teams/modules/inventory" id="inventory">
+      <view is="miniprogram_npm/@vant/weapp/popup/index">
+        <view is="miniprogram_npm/@vant/weapp/overlay/index">
+          <view is="miniprogram_npm/@vant/weapp/transition/index"></view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>

+ 195 - 0
pages/teams/order.skeleton.wxss

@@ -0,0 +1,195 @@
+/*
+此文件为开发者工具生成,生成时间: 2023/5/23下午2:56:34
+
+在 D:\开发项目\MD_YOSwechat\pages\teams\order.wxss 中引入样式
+```
+@import "./order.skeleton.wxss";
+```
+
+更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
+*/
+.sk-transparent {
+    color: transparent !important;
+  }
+.sk-text-14-2857-980 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text {
+    background-origin: content-box !important;
+    background-clip: content-box !important;
+    background-color: transparent !important;
+    color: transparent !important;
+    background-repeat: repeat-y !important;
+  }
+.sk-text-14-2857-123 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-364 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-158 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-910 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-33 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-551 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-opacity {
+    opacity: 0 !important;
+  }
+.sk-text-14-2857-468 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-100 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-836 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-885 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-199 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-903 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-66 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-698 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-294 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 39.2000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-93 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 42.0000rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-887 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 34.0000rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-50 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 34.0000rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-182 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 34.0000rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-918 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 34.0000rpx;
+    position: relative !important;
+  }
+.sk-text-14-2857-6 {
+    background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+    background-size: 100% 42.0000rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-970 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 34.0000rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-591 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 34.0000rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-34 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 34.0000rpx;
+    position: relative !important;
+  }
+.sk-text-14-7059-511 {
+    background-image: linear-gradient(transparent 14.7059%, #EEEEEE 0%, #EEEEEE 85.2941%, transparent 0%) !important;
+    background-size: 100% 34.0000rpx;
+    position: relative !important;
+  }
+.sk-text-31-3953-69 {
+    background-image: linear-gradient(transparent 31.3953%, #EEEEEE 0%, #EEEEEE 68.6047%, transparent 0%) !important;
+    background-size: 100% 86.0000rpx;
+    position: relative !important;
+  }
+.sk-text-15-0000-528 {
+    background-image: linear-gradient(transparent 15.0000%, #EEEEEE 0%, #EEEEEE 85.0000%, transparent 0%) !important;
+    background-size: 100% 40.0000rpx;
+    position: relative !important;
+  }
+.sk-text-15-0000-836 {
+    background-image: linear-gradient(transparent 15.0000%, #EEEEEE 0%, #EEEEEE 85.0000%, transparent 0%) !important;
+    background-size: 100% 40.0000rpx;
+    position: relative !important;
+  }
+.sk-button {
+    color: #EFEFEF !important;
+    background: #EFEFEF !important;
+    border: none !important;
+    box-shadow: none !important;
+  }
+.sk-pseudo::before, .sk-pseudo::after {
+      background: #EFEFEF !important;
+      background-image: none !important;
+      color: transparent !important;
+      border-color: transparent !important;
+    }
+.sk-pseudo-rect::before, .sk-pseudo-rect::after {
+      border-radius: 0 !important;
+    }
+.sk-pseudo-circle::before, .sk-pseudo-circle::after {
+      border-radius: 50% !important;
+    }
+.sk-container {
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+    background-color: transparent;
+  }

+ 46 - 0
pages/teams/order.wxml

@@ -0,0 +1,46 @@
+<import src="order.skeleton.wxml" />
+<template is="skeleton" wx:if="{{loading}}" />
+<navigator url="#" class="row" wx:for="{{showroom}}" wx:key="lebel" bindtap="{{item.func||''}}">
+    <view>
+        <view class="lebel">{{item.label}}</view>
+        <view class="text" style="color: {{item.color||'#333333'}};">{{item.value||' --'}}</view>
+    </view>
+</navigator>
+<view class="title">
+    付费订单列表
+</view>
+<block wx:if="{{sys_payincidence==1}}" wx:key="index">
+    <view class="card" wx:for="{{list}}">
+        <view class="label">账号名称:{{item.name}}</view>
+        <view>账号:{{item.accountno}}</view>
+        <view>单价(元):
+            <text class="price">{{item.price}}</text>
+            <view class="tag">优惠抵扣</view>
+        </view>
+        <view>生效时间:{{item.begdate}}</view>
+        <view>到期时间:{{item.enddate}}</view>
+    </view>
+</block>
+<block wx:else>
+    <view class="card" wx:for="{{list}}" wx:key="index">
+        <view class="label">{{item.agentname}}</view>
+        <view>单价(元):<text class="price">{{item.price}} <view class="tag" wx:if="{{item.discount}}">优惠抵扣</view></text></view>
+        <view>生效时间:{{item.begdate}}</view>
+        <view>到期时间:{{item.enddate}}</view>
+    </view>
+</block>
+<block wx:if="{{detail.ispaid!=1}}">
+    <view style="height: 130rpx;" />
+    <view class="footer">
+        <view class="left">
+            <view>
+                总价:<text class="price">{{detail.showAmount}}</text>
+            </view>
+        </view>
+        <view class="but-box">
+            <van-button custom-class='but delete' bind:click="deleteOrder">删除订单</van-button>
+            <van-button custom-class='but' wx:if="{{sys_payswitch && detail.ispaid==0}}" bind:click="payment">继续支付</van-button>
+        </view>
+    </view>
+</block>
+<inventory id='inventory' />

+ 2 - 2
utils/Http.js

@@ -4,8 +4,8 @@ class HTTP {
 		if (ENV === 'release') { // 正式版
 			this.baseUrl = "https://lsa.cnyunl.com";
 		} else {
-			this.baseUrl = "https://lsa.cnyunl.com";
-			// this.baseUrl = "http://61.164.207.46:8300";
+			// this.baseUrl = "https://lsa.cnyunl.com";
+			this.baseUrl = "http://61.164.207.46:8300";
 		}
 		console.log("接口地址:", this.baseUrl)
 	}

+ 170 - 0
utils/pay.js

@@ -0,0 +1,170 @@
+//验证付费凭证,通过后跳转
+const evidence = item => {
+    const isLeader = wx.getStorageSync('isLeader');
+    console.log("跳转", item)
+    return new Promise((resolve) => {
+        //应用是否开通,开通直接跳转
+        if (item.isneedpay) {
+            update(false).then(res => {
+                console.log("res",res)
+                let p = null;
+                try {
+                    if (item.systemappid) {
+                        let app = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案"])[0].apps
+                        p = app.find(v => v.name == item.name)
+                    } else {
+                        p = res.find(v => v.vame == item.vame);
+                    }
+                } catch (error) {
+                    p = null;
+                }
+                console.log("p", p)
+                if (p.isneedpay) {
+                    wx.showModal({
+                        title: '提示',
+                        content: `当前模块未付费,是否付费使用?`,
+                        confirmText: "去付费",
+                        cancelText: isLeader ? "下次再说" : "提醒老板",
+                        complete: (res) => {
+                            if (res.confirm) createOrder();
+                            if (res.cancel && !isLeader) sendMessage();
+                            resolve(false)
+                        }
+                    })
+                } else {
+                    resolve(true)
+                }
+            })
+        } else {
+            console.log('直接跳转')
+            resolve(true)
+        }
+    })
+};
+//创建新的订单
+const createOrder = (query = "") => {
+    getApp().globalData.http.basic({
+        "classname": "system.payorder.payorder",
+        "method": "createOrder",
+        "content": {},
+    }).then(res => {
+        console.log("新建订单", res)
+        if (res.msg != '成功') return wx.showModal({
+            title: '提示',
+            content: res.msg,
+            showCancel: false,
+        })
+        wx.navigateTo({
+            url: '/pages/teams/addOrder?sys_payorderid=' + res.data.sys_payorderid + query
+        })
+    })
+}
+//查询版本到期情况
+const vIndate = () => {
+    const http = getApp().globalData.http;
+    const isLeader = wx.getStorageSync('isLeader');
+    return http.basic({
+        "classname": "sysmanage.develop.paymentrules.paymentrules",
+        "method": "queryRemind",
+        "content": {
+            nocache: true,
+            siteid: wx.getStorageSync('siteP').siteid,
+            pageSize: 999
+        }
+    }, false).then(res => {
+        console.log("版本到期情况", res)
+        if (res.msg != '成功') return;
+        let data = res.data;
+        let content = data.map(v => {
+            return `【${v.partitionname}】将于${v.enddate}日到期`
+        }).join(";") + ',请尽快续费!'
+        if (data.length) {
+            wx.showModal({
+                title: '提示',
+                content,
+                confirmText: "去付费",
+                cancelText: isLeader ? "下次再说" : "提醒老板",
+                complete: (res) => {
+                    if (res.confirm) createOrder(`&vid=${data[0].sys_site_systempartitionid}`);
+                    if (res.cancel && !isLeader) {
+                        sendMessage();
+                    } else {
+                        uIndate()
+                    }
+                }
+            })
+        } else {
+            if (isLeader) uIndate();
+        }
+    })
+}
+//查询人员到期情况
+const uIndate = () => {
+    const http = getApp().globalData.http;
+    http.basic({
+        "classname": "sysmanage.develop.paymentrules.paymentrules",
+        "method": "queryRemindUser",
+        "content": {
+            siteid: wx.getStorageSync('siteP').siteid,
+        }
+    }).then(res => {
+        console.log("人员到期情况", res)
+        if (res.msg != '成功') return;
+        let data = res.data;
+        let content = data.map(v => v.name).join(",")
+        if (data.length) wx.showModal({
+            title: '提示',
+            content: `${content}申请账号付费,请前往处理!`,
+            confirmText: "去付费",
+            cancelText: "下次再说",
+            complete: (res) => {
+                if (res.confirm) createOrder(`&users=${JSON.stringify(data.map(v => v.userid + ''))}`);
+            }
+        })
+    })
+}
+//发送提醒付费消息发送到主账号
+const sendMessage = (sys_payorderid = '') => getApp().globalData.http.basic({
+    "classname": "system.payorder.payorder",
+    "method": "sendMessage",
+    "content": {
+        sys_payorderid
+    }
+}).then(s => wx.showToast({
+    title: '已发送消息到主体主账号',
+    icon: "none"
+}));
+//更新付费权限
+const update = (total = true) => {
+    return new Promise((resolve) => {
+        getApp().globalData.http.basic({
+            "classname": "sysmanage.develop.userauth.userauth",
+            "method": "query_userauth",
+            content: {
+                nocache: true
+            }
+        }).then(res => {
+            console.log('更新付费信息', res)
+            if (res.msg != '成功') return resolve(false)
+            wx.setStorageSync('userauth', res.data);
+            if (total) wx.showToast({
+                title: '应用付费信息已更新',
+                icon: "none"
+            })
+            try {
+                let page = getCurrentPages().find(v => v.__route__ == 'pages/index/index')
+                resolve(page ? page.refreshData() : getApp().globalData.refreshData())
+            } catch (error) {
+                resolve([])
+            }
+        });
+    })
+}
+export {
+    evidence,
+    sendMessage,
+    createOrder,
+    vIndate,
+    uIndate,
+    update
+}