Quellcode durchsuchen

1、修改续费

zhoux vor 1 Jahr
Ursprung
Commit
9040ecc266

+ 100 - 26
package-basic-data/pages/activity/activity.js

@@ -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
                     })
                 }
             }

+ 46 - 11
package-basic-data/pages/activity/activity.wxml

@@ -11,18 +11,18 @@
 			<view class="cp-class">{{companyName}}</view>
 			<view class="staff-class">{{staffName + (staffPhone?(' | ' + staffPhone):'')}}</view>
 			<view class="end-date-class">{{$t['cpEndDate'] + ':' + cpEndDate}}</view>
-			<view class="staff-count-class">{{'用户数:' + staffCount + '个,其中' + canLoginStaffCount + '个可登录系统' }}</view>
+			<view class="staff-count-class">{{'手机端授权:' + wxMaxNum + '个,电脑端授权' + webMaxNum + '个' }}</view>
 		</view>
 	</view>
 </view>
 <view class="func">
 	<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="{{(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.salePrice}}"></dk-cell>
+			<dk-cell fontSize="16" center="center" contentFontWeight="700" contentColor="#FF7B1A" content="{{item.stdPrice}}"></dk-cell>
 			<!-- 描述-->
 			<view class="card-desc">{{item.activityItemDescribe}}
 			</view>
@@ -32,25 +32,60 @@
 
 <!--用户数-->
 <view class="card-class">
+	<!--用户数量-->
+	<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" title="手机用户数" >
-		<van-stepper value="{{wxStaffCount}}" integer="{{true}}" min="0" max="{{1000}}" data-type="wx" bind:change="changeStaffCount"  />
+	<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" title="电脑用户数" >
-		<van-stepper value="{{webStaffCount}}" integer="{{true}}" min="0" max="{{1000}}" data-type="web" bind:change="changeStaffCount"  />
+	<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" >
-	<view class="summary-item-class">订单总价</view>
-	<view class="summary-item-class">4000</view>
+<view class="summary-class">
+	<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">可配置信息</view>
+	<view class="summary-item-class" wx:if="{{staffCount.maxNum || staffCount.webMaxNum || staffCount.wxMaxNum}}">{{summaryInfo.staffInfo}}</view>
 </view>
 
+<!--注册须知-->
+<view class="notice-class">
+	<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">我已阅读并同意</van-checkbox>
+		<view style="color: #CE9965;">《注册须知》</view>
+		<view style="color: #CE9965;">《免责条款》</view>
+	</view>
+</view>
 
+<view style="height: 200rpx;"></view>
 
 <!--  保存 -->
 <dk-save-button btnAutoWidthFlag="{{true}}" buttonList="{{buttonSaveList}}" bind:open="save"></dk-save-button>

+ 23 - 0
package-basic-data/pages/activity/activity.wxss

@@ -165,6 +165,29 @@ page {
 	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;
 }