mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-03 02:36:39 +08:00
Merge branch 'sit-Carl' into sit-Leung
This commit is contained in:
commit
61c365c3fc
@ -154,6 +154,17 @@ export const userLongin = (mobile, pet,address) => {
|
|||||||
}
|
}
|
||||||
return fetch('member?type=get', data, 'POST' )
|
return fetch('member?type=get', data, 'POST' )
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 登录和注册
|
||||||
|
*/
|
||||||
|
export const userregOrLogin = (mobile) => {
|
||||||
|
var data = {
|
||||||
|
id:'',
|
||||||
|
mobile:mobile,
|
||||||
|
}
|
||||||
|
return fetch('regOrLogin?phoneNumber='+ mobile , data, 'POST' )
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//注册
|
//注册
|
||||||
export const useredit = (mobile, pet,address) => {
|
export const useredit = (mobile, pet,address) => {
|
||||||
|
@ -241,7 +241,7 @@
|
|||||||
width:100%;
|
width:100%;
|
||||||
height:100%;
|
height:100%;
|
||||||
background:url("../image/btn-play.png") center center no-repeat;
|
background:url("../image/btn-play.png") center center no-repeat;
|
||||||
background-size:90px 90px;
|
background-size:48px 48px;
|
||||||
z-index:2;
|
z-index:2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ ul li ol li em strong i {
|
|||||||
list-style: none;
|
list-style: none;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rc-main {
|
.rc-main {
|
||||||
//rc-main start
|
//rc-main start
|
||||||
margin-top:.23rem;
|
margin-top:.23rem;
|
||||||
|
@ -10,10 +10,12 @@
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ts-tag-list {
|
.ts-tag-list {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
margin-top: 20px;
|
||||||
em {
|
em {
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -52,6 +54,13 @@
|
|||||||
color: #333333;
|
color: #333333;
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
}
|
}
|
||||||
|
.ts-record {
|
||||||
|
font-size: 12px;
|
||||||
|
margin-left: 16px;
|
||||||
|
font-style: normal;
|
||||||
|
color: #333333;
|
||||||
|
display:inline-block;
|
||||||
|
}
|
||||||
.ts-row-title + i {
|
.ts-row-title + i {
|
||||||
color: #666666;
|
color: #666666;
|
||||||
display:inline-flex;
|
display:inline-flex;
|
||||||
@ -115,6 +124,14 @@
|
|||||||
}
|
}
|
||||||
// 手机端
|
// 手机端
|
||||||
@media screen and (max-width:768px) {
|
@media screen and (max-width:768px) {
|
||||||
|
.uservideo{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
video{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
.ts-ecprice{
|
.ts-ecprice{
|
||||||
font-size:.625rem;
|
font-size:.625rem;
|
||||||
}
|
}
|
||||||
@ -287,12 +304,13 @@
|
|||||||
}
|
}
|
||||||
.productdetails {
|
.productdetails {
|
||||||
margin-top: 19px;
|
margin-top: 19px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.rc-productdeta {
|
.rc-productdeta {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
.rc-prodtop {
|
.rc-prodtop {
|
||||||
display: flex;
|
// display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
span {
|
span {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@ -357,11 +375,17 @@
|
|||||||
.ts-row-title{
|
.ts-row-title{
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
width:82px;
|
width:82px;
|
||||||
|
|
||||||
}
|
}
|
||||||
.ts-row-title + i {
|
.ts-row-title + i {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
max-width:596px;
|
max-width:596px;
|
||||||
}
|
}
|
||||||
|
.ts-row-record{
|
||||||
|
color: #999;
|
||||||
|
margin-left: 12px;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.rc-button{
|
.rc-button{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -536,7 +560,7 @@
|
|||||||
.rc-productdeta {
|
.rc-productdeta {
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
.rc-prodtop {
|
.rc-prodtop {
|
||||||
display: flex;
|
// display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
span {
|
span {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
@ -308,7 +308,7 @@
|
|||||||
<li class="rc-list__item">
|
<li class="rc-list__item">
|
||||||
<a class="rc-list__link rc-icon ts-login--xs rc-iconography--xs" role="menuitem" @click="turnlogin">
|
<a class="rc-list__link rc-icon ts-login--xs rc-iconography--xs" role="menuitem" @click="turnlogin">
|
||||||
个人中心
|
个人中心
|
||||||
<em class="rc-screen-reader" v-if="loginornot"></em>
|
<em class="rc-screen-reader" v-show="loginornot"></em>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="rc-list__item">
|
<li class="rc-list__item">
|
||||||
@ -353,7 +353,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
headerScroll:false,
|
headerScroll:false,
|
||||||
loginornot:true,//用户是否登录提示点
|
loginornot:false,//用户是否登录提示点
|
||||||
usermessage:null,//存储用户信息
|
usermessage:null,//存储用户信息
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,12 @@
|
|||||||
rc-border-colour--brand4
|
rc-border-colour--brand4
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div class="rc-column">
|
<div class="uservideo" v-if="videoshow">
|
||||||
|
<video controls="" preload="videoimg">
|
||||||
|
<source :src= videolist type="video/mp4">
|
||||||
|
</video>
|
||||||
|
</div>
|
||||||
|
<div class="rc-column" v-if="!videoshow">
|
||||||
<div data-js-carousel="" data-image-gallery="true">
|
<div data-js-carousel="" data-image-gallery="true">
|
||||||
<div
|
<div
|
||||||
class="rc-carousel rc-carousel__gallery-image"
|
class="rc-carousel rc-carousel__gallery-image"
|
||||||
@ -108,7 +113,7 @@
|
|||||||
<span>{{ curItem.categoryName }}</span>
|
<span>{{ curItem.categoryName }}</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="rc-button ">
|
<div class="rc-button" v-if="!userbuy">
|
||||||
<span @click="chuafangbuy()">立即购买</span>
|
<span @click="chuafangbuy()">立即购买</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -119,6 +124,11 @@
|
|||||||
<span class="ts-remove ts-ecprice"
|
<span class="ts-remove ts-ecprice"
|
||||||
>¥{{ curItem.rsp }}
|
>¥{{ curItem.rsp }}
|
||||||
</span>
|
</span>
|
||||||
|
<span class="ts-record" v-if="curItem.basePoint!==0">
|
||||||
|
购买该商品你将获得{{curItem.basePoint}}积分
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- <span class="rc-title">购买该商品你将得到22积分</span> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="rc-productdetai" v-if="userbuy">
|
<div class="rc-productdetai" v-if="userbuy">
|
||||||
<div>
|
<div>
|
||||||
@ -274,7 +284,9 @@
|
|||||||
<span @click="usertanchu(curItem, 0)">加入购物车</span>
|
<span @click="usertanchu(curItem, 0)">加入购物车</span>
|
||||||
<span @click="usertanchu(curItem, 1)">立即购买</span>
|
<span @click="usertanchu(curItem, 1)">立即购买</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="rc-button rc-md-down " v-if="(!userbuy)">
|
||||||
|
<span @click="chuafangbuy()" style="margin-right: 20px">立即购买</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -304,6 +316,7 @@ export default {
|
|||||||
let newlist = [];
|
let newlist = [];
|
||||||
let curItem = {};
|
let curItem = {};
|
||||||
let chufang = {};
|
let chufang = {};
|
||||||
|
let videolist=[];
|
||||||
let productAttachmentList = [];
|
let productAttachmentList = [];
|
||||||
let userlistmenu = [];
|
let userlistmenu = [];
|
||||||
isRxGoods = (isRxGoods == '1'?true:false);
|
isRxGoods = (isRxGoods == '1'?true:false);
|
||||||
@ -318,7 +331,6 @@ export default {
|
|||||||
let data = await oncequery(mainProductCode);
|
let data = await oncequery(mainProductCode);
|
||||||
let outputObj = {};
|
let outputObj = {};
|
||||||
if (data) {
|
if (data) {
|
||||||
console.log(data);
|
|
||||||
chufang=data;
|
chufang=data;
|
||||||
outputObj = data;
|
outputObj = data;
|
||||||
outputObj.productName = data.name;
|
outputObj.productName = data.name;
|
||||||
@ -340,6 +352,7 @@ export default {
|
|||||||
let data = await goodsmessage(singleCode);
|
let data = await goodsmessage(singleCode);
|
||||||
if (data && data.data.length>0) {
|
if (data && data.data.length>0) {
|
||||||
newlist.push(data.data[0]);
|
newlist.push(data.data[0]);
|
||||||
|
|
||||||
if(data.data[0].leftAllotment>0 && !stopLeftAllotmentChecking) {
|
if(data.data[0].leftAllotment>0 && !stopLeftAllotmentChecking) {
|
||||||
activeIndexa = stopIndex;
|
activeIndexa = stopIndex;
|
||||||
curItem = data.data[0];
|
curItem = data.data[0];
|
||||||
@ -350,6 +363,8 @@ export default {
|
|||||||
}
|
}
|
||||||
if(curItem.productAttachmentList != undefined)
|
if(curItem.productAttachmentList != undefined)
|
||||||
productAttachmentList = curItem.productAttachmentList;
|
productAttachmentList = curItem.productAttachmentList;
|
||||||
|
let list=[];
|
||||||
|
|
||||||
if(curItem.productName == undefined)
|
if(curItem.productName == undefined)
|
||||||
curItem = newlist[0];
|
curItem = newlist[0];
|
||||||
userbuy = true;
|
userbuy = true;
|
||||||
@ -364,12 +379,14 @@ export default {
|
|||||||
title: curItem.productName,
|
title: curItem.productName,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
console.log(curItem);
|
||||||
return {
|
return {
|
||||||
crumbs,
|
crumbs,
|
||||||
activeIndexa,
|
activeIndexa,
|
||||||
curItem,
|
curItem,
|
||||||
newlist,
|
newlist,
|
||||||
chufang,
|
chufang,
|
||||||
|
videolist,
|
||||||
productAttachmentList,
|
productAttachmentList,
|
||||||
userbuy
|
userbuy
|
||||||
}
|
}
|
||||||
@ -380,6 +397,9 @@ export default {
|
|||||||
userimage: require("../../assets/image/unused.png"),
|
userimage: require("../../assets/image/unused.png"),
|
||||||
gotop: false,
|
gotop: false,
|
||||||
dialogInfo1: false,
|
dialogInfo1: false,
|
||||||
|
videolist:[],
|
||||||
|
videoimg:'',
|
||||||
|
videoshow: false,
|
||||||
name: [],
|
name: [],
|
||||||
userlist: [],
|
userlist: [],
|
||||||
drawlist: [], //用户可以领取的优惠券
|
drawlist: [], //用户可以领取的优惠券
|
||||||
@ -449,9 +469,23 @@ export default {
|
|||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.checkIsLogin();
|
this.checkIsLogin();
|
||||||
|
// console.log(this.curItem);
|
||||||
if (this.usermessage !== "" || this.usermessage.data !== undefined) {
|
if (this.usermessage !== "" || this.usermessage.data !== undefined) {
|
||||||
this.usermessage = this.$store.state.userInfo;
|
this.usermessage = this.$store.state.userInfo;
|
||||||
this.productCode = this.$route.query.productCode;
|
this.productCode = this.$route.query.productCode;
|
||||||
|
//video显示
|
||||||
|
this.productAttachmentList.map(element=>{
|
||||||
|
if(element.attachmentPath.substring(element.attachmentPath.lastIndexOf(".")+1)=='mp4'){
|
||||||
|
this.videolist=element.attachmentPath;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.videoimg=this.productAttachmentList[0].attachmentPath;
|
||||||
|
if(this.videolist.length>0){
|
||||||
|
this.videoshow=true
|
||||||
|
}else{
|
||||||
|
this.videoshow=false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
let stype = this.$route.query.stype;
|
let stype = this.$route.query.stype;
|
||||||
let isRxGoods = this.$route.query.isRxGoods;
|
let isRxGoods = this.$route.query.isRxGoods;
|
||||||
@ -508,10 +542,11 @@ export default {
|
|||||||
async userquery() {
|
async userquery() {
|
||||||
let data = await goodsmessage(this.productCode);
|
let data = await goodsmessage(this.productCode);
|
||||||
if (data) {
|
if (data) {
|
||||||
|
console.log(data)
|
||||||
|
debugger
|
||||||
this.newlist = data.data;
|
this.newlist = data.data;
|
||||||
}
|
}
|
||||||
this.productAttachmentList = this.newlist[0].productAttachmentList;
|
this.productAttachmentList = this.newlist[0].productAttachmentList;
|
||||||
|
|
||||||
this.userlistmenu = this.newlist[0].productAttachmentList;
|
this.userlistmenu = this.newlist[0].productAttachmentList;
|
||||||
let changemess = JSON.stringify(this.userlistmenu);
|
let changemess = JSON.stringify(this.userlistmenu);
|
||||||
this.changemessage({ data: changemess });
|
this.changemessage({ data: changemess });
|
||||||
@ -521,6 +556,8 @@ export default {
|
|||||||
let data = await oncequery(this.productCode);
|
let data = await oncequery(this.productCode);
|
||||||
let outputObj = {};
|
let outputObj = {};
|
||||||
if (data) {
|
if (data) {
|
||||||
|
console.log(data);
|
||||||
|
debugger
|
||||||
outputObj = data;
|
outputObj = data;
|
||||||
outputObj.productName = data.name;
|
outputObj.productName = data.name;
|
||||||
outputObj.picture = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.picture;
|
outputObj.picture = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.picture;
|
||||||
|
@ -75,10 +75,10 @@
|
|||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@click="checkBox($event,2)"
|
@click="checkBoxa($event,2)"
|
||||||
v-model="inRank"
|
v-model="isRank"
|
||||||
/>
|
/>
|
||||||
<strong>本人已年满16周岁,同意并接受公司按<a href="https://royalcanin.com.cn/privacy"><i>《隐私政策》</i></a>及<a href="https://royalcanin.com.cn/declaration"><i>《法律声明》</i></a>的规定收集和处理我的个人信息。
|
<strong>本人已年满16周岁,同意并接受公司按<a href="https://royalcanin.com.cn/privacy" target="_blank"><i>《隐私政策》</i></a>及<a href="https://royalcanin.com.cn/declaration" target="_blank"><i>《法律声明》</i></a>的规定收集和处理我的个人信息。
|
||||||
您可以就隐私问题通过隐私政策中的方式联系我们并行使您的个人信息权利。</strong>
|
您可以就隐私问题通过隐私政策中的方式联系我们并行使您的个人信息权利。</strong>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@ -86,18 +86,18 @@
|
|||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@click="checkBox($event,3)"
|
@click="checkBoxa($event,1)"
|
||||||
v-model="inRanka"
|
v-model="isRanka"
|
||||||
/>
|
/>
|
||||||
<strong>
|
<strong>
|
||||||
我已阅读和了解皇家爱宠荟的<a href="https://royalcanin.com.cn/member-principle"><i>《会员规则》</i></a>并同意接受其中所有的条框。</strong>
|
我已阅读和了解皇家爱宠荟的<a href="https://royalcanin.com.cn/member-principle" target="_blank"><i>《会员规则》</i></a>并同意接受其中所有的条框。</strong>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="usecheck rc-column rc-text--left">
|
<div class="usecheck rc-column rc-text--left">
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@click="checkBox($event,1)"
|
@click="checkBoxa($event,3)"
|
||||||
v-model="allcheck"
|
v-model="allcheck"
|
||||||
/>
|
/>
|
||||||
<i>
|
<i>
|
||||||
@ -119,7 +119,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<div class="rc-layout-container rc-one-column">
|
<div class="rc-layout-container rc-one-column" style="margin-top:45px">
|
||||||
<div class="rc-column">
|
<div class="rc-column">
|
||||||
<input
|
<input
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -142,7 +142,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { userLongin,sendMsg,vadatnmsg } from "../../ajax/getData";
|
import { userLongin,sendMsg,vadatnmsg,userregOrLogin,inserdiscount } from "../../ajax/getData";
|
||||||
import { mapMutations } from "vuex";
|
import { mapMutations } from "vuex";
|
||||||
import Myheader from "~/components/header.vue"; //引用头部公共组件
|
import Myheader from "~/components/header.vue"; //引用头部公共组件
|
||||||
export default {
|
export default {
|
||||||
@ -152,6 +152,7 @@ export default {
|
|||||||
layerMSg: "手机格式不对",
|
layerMSg: "手机格式不对",
|
||||||
tel: "",
|
tel: "",
|
||||||
password: "",
|
password: "",
|
||||||
|
userdata:{},
|
||||||
allcheck:false,
|
allcheck:false,
|
||||||
activeIndex: 0,
|
activeIndex: 0,
|
||||||
tamp:'',
|
tamp:'',
|
||||||
@ -171,9 +172,11 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
usertitle: true,
|
usertitle: true,
|
||||||
ifpassword: false,
|
ifpassword: false,
|
||||||
|
verification:'',//验证码数据
|
||||||
|
userislogin:[],//登录成功数据
|
||||||
checked: false,
|
checked: false,
|
||||||
inRank: false,
|
isRank: false,
|
||||||
inRanka: false,
|
isRanka: false,
|
||||||
usercheckbox:false,
|
usercheckbox:false,
|
||||||
|
|
||||||
swiperData: [
|
swiperData: [
|
||||||
@ -221,20 +224,45 @@ export default {
|
|||||||
// console.log(this.inRank);
|
// console.log(this.inRank);
|
||||||
// },
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapMutations(["changeClod","checkIsLogin"]),
|
||||||
//全选
|
//全选
|
||||||
checkBoxa(e,order){
|
checkBoxa(e,order){
|
||||||
let checked=e.target.checked;
|
let checked=e.target.checked;
|
||||||
console.log(checked)
|
console.log(e.target.checked);
|
||||||
|
// this.isRank=e.target.checked;
|
||||||
|
// this.isRanka=e.target.checked;
|
||||||
|
if(order==3){
|
||||||
|
this.allcheck=checked;
|
||||||
|
this.isRank=this.allcheck;
|
||||||
|
this.isRanka=this.allcheck;
|
||||||
|
}else if(order==2){
|
||||||
|
this.isRank=e.target.checked;
|
||||||
|
}
|
||||||
|
else if(order==1){
|
||||||
|
this.isRanka=e.target.checked;
|
||||||
|
}
|
||||||
|
console.log(this.isRank,this.isRanka);
|
||||||
|
if(this.isRanka==true && this.isRank==true){
|
||||||
|
this.allcheck=true;
|
||||||
|
}else{
|
||||||
|
this.allcheck=false;
|
||||||
|
}
|
||||||
|
// console.log(this.isRanka,this.isRank);
|
||||||
|
this.usercheckbox=this.allcheck;
|
||||||
},
|
},
|
||||||
|
//获取用户领取的优惠券
|
||||||
checkBox(e,order){
|
async reglogin() {
|
||||||
console.log(e.target.checked)
|
let data = await getConfig(memberId, couponId);
|
||||||
this.usercheckbox=e.target.checked;
|
let msg = '领取成功';
|
||||||
this.inRank= this.usercheckbox;
|
if (data) {
|
||||||
|
if(data.code!='0')
|
||||||
|
msg = data.msg;
|
||||||
|
this.$message({
|
||||||
|
type: "warning",
|
||||||
|
message: msg,
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
...mapMutations(["changeClod"]),
|
|
||||||
//获取验证码
|
//获取验证码
|
||||||
async usermsg() {
|
async usermsg() {
|
||||||
//console.log("-----");
|
//console.log("-----");
|
||||||
@ -248,14 +276,35 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//添加优惠券
|
||||||
|
async serdiscount (mobile,couponId) {
|
||||||
|
let data = await inserdiscount(mobile,couponId);
|
||||||
|
if(data){
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
//console.log(data);
|
||||||
|
},
|
||||||
|
|
||||||
//发送验证码数据
|
//发送验证码数据
|
||||||
async vadmsg() {
|
async vadmsg() {
|
||||||
//console.log("-----");
|
//console.log("-----");
|
||||||
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
|
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
|
||||||
if(data){
|
if(data){
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
//登录成功数据
|
||||||
|
async userlogin() {
|
||||||
|
//console.log("-----");
|
||||||
|
let data= await userregOrLogin(this.tel);
|
||||||
|
if(data){
|
||||||
|
this.userislogin=data;
|
||||||
|
console.log(this.userislogin);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
onClickHander(e) {
|
onClickHander(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
},
|
},
|
||||||
@ -293,11 +342,8 @@ export default {
|
|||||||
return
|
return
|
||||||
|
|
||||||
} else{
|
} else{
|
||||||
|
|
||||||
|
|
||||||
let time = 60;
|
let time = 60;
|
||||||
let timer;
|
let timer;
|
||||||
|
|
||||||
timer = setInterval(() => {
|
timer = setInterval(() => {
|
||||||
time--;
|
time--;
|
||||||
if (time === 0) {
|
if (time === 0) {
|
||||||
@ -327,45 +373,75 @@ export default {
|
|||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(this.usercheckbox==false){
|
if(this.usercheckbox==false){
|
||||||
//console.log('----');
|
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: '请先同意隐私声明和账号使用协议'
|
message: '请先勾选相关协议'
|
||||||
});
|
});
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(this.usercheckbox==false){
|
||||||
|
//console.log('----');
|
||||||
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: '手机号码输入有误'
|
message: '手机号码输入有误'
|
||||||
});
|
});
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: '请先同意隐私声明和账号使用协议'
|
||||||
|
});
|
||||||
return
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
let data=await this.vadmsg();
|
console.log('===')
|
||||||
|
let data=await this.vadmsg();
|
||||||
if(data.code=="1")
|
if(data.code=="1")
|
||||||
{
|
{
|
||||||
data = await userLongin(this.tel);
|
data = await userregOrLogin(this.tel);
|
||||||
if(data.msg=='SUCCESS'){
|
console.log(data);
|
||||||
this.$message({
|
let token=JSON.stringify(data);
|
||||||
|
this.changeClod({ cloud: token });
|
||||||
|
this.checkIsLogin();
|
||||||
|
if(data.type==1){
|
||||||
|
if(data.data.memberName===undefined){
|
||||||
|
this.$message({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: '登录成功'
|
message: '欢迎回来'
|
||||||
});
|
});
|
||||||
|
console.log('-----')
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: '欢迎回来'+data.data.memberName
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}else if(data.type==2){
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: '恭喜注册成功'
|
||||||
|
});
|
||||||
|
let couponId='0000000123';
|
||||||
|
this.serdiscount(this.tel,couponId);
|
||||||
|
setTimeout(() => {
|
||||||
|
this.serdiscount(this.tel,"0000000140");
|
||||||
|
}, 100);
|
||||||
|
setTimeout(() => {
|
||||||
|
this.serdiscount(this.tel,"0000000122");
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: "/",
|
path: "/",
|
||||||
});
|
});
|
||||||
let token=JSON.stringify(data);
|
}else{
|
||||||
this.changeClod({ cloud: token });
|
this.$message({
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.$message({
|
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: data.msg
|
message: data.msg,
|
||||||
});
|
});
|
||||||
|
|
||||||
return
|
return
|
||||||
|
}
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
BIN
rc-busness/static/images/banner/pc-weixin.png
Normal file
BIN
rc-busness/static/images/banner/pc-weixin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 621 KiB |
BIN
rc-busness/static/images/banner/weixin.png
Normal file
BIN
rc-busness/static/images/banner/weixin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 573 KiB |
@ -57,7 +57,7 @@ public class MemberService {
|
|||||||
JSONObject json = JSONObject.parseObject(jsonObjectResult.getString("data"));
|
JSONObject json = JSONObject.parseObject(jsonObjectResult.getString("data"));
|
||||||
String id = json.getString("id");
|
String id = json.getString("id");
|
||||||
jsonObjectResult.put("xaccessToken", SmartJWTUtil.generateToken(id));
|
jsonObjectResult.put("xaccessToken", SmartJWTUtil.generateToken(id));
|
||||||
jsonObject.put("type","2");
|
jsonObjectResult.put("type","2");
|
||||||
return jsonObjectResult.toJSONString();
|
return jsonObjectResult.toJSONString();
|
||||||
}else {
|
}else {
|
||||||
return jsonObjectResult.toJSONString();
|
return jsonObjectResult.toJSONString();
|
||||||
|
@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import net.lab1024.smartadmin.common.anno.OperateLog;
|
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.domain.ResponseDTO;
|
||||||
import net.lab1024.smartadmin.common.heartbeat.StringUtil;
|
import net.lab1024.smartadmin.common.heartbeat.StringUtil;
|
||||||
import net.lab1024.smartadmin.constant.SwaggerTagConst;
|
import net.lab1024.smartadmin.constant.SwaggerTagConst;
|
||||||
@ -117,6 +116,8 @@ public class TransitionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "会员地址", notes = "查询会员地址,添加会员地址,更新会员地址,删除会员地址")
|
@ApiOperation(value = "会员地址", notes = "查询会员地址,添加会员地址,更新会员地址,删除会员地址")
|
||||||
@PostMapping("royalcanin/memberAddress")
|
@PostMapping("royalcanin/memberAddress")
|
||||||
public String transferMemberAddress(String type ,@RequestBody Object object, HttpServletRequest request) throws Exception {
|
public String transferMemberAddress(String type ,@RequestBody Object object, HttpServletRequest request) throws Exception {
|
||||||
|
@ -3,6 +3,7 @@ package net.lab1024.smartadmin.module.system.royalcanin.good;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.alipay.api.internal.util.AlipaySignature;
|
import com.alipay.api.internal.util.AlipaySignature;
|
||||||
|
import com.beust.jcommander.Parameter;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import net.lab1024.smartadmin.common.anno.OperateLog;
|
import net.lab1024.smartadmin.common.anno.OperateLog;
|
||||||
@ -23,17 +24,22 @@ import net.lab1024.smartadmin.module.system.royalcanin.good.service.CartService;
|
|||||||
import net.lab1024.smartadmin.module.system.royalcanin.good.service.OrderService;
|
import net.lab1024.smartadmin.module.system.royalcanin.good.service.OrderService;
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.orderMaster.OrderDatilListEntity;
|
import net.lab1024.smartadmin.module.system.royalcanin.orderMaster.OrderDatilListEntity;
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.orderMaster.QueryEntity;
|
import net.lab1024.smartadmin.module.system.royalcanin.orderMaster.QueryEntity;
|
||||||
|
import net.lab1024.smartadmin.module.system.wxpay.MyConfig;
|
||||||
import net.lab1024.smartadmin.module.system.wxpay.WxpayService;
|
import net.lab1024.smartadmin.module.system.wxpay.WxpayService;
|
||||||
import net.lab1024.smartadmin.module.system.wxpay.wxPayModel.WxPayEntity;
|
import net.lab1024.smartadmin.module.system.wxpay.wxPayModel.WxPayEntity;
|
||||||
import net.lab1024.smartadmin.util.GenerateSequenceUtil;
|
import net.lab1024.smartadmin.util.GenerateSequenceUtil;
|
||||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||||
import net.sf.json.JSONArray;
|
import net.sf.json.JSONArray;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.client.utils.URLEncodedUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@Api(tags = {SwaggerTagConst.Admin.MANAGER_MALL_API})
|
@Api(tags = {SwaggerTagConst.Admin.MANAGER_MALL_API})
|
||||||
@ -128,7 +134,8 @@ public class OrderController {
|
|||||||
Map<String, String> returnMap = new HashMap<>();
|
Map<String, String> returnMap = new HashMap<>();
|
||||||
returnMap.put("orderNumber",ordersEntity.getOrderNo());
|
returnMap.put("orderNumber",ordersEntity.getOrderNo());
|
||||||
returnMap.put("orderAmount",ordersEntity.getOrderAmount());
|
returnMap.put("orderAmount",ordersEntity.getOrderAmount());
|
||||||
return ResponseDTO.succData(returnMap,wxpayService.generateQRCode(wxPayEntity));
|
// return ResponseDTO.succData(returnMap,wxpayService.generateQRCode(wxPayEntity));
|
||||||
|
return ResponseDTO.succData(returnMap,wxpayService.testGenerateQRCode(wxPayEntity));
|
||||||
}
|
}
|
||||||
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_FAIL);
|
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_FAIL);
|
||||||
}
|
}
|
||||||
@ -197,7 +204,7 @@ public class OrderController {
|
|||||||
ordersEntity.setOrderNo(GenerateSequenceUtil.generateSequenceNo());
|
ordersEntity.setOrderNo(GenerateSequenceUtil.generateSequenceNo());
|
||||||
ordersEntity.setOrderStatus("0");
|
ordersEntity.setOrderStatus("0");
|
||||||
ordersEntity.setBasePoint(basePoint);
|
ordersEntity.setBasePoint(basePoint);
|
||||||
|
ordersEntity.setPayType("3");
|
||||||
|
|
||||||
if(orderService.generateOrder(ordersEntity,orderDatilListJson) == 1){
|
if(orderService.generateOrder(ordersEntity,orderDatilListJson) == 1){
|
||||||
wxPayEntity.setProduct_id(ordersEntity.getProductCode());
|
wxPayEntity.setProduct_id(ordersEntity.getProductCode());
|
||||||
@ -235,6 +242,15 @@ public class OrderController {
|
|||||||
return ResponseDTO.wrap(OrderResponseCodeConst.WITHOUT_ORDER);
|
return ResponseDTO.wrap(OrderResponseCodeConst.WITHOUT_ORDER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ApiOperation(value = "重定向", notes = "重定向")
|
||||||
|
@PostMapping("royalcanin/redirectUrlWXH5")
|
||||||
|
public void redirectUrl(HttpServletRequest request, HttpServletResponse response,@RequestBody String url) throws IOException {
|
||||||
|
response.addHeader("referer", MyConfig.NOTIFY_URL_H5);
|
||||||
|
JSONObject jonUrl = JSONObject.parseObject(url);
|
||||||
|
response.sendRedirect(jonUrl.getString("url"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "重新支付(H5)", notes = "重新支付(H5)")
|
@ApiOperation(value = "重新支付(H5)", notes = "重新支付(H5)")
|
||||||
@PostMapping("royalcanin/repayOrderWXH5")
|
@PostMapping("royalcanin/repayOrderWXH5")
|
||||||
@ -269,6 +285,8 @@ public class OrderController {
|
|||||||
wxpayService.orderCallBack(request,response);
|
wxpayService.orderCallBack(request,response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "监听微信回调", notes = "监听微信回调")
|
@ApiOperation(value = "监听微信回调", notes = "监听微信回调")
|
||||||
@PostMapping(value = "royalcanin/monitorOrderNotify")
|
@PostMapping(value = "royalcanin/monitorOrderNotify")
|
||||||
public ResponseDTO<String> monitorOrderNotify(@RequestParam String OrderNumber){
|
public ResponseDTO<String> monitorOrderNotify(@RequestParam String OrderNumber){
|
||||||
|
@ -232,6 +232,7 @@ public class OrderService {
|
|||||||
OrderEntity orderEntity = ordersDao.findByOrderId(queryEntity.getOrderNumber());
|
OrderEntity orderEntity = ordersDao.findByOrderId(queryEntity.getOrderNumber());
|
||||||
//新增支付方式paytype
|
//新增支付方式paytype
|
||||||
jsonObjectResult.put("paytype",orderEntity.getPayType());
|
jsonObjectResult.put("paytype",orderEntity.getPayType());
|
||||||
|
jsonObjectResult.put("basePoint",orderEntity.getBasePoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
//记录服务响应时间
|
//记录服务响应时间
|
||||||
|
@ -13,4 +13,8 @@ public class QueryEntity {
|
|||||||
|
|
||||||
private String phoneNumber;
|
private String phoneNumber;
|
||||||
|
|
||||||
|
private String page;
|
||||||
|
|
||||||
|
private String rows;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package net.lab1024.smartadmin.module.system.wxpay;
|
package net.lab1024.smartadmin.module.system.wxpay;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.aliyun.oss.internal.SignUtils;
|
|
||||||
import net.lab1024.smartadmin.common.heartbeat.StringUtil;
|
import net.lab1024.smartadmin.common.heartbeat.StringUtil;
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.MemberAccountService;
|
import net.lab1024.smartadmin.module.system.royalcanin.MemberAccountService;
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.good.model.OrderEntity;
|
import net.lab1024.smartadmin.module.system.royalcanin.good.model.OrderEntity;
|
||||||
@ -10,7 +9,6 @@ import net.lab1024.smartadmin.module.system.royalcanin.good.service.OrderService
|
|||||||
import net.lab1024.smartadmin.module.system.royalcanin.memberAccount.MemberAccountChangeEntity;
|
import net.lab1024.smartadmin.module.system.royalcanin.memberAccount.MemberAccountChangeEntity;
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.notify.model.NotifyEntity;
|
import net.lab1024.smartadmin.module.system.royalcanin.notify.model.NotifyEntity;
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.notify.service.NotifyService;
|
import net.lab1024.smartadmin.module.system.royalcanin.notify.service.NotifyService;
|
||||||
import net.lab1024.smartadmin.module.system.royalcanin.orderMaster.QueryEntity;
|
|
||||||
import net.lab1024.smartadmin.module.system.wxpay.sdk.WXPay;
|
import net.lab1024.smartadmin.module.system.wxpay.sdk.WXPay;
|
||||||
import net.lab1024.smartadmin.module.system.wxpay.sdk.WXPayUtil;
|
import net.lab1024.smartadmin.module.system.wxpay.sdk.WXPayUtil;
|
||||||
import net.lab1024.smartadmin.module.system.wxpay.wxPayModel.WxPayEntity;
|
import net.lab1024.smartadmin.module.system.wxpay.wxPayModel.WxPayEntity;
|
||||||
@ -28,6 +26,7 @@ import java.io.InputStream;
|
|||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.Inet4Address;
|
import java.net.Inet4Address;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@ -49,6 +48,27 @@ public class WxpayService {
|
|||||||
|
|
||||||
String url = "https://miniapp-test.royalcanin.com.cn/rcmini/h5/";
|
String url = "https://miniapp-test.royalcanin.com.cn/rcmini/h5/";
|
||||||
|
|
||||||
|
private String urlNative = "https://api.mch.weixin.qq.com/v3/pay/transactions/native";
|
||||||
|
|
||||||
|
public String testGenerateQRCode(WxPayEntity wxPayEntity)throws Exception{
|
||||||
|
String Authorization = "WECHATPAY2-SHA256-RSA2048";
|
||||||
|
long timestamp = System.currentTimeMillis();
|
||||||
|
SortedMap<String,String> data = new TreeMap<>();
|
||||||
|
SortedMap<String, Integer> amount = new TreeMap<>();
|
||||||
|
amount.put("total",Integer.parseInt(getMoney(wxPayEntity.getTotal_fee())));
|
||||||
|
data.put("out_trade_no",wxPayEntity.getOut_trade_no());
|
||||||
|
data.put("notify_url",config.notify_url);
|
||||||
|
data.put("description","皇家宠物食品官方商城");
|
||||||
|
data.put("appid",config.getAppID());
|
||||||
|
data.put("mchid",config.getMchID());
|
||||||
|
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(data);
|
||||||
|
jsonObject.put("amount",amount);
|
||||||
|
SortedMap<String ,String>hearder = new TreeMap<>();
|
||||||
|
hearder.put("Accept","application/json");
|
||||||
|
hearder.put("Authorization",Authorization +" mchid="+config.getMchID() +",nonce_str=" + WXPayUtil.generateNonceStr() + ",timestamp=" + timestamp + ",signature=" + WXPayUtil.generateSignature(data, config.getKey()) + ",serial_no=" + config.getKey());
|
||||||
|
String sb = SmartHttpUtil.httpPostRaw(urlNative,jsonObject.toString(),hearder,"utf-8");
|
||||||
|
return sb;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -176,7 +196,7 @@ public class WxpayService {
|
|||||||
data.put("fee_type","CNY");
|
data.put("fee_type","CNY");
|
||||||
data.put("total_fee",getMoney(wxPayEntity.getTotal_fee()));
|
data.put("total_fee",getMoney(wxPayEntity.getTotal_fee()));
|
||||||
data.put("spbill_create_ip", SmartIPUtil.getLocalHostIP());
|
data.put("spbill_create_ip", SmartIPUtil.getLocalHostIP());
|
||||||
data.put("trade_type", "MWEB"); // 此处指定为扫码支付
|
data.put("trade_type", "MWEB"); // 此处指定为H5支付
|
||||||
data.put("body","皇家宠物食品官方商城");
|
data.put("body","皇家宠物食品官方商城");
|
||||||
data.put("nonce_str", WXPayUtil.generateNonceStr());
|
data.put("nonce_str", WXPayUtil.generateNonceStr());
|
||||||
data.put("product_id",wxPayEntity.getProduct_id());
|
data.put("product_id",wxPayEntity.getProduct_id());
|
||||||
@ -190,7 +210,7 @@ public class WxpayService {
|
|||||||
if (returnCode.equals("SUCCESS")) {
|
if (returnCode.equals("SUCCESS")) {
|
||||||
returnMap.put("ok", "200");
|
returnMap.put("ok", "200");
|
||||||
//拼接返回跳转地址
|
//拼接返回跳转地址
|
||||||
String url= config.NOTIFY_URL_H5+"orderNumber="+wxPayEntity.getOut_trade_no() ;
|
String url= config.NOTIFY_URL_H5+"/myorder/usertion?orderNumber="+wxPayEntity.getOut_trade_no() + "&tradeType=MWEB";
|
||||||
returnMap.put("url", response.get("mweb_url")+"&redirect_url="+url);
|
returnMap.put("url", response.get("mweb_url")+"&redirect_url="+url);
|
||||||
return response.get("mweb_url") == null ? response.get("err_code_des"):returnMap.get("url");
|
return response.get("mweb_url") == null ? response.get("err_code_des"):returnMap.get("url");
|
||||||
} else {
|
} else {
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 57 KiB |
Binary file not shown.
After Width: | Height: | Size: 510 KiB |
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
Binary file not shown.
After Width: | Height: | Size: 522 KiB |
Loading…
Reference in New Issue
Block a user