|
|
@@ -20,14 +20,18 @@ Page({
|
|
|
companyName: null,
|
|
|
staffName: null,
|
|
|
staffPhone: null,
|
|
|
- staffCount: 10,
|
|
|
- canLoginStaffCount: 3,
|
|
|
+ webMaxNum: app.globalData.company.webMaxNum,
|
|
|
+ wxMaxNum: app.globalData.company.wxMaxNum,
|
|
|
cpEndDate: null,
|
|
|
- activityTable:null,
|
|
|
- wxStaffCount:0,
|
|
|
- webStaffCount:0,
|
|
|
- curentAdItem:null,
|
|
|
- summaryInfo:{},
|
|
|
+ activityTable: null,
|
|
|
+ readFlag:false,
|
|
|
+ staffCount: {
|
|
|
+ maxNum: 1,
|
|
|
+ webMaxNum: 0,
|
|
|
+ wxMaxNum: 0
|
|
|
+ },
|
|
|
+ curentAdItem: null,
|
|
|
+ summaryInfo: {},
|
|
|
// 主键Id
|
|
|
primaryKey: 'orderId',
|
|
|
routeObjName: 'order',
|
|
|
@@ -36,25 +40,91 @@ Page({
|
|
|
buttonSaveList: [
|
|
|
{ code: 'save', title: mixins.$t('save'), width: '120rpx' }
|
|
|
],
|
|
|
+ noticeInfo:{
|
|
|
+ title:'注册须知:',
|
|
|
+ cpName:'用于登录系统时显示公司信息。',
|
|
|
+ contact:'负责人和联系电话:用于开通系统电话确认核实信息。',
|
|
|
+ cpSize:'公司规模及门店规模:用于开通系统配置基础档案。'
|
|
|
+ }
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 选择活动明细
|
|
|
* @author : 周兴
|
|
|
* @date : 2024/4/1
|
|
|
*/
|
|
|
- chooseAdItem(e){
|
|
|
- console.log('rrr',e);
|
|
|
+ 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
|
|
|
endDate = new Date(endDate).addMonths(months)
|
|
|
- let summaryInfo = this.data.summaryInfo
|
|
|
summaryInfo.endDate = endDate.toDateStr();
|
|
|
- console.log('f',summaryInfo);
|
|
|
+ console.log('f', summaryInfo);
|
|
|
+ this.setData({
|
|
|
+ curentAdItem: item,
|
|
|
+ summaryInfo: summaryInfo
|
|
|
+ })
|
|
|
+ // 计算金额
|
|
|
+ this.countSummaryAmount(item);
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 计算金额
|
|
|
+ * @author : 周兴
|
|
|
+ * @date : 2024/4/1
|
|
|
+ */
|
|
|
+ countSummaryAmount() {
|
|
|
+ let item = this.data.curentAdItem;
|
|
|
+ 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 + '(元)'
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ summaryInfo: summaryInfo
|
|
|
+ })
|
|
|
+ // 统计两端用户数
|
|
|
+ this.countStaffInfo();
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @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 + '个(包含当前用户)'
|
|
|
this.setData({
|
|
|
- curentAdItem:item,
|
|
|
summaryInfo:summaryInfo
|
|
|
})
|
|
|
},
|
|
|
@@ -63,26 +133,30 @@ Page({
|
|
|
* @author : 周兴
|
|
|
* @date : 2024/4/1
|
|
|
*/
|
|
|
- changeStaffCount(e){
|
|
|
+ changeStaffCount(e) {
|
|
|
+ let staffCount = this.data.staffCount
|
|
|
let ds = e.currentTarget.dataset
|
|
|
- if(ds.type == 'wx'){
|
|
|
- this.setData({
|
|
|
- wxStaffCount:e.detail
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.setData({
|
|
|
- webStaffCount:e.detail
|
|
|
- })
|
|
|
+ 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
|
|
|
*/
|
|
|
- validData(){
|
|
|
+ validData() {
|
|
|
let curentAdItem = this.data.curentAdItem;
|
|
|
- if(!curentAdItem){
|
|
|
+ if (!curentAdItem) {
|
|
|
util.showToast('未选择活动');
|
|
|
return false
|
|
|
}
|
|
|
@@ -96,7 +170,7 @@ Page({
|
|
|
getActivity() {
|
|
|
let params = {
|
|
|
appCode: Constants.APP_CODE,
|
|
|
- activityTypeList:[Constants.kindCode.activityGrade,Constants.kindCode.activityMenu],
|
|
|
+ activityTypeList: [Constants.kindCode.activityGrade, Constants.kindCode.activityMenu],
|
|
|
gradeCode: app.globalData.company.gradeCode
|
|
|
}
|
|
|
let service = app.globalData['activityService']
|
|
|
@@ -105,7 +179,7 @@ Page({
|
|
|
if (res.data && res.data.data) {
|
|
|
let activityTable = res.data.data;
|
|
|
this.setData({
|
|
|
- activityTable:activityTable
|
|
|
+ activityTable: activityTable
|
|
|
})
|
|
|
}
|
|
|
}
|