Merge branch 'sit-Carl' into sit-Leung

This commit is contained in:
Vion
2022-01-28 11:54:13 +08:00
20 changed files with 2155 additions and 1603 deletions

View File

@@ -154,6 +154,17 @@ export const userLongin = (mobile, pet,address) => {
}
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) => {

View File

@@ -241,7 +241,7 @@
width:100%;
height:100%;
background:url("../image/btn-play.png") center center no-repeat;
background-size:90px 90px;
background-size:48px 48px;
z-index:2;
}
}

View File

@@ -5,6 +5,7 @@ ul li ol li em strong i {
list-style: none;
font-style: normal;
}
.rc-main {
//rc-main start
margin-top:.23rem;

View File

@@ -10,10 +10,12 @@
overflow-y: auto;
}
}
.ts-tag-list {
display: inline-flex;
flex-wrap: wrap;
justify-content: flex-start;
margin-top: 20px;
em {
font-style: normal;
display: flex;
@@ -52,6 +54,13 @@
color: #333333;
display:inline-block;
}
.ts-record {
font-size: 12px;
margin-left: 16px;
font-style: normal;
color: #333333;
display:inline-block;
}
.ts-row-title + i {
color: #666666;
display:inline-flex;
@@ -115,6 +124,14 @@
}
// 手机端
@media screen and (max-width:768px) {
.uservideo{
width: 100%;
height: 100%;
video{
width: 100%;
height: 100%;
}
}
.ts-ecprice{
font-size:.625rem;
}
@@ -287,12 +304,13 @@
}
.productdetails {
margin-top: 19px;
}
.rc-productdeta {
margin-top: 20px;
.rc-prodtop {
display: flex;
// display: flex;
align-items: flex-start;
span {
font-size: 14px;
@@ -357,11 +375,17 @@
.ts-row-title{
font-size: 16px;
width:82px;
}
.ts-row-title + i {
font-size: 16px;
max-width:596px;
}
.ts-row-record{
color: #999;
margin-left: 12px;
font-size: 12px;
}
}
.rc-button{
width: 100%;
@@ -536,7 +560,7 @@
.rc-productdeta {
margin-top: 16px;
.rc-prodtop {
display: flex;
// display: flex;
align-items: flex-start;
span {
font-size: 18px;

View File

@@ -308,7 +308,7 @@
<li class="rc-list__item">
<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>
</li>
<li class="rc-list__item">
@@ -353,7 +353,7 @@ export default {
data() {
return {
headerScroll:false,
loginornot:true,//用户是否登录提示点
loginornot:false,//用户是否登录提示点
usermessage:null,//存储用户信息
};
},

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,12 @@
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
class="rc-carousel rc-carousel__gallery-image"
@@ -108,7 +113,7 @@
<span>{{ curItem.categoryName }}</span>
</div>
<div class="rc-button ">
<div class="rc-button" v-if="!userbuy">
<span @click="chuafangbuy()">立即购买</span>
</div>
@@ -119,6 +124,11 @@
<span class="ts-remove ts-ecprice"
>{{ curItem.rsp }}
</span>
<span class="ts-record" v-if="curItem.basePoint!==0">
购买该商品你将获得{{curItem.basePoint}}积分
</span>
<!-- <span class="rc-title">购买该商品你将得到22积分</span> -->
</div>
<div class="rc-productdetai" v-if="userbuy">
<div>
@@ -274,7 +284,9 @@
<span @click="usertanchu(curItem, 0)">加入购物车</span>
<span @click="usertanchu(curItem, 1)">立即购买</span>
</div>
<div class="rc-button rc-md-down " v-if="(!userbuy)">
<span @click="chuafangbuy()" style="margin-right: 20px">立即购买</span>
</div>
</div>
</template>
@@ -304,6 +316,7 @@ export default {
let newlist = [];
let curItem = {};
let chufang = {};
let videolist=[];
let productAttachmentList = [];
let userlistmenu = [];
isRxGoods = (isRxGoods == '1'?true:false);
@@ -318,7 +331,6 @@ export default {
let data = await oncequery(mainProductCode);
let outputObj = {};
if (data) {
console.log(data);
chufang=data;
outputObj = data;
outputObj.productName = data.name;
@@ -340,6 +352,7 @@ export default {
let data = await goodsmessage(singleCode);
if (data && data.data.length>0) {
newlist.push(data.data[0]);
if(data.data[0].leftAllotment>0 && !stopLeftAllotmentChecking) {
activeIndexa = stopIndex;
curItem = data.data[0];
@@ -350,6 +363,8 @@ export default {
}
if(curItem.productAttachmentList != undefined)
productAttachmentList = curItem.productAttachmentList;
let list=[];
if(curItem.productName == undefined)
curItem = newlist[0];
userbuy = true;
@@ -364,12 +379,14 @@ export default {
title: curItem.productName,
}
];
console.log(curItem);
return {
crumbs,
activeIndexa,
curItem,
newlist,
chufang,
videolist,
productAttachmentList,
userbuy
}
@@ -380,6 +397,9 @@ export default {
userimage: require("../../assets/image/unused.png"),
gotop: false,
dialogInfo1: false,
videolist:[],
videoimg:'',
videoshow: false,
name: [],
userlist: [],
drawlist: [], //用户可以领取的优惠券
@@ -449,9 +469,23 @@ export default {
mounted() {
this.checkIsLogin();
// console.log(this.curItem);
if (this.usermessage !== "" || this.usermessage.data !== undefined) {
this.usermessage = this.$store.state.userInfo;
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 isRxGoods = this.$route.query.isRxGoods;
@@ -508,10 +542,11 @@ export default {
async userquery() {
let data = await goodsmessage(this.productCode);
if (data) {
console.log(data)
debugger
this.newlist = data.data;
}
this.productAttachmentList = this.newlist[0].productAttachmentList;
this.userlistmenu = this.newlist[0].productAttachmentList;
let changemess = JSON.stringify(this.userlistmenu);
this.changemessage({ data: changemess });
@@ -521,6 +556,8 @@ export default {
let data = await oncequery(this.productCode);
let outputObj = {};
if (data) {
console.log(data);
debugger
outputObj = data;
outputObj.productName = data.name;
outputObj.picture = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.picture;

View File

@@ -75,10 +75,10 @@
<label>
<input
type="checkbox"
@click="checkBox($event,2)"
v-model="inRank"
@click="checkBoxa($event,2)"
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>
</label>
</div>
@@ -86,18 +86,18 @@
<label>
<input
type="checkbox"
@click="checkBox($event,3)"
v-model="inRanka"
@click="checkBoxa($event,1)"
v-model="isRanka"
/>
<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>
</div>
<div class="usecheck rc-column rc-text--left">
<label>
<input
type="checkbox"
@click="checkBox($event,1)"
@click="checkBoxa($event,3)"
v-model="allcheck"
/>
<i>
@@ -119,7 +119,7 @@
</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">
<input
type="primary"
@@ -142,7 +142,7 @@
<script>
import { userLongin,sendMsg,vadatnmsg } from "../../ajax/getData";
import { userLongin,sendMsg,vadatnmsg,userregOrLogin,inserdiscount } from "../../ajax/getData";
import { mapMutations } from "vuex";
import Myheader from "~/components/header.vue"; //引用头部公共组件
export default {
@@ -152,6 +152,7 @@ export default {
layerMSg: "手机格式不对",
tel: "",
password: "",
userdata:{},
allcheck:false,
activeIndex: 0,
tamp:'',
@@ -171,9 +172,11 @@ export default {
loading: false,
usertitle: true,
ifpassword: false,
verification:'',//验证码数据
userislogin:[],//登录成功数据
checked: false,
inRank: false,
inRanka: false,
isRank: false,
isRanka: false,
usercheckbox:false,
swiperData: [
@@ -221,20 +224,45 @@ export default {
// console.log(this.inRank);
// },
methods: {
...mapMutations(["changeClod","checkIsLogin"]),
//全选
checkBoxa(e,order){
let checked=e.target.checked;
console.log(checked)
let checked=e.target.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){
console.log(e.target.checked)
this.usercheckbox=e.target.checked;
this.inRank= this.usercheckbox;
//获取用户领取的优惠券
async reglogin() {
let data = await getConfig(memberId, couponId);
let msg = '领取成功';
if (data) {
if(data.code!='0')
msg = data.msg;
this.$message({
type: "warning",
message: msg,
});
}
},
...mapMutations(["changeClod"]),
//获取验证码
async usermsg() {
//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() {
//console.log("-----");
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
if(data){
return data;
}
},
//登录成功数据
async userlogin() {
//console.log("-----");
let data= await userregOrLogin(this.tel);
if(data){
this.userislogin=data;
console.log(this.userislogin);
}
},
onClickHander(e) {
console.log(e);
},
@@ -293,11 +342,8 @@ export default {
return
} else{
let time = 60;
let timer;
timer = setInterval(() => {
time--;
if (time === 0) {
@@ -327,45 +373,75 @@ export default {
});
return
}
if(this.usercheckbox==false){
//console.log('----');
if(this.usercheckbox==false){
this.$message({
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 === "") {
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
this.$message({
type: 'warning',
message: '请先同意隐私声明和账号使用协议'
});
return
}
}
else{
let data=await this.vadmsg();
console.log('===')
let data=await this.vadmsg();
if(data.code=="1")
{
data = await userLongin(this.tel);
if(data.msg=='SUCCESS'){
this.$message({
data = await userregOrLogin(this.tel);
console.log(data);
let token=JSON.stringify(data);
this.changeClod({ cloud: token });
this.checkIsLogin();
if(data.type==1){
if(data.data.memberName===undefined){
this.$message({
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({
path: "/",
});
let token=JSON.stringify(data);
this.changeClod({ cloud: token });
return;
}
}
this.$message({
}else{
this.$message({
type: 'warning',
message: data.msg
message: data.msg,
});
return
}
}},
},
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 KiB