Browse Source

添加应用付费授权

xiaohaizhao 1 year ago
parent
commit
d9687fd82c

+ 3 - 1
app.json

@@ -29,7 +29,9 @@
         "pages/classroom/list",
         "pages/classroom/detail",
         "pages/exam/index",
-        "pages/exam/detail"
+        "pages/exam/detail",
+        "pages/teams/order",
+        "pages/teams/addOrder"
     ],
     "usingComponents": {
         "My_card": "/components/My_card/index",

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

@@ -22,12 +22,13 @@ function query_userauth(i = 0) {
         querySite_Parameter();
     }
     _Http.basic({
-        "classname": "sysmanage.develop.userauth.userauth",
+        "classname": "system.payorder.payorder", //"sysmanage.develop.userauth.userauth"
         "method": "query_userauth",
         content: {
             nocache: true
         }
     }).then(res => {
+        console.log('用户权限', res)
         if (res.msg != '成功') return query_userauth(i + 1);
         wx.setStorageSync('userauth', res.data);
         count += 1;
@@ -63,6 +64,7 @@ function query_adspacelist(i = 0) {
         toHome();
     })
 }
+
 function toHome() {
     if (count < 3) return;
     let pages = getCurrentPages();

+ 1 - 1
pages/login/phone.wxml

@@ -3,7 +3,7 @@
 </view>
 
 <!-- 手机号登录  -->
-<phone id='login' wx:if="{{false}}" />
+<phone id='login' wx:if="{{true}}" />
 <!-- 账号登录 -->
 <account wx:else id='login' />
 <view style="width: 100vw; text-align: center;margin-top: 60rpx;margin-bottom: 40rpx;">

+ 40 - 11
pages/tabbar/home/index.js

@@ -1,10 +1,6 @@
 const _Http = getApp().globalData.http;
 let DataCarousel = null;
 Page({
-
-    /**
-     * 页面的初始数据
-     */
     data: {
         bannerList: [], //banner列表
         user: {},
@@ -16,10 +12,6 @@ Page({
         subassembly: [], //首页部件
         msgList: [], //消息列表
     },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
     onLoad(options) {
         this.refreshData() //更新权限等信息
         this.setData({ //获取胶囊位置信息
@@ -230,17 +222,54 @@ Page({
     applications(e) {
         const {
             item
-        } = e.currentTarget.dataset;
-        const url = `${item.path}?auth=${JSON.stringify(item.apps)}`
+        } = e.currentTarget.dataset,
+            that = this, userType = wx.getStorageSync('userMsg').usertype,
+            isLeader = userType == 21 || userType == 22;
+        console.log("跳转", item)
         if (item.name == "营销物料") {
             wx.switchTab({
                 url
             });
         } else {
             wx.navigateTo({
-                url
+                url:item.path
             });
         }
+        return
+        //应用是否开通,开通直接跳转
+        if (!item.apps[0].isneedpay) {
+            wx.showModal({
+                title: '提示',
+                content: `当前模块未付费,是否付费使用?`,
+                confirmText: "前往付费",
+                cancelColor: isLeader ? "取消" : "提醒付费",
+                complete: (res) => {
+                    if (res.confirm) {
+                        _Http.basic({
+                            "classname": "system.payorder.payorder",
+                            "method": "createOrder",
+                            "content": {},
+                        }).then(res => {
+                            console.log("新建订单", res)
+                            if (res.msg != '成功') return wx.showToast({
+                                title: res.msg,
+                                icon: "none",
+                                mask: true
+                            });
+                            wx.navigateTo({
+                                url: '/pages/teams/addOrder?sys_payorderid=' + res.data.sys_payorderid
+                            })
+                        })
+                    }
+                    if (res.cancel) {
+                        if (!isLeader) console.log("提醒付费")
+                    }
+                }
+            })
+        } else {
+            const url = `${item.path}?auth=${JSON.stringify(item.apps)}`
+
+        }
     },
     /* 去消息详情 */
     toMsg(e) {

+ 11 - 21
pages/tabbar/mine/index.js

@@ -8,38 +8,28 @@ Page({
     data: {
         userMsg: {},
         pathList: [], //功能权限
-        teamAuth: '', //团队管理权限列表 JSON字符串 用于传递
     },
     onLoad(options) {
         this.queryUserMsg();
         //美大关闭团队管理
-        /* let authlist = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心']);
-        let pathList = [{
+        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) {
-            authlist[0].apps.forEach(v => {
-                switch (v.name) {
-                    case "teamManagement":
-                        pathList.unshift({
-                            name: "团队管理",
-                            icon: "icon-a-wodetuanduiguanli",
-                            color: "var(--assist)",
-                            path: `/${v.path}`
-                        })
-                        this.setData({
-                            teamAuth: JSON.stringify(v.meta.auth)
-                        })
-                        break;
-                }
+        }] */
+        if (authlist[0].apps.some(v => v.name == "teamManagement")) {
+            this.data.pathList.unshift({
+                name: "团队管理",
+                icon: "icon-a-wodetuanduiguanli",
+                color: "var(--assist)",
+                path: `/pages/teams/index`
             });
             this.setData({
-                pathList
+                pathList: this.data.pathList
             })
-        } */
+        }
     },
     /* 查询用户信息 */
     queryUserMsg() {

+ 3 - 11
pages/tabbar/mine/index.wxml

@@ -11,19 +11,9 @@
         </view>
         <van-icon size='40rpx' name="arrow" />
     </My_card>
-    <!-- <My_card custom-class='display-data'>
-        <view class="display-data_l">
-            <view class="first-line">250</view>
-            <view class="tow-line">行动力</view>
-        </view>
-        <view class="display-data_r">
-            <view class="first-line">平台行动力:250</view>
-            <view class="tow-line">总部行动力:250</view>
-        </view>
-    </My_card> -->
 </view>
 <My_card custom-class='operating' hover>
-    <navigator class="item" url="{{item.name=='团队管理'?item.path+'?auth='+teamAuth:item.path}}" wx:for="{{pathList}}">
+    <navigator class="item" url="{{item.path}}" wx:for="{{pathList}}">
         <view class="con">
             <view class="label">
                 <text class="iconfont {{item.icon}}" style="color: {{item.color}};" />
@@ -34,6 +24,8 @@
             </view>
         </view>
     </navigator>
+
+
     <navigator class="item" url="#" bindtap="bindingWechat">
         <view class="con">
             <view class="label">

+ 235 - 0
pages/teams/addOrder.js

@@ -0,0 +1,235 @@
+const _Http = getApp().globalData.http;
+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
+    },
+    onLoad(options) {
+        this.setData({
+            sys_payinstructions: wx.getStorageSync('siteP').sys_payinstructions,
+            sys_payincidence: 1
+        })
+        sys_payorderid = options.sys_payorderid;
+        this.getVersions();
+        this.getUsers(true);
+    },
+    /* 保存订单进度 */
+    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() {
+        _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;
+            };
+            this.setData({
+                versionsList: res.data,
+                sys_site_systempartitionid: res.data[0].sys_site_systempartitionid || ''
+            })
+        })
+    },
+    /* 切换版本 */
+    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.changeOrder();
+    },
+    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": 20,
+                "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;
+            this.setData({
+                userList: res.pageNumber == 1 ? res.data : this.data.userList.concat(res.data),
+                users: res.pageNumber == 1 ? [this.data.sys_payincidence == 1 ? (wx.getStorageSync('userMsg').userid + "") : (res.data[0].sa_agentsid + "" || "")] : this.data.users,
+            })
+            pageNumber = res.pageNumber + 1;
+            this.changeOrder();
+        })
+    },
+    onReachBottom() {
+        this.getUsers();
+    },
+    onChange(e) {
+        const {
+            id
+        } = e.currentTarget.dataset;
+        let users = this.data.users;
+        if (users.some(v => v == id)) {
+            users = users.filter(s => s != id)
+        } else {
+            users.push(id + "")
+        }
+        this.setData({
+            users
+        });
+        this.changeOrder();
+    },
+    /* 支付 */
+    payment() {
+        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 => {
+                    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) {
+                            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": "订单"
+}

+ 132 - 0
pages/teams/addOrder.scss

@@ -0,0 +1,132 @@
+.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 {
+        .label {
+            font-size: 30rpx;
+            font-family: PingFang SC-Bold, PingFang SC;
+            font-weight: bold;
+            color: #333333;
+            margin-top: 0;
+        }
+
+        view {
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #666666;
+            margin-top: 8rpx;
+        }
+    }
+}
+
+.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;
+        }
+    }
+}

+ 63 - 0
pages/teams/addOrder.wxml

@@ -0,0 +1,63 @@
+<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>
+<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}}" bindtap="onChange">
+        <van-checkbox shape='square' icon-size='14' name="{{item.userid}}" />
+        <view class="content">
+            <view class="label">{{item.name}}</view>
+            <view>
+                账号ID:{{item.accountno}}
+            </view>
+            <view>
+                手机号:{{item.phonenumber||" --"}}
+            </view>
+            <view>
+                到期时间:{{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>

+ 0 - 54
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,10 +41,7 @@ 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();
     },
@@ -156,9 +147,6 @@ Page({
             })
         }, 300)
     },
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
     onReady() {
         getHeight.getHeight('.module-navigation', this).then(res => {
             this.setData({
@@ -175,46 +163,4 @@ Page({
             disabled: !detail
         })
     },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
-
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    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>

+ 2 - 3
pages/teams/addUsers.js

@@ -3,7 +3,6 @@ const _Http = getApp().globalData.http,
 
 Page({
     data: {
-        update: true, // 修改权限
         sa_agent_hrid: 0,
         remarks: "", //备注
         fromList: [{
@@ -71,8 +70,7 @@ Page({
                 roleValue: item.rolenames,
                 remarks: item.remarks,
                 roleids: item.roleids.map(v => v + ''),
-                disabled: true,
-                update: options.update
+                disabled: true
             })
         };
         this.queryRole();
@@ -157,6 +155,7 @@ Page({
             roleids: detail.roleids,
             roleValue: detail.rolenames
         })
+        this.selectComponent("#form").statistics();
     },
     /* 文本域输入 */
     textareaInput(e) {

+ 1 - 1
pages/teams/addUsers.wxml

@@ -7,6 +7,6 @@
     <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>

+ 156 - 110
pages/teams/index.js

@@ -1,114 +1,160 @@
 const _Http = getApp().globalData.http;
-const getHeight = require("../../utils/getRheRemainingHeight");
+const getHeight = require("../../utils/getRheRemainingHeight"),
+	currency = require("../../utils/currency");
 
 Page({
-    data: {
-        tabShow: true,
-        auth: {}, //权限
-        listHeight: 0,
-        butText: "", //按钮类型
-        content: {
-            "pageNumber": 1,
-            "pageSize": 20,
-            "pageTotal": 1,
-            "where": {
-                "condition": ""
-            }
-        }
-    },
-    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('查看角色') ? '角色' : '账号';
-        }
-        this.setData({
-            tabShow,
-            butText,
-            authList
-        })
-        this.getList();
-    },
-    /* 获取列表 */
-    getList(init = false) {
-        if (init.detail != undefined) init = init.detail;
-        if (init) this.setData({
-            ['content.pageNumber']: 1
-        })
-        if (this.data.content.pageNumber > this.data.content.pageTotal) return;
-        _Http.basic({
-            "classname": this.data.butText == '账号' ? "sale.team.team" : "sale.role.role",
-            "method": this.data.butText == '账号' ? "query_teamList" : "query_roleList",
-            "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 == '账号') {
-                for (let i = 0; i < res.data.length; i++) {
-                    res.data[i].attinfos = res.data[i].attinfos.filter(v => v.usetype == 'headportrait');
-                }
-            }
-            this.setData({
-                list: (res.pageNumber == 1) ? res.data : this.data.list.concat(res.data),
-                ['content.pageNumber']: res.pageNumber + 1,
-                ['content.pageTotal']: res.pageTotal
-            })
-        })
-    },
-    /* 新建账号/角色 */
-    newItem() {
-        if (this.data.butText == '账号') {
-            wx.navigateTo({
-                url: '/pages/teams/addUsers'
-            })
-        } else {
-            wx.navigateTo({
-                url: '/pages/teams/addRole'
-            })
-        }
-    },
-    /* tab切换 */
-    tabChange(e) {
-        this.setData({
-            butText: e.detail.title.slice(0, 2),
-            list: [],
-        })
-        this.getList(true);
-    },
-    /* 修改角色 */
-    changeRole(e) {
-        let {
-            item
-        } = e.currentTarget.dataset;
-        wx.navigateTo({
-            url: `./addRole?item=${JSON.stringify(item)}&update=${this.data.authList.includes("角色修改")}&userDelete=${this.data.authList.includes("角色删除")}`
-        })
-    },
-    /* 修改账号 */
-    changeUser(e) {
-        let {
-            item
-        } = e.currentTarget.dataset;
-        delete(item.attinfos);
-        wx.navigateTo({
-            url: `./addUsers?item=${JSON.stringify(item)}&update=${this.data.authList.includes("账号修改")}`
-        })
-    },
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady() {
-        getHeight.getHeight('.tabs', this).then(res => {
-            this.setData({
-                listHeight: res
-            })
-        });
-    },
+	data: {
+		tabShow: true,
+		auth: {}, //权限
+		listHeight: 0,
+		butText: "", //按钮类型
+		content: {
+			nocache: true,
+			"pageNumber": 1,
+			"pageSize": 20,
+			"pageTotal": 1,
+			"where": {
+				"condition": ""
+			}
+		}
+	},
+	onLoad(options) {
+		let auth = options.auth ? JSON.parse(options.auth) : getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心'])[0].apps[0].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: "新建付费订单",
+						classname: "system.payorder.payorder",
+						method: "list",
+						url: "/pages/teams/addOrder"
+					}
+				}
+				return v.option
+			});
+		console.log(tabList)
+		this.setData({
+			authList,
+			tabList: tabList.filter(v => v),
+			active: tabList[0]
+		})
+		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;
+		if (init) this.setData({
+			['content.pageNumber']: 1
+		})
+		if (this.data.content.pageNumber > this.data.content.pageTotal) return;
+		let active = this.data.active;
+		_Http.basic({
+			classname: active.classname || '',
+			method: active.method || '',
+			id: active.id || '',
+			content: this.data.content
+		}).then(res => {
+			console.log(active.title, res)
+			this.selectComponent('#ListBox').RefreshToComplete();
+			if (res.msg != '成功') return wx.showToast({
+				title: res.msg,
+				icon: "none"
+			})
+			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 => {
+					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),
+				['content.pageNumber']: res.pageNumber + 1,
+				['content.pageTotal']: res.pageTotal
+			})
+		})
+	},
+	/* 新建账号/角色 */
+	newItem() {
+		let url = this.data.active.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.showToast({
+					title: res.msg,
+					icon: "none",
+					mask: true
+				});
+				wx.navigateTo({
+					url: url + '?sys_payorderid=' + res.data.sys_payorderid
+				})
+			})
+		} else {
+			wx.navigateTo({
+				url
+			})
+		}
+	},
+	/* 修改角色 */
+	changeRole(e) {
+		let {
+			item
+		} = e.currentTarget.dataset;
+		wx.navigateTo({
+			url: `./addRole?item=${JSON.stringify(item)}&update=${this.data.authList.includes("角色修改")}&userDelete=${this.data.authList.includes("角色删除")}`
+		})
+	},
+	/* 修改账号 */
+	changeUser(e) {
+		let {
+			item
+		} = e.currentTarget.dataset;
+		delete(item.attinfos);
+		wx.navigateTo({
+			url: `./addUsers?item=${JSON.stringify(item)}&update=${this.data.authList.includes("账号修改")}`
+		})
+	},
+	onReady() {
+		getHeight.getHeight('.tabs', this).then(res => {
+			this.setData({
+				listHeight: res
+			})
+		});
+	},
 })

