Browse Source

renew/renew

姜永辉 1 năm trước cách đây
mục cha
commit
ac38e4b57c

+ 1 - 0
app.json

@@ -59,6 +59,7 @@
                 "pages/org/choose-org/choose-org",
                 "pages/org/sub-org-choose/sub-org-choose",
                 "pages/activity/activity",
+                "pages/activity/renew/renew",
                 "pages/activity/detail/detail",
                 "pages/print-layout/print-layout",
                 "pages/beginner-guide/beginner-guide",

+ 811 - 0
package-basic-data/pages/activity/renew/renew.js

@@ -0,0 +1,811 @@
+/*******************************************************************************
+ * Copyright(c) 2022 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:活动(用于续费、注册)
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		周兴		       2024-5-15	            1.00		   	   新建 
+ *******************************************************************************/
+const Constants = require('@/utils/Constants.js');
+const util = require('@/utils/util.js')
+const mixins = require('@/mixins/index.js');
+const config = require('@/config/config.js');
+const app = getApp()
+Page({
+    mixins: [mixins],
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        imageUrl: config.image_url + '/static/img/',
+        // 是否加载完毕
+        loadFlag: false,
+        // 是否显示vip
+        showVip: false,
+        // 升级标识
+        upgradeFlag: false,
+        gradeCode: null,
+        freeFlag: false,
+        // 企业名称
+        companyName: null,
+        cpManager: null,
+        cpPhone: null,
+        webMaxNum: null,
+        wxMaxNum: null,
+        cpEndDate: null,
+        activityTable: null,
+        vipTable: [],
+        readFlag: false,
+        staffCount: {
+            maxNum: 1,
+            webMaxNum: 0,
+            wxMaxNum: 0
+        },
+        curentAdItem: null,
+        // 选择的vip报表
+        chooseVipFlag: false,
+        summaryInfo: {},
+        routeObjName: 'company',
+        pageFlag: false,
+        // 当前用户授权数
+        currentUserCount: null,
+        //按钮
+        buttonSaveList: [
+            { code: 'save', title: mixins.$t('save'), width: '120rpx' }
+        ],
+        noticeInfo: Constants.noticeInfo,
+        funcMenu: [
+            {
+                title: '订单开单',
+                icon: 'btn-account-receivable.png',
+            },
+            {
+                title: '销售出库',
+                icon: 'btn-shipped.png',
+            },
+            {
+                title: '销售退货',
+                icon: 'btn-stored.png',
+            },
+            {
+                title: '销售跟踪',
+                icon: 'btn-shipped-out.png',
+            },
+            {
+                title: '采购订单',
+                icon: 'btn-account-receivable.png',
+            },
+            {
+                title: '采购入库',
+                icon: 'btn-shipped.png',
+            },
+            {
+                title: '采购退货',
+                icon: 'btn-stored.png',
+            },
+            {
+                title: '以销定采',
+                icon: 'btn-shipped-out.png',
+            },
+        ],
+        funcMenuFlg: false,
+        userEndDate: null,
+    },
+    /**
+     * @desc : 选择活动明细
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    chooseAdItem(e) {
+        let item = e.currentTarget.dataset.item;
+        let summaryInfo = this.data.summaryInfo
+        // 计算截止日期
+        let months = item.validLong + item.extraLong
+        let endDate = app.globalData.company.endDate
+        // 升级需要从当天开始算
+        if (this.data.upgradeFlag) {
+            endDate = new Date()
+        }
+        endDate = new Date(endDate).addMonths(months).addDays(-1)
+        summaryInfo.endDate = endDate.toDateStr();
+        this.setData({
+            curentAdItem: item,
+            summaryInfo: summaryInfo
+        })
+        // 计算金额
+        this.countSummaryAmount(item);
+    },
+    /**
+     * @desc : 选择VIP报表明细
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    chooseVipItem(e) {
+        let item = e.currentTarget.dataset.item
+        let index = e.currentTarget.dataset.index
+        let vipTable = this.data.vipTable
+        item.chooseVipFlag = !item.chooseVipFlag
+        vipTable[index] = item
+        this.setData({
+            chooseVipFlag: !this.data.chooseVipFlag,
+            vipTable,
+        })
+        // 计算金额
+        this.countSummaryAmountSTD();
+    },
+    /**
+     * @desc : 勾选已阅读表示
+     * @author : 周兴
+     * @date : 2024/5/17
+     */
+    handleChangeCheckbox(e) {
+        this.setData({
+            readFlag: e.detail
+        })
+    },
+    /**
+     * @desc : 计算金额
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    countSummaryAmount() {
+        let item = this.data.curentAdItem;
+        if (!item) return;
+        let staffCount = this.data.staffCount;
+        let summaryInfo = this.data.summaryInfo
+        let amount = 0;
+        // 先清空
+        summaryInfo.amountInfo = '';
+        // 共通用户
+        if (staffCount.maxNum) {
+            summaryInfo.amountInfo = item.stdPrice + '(打包价格)*' + staffCount.maxNum
+            amount += item.stdPrice * staffCount.maxNum
+        }
+        // 手机端用户
+        if (staffCount.wxMaxNum) {
+            if (summaryInfo.amountInfo) {
+                summaryInfo.amountInfo += ' + '
+            }
+            summaryInfo.amountInfo += item.wxPrice + '(手机端价格)*' + staffCount.wxMaxNum
+            amount += item.wxPrice * staffCount.wxMaxNum
+        }
+        // 电脑端用户
+        if (staffCount.webMaxNum) {
+            if (summaryInfo.amountInfo) {
+                summaryInfo.amountInfo += ' + '
+            }
+            summaryInfo.amountInfo += item.webPrice + '(电脑端价格)*' + staffCount.webMaxNum
+            amount += item.webPrice * staffCount.webMaxNum
+        }
+        if (summaryInfo.amountInfo) {
+            summaryInfo.amountInfo += ' = ' + amount + '(元)'
+            summaryInfo.amount = amount;
+        }
+        this.setData({
+            summaryInfo: summaryInfo
+        })
+        // 统计两端用户数
+        this.countStaffInfo();
+    },
+    /**
+     * @desc : 获取标准版的价格显示
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    countSummaryAmountSTD() {
+        let item = this.data.curentAdItem;
+        let vipTable = this.data.vipTable
+        let summaryInfo = this.data.summaryInfo
+        let amount = 0;
+        // 先清空
+        summaryInfo.amountInfo = '';
+        let extendDays = null;
+        // 服务器的时间
+        let nowDate = new Date(this.data.currentDate.toDateStr());
+
+        extendDays = new Date(summaryInfo.userEndDate).dayDiff(nowDate) + 1;
+        if (summaryInfo.wxMaxNum >= 0) {
+            //  购买授权
+            if (this.data.buyUser) {
+                summaryInfo.amountInfo += item.wxPrice + '(元)  '
+            } else {
+                summaryInfo.amountInfo += item.wxPrice + '(元)  ' +
+                    ' * 1(年) * ' + summaryInfo.wxMaxNum + '(个)'
+            }
+            amount += item.wxPrice * summaryInfo.wxMaxNum
+        }
+        // vip报表
+        if (vipTable && vipTable.length > 0) {
+            vipTable.forEach(vipItem => {
+                if (vipItem.chooseVipFlag) {
+                    summaryInfo.amountInfo += ' + ' + vipItem.wxPrice + '(元/' + vipItem.activityItemDescribe + ') ';
+                    summaryInfo.amountInfo = '( ' + summaryInfo.amountInfo + ' ) ';
+                    amount += vipItem.wxPrice;
+                }
+            })
+
+        }
+        //  购买授权
+        if (this.data.buyUser) {
+            summaryInfo.amountInfo += ' / 365(天) * ' + extendDays + '(天) * ' + summaryInfo.wxMaxNum + '(个)'
+            if (summaryInfo.amountInfo) {
+                amount = (amount / 365 * extendDays).toFixed(2);
+                summaryInfo.amountInfo += ' = ' + amount + '(元)'
+                summaryInfo.amount = amount;
+            }
+            this.setData({
+                userEndDate: summaryInfo.userEndDate
+            })
+
+        } else {
+            //  续费 
+            if (summaryInfo.amountInfo) {
+                amount = (amount).toFixed(2);
+                summaryInfo.amountInfo += ' = ' + amount + '(元)'
+                summaryInfo.amount = amount;
+            }
+            let userEndDate = new Date(summaryInfo.userEndDate).addMonths(12).addDays(-1)
+            this.setData({
+                userEndDate: userEndDate.toDateStr()
+            })
+        }
+
+        // 计算一授权一天的单价
+        if (summaryInfo.userEndDate) {
+            let price = (summaryInfo.amount / summaryInfo.wxMaxNum / extendDays).toFixed(2);
+            summaryInfo.priceInfo = price
+            summaryInfo.extendDays = extendDays
+        }
+
+        this.setData({
+            summaryInfo: summaryInfo
+        })
+    },
+    /**
+     * @desc : 统计电脑端和手机端的用户数
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    countStaffInfo() {
+        let summaryInfo = this.data.summaryInfo;
+        let staffCount = this.data.staffCount;
+        if (!staffCount) {
+            return;
+        }
+        let webNum = staffCount.webMaxNum + staffCount.maxNum
+        let wxNum = staffCount.wxMaxNum + staffCount.maxNum
+        summaryInfo.staffInfo = '可配置手机端授权' + wxNum + '个;电脑端授权' + webNum + '个(包含当前用户)'
+        summaryInfo.webMaxNum = webNum
+        summaryInfo.wxMaxNum = wxNum
+        // 升级从当天算
+        if (this.data.upgradeFlag) {
+            summaryInfo.buyBeginDate = new Date().addDays(1).toDateStr();
+            summaryInfo.extendDays = new Date(summaryInfo.endDate).dayDiff(new Date().addDays(1));
+        } else {
+            summaryInfo.buyBeginDate = new Date(this.data.cpEndDate).addDays(1).toDateStr();
+            summaryInfo.extendDays = new Date(summaryInfo.endDate).dayDiff(new Date(this.data.cpEndDate).addDays(1));
+        }
+        // 计算一授权一天的单价
+        let price = (summaryInfo.amount / (webNum + wxNum) / summaryInfo.extendDays).toFixed(2);
+        summaryInfo.priceInfo = price
+
+        this.setData({
+            summaryInfo: summaryInfo
+        })
+    },
+    /**
+     * @desc : 修改用户数
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    changeStaffCount(e) {
+        let staffCount = this.data.staffCount
+        let ds = e.currentTarget.dataset
+        if (ds.type == 'wx') {
+            staffCount.wxMaxNum = e.detail
+        } else if (ds.type == 'web') {
+            staffCount.webMaxNum = e.detail
+        } else {
+            staffCount.maxNum = e.detail
+        }
+        this.setData({
+            staffCount: staffCount
+        })
+        // 计算金额
+        this.countSummaryAmount();
+    },
+    /**
+     * @desc : 保存
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    handleSave() {
+        let summaryInfo = this.data.summaryInfo;
+        let currentUserCount = this.data.currentUserCount
+        if (!currentUserCount) {
+            return;
+        }
+        if (this.data.gradeCode == Constants.gradeCode.STD) {
+            // 必须要选择一个授权              
+            if (Number(summaryInfo.wxMaxNum) <= 0 && this.data.buyUser) {
+                util.showToast('请选择一个授权');
+                return false
+            }
+            // 功能包
+            let chooseVipFlag = false
+            this.data.vipTable.forEach(it => {
+                if (it.chooseVipFlag) {
+                    chooseVipFlag = true
+                    return
+                }
+            })
+            if (Number(summaryInfo.wxMaxNum) <= 0 && !this.data.buyUser && !chooseVipFlag) {
+                util.showToast('请选择一个授权或功能包');
+                return false
+            }
+            // 判断数量是否超出续约授权
+            console.log(currentUserCount.wxNum - summaryInfo.wxMaxNum);
+            if (currentUserCount.wxNum > summaryInfo.wxMaxNum && summaryInfo.reCountFlag
+                && currentUserCount.wxNum > 1 && currentUserCount.wxNum - summaryInfo.wxMaxNum > 1) {
+                let staffInfo = [{ wxMaxNum: Number(this.data.wxMaxNum), title: '当前授权', wxTitle: '手机授权', code: 'current', userTitle: '当前用户' }, { wxMaxNum: this.data.buyUser ? summaryInfo.wxMaxNum : summaryInfo.wxMaxNum + 1, title: '续费授权', wxTitle: '手机授权', code: 'renew' }]
+                this.save({ saveFlag: false, url: '/package-basic-data/pages/activity/detail/detail?staffInfo=' + JSON.stringify(staffInfo) });
+            } else {
+                this.save({});
+            }
+        } else {
+            // 判断数量是否超出续约授权
+            if (currentUserCount.wxNum > summaryInfo.wxMaxNum || currentUserCount.webNum > summaryInfo.webMaxNum) {
+                let staffInfo = [{ wxMaxNum: this.data.wxMaxNum, webMaxNum: this.data.webMaxNum, title: '当前授权', wxTitle: '手机授权', webTitle: (app.globalData.company.gradeCode == Constants.gradeCode.STD) ? '' : '电脑授权', code: 'current', userTitle: '当前用户' }, { wxMaxNum: summaryInfo.wxMaxNum, webMaxNum: summaryInfo.webMaxNum, title: '续费授权', wxTitle: '手机授权', webTitle: '电脑授权', code: 'renew' }]
+                this.save({ saveFlag: false, url: '/package-basic-data/pages/activity/detail/detail?staffInfo=' + JSON.stringify(staffInfo) });
+            } else {
+                this.save({});
+            }
+        }
+    },
+    /**
+     * @desc : 改变用户授权数
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    changeUserSTD(e) {
+        let summaryInfo = this.data.summaryInfo
+        summaryInfo.wxMaxNum = e.detail
+        this.setData({
+            summaryInfo: summaryInfo
+        })
+        wx.nextTick(() => {
+            // 计算金额
+            this.countSummaryAmountSTD();
+        });
+
+    },
+    /**
+     * @desc : 校验
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    validData() {
+        // 专业版校验
+        if (this.data.gradeCode == Constants.gradeCode.PRO) {
+            // if (!this.data.readFlag) {
+            //     util.showToast('请勾选阅读须知');
+            //     return false;
+            // }
+            let curentAdItem = this.data.curentAdItem;
+            if (!curentAdItem) {
+                util.showToast('请选择活动');
+                return false
+            }
+            // 必须要选择一个授权
+            let staffCount = this.data.staffCount
+            if (!staffCount.maxNum && !staffCount.webMaxNum && !staffCount.wxMaxNum) {
+                util.showToast('请选择一个授权');
+                return false
+            }
+        } else {
+            let curentAdItem = this.data.curentAdItem;
+            if (!curentAdItem) {
+                util.showToast('请选择活动');
+                return false
+            }
+        }
+
+        return true;
+    },
+    /**
+     * @desc : 设置保存参数
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    setParams(params) {
+        let summaryInfo = this.data.summaryInfo
+        let curentAdItem = this.data.curentAdItem
+        let cpEndDate = this.data.cpEndDate
+        if (!summaryInfo || !cpEndDate) return;
+        params.endDate = summaryInfo.endDate
+        params.userEndDate = summaryInfo.userEndDate
+        params.gradeCode = this.data.gradeCode
+        params.cpId = app.globalData.company.cpId
+        params.tradeNo = this.generateRandomNo();
+        params.wxUserId = app.globalData.user.userId
+        params.tradeAmount = summaryInfo.amount
+        params.buyBeginDate = summaryInfo.buyBeginDate;
+        params.buyEndDate = summaryInfo.endDate
+        params.extendDays = summaryInfo.extendDays;
+        if (this.data.gradeCode == Constants.gradeCode.STD) {
+            params.buyEndDate = summaryInfo.userEndDate
+            params.endDate = app.globalData.company.endDate
+            params.wxMaxNum = summaryInfo.wxMaxNum
+            if (!summaryInfo.reCountFlag && summaryInfo.wxMaxNumSocial) {
+                params.wxMaxNum = summaryInfo.wxMaxNum + summaryInfo.wxMaxNumSocial
+            }
+            let funPackage = app.globalData.company.funPackage ? [...app.globalData.company.funPackage] : []
+            params.funPackage = funPackage
+            // 选中的功能包的数据
+            let activityIds = []
+            let itemIds = []
+            this.data.vipTable.forEach(it => {
+                if (it.chooseVipFlag) {
+                    activityIds.push(it.activityId)
+                    itemIds.push(it.itemId)
+                }
+            })
+            if (activityIds.length > 0) {
+                params.activityIds = activityIds
+                params.activityItemIds = itemIds
+            }
+            // 续费的时候需要传 
+            //  购买授权
+            if (this.data.buyUser) {
+                params.reNew = app.globalData.company.reNew
+            } else {
+                let funPackages = []
+                this.data.vipTable.forEach(it => {
+                    if (it.chooseVipFlag) {
+                        funPackages.push({
+                            activityId: it.activityId,
+                            funUuids: it.funUuids
+                        })
+                    }
+                })
+                let renew = {
+                    "user_end_date": this.data.userEndDate,
+                    "wx_max_num": summaryInfo.wxMaxNum + 1,
+                    "fun_package": funPackages.length > 0 ? funPackages : null,
+                }
+                params.reNew = renew
+                // 续费时候保持原来的 微信人数 
+                params.wxMaxNum = summaryInfo.wxMaxNumSocial
+            }
+            params.webMaxNum = 0
+            params.remarks = summaryInfo.amountInfo
+            //  交易类型-续费
+            params.tradeType = '交易类型-续费'
+        } else {
+            params.webMaxNum = summaryInfo.webMaxNum
+            params.wxMaxNum = summaryInfo.wxMaxNum
+        }
+        params.buyLong = curentAdItem.activityItemName
+        return params;
+    },
+    /**
+     * @desc : 保存数据
+     * @author : 周兴
+     * @date : 2024/5/17
+     */
+    saveData(params) {
+        return this.excute(this.data.service, this.data.service.reNewCompany, this.data.params).then(res => {
+            if (res.data.code == Constants.SUCESS_CODE) {
+                // 成功后跳转支付
+                this.toPay(res.data.data);
+            }
+        })
+    },
+    /**
+     * @desc : 查询当前用户授权数
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    getStaffCount() {
+        let service = app.globalData['commonService']
+        this.excute(service, service.selectUserCount, {}).then(res => {
+            if (res.data.code == Constants.SUCESS_CODE) {
+                if (res.data && res.data.data) {
+                    let currentUserCount = res.data.data;
+                    this.setData({
+                        currentUserCount: currentUserCount,
+                        //服务器的时间 
+                        currentDate: new Date(currentUserCount.currentDate)
+                    })
+                }
+            }
+            // 获取活动
+            this.getActivity()
+            this.setData({
+                loadFlag: true
+            })
+        });
+    },
+    /**
+     * @desc : 查询活动
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    getActivity() {
+        let params = {
+            appCode: Constants.APP_CODE,
+            activityStatus: Constants.kindCode.activityStatus,
+            cpId: app.globalData.company.cpId,
+            gradeCode: this.data.gradeCode
+        }
+        // 标准版
+        if (this.data.gradeCode == Constants.gradeCode.STD) {
+            if (this.data.buyUser) {
+                params.activityTypeList = [Constants.kindCode.activityGrade];
+            } else {
+                params.activityTypeList = [Constants.kindCode.activityGrade, Constants.kindCode.activityFunc];
+            }
+
+        } else {
+            params.activityTypeList = [Constants.kindCode.activityGrade, Constants.kindCode.activityVip];
+        }
+        let service = app.globalData['activityService']
+        this.excute(service, service.selectActivityItems, params).then(res => {
+            if (res.data.code == Constants.SUCESS_CODE) {
+                if (res.data && res.data.data) {
+                    let activityTable = res.data.data;
+
+                    // 如果是标准版,需要进行截止日期的处理
+                    if (this.data.gradeCode == Constants.gradeCode.STD) {
+                        this.setData({
+                            activityTable: activityTable.filter(it => it.activityType == Constants.kindCode.activityGrade),
+                            vipTable: activityTable.filter(it => it.activityType == Constants.kindCode.activityFunc),
+                        })
+                        this.handleDataStd(activityTable);
+                    } else {
+                        this.setData({
+                            activityTable: activityTable
+                        })
+                    }
+                }
+            }
+        });
+    },
+    /**
+     * @desc : 标准版处理数据
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    handleDataStd(activityTable) {
+        if (activityTable && activityTable.length > 0) {
+            let item = activityTable[0]
+            this.setData({
+                curentAdItem: item
+            })
+            let summaryInfo = this.data.summaryInfo
+            let months = item.validLong + item.extraLong
+            //服务器的时间  
+            let endDate = this.data.currentDate.addMonths(months).addDays(-1)
+            let dayDiffs = null;
+            if (summaryInfo.userEndDate) {
+                dayDiffs = new Date(summaryInfo.userEndDate).dayDiff(this.data.currentDate)
+            }
+            // 如果截止日期是空,就取活动中的截止日期
+            if (!summaryInfo.userEndDate || !dayDiffs || dayDiffs < 0) {
+                summaryInfo.userEndDate = endDate.toDateStr();
+                // 重新统计,到期续费或者第一次购买用户
+                summaryInfo.reCountFlag = true;
+                summaryInfo.wxMaxNum = summaryInfo.wxMaxNumSocial
+                this.setData({
+                    showVip: true
+                })
+            } else {
+                // 如果没有购买,需要显示
+                if (!app.globalData.company.vip) {
+                    this.setData({
+                        showVip: true
+                    })
+                }
+            }
+            summaryInfo.buyBeginDate = this.data.currentDate.toDateStr();
+
+            this.setData({
+                summaryInfo: summaryInfo
+            })
+            wx.nextTick(() => {
+                // 计算金额
+                this.countSummaryAmountSTD();
+            });
+        }
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+        console.log(options, "onLoad");
+        // 升级
+        if (options && options.upgrade) {
+            wx.setNavigationBarTitle({
+                title: mixins.$t('updateSpecialized'),
+            })
+            this.setData({
+                gradeCode: Constants.gradeCode.PRO,
+                upgradeFlag: true
+            })
+        } else {
+            // 购买授权 和续费
+            if (options.buyUser) {
+                wx.setNavigationBarTitle({
+                    title: mixins.$t('buyUser'),
+                })
+            } else {
+                wx.setNavigationBarTitle({
+                    title: mixins.$t('reNew'),
+                })
+            }
+
+            this.setData({
+                gradeCode: app.globalData.company.gradeCode,
+                buyUser: options.buyUser
+            })
+        }
+
+        this.setData({
+            companyName: app.globalData.company.cpName,
+            cpManager: app.globalData.company.cpManager,
+            cpPhone: app.globalData.company.cpPhone,
+            cpEndDate: app.globalData.company.endDate,
+            webMaxNum: app.globalData.company.webMaxNum,
+            wxMaxNum: app.globalData.company.wxMaxNum,
+        })
+        // 如果是标准版,需要获取用户授权数(手机)
+        let summaryInfo = {}
+        if (app.globalData.company.gradeCode == Constants.gradeCode.STD && !options.buyUser) {
+            summaryInfo.wxMaxNum = app.globalData.company.wxMaxNum
+            summaryInfo.reCountFlag = true
+        } else {
+            summaryInfo.wxMaxNum = 1
+        }
+
+        summaryInfo.wxMaxNumSocial = this.data.wxMaxNum
+        // 续费用户到期日期
+        summaryInfo.userEndDate = app.globalData.company.userEndDate
+        this.setData({
+            summaryInfo: summaryInfo,
+        })
+        // 获取活动
+        // this.getActivity();
+        // 获取当前用户授权数
+        this.getStaffCount();
+    },
+    /**
+     * 六大功能的切换
+     */
+    funcClick(e) {
+        let funcMenuFlg = !this.data.funcMenuFlg
+        if (funcMenuFlg) {
+            this.setData({
+                funcMenu: [
+                    {
+                        title: '订单开单',
+                        icon: 'btn-account-receivable.png',
+                    },
+                    {
+                        title: '销售出库',
+                        icon: 'btn-shipped.png',
+                    },
+                    {
+                        title: '销售退货',
+                        icon: 'btn-stored.png',
+                    },
+                    {
+                        title: '销售跟踪',
+                        icon: 'btn-shipped-out.png',
+                    },
+                    {
+                        title: '采购订单',
+                        icon: 'btn-account-receivable.png',
+                    },
+                    {
+                        title: '采购入库',
+                        icon: 'btn-shipped.png',
+                    },
+                    {
+                        title: '采购退货',
+                        icon: 'btn-stored.png',
+                    },
+                    {
+                        title: '以销定采',
+                        icon: 'btn-shipped-out.png',
+                    },
+                    {
+                        title: '库存查询',
+                        icon: 'btn-account-receivable.png',
+                    },
+                    {
+                        title: '入库办理',
+                        icon: 'btn-shipped.png',
+                    },
+                    {
+                        title: '出库办理',
+                        icon: 'btn-stored.png',
+                    },
+                    {
+                        title: '库存盘点',
+                        icon: 'btn-shipped-out.png',
+                    },
+                    {
+                        title: '资金账户',
+                        icon: 'btn-account-receivable.png',
+                    },
+                    {
+                        title: '资金转账',
+                        icon: 'btn-shipped.png',
+                    },
+                    {
+                        title: '收款单',
+                        icon: 'btn-stored.png',
+                    },
+                    {
+                        title: '付款单',
+                        icon: 'btn-shipped-out.png',
+                    },
+                    {
+                        title: '日结对账',
+                        icon: 'btn-account-receivable.png',
+                    },
+                    {
+                        title: '资金日记账',
+                        icon: 'btn-shipped.png',
+                    },
+                    {
+                        title: '供应商往来',
+                        icon: 'btn-stored.png',
+                    },
+
+                ],
+            })
+        } else {
+            this.setData({
+                funcMenu: [
+                    {
+                        title: '订单开单',
+                        icon: 'btn-account-receivable.png',
+                    },
+                    {
+                        title: '销售出库',
+                        icon: 'btn-shipped.png',
+                    },
+                    {
+                        title: '销售退货',
+                        icon: 'btn-stored.png',
+                    },
+                    {
+                        title: '销售跟踪',
+                        icon: 'btn-shipped-out.png',
+                    },
+                    {
+                        title: '采购订单',
+                        icon: 'btn-account-receivable.png',
+                    },
+                    {
+                        title: '采购入库',
+                        icon: 'btn-shipped.png',
+                    },
+                    {
+                        title: '采购退货',
+                        icon: 'btn-stored.png',
+                    },
+                    {
+                        title: '以销定采',
+                        icon: 'btn-shipped-out.png',
+                    },
+                ],
+            })
+        }
+
+        this.setData({
+            funcMenuFlg
+        })
+    },
+})

