From a45b3d638af627ce62d35a26dd34653811a52682 Mon Sep 17 00:00:00 2001 From: Paidax Date: Thu, 26 Dec 2024 13:48:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=8F=E5=88=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WelfareUserChooseController.java | 2 +- .../views/mobile/welfare/list/receive.html | 79 ++++++++++++++++--- .../views/platform/welfare/addressManage.html | 55 +++++++------ .../welfare/project/ProjectMange.html | 24 +++--- .../views/platform/welfare/userChoose.html | 62 ++++++++------- 5 files changed, 145 insertions(+), 77 deletions(-) diff --git a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareUserChooseController.java b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareUserChooseController.java index 89f1110..bbaac3c 100644 --- a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareUserChooseController.java +++ b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareUserChooseController.java @@ -78,9 +78,9 @@ public class WelfareUserChooseController { Cnd cnd = Cnd.NEW(); cnd.and("wp.provideMode", "in", "2,3"); + cnd.and("wl.userId", "=", ShiroUtil.getUserId()); cnd.andEX("YEAR(wp.choiceTimeStart)", "in", year); cnd.and("wp.isDisabled", "=", 0); - cnd.and("wp.id","!=","fe1d51dafc104a1482cc946d05312e78"); cnd.groupBy("wp.id"); cnd.desc("YEAR(wp.choiceTimeStart)"); sql.setCondition(cnd); diff --git a/src/main/resources/views/mobile/welfare/list/receive.html b/src/main/resources/views/mobile/welfare/list/receive.html index f968da9..c5f8c85 100644 --- a/src/main/resources/views/mobile/welfare/list/receive.html +++ b/src/main/resources/views/mobile/welfare/list/receive.html @@ -139,7 +139,11 @@ layout("/mobile/platform.html"){ right: 0; transform: rotate(23deg); z-index: 1; - } + } + + .van-submit-bar__button { + width: 150px; + }
@@ -274,7 +278,8 @@ layout("/mobile/platform.html"){ -
@@ -287,10 +292,17 @@ layout("/mobile/platform.html"){ {{item.address}} @@ -306,7 +318,6 @@ layout("/mobile/platform.html"){
-
moment(choiceTimeStart).valueOf() && now < moment(choiceTimeEnd).valueOf()) { - return {text: this.isSelect ? '确定修改' : '确定选择', disabled: false} + return {text: this.isSelect ? '选好了,下一步' : '选好了,下一步', disabled: false} } else if (now > moment(choiceTimeEnd).valueOf()) { return {text: '选择已结束', disabled: true} } else if (now < moment(choiceTimeStart).valueOf()) { @@ -453,12 +464,12 @@ layout("/mobile/platform.html"){ //已选择了不能再动了 if (this.isSelect) { if (moment(this.selectTime).valueOf() > moment(choiceTimeEnd).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()) { - return {text: '确定修改', disabled: false} + return {text: '下一步', disabled: false} } return {text: '选择已结束', disabled: true} } else { if (now > moment(choiceTimeStart).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()) { - return {text: this.isSelect ? '确定修改' : '确定选择', disabled: false} + return {text: this.isSelect ? '选好了,下一步' : '选好了,下一步', disabled: false} } else if (now > moment(overdueChoiceTimeEnd).valueOf()) { return {text: '选择已结束', disabled: true} } else if (now < moment(choiceTimeStart).valueOf()) { @@ -477,6 +488,46 @@ layout("/mobile/platform.html"){ } }, methods: { + editAddress(item) { + pjaxReplace('/mobile/welfare/mine/addressEdit?projectId=' + this.projectId + '&id=' + item.id) + window.sessionStorage.setItem('welfareProjectId', this.projectId) + + const formData = { + projectInfo: this.projectInfo, + signData: this.signData || null + } + window.sessionStorage.setItem('welfareProjectSelectInfo' + "${@shiro.getPrincipalProperty('loginname')}", JSON.stringify(formData)) + }, + deleteAddress(item) { + this.selectAddressPopup = true + // 确认要删除该地址吗 + this.$dialog.confirm({ + title: '提示', + message: '确认要删除该地址吗' + }).then(async () => { + const loading = this.$toast.loading({ + message: '删除中...', + forbidClick: true, + overlay: true, + duration: 0 + }) + const resp = await $.post('/mobile/welfare/mine/deleteAddress', {id: item.id}) + loading.close() + if (resp.code === 0) { + this.$toast.success(resp.msg) + } + await this.selectAddressList() + if (this.addressList && this.addressList.length > 0) { + const resp = this.addressList.find(v=> v.isDefault) + this.addressClick(resp) + } else { + this.selectAddress = '' + } + this.selectAddressPopup = true + }).catch(() => { + this.selectAddressPopup = true + }) + }, // top字体颜色 getRankColor(rank) { switch(rank) { @@ -602,6 +653,7 @@ layout("/mobile/platform.html"){ } this.confirmPopup = false await this.getProjectInfo() + window.location.reload() }, //查看详情 @@ -640,6 +692,10 @@ layout("/mobile/platform.html"){ //地址列表点击 addressClick(item) { + if (item == null) { + this.selectAddress = null + return + } const {province, city, county, address, name, tel} = item this.selectAddress = "收货地址:" + province + city + county + address + "," + "收件人:" + name + "," + "联系方式:" + tel }, @@ -662,12 +718,15 @@ layout("/mobile/platform.html"){ //回显用户选择的数据 echoUserSelection() { + let selectNum = 0; this.projectInfo.welfareProjectSubjects[0].options.forEach(v => { const option = this.userSelection.find(x => x.selectOptionId === v.id) if (option) { v.selectNum = option.selectNum + selectNum = Number(selectNum) + Number(v.selectNum) } }) + this.selectNum = selectNum }, }, created() { diff --git a/src/main/resources/views/platform/welfare/addressManage.html b/src/main/resources/views/platform/welfare/addressManage.html index 338535c..039e549 100644 --- a/src/main/resources/views/platform/welfare/addressManage.html +++ b/src/main/resources/views/platform/welfare/addressManage.html @@ -64,14 +64,13 @@ layout("/layouts/platform.html"){ title="收货地址" :close-on-click-modal="false" :visible.sync="dialogVisible" - width="30%"> + width="40%"> - - - + - + - - + + + + + + + + @@ -140,7 +142,13 @@ layout("/layouts/platform.html"){ {prop: 'address', label: '所在地区'}, {prop: 'addressDetail', label: '详细地址'}, {prop: 'tel', label: '电话'}, - ] + ], + formRules: { + addressList: [{required: true, message: '请选择地址信息', trigger: ['blur', 'change']}], + addressDetail: [{required: true, message: '请填写您的详细地址', trigger: ['blur', 'change']}], + userName: [{required: true, message: '请填写收货人姓名', trigger: ['blur', 'change']}], + tel: [{required: true, message: '必填', trigger: ['blur', 'change']}, {pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号'}], + }, } }, methods: { @@ -181,7 +189,10 @@ layout("/layouts/platform.html"){ }, openAddress() { - this.formData = {} + this.formData = { + userName: "${@shiro.getPrincipalProperty('username')}", + tel: "${@shiro.getPrincipalProperty('mobile')}" + } this.dialogVisible = true if (this.$refs["addForm"]) this.$refs["addForm"].resetFields(); @@ -251,10 +262,6 @@ layout("/layouts/platform.html"){ }, async created() { this.pageData() - if ("${@shiro.hasRole('sysadmin')}" === 'false') { - this.dzOptions = this.dzOptions.filter(d => d.label === "江苏省") - this.dzOptions[0].children = this.dzOptions[0].children.filter(d => d.label === "无锡市") - } } }) diff --git a/src/main/resources/views/platform/welfare/project/ProjectMange.html b/src/main/resources/views/platform/welfare/project/ProjectMange.html index 48e65cd..8417c38 100644 --- a/src/main/resources/views/platform/welfare/project/ProjectMange.html +++ b/src/main/resources/views/platform/welfare/project/ProjectMange.html @@ -618,20 +618,16 @@ layout("/layouts/platform.html"){ this.$refs.openQRCode.openCode('/mobile/welfare/list/receive?projectId=' + row.id) }, isCheckBoxChange() { - this.formData.welfareProjectSubjects = [{ - subjectName: '请输入福利信息', - subjectType: this.formData.isCheckBox ? this.formData.isCheckBox : 'radio', - defaultOption: null, - options: [ - { - optionType: "套餐", - optionName: '福利1', - optionNameId: '', - optionSort: '1', - imgUrl: '' - } - ] - }] + this.formData.welfareProjectSubjects.forEach(v=> { + v.subjectType = this.formData.isCheckBox ? this.formData.isCheckBox : 'radio' + }) + + // this.formData.welfareProjectSubjects = [{ + // subjectName: '请输入福利信息', + // subjectType: this.formData.isCheckBox ? this.formData.isCheckBox : 'radio', + // defaultOption: null, + // + // }] }, async handleAvatarSuccess(res, file) { diff --git a/src/main/resources/views/platform/welfare/userChoose.html b/src/main/resources/views/platform/welfare/userChoose.html index 7a4f8ca..bedd05e 100644 --- a/src/main/resources/views/platform/welfare/userChoose.html +++ b/src/main/resources/views/platform/welfare/userChoose.html @@ -312,6 +312,7 @@ layout("/layouts/platform.html"){
+ 温馨提示:填写默认收货地址后,系统会自动选择默认地址;如未设置默认,请您在添加收货地址后在此下拉框进行选择 @@ -368,14 +369,13 @@ layout("/layouts/platform.html"){ :close-on-click-modal="false" :visible.sync="addressDialogVisible" title="收货地址" - width="30%"> + width="40%"> - - - + - + - - + + + + + + + + @@ -464,6 +467,13 @@ layout("/layouts/platform.html"){ isChoice: false, addressDialogVisible: false, + + formRules: { + addressList: [{required: true, message: '请选择地址信息', trigger: ['blur', 'change']}], + addressDetail: [{required: true, message: '请填写您的详细地址', trigger: ['blur', 'change']}], + userName: [{required: true, message: '请填写收货人姓名', trigger: ['blur', 'change']}], + tel: [{required: true, message: '必填', trigger: ['blur', 'change']}, {pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号'}], + }, } }, computed: { @@ -480,7 +490,7 @@ layout("/layouts/platform.html"){ const now = moment().valueOf() if (overdueChoiceTimeEnd == null || overdueChoiceTimeEnd === '') { if (now > moment(choiceTimeStart).valueOf() && now < moment(choiceTimeEnd).valueOf()) { - return {text: isChoose ? '确定修改' : '确定选择', disabled: false} + return {text: isChoose ? '修改' : '选择', disabled: false} } else if (now > moment(choiceTimeEnd).valueOf()) { return {text: '选择已结束', disabled: true} } else if (now < moment(choiceTimeStart).valueOf()) { @@ -490,12 +500,12 @@ layout("/layouts/platform.html"){ //已选择了不能再动了 if (isChoose) { if(moment(selectTime).valueOf() > moment(choiceTimeEnd).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()){ - return {text: '确定修改', disabled: false} + return {text: '修改', disabled: false} } return {text: '选择已结束', disabled: true} } else { if (now > moment(choiceTimeStart).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()) { - return {text: isChoose ? '确定修改' : '确定选择', disabled: false} + return {text: isChoose ? '修改' : '选择', disabled: false} } else if (now > moment(overdueChoiceTimeEnd).valueOf()) { return {text: '选择已结束', disabled: true} } else if (now < moment(choiceTimeStart).valueOf()) { @@ -745,6 +755,9 @@ layout("/layouts/platform.html"){ r.name = "收货地址:" + r.province + r.city + r.county + r.addressDetail + ",收件人:" + r.userName + ",联系方式:" + r.tel }) this.addressOptions = resp.data + + this.formData.addressId = this.addressOptions.find(v=> v.isDefault).id + }, }, async created() { @@ -756,13 +769,6 @@ layout("/layouts/platform.html"){ getEnumOptions("WelfareSignMode").then(res => { this.welfareSignMode = res }) - - if ("${@shiro.hasRole('sysadmin')}" === 'false') { - this.dzOptions = this.dzOptions.filter(d => d.label === "江苏省") - this.dzOptions[0].children = this.dzOptions[0].children.filter(d => d.label === "无锡市") - } - - } })