+ 40 - 0
pages/teams/index.scss

@@ -121,6 +121,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;

+ 23 - 10
pages/teams/index.wxml

@@ -1,11 +1,10 @@
 <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-tab wx:for="{{tabList}}" wx:key="title" title="{{item.title}}" />
 </van-tabs>
 <view class="tabs" />
 <My_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">
+    <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>
@@ -24,8 +23,8 @@
             </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 +37,25 @@
             </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.ispaid==1?'#52C41A':'#FF3B30'}};">{{item.ispaid==1?'已付费':'未付费'}}</text>
+        </navigator>
+    </block>
     <view style="height: 230rpx;" />
     <My_empty wx:if="{{list.length==0}}" />
 </My_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" />
+<view class="footer" wx:if="{{active.butText}}">
+    <van-button custom-class='add-but' color="var(--assist)" bindtap="newItem">{{active.butText}}</van-button>
+</view>

+ 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>

+ 214 - 0
pages/teams/order.js

@@ -0,0 +1,214 @@
+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: {},
+    onLoad(options) {
+        sys_payorderid = options.id;
+        // sys_payincidence 1账号 2主体
+        this.setData({
+            sys_payincidence: wx.getStorageSync('siteP').sys_payincidence
+        })
+        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);
+            this.setData({
+                detail,
+                showroom: [{
+                    label: "付费订单号",
+                    value: detail.orderno
+                }, {
+                    label: "付费状态",
+                    value: detail.ispaid == 1 ? '已付费' : '未付费',
+                    color: detail.ispaid == 1 ? '#52C41A' : '#FF3B30',
+                }, {
+                    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
+                }]
+            });
+        })
+	},
+	/* 获取列表 */
+    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.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) => {
+                console.log(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)
+                    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)
+                if (res.msg == '成功') page.setData({
+                    list: res.data
+                })
+            })
+        }
+    }
+})