+ 3 - 0
package-basic-data/pages/activity/renew/renew.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 154 - 0
package-basic-data/pages/activity/renew/renew.wxml

@@ -0,0 +1,154 @@
+<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
+<van-dialog id="van-dialog" />
+<loading wx:if="{{loading}}"></loading>
+<view wx:if="{{loadFlag}}">
+	<!--公司信息-->
+	<view class="detail-top" data-item="{{item}}" bind:tap="toDetail">
+		<image class="scan-image" fit="fill" src="{{imageUrl+'/detail_sale_order.png'}}"></image>
+		<view style="display: flex;margin:20rpx 20rpx">
+			<!-- 头像 -->
+			<open-data type="userAvatarUrl" class='wx-avatar'></open-data>
+			<view style="margin-left: 30rpx;">
+				<view class="cp-class">{{companyName}}
+					<dk-tag style="margin-left: 20rpx;" type="primary" padding="0 10rpx" height="30rpx" color="linear-gradient(77.62deg, #CAA977 12.58%, #FFDA7A 85.49%),conic-gradient(from 154.5deg at 29.17% -8.33%, #FFE8BA -0.56deg, rgba(255, 230, 165, 0) 0.26deg, rgba(227, 184, 73, 0.34) 17.37deg, rgba(240, 187, 253, 0.23) 347.83deg, rgba(186, 234, 255, 0.38) 353.78deg, #FFE8BA 359.44deg, rgba(255, 230, 165, 0) 360.26deg);" textColor="#1B365D" radius="10rpx" fontSize="9px" value="{{gradeCode == 'STD'?$t['std']:$t['pro']}}" catchtap="expandCard" data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>
+				</view>
+				<view class="staff-class">{{cpManager + (cpPhone?(' | ' + cpPhone):'')}}</view>
+				<view class="end-date-class" wx:if="{{gradeCode != 'STD' && !upgradeFlag}}">{{$t['cpEndDate'] + ':' + cpEndDate}}</view>
+				<view class="staff-count-class" wx:if="{{gradeCode != 'STD'}}">{{'手机端授权:' + wxMaxNum + '个,电脑端授权' + (webMaxNum?webMaxNum:0) + '个' }}</view>
+				<view class="staff-count-class" wx:if="{{gradeCode == 'STD'}}">{{'手机端授权:' + (wxMaxNum ) + '个(含1个免费授权)'}}</view>
+			</view>
+		</view>
+	</view>
+
+	<!--活动(专业版)-->
+	<view class="func" wx:if="{{gradeCode != 'STD' && !funcMenuFlg}}">
+		<view style="display:flex;flex-wrap: wrap;">
+			<view class="{{(curentAdItem && curentAdItem.itemId == item.itemId)?'func-card-selected':'func-card'}}" wx:for="{{activityTable}}" wx:for-item="item" wx:key="index" data-item="{{item}}" catchtap="chooseAdItem">
+				<!-- 标题 -->
+				<view class="card-title">{{item.activityItemName}}
+				</view>
+				<!-- 价格-->
+				<dk-cell fontSize="16" center="center" contentFontWeight="700" contentColor="#FF7B1A" content="{{item.stdPrice}}"></dk-cell>
+				<!-- 描述-->
+				<view class="card-desc">{{item.activityItemDescribe}}
+				</view>
+			</view>
+		</view>
+	</view>
+
+	<!--活动(标准版)-->
+	<view class="func" wx:if="{{gradeCode == 'STD'}}">
+		<view style="display:flex;flex-wrap: wrap;">
+			<view class="func-card-std" wx:for="{{activityTable}}" wx:for-item="item" wx:key="index" data-item="{{item}}">
+				<!-- 标题 -->
+				<view class="card-title-std">{{item.activityItemName}}
+				</view>
+				<!-- 价格-->
+				<dk-cell fontSize="19" center="center" contentFontWeight="700" contentColor="#FF7B1A" content="{{item.wxPrice}}"></dk-cell>
+				<!-- 授权-->
+				<view class="card-desc-std">
+					<view style="font-size: 13px;">{{$t['userAuthorize']}}</view>
+					<view style="text-align: right;"><van-stepper integer="{{true}}" value="{{ summaryInfo.wxMaxNum}}" min="0" bind:change="changeUserSTD" /></view>
+					
+				</view>
+			</view>
+
+			<!--VIP报表-->
+			<view wx:if="{{showVip}}" class="{{item.chooseVipFlag?'func-card-vip-std-selected':'func-card-vip-std'}}" wx:for="{{vipTable}}" wx:for-item="item" wx:key="index" data-index="{{index}}" data-item="{{item}}" catchtap="chooseVipItem">
+				<!-- 标题 -->
+				<view class="card-title-std" style="text-align: center;">{{item.activityItemName?item.activityItemName:item.activityType}}
+				</view>
+				<!-- 价格-->
+				<dk-cell fontSize="19" center="center" contentFontWeight="700" contentColor="#FF7B1A" content="{{item.wxPrice}}"></dk-cell>
+				<!-- 描述-->
+				<view class="card-desc">{{item.activityItemDescribe}}
+				</view>
+			</view>
+		</view>
+	</view>
+
+	<!--用户数-->
+	<view class="card-class" wx:if="{{gradeCode != 'STD' && !funcMenuFlg}}">
+		<!--用户数量-->
+		<van-cell border="{{ false }}" title-class="cell_title">
+			<view slot="title" style="display: flex;">
+				<view>用户数量</view>
+				<view style="font-size: 10px;">(包含手机和电脑授权)</view>
+			</view>
+			<van-stepper value="{{staffCount.maxNum}}" integer="{{true}}" min="0" max="{{1000}}" data-type="all" bind:change="changeStaffCount" />
+		</van-cell>
+		<van-cell border="{{ false }}" title="额外购买授权">
+		</van-cell>
+		<!--手机用户数-->
+		<van-cell border="{{ false }}" title-class="cell_title">
+			<view slot="title" style="display: flex;">
+				<view>手机端授权</view>
+				<view wx:if="{{curentAdItem && curentAdItem.wxPrice}}" style="display: flex;font-size: 10px;">
+					(<dk-cell fontSize="10" left="5rpx" height="50rpx" contentColor="#e00808" content="{{curentAdItem.wxPrice}}"></dk-cell>/个)
+				</view>
+			</view>
+			<van-stepper value="{{staffCount.wxMaxNum}}" integer="{{true}}" min="0" max="{{1000}}" data-type="wx" bind:change="changeStaffCount" />
+		</van-cell>
+		<!--电脑用户数-->
+		<van-cell border="{{ false }}" title-class="cell_title">
+			<view slot="title" style="display: flex;">
+				<view>电脑端授权</view>
+				<view wx:if="{{curentAdItem && curentAdItem.webPrice}}" style="display: flex;font-size: 10px;">
+					(<dk-cell fontSize="10" left="5rpx" height="50rpx" contentColor="#e00808" content="{{ curentAdItem.webPrice }}"></dk-cell>/个)
+				</view>
+			</view>
+			<van-stepper value="{{staffCount.webMaxNum}}" integer="{{true}}" min="0" max="{{1000}}" data-type="web" bind:change="changeStaffCount" />
+		</van-cell>
+	</view>
+
+	<!--合计(专业版)-->
+	<view class="summary-class" wx:if="{{gradeCode != 'STD' && curentAdItem!=null && !funcMenuFlg}}">
+		<view class="summary-item-class">订单详情:</view>
+		<view class="summary-item-class">{{summaryInfo.amountInfo}}</view>
+		<view class="summary-item-class">截止日期:{{summaryInfo.endDate}}</view>
+		<view class="summary-item-class" wx:if="{{staffCount.maxNum || staffCount.webMaxNum || staffCount.wxMaxNum}}">{{summaryInfo.staffInfo}}</view>
+		<view class="summary-item-class" style="display: flex;justify-content: flex-end;" wx:if="{{staffCount.maxNum || staffCount.webMaxNum || staffCount.wxMaxNum}}">
+			折合<dk-cell fontSize="14" left="5rpx" fontWeight="bold" height="45rpx" contentColor="#FF7B1A" content="{{summaryInfo.priceInfo}}"></dk-cell>/天/授权</view>
+	</view>
+
+	<!--合计(标准版)-->
+	<view class="summary-class" wx:if="{{gradeCode == 'STD'}}">
+		<view class="summary-item-class">订单详情:</view>
+		<view class="summary-item-class">{{summaryInfo.amountInfo}}</view>
+		<view class="summary-item-class" style="display: flex;">截止日期:<view style="color:#FF7B1A">{{userEndDate}}</view>
+		</view>
+		<view class="summary-item-class" style="display: flex;justify-content: flex-end;" wx:if="{{buyUser && summaryInfo.wxMaxNum}}">
+			折合<dk-cell fontSize="14" left="5rpx" fontWeight="bold" height="45rpx" contentColor="#FF7B1A" content="{{summaryInfo.priceInfo}}"></dk-cell>/天/授权</view>
+	</view>
+
+	<!--注册须知 240704 去除 用功能模块代替-->
+	<!-- <view class="notice-class" wx:if="{{gradeCode != 'STD'}}">
+		<view class="notice-item-class" style="font-size: 16px;font-weight: bold;">{{noticeInfo.title}}</view>
+		<view class="notice-item-class">{{noticeInfo.cpName}}</view>
+		<view class="notice-item-class">{{noticeInfo.contact}}</view>
+		<view class="notice-item-class">{{noticeInfo.cpSize}}</view>
+		<view class="notice-item-class" style="display: flex;">
+			<van-checkbox shape="square" value="{{readFlag}}" label-class="checkbox-class" bind:change="handleChangeCheckbox">我已阅读并同意</van-checkbox>
+			<view style="color: #CE9965;">《注册须知》</view>
+			<view style="color: #CE9965;">《免责条款》</view>
+		</view>
+	</view> -->
+
+	<!--   功能模块 -->
+	<view class="notice-class" wx:if="{{upgradeFlag}}" catch:tap="funcClick">
+		<view class="notice-item-class" style="color: #FF7B1ACC; font-size: 16px;font-weight: bold;text-align: center;">{{noticeInfo.proTitle}}</view>
+		<view style="display: flex;flex-wrap: wrap;padding: 10rpx 0 20rpx 0;">
+			<view class="app-item" style="width:25%;text-align: center;margin-top: 15rpx;margin-bottom: 15rpx;" wx:for="{{funcMenu}}" wx:for-item="item"  wx:key="i">				 
+				<image src="{{imageUrl + item.icon }}" style="height: 85rpx;width:85rpx;"></image>
+				<view class="index-grid-item-text-class" style="font-size: 12px;">{{item.title}}</view>
+			</view>
+		</view>
+	</view>
+
+
+
+	<view style="height: 200rpx;"></view>
+</view>
+
+<!--  保存 -->
+<dk-save-button btnAutoWidthFlag="{{true}}" buttonList="{{buttonSaveList}}" bind:open="handleSave"></dk-save-button>

