| | |
| | | <template> |
| | | <div class="verify-content" v-if="show" @mousemove="mouseMove" @mouseup="mouseUp" @click.stop> |
| | | <div class="verify-content" v-if="show" @mousemove="mouseMove" @mouseup="mouseUp" @touchmove="touchMove" @touchend="touchEnd" @click.stop> |
| | | <div class="imgBox" :style="{width:data.originalWidth+'px',height:data.originalHeight + 'px'}"> |
| | | <img :src="data.backImage" style="width:100%;height:100%" alt=""> |
| | | <img class="slider" :src="data.slidingImage" :style="{left:distance+'px',top:data.randomY+'px'}" :width="data.sliderWidth" :height="data.sliderHeight" alt=""> |
| | |
| | | </div> |
| | | <div class="handle" :style="{width:data.originalWidth+'px'}"> |
| | | <span class="bgcolor" :style="{width:distance + 'px',background:bgColor}"></span> |
| | | <span class="swiper" :style="{left:distance + 'px'}" @mousedown="mouseDown"> |
| | | <span class="swiper" :style="{left:distance + 'px'}" @mousedown="mouseDown" @touchstart="touchStart"> |
| | | <Icon type="md-arrow-round-forward" /> |
| | | </span> |
| | | <span class="text">{{verifyText}}</span> |
| | |
| | | this.downX = e.clientX; |
| | | this.flag = true; |
| | | }, |
| | | // 触摸开始事件,开始拖动滑块 |
| | | touchStart (e) { |
| | | // 阻止默认滚动行为 |
| | | e.preventDefault(); |
| | | this.downX = e.touches[0].clientX; |
| | | this.flag = true; |
| | | }, |
| | | // 鼠标移动事件,计算距离 |
| | | mouseMove (e) { |
| | | if (this.flag) { |
| | |
| | | } |
| | | } |
| | | }, |
| | | // 触摸移动事件,计算距离 |
| | | touchMove (e) { |
| | | // 阻止默认滚动行为 |
| | | e.preventDefault(); |
| | | if (this.flag) { |
| | | let offset = e.touches[0].clientX - this.downX; |
| | | |
| | | if (offset > this.data.originalWidth - 43) { |
| | | this.distance = this.data.originalWidth - 43; |
| | | } else if (offset < 0) { |
| | | this.distance = 0; |
| | | } else { |
| | | this.distance = offset; |
| | | } |
| | | } |
| | | }, |
| | | // 鼠标抬起事件,验证是否正确 |
| | | mouseUp () { |
| | | if (!this.flag) return false; |
| | | this.flag = false; |
| | | this.verifySlide(); |
| | | }, |
| | | // 触摸结束事件,验证是否正确 |
| | | touchEnd () { |
| | | if (!this.flag) return false; |
| | | this.flag = false; |
| | | this.verifySlide(); |
| | | }, |
| | | // 验证滑块位置 |
| | | verifySlide() { |
| | | // 四舍五入确保位置是整数,提高验证准确性 |
| | | let xPos = Math.round(this.distance); |
| | | |
| | | // 添加调试信息 |
| | | console.log('滑块位置:', xPos, '容器宽度:', this.data.originalWidth, '设备像素比:', window.devicePixelRatio); |
| | | |
| | | let params = { |
| | | verificationEnums: this.type, |
| | | xPos: this.distance |
| | | xPos: xPos |
| | | }; |
| | | |
| | | postVerifyImg(params).then(res => { |
| | | console.log('验证响应:', res); |
| | | if (res.success) { |
| | | if (res.result) { |
| | | this.bgColor = 'green'; |
| | | this.verifyText = '解锁成功'; |
| | | this.$emit('change', { status: true, distance: this.distance }); |
| | | this.$emit('change', { status: true, distance: xPos }); |
| | | } else { |
| | | this.bgColor = 'red'; |
| | | this.verifyText = '解锁失败'; |
| | |
| | | setTimeout(() => { |
| | | that.init(); |
| | | }, 1000); |
| | | this.$emit('change', { status: false, distance: this.distance }); |
| | | this.$emit('change', { status: false, distance: xPos }); |
| | | } |
| | | } else { |
| | | this.init() |
| | | } |
| | | |
| | | }).catch(()=>{ |
| | | }).catch((err)=>{ |
| | | console.error('验证请求失败:', err); |
| | | this.init() |
| | | }); |
| | | }, |
| | |
| | | export const insertOrUpdateSpec = (params) => { |
| | | return postRequest("/memberNoticeSenter/insertOrUpdate", params); |
| | | }; |
| | | export const exportMemberListData = (params) => { |
| | | const processedParams = new URLSearchParams(); |
| | | |
| | | Object.entries(params).forEach(([key, value]) => { |
| | | if (key === 'tagIds' && Array.isArray(value)) { |
| | | // 如果是tagIds数组,为每个元素添加[]后缀 |
| | | value.forEach(tagId => { |
| | | processedParams.append('tagIds[]', tagId); |
| | | }); |
| | | } else { |
| | | processedParams.append(key, value); |
| | | } |
| | | }); |
| | | |
| | | return getRequest(`/passport/member/export?${processedParams.toString()}`,null,'blob'); |
| | | }; |
| | | |
| | | // 获取会员列表 |
| | | export const getMemberListData = (params) => { |
| | |
| | | </Select> |
| | | </div> |
| | | <div class="shop-list" v-if="!closeShop"> |
| | | <Select clearable @on-change="changeshop(selectedWay)" v-model="storeId" placeholder="店铺查询" |
| | | <Select clearable @on-change="changeshop(selectedWay)" filterable :loading="storeLoading" v-model="storeId" placeholder="店铺查询" |
| | | style="width:200px;margin-left:10px;"> |
| | | <Scroll :on-reach-bottom="handleReachBottom"> |
| | | <Option v-for="(item, index) in shopsData" :value="item.id" :key="index">{{ item.storeName }}</Option> |
| | | </Scroll> |
| | | <!-- <Scroll :on-reach-bottom="handleReachBottom">--> |
| | | <Option v-for="(item, index) in shopsData" :value="item.id" :key="item.id">{{ item.storeName }}</Option> |
| | | <!-- <Scroll>--> |
| | | </Select> |
| | | </div> |
| | | </div> |
| | |
| | | params: { |
| | | // 请求参数 |
| | | pageNumber: 1, |
| | | pageSize: 10, |
| | | pageSize: 999, |
| | | storeName: "", |
| | | }, |
| | | dateList: [ |
| | |
| | | |
| | | shopTotal: "", // 店铺总数 |
| | | shopsData: [], // 店铺数据 |
| | | storeLoading: false |
| | | }; |
| | | }, |
| | | mounted() { |
| | |
| | | <template> |
| | | <div class="verify-content" v-if="show" @mousemove="mouseMove" @mouseup="mouseUp" @click.stop> |
| | | <div class="verify-content" v-if="show" @mousemove="mouseMove" @mouseup="mouseUp" @touchmove="touchMove" @touchend="touchEnd" @click.stop> |
| | | <div class="imgBox" :style="{width:data.originalWidth+'px',height:data.originalHeight + 'px'}"> |
| | | <img :src="data.backImage" style="width:100%;height:100%" alt=""> |
| | | <img class="slider" :src="data.slidingImage" :style="{left:distance+'px',top:data.randomY+'px'}" :width="data.sliderWidth" :height="data.sliderHeight" alt=""> |
| | |
| | | </div> |
| | | <div class="handle" :style="{width:data.originalWidth+'px'}"> |
| | | <span class="bgcolor" :style="{width:distance + 'px',background:bgColor}"></span> |
| | | <span class="swiper" :style="{left:distance + 'px'}" @mousedown="mouseDown"> |
| | | <span class="swiper" :style="{left:distance + 'px'}" @mousedown="mouseDown" @touchstart="touchStart"> |
| | | <Icon type="md-arrow-round-forward" /> |
| | | </span> |
| | | <span class="text">{{verifyText}}</span> |
| | |
| | | this.downX = e.clientX; |
| | | this.flag = true; |
| | | }, |
| | | // 触摸开始事件,开始拖动滑块 |
| | | touchStart (e) { |
| | | // 阻止默认滚动行为 |
| | | e.preventDefault(); |
| | | this.downX = e.touches[0].clientX; |
| | | this.flag = true; |
| | | }, |
| | | // 鼠标移动事件,计算距离 |
| | | mouseMove (e) { |
| | | if (this.flag) { |
| | |
| | | } |
| | | } |
| | | }, |
| | | // 触摸移动事件,计算距离 |
| | | touchMove (e) { |
| | | // 阻止默认滚动行为 |
| | | e.preventDefault(); |
| | | if (this.flag) { |
| | | let offset = e.touches[0].clientX - this.downX; |
| | | |
| | | if (offset > this.data.originalWidth - 43) { |
| | | this.distance = this.data.originalWidth - 43; |
| | | } else if (offset < 0) { |
| | | this.distance = 0; |
| | | } else { |
| | | this.distance = offset; |
| | | } |
| | | } |
| | | }, |
| | | // 鼠标抬起事件,验证是否正确 |
| | | mouseUp () { |
| | | if (!this.flag) return false; |
| | | this.flag = false; |
| | | this.verifySlide(); |
| | | }, |
| | | // 触摸结束事件,验证是否正确 |
| | | touchEnd () { |
| | | if (!this.flag) return false; |
| | | this.flag = false; |
| | | this.verifySlide(); |
| | | }, |
| | | // 验证滑块位置 |
| | | verifySlide() { |
| | | // 四舍五入确保位置是整数,提高验证准确性 |
| | | let xPos = Math.round(this.distance); |
| | | |
| | | // 添加调试信息 |
| | | console.log('滑块位置:', xPos, '容器宽度:', this.data.originalWidth, '设备像素比:', window.devicePixelRatio); |
| | | |
| | | let params = { |
| | | verificationEnums: this.type, |
| | | xPos: this.distance |
| | | xPos: xPos |
| | | }; |
| | | |
| | | postVerifyImg(params).then(res => { |
| | | console.log('验证响应:', res); |
| | | if (res.success) { |
| | | if (res.result) { |
| | | this.bgColor = 'green'; |
| | | this.verifyText = '解锁成功'; |
| | | this.$emit('change', { status: true, distance: this.distance }); |
| | | this.$emit('change', { status: true, distance: xPos }); |
| | | } else { |
| | | this.bgColor = 'red'; |
| | | this.verifyText = '解锁失败'; |
| | |
| | | setTimeout(() => { |
| | | that.init(); |
| | | }, 1000); |
| | | this.$emit('change', { status: false, distance: this.distance }); |
| | | this.$emit('change', { status: false, distance: xPos }); |
| | | } |
| | | } else { |
| | | this.init() |
| | | } |
| | | |
| | | }).catch(()=>{ |
| | | }).catch((err)=>{ |
| | | console.error('验证请求失败:', err); |
| | | this.init() |
| | | }); |
| | | }, |
| | |
| | | let userInfo = Cookies.get("userInfoManager"); |
| | | if (!userInfo) { |
| | | // 未登录 |
| | | return; |
| | | return Promise.resolve(false); |
| | | } |
| | | if (!vm.$store.state.app.added) { |
| | | // 第一次加载 读取数据 |
| | | // 加载菜单 |
| | | getCurrentPermissionList().then(res => { |
| | | if (!res.success) return false; |
| | | return getCurrentPermissionList().then(res => { |
| | | if (!res.success) return Promise.reject(false); |
| | | let menuData = res.result; |
| | | |
| | | // 格式化数据,设置 空children 为 null |
| | |
| | | } |
| | | |
| | | if (!menuData) { |
| | | return; |
| | | return Promise.reject(false); |
| | | } |
| | | util.initAllMenuData(constRoutes, menuData); |
| | | util.initRouterNode(otherRoutes, otherRouter); |
| | |
| | | // 缓存数据 修改加载标识 |
| | | window.localStorage.setItem("menuData", JSON.stringify(menuData)); |
| | | vm.$store.commit("setAdded", true); |
| | | return Promise.resolve(true); |
| | | }).catch(err => { |
| | | console.error("路由初始化失败:", err); |
| | | return Promise.reject(false); |
| | | }); |
| | | } else { |
| | | // 读取缓存数据 |
| | | let data = window.localStorage.getItem("menuData"); |
| | | if (!data) { |
| | | vm.$store.commit("setAdded", false); |
| | | return; |
| | | return Promise.resolve(false); |
| | | } |
| | | let menuData = JSON.parse(data); |
| | | // 添加菜单路由 |
| | | util.initMenuData(vm, menuData); |
| | | return Promise.resolve(true); |
| | | } |
| | | }; |
| | | |
| | |
| | | // 加载菜单 |
| | | Cookies.set("userInfoManager", JSON.stringify(res.result)); |
| | | this.$store.commit("setAvatarPath", res.result.avatar); |
| | | util.initRouter(this); |
| | | this.$router.push({ |
| | | name: "home_index", |
| | | // 确保路由初始化完成后再进行跳转 |
| | | return util.initRouter(this).then(() => { |
| | | this.$router.push({ |
| | | name: "home_index", |
| | | }).catch(err => { |
| | | console.error("路由跳转错误:", err); |
| | | // 如果直接跳转失败,尝试使用replace |
| | | this.$router.replace({ |
| | | name: "home_index", |
| | | }); |
| | | }); |
| | | }).catch(err => { |
| | | console.error("路由初始化失败:", err); |
| | | // 路由初始化失败时也跳转到首页 |
| | | this.$router.push({ |
| | | name: "home_index", |
| | | }); |
| | | }); |
| | | } else { |
| | | this.loading = false; |
| | | } |
| | | }).catch(err => { |
| | | console.error("获取用户信息失败:", err); |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | submitLogin() { |
| | |
| | | .catch(() => { |
| | | this.loading = false; |
| | | }); |
| | | this.$refs.verify.show = false; |
| | | // this.$refs.verify.show = false; |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | <Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search">搜索</Button> |
| | | </Form> |
| | | </Row> |
| | | <Row class="operation padding-row" v-if="!selectedMember"> |
| | | <Button @click="addMember" type="primary">添加会员</Button> |
| | | <Row class="operation padding-row" > |
| | | <Button @click="addMember" v-if="!selectedMember" type="primary">添加会员</Button> |
| | | <Button @click="exportExcel" type="primary">导出excel</Button> |
| | | </Row> |
| | | |
| | | <Table :loading="loading" border :columns="columns" class="mt_10" :data="data" ref="table"></Table> |
| | |
| | | import * as RegExp from "@/libs/RegExp.js"; |
| | | import { getTags } from "@/api/tag.js"; |
| | | import { detailById } from "@/api/memberCustomerTag.js" |
| | | import {exportMemberListData} from "@/api/member.js"; |
| | | |
| | | export default { |
| | | name: "member", |
| | |
| | | this.searchForm.pageNumber = 1; |
| | | this.searchForm.pageSize = 10; |
| | | this.getData(); |
| | | }, // 搜索 |
| | | exportExcel() { |
| | | API_Member.exportMemberListData(this.searchForm).then(res =>{ |
| | | const blob = new Blob([res], { |
| | | type: "application/vnd.ms-excel;charset=utf-8", |
| | | }); |
| | | //对于<a>标签,只有 Firefox 和 Chrome(内核) 支持 download 属性 |
| | | //IE10以上支持blob但是依然不支持download |
| | | if ("download" in document.createElement("a")) { |
| | | //支持a标签download的浏览器 |
| | | const link = document.createElement("a"); //创建a标签 |
| | | link.download = "会员列表.xlsx"; //a标签添加属性 |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); |
| | | document.body.appendChild(link); |
| | | link.click(); //执行下载 |
| | | URL.revokeObjectURL(link.href); //释放url |
| | | document.body.removeChild(link); //释放标签 |
| | | } else { |
| | | navigator.msSaveBlob(blob, fileName); |
| | | } |
| | | }) |
| | | }, |
| | | //查看详情修改 |
| | | editPerm(val) { |
| | |
| | | <template> |
| | | <div class="verify-content" v-if="show" @mousemove="mouseMove" @mouseup="mouseUp" @click.stop> |
| | | <div class="verify-content" v-if="show" @mousemove="mouseMove" @mouseup="mouseUp" @touchmove="touchMove" @touchend="touchEnd" @click.stop> |
| | | <div class="imgBox" :style="{width:data.originalWidth+'px',height:data.originalHeight + 'px'}"> |
| | | <img :src="data.backImage" style="width:100%;height:100%" alt=""> |
| | | <img class="slider" :src="data.slidingImage" :style="{left:distance+'px',top:data.randomY+'px'}" :width="data.sliderWidth" :height="data.sliderHeight" alt=""> |
| | |
| | | </div> |
| | | <div class="handle" :style="{width:data.originalWidth+'px'}"> |
| | | <span class="bgcolor" :style="{width:distance + 'px',background:bgColor}"></span> |
| | | <span class="swiper" :style="{left:distance + 'px'}" @mousedown="mouseDown"> |
| | | <span class="swiper" :style="{left:distance + 'px'}" @mousedown="mouseDown" @touchstart="touchStart"> |
| | | <Icon type="md-arrow-round-forward" /> |
| | | </span> |
| | | <span class="text">{{verifyText}}</span> |
| | |
| | | this.downX = e.clientX; |
| | | this.flag = true; |
| | | }, |
| | | // 触摸开始事件,开始拖动滑块 |
| | | touchStart (e) { |
| | | // 阻止默认滚动行为 |
| | | e.preventDefault(); |
| | | this.downX = e.touches[0].clientX; |
| | | this.flag = true; |
| | | }, |
| | | // 鼠标移动事件,计算距离 |
| | | mouseMove (e) { |
| | | if (this.flag) { |
| | |
| | | } |
| | | } |
| | | }, |
| | | // 触摸移动事件,计算距离 |
| | | touchMove (e) { |
| | | // 阻止默认滚动行为 |
| | | e.preventDefault(); |
| | | if (this.flag) { |
| | | let offset = e.touches[0].clientX - this.downX; |
| | | |
| | | if (offset > this.data.originalWidth - 43) { |
| | | this.distance = this.data.originalWidth - 43; |
| | | } else if (offset < 0) { |
| | | this.distance = 0; |
| | | } else { |
| | | this.distance = offset; |
| | | } |
| | | } |
| | | }, |
| | | // 鼠标抬起事件,验证是否正确 |
| | | mouseUp () { |
| | | if (!this.flag) return false; |
| | | this.flag = false; |
| | | this.verifySlide(); |
| | | }, |
| | | // 触摸结束事件,验证是否正确 |
| | | touchEnd () { |
| | | if (!this.flag) return false; |
| | | this.flag = false; |
| | | this.verifySlide(); |
| | | }, |
| | | // 验证滑块位置 |
| | | verifySlide() { |
| | | // 四舍五入确保位置是整数,提高验证准确性 |
| | | let xPos = Math.round(this.distance); |
| | | |
| | | // 添加调试信息 |
| | | console.log('滑块位置:', xPos, '容器宽度:', this.data.originalWidth, '设备像素比:', window.devicePixelRatio); |
| | | |
| | | let params = { |
| | | verificationEnums: this.type, |
| | | xPos: this.distance |
| | | xPos: xPos |
| | | }; |
| | | |
| | | postVerifyImg(params).then(res => { |
| | | console.log('验证响应:', res); |
| | | if (res.success) { |
| | | if (res.result) { |
| | | this.bgColor = 'green'; |
| | | this.verifyText = '解锁成功'; |
| | | this.$emit('change', { status: true, distance: this.distance }); |
| | | this.$emit('change', { status: true, distance: xPos }); |
| | | } else { |
| | | this.bgColor = 'red'; |
| | | this.verifyText = '解锁失败'; |
| | |
| | | setTimeout(() => { |
| | | that.init(); |
| | | }, 1000); |
| | | this.$emit('change', { status: false, distance: this.distance }); |
| | | this.$emit('change', { status: false, distance: xPos }); |
| | | } |
| | | } else { |
| | | this.init() |
| | | } |
| | | |
| | | }).catch(()=>{ |
| | | }).catch((err)=>{ |
| | | console.error('验证请求失败:', err); |
| | | this.init() |
| | | }); |
| | | }, |