+ 6 - 0
pages/teams/order.json

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

+ 114 - 0
pages/teams/order.scss

@@ -0,0 +1,114 @@
+.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 {
+        font-size: 24rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #666666;
+        line-height: 34rpx;
+        margin-top: 10rpx;
+    }
+
+    .price {
+        color: #FF3B30;
+    }
+}
+
+.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;
+        }
+    }
+}

+ 45 - 0
pages/teams/order.wxml

@@ -0,0 +1,45 @@
+<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>
+        <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}}</text></view>
+        <view>生效时间:{{item.begdate}}</view>
+        <view>到期时间:{{item.enddate}}</view>
+    </view>
+</block>
+
+<block wx:if="{{detail.ispaid==0}}">
+    <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' bind:click="payment">继续支付</van-button>
+        </view>
+    </view>
+</block>
+<inventory id='inventory' />

+ 7 - 0
project.private.config.json

@@ -119,6 +119,13 @@
                     "query": "",
                     "launchMode": "default",
                     "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/teams/addOrder",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
                 }
             ]
         }

+ 5 - 0
utils/currency.js

@@ -0,0 +1,5 @@
+(function(e,g){"object"===typeof exports&&"undefined"!==typeof module?module.exports=g():"function"===typeof define&&define.amd?define(g):(e=e||self,e.currency=g())})(this,function(){function e(b,a){if(!(this instanceof e))return new e(b,a);a=Object.assign({},m,a);var d=Math.pow(10,a.precision);this.intValue=b=g(b,a);this.value=b/d;a.increment=a.increment||1/d;a.groups=a.useVedic?n:p;this.s=a;this.p=d}function g(b,a){var d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!0;var c=a.decimal;
+var h=a.errorOnInvalid,k=a.fromCents,l=Math.pow(10,a.precision),f=b instanceof e;if(f&&k)return b.intValue;if("number"===typeof b||f)c=f?b.value:b;else if("string"===typeof b)h=new RegExp("[^-\\d"+c+"]","g"),c=new RegExp("\\"+c,"g"),c=(c=b.replace(/\((.*)\)/,"-$1").replace(h,"").replace(c,"."))||0;else{if(h)throw Error("Invalid Input");c=0}k||(c=(c*l).toFixed(4));return d?Math.round(c):c}var m={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:function(b,
+a){var d=a.pattern,c=a.negativePattern,h=a.symbol,k=a.separator,l=a.decimal;a=a.groups;var f=(""+b).replace(/^-/,"").split("."),q=f[0];f=f[1];return(0<=b.value?d:c).replace("!",h).replace("#",q.replace(a,"$1"+k)+(f?l+f:""))},fromCents:!1},p=/(\d)(?=(\d{3})+\b)/g,n=/(\d)(?=(\d\d)+\d\b)/g;e.prototype={add:function(b){var a=this.s,d=this.p;return e((this.intValue+g(b,a))/(a.fromCents?1:d),a)},subtract:function(b){var a=this.s,d=this.p;return e((this.intValue-g(b,a))/(a.fromCents?1:d),a)},multiply:function(b){var a=
+this.s;return e(this.intValue*b/(a.fromCents?1:Math.pow(10,a.precision)),a)},divide:function(b){var a=this.s;return e(this.intValue/g(b,a,!1),a)},distribute:function(b){var a=this.intValue,d=this.p,c=this.s,h=[],k=Math[0<=a?"floor":"ceil"](a/b),l=Math.abs(a-k*b);for(d=c.fromCents?1:d;0!==b;b--){var f=e(k/d,c);0<l--&&(f=f[0<=a?"add":"subtract"](1/d));h.push(f)}return h},dollars:function(){return~~this.value},cents:function(){return~~(this.intValue%this.p)},format:function(b){var a=this.s;return"function"===
+typeof b?b(this,a):a.format(this,Object.assign({},a,b))},toString:function(){var b=this.s,a=b.increment;return(Math.round(this.intValue/this.p/a)*a).toFixed(b.precision)},toJSON:function(){return this.value}};return e});