+ 331 - 0
package-basic-data/pages/activity/renew/renew.wxss

@@ -0,0 +1,331 @@
+page {
+	background: #F8F9FD;
+}
+
+.wx-avatar {
+	overflow: hidden;
+	display: block;
+	width: 80rpx;
+	height: 80rpx;
+	border-radius: 50%;
+	border: 1px solid #95a8cb;
+}
+
+.cp-class {
+	font-size: 16px;
+	font-weight: 600;
+	margin: 10rpx 0;
+	display: flex;
+	align-items: center;
+}
+
+.staff-class {
+	font-size: 14px;
+	margin: 10rpx 0;
+}
+
+.end-date-class {
+	color: #e00808;
+	font-size: 14px;
+	font-weight: 500;
+	margin-top: 20rpx;
+}
+
+.staff-count-class {
+	color: #CE9965;
+	font-size: 14px;
+	font-weight: 500;
+	margin-top: 10rpx;
+}
+
+.detail-top {
+	position: relative;
+	border: 1px solid #F3FBFF;
+	margin: 10px 32rpx 10px 32rpx;
+	background-color: #FFFF;
+	background: radial-gradient(61.26% 65.52% at 6.12% 18.49%, #CDD8FF 0%, #F3FAFF 100%);
+	padding: 20rpx;
+	border-radius: 16rpx;
+	color: #1B365D
+}
+
+.dk-card-outer-class-1 {
+	margin: 10px 32rpx 10px 32rpx;
+	margin-top: 10px;
+	border-radius: 15rpx;
+	/* box-shadow: 2px 2px 5px #e5e5e6; */
+}
+
+.detail-top-sup {
+	font-weight: bold;
+	font-size: 14px;
+	padding: 10rpx;
+}
+
+.detail-top-color {
+	font-weight: bold;
+	font-size: 14px;
+	padding: 10rpx;
+}
+
+.scan-image-icon {
+	width: 40rpx;
+	height: 40rpx;
+}
+
+.scan-image-icon-3 {
+	width: 96rpx;
+	height: 96rpx;
+	position: absolute;
+	right: 0;
+	bottom: 0;
+	border-radius: 0px 0px 16rpx 0px;
+}
+
+.scan-image {
+	width: 200rpx;
+	height: 200rpx;
+	position: absolute;
+	right: 0;
+	bottom: 0;
+	border-radius: 0px 0px 16rpx 0px;
+}
+
+.func {
+	width: 100%;
+	height: auto;
+	margin-bottom: 15rpx;
+	margin-top: 15rpx;
+}
+
+.func-card {
+	margin: 15rpx 1.15%;
+	width: 30.5%;
+	height: 215rpx;
+	background: #ffffff;
+	border-radius: 19rpx;
+}
+
+.func-card-selected {
+	margin: 15rpx 1.15%;
+	width: 30.5%;
+	height: 215rpx;
+	background: #FCF0DD;
+	border-radius: 19rpx;
+	border: 3rpx solid #CE9965;
+}
+
+.func-card-std {
+	margin: 15rpx 22rpx;
+	width: 95%;
+	height: 215rpx;
+	background: #FCF0DD;
+	border-radius: 19rpx;
+	border: 3rpx solid #CE9965;
+}
+
+.func-card-vip-std-selected {
+	margin: 15rpx 0rpx 15rpx 22rpx;
+	width: 29%;
+	height: 215rpx;
+	background: #FCF0DD;
+	border-radius: 19rpx;
+	border: 3rpx solid #CE9965;
+}
+
+.func-card-vip-std {
+	margin: 15rpx 0rpx 15rpx 22rpx;
+	width: 29%;
+	height: 215rpx;
+	background: #ffffff;
+	border-radius: 19rpx;
+}
+
+.card-name {
+	font-style: normal;
+	font-weight: 600;
+	font-size: 15px;
+	line-height: 48rpx;
+	margin-left: 16rpx;
+	color: #1B365D
+}
+
+.card-title {
+	margin-top: 10rpx;
+	display: flex;
+	height: 54rpx;
+	align-items: center;
+	justify-content: center;
+	width: 100%;
+	color: #1B365D;
+	font-size: 16px;
+	font-weight: 600;
+}
+
+.card-title-std {
+	margin-top: 10rpx;
+	margin-left: 20rpx;
+	display: flex;
+	height: 54rpx;
+	align-items: center;
+	width: 100%;
+	color: #1B365D;
+	font-size: 16px;
+	font-weight: 600;
+}
+
+.card-desc {
+	margin-top: 10rpx;
+	display: flex;
+	height: 54rpx;
+	align-items: center;
+	justify-content: center;
+	width: 100%;
+	color: #95A8CB;
+	font-size: 11px;
+}
+
+.card-desc-std { 
+	margin: 10rpx 20rpx;
+	display: flex;
+	height: 55rpx;
+	align-items: center;
+	justify-content: space-between;
+	color: #1B365D;
+	font-weight: bold;
+	font-size: 14px;
+}
+
+.card-class {
+	margin: 0 30rpx;
+	border-radius: 16rpx;
+	background: #ffffff;
+}
+
+.cell_title {
+	color: #e00808;
+}
+
+.summary-class {
+	margin: 0 30rpx;
+	margin-top: 30rpx;
+	padding: 10rpx 20rpx;
+	border-radius: 16rpx;
+	background: #ffffff;
+	color: #CE9965;
+	font-size: 14px;
+}
+
+.notice-class {
+	margin: 0 30rpx;
+	margin-top: 30rpx;
+	padding: 10rpx 20rpx;
+	border-radius: 16rpx;
+	background: #ffffff;
+	color: #1B365D;
+}
+
+.checkbox-class {
+	color: #1B365D !important;
+}
+
+.van-checkbox__icon--square {
+	border-radius: 10rpx;
+}
+
+.notice-item-class {
+	margin: 20rpx 0;
+	font-size: 14px;
+	font-weight: 400;
+}
+ 
+
+.summary-item-class {
+	margin: 8rpx 0;
+}
+
+.edit-image {
+	width: 50rpx;
+	height: 50rpx;
+	position: absolute;
+	right: 30rpx;
+	top: 20rpx;
+	border-radius: 0px 0px 16rpx 0px;
+}
+
+.tags-class {
+	margin: 20rpx;
+	/* text-align: center; */
+	display: flex;
+	justify-content: center;
+}
+
+.dk-card-outer-class-1 {
+	margin: 10px 32rpx 10px 32rpx;
+	margin-top: 10px;
+	border-radius: 15rpx;
+	/* box-shadow: 2px 2px 5px #e5e5e6; */
+}
+
+.btn-add-class {
+	background: #8091A9;
+	border-radius: 50%;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	padding: 20rpx;
+	box-shadow: 0px 17px 22px 0px #1B365D33;
+}
+
+
+
+.todo-view-app {
+	padding-top: 24rpx;
+	display: -webkit-box;
+	overflow: auto;
+	width: 100%;
+}
+
+.todo-view-app-item {
+	width: 25%;
+	display: grid;
+	justify-items: center;
+}
+
+.todo-view-app-item-icon {
+	width: 85rpx;
+	height: 85rpx;
+	/* background-color: #B280E4; */
+	display: flex;
+	align-items: center;
+	justify-content: center; 
+	position: relative;
+}
+
+.todo-view-app-item-icon-tip {
+	position: absolute;
+	width: 85rpx;
+	height: 85rpx;
+	top: -6rpx;
+	right: -6rpx;
+	font-size: 9px;
+	font-family: 'PingFang SC';
+	background: #FF594E;
+	border: 1px solid #FFFFFF;
+	border-radius: 50%;
+	color: #fff;
+	text-align: center;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+}
+
+.todo-view-app-item-name {
+	font-style: normal;
+	font-weight: 400;
+	font-size: 14px;
+	font-family: 'PingFang SC';
+	/* font-family: 'SimSun'; */
+	color: #1B365D;
+	margin-top: 10rpx;
+}

+ 1 - 1
pages/company/company.js

@@ -263,7 +263,7 @@ Page({
         let item = e.currentTarget.dataset.item
         // 记录登录的缓存
         app.globalData.company = item
-        let url = '/package-basic-data/pages/activity/activity'
+        let url = '/package-basic-data/pages/activity/renew/renew'
         wx.navigateTo({
             url: url,
             events: {

+ 1 - 1
pages/mine/mine.js

@@ -292,7 +292,7 @@ Page({
       util.showToast('无权续费,请联系责任人')
       return
     }
-    let url = '/package-basic-data/pages/activity/activity'
+    let url = '/package-basic-data/pages/activity/renew/renew'
     wx.navigateTo({
       url: url,
       events: {