浏览代码

个人/企业中心 修改用户会员

cornyuan 7 月之前
父节点
当前提交
f114616b2c
共有 2 个文件被更改,包括 126 次插入10 次删除
  1. 58 0
      src/views/user/userList.vue
  2. 68 10
      src/views/user/userListQy.vue

+ 58 - 0
src/views/user/userList.vue

@@ -589,6 +589,21 @@
     			<el-radio :label="2">减少</el-radio>
     		</el-radio-group>
     	</div> -->
+			<div style="margin-bottom: 20px;position: relative;">
+				<div style="width: 200px;display: inline-block;text-align: right;position: absolute;top: 0;">会员种类:</div>
+				<div class="ruleitem" style="display: inline-block;margin-left: 205px;">
+						<span><el-radio v-for="(item,index) in vipData" :key="index" v-model="vipId"
+								:label="item.id">{{item.vipName}}</el-radio></span>
+				</div>
+			</div>
+			<div style="margin-bottom: 20px;">
+				<span style="width: 200px;display: inline-block;text-align: right;">会员等级:</span>
+				<el-radio-group v-model="vipNameType">
+					<el-radio :label="0">月会员</el-radio>
+					<el-radio :label="1">季会员</el-radio>
+					<el-radio :label="2">年会员</el-radio>
+				</el-radio-group>
+			</div>
 			<div style="margin-bottom: 10px;">
 				<span style="width: 200px;display: inline-block;text-align: right;">修改天数:</span>
 				<el-input style="width:50%;" v-model="proportion" type="number" :min="0" :controls="false"
@@ -689,6 +704,9 @@
 				isVip: '',
 				type: 1,
 				proportion: '',
+				vipData: [],
+				vipId: '',
+				vipNameType: 0,
 				// inviterCodeT: '',
 				// invitationCodeT: '',
 			}
@@ -794,6 +812,32 @@
 				// }
 				
 			},
+			// 获取会员类型
+			classSelectVipType() {
+				this.$http({
+					url: this.$http.adornUrl('vipDetails/selectVipDetailsList'),
+					method: 'get',
+					params: this.$http.adornParams({
+
+					})
+				}).then(({
+					data
+				}) => {
+					if (data.code == 0) {
+						this.tableDataLoading = false
+						let returnData = data.data
+						this.vipData = returnData.list
+					} else {
+						this.$notify({
+							title: '提示',
+							duration: 1800,
+							message: data.msg,
+							type: 'warning'
+						});
+					}
+
+				})
+			},
 			handleClick(tab, event) {
 				this.page = 1
 				this.campus = ''
@@ -1351,9 +1395,21 @@
 				this.proportion = ''
 				this.userIdss = row.userId
 				this.dialogFormVisibleZs = true
+				this.vipId=''
+				this.vipNameType = 0
+				this.classSelectVipType()
 			},
 			// 设置会员
 			updateVip(row) {
+				if (this.vipId == '') {
+					this.$notify({
+						title: '提示',
+						duration: 1800,
+						message: '请选择会员种类',
+						type: 'warning'
+					});
+					return
+				}
 				if (this.proportion === '') {
 					this.$notify({
 						title: '提示',
@@ -1370,6 +1426,8 @@
 						'userId': this.userIdss,
 						'num': this.proportion,
 						'vipType': 1,
+						'vipId': this.vipId,
+						'vipNameType': this.vipNameType,
 						// 'type':this.type
 					})
 				}).then(({

+ 68 - 10
src/views/user/userListQy.vue

@@ -504,6 +504,21 @@
     			<el-radio :label="2">减少</el-radio>
     		</el-radio-group>
     	</div> -->
+		<div style="margin-bottom: 20px;position: relative;">
+				<div style="width: 200px;display: inline-block;text-align: right;position: absolute;top: 0;">会员种类:</div>
+				<div class="ruleitem" style="display: inline-block;margin-left: 205px;">
+						<span><el-radio v-for="(item,index) in vipData" :key="index" v-model="vipId"
+								:label="item.id">{{item.vipName}}</el-radio></span>
+				</div>
+			</div>
+			<div style="margin-bottom: 20px;">
+				<span style="width: 200px;display: inline-block;text-align: right;">会员等级:</span>
+				<el-radio-group v-model="vipNameType">
+					<el-radio :label="0">月会员</el-radio>
+					<el-radio :label="1">季会员</el-radio>
+					<el-radio :label="2">年会员</el-radio>
+				</el-radio-group>
+			</div>
     	<div style="margin-bottom: 10px;">
     		<span style="width: 200px;display: inline-block;text-align: right;">修改天数:</span>
     		<el-input style="width:50%;" v-model="proportion" type="number" :min="0" :controls="false"
@@ -603,6 +618,9 @@
 				isVip:'',
 				type:1,
 				proportion:'',
+				vipData: [],
+				vipId: '',
+				vipNameType: 0,
 				// inviterCodeT: '',
 				// invitationCodeT: '',
 			}
@@ -705,6 +723,32 @@
 				// 	}
 				// })
 			},
+			// 获取会员类型
+			classSelectVipType() {
+				this.$http({
+					url: this.$http.adornUrl('vipDetails/selectVipDetailsList'),
+					method: 'get',
+					params: this.$http.adornParams({
+
+					})
+				}).then(({
+					data
+				}) => {
+					if (data.code == 0) {
+						this.tableDataLoading = false
+						let returnData = data.data
+						this.vipData = returnData.list
+					} else {
+						this.$notify({
+							title: '提示',
+							duration: 1800,
+							message: data.msg,
+							type: 'warning'
+						});
+					}
+
+				})
+			},
 			handleClick(tab, event) {
 				this.page = 1
 				this.campus = ''
@@ -1188,25 +1232,39 @@
       	this.proportion = ''
       	this.userIdss = row.userId
       	this.dialogFormVisibleZs = true
+		this.vipId=''
+		this.vipNameType = 0
+		this.classSelectVipType()
       },
       // 设置会员
       updateVip(row){
-      if (this.proportion === '') {
-      	this.$notify({
-      		title: '提示',
-      		duration: 1800,
-      		message: '请输入天数',
-      		type: 'warning'
-      	});
-      	return
-      }
+		if (this.vipId == '') {
+				this.$notify({
+					title: '提示',
+					duration: 1800,
+					message: '请选择会员种类',
+					type: 'warning'
+				});
+				return
+			}
+		if (this.proportion === '') {
+			this.$notify({
+				title: '提示',
+				duration: 1800,
+				message: '请输入天数',
+				type: 'warning'
+			});
+			return
+		}
       	this.$http({
       		url: this.$http.adornUrl('vipDetails/giveUserVip'),
       		method: 'post',
       		params: this.$http.adornParams({
       			'userId':this.userIdss,
       			'num':this.proportion,
-            'vipType':2,
+            	'vipType':2,
+				'vipId': this.vipId,
+				'vipNameType': this.vipNameType,
       			// 'type':this.type
       		})
       	}).then(({