diff --git a/rc-busness/ajax/getData.js b/rc-busness/ajax/getData.js index 6fe65551..fa138d0b 100644 --- a/rc-busness/ajax/getData.js +++ b/rc-busness/ajax/getData.js @@ -517,6 +517,7 @@ export const goodsmessage = (productCode) => { //地址的添加 //id/详细地址/ 收货人姓名/收货人电话号码/省份id/城市id/区域编码 export const editaddress = (memberId, detailAddress,recipient,tel,provinceId,cityId,districtId) => { + var data = { memberId:844350, provinceId:25, @@ -528,7 +529,7 @@ export const goodsmessage = (productCode) => { zipCode:'214423', default:false, } - return fetch('memberAddress?type=add', data, 'POST' ) + return fetch('memberAddress?type=add', memberId, 'POST' ) } //删除 @@ -541,21 +542,13 @@ export const goodsmessage = (productCode) => { } //地址的编辑 - export const editupdate = (mobile, pet,address) => { - var data = { - - memberId:'3242', - id:'620111', - provinceId:'', - cityId:'', - districtId:'', - detailAddress:'江西省萍乡市', - recipient:'刘佳敏', - recipientPhone:'13407998521', - zipCode:'', - isDefault:'', - } - return fetch('memberAddress?type=update', data, 'POST' ) + export const editupdate = (userid,) => { + // var data = { + // memberId:userid, + // id:id, + // isDefault:isDefault, + // } + return fetch('memberAddress?type=update', userid, 'POST' ) } //修改密码 diff --git a/rc-busness/assets/css/addaddress.less b/rc-busness/assets/css/addaddress.less index 471c5f6f..53b349ee 100644 --- a/rc-busness/assets/css/addaddress.less +++ b/rc-busness/assets/css/addaddress.less @@ -2,50 +2,51 @@ @media screen and (max-width:768px){ - .usercontend{ + .rc-button{ display: flex; + justify-content: center; + font-size: 14px; + width: 100%; + box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1); + height: 80px; + align-items: center; + padding:0 20px 0 20px; + span + { + width: 160px; + height: 48px; + border: 2px solid #E2001A; + border-radius: 30px; + display: flex; + align-items: center; + justify-content: center; + color: #E2001A; + } + em{ + font-style: normal; + width: 164px; + height: 48px; + background: #E2001A; + cursor: pointer; + border-radius: 30px; + display: flex; + align-items: center; + justify-content: center; + color: #FFFFFF; + margin-left: 40px; + } + } + .usercontend{ align-items: center; justify-content: center; flex-direction: column; + min-height: 70vh; .rc-useaddress{ textarea{ display: none; } } - .rc-button{ - display: flex; - justify-content: center; - font-size: 14px; - width: 100%; - box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1); - height: 80px; - align-items: center; - padding:0 20px 0 20px; - span - { - width: 160px; - height: 48px; - border: 2px solid #E2001A; - border-radius: 30px; - display: flex; - align-items: center; - justify-content: center; - color: #E2001A; - } - em{ - font-style: normal; - width: 164px; - height: 48px; - background: #E2001A; - cursor: pointer; - border-radius: 30px; - display: flex; - align-items: center; - justify-content: center; - color: #FFFFFF; - margin-left: 40px; - } - } + .rc-max-width--xl{ h2{ display: none; @@ -55,7 +56,7 @@ } .rc-max-width--xl{ - margin-top: 16px; + padding: 24px 20px 0 20px; input{ width: 258px; height: 34px; @@ -100,6 +101,40 @@ @media screen and (min-width: 769px) { + .rc-button{ + display: flex; + justify-content: center; + font-size: 14px; + width: 100%; + box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1); + height: 80px; + align-items: center; + padding:0 20px 0 20px; + span + { + width: 160px; + height: 48px; + border: 2px solid #E2001A; + border-radius: 30px; + display: flex; + align-items: center; + justify-content: center; + color: #E2001A; + } + em{ + font-style: normal; + width: 164px; + height: 48px; + background: #E2001A; + cursor: pointer; + border-radius: 30px; + display: flex; + align-items: center; + justify-content: center; + color: #FFFFFF; + margin-left: 40px; + } + } .usercontend{ display: flex; align-items: center; @@ -197,12 +232,11 @@ // .rc-phone{ // } -// .rc-address{ + .rc-address{ + position: relative; -// } -// .rc-useaddress{ - -// } + } + diff --git a/rc-busness/assets/css/editaddress.less b/rc-busness/assets/css/editaddress.less index 269b6de2..53b349ee 100644 --- a/rc-busness/assets/css/editaddress.less +++ b/rc-busness/assets/css/editaddress.less @@ -1,3 +1,6 @@ + + + @media screen and (max-width:768px){ .rc-button{ display: flex; @@ -7,8 +10,6 @@ box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1); height: 80px; align-items: center; - position: absolute; - bottom: 0; padding:0 20px 0 20px; span { @@ -35,8 +36,27 @@ margin-left: 40px; } } + .usercontend{ + align-items: center; + justify-content: center; + flex-direction: column; + min-height: 70vh; + .rc-useaddress{ + textarea{ + display: none; + } + } + + .rc-max-width--xl{ + h2{ + display: none; + } + } + + } + .rc-max-width--xl{ - margin-top: 16px; + padding: 24px 20px 0 20px; input{ width: 258px; height: 34px; @@ -61,8 +81,6 @@ span{ text-align: left; } - - } // .rc-phone{ @@ -82,8 +100,147 @@ } @media screen and (min-width: 769px) -{ +{ + .rc-button{ + display: flex; + justify-content: center; + font-size: 14px; + width: 100%; + box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1); + height: 80px; + align-items: center; + padding:0 20px 0 20px; + span + { + width: 160px; + height: 48px; + border: 2px solid #E2001A; + border-radius: 30px; + display: flex; + align-items: center; + justify-content: center; + color: #E2001A; + } + em{ + font-style: normal; + width: 164px; + height: 48px; + background: #E2001A; + cursor: pointer; + border-radius: 30px; + display: flex; + align-items: center; + justify-content: center; + color: #FFFFFF; + margin-left: 40px; + } + } + .usercontend{ + display: flex; + align-items: center; + justify-content: center; + position: relative; + flex-direction: column; + .rc-button{ + display: flex; + justify-content: center; + font-size: 14px; + width: 100%; + box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1); + height: 80px; + align-items: center; + + padding:0 20px 0 20px; + span + { + width: 160px; + height: 48px; + border: 2px solid #E2001A; + border-radius: 30px; + display: flex; + align-items: center; + justify-content: center; + color: #E2001A; + } + em{ + font-style: normal; + width: 164px; + height: 48px; + background: #E2001A; + cursor: pointer; + border-radius: 30px; + display: flex; + align-items: center; + justify-content: center; + color: #FFFFFF; + margin-left: 40px; + } + } + h2{ + font-size: 26px; + color: #333333; + text-align: center; + font-weight: bold; + } + .rc-useaddress{ + display: flex; + align-items: center; + textarea{ + width: 680px; + height: 118px; + background: #FFFFFF; + border: 1px solid #808285; + opacity: 1; + border-radius: 0px; + padding-top: 12px; + padding-left: 16px; + } + +.userinput{ + display: none; +} + } + } + +.rc-max-width--xl{ + margin-top: 16px; + input{ + width: 680px; + height: 45px; + border: 1px solid #808285; + color: #999999; + font-size: 16px; + margin-left: 2px; + padding-left: 16px; + } + span{ + font-size: 16px; + font-weight: bold; + width: 10%; + text-align: center; + color: #333333; + margin-top: 2px; + } + .rc-people{ + width: 100%; + display: flex; + align-items: center; + + } + +// .rc-phone{ + +// } + .rc-address{ + position: relative; + + } + + + + +} } \ No newline at end of file diff --git a/rc-busness/assets/css/openaddress.less b/rc-busness/assets/css/openaddress.less index 689de33e..1be67eec 100644 --- a/rc-busness/assets/css/openaddress.less +++ b/rc-busness/assets/css/openaddress.less @@ -1,11 +1,288 @@ -@media screen and (max-width:768px){ +.rc-margin-bottom--lg{ + margin: 0; +} +@media screen and (max-width:768px){ + .userdit{ + display: none; + } + .online{ + width:100%; + background:#d7d7d7; + margin-top:1.5rem; + height:.06rem; + &.bold{ + height:8px; + background:#f6f6f6; + } + } + .useredit{ + display: none; + } + .rc-button{ + display: flex; + align-items: center; + justify-content: center; + width: 375px; +height: 80px; +background: #FFFFFF; +box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1); +opacity: 1; +border-radius: 0px; + } + .rc-footbutton { + width: 164px; +height: 48px; +border: 2px solid #E2001A; +opacity: 1; +border-radius: 30px; +background: #E2001A; +display: flex; +justify-content: center; +align-items: center; +font-size: 16px; +color: #FFFFFF; + + + } +.rc-max-width--xl{ + padding: 0px 20px 24px 20px; + min-height: 60vh; + .rc-cat{ + margin-top: 20px; + } + .rc-title { + display: flex; + align-items: center; + color: #333333; + font-size: 14px; + em { + font-style: normal; + font-size: 14px; + } + span { + display: block; + margin-left: 8px; + } + } + + +} + + + + .rc-address { + margin-top: 8px; + text-overflow: -o-ellipsis-lastline; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + line-clamp: 2; + -webkit-box-orient: vertical; + font-size: 14px; + color: #333333; + } + .rc-footer { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 20px; + display: flex; + align-items: center; + .rc-right { + span { + border-bottom: 1px solid #666666; + } + span:first-child { + margin-right: 16px; + } + } + img{ + width: 43px; + } + .rc-foot{ + display: flex; + align-items: center; + color: #333333; + font-size: 14px; + span{ + margin-left: 8px; + } + } + } } -@media screen and (min-width: 769px) +@media screen and (min-width: 768px) + { + + .rc-max-width--xl{ + margin-bottom: 80px; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between + } + .rc-button{ +display: none; +} +.usercontend { + display:inline-block; + width: 48%; + margin-top: 40px; + padding: 24px 20px; +} + + .online{ + display: none; + } + .rc-button{ + display: none; + } + .rc-max-width--xl{ + .rc-cat{ + border: 1px solid #D7D7D7; + border-radius: 3px; + position: relative; + height: 164px; + box-sizing: border-box; + padding: 20px 20px; + } + .rc-title { + display: flex; + align-items: center; + color: #333333; + font-size: 20px; + em { + font-style: normal; + } + span { + display: block; + margin-left: 32px; + font-size: 20px; + } + } + .rc-footer { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 20px; + display: flex; + align-items: center; + .rc-right { + position: absolute; + right: 24px; + top: 24px; + span { + border-bottom: 1px solid #666666; + cursor: pointer; + } + span:first-child { + margin-right: 16px; + } + } + img{ + width: 43px; + } + .rc-foot{ + display: flex; + align-items: center; + color: #333333; + font-size: 16px; + margin-top: 16px; + span{ + margin-left: 8px; + } + } + } + + } + .rc-max-width--xl{ + + .rc-button { + display: none; + } + .rc-header { + display: flex; + align-items: center; + color: #333333; + em { + font-style: normal; + font-size: 14px; + } + span { + display: block; + margin-left: 8px; + } + } + .rc-address { + margin-top: 16px; + text-overflow: -o-ellipsis-lastline; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + line-clamp: 2; + -webkit-box-orient: vertical; + font-size: 20px; + color: #333333; + } + .rc-footer { + display: flex; + justify-content: space-between; + align-items: center; + padding-bottom: 20px; + margin-top: 8px; + .rc-right { + span { + border-bottom: 1px solid #666666; + } + span:first-child { + margin-right: 16px; + } + } + } + + + } + .userdit{ + width: 45%; + height: 164px; + display: inline-block; + height: 164px; + border: 1px solid #D7D7D7; + border-radius: 3px; + margin-top: 65px; + box-sizing: border-box; + border: 1px solid #D7D7D7; + border-radius: 3px; + position: relative; + height: 164px; + box-sizing: border-box; + margin-left: 20px; + + } + .alledit{ + display: flex; + align-items: center; + justify-content: center; + position: relative; + height: 100%; + img{ + width: 31px; + height: 31px; + + } + span{ + color: #333333; + font-size: 18px; + + } + } + } \ No newline at end of file diff --git a/rc-busness/assets/css/orderquantity.less b/rc-busness/assets/css/orderquantity.less new file mode 100644 index 00000000..0698f7a2 --- /dev/null +++ b/rc-busness/assets/css/orderquantity.less @@ -0,0 +1,366 @@ + + + + +@media screen and (max-width:768px){ + .active { + font-size: 14px; + color: #e2001a; + cursor: pointer; + } + .unactive { + font-size: 14px; + color: #444444; + cursor: pointer; + } + + + .usercontshow{ + padding: 0 1.5rem; + .online{ + margin: 0; + &.bold{ + height: 0.5rem; + } + } + .rc-usermaina{ + width: 100%; + height: 100%; + } + .rc-headera { + display: flex; + justify-content: space-between; + height: 64px; + align-items: center; + } + .rc-userheader{ + display: none; + } + + .rc-center { + width: 100%; + height: 245px; + margin-top: 8px; + .rc-usermain { + .pc-bottom{ + display: none; + } + + display: flex; + .rc-image { + border: 1px solid #D8D8D8; + margin-top: 17px; + ; + img { + width: 96px; + height: 96px; + display: block; + + } + } + + .rc-right { + + .rc-userbottomm{ + display: none; + } + display: flex; + flex-direction: column; + width: 100%; + margin-left: 16px; + justify-content: center; + em + { + font-style: normal; + display: block; + font-size: 16px; + margin-top: 18px; + font-weight: bold; + + color: #E1001A; + } + } + .rc-userright { + display: flex; + flex-direction: column; + color: #666666; + font-size: 14px; + span{ + display: block; + margin-top: 16px; + } + } + .rc-userbottom { + display: flex; + justify-content: space-between; + margin-top: 8px; + span{ + color: #666666; + font-size: 14px; + } + i{ + font-style: normal; + color: #E1001A; + font-size: 18px; + font-weight: bold; + } + } + } + + .rc-bottom { + display: flex; + align-items: center; + justify-content: center; + margin-top: 24px; + span { + display: block; + width: 130px; + display: flex; + align-items: center; + line-height: 40px; + text-align: center; + color: #e2001a; + height: 40px; + border: 2px solid #e2001a; + justify-content: center; + border-radius: 30px; + font-weight: bold; + } + span:last-child{ + margin-left: 15px; + } + } + } + + .rc-title { + height: 52px; + display: flex; + align-items: center; + border-bottom: 1px solid #d8d8d8; + justify-content: space-between; + span{ + font-size: 14px; + color: #999999; + margin-left: 8px; + } + em{ + font-style: normal; + font-size: 14px; + + color: #333333; + } + i{ + font-style: normal; + font-size: 14px; + + color: #333333; + } + .rc-usertitle strong{ + display: none; + } + } + + } + + + +} +@media screen and (min-width: 769px) +{ + .active { + font-size: 18px; + color: #e2001a; + cursor: pointer; + // margin-left: 40px; + } + .unactive { + font-size: 18px; + color: #444444; + cursor: pointer; + // margin-left: 80px; + } + .usercontshow{ + .rc-headera { + display: flex; + height: 64px; + align-items: center; + border: 1px solid #D7D7D7; + border-radius: 3px 3px 0px 0px; + font-size: 18px; + span:first-child{ + margin-left: 40px; + } + span{ + margin-left: 80px; + } + } + + .rc-userheader{ + width: 100%; + height: 64px; + background: #F6F6F6; + border: 1px solid #D7D7D7; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 18px; + span:first-child{ + margin-left: 173px; + } + span:last-child{ + margin-right: 87px; + } + } + + .rc-center { + width: 100%; + height: 220px; + border: 1px solid #D7D7D7; + .rc-usermain { + display: flex; + justify-content: space-between; + align-items: center; + height: 164px; + .rc-usercenter{ + width: 25%; + em{ + font-size: 18px; + } + } + .rc-image { + border: 1px solid #D8D8D8; + margin-left: 40px; + + img { + width: 96px; + height: 96px; + display: block; + + } + } + + .rc-right { + .rc-userbottom{ + display: none; + } + display: flex; + + width: 100%; + margin-left: 16px; + + em + { + font-style: normal; + font-weight: bold; + font-size: 16px; + margin-top: 18px; + + color: #E1001A; + } + } + .rc-userright { + display: flex; + flex-direction: column; + color: #666666; + font-size: 16px; + span{ + display: block; + margin-top: 6px; + } + } + .rc-userbottomm { + display: flex; + justify-content: space-between; + align-items: center; + width: 58%; + font-size: 20px; + color: #E1001A; + font-weight: bold; + i{ + font-style: normal; + + + } + } + + .pc-bottom { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + margin-right: 40px; + + span { + display: block; + width: 130px; + cursor: pointer; + display: flex; + align-items: center; + line-height: 40px; + font-weight: bold; + text-align: center; + color: #e2001a; + height: 40px; + border: 2px solid #e2001a; + justify-content: center; + border-radius: 30px; + } + span:last-child{ + margin-top: 15px; + } + } + } + + .rc-bottom { + display: none; + } + } + + .rc-title { + height: 55px; + display: flex; + align-items: center; + border-bottom: 1px solid #d8d8d8; + justify-content: space-between; + span{ + font-size: 16px; + color: #999999; + margin-left: 8px; + } + strong{ + font-style: normal; + font-size: 16px; + color: #444444; + } + em{ + font-style: normal; + font-size: 16px; + + color: #333333; + } + i{ + font-style: normal; + font-size: 16px; + margin-left: 40px; + + color: #333333; + } + .rc-usertitle{ + margin-right: 73px; + display: flex; + align-items: center; + em{ + display: block; + margin-left: 8px; + } + } + } + + + } + + + + + +} \ No newline at end of file diff --git a/rc-busness/components/addressInput.vue b/rc-busness/components/addressInput.vue index 369e83ee..93761a45 100644 --- a/rc-busness/components/addressInput.vue +++ b/rc-busness/components/addressInput.vue @@ -63,10 +63,9 @@ export default { { defaultValues = this.defaultValues; this.onConfirm(defaultValues); - } - else - { + else{ this.defaultValues = defaultValues; + } //Initilizing end }, diff --git a/rc-busness/pages/personal/useraddress.vue b/rc-busness/pages/personal/useraddress.vue index c9a878dc..3bbf2525 100644 --- a/rc-busness/pages/personal/useraddress.vue +++ b/rc-busness/pages/personal/useraddress.vue @@ -2,8 +2,8 @@
-
-
+
+
+
{{item.title}} @@ -22,7 +23,7 @@
-
+
订单编号:{{ item.orderNumber }} @@ -41,15 +42,13 @@
{{ item.usereat }}
- 规格:{{ userlist.num }} + 规格:{{ item.num }}
- 数量:{{ userlist.pcs}}件 - ¥{{ userlist.ecPrice }} + 数量:{{ item.pcs}}件 + ¥{{ item.ecPrice }}
- -
¥{{ item.userprice }} {{item.orderstype}} @@ -62,14 +61,13 @@ 查看订单
- +
-
@@ -300,360 +298,6 @@ async canceldanhao(orderNumber){ \ No newline at end of file diff --git a/rc-busness/pages/useraddress/addaddress.vue b/rc-busness/pages/useraddress/addaddress.vue index 2984e5f1..46592611 100644 --- a/rc-busness/pages/useraddress/addaddress.vue +++ b/rc-busness/pages/useraddress/addaddress.vue @@ -7,33 +7,31 @@

新增收货地址

收货人: - +
手机号码: - +
所在地区: - - + +
详细地址: - +
- - - + +
+
取消 - 确认 + 确认
- -
+ + +
+
取消 - 确认 + 确认
- - + @@ -40,13 +42,25 @@ import Myheader from '~/components/header.vue' import MyFooter from '~/components/rc-footer.vue' + import { editupdate} from "../../ajax/getData"; + import addressInput from '~/components/addressInput.vue' export default { data() { return { chosenAddressId: "1", checked: true, userid: null, + dialogInfo1:false, usermessage:null, + useradrname:[], + detailAddress:'', + recipientPhone:'', + recipient:'', + addressid:'', + provinceId:'', + cityId:'', + districtId:'', + defaultValues:[], list: [ { id: 1, @@ -71,26 +85,116 @@ export default { }; }, methods: { - onEdit(item, index) { - // let userid = item.id; - console.log(item); - this.$router.push({ - path: "/useraddress/editaddress", - query: { - id: item, - }, + onGetMenu(values){ + let user; + console.log(values,+'111111'); + console.log(typeof(values[2])); + const objToStr = JSON.stringify(values[2]); + console.log(objToStr); + console.log(typeof(objToStr)); + if(objToStr.includes('-')){ + console.log("===包含符号") + let user=values[2].id; + user=user.split('-'); + this.provinceId=user[0]; + this.cityId=user[1]; + this.districtId=user[2]; + }else{ + this.provinceId=values[0].id; + this.cityId=values[1].id; + this.districtId=values[2].id; + console.log("---不包含符号"); + } + // let user=values[2].id; + // user=user.split('-'); + + + console.log(this.provinceId,this.cityId,this.districtId); + }, + openclose(){ + this.$router.push({ + path: "/useraddress/openaddress", }); }, - onAdd(item, index) { - // let userid = item.id; - // console.log(item); - this.$router.push({ - path: "/useraddress/addaddress", - // query: { - // id: userid, - // }, - }); + handleClose1(){ + this.dialogInfo1 = false }, + + register(){ + console.log(this.tel) + if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.recipientPhone) || this.recipientPhone === "") { + this.$message({ + type: 'warning', + message: '手机号码输入有误' + }); + return + }else if(this.alladdress===''){ + this.$message({ + type: 'warning', + message: '请输入详细地址' + }); + return + } + else if(this.userpeople===''){ + this.$message({ + type: 'warning', + message: '请输入姓名' + }); + return + } + else if(this.provinceId===''){ + this.$message({ + type: 'warning', + message: '请填写省区' + }); + return + } + else if(this.userpeople===''){ + this.$message({ + type: 'warning', + message: '请填写市区' + }); + return + } + else if(this.userpeople===''){ + this.$message({ + type: '请填写街道', + message: '请输入姓名' + }); + return + } + + else{ + this.edupdate(); + } +}, + + //更改 + async edupdate(item) { + let useradd={ + memberId:this.userid, + id:this.id, + provinceId:this.provinceId,//省份id, + cityId:this.cityId,//城市id, + districtId:this.districtId,//区域id, + detailAddress:this.detailAddress, //详细地址 + recipient:this.recipient, //收件人姓名 + recipientPhone:this.recipientPhone, //收件人电话 + } + let data = await editupdate(useradd); + if(data){ + this.$message({ + type: 'warning', + message: '地址修改成功' + }); + this.$router.push({ + path: "/useraddress/openaddress", + }); + + } + + }, + @@ -114,13 +218,37 @@ export default { components: { Myheader, MyFooter, + addressInput }, + created(){ + let provinceName=this.$route.query.provinceName; + let districtName=this.$route.query.districtName; + let cityName=this.$route.query.cityName + this.provinceId=this.$route.query.provinceId; + this.districtId=this.$route.query.districtId; + this.cityId=this.$route.query.cityId; + this.defaultValues=[ + { + id:this.provinceId, + name:provinceName + }, + { + id:this.cityId, + name:cityName + }, + { + id:this.districtId, + name:districtName + } + ]; + }, mounted() { - //地址的查询 - // this.usermessage = JSON.parse(localStorage.getItem("userInfo")); - // this.editaddress(this.usermessage); - // this.userid = this.usermessage.data.id; + this.userid = JSON.parse(localStorage.getItem("userInfo")).data.id; + this.recipient=this.$route.query.recipient + this.recipientPhone=this.$route.query.recipientPhone + this.detailAddress=this.$route.query.detailAddress + this.id=this.$route.query.id; }, }; diff --git a/rc-busness/pages/useraddress/openaddress.vue b/rc-busness/pages/useraddress/openaddress.vue index 7a038389..60fabf15 100644 --- a/rc-busness/pages/useraddress/openaddress.vue +++ b/rc-busness/pages/useraddress/openaddress.vue @@ -1,25 +1,29 @@ @@ -138,4 +187,4 @@ export default { + \ No newline at end of file diff --git a/rc-busness/static/images/adddress.png b/rc-busness/static/images/adddress.png new file mode 100644 index 00000000..5eebb39c Binary files /dev/null and b/rc-busness/static/images/adddress.png differ diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/alipay/conf/AlipayConfig.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/alipay/conf/AlipayConfig.java index 23fe2371..4649b18f 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/alipay/conf/AlipayConfig.java +++ b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/alipay/conf/AlipayConfig.java @@ -18,20 +18,20 @@ public class AlipayConfig { //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ // 应用ID,您的APPID,收款账号既是您的APPID对应支付宝账号 - public static String app_id = "2016101800716209"; -// public static String app_id = "2021000118668627"; +// public static String app_id = "2016101800716209"; + public static String app_id = "2021003108690157"; // 商户私钥,您的PKCS8格式RSA2私钥 - public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDL8350XEsOVVSg8+cKZEl6Jx7Tp63JFimk+lldS8chZ8hv3Netz5iMemQJYH328VEB5sKkIXfDiwT1fxR2cgsGdQgmG25omKM/47QfxTRp9C4II65AlMfLsPWOWefc/enaza/gMMzB5SvvFnbpX/71aJmqU7nJvATY8MwW4SxKXKMTEI/K7+jERReR4SxtGHeFTZ892ljr7IOqJbGP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k8hZnB59+zahu+LECeEUlUUv/6xZd1x+zgUKQ72sEUy1wheG6uiqcSnzfA/SFfDLAXKNZtwcW+WJaWisfAsK1h4+SDHk91MruwerjHZAQKBgH6muiaSlg6DvAUBjtxaOE0bgchI+M/j7N4289syb/6A0iTUNeTREWk2kmBT/ZeZCFtrjJx+TdVauyjkRwKx0wEuf9H+WrUM+6i5j5nTrcUEAUTjCY7IRxGk8uhNLM7cyBNvpsD4olI5j2DmRsZWnv/bNuJH2FHbvXMwanZ22vM5"; - +// public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDL8350XEsOVVSg8+cKZEl6Jx7Tp63JFimk+lldS8chZ8hv3Netz5iMemQJYH328VEB5sKkIXfDiwT1fxR2cgsGdQgmG25omKM/47QfxTRp9C4II65AlMfLsPWOWefc/enaza/gMMzB5SvvFnbpX/71aJmqU7nJvATY8MwW4SxKXKMTEI/K7+jERReR4SxtGHeFTZ892ljr7IOqJbGPnd2CXzLO05AGGhOrsmtFMh9eysD1WzcDKoADJSi26oMI49mExGo3jMF111AcXSR4CgLsx5bSoe4XtXtVbqEr/tOCt4zAWoUbu/Mviog+60eMr9qaE719aobEZP7aI5ECd86NAgMBAAECggEAXRVBtqvU2bLaUCdhYF3LJ0QpjqIt7+P8l75nAOyv8rAiS+O4UCy6TAskEx+F/im/NiXy2eQofAe7+KvKVBDStVy+nl3Qs05O2776G7HurRjz1WUrh3AgC/g06oZgC32buPA9gA3ltez5c0KGfRcCD1FxKMrTtZ3pfHXSP/L/OuRhobxCZvEL5jcWHkxgOeaL37+UQSHJe3dhCPjjj1VOxBj0RLgcAPJ8/KoglcmWHacYvPxgRo26xahrW3yCofcb+cEzG5WhCc3uBK3eSWNB1knSwl2gVMcGmN8gOPBpAneSjqv6pqWUqgAOENxi2kRZYDyTNi3JHt2ZJMdDblU8AQKBgQD2Z+CjGGloaQTvcow/dqxF4a5EAnjeUSA+cdw7ttNqvszNofjvxv9RULK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U2ioS9IfXs2vXGXvq4ER5quwzEBOeEhYi3WFsDpJdXlHx1fnJyh0hk/eQVrd4jS9odAoWqA0HvCEVnjpjRX4jrfHZ0XjHPx6FdSt93q2myb6jo9AoGAEO55XOywOuPi9SjdnPq1dgFiD+KrwxaxjapB2u0wQVdmpDtQEVo4sf30afr2zHZ/zUHGaQpAJwDnvTFhsifzkG0jmErBC+Pp9Xz217/kLN1gPqB/cs24gkyOvm4i8Xc7ofjMhRv1RDg2geFBBhZjc29hhTRwrGB0ST0XRXDsK6A="; // 支付宝公钥,查看地址:https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。 -// public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy/N+dFxLDlVUoPPnCmRJeice06etyRYppPpZXUvHIWfIb9zXrc+YjHpkCWB99vFRAebCpCF3w4sE9X8UdnILBnUIJhtuaJijP+O0H8U0afQuCCOuQJTHy7D1jlnn3P3p2s2v4DDMweUr7xZ26V/+9WiZqlO5ybwE2PDMFuEsSlyjExCPyu/oxEUXkeEsbRh3hU2fPdpY6+yDqiWxj53dgl8yztOQBhoTq7JrRTIfXsrA9Vs3AyqAAyUotuqDCOPZhMRqN4zBdddQHF0keAoC7MeW0qHuF7V7VW6hK/7TgreMwFqFG7vzL4qIPutHjK/amhO9fWqGxGT+2iORAnfOjQIDAQAB"; - public static String alipay_public_key ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjBThgyJ3SJsx0IYUspiW+R/NDInruz2Tirr0vGmzfaNkBSDmyg2vNLmnkNrxbHApJkIRKWqGbC8yPybyjFz1nXP7oji0d/3sPKZZGdNEqOcZLaki8xPeXfOVu1T/uPH/9S084t94yQPNrD9BqehOlN+I4b/mXJ7tDGRnS2OVrQqDrPbg8pjH3OYa0bELkr71R92EHxCN4V2bSdCS1ag96/etgkodduOCmiBPVSmSRXas/GpRw92NVsRKvesWOatfjEjqST0Bz0nRuOuRnQIy1exxs/D2DHCVa6aO6TNogcPWe3C9dvxjxjw9IOiyhkGThWoWrdk8Ot+V8V8LeomcYwIDAQAB"; +// public static String alipay_public_key ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjBThgyJ3SJsx0IYUspiW+R/NDInruz2Tirr0vGmzfaNkBSDmyg2vNLmnkNrxbHApJkIRKWqGbC8yPybyjFz1nXP7oji0d/3sPKZZGdNEqOcZLaki8xPeXfOVu1T/uPH/9S084t94yQPNrD9BqehOlN+I4b/mXJ7tDGRnS2OVrQqDrPbg8pjH3OYa0bELkr71R92EHxCN4V2bSdCS1ag96/etgkodduOCmiBPVSmSRXas/GpRw92NVsRKvesWOatfjEjqST0Bz0nRuOuRnQIy1exxs/D2DHCVa6aO6TNogcPWe3C9dvxjxjw9IOiyhkGThWoWrdk8Ot+V8V8LeomcYwIDAQAB"; +// public static String alipay_public_key ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr+fwsHUR8dosvQlrQk1uKu8bzWtt4BHRIK4PsY5IVPUuk/NbcSXH9HC/tyj/L4L68/9pxteG7nGMioveqSMx8d5jhf/1sHsBC2C/BiffjzfiaeKsPqIag2jM0GNVFnrtmx1xeKYwx8T3X87BH7T4lcrOqsjt7JCtXDgWlttEpiIJTLTPOgtMlFPLkwvvp/Dlc0f+t2Bo9bHaCkrOkq3AC9TACEzXCVBKIP670MD0rTLnCEr3E/9oKzQazcCydzj548LAmwSQ660Wh+w6pZrL8p43ODski4sbl5ulidw7MklDHKOdZFj/tWf2NqMQjmAdmthZ5oGilJhiLvHiUR1YyQIDAQAB"; + public static String alipay_public_key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnxj/9qwVfgoUh/y2W89L6BkRAFljhNhgPdyPuBV64bfQNN1PjbCzkIM6qRdKBoLPXmKKMiFYnkd6rAoprih3/PrQEB/VsW8OoM8fxn67UDYuyBTqA23MML9q1+ilIZwBC2AQ2UBVOrFXfFl75p6/B5KsiNG9zpgmLCUYuLkxpLQIDAQAB"; // 服务器异步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问 -// public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp"; - public static String notify_url = "http://localhost:10086/smart-admin-api/royalcanin/notify_url"; + public static String notify_url = "https://royalcanincn.escase.cn/jc/royalcanin/royalcanin/updateOrderAliPay"; // 页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问 - public static String return_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp"; + public static String return_url = "https://royalcanincn.escase.cn/jc/royalcanin/royalcanin/updateOrderAliPay"; // 签名方式 public static String sign_type = "RSA2"; @@ -40,7 +40,7 @@ public class AlipayConfig { public static String charset = "utf-8"; // 支付宝网关 - public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do"; + public static String gatewayUrl = "https://openapi.alipay.com/gateway.do"; // 支付宝网关 public static String log_path = "C:\\"; diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/GoodController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/GoodController.java index 7a1cb1c4..c414b6d3 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/GoodController.java +++ b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/GoodController.java @@ -5,6 +5,7 @@ package net.lab1024.smartadmin.module.system.royalcanin.good; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import net.lab1024.smartadmin.common.anno.OperateLog; +import net.lab1024.smartadmin.common.constant.ResponseCodeConst; import net.lab1024.smartadmin.common.domain.ResponseDTO; import net.lab1024.smartadmin.common.heartbeat.StringUtil; import net.lab1024.smartadmin.constant.SwaggerTagConst; @@ -59,10 +60,11 @@ public class GoodController { @ApiOperation(value = "处方粮商品", notes = "处方粮商品查询") @PostMapping("royalcanin/goods") - public List transferGoods(String goodsName) { - return goodService.listGoodsByNameBankNameTagUsedAge(goodsName); + public List transferGoods(String goodsName,String petType) { + return goodService.listGoodsByNameBankNameTagUsedAge(goodsName,petType); } + @ApiOperation(value = "查询标品信息", notes = "查询标品信息") @PostMapping("royalcanin/product/query") public String transferBrand(ProductQueryEntity productQueryEntity) throws Exception { @@ -164,21 +166,26 @@ public class GoodController { @ApiOperation(value = "插入购物车信息", notes = "插入购物车信息") @PostMapping("royalcanin/insertCartProductInfo") - public ResponseDTO insertCartProductInfo(@RequestBody CartEntity cartEntity){ - - CartEntity cartEntityFromDB = cartService.getInfoByProductCodeAndMemberId(cartEntity.getMemberId(),cartEntity.getProductCode()); - if (null == cartEntityFromDB){ - if (1 == cartService.insertProductCart(cartEntity)) - return ResponseDTO.succ(); - else - return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_FAIL); - }else{ - int buyCountTotal = cartEntity.getBuyCount()+ cartEntityFromDB.getBuyCount(); - cartEntityFromDB.setBuyCount(buyCountTotal); - if (1 == cartService.updateInfo(cartEntityFromDB)) - return ResponseDTO.succ(); - else - return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_FAIL); + public ResponseDTO insertCartProductInfo(@RequestBody CartEntity cartEntity,HttpServletRequest request){ + String memberId = SmartJWTUtil.decodeToken(request.getHeader(TOKEN_NAME)); + cartEntity.setMemberId(memberId); + if(cartEntity.getProductCode() != null&&cartEntity.getProductCode() != ""&&cartEntity.getProductName() != null&&cartEntity.getProductName() != ""&&cartEntity.getMemberId() != null&&cartEntity.getMemberId() != "") { + CartEntity cartEntityFromDB = cartService.getInfoByProductCodeAndMemberId(cartEntity.getMemberId(), cartEntity.getProductCode()); + if (null == cartEntityFromDB) { + if (1 == cartService.insertProductCart(cartEntity)) + return ResponseDTO.succ(); + else + return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_FAIL); + } else { + int buyCountTotal = cartEntity.getBuyCount() + cartEntityFromDB.getBuyCount(); + cartEntityFromDB.setBuyCount(buyCountTotal); + if (1 == cartService.updateInfo(cartEntityFromDB)) + return ResponseDTO.succ(); + else + return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM); + } + }else { + return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM); } } diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/OrderController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/OrderController.java index 83877afe..066b22cc 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/OrderController.java +++ b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/OrderController.java @@ -203,6 +203,12 @@ public class OrderController { wxpayService.orderCallBack(request,response); } + @ApiOperation(value = "支付宝更新订单", notes = "支付宝更新订单") + @RequestMapping(value = "royalcanin/updateOrderAlipay") + public void updateOrderAlipay(HttpServletRequest request, HttpServletResponse response){ +// aliPayService.orderCallBackAliPay(request,response); + } + @ApiOperation(value = "取消订单", notes = "取消订单") @RequestMapping(value = "royalcanin/cancelOrder",method = RequestMethod.POST) public ResponseDTO cancelOrder(@RequestBody QueryEntity queryEntity) throws Exception { @@ -213,53 +219,31 @@ public class OrderController { @ApiOperation(value = "支付宝支付订单", notes = "生成订单") @PostMapping("royalcanin/generateOrderAlipay") - public ResponseDTO generateOrderAliPay(@RequestBody List ordersEntityList) throws Exception { - StringBuffer productId = new StringBuffer(); - StringBuffer productName = new StringBuffer(); - String memberId = ""; - String mobile = ""; - int buyCount = 0; - double total_fee = 0 ; - AliPayEntity aliPayEntity = new AliPayEntity(); - OrdersEntity ordersEntity = new OrdersEntity(); - JSONArray orderDatilListJson = new JSONArray(); - for (OrdersEntity ordersEntitys:ordersEntityList) { - //存储orderDetailList - OrderDatilListEntity orderDatilListEntity= new OrderDatilListEntity(); - orderDatilListEntity.setProductName(ordersEntitys.getProductName()); - orderDatilListEntity.setPcs(ordersEntitys.getBuyCount()); - orderDatilListEntity.setProductCode(ordersEntitys.getProductCode()); - orderDatilListEntity.setEcPrice(ordersEntitys.getPayAmount()); - orderDatilListJson.add(orderDatilListEntity); - - - productId.append(ordersEntitys.getProductCode()+","); - productName.append(ordersEntitys.getProductName()+","); - if(ordersEntitys.getPayAmount() != "0"){ - total_fee = total_fee + (Double.parseDouble(ordersEntitys.getPayAmount()) * ordersEntitys.getBuyCount()) - Double.parseDouble(ordersEntitys.getCouponAmount()); - }else { - total_fee = total_fee + Double.parseDouble(ordersEntitys.getPayAmount())*ordersEntitys.getBuyCount(); + public ResponseDTO generateOrderAliPay(String orderNo) throws Exception { + OrderEntity ordersEntity = orderService.findByOrderId(orderNo); + if(ordersEntity != null) { + QueryEntity queryEntity = new QueryEntity(); + queryEntity.setOrderNumber(ordersEntity.getOrderNo()); + String orderInfo = orderService.query(queryEntity); + com.alibaba.fastjson.JSONArray jsonArray = JSONObject.parseArray(orderInfo); + JSONObject jsonObject = (JSONObject)jsonArray.get(0); + if(jsonObject.getString("status").equals("0")) { + AliPayEntity aliPayEntity = new AliPayEntity(); + ordersEntity.setPayType("2"); + ordersEntity.setOrderStatus("0"); + if (orderService.updateOrder(ordersEntity) == 1) { + aliPayEntity.setProduct_code(ordersEntity.getProductCode()); + aliPayEntity.setTotal_amount(ordersEntity.getOrderAmount()); + aliPayEntity.setOut_trade_no(ordersEntity.getOrderNo()); + return ResponseDTO.succData(aliPayService.generateQRCode(aliPayEntity)); + } else { + return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_FAIL); + } + }else{ + return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_ERROR); } - memberId = ordersEntitys.getMemberId(); - mobile = ordersEntitys.getPhoneNumber(); - buyCount = buyCount + ordersEntitys.getBuyCount(); - } - ordersEntity.setProductCode(productId.substring(0,productId.length()-1)); - ordersEntity.setProductName(productName.substring(0,productName.length()-1)); - ordersEntity.setOrderAmount(StringUtil.toString(total_fee)); - ordersEntity.setMemberId(memberId); - ordersEntity.setPhoneNumber(mobile); - ordersEntity.setBuyCount(buyCount); - ordersEntity.setPayType("2"); - ordersEntity.setOrderNo(GenerateSequenceUtil.generateSequenceNo()); - ordersEntity.setOrderStatus("0"); - if(orderService.generateOrder(ordersEntity,orderDatilListJson) == 1){ - aliPayEntity.setProduct_code(ordersEntity.getProductCode()); - aliPayEntity.setTotal_amount(StringUtil.toString(total_fee)); - aliPayEntity.setOut_trade_no(ordersEntity.getOrderNo()); - return ResponseDTO.succData(aliPayService.generateQRCode(aliPayEntity)); - }else { - return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_FAIL); + }else{ + return ResponseDTO.wrap(OrderResponseCodeConst.WITHOUT_ORDER); } } diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/dao/GoodsDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/dao/GoodsDao.java index ed61d985..4915438e 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/dao/GoodsDao.java +++ b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/dao/GoodsDao.java @@ -15,6 +15,6 @@ public interface GoodsDao extends BaseMapper { GoodsEntity findByProductCode(String productCode); - List selectRoleIdByGoodsNameBankNameTagUsedAge(String goodsName); + List selectRoleIdByGoodsNameBankNameTagUsedAge(@Param("goodsName") String goodsName,@Param("petType")String petType); } diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/model/GoodsEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/model/GoodsEntity.java index 4a5c82c3..61bf17fe 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/model/GoodsEntity.java +++ b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/model/GoodsEntity.java @@ -2,13 +2,17 @@ package net.lab1024.smartadmin.module.system.royalcanin.good.model; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; +import net.lab1024.smartadmin.util.SmartIPUtil; @Data @TableName("t_good_goods") public class GoodsEntity { - private String productName; - private String basePrice; + private Long id; + + private String name; + +// private String ecPrice; private String productCode; @@ -22,7 +26,8 @@ public class GoodsEntity { private String tagUsedAge; - private String picFile; + + private String picture; private String showImgFile; diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/model/OrderEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/model/OrderEntity.java index 6889f103..b9c97ebf 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/model/OrderEntity.java +++ b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/model/OrderEntity.java @@ -9,6 +9,8 @@ import java.util.Date; @TableName("t_good_orders") public class OrderEntity { + private Long id; + private String orderNo; private String orderStatus; diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/service/GoodService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/service/GoodService.java index a2021b3a..d3f2925b 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/service/GoodService.java +++ b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/service/GoodService.java @@ -10,10 +10,12 @@ import net.lab1024.smartadmin.module.system.royalcanin.good.model.ProductQueryEn import net.lab1024.smartadmin.util.AESUtil; import net.lab1024.smartadmin.util.MapRemoveNullUtil; import net.lab1024.smartadmin.util.SmartHttpUtil; +import net.lab1024.smartadmin.util.SmartIPUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -34,8 +36,14 @@ public class GoodService { return goodsDao.findByProductCode(productCode); } - public List listGoodsByNameBankNameTagUsedAge(String title){ - return goodsDao.selectRoleIdByGoodsNameBankNameTagUsedAge(title); + public List listGoodsByNameBankNameTagUsedAge(String title,String petType){ + String ip = "https://royalcanincn.escase.cn/jc/royalcanin/"; + List goodsList = goodsDao.selectRoleIdByGoodsNameBankNameTagUsedAge(title,petType); + for (GoodsEntity goodsEntity:goodsList) { + goodsEntity.setShowImgFile(ip+goodsEntity.getPicture()); + goodsEntity.setPicture(ip+goodsEntity.getPicture()); + } + return goodsList; } public String brandQuery(ProductQueryEntity productQueryEntity) throws Exception { diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/service/OrderService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/service/OrderService.java index ff69b234..60e9f3e0 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/service/OrderService.java +++ b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/royalcanin/good/service/OrderService.java @@ -269,4 +269,8 @@ public class OrderService { return ordersDao.findByOrderId(orderNo); } + + public int updateOrder(OrderEntity orderEntity){ + return ordersDao.updateById(orderEntity); + } } diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/royalcanin/good/GoodMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/royalcanin/good/GoodMapper.xml index b9a8daef..66499bc9 100644 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/royalcanin/good/GoodMapper.xml +++ b/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/royalcanin/good/GoodMapper.xml @@ -10,17 +10,25 @@ \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/sql/smart-admin.sql b/smart-admin-service/smart-admin-api/src/main/resources/sql/smart-admin.sql index f5941deb..4b5378b2 100644 --- a/smart-admin-service/smart-admin-api/src/main/resources/sql/smart-admin.sql +++ b/smart-admin-service/smart-admin-api/src/main/resources/sql/smart-admin.sql @@ -1653,14 +1653,14 @@ PRIMARY KEY (`id`) CREATE TABLE `t_good_goods` ( `id` int(11) NOT NULL AUTO_INCREMENT, `product_code` VARCHAR(20) NOT NULL COMMENT '标品编码', -`product_name` varchar(20) DEFAULT NULL COMMENT '产品名称', -`base_price` varchar(11) DEFAULT NULL COMMENT '价格', +`name` varchar(20) DEFAULT NULL COMMENT '产品名称', +`ec_price` varchar(11) DEFAULT NULL COMMENT '价格', `brand_code` varchar(11) DEFAULT NULL COMMENT '品牌编码', `brand_name` varchar(11) DEFAULT NULL COMMENT '品牌名称', `category_name` varchar(11) DEFAULT NULL COMMENT '品类', `pet_type` int(11) DEFAULT NULL COMMENT '宠物类型1:狗0:猫', `tagUsedAge` varchar(11) DEFAULT NULL COMMENT '适用阶段', -`pic_file` varchar(200) DEFAULT NULL COMMENT '标品头图', +`picture` varchar(200) DEFAULT NULL COMMENT '标品头图', `show_img_file` varchar(200) DEFAULT NULL COMMENT '身体头图', `isSales` int(11) DEFAULT NULL COMMENT '0:未销售,1:销售', `isShow` int(11) DEFAULT NULL COMMENT '0:不展示,1:展示',