This commit is contained in:
summation 2022-01-19 19:11:18 +08:00
parent 320c23dde5
commit e133d3e778
16 changed files with 5410 additions and 4701 deletions

View File

@ -0,0 +1,127 @@
<template>
<div>
<van-address-edit
:area-list="areaList"
:address-info="{
name: editAddressData.name,
tel: editAddressData.tel,
addressDetail: editAddressData.detailAddress,
areaCode: areaCode,
}"
show-delete
show-set-default
show-search-result
:search-result="searchResult"
@save="onSave"
@delete="onDelete"
/>
</div>
</template>
<script>
import { Toast } from "vant";
import { areaList } from "@vant/area-data";
var _ = require("lodash");
import { memberAddress } from "../../ajax/getData";
export default {
data() {
return {
areaList,
searchResult: [],
areaCode: "",
};
},
props: ["editAddressData"],
computed: {},
methods: {
async onSave(content) {
// Toast('save');
let provinceId = Number(content.areaCode.substring(0, 2)); //id
let cityId = Number(content.areaCode.substring(2, 4)); //id
let districtId = Number(content.areaCode.substring(4, 7)); //
//id / id/id/
let memberId = JSON.parse(localStorage.getItem("userInfo")).data.id;
let postData = {
memberId,
provinceId: 25,
cityId: 36,
districtId: 418,
// provinceId,
// cityId,
// districtId,
detailAddress: content.addressDetail,
recipient: content.name,
recipientPhone: content.tel,
default: content.default,
};
let saveType = this.editAddressData.saveType ? "update" : "add";
let data = await memberAddress(saveType, postData);
if (data) {
this.$message({
type: "warning",
message: data.msg,
});
if (data.code == "0") {
this.$emit("isClose", false);
}
}
},
async onDelete() {
// Toast("delete");
let postData = {
ids: this.editAddressData.id,
memberId: this.editAddressData.memberId,
};
let data = await memberAddress("delete", postData);
if (data) {
this.$message({
type: "warning",
message: data.msg,
});
if (data.code == "0") {
this.$emit("isClose", false);
}
}
},
async areaCodeInit() {
var city = this.editAddressData.city;
var district = this.editAddressData.district;
this.areaCode = "1310001";
// _.forEach(this.areaList.city_list, (o, c) => {
// if (o == city) {
// // let cityId = String(_.take(c, 2));
// let cityId = c.substring(0, 4);
// _.forEach(this.areaList.county_list, (i, a) => {
// if (i == district) {
// // let districtId = String(_.take(a, 2));
// let districtId = a.substring(0, 4);
// if (cityId == districtId) {
// this.areaCode = a;
// }
// }
// });
// }
// });
},
},
mounted() {
this.areaCodeInit();
},
};
</script>
<style>
.van-area {
width: 400px;
margin: 0 auto;
border: 1px solid #808285;
}
.van-popup {
background-color: transparent;
}
.van-overlay {
background-color: transparent;
}
.v-modal {
background: transparent;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,11 +2,10 @@
<div class="allmain">
<Myheader></Myheader>
<div class="online bold rc-md-down" id="fixed-catbar-seperator"></div>
<!-- <tabs></tabs> -->
<div class="rc-top"></div>
<div class="rc-usermain">
<div class="online bold"></div>
<div class="rc">
<span
v-for="(item, index) in discountlist"
@ -28,20 +27,20 @@
>
<img :src="userimage" alt="" />
<div class="rc-contair">
<div class="rc-left" ref="userleft" id="userleft">
<div class="rc-left" ref="userleft" id="userleft" :style='usercolor'>
<div>
<i></i><span>{{ item.couponAmount }}</span>
<i></i><span>{{item.couponTypeId=='4'?parseInt(((item.discount) *10))+ '折':item.couponAmount}}</span>
</div>
<strong>{{ item.couponName }}</strong>
</div>
<div class="rc-right">
<i>
<i :style='usercolor'>
{{ item.couponName }}
</i>
<div class="rc-userfont">
<strong>有效期</strong>
<span>{{item.validFrom}}</span>
<em>{{ item.validTo }}</em>
<em>{{item.validTo}}</em>
</div>
<nuxt-link :to="`/productdetails/productlist`">
<div v-if="userload" class="ts-stand">
@ -71,6 +70,7 @@ export default {
userload: true,
pastdue: false,
unused: false,
usercolor:{color:'#e1001a'},
usermessage:[],
userstates:0,
userimage: require("../../assets/image/unused.png"),
@ -196,6 +196,10 @@ export default {
if(data){
console.log(data);
this.newlist=data.data;
this.newlist.forEach(element=>{
element.validFrom=element.validFrom.slice(0,10)
element.validTo=element.validTo.slice(0,10)
})
console.log(this.newlist);
}
@ -207,21 +211,26 @@ export default {
this.pastdue = true;
this.userimage = require("../../assets/image/hasused.png");
this.userstates=1
this.userdraw(this.usermessage.data.mobile,0)
console.log(this.$refs.userleft);
this.usercolor={color:'white'}
this.userdraw(this.usermessage.data.mobile,1)
}
if (this.activeIndex == 0) {
this.userload = true;
this.pastdue = false;
this.userdraw(this.usermessage.data.mobile,0)
this.usercolor={color:'#e1001a'}
this.userstates=0
this.userimage = require("../../assets/image/unused.png");
}
if (this.activeIndex == 2) {
this.userload = false;
this.pastdue = true;
this.userdraw(this.usermessage.data.mobile,0)
this.userdraw(this.usermessage.data.mobile,2)
this.userstates=2
this.usercolor={color:'white'}
this.userimage = require("../../assets/image/expired.png");
}
console.log(index);
@ -242,6 +251,18 @@ export default {
// }
// dis_livchat(option);
// }
},
directives: {
'color': {
bind: function(el, binding){
el.style.color = binding.value
},
inserted: function(el){
}
},
},
mounted() {
if(this.usermessage!=='' ||this.usermessage.data!==undefined){

View File

@ -1,33 +1,38 @@
<template>
<div>
<Myheader></Myheader>
<div class="rc-top"></div>
<div class="rc-main rc-layout-container rc-max-width--lg">
<div class="rc-usermain">
<ul>
<li v-for="(item,index) in userrecord" :key="index">
{{item.title}}
</li>
</ul>
<ol>
<li v-for="(item,index) in usermessage" :key="index">
<span>{{item.startDate}}</span>
<em>{{item.changeValue}}</em>
<i>{{item.remark}}</i>
</li>
</ol>
</div>
<div class="rc-usermain ">
<ul>
<li v-for="(item,index) in userrecord" :key="index">
{{item.title}}
</li>
</ul>
<ol>
</div>
<Myfooter v-on:litentop='showmesg'></Myfooter>
</div>
<li v-for="(item,index) in usermessage" :key="index">
<span>{{item.startDate}}</span>
<em>{{item.changeValue}}</em>
<i>{{item.remark}}</i>
</li>
</ol>
</div>
<div class="rc-button">
<div class="rc-order">
<span>积分兑换</span>
</div>
</div>
</div>
</template>
<script>
import Myheader from '~/components/header.vue'
import Myfooter from '~/components/rc-footer.vue'
import { memberAccount } from "../../ajax/getData";
import { memberAccount } from "../../ajax/getData";
export default {
data(){
return{
@ -103,7 +108,6 @@ export default {
},
components:{
Myheader,
Myfooter
},
}
@ -111,4 +115,6 @@ export default {
<style lang="less" scoped>
@import url("../../assets/css/integral.less");
</style>

View File

@ -1,8 +1,8 @@
<template>
<div>
<Myheader></Myheader>
<!-- <tabs></tabs> -->
<div class="rc-top"></div>
<tabs></tabs>
<div class="rc-layout-container rc-one-column rc-full-width ts-mypersonal">
<div class="rc-column">
<!-- <div class="rc-title">
@ -47,8 +47,10 @@
<div class="rc-cordd">
<span>距离升级还差:</span> <span class="lackOfPoint">{{ rcvalue }}</span>
<div class="block">
<div class="ts-point-tag rc-md-up"></div>
<div class="ts-point-tag rc-md-up">0</div>
<div class="r-block" ref="userblock"></div>
<!-- <el-slider v-model="value" range show-stops :max="10"> </el-slider> -->
</div>
<div class="rc-value">
<span>0</span>
@ -136,25 +138,25 @@
</template>
<script>
import Myheader from '~/components/header.vue'
import Myheader from '~/components/header.vue'
import MyFooter from '~/components/rc-footer.vue'
import tabs from "@/components/tabs.vue";
export default {
middleware: 'metaTitle',
// middleware: 'metaTitle',
meta: {title: '个人中心'},
middleware: 'metaTitle',
// middleware: 'metaTitle',
meta: {title: '个人中心'},
data() {
return {
userlog:false,
islogin:false,
dialogInfo1:false,
userid:null,
usertitle:'',
rcvalue:5000,
usermessage:'关注皇家爱宠荟,修改个人资料',
userimage:require("../../assets/image/rc-new.png"),
userlogin:'登录注册',
userorder: "新手铲屎官",
userlog:false,
islogin:false,
dialogInfo1:false,
userid:null,
usertitle:'',
rcvalue:5000,
usermessage:'关注皇家爱宠荟,修改个人资料',
userimage:require("../../assets/image/rc-new.png"),
userlogin:'登录注册',
userorder: "新手铲屎官",
prefecture: [
{
title: "待付款",
@ -202,11 +204,11 @@ export default {
components: {
Myheader,
MyFooter,
tabs,
tabs
},
watch:{
watch:{
},
},
methods: {
userinter(){
let user= localStorage.getItem("userInfo");
@ -313,7 +315,7 @@ obligation(item,index){
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
//console.log("")
console.log("当前是电脑打开")
if(this.userlog==true){
this.usermessage='关注皇家爱宠荟,修改个人资料',
this.dialogInfo1=true;
@ -323,7 +325,7 @@ obligation(item,index){
}
}else{
//console.log("")
console.log("当前是手机打开")
this.dialogInfo1=false;
}
},
@ -339,12 +341,13 @@ obligation(item,index){
return
}else{
if(item.title=='收货地址'){
this.$router.push({
path: `/useraddress/openaddress/`
})
//console.log('');
}
if(item.title=='收货地址'){
this.$router.push({
path: `/useraddress/openaddress/`
})
console.log('这是地址的跳转');
}
if(index==0){
this.userlog=true
this.ifadroind();
@ -368,42 +371,44 @@ obligation(item,index){
}
},
mounted() {
//console.log(this.islogin)
//console.log(this.userid);
let userwidth=0;
this.ifadroind();
let user= JSON.parse(localStorage.getItem("userInfo"));
//console.log(user)
if(user!==null){
//console.log('11')
this.userid=user.data;
console.log(this.userid);
this.usertitle=this.userid.memberName;
this.rcrcord=this.userid.availiblePoint;
if(this.userid.memberLevel==1){
let userlength=this.userid.availiblePoint.toString().length;
this.userimage=require('../../assets/image/rc-new.png');
this.userorder='新手铲屎官';
this.uservalue=5000; //
this.rcvalue=this.uservalue-this.userid.availiblePoint; //
if(userlength==1||userlength==2||userlength==3||userlength==4){
userwidth=this.userid.availiblePoint/100
//console.log(userwidth);
}
}
else if(this.userid.memberLevel==2){
this.userimage=require('../../assets/image/rc-new2.png');
this.userorder='资深铲屎官';
this.uservalue=10000;
this.rcvalue=this.uservalue-this.userid.availiblePoint;
userwidth=this.userid.availiblePoint/100
}else if( this.userid.memberLevel==3){
this.userimage=require('../../assets/image/rc-new1.png');
this.userorder='金牌铲屎官';
this.usrnewlist=this.goldmedal;
userwidth=100
}
this.$refs.userblock.style.width=userwidth+'%'
console.log(this.islogin)
console.log(this.userid);
let userwidth=0;
this.ifadroind();
let user= JSON.parse(localStorage.getItem("userInfo"));
console.log(user)
if(user!==null){
console.log('11')
this.userid=user.data;
console.log(this.userid);
this.usertitle=this.userid.memberName;
this.rcrcord=this.userid.availiblePoint;
if(this.userid.memberLevel==1){
let userlength=this.userid.availiblePoint.toString().length;
this.userimage=require('../../assets/image/rc-new.png');
this.userorder='新手铲屎官';
this.uservalue=5000; //
this.rcvalue=this.uservalue-this.userid.availiblePoint; //
if(userlength==1||userlength==2||userlength==3||userlength==4){
userwidth=this.userid.availiblePoint/100
console.log(userwidth);
}
}
else if(this.userid.memberLevel==2){
this.userimage=require('../../assets/image/rc-new2.png');
this.userorder='资深铲屎官';
this.uservalue=10000;
this.rcvalue=this.uservalue-this.userid.availiblePoint;
userwidth=this.userid.availiblePoint/100
}else if( this.userid.memberLevel==3){
this.userimage=require('../../assets/image/rc-new1.png');
this.userorder='金牌铲屎官';
this.usrnewlist=this.goldmedal;
userwidth=100
}
this.$refs.userblock.style.width=userwidth+'%';
let tagEle=document.querySelector('.ts-point-tag');
if(tagEle){
tagEle.innerText=this.userid.availiblePoint;
@ -412,14 +417,17 @@ obligation(item,index){
tagEleLeft=0;
tagEle.style.left=tagEleLeft+"%";
}
} else{
} else{
console.log('---');
this.userid=[];
}
if(this.userid==undefined ||this.userid==''||this.userid==null){
console.log(this.userid)
this.islogin=true;
console.log(this.userid)
this.islogin=true;
}
},

View File

@ -0,0 +1,414 @@
ul li ol li em strong i {
list-style: none;
font-style: normal;
}
.rc-header {
width: 100%;
}
.settlement {
padding-top: 100px;
}
.rc-main {
width: 92%;
margin: 0 auto;
max-width: 1400px;
.rc-userbottomm {
display: none;
}
.rc-border {
width: 100%;
border-bottom: 1px solid #d7d7d7;
margin-top: 32px;
}
.rc-receiving {
width: 100%;
height: 80px;
display: flex;
flex-direction: column;
em {
font-style: normal;
color: #e1001a;
font-size: 26px;
}
span {
color: #666666;
font-size: 16px;
display: block;
margin-top: 25px;
}
}
.delivery {
display: flex;
flex-direction: column;
height: 140px;
display: flex;
justify-content: center;
.viewdetails {
display: flex;
align-items: center;
justify-content: flex-end;
span {
color: #444444;
font-size: 18px;
display: block;
margin-right: 8px;
}
img {
width: 8px;
height: 16px;
}
}
.to-delivery {
display: flex;
align-items: center;
font-style: normal;
span {
display: block;
// margin-left: 16px;
font-size: 18px;
color: #333333;
}
i {
font-style: normal;
margin-left: 8px;
display: block;
font-size: 18px;
color: #999999;
}
}
.bo-delivery {
span {
font-size: 16px;
color: #666666;
display: block;
margin-top: 16px;
}
}
}
.address-list {
display: flex;
.mypersonal {
display: flex;
flex-direction: column;
justify-content: center;
border: 1px solid #808285;
height: 118px;
width: 320px;
padding: 15px;
color: #333333;
margin: 20px 40px 20px 0;
position: relative;
cursor: pointer;
&.active {
border: 1px solid #E2001A;
}
.edit {
position: absolute;
top: 5px;
right: 8px;
display: none;
cursor: pointer;
}
&:hover {
.edit {
display: block;
}
}
.my-delivery {
display: flex;
align-items: center;
font-style: normal;
span {
display: block;
margin-left: 3px;
}
i {
font-style: normal;
margin-left: 3px;
display: block;
}
}
.per-delivery {
span {
color: #666666;
display: block;
margin-top: 5px;
}
}
}
}
.rc-usermain {
display: flex;
padding: 20px 0;
.rc-image {
border: 1px solid #d8d8d8;
margin-right: 20px;
img {
width: 96px;
height: 96px;
display: block;
}
}
.rc-right {
.rc-usercenter {
display: flex;
justify-content: center;
flex-direction: column;
h3,
.price {
font-style: normal;
display: block;
font-size: 18px;
font-weight: bold;
margin-top: 17px;
color: #e1001a;
}
}
display: flex;
justify-content: space-between;
width: 100%;
}
.rc-userright {
display: flex;
flex-direction: column;
color: #666666;
font-size: 16px;
span {
display: block;
margin-top: 16px;
font-size: 16px;
}
}
.rc-userbottom {
display: flex;
width: 60%;
justify-content: space-between;
align-items: center;
.price {
font-style: normal;
color: #e1001a;
font-size: 20px;
font-weight: bold;
}
}
}
.rc-merchandise {
padding: 15px 0;
&::after {
display: block;
content: '';
clear: both;
}
ul {
width: 25%;
display: flex;
flex-direction: column;
justify-content: space-between;
line-height: 40px;
float: right;
i {
font-style: normal;
color: #666666;
}
li {
list-style: none;
font-style: normal;
display: flex;
justify-content: space-between;
span {
color: #333333;
}
}
li .red {
color: #e1001a;
font-size: 20px;
font-style: normal;
}
}
}
.rc-payment {
width: 100%;
margin-top: 80px;
.u-trackingnumber {
display: flex;
align-items: center;
i {
font-size: 18px;
font-style: normal;
margin-right: 16px;
}
img {
width: 8px;
height: 16px;
}
}
ul {
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
line-height: 40px;
font-size: 18px;
i {
font-style: normal;
color: #666666;
display: block;
}
li {
list-style: none;
font-style: normal;
display: flex;
justify-content: space-between;
span {
color: #333333;
}
}
}
}
.rc-foot {
display: flex;
flex-direction: column;
.rc-foo {
display: flex;
justify-content: flex-end;
flex-direction: column;
align-items: self-end;
i {
font-style: normal;
color: #333333;
font-size: 20px;
margin-right: 20px;
}
em {
font-style: normal;
color: #e1001a;
font-size: 26px;
}
span {
display: block;
width: 164px;
margin-top: 36px;
background: #e2001a;
line-height: 48px;
text-align: center;
color: white;
font-size: 16px;
height: 48px;
border-radius: 30px;
}
}
}
}
.diallog_width{
width: 100%;
max-width: 440px;
}
.el-dialog{
width: 100%;
}
//手机端
@media screen and (max-width: 768px) {
.diallog_width{
width: 100%;
}
.rc-main {
.address-list {
display: contents;
.mypersonal {
width: 100%;
height: auto;
}
}
.rc-usermain {
.rc-right { display: table}
}
.rc-merchandise{
padding: 15px 0 120px;
ul{
float: none;
width: 100%;
}
}
.rc-foot{
.rc-foo{
display: flex;
justify-content: space-around;
flex-direction: row;
align-items: self-end;
position: fixed;
bottom: 0;
background: #fff;
width: 100%;
padding: 10px;
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
<template>
<div>
<Myheader></Myheader>
<div class="rc-top"></div>
<div class="rc-full-width rc-layout-container">
<div class="rc-top"></div>
<div class="rc-header">
<div class="rc-main">
<div class="rc-headera">
<span
@ -118,39 +118,27 @@ export default {
goldmedal: [
{
ordernumber: "1111111111111111111",
orderstype: 1,
usereat: "专属升级奖励",
ordernum: 0,
num: "5kg",
specification: "1",
buttontitle:'立即支付',
userprice: "167.00",
catimage: require("../../assets/image/rc-win.png"),
orderDetailList:{
userlist:{
num:10,
pcs:10,
ecprice:167
}
}
ordernumber: "1111111111111111111",
orderstype: 1,
usereat: "专属升级奖励",
ordernum: 0,
num: "5kg",
specification: "1",
buttontitle:'立即支付',
userprice: "167.00",
catimage: require("../../assets/image/rc-win.png"),
},
{
ordernumber: "1111111111111111111",
usereat: "每年4次免积分产品试吃",
ordernum: 0,
buttontitle:'再次购买',
catimage: require("../../assets/image/usereat.png"),
orderstype: 2,
userprice: "167.00",
orderDetailList:{
userlist:{
num:10,
pcs:10,
ecprice:167
}
}
ordernumber: "1111111111111111111",
usereat: "每年4次免积分产品试吃",
ordernum: 0,
buttontitle:'再次购买',
catimage: require("../../assets/image/usereat.png"),
orderstype: 2,
userprice: "167.00",
},
{
ordernumber: "1111111111111111111",
@ -160,13 +148,6 @@ export default {
catimage: require("../../assets/image/usercar.png"),
orderstype: 3,
userprice: "167.00",
orderDetailList:{
userlist:{
num:10,
pcs:10,
ecprice:167
}
}
},
{
ordernumber: "1111111111111111111",
@ -183,13 +164,6 @@ export default {
catimage: require("../../assets/image/consult.png"),
orderstype: 2,
userprice: "167.00",
orderDetailList:{
userlist:{
num:10,
pcs:10,
ecprice:167
}
}
},
{
ordernumber: "1111111111111111111",
@ -198,13 +172,6 @@ export default {
catimage: require("../../assets/image/rc-book.png"),
orderstype: 3,
userprice: "167.00",
orderDetailList:{
userlist:{
num:10,
pcs:10,
ecprice:100
}
}
},
{
ordernumber: "1111111111111111111",
@ -213,13 +180,6 @@ export default {
catimage: require("../../assets/image/userself.png"),
orderstype: 3,
userprice: "167.00",
orderDetailList:{
userlist:{
num:10,
pcs:10,
ecprice:100
}
}
},
{
usereat: "每年积分兑换1次价值288元的免费体检及100元医院绝育券",
@ -227,83 +187,84 @@ export default {
catimage: require("../../assets/image/rc-health.png"),
orderstype: 3,
userprice: "167.00",
orderDetailList:{
userlist:{
num:10,
pcs:10,
ecprice:100
}
}
},
],
};
},
mounted() {
let user= JSON.parse(localStorage.getItem("userInfo"));
this.userdata=user;
let stype=this.$route.query.stype
if(user=='' ||user==null){
this.$message({
type: 'warning',
message: '请先去登录'
});
return
}else{
this.indet(user.data.mobile,stype);
}
let user= JSON.parse(localStorage.getItem("userInfo"));
this.userdata=user;
let stype=this.$route.query.stype
if(user=='' ||user==null){
this.$message({
type: 'warning',
message: '请先去登录'
});
return
}else{
this.indet(user.data.mobile,stype);
}
},
components: {
Myheader,
Myheader,
},
methods: {
async indet(mobile,stype){
let data=await userindent(mobile,);
this.activeIndex=stype;
//this.goldmedal=data;
let list=[];
let fahuolist=[];
console.log(this.goldmedal);
for(let i=0;i<this.goldmedal.length;i++){
list.push(this.goldmedal[i].orderDetailList);
}
},
async indet(mobile,stype){
let data=await userindent(mobile,);
this.activeIndex=stype;
this.goldmedal=data;
let list=[];
let fahuolist=[];
console.log(this.goldmedal);
for(let i=0;i<this.goldmedal.length;i++){
list.push(this.goldmedal[i].orderDetailList);
}
},
async canceldanhao(orderNumber){
let data=await canceldanhao(orderNumber);
console.log(data);
if(data){
this.$message({
type: 'warning',
message: '取消订单成功'
});
this.indet(this.userdata.data.mobile);
}
},
async canceldanhao(orderNumber){
let data=await canceldanhao(orderNumber);
console.log(data);
if(data){
this.$message({
type: 'warning',
message: '取消订单成功'
});
this.indet(this.userdata.data.mobile);
}
userpay(item,index){
console.log(item);
if(item.status==0){
this.canceldanhao(item.orderNumber);
}
console.log(item.buttontitle);
if(item.buttontitle=='立即支付'){
this.$router.push({
path: "/personal/userpay",
query: {
stype: 1,
},
});
}else if(item.buttontitle=='再次购买'){
this.$router.push({
path: "/myorder/userrecord",
query: {
stype: 1,
},
});
}
},
},
userpay(item,index){
console.log(item);
if(item.status==0){
this.canceldanhao(item.orderNumber);
}
console.log(item.buttontitle);
if(item.buttontitle=='立即支付'){
this.$router.push({
path: "/personal/userpay",
query: {
stype: 1,
},
});
}else if(item.buttontitle=='再次购买'){
this.$router.push({
path: "/myorder/userrecord",
query: {
stype: 1,
},
});
}
},
selectGoods(item, index) {
this.activeIndex = index;
if(index==1){
@ -339,6 +300,360 @@ export default {
</script>
<style lang="less" scoped>
@import url("../../assets/css/global.less");
@import url("../../assets/css/useraddress.less");
//
@media screen and(min-width: 320px) and(max-width:768px) {
.active {
font-size: 14px;
color: #e2001a;
cursor: pointer;
}
.unactive {
font-size: 14px;
color: #444444;
cursor: pointer;
}
.rc-header {
width: 100%;
.rc-main {
width: 92%;
margin: 0 auto;
.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;
}
}
}
}
}
// /* 768px1920 *pc/
@media screen and (min-width: 768px) and (max-width: 1920px) {
.active {
font-size: 18px;
color: #e2001a;
cursor: pointer;
// margin-left: 40px;
}
.unactive {
font-size: 18px;
color: #444444;
cursor: pointer;
// margin-left: 80px;
}
.rc-header {
.rc-main {
width: 92%;
margin: 0 auto;
.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;
}
}
}
}
}
}
</style>

View File

@ -1,578 +1,320 @@
<template>
<div>
<div class="page_modules">
<Myheader></Myheader>
<div class="rc-main">
<div class="online" style="height:3px;width:93%;margin:0 auto;background:#DDDDDD;margin-top:0.23rem"></div>
<div class="rc-hearder">
<div class="rc-userpay">
<div class="paysucess">
<span>订单提交成功等待付款</span>
</div>
<div class="rc-all">
<div class="rc-payprice">
<span>付款金额:</span>
<i>{{ userprice }}</i>
<div class="cont_modules">
<tabs></tabs>
<el-row class="order_info">
<el-col :span="6" class="ph_hidden">
<ul class="li_inline">
<li class="sucess_img">
<img src="../../assets/image/usersucess.png" alt="" />
</li>
<li class="ready">
<p>订单提交成功</p>
<p>等待付款</p>
</li>
</ul>
</el-col>
<el-col :span="12" class="ph_hidden">&nbsp;</el-col>
<el-col :span="6" class="ready_right">
<div class="inline_right">
<p>付款金额:</p>
<p class="price">{{ info.userprice }}</p>
</div>
<div class="rc-receiving">
<span>收货信息:</span>
<i>{{ userinformation }}</i>
<div class="inline_right">
<p>收货信息:</p>
<p>{{ info.userinformation }}</p>
</div>
</div>
<div class="online" style="height:3px;width:100%;background:#DDDDDD;"></div>
<div class="rc-usermaina">
<div class="rc-title" id="qrcode" ref="qrcode" >
</div>
</div>
</div>
<div class="rc-paystype">
<span>请选择支付方式</span>
</div>
<div class="online" style="height:3px;width:100%;background:#DDDDDD;"></div>
<div class="paystype">
<div
class="payAlipay"
</el-col>
</el-row>
</div>
<div class="rc_contline"></div>
<div class="cont_modules">
<div class="pay_title color_red">请选择支付方式</div>
</div>
<div class="rc_contline"></div>
<div class="cont_modules">
<div class="pay_list">
<ul>
<li
class="pay_item"
v-for="(item, index) in userpaystype"
:key="index"
@click="selectGoods(item, index)"
:class="activeIndex == index ? 'active' : 'unactive'"
:class="activeIndex == index ? 'active' : ''"
>
<div class="rc-payype">
<img :src="item.payimage" alt="" />
<span>{{ item.price }}</span>
</div>
<div class="user-righticon">
<img src="../../assets/image/rc-left.png" alt="" />
</div>
</div>
<img :src="item.payimage" alt="" />
<span>{{ item.paytype }}支付</span>
</li>
</ul>
</div>
</div>
<div class="paycord">
<div id="qrcode" ref="qrcode" class="qrcode"></div>
<span>{{ paytype }}扫一扫立即支付</span>
</div>
<el-dialog
:visible.sync="dialogSuccess"
@close="closeDialogSuccess"
>
<div class="tc dl_cont">
<div class="dl_img">
<img src="../../assets/image/usersucess.png" alt="" />
</div>
<h3 class="title">支付成功</h3>
<p>您的商品我们正在抓紧打包请耐心等候</p>
<div class="line_dashed"></div>
<div class="userer">
<img
width="210"
height="210"
src="../../assets/image/rc-discount.png"
alt=""
/>
<p>微信扫一扫识别二维码</p>
<p class="tips">加入社群0元试用商品随单发放</p>
</div>
</div>
<div class="paycord" @click="usershow()" id="qrcode" ref="qrcode">
<!-- <img src="../../assets/image/rc-discount.png" alt="" />
<span>微信扫一扫立即支付</span> -->
</div>
</div>
</el-dialog>
<el-dialog
:visible.sync="dialogInfo1"
hegight="700px"
@close='closeDialog'
>
<div class="rc-header">
<div class="rc-titled" >
<img src="../../assets/image/usersucess.png" alt="">
</div>
<div class="rc-logmain">
<h3>支付成功</h3>
<span>{{usermessage}}</span>
</div>
<div class="userer">
<img src="../../assets/image/rc-discount.png" alt="">
<span>微信扫一扫识别二维码</span>
<i>加入社群0元试用商品随单发放</i>
</div>
</div>
</el-dialog>
:visible.sync="dialogFail"
@close="closeDialogFail"
>
<div class="tc dl_cont">
<div class="dl_img">
<img src="../../assets/pay/fail.png" alt="" />
</div>
<h3 class="title">支付失败</h3>
<p>请返回商品结算页面重新支付</p>
</div>
</el-dialog>
</div>
</template>
<script>
import Myheader from "~/components/header.vue";
import QRCode from 'qrcodejs2'
import { generateOrderWX } from "../../ajax/getData";
import tabs from "@/components/tabs.vue";
import QRCode from "qrcodejs2";
import { generateOrderAlipay, updateOrderWX } from "../../ajax/getData";
export default {
data() {
return {
userdata:null,
activeIndex: 0,
usermessage:'您的商品我们正在抓紧打包,请耐心等候!',
userprice: "¥167.00",
userinformation: "李某某 151****7917",
activeIndex: 0,
isSucess: false,
paytype: "微信",
userpaystype: [
{
price: "支付宝支付",
payimage: require("../../assets/image/rc-cat.png"),
catimage: require("../../assets/image/rc-left.png"),
paytype: "微信",
payimage: require("../../assets/pay/wx.png"),
},
{
price: "微信支付",
payimage: require("../../assets/image/rc-cat.png"),
catimage: require("../../assets/image/rc-left.png"),
paytype: "支付宝",
payimage: require("../../assets/pay/zfb.png"),
},
],
dialogInfo1:false,
dialogSuccess: true,
dialogFail: false,
};
},
computed: {
//
info() {
let obj = {
userprice: this.$route.query.userPayData.postData[0].payAmount,
userinformation:
this.$route.query.userPayData.postData[0].orderAddress
.addressUserName +
" " +
this.$route.query.userPayData.postData[0].orderAddress
.addressPhoneNumber,
};
return obj;
},
},
mounted() {
this.userdata=this.$route.query.wxdata;
this.userpay(this.userdata);
console.log(this.userdata);
this.$nextTick(() => {
this.userpay();
})
this.qrcode(this.$route.query.userPayData.wxPay);
},
methods: {
closeDialog(){
this.qrcode=null;
console.log('关闭的')
},
async userpay(userdata) {
console.log("-----");
let data = await generateOrderWX();
console.log();
this.qrcode(userdata);
closeDialogSuccess() {
this.qrcode = null;
this.$router.push({
path: "/index",
});
},
qrcode (e) {
console.log(e);
let qrcode = new QRCode('qrcode',{
width: 150, //
height: 150, //
text: e//
})
},
selectGoods(item,index){
let _that=this
_that.dialogInfo1=true;
_that.activeIndex=index;
if(item.price=='微信支付'){
// this.userpay();
}
},
usershow(){
console.log('这是支付')
this.dialogInfo1=true;
closeDialogFail() {
this.qrcode = null;
this.$router.push({
path: "/personal/useraddress",
});
},
qrcode(e) {
let qrcode = new QRCode("qrcode", {
width: 260, //
height: 260, //
text: e, //
});
},
async selectGoods(item, index) {
this.activeIndex = index;
this.paytype = item.paytype;
if (index == 1) {
//
let res = await generateOrderAlipay(
this.$route.query.userPayData.postData
);
if (res.success) {
this.qrcode(res.data);
}
}
},
//
async updateOrderWX() {
let res = await updateOrderWX();
if (res.success) {
this.dialogSuccess = true;
clearInterval(this.time);
} else {
this.dialogFail = true;
clearInterval(this.time);
}
},
},
components: {
Myheader,
tabs,
},
};
</script>
<style lang="less" scoped >
@media screen and (max-width: 768px) {
.rc-usermaina{
width: 100%;
display: flex;
align-items: center;
justify-content: center;
display: none;
}
.rc-userpay{
display: none;
}
/deep/.el-dialog {
width:80%;
height: 500px;
.sucess_img {
width: 96px;
height: 96px;
margin-right: 10px;
}
.rc-header{
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
h3{
color:#333333;
font-size: 26px;
}
.rc-title{
.order_info {
padding: 10px 0;
}
.info {
display: flex;
justify-content: space-between;
}
.ready {
font-size: 20px;
color: #e2001a;
}
.ready_right {
line-height: 200%;
padding-top: 8px;
}
.price {
font-size: 20px;
color: #e2001a;
}
.pay_title {
font-size: 26px;
padding: 26px 0;
border-bottom: 1px solid #d7d7d7;
}
.pay_list {
padding: 20px 0;
.pay_item {
float: left;
margin-right: 20px;
display: flex;
margin-top: 30px;
display: none;
img{
width: 96px;
height: 96px;
margin-left: 40px;
}
}
.rc-titled{
img{
width: 96px;
height: 96px;
}
}
.userer{
display: flex;
flex-direction: column;
align-items: center;
img{
width: 96px;
height: 96px;
display: flex;
justify-content: center;
flex-direction: column;
}
span{
font-size: 16px;
color: #333333;
border: 1px solid #333333;
padding: 5px 20px;
cursor: pointer;
&.active {
border: 1px solid #e2001a;
color: #e2001a;
}
i{
font-size: 18px;
font-style: normal;
display: block;
margin-top: 32px;
color: #E1001A;
img {
margin-right: 5px;
width: 24px;
height: 24px;
}
}
}
.rc-main {
width: 100%;
margin-top: 24%;
.paysucess{
display: none;
}
.paycord{
display: none;
}
.rc-hearder {
width: 93%;
margin: 0 auto;
i em {
font-style: normal;
}
.rc-userpay {
width: 100%;
// height: 96px;
display: flex;
flex-direction: column;
justify-content: center;
.rc-all{
height: 96px;
display: flex;
flex-direction: column;
justify-content: center;
// display: none;
}
.rc-payprice {
display: flex;
justify-content: space-between;
span {
font-size: 14px;
color: #333333;
}
i {
font-size: 14px;
font-style: normal;
color: #e1001a;
}
}
.rc-receiving {
margin-top: 8px;
display: flex;
justify-content: space-between;
span {
font-size: 14px;
color: #333333;
}
i {
font-style: normal;
color: #666666;
font-size: 14px;
}
}
strong {
font-size: 16px;
display: block;
margin-top: 53px;
color: #e1001a;
}
}
.rc-paystype {
height:64px;
display: flex;
align-items: center;
span {
font-size: 16px;
color: #e1001a;
}
}
.payAlipay {
.user-righticon{
display: flex;
align-items: center;
img{
width: 8px;
height: 16px;
}
}
display: flex;
justify-content: space-between;
height: 80px;
border-bottom: 1px solid #d8d8d8;
.rc-payype {
display: flex;
align-items: center;
img {
width: 32px;
height: 32px;
border-radius: 50%;
}
span {
color: #333333;
font-size: 14px;
margin-left: 16px;
}
}
}
}
}
}
@media screen and (min-width: 768px) and (max-width: 1920px) {
.rc-usermaina{
width: 100%;
display: flex;
align-items: center;
justify-content: center;
display: block;
}
/deep/.el-dialog {
width: 440px;
height: 677px;
}
.rc-header{
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
h3{
color:#333333;
font-size: 26px;
}
.rc-titled{
img{
width: 96px;
height: 96px;
}
}
.rc-title{
position: absolute;
left: 50%;
margin-left: -75px;
&::after {
content: "";
display: block;
top: 59%;
img{
width: 96px;
height: 96px;
}
}
.userer{
img{
width: 210px;
height: 210px;
display: flex;
justify-content: center;
flex-direction: column;
}
span{
font-size: 16px;
color: #333333;
}
i{
font-size: 18px;
font-style: normal;
display: block;
margin-top: 32px;
color: #E1001A;
}
clear: both;
}
}
.rc-main {
.active {
border: 1px solid #E2001A;
cursor: pointer;
width: 200px;
height: 56px;
.paycord {
padding: 10px;
text-align: center;
.qrcode {
margin: 0 auto 10px;
width: 260px;
height: 260px;
}
}
.unactive {
border:1px solid #3D3D3D;
cursor: pointer;
width: 200px;
height: 56px;
.dl_width {
width: 440px;
}
width: 100%;
.rc-hearder {
width: 93%;
.dl_cont {
color: #333;
margin-top: -10px;
.title {
font-size: 26px;
font-weight: bold;
padding-bottom: 10px;
}
.line_dashed {
border-bottom: 2px dashed #999999;
margin: 10px 0;
}
.dl_img {
img {
width: 90px;
height: 90px;
margin: 0 auto;
i em {
font-style: normal;
}
.rc-userpay {
width: 100%;
height: 96px;
// display: flex;
// justify-content: space-between;
.paysucess{
display: flex;
align-items: center;
span{
font-size: 20px;
display: block;
width: 61%;
color: #E2001A;
}
}
.rc-all{
display: flex;
flex-direction: column;
justify-content: center;
}
.rc-payprice {
display: flex;
justify-content: flex-end;
span {
font-size: 16px;
color: #333333;
}
i {
font-size: 16px;
font-style: normal;
color: #e1001a;
}
}
.rc-receiving {
margin-top: 8px;
display: flex;
justify-content: flex-end;
span {
font-size: 16px;
color: #333333;
}
i {
font-style: normal;
color: #666666;
font-size: 16px;
}
}
strong {
font-size: 16px;
display: block;
margin-top: 53px;
color: #e1001a;
}
}
.paystype{
display: flex;
align-items: center;
}
.rc-paystype {
height: 100px;
display: flex;
align-items: center;
span {
font-size: 26px;
color: #E2001A;
}
}
.payAlipay {
margin-left: 20px;
.user-righticon{
display: none;
img{
width: 8px;
height: 16px;
}
}
display: flex;
justify-content: space-between;
height: 56px;
.rc-payype {
display: flex;
align-items: center;
font-size: 16px;
color: #E2001A;
justify-content: center;
width: 100%;
img {
width: 32px;
height: 32px;
border-radius: 50%;
}
span {
margin-left: 16px;
}
}
}
}
.paycord{
width: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
img{
width: 260px;
height: 260px;
display: block;
}
span{
font-size: 20px;
display: block;
color: #333333;
}
padding: 0px 0 20px;
}
.userer {
img {
margin: 0 auto;
}
}
.tips {
color: #e2001a;
margin-top: 30px;
font-size: 18px;
}
}
@media screen and (max-width: 768px) {
.ph_hidden {
display: none;
}
.ready_right {
width: 100%;
padding: 10px;
}
.pay_title {
padding: 10px;
}
.pay_list {
padding: 0;
.pay_item {
float: none;
border: none;
border-bottom: 1px solid #d7d7d7;
height: 50px;;
margin-right: 0;
align-items: center;
justify-content: left;
justify-content: left; &.active {
border: none;
border-bottom: 1px solid #d7d7d7;
}
}
}
.paycord{ display:none;}
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -104,7 +104,6 @@ export default {
//
async editaddress(user) {
user.data.id=844350
let data = await selectaddress(user.data.id);
this.list=data.data;

View File

@ -1,308 +1,308 @@
<template>
<div class="container rc-full-width">
<div class="container rc-full-width">
<Myheader></Myheader>
<div class="rc-top"></div>
<div class="rc-top"></div>
<div class="content ts-max-width--460">
<h2 class="rc-beta rc-text--center">账号注册</h2>
<div class="rc-layout-container rc-one-column">
<div class="rc-column">
<input
class="ts-standard-input"
v-model="tel"
placeholder="请输入手机号"
:error-message="usertel"
v-if="!ifpassword"
clearable
/>
</div>
</div>
<!-- <van-field
v-model="password"
type="password"
placeholder="请输入密码"
:error-message="pass"
clearable
/> -->
<div class="rc-layout-container rc-two-column">
<div class="rc-column">
<input
v-if="!ifpassword"
v-model="sms"
class="ts-standard-input ts-standard-input--two center"
center
clearable
placeholder="请输入验证码"
>
</div>
<div class="rc-column">
<button
:disabled="flag"
slot="button"
size="small"
@click="sendCode"
class="rc-use ts-standard-btn ts-standard-btn--two"
>{{ buttonmsg }}</button
>
</div>
</div>
<div class="content ts-max-width--460">
<h2 class="rc-beta rc-text--center">账号注册</h2>
<div class="rc-layout-container rc-one-column">
<div class="usecheck rc-column rc-text--left">
<label>
<input
type="checkbox"
@click="checkBox()"
style="width: 24px; height: 24px"
v-model="inRank"
/>使
</label>
</div>
</div>
<div class="rc-layout-container rc-two-column rc-button">
<div class="rc-column rc-text--left">
<a href="#" class="rc-styled-link"><span>隐私政策</span></a>
</div>
<div class="rc-column rc-text--right">
<nuxt-link :to="`/userlogin/login/`" class="rc-styled-link">
<span>返回登录</span>
</nuxt-link>
</div>
</div>
<div class="rc-layout-container rc-one-column">
<div class="rc-column">
<input
class="ts-standard-input"
v-model="tel"
placeholder="请输入手机号"
:error-message="usertel"
v-if="!ifpassword"
clearable
/>
</div>
</div>
<!-- <van-field
v-model="password"
type="password"
placeholder="请输入密码"
:error-message="pass"
<div class="rc-layout-container rc-one-column">
<div class="rc-column">
<input
type="primary"
:loading="loading"
loading-text="注册中..."
size="large"
:disabled="zhud"
@click="register()"
class="ts-standard-btn ts-standard-btn--max-width"
value="注册"
></input
>
<!-- <van-divider @click="toLogin">注册账户</van-divider> -->
</div>
</div>
</div>
clearable
/> -->
<div class="rc-layout-container rc-two-column">
<div class="rc-column">
<input
v-if="!ifpassword"
v-model="sms"
class="ts-standard-input ts-standard-input--two center"
center
clearable
placeholder="请输入验证码"
>
</div>
<div class="rc-column">
<button
:disabled="flag"
slot="button"
size="small"
@click="sendCode"
class="rc-use ts-standard-btn ts-standard-btn--two"
>{{ buttonmsg }}</button
>
</div>
</div>
<div class="rc-layout-container rc-one-column">
<div class="usecheck rc-column rc-text--left">
<label>
<input
type="checkbox"
@click="checkBox()"
style="width: 24px; height: 24px"
v-model="inRank"
/>使
</label>
</div>
</div>
<div class="rc-layout-container rc-two-column rc-button">
<div class="rc-column rc-text--left">
<a href="#" class="rc-styled-link"><span>隐私政策</span></a>
</div>
<div class="rc-column rc-text--right">
<nuxt-link :to="`/userlogin/login/`" class="rc-styled-link">
<span>返回登录</span>
</nuxt-link>
</div>
</div>
<div class="rc-layout-container rc-one-column">
<div class="rc-column">
<input
type="primary"
:loading="loading"
loading-text="注册中..."
size="large"
:disabled="zhud"
@click="register()"
class="ts-standard-btn ts-standard-btn--max-width"
value="注册"
></input
>
<!-- <van-divider @click="toLogin">注册账户</van-divider> -->
</div>
</div>
</div>
</div>
</template>
<script>
import {useredit,inserdiscount,sendMsg,vadatnmsg } from '../../ajax/getData'
import {useredit,inserdiscount,sendMsg,vadatnmsg } from '../../ajax/getData'
import Myheader from '~/components/header.vue' //
export default {
data () {
return {
phone:'',
layerMSg:'手机格式不对',
tel:'',
password:'',
captchadata:'',
tamp:'',
hash:'',
sms:'',
buttonmsg:'获取验证码',
flag:false,
adminCode:'',
zhud:false,
usercheckbox:false,
loading:false,
usertitle:true,
gender: '',
inRank:false,
ifpassword:false
phone:'',
layerMSg:'手机格式不对',
tel:'',
password:'',
captchadata:'',
tamp:'',
hash:'',
sms:'',
buttonmsg:'获取验证码',
flag:false,
adminCode:'',
zhud:false,
usercheckbox:false,
loading:false,
usertitle:true,
gender: '',
inRank:false,
ifpassword:false
};
},
components: {
Myheader,
},
computed: {
usertel () {
if (this.tel === ""){
return ''
}else if(!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel)){
return '手机号格式错误'
}else {
return ''
}
},
pass () {
if (this.password === ""){
return ''
}else if(this.password.length<6){
return '密码不可小于6位'
}else {
return ''
}
},
computed: {
usertel () {
if (this.tel === ""){
return ''
}else if(!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel)){
return '手机号格式错误'
}else {
return ''
}
},
pass () {
if (this.password === ""){
return ''
}else if(this.password.length<6){
return '密码不可小于6位'
}else {
return ''
}
},
},
mounted(){
},
methods: {
//
//
async usermsg() {
//console.log("-----");
let data = await sendMsg(this.tel);
if(data){
//console.log(data);
//this.captchadata=data.msgNum;
this.tamp=data.tamp;
this.hash=data.hash;
//console.log(data);
//this.captchadata=data.msgNum;
this.tamp=data.tamp;
this.hash=data.hash;
}
},
async vadmsg() {
async vadmsg() {
//console.log("-----");
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
if(data){
return data;
}
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
if(data){
return data;
}
},
checkBox(){
//console.log(event.target.checked)
this.usercheckbox=event.target.checked
checkBox(){
//console.log(event.target.checked)
this.usercheckbox=event.target.checked
},
//
async serdiscount (mobile,couponId) {
//
async serdiscount (mobile,couponId) {
let data = await inserdiscount(mobile,couponId);
if(data){
console.log(data);
console.log(data);
}
//console.log(data);
},
//
sendCode () {
this.getCode()
},
//
sendCode () {
this.getCode()
},
getCode() {
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
return
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
return
} else{
let time = 60;
let timer;
timer = setInterval(() => {
time--;
if (time === 0) {
clearInterval(timer);
this.flag = false;
this.buttonmsg = "点击发送验证码";
return;
}
this.flag = true;
this.buttonmsg = time + "秒后重新发送";
}, 1000);
this.usermsg();
let time = 60;
let timer;
timer = setInterval(() => {
time--;
if (time === 0) {
clearInterval(timer);
this.flag = false;
this.buttonmsg = "点击发送验证码";
return;
}
this.flag = true;
this.buttonmsg = time + "秒后重新发送";
}, 1000);
this.usermsg();
}
},
async register () {
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
return
async register () {
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
return
}
// if(this.sms!==this.captchadata){
// this.$message({
// type: 'warning',
// message: ''
// });
// return
// }
if(this.sms==''){
this.$message({
type: 'warning',
message: '请输入验证码'
});
return
// if(this.sms!==this.captchadata){
// this.$message({
// type: 'warning',
// message: ''
// });
// return
// }
if(this.sms==''){
this.$message({
type: 'warning',
message: '请输入验证码'
});
return
}
console.log(this.usercheckbox);
if(this.usercheckbox==false){
console.log('----');
this.$message({
type: 'warning',
message: '请先同意隐私声明和账号使用协议'
});
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
this.$message({
type: 'warning',
message: '请先同意隐私声明和账号使用协议'
});
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
return
type: 'warning',
message: '手机号码输入有误'
});
return
}
}
}
else{
else{
//let user= JSON.parse(localStorage.getItem("userInfo"));
let data = await this.vadmsg();
if(data.code=="1")
{
data=await useredit(this.tel);
if(data.code=='1'){
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: "/",
});
return;
}
}
this.$message({
type: 'warning',
message: data.msg
});
return
let data = await this.vadmsg();
if(data.code=="1")
{
data=await useredit(this.tel);
if(data.code=='1'){
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: "/",
});
return;
}
}
this.$message({
type: 'warning',
message: data.msg
});
return
}
},
// reallR () {
// this.zhud=true
// this.loading=true
// axios.post('https://www.daxunxun.com/users/register', {
// username: this.tel,
// password: this.password
// }).then(res=>{
// this.zhud=false
// this.loading=false
// if (res.data === 2) {
// Toast('')
// } else if (res.data === 0) {
// Toast('')
// } else {
// Toast('')
// }
// })
// }
},
// reallR () {
// this.zhud=true
// this.loading=true
// axios.post('https://www.daxunxun.com/users/register', {
// username: this.tel,
// password: this.password
// }).then(res=>{
// this.zhud=false
// this.loading=false
// if (res.data === 2) {
// Toast('')
// } else if (res.data === 0) {
// Toast('')
// } else {
// Toast('')
// }
// })
// }
}
}

View File

@ -1,116 +1,116 @@
<template>
<div class="container rc-full-width">
<div class="container rc-full-width">
<Myheader></Myheader>
<div class="rc-top"></div>
<div class="content ts-max-width--460">
<h2 class="rc-beta rc-text--center">{{ usertitle ? "账号登录" : "" }}</h2>
<!-- Deprecated : No tab switching as no password
<div class="rc-header">
<span
v-for="(item, index) in swiperData"
:key="index"
@click="selectGoods(item, index)"
:class="activeIndex == index ? 'active' : 'unactive'"
>{{ item.title }}</span
>
</div>
-->
<div class="rc-layout-container rc-one-column">
<div class="rc-column">
<input
class="ts-standard-input"
v-model="tel"
placeholder="请输入手机号"
:error-message="usertel"
v-if="!ifpassword"
clearable
/>
</div>
</div>
<!-- Deprecated : No tab switching as no password
<input
v-model="text"
class="ts-standard-input ts-standard-input--two"
placeholder="请输入账号"
v-if="ifpassword"
clearable
/>
<van-field
v-model="password"
type="password"
placeholder="请输入密码"
v-if="ifpassword"
clearable
/>
-->
<div class="rc-layout-container rc-two-column">
<div class="rc-column">
<input
v-if="!ifpassword"
v-model="sms"
class="ts-standard-input ts-standard-input--two center"
center
clearable
placeholder="请输入验证码"
>
</div>
<div class="rc-column">
<button
:disabled="flag"
slot="button"
size="small"
@click="sendCode"
class="rc-use ts-standard-btn ts-standard-btn--two"
>{{ buttonmsg }}</button
>
</div>
</div>
<div class="rc-layout-container rc-one-column">
<div class="usecheck rc-column rc-text--left">
<label>
<input
type="checkbox"
@click="checkBox()"
style="width: 24px; height: 24px"
v-model="inRank"
/>使
</label>
</div>
</div>
<div class="rc-layout-container rc-two-column rc-button">
<div class="rc-column rc-text--left">
<a href="#" class="rc-styled-link"><span>隐私政策</span></a>
</div>
<div class="rc-column rc-text--right">
<nuxt-link :to="`/userlogin/edit/`" class="rc-styled-link">
<span>注册账户</span>
</nuxt-link>
</div>
</div>
<div class="rc-layout-container rc-one-column">
<div class="rc-column">
<input
type="primary"
:loading="loading"
loading-text="登录..."
size="large"
:disabled="zhud"
@click="register()"
class="ts-standard-btn ts-standard-btn--max-width"
value="登录"
></input
>
<!-- <van-divider @click="toLogin">注册账户</van-divider> -->
</div>
</div>
</div>
</div>
<div class="rc-top"></div>
<div class="content ts-max-width--460">
<h2 class="rc-beta rc-text--center">{{ usertitle ? "账号登录" : "" }}</h2>
<!-- Deprecated : No tab switching as no password
<div class="rc-header">
<span
v-for="(item, index) in swiperData"
:key="index"
@click="selectGoods(item, index)"
:class="activeIndex == index ? 'active' : 'unactive'"
>{{ item.title }}</span
>
</div>
-->
<div class="rc-layout-container rc-one-column">
<div class="rc-column">
<input
class="ts-standard-input"
v-model="tel"
placeholder="请输入手机号"
:error-message="usertel"
v-if="!ifpassword"
clearable
/>
</div>
</div>
<!-- Deprecated : No tab switching as no password
<input
v-model="text"
class="ts-standard-input ts-standard-input--two"
placeholder="请输入账号"
v-if="ifpassword"
clearable
/>
<van-field
v-model="password"
type="password"
placeholder="请输入密码"
v-if="ifpassword"
clearable
/>
-->
<div class="rc-layout-container rc-two-column">
<div class="rc-column">
<input
v-if="!ifpassword"
v-model="sms"
class="ts-standard-input ts-standard-input--two center"
center
clearable
placeholder="请输入验证码"
>
</div>
<div class="rc-column">
<button
:disabled="flag"
slot="button"
size="small"
@click="sendCode"
class="rc-use ts-standard-btn ts-standard-btn--two"
>{{ buttonmsg }}</button
>
</div>
</div>
<div class="rc-layout-container rc-one-column">
<div class="usecheck rc-column rc-text--left">
<label>
<input
type="checkbox"
@click="checkBox()"
style="width: 24px; height: 24px"
v-model="inRank"
/>使
</label>
</div>
</div>
<div class="rc-layout-container rc-two-column rc-button">
<div class="rc-column rc-text--left">
<a href="#" class="rc-styled-link"><span>隐私政策</span></a>
</div>
<div class="rc-column rc-text--right">
<nuxt-link :to="`/userlogin/edit/`" class="rc-styled-link">
<span>注册账户</span>
</nuxt-link>
</div>
</div>
<div class="rc-layout-container rc-one-column">
<div class="rc-column">
<input
type="primary"
:loading="loading"
loading-text="登录..."
size="large"
:disabled="zhud"
@click="register()"
class="ts-standard-btn ts-standard-btn--max-width"
value="登录"
></input
>
<!-- <van-divider @click="toLogin">注册账户</van-divider> -->
</div>
</div>
</div>
</div>
</template>
@ -149,7 +149,7 @@ export default {
};
},
components: {
Myheader
Myheader
},
computed: {
usertel() {
@ -188,32 +188,32 @@ export default {
// },
methods: {
...mapMutations(["changeClod"]),
...mapMutations(["changeClod"]),
checkBox(){
console.log(event.target.checked)
this.usercheckbox=event.target.checked
console.log(event.target.checked)
this.usercheckbox=event.target.checked
},
//
async usermsg() {
async usermsg() {
//console.log("-----");
let data = await sendMsg(this.tel);
if(data){
console.log(data);
//this.captchadata=data.msgNum;
this.tamp=data.tamp;
this.hash=data.hash;
}
if(data){
console.log(data);
//this.captchadata=data.msgNum;
this.tamp=data.tamp;
this.hash=data.hash;
}
},
//
async vadmsg() {
//
async vadmsg() {
//console.log("-----");
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
if(data){
return data;
}
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
if(data){
return data;
}
},
onClickHander(e) {
console.log(e);
@ -239,93 +239,93 @@ export default {
},
sendCode() {
this.getCode();
this.getCode();
},
getCode() {
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
return
} else{
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
return
let time = 60;
let timer;
timer = setInterval(() => {
time--;
if (time === 0) {
clearInterval(timer);
this.flag = false;
this.buttonmsg = "点击发送验证码";
return;
}
this.flag = true;
this.buttonmsg = time + "秒后重新发送";
}, 1000);
this.usermsg();
} else{
let time = 60;
let timer;
timer = setInterval(() => {
time--;
if (time === 0) {
clearInterval(timer);
this.flag = false;
this.buttonmsg = "点击发送验证码";
return;
}
this.flag = true;
this.buttonmsg = time + "秒后重新发送";
}, 1000);
this.usermsg();
}
},
async register() {
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
return
}
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
return
}
if(this.sms==''){
this.$message({
type: 'warning',
message: '请输入验证码'
});
return
this.$message({
type: 'warning',
message: '请输入验证码'
});
return
}
if(this.usercheckbox==false){
//console.log('----');
this.$message({
type: 'warning',
message: '请先同意隐私声明和账号使用协议'
});
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
return
//console.log('----');
this.$message({
type: 'warning',
message: '请先同意隐私声明和账号使用协议'
});
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
return
}
}
}
else{
let data=await this.vadmsg();
if(data.code=="1")
{
data = await userLongin(this.tel);
if(data.msg=='SUCCESS'){
this.$message({
type: 'warning',
message: '登录成功'
});
this.$router.push({
path: "/",
});
let token=JSON.stringify(data);
this.changeClod({ cloud: token });
return;
}
}
this.$message({
type: 'warning',
message: data.msg
});
else{
let data=await this.vadmsg();
if(data.code=="1")
{
data = await userLongin(this.tel);
if(data.msg=='SUCCESS'){
this.$message({
type: 'warning',
message: '登录成功'
});
this.$router.push({
path: "/",
});
let token=JSON.stringify(data);
this.changeClod({ cloud: token });
return;
}
}
this.$message({
type: 'warning',
message: data.msg
});
return
}},
return
}},
},
};
</script>

File diff suppressed because it is too large Load Diff