会员权益

This commit is contained in:
2026-04-29 15:33:58 +08:00
commit 54965243da
2787 changed files with 242809 additions and 0 deletions

View File

@@ -0,0 +1,180 @@
<!-- 组件-确认弹窗 开发者: 麦沃德科技-半夏 -->
<template>
<view class="component-modal-confirm">
<uni-popup ref="popup" type="center" @change="onChange">
<view class="modal-confirm" :style="{width: editable ? '688rpx' : '544rpx'}">
<view class="confirm-title" v-if="title">{{title}}</view>
<view class="confirm-input" v-if="editable">
<textarea class="textarea" v-model="inputData" :placeholder="placeholderText" :placeholder-class="placeholder" />
</view>
<view class="confirm-content" v-else>
<rich-text :nodes="content"></rich-text>
</view>
<view class="confirm-footer">
<view class="footer-btn" :style="{color: cancelColor}" v-if="showCancel" @click="handleCancel()">{{cancelText}}</view>
<view class="footer-btn" :style="{color: confirmColor}" @click="handleConfirm()">{{confirmText}}</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
// 模态框标题
title: "",
// 模态框内容
content: "",
// 是否显示取消按钮
showCancel: true,
// 取消按钮文字
cancelText: "取消",
// 取消按钮颜色
cancelColor: "#8D929C",
// 确认按钮文字
confirmText: "确定",
// 确认按钮颜色
confirmColor: "#DE2828",
// 是否显示输入框
editable: false,
// 显示输入框时的提示文本
placeholderText: "请输入",
// 回调函数
callback: null,
// 输入内容
inputData: "",
}
},
methods: {
// 打开弹窗
open(e) {
this.title = e.title || ""
this.content = e.content || ""
this.showCancel = e.showCancel === false ? false : true
this.cancelText = e.cancelText || "取消"
this.cancelColor = e.cancelColor || "#8D929C"
this.confirmText = e.confirmText || "确定"
this.confirmColor = e.confirmColor || "#325DFF"
this.editable = e.editable || false
this.placeholderText = e.placeholderText || "请输入"
this.callback = e.success
this.inputData = ""
this.$refs.popup.open()
},
// 改变事件
onChange(e) {
this.$emit("onChange", e.show)
},
// 取消按钮
handleCancel() {
if (this.callback) {
this.callback({
cancel: true,
})
}
this.$refs.popup.close()
},
// 确认按钮
handleConfirm() {
if (this.callback) {
if (this.editable) {
if (!this.inputData) {
uni.showToast({
icon: "none",
title: this.placeholderText
})
return
}
this.callback({
confirm: true,
content: this.inputData
})
this.$refs.popup.close()
} else {
this.callback({
confirm: true
})
this.$refs.popup.close()
}
} else {
this.$refs.popup.close()
}
},
},
}
</script>
<style lang="scss">
.component-modal-confirm {
position: relative;
z-index: 999;
.modal-confirm {
width: 544rpx;
max-width: 92vw;
border-radius: 16rpx;
background: #FFF;
padding-top: 32rpx;
.confirm-title {
color: #5A5B6E;
font-size: 32rpx;
font-weight: 600;
line-height: 44rpx;
padding: 0 32rpx 16rpx;
text-align: center;
}
.confirm-content {
padding: 32rpx 48rpx 64rpx;
color: #5A5B6E;
text-align: center;
font-size: 32rpx;
line-height: 44rpx;
white-space: pre-wrap;
}
.confirm-input {
padding: 16rpx 32rpx 32rpx;
.textarea {
padding: 32rpx;
border-radius: 16rpx;
background: #F6F7FB;
width: 100%;
box-sizing: border-box;
height: 240rpx;
color: #5A5B6E;
font-size: 28rpx;
line-height: 40rpx;
}
.placeholder {
color: #8D929C;
}
}
.confirm-footer {
border-top: 1px solid #E5E5E5;
display: flex;
.footer-btn {
flex: 1;
width: 50%;
padding: 28rpx 20rpx;
text-align: center;
font-size: 32rpx;
line-height: 48rpx;
border-left: 1px solid #E5E5E5;
&:first-child {
border-left: none;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,204 @@
<!-- +----------------------------------------------------------------------
| 麦沃德科技赋能开发者助力商协会发展
+----------------------------------------------------------------------
| Copyright (c) 20172024 www.wdsxh.cn All rights reserved.
+----------------------------------------------------------------------
| 沃德商协会系统并不是自由软件不加密并不代表开源未经许可不可自由转售和商用
+----------------------------------------------------------------------
| Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
+----------------------------------------------------------------------
| 组件-级别选择弹窗 开发者: 麦沃德科技-半夏
+---------------------------------------------------------------------- -->
<template>
<view class="component-modal-level" @click.stop>
<uni-popup ref="popupModal" type="bottom" :safe-area="false" @change="onChange">
<view class="popup-box" :style="{'--theme-color': themeColor}">
<view class="popup-header">
<view class="title">会员级别</view>
<image class="close" src="/static/close.png" mode="aspectFit" @click="onClose"></image>
</view>
<view class="popup-content flex-direction-column">
<scroll-view scroll-y class="contetnt-scroll flex-item">
<view class="scroll-list flex flex-wrap">
<view class="list-item" :class="{active: selectItem.includes(item)}" v-for="item in levelList" :key="item.id" @click="selectLevel(item)">{{item.name}}</view>
</view>
</scroll-view>
</view>
<view class="popup-btn">
<view class="btn" @click="onReset">重置</view>
<view class="btn confirm" @click="onConfirm">确认</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import { mapState } from "vuex"
export default {
name: "modalLevel",
data() {
return {
// 级别列表
levelList: [],
// 已选项目
selectItem: [],
};
},
computed: {
...mapState({
themeColor: state => state.app.themeColor,
})
},
methods: {
// 打开模态框
open(value) {
this.levelList = []
this.getLevelList(value)
this.$refs.popupModal.open()
},
// 获取级别数据
getLevelList(value) {
// 获取会员级别
this.$util.request("member.level").then(res => {
if (res.code == 1) {
this.levelList = res.data
this.selectItem = []
for (let i in this.levelList) {
for (let j in value) {
if (this.levelList[i].id == value[j].id) {
this.selectItem.push(this.levelList[i])
}
}
}
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
}).catch(error => {
console.error('获取会员级别 ', error)
})
},
// 选择级别
selectLevel(item) {
if (this.selectItem.includes(item)) {
this.$delete(this.selectItem, this.selectItem.indexOf(item))
} else {
this.selectItem.push(item)
}
},
// 关闭弹窗
onClose() {
this.$refs.popupModal.close()
},
// 重置
onReset() {
this.selectItem = []
this.$emit("callback", [])
this.onClose()
},
// 确认
onConfirm() {
this.$emit("callback", this.selectItem)
this.onClose()
},
// 改变事件
onChange(e) {
this.$emit("onChange", e.show)
},
},
}
</script>
<style lang="scss">
.component-modal-level {
position: relative;
z-index: 999;
.popup-box {
background: #FFFFFF;
border-radius: 40rpx 40rpx 0 0;
padding-top: 32rpx;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.popup-header {
display: flex;
align-items: center;
padding: 0 32rpx 0 64rpx;
.title {
color: #333;
text-align: center;
font-size: 32rpx;
font-weight: 600;
line-height: 44rpx;
flex: 1;
}
.close {
width: 32rpx;
height: 32rpx;
}
}
.popup-content {
padding: 12rpx 32rpx 32rpx;
height: 60vh;
.contetnt-scroll {
overflow: hidden;
padding: 0 12rpx;
.scroll-list {
margin-left: -32rpx;
.list-item {
margin-top: 32rpx;
color: #666666;
font-size: 28rpx;
line-height: 40rpx;
text-align: center;
padding: 16rpx;
min-width: 200rpx;
border-radius: 10rpx;
background: #F6F7FB;
margin-left: 32rpx;
&.active {
background: var(--theme-color);
color: #ffffff;
}
}
}
}
}
.popup-btn {
display: flex;
justify-content: space-between;
border-top: 1rpx solid #F6F7FB;
padding: 16rpx 32rpx;
.btn {
width: 48%;
color: #666666;
font-size: 28rpx;
line-height: 40rpx;
padding: 20rpx;
border-radius: 10rpx;
background: #F0F0F0;
text-align: center;
&.confirm {
color: #FFFFFF;
background: var(--theme-color);
}
}
}
}
}
</style>

View File

@@ -0,0 +1,328 @@
<!-- +----------------------------------------------------------------------
| 麦沃德科技赋能开发者助力商协会发展
+----------------------------------------------------------------------
| Copyright (c) 20172024 www.wdsxh.cn All rights reserved.
+----------------------------------------------------------------------
| 沃德商协会系统并不是自由软件不加密并不代表开源未经许可不可自由转售和商用
+----------------------------------------------------------------------
| Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
+----------------------------------------------------------------------
| 组件-地区选择弹窗 开发者: 麦沃德科技-半夏
+---------------------------------------------------------------------- -->
<template>
<view class="component-modal-region" @click.stop>
<uni-popup ref="popupModal" type="bottom" :safe-area="false" @change="onChange">
<view class="popup-box" :style="{'--theme-color': themeColor}">
<view class="popup-header">
<view class="title">地区选择</view>
<image class="close" src="/static/close.png" mode="aspectFit" @click="onClose"></image>
</view>
<view class="popup-content flex-direction-column">
<view class="contetnt-select flex">
<view class="select-item flex" @click="selectProvince = '';selectCity = '';selectArea = '';">
<view class="item-title"></view>
<view class="item-value">{{selectProvince || "请选择"}}</view>
</view>
<view class="select-item flex" @click="selectCity = '';selectArea = '';">
<view class="item-title"></view>
<view class="item-value">{{selectCity || "请选择"}}</view>
</view>
<view class="select-item flex">
<view class="item-title">/</view>
<view class="item-value" v-if="selectCity">{{selectArea || "全部"}}</view>
<view class="item-value" v-else>请选择</view>
</view>
</view>
<scroll-view scroll-y class="contetnt-city flex-item">
<view class="city-list">
<block v-if="provinceList.length && !selectProvince">
<view class="list-item" v-for="(item, index) in provinceList" :key="index" @click="changeProvince(item.id, item.name)">{{item.name}}</view>
</block>
<block v-if="cityList.length && !selectCity">
<view class="list-item" v-for="(item, index) in cityList" :key="index" @click="changeCity(item.id, item.name)">{{item.name}}</view>
</block>
<block v-if="areaList.length">
<view class="list-item" :class="{active: selectArea == ''}" @click="changeArea('')">全部</view>
<view class="list-item" :class="{active: selectArea == item.name}" v-for="(item, index) in areaList" :key="index" @click="changeArea(item.name)">{{item.name}}</view>
</block>
</view>
<view class="city-empty" v-if="!provinceList.length && !cityList.length && !areaList.length">暂无相关数据</view>
</scroll-view>
</view>
<view class="popup-btn">
<view class="btn" @click="onReset">重置</view>
<view class="btn confirm" @click="onConfirm">确认</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import { mapState } from "vuex"
export default {
name: "modalRegion",
data() {
return {
// 省份列表
provinceList: [],
// 城市列表
cityList: [],
// 区县列表
areaList: [],
// 已选省份
selectProvince: "",
// 已选城市
selectCity: "",
// 已选区县
selectArea: "",
};
},
computed: {
...mapState({
themeColor: state => state.app.themeColor,
})
},
methods: {
// 打开模态框
open(value) {
this.provinceList = []
this.cityList = []
this.areaList = []
this.selectProvince = value.province || ""
this.selectCity = value.city || ""
this.selectArea = value.area || ""
this.getProvinceList()
this.$refs.popupModal.open()
},
// 获取省份数据
getProvinceList() {
this.$util.request("main.address.province").then(res => {
if (res.code == 1) {
this.provinceList = res.data.data
for (let i in this.provinceList) {
if (this.provinceList[i].name == this.selectProvince) {
this.getCityList(this.provinceList[i].id)
break;
}
}
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
}).catch(error => {
console.error('获取省份数据 ', error)
})
},
// 获取城市数据
getCityList(id) {
this.$util.request("main.address.city", {
crea_id: id
}).then(res => {
if (res.code == 1) {
this.cityList = res.data.data
for (let i in this.cityList) {
if (this.cityList[i].name == this.selectCity) {
this.getAreaList(this.cityList[i].id)
break;
}
}
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
}).catch(error => {
console.error('获取城市数据 ', error)
})
},
// 获取区县数据
getAreaList(id) {
this.$util.request("main.address.area", {
crea_id: id
}).then(res => {
if (res.code == 1) {
this.areaList = res.data.data
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
}).catch(error => {
console.error('获取区县数据 ', error)
})
},
// 关闭弹窗
onClose() {
this.$refs.popupModal.close()
},
// 重置
onReset() {
this.cityList = []
this.areaList = []
this.selectProvince = ""
this.selectCity = ""
this.selectArea = ""
this.$emit("callback", {
province: "",
city: "",
area: "",
})
this.onClose()
},
// 选择省份
changeProvince(id, name) {
this.selectProvince = name
this.getCityList(id)
},
// 选择城市
changeCity(id, name) {
this.selectCity = name
this.getAreaList(id)
},
// 选择区县
changeArea(name) {
this.selectArea = name
},
// 确认
onConfirm() {
if (this.selectProvince && this.selectCity) {
this.$emit("callback", {
province: this.selectProvince,
city: this.selectCity,
area: this.selectArea,
})
} else {
this.$emit("callback", {})
}
this.onClose()
},
// 改变事件
onChange(e) {
this.$emit("onChange", e.show)
},
},
}
</script>
<style lang="scss">
.component-modal-region {
position: relative;
z-index: 999;
.popup-box {
background: #FFFFFF;
border-radius: 40rpx 40rpx 0 0;
padding: 32rpx 32rpx 0;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.popup-header {
display: flex;
align-items: center;
padding-left: 32rpx;
.title {
color: #333;
text-align: center;
font-size: 32rpx;
font-weight: 600;
line-height: 44rpx;
flex: 1;
}
.close {
width: 32rpx;
height: 32rpx;
}
}
.popup-content {
padding: 32rpx 0;
height: 65vh;
.contetnt-select {
margin-top: 16rpx;
.select-item {
margin-left: 32rpx;
&:first-child {
margin-left: 0;
}
.item-title {
color: #333;
font-size: 28rpx;
line-height: 50rpx;
}
.item-value {
color: var(--theme-color);
font-size: 28rpx;
line-height: 50rpx;
}
}
}
.contetnt-city {
padding-top: 32rpx;
overflow: hidden;
.city-list {
.list-item {
margin-top: 32rpx;
color: #333;
font-size: 28rpx;
line-height: 50rpx;
&.active {
color: var(--theme-color);
}
&:first-child {
margin-top: 0;
}
}
}
.city-empty {
padding: 48rpx 0 24rpx;
color: #A0A2B3;
text-align: center;
font-size: 28rpx;
line-height: 40rpx;
}
}
}
.popup-btn {
display: flex;
justify-content: space-between;
border-top: 1rpx solid #F6F7FB;
padding: 16rpx 32rpx;
.btn {
width: 48%;
color: #666666;
font-size: 28rpx;
line-height: 40rpx;
padding: 20rpx;
border-radius: 10rpx;
background: #F0F0F0;
text-align: center;
&.confirm {
color: #FFFFFF;
background: var(--theme-color);
}
}
}
}
}
</style>