Merge pull request !253 from Admin/sit-Carl-lin-dev
This commit is contained in:
Admin 2022-03-23 10:13:38 +00:00 committed by Gitee
commit 281d5b7c14
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
29 changed files with 5615 additions and 5612 deletions

View File

@ -130,10 +130,10 @@ margin:0 auto;
justify-content: space-between
}
.usercontshow{
min-height: 20vh;
// min-height: 20vh;
margin-bottom: 2rem;
padding-left:.5rem;
padding-right:.5rem;
// padding-left:.5rem;
// padding-right:.5rem;
}
.rc-button{
@ -268,7 +268,7 @@ display: none;
border: 1px solid #D7D7D7;
border-radius: 3px;
position: relative;
margin-left: 20px;
// margin-left: 20px;
}
.alledit{

View File

@ -42,6 +42,7 @@
<script>
import addressInput from "~/components/addressInput.vue";
import { memberAddress } from "../ajax/getData";
import { mapState } from 'vuex';
export default {
data() {
return {
@ -168,6 +169,9 @@ export default {
return "";
}
},
...mapState({
userInfo : state => state.user.userInfo,
})
},
created() {
this.title =
@ -195,8 +199,9 @@ export default {
];
},
mounted() {
this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
this.userid = this.usermessage.data.id;
// this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
this.usermessage = this.userInfo;
this.userid = this.usermessage.id;
this.id = this.editAddressData.id;
},
};

View File

@ -2,24 +2,26 @@
<div class="rc-fixright-container">
<div class="rc-fixright">
<ul>
<li v-for="(userfixed,index) in fixedlist" :key="index" @click="lianxi(userfixed,index)">
<img :src="userfixed.catimage" alt="">
<span> {{userfixed.title}}</span>
<li v-for="(userfixed, index) in fixedlist" :key="index" @click="lianxi(userfixed, index)">
<img :src="userfixed.catimage" alt="" />
<span>{{ userfixed.title }}</span>
</li>
</ul>
<div class="tuntop" @click="toTop" v-show="gotop">
<img src="../assets/image/turntop.png" alt="">
<img src="../assets/image/turntop.png" alt="" />
<span>回到顶部</span>
</div>
</div>
<el-dialog :visible.sync="customerServerStop" :close-on-click-modal="false">
<div class="ts-warning-popup">
<div class="title rc-full-width">
<img src="../assets/error.png" alt="" />
</div>
<div class="title rc-full-width"><img src="../assets/error.png" alt="" /></div>
<div class="content rc-full-width rc-text--center rc-margin-y--md">
<h3>温馨提示</h3>
<span class="">客服因法定春节假期暂停服务<br/>预计2月10日恢复正常服务</span>
<span class="">
客服因法定春节假期暂停服务
<br />
预计2月10日恢复正常服务
</span>
</div>
</div>
</el-dialog>
@ -27,7 +29,7 @@
</template>
<script>
import { mapMutations } from "vuex";
import { mapMutations,mapState } from "vuex";
export default {
data(){
return{
@ -56,9 +58,9 @@ export default {
methods:{
...mapMutations(["checkIsLogin"]),
lianxi(item,index) {
this.checkIsLogin();
let user = this.$store.state.userInfo;
let curMemberId = (user?user.data.id:'');
// this.checkIsLogin();
let user = this.userInfo;
let curMemberId = (user?user.id:'');
if(item.title=='在线客服'){
//this.customerServerStop = true;
/* Stop until 2022-2-10 */
@ -128,13 +130,25 @@ export default {
}
}
},
created(){
computed:{
...mapState({
userInfo : state => state.user.userInfo,
loginState : state => state.login.loginState,
})
},
watch: {
userInfo(newVal){
if(newVal && this.loginState){
this.loginornot = false;
}else{
this.loginornot = true;
}
}
},
mounted(){
//Check login
this.checkIsLogin();
let usernot = this.$store.state.userInfo;
let usernot = this.userInfo;
//console.log(usernot);
if(usernot==null ||usernot==undefined){
this.loginornot=true
@ -148,5 +162,4 @@ export default {
}
</script>
<style lang="less" scoped >
</style>
<style lang="less" scoped></style>

View File

@ -9,9 +9,7 @@
<em class="rc-screen-reader" v-show="loginornot"></em>
</button>
<button class="rc-btn rc-btn--icon rc-icon rc-menu--xs rc-iconography rc-md-down" data-js-trigger="mobile-push-nav" aria-label="Menu" role="menuitem">
<span class="rc-screen-reader-text">
translations.feature.headerbar.menu
</span>
<span class="rc-screen-reader-text">translations.feature.headerbar.menu</span>
</button>
</li>
</ul>
@ -20,32 +18,47 @@
<span class="rc-screen-reader-text">translations.feature.headerbar.alternatelogotext</span>
<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 223 83.75" class="rc-header__logo">
<title>Royal Canin logo - animated</title>
<path class="cls-1 rc-header__logo-text" d="M98,74.8h-6l0,0c-0.2,0-0.3-0.2-0.3-0.3V56.4c0.1-0.3,0.1-0.7,0-1c-0.3-1.7-1.9-2.8-3.6-2.6 c-1.7,0.3-2.8,1.9-2.6,3.6v22.6c0,0.9,0.7,1.7,1.7,1.8H98c0.1,0,0.2,0,0.3,0c1.6-0.1,2.8-1.5,2.7-3.1C101,75.8,99.7,74.7,98,74.8z M76.3,54.3l-16,21.6c-0.4,0.5-0.6,1.1-0.6,1.8c0,0.9,0.4,1.9,1.3,2.4c1.4,0.9,3.1,0.6,4.1-0.6l3.1-4.2h7.5v2.4 c0.1,1.7,1.5,3,3.1,2.9l0,0c1.7,0,2.9-1.4,2.9-2.9V56.3c0-0.9-0.4-1.8-1-2.3C79.4,52.8,77.4,52.9,76.3,54.3z M75.6,69.2h-2.8 c-0.1,0-0.2-0.1-0.2-0.2V69l3-4.1C75.6,64.8,75.6,69.2,75.6,69.2z M67.5,56.4c0-1.6-1.3-2.9-2.8-2.9c-0.8,0-1.6,0.3-2.1,0.8 l-6.8,7.1c-0.1,0.1-0.2,0.1-0.3,0.1s-0.2,0-0.2-0.1l-6.8-7.1c-0.5-0.5-1.3-0.9-2.1-0.9c-1.6,0-2.8,1.3-2.8,2.8c0,0.7,0.3,1.5,0.7,2 l8.3,9.5l0.1,10c0,1.6,1.3,2.9,2.9,2.9c1.6,0,2.9-1.3,2.9-2.9l0.2-9.9l8.1-9.5C67.3,57.7,67.5,57,67.5,56.4z M32.4,53.4 c-7.5,0-13.6,6.1-13.6,13.6s6.1,13.6,13.6,13.6S46,74.4,46,66.9C46,59.6,39.9,53.5,32.4,53.4z M32.4,74.2c-4.1,0-7.3-3.2-7.3-7.3 s3.2-7.3,7.3-7.3s7.3,3.2,7.3,7.3C39.7,71,36.5,74.2,32.4,74.2z M175.9,52.8c-1.5,0.1-2.7,1.3-2.7,2.7v12.7c0,0.1-0.1,0.2-0.2,0.2 c-0.1,0-0.1,0-0.1-0.1l-7.4-13.1c-1.1-2-3.7-2.6-5.6-1.4c-1.1,0.7-1.9,2-2,3.3v20.8c0.1,1.7,1.6,2.9,3.1,2.8s2.7-1.3,2.8-2.8V65.2 c0-0.1,0.1-0.2,0.2-0.2s0.1,0,0.1,0.1l7.6,13.4c1,1.9,3.4,2.5,5.3,1.5c1.3-0.7,2-2,2-3.3V55.6C178.9,54,177.6,52.7,175.9,52.8z M14,69.5c2.4-1.5,4-4.1,3.9-6.9c0,0,0,0,0-0.1c0.1-4.9-3.9-9-8.8-9.1c-2.4-0.2-4.9,0.6-6.6,2.3C0.6,57.6,0,60,0,62.6l0.4,15.1 c0,1.6,1.3,2.9,2.9,2.9s2.9-1.3,2.9-2.9l0.1-7.2l0,0c0-0.2,0.1-0.3,0.3-0.3c0,0,0.1,0,0.2,0l7.1,9.7c0.5,0.5,1.1,0.7,1.9,0.7 c1.6,0,2.8-1.3,2.9-2.8c0-0.4-0.1-0.8-0.3-1.3L14,69.5z M8.9,65.3c-0.2,0-0.3,0-0.5,0c-1.7-0.1-2.8-1.6-2.7-3.1 c0.1-1.7,1.6-2.8,3.1-2.7c0.2,0,0.3,0,0.5,0c1.7,0.1,2.8,1.6,2.7,3.1C11.9,64.2,10.4,65.7,8.9,65.3z M129.8,71.5 c-0.4,0-0.9,0.1-1.4,0.3l-2.4,1.6c-1.1,0.7-2.5,1.1-3.9,1.1c-4.2-0.2-7.3-3.8-7.1-7.8c0.2-3.9,3.2-6.9,7.1-7.1 c1.4,0,2.7,0.4,3.9,1.1l2.3,1.6c0.4,0.2,0.8,0.3,1.4,0.3c1.6,0,2.9-1.3,2.9-2.9l0,0c0-0.6-0.2-1.4-0.7-1.9c-2.3-2.7-5.7-4.3-9.4-4.3 c-7.5,0-13.6,6.1-13.6,13.6l0,0c0,7.2,5.6,13.2,12.8,13.6c3.9,0,7.5-1.6,10.2-4.4c0.4-0.5,0.7-1.1,0.6-1.9 C132.8,72.8,131.4,71.5,129.8,71.5z M185.4,52.7c-1.8,0-3.1,1.5-3.1,3.1v21.9c0,1.8,1.5,3.1,3.1,3.1c1.8,0,3.1-1.5,3.1-3.1V55.8 C188.5,54.1,187.2,52.7,185.4,52.7z M139.9,54.2c-0.6-0.6-1.5-1-2.4-1c-1.8,0-3.1,0.8-3.1,2.6v21.9l0,0c0,1.7,1.4,2.9,3,2.9 s3-1.3,3.1-2.9v-2.4h7.5l3.1,4.2c0.5,0.7,1.5,1.1,2.4,1.1c1.7,0,2.9-1.4,2.9-2.9c0-0.6-0.2-1.3-0.6-1.8L139.9,54.2z M143.5,69 c0,0.1-0.1,0.2-0.2,0.2h-2.8v-4.5l3,4.2C143.6,68.9,143.6,68.9,143.5,69z M209.9,52.8c-1.5,0.1-2.7,1.3-2.7,2.7v12.7 c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.1,0-0.2-0.1l-7.3-13.1c-1.1-2-3.7-2.6-5.6-1.4c-1.1,0.7-1.9,2-2,3.3v20.8c0,1.7,1.4,3,3,3 s3-1.4,3-3V65.2c0-0.1,0.1-0.2,0.2-0.2s0.1,0,0.1,0.1l7.6,13.4c1,1.9,3.4,2.5,5.3,1.5c1.3-0.7,2-2,2-3.3V55.6 C212.9,54,211.5,52.7,209.9,52.8z M220.7,55.3c0-0.1,0-0.1,0-0.2c0-0.8-0.6-1-1.3-1h-0.9c-0.3,0-0.4,0.2-0.4,0.3v2.7 c0,0.3,0.1,0.4,0.4,0.4s0.4-0.2,0.4-0.4v-1h0.2l0.5,1c0.1,0.2,0.2,0.4,0.5,0.4s0.4-0.1,0.4-0.3c0-0.1,0-0.1,0-0.2l-0.6-0.9 C220.3,56.2,220.7,55.7,220.7,55.3z M219.5,55.5h-0.6v-0.8h0.6c0.3,0,0.5,0.1,0.5,0.4S219.8,55.5,219.5,55.5z M219.4,52.6 L219.4,52.6c-1.8,0-3.2,1.5-3.2,3.2s1.5,3.2,3.2,3.2s3.2-1.5,3.2-3.2C222.5,54.1,221.1,52.6,219.4,52.6z M219.4,58.2L219.4,58.2 c-1.4,0-2.4-1-2.4-2.4s1-2.4,2.4-2.4s2.4,1,2.4,2.4C221.8,57.1,220.7,58.2,219.4,58.2z" style="fill:#e2001a"></path>
<path class="cls-1 rc-header__logo-crown" d="M132.7,38.8c-6.4-4.7-16-7.5-25.9-7.5s-19.6,2.8-25.9,7.5c-0.6,0.4-0.9,1.1-0.9,1.9c0,1.4,1,2.4,2.4,2.4l0,0 c0.5,0,1-0.2,1.5-0.5C88.2,39.4,96.5,36,107,36s18.7,3.4,23,6.6l0.1,0.1c1,0.7,2.6,0.5,3.3-0.6C134,41,133.8,39.5,132.7,38.8z M106.8,37c-9.2,0-17.9,2.7-23.3,7.2c0,0,0,0-0.1,0c-0.6,0.6-0.7,1.6-0.2,2.3c0.3,0.4,0.7,0.6,1.3,0.6c0.4,0,0.7-0.1,1-0.4 c4.8-4,12.8-6.5,21.2-6.5s16.3,2.4,21.2,6.5c0.7,0.6,1.8,0.5,2.3-0.2c0.6-0.7,0.5-1.8-0.2-2.3C124.6,39.8,115.9,37,106.8,37z M71.8,12.8L71.8,12.8L71.8,12.8L71.8,12.8z M77,19.7c0.7-2.9-1-5.8-4-6.7c-0.4-0.1-0.9-0.2-1.4-0.2c-3,0-5.4,2.4-5.4,5.4 s2.4,5.4,5.4,5.4C74.3,23.8,76.4,22.1,77,19.7z M106.8,28.1c3,0,5.4-2.4,5.4-5.4s-2.4-5.4-5.4-5.4s-5.4,2.4-5.4,5.4 S103.7,28.1,106.8,28.1z M106.8,14.3c3,0,5.4-2.4,5.4-5.4s-2.4-5.5-5.4-5.5s-5.4,2.4-5.4,5.4C101.3,11.9,103.7,14.3,106.8,14.3z M90.8,19.2C87.9,20,86.2,23.1,87,26c0.6,2.3,2.8,3.9,5.2,4h0.1c0.4,0,0.9-0.1,1.4-0.2c2.9-0.8,4.6-3.8,3.9-6.7 C97,20.7,94.8,19,92.3,19C91.7,19,91.3,19.1,90.8,19.2z M84,31.5c0.7-2.9-1-6-4-6.7c-0.4-0.1-0.9-0.2-1.4-0.2l0,0 c-0.9,0-1.9,0.3-2.8,0.7c-1.3,0.7-2.2,2-2.5,3.3c-0.4,1.5-0.2,2.9,0.6,4.2c0.9,1.7,2.7,2.6,4.7,2.7c0.9,0,2-0.2,2.8-0.7 C82.7,34.1,83.7,32.9,84,31.5z M119.9,29.7c0.5,0.1,0.9,0.2,1.5,0.2c3,0,5.4-2.5,5.4-5.4c0-2.5-1.7-4.6-4-5.2 c-0.5-0.1-0.9-0.2-1.5-0.2c-3,0-5.4,2.5-5.4,5.5C115.8,26.9,117.5,29.1,119.9,29.7z M123.5,16.5c0.4,0.1,0.9,0.2,1.5,0.2 c3,0,5.4-2.5,5.4-5.4c0-2.5-1.7-4.6-4-5.2c-0.5-0.1-0.9-0.2-1.5-0.2c-3,0-5.4,2.5-5.4,5.5C119.5,13.6,121.2,15.8,123.5,16.5z M137.7,25.4c-0.8-0.5-1.8-0.7-2.7-0.7c-3,0-5.4,2.4-5.4,5.4c0,0.4,0.1,0.9,0.2,1.4c0.3,1.4,1.3,2.6,2.5,3.3c2.6,1.6,6,0.6,7.5-2 c0.7-1.3,0.9-2.7,0.6-4.2C139.8,27.4,138.9,26.2,137.7,25.4z M147.2,17c-0.3-1.4-1.3-2.6-2.5-3.3c-2.6-1.6-6-0.6-7.5,2 c-0.7,1.3-0.9,2.7-0.6,4.2c0.3,1.4,1.3,2.6,2.5,3.3c2.6,1.6,6,0.7,7.5-1.9C147.4,19.9,147.6,18.2,147.2,17z M88.7,16.7L88.7,16.7 c0.5,0,1-0.1,1.5-0.2c2.9-0.8,4.6-3.9,3.9-6.7c-0.6-2.4-2.8-4-5.2-4c-0.5,0-0.9,0.1-1.5,0.2c-2.9,0.8-4.6,3.9-3.9,6.7 C84.1,15,86.2,16.7,88.7,16.7z" style="fill:#e2001a"></path>
<path
class="cls-1 rc-header__logo-text"
d="M98,74.8h-6l0,0c-0.2,0-0.3-0.2-0.3-0.3V56.4c0.1-0.3,0.1-0.7,0-1c-0.3-1.7-1.9-2.8-3.6-2.6 c-1.7,0.3-2.8,1.9-2.6,3.6v22.6c0,0.9,0.7,1.7,1.7,1.8H98c0.1,0,0.2,0,0.3,0c1.6-0.1,2.8-1.5,2.7-3.1C101,75.8,99.7,74.7,98,74.8z M76.3,54.3l-16,21.6c-0.4,0.5-0.6,1.1-0.6,1.8c0,0.9,0.4,1.9,1.3,2.4c1.4,0.9,3.1,0.6,4.1-0.6l3.1-4.2h7.5v2.4 c0.1,1.7,1.5,3,3.1,2.9l0,0c1.7,0,2.9-1.4,2.9-2.9V56.3c0-0.9-0.4-1.8-1-2.3C79.4,52.8,77.4,52.9,76.3,54.3z M75.6,69.2h-2.8 c-0.1,0-0.2-0.1-0.2-0.2V69l3-4.1C75.6,64.8,75.6,69.2,75.6,69.2z M67.5,56.4c0-1.6-1.3-2.9-2.8-2.9c-0.8,0-1.6,0.3-2.1,0.8 l-6.8,7.1c-0.1,0.1-0.2,0.1-0.3,0.1s-0.2,0-0.2-0.1l-6.8-7.1c-0.5-0.5-1.3-0.9-2.1-0.9c-1.6,0-2.8,1.3-2.8,2.8c0,0.7,0.3,1.5,0.7,2 l8.3,9.5l0.1,10c0,1.6,1.3,2.9,2.9,2.9c1.6,0,2.9-1.3,2.9-2.9l0.2-9.9l8.1-9.5C67.3,57.7,67.5,57,67.5,56.4z M32.4,53.4 c-7.5,0-13.6,6.1-13.6,13.6s6.1,13.6,13.6,13.6S46,74.4,46,66.9C46,59.6,39.9,53.5,32.4,53.4z M32.4,74.2c-4.1,0-7.3-3.2-7.3-7.3 s3.2-7.3,7.3-7.3s7.3,3.2,7.3,7.3C39.7,71,36.5,74.2,32.4,74.2z M175.9,52.8c-1.5,0.1-2.7,1.3-2.7,2.7v12.7c0,0.1-0.1,0.2-0.2,0.2 c-0.1,0-0.1,0-0.1-0.1l-7.4-13.1c-1.1-2-3.7-2.6-5.6-1.4c-1.1,0.7-1.9,2-2,3.3v20.8c0.1,1.7,1.6,2.9,3.1,2.8s2.7-1.3,2.8-2.8V65.2 c0-0.1,0.1-0.2,0.2-0.2s0.1,0,0.1,0.1l7.6,13.4c1,1.9,3.4,2.5,5.3,1.5c1.3-0.7,2-2,2-3.3V55.6C178.9,54,177.6,52.7,175.9,52.8z M14,69.5c2.4-1.5,4-4.1,3.9-6.9c0,0,0,0,0-0.1c0.1-4.9-3.9-9-8.8-9.1c-2.4-0.2-4.9,0.6-6.6,2.3C0.6,57.6,0,60,0,62.6l0.4,15.1 c0,1.6,1.3,2.9,2.9,2.9s2.9-1.3,2.9-2.9l0.1-7.2l0,0c0-0.2,0.1-0.3,0.3-0.3c0,0,0.1,0,0.2,0l7.1,9.7c0.5,0.5,1.1,0.7,1.9,0.7 c1.6,0,2.8-1.3,2.9-2.8c0-0.4-0.1-0.8-0.3-1.3L14,69.5z M8.9,65.3c-0.2,0-0.3,0-0.5,0c-1.7-0.1-2.8-1.6-2.7-3.1 c0.1-1.7,1.6-2.8,3.1-2.7c0.2,0,0.3,0,0.5,0c1.7,0.1,2.8,1.6,2.7,3.1C11.9,64.2,10.4,65.7,8.9,65.3z M129.8,71.5 c-0.4,0-0.9,0.1-1.4,0.3l-2.4,1.6c-1.1,0.7-2.5,1.1-3.9,1.1c-4.2-0.2-7.3-3.8-7.1-7.8c0.2-3.9,3.2-6.9,7.1-7.1 c1.4,0,2.7,0.4,3.9,1.1l2.3,1.6c0.4,0.2,0.8,0.3,1.4,0.3c1.6,0,2.9-1.3,2.9-2.9l0,0c0-0.6-0.2-1.4-0.7-1.9c-2.3-2.7-5.7-4.3-9.4-4.3 c-7.5,0-13.6,6.1-13.6,13.6l0,0c0,7.2,5.6,13.2,12.8,13.6c3.9,0,7.5-1.6,10.2-4.4c0.4-0.5,0.7-1.1,0.6-1.9 C132.8,72.8,131.4,71.5,129.8,71.5z M185.4,52.7c-1.8,0-3.1,1.5-3.1,3.1v21.9c0,1.8,1.5,3.1,3.1,3.1c1.8,0,3.1-1.5,3.1-3.1V55.8 C188.5,54.1,187.2,52.7,185.4,52.7z M139.9,54.2c-0.6-0.6-1.5-1-2.4-1c-1.8,0-3.1,0.8-3.1,2.6v21.9l0,0c0,1.7,1.4,2.9,3,2.9 s3-1.3,3.1-2.9v-2.4h7.5l3.1,4.2c0.5,0.7,1.5,1.1,2.4,1.1c1.7,0,2.9-1.4,2.9-2.9c0-0.6-0.2-1.3-0.6-1.8L139.9,54.2z M143.5,69 c0,0.1-0.1,0.2-0.2,0.2h-2.8v-4.5l3,4.2C143.6,68.9,143.6,68.9,143.5,69z M209.9,52.8c-1.5,0.1-2.7,1.3-2.7,2.7v12.7 c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.1,0-0.2-0.1l-7.3-13.1c-1.1-2-3.7-2.6-5.6-1.4c-1.1,0.7-1.9,2-2,3.3v20.8c0,1.7,1.4,3,3,3 s3-1.4,3-3V65.2c0-0.1,0.1-0.2,0.2-0.2s0.1,0,0.1,0.1l7.6,13.4c1,1.9,3.4,2.5,5.3,1.5c1.3-0.7,2-2,2-3.3V55.6 C212.9,54,211.5,52.7,209.9,52.8z M220.7,55.3c0-0.1,0-0.1,0-0.2c0-0.8-0.6-1-1.3-1h-0.9c-0.3,0-0.4,0.2-0.4,0.3v2.7 c0,0.3,0.1,0.4,0.4,0.4s0.4-0.2,0.4-0.4v-1h0.2l0.5,1c0.1,0.2,0.2,0.4,0.5,0.4s0.4-0.1,0.4-0.3c0-0.1,0-0.1,0-0.2l-0.6-0.9 C220.3,56.2,220.7,55.7,220.7,55.3z M219.5,55.5h-0.6v-0.8h0.6c0.3,0,0.5,0.1,0.5,0.4S219.8,55.5,219.5,55.5z M219.4,52.6 L219.4,52.6c-1.8,0-3.2,1.5-3.2,3.2s1.5,3.2,3.2,3.2s3.2-1.5,3.2-3.2C222.5,54.1,221.1,52.6,219.4,52.6z M219.4,58.2L219.4,58.2 c-1.4,0-2.4-1-2.4-2.4s1-2.4,2.4-2.4s2.4,1,2.4,2.4C221.8,57.1,220.7,58.2,219.4,58.2z"
style="fill:#e2001a"
></path>
<path
class="cls-1 rc-header__logo-crown"
d="M132.7,38.8c-6.4-4.7-16-7.5-25.9-7.5s-19.6,2.8-25.9,7.5c-0.6,0.4-0.9,1.1-0.9,1.9c0,1.4,1,2.4,2.4,2.4l0,0 c0.5,0,1-0.2,1.5-0.5C88.2,39.4,96.5,36,107,36s18.7,3.4,23,6.6l0.1,0.1c1,0.7,2.6,0.5,3.3-0.6C134,41,133.8,39.5,132.7,38.8z M106.8,37c-9.2,0-17.9,2.7-23.3,7.2c0,0,0,0-0.1,0c-0.6,0.6-0.7,1.6-0.2,2.3c0.3,0.4,0.7,0.6,1.3,0.6c0.4,0,0.7-0.1,1-0.4 c4.8-4,12.8-6.5,21.2-6.5s16.3,2.4,21.2,6.5c0.7,0.6,1.8,0.5,2.3-0.2c0.6-0.7,0.5-1.8-0.2-2.3C124.6,39.8,115.9,37,106.8,37z M71.8,12.8L71.8,12.8L71.8,12.8L71.8,12.8z M77,19.7c0.7-2.9-1-5.8-4-6.7c-0.4-0.1-0.9-0.2-1.4-0.2c-3,0-5.4,2.4-5.4,5.4 s2.4,5.4,5.4,5.4C74.3,23.8,76.4,22.1,77,19.7z M106.8,28.1c3,0,5.4-2.4,5.4-5.4s-2.4-5.4-5.4-5.4s-5.4,2.4-5.4,5.4 S103.7,28.1,106.8,28.1z M106.8,14.3c3,0,5.4-2.4,5.4-5.4s-2.4-5.5-5.4-5.5s-5.4,2.4-5.4,5.4C101.3,11.9,103.7,14.3,106.8,14.3z M90.8,19.2C87.9,20,86.2,23.1,87,26c0.6,2.3,2.8,3.9,5.2,4h0.1c0.4,0,0.9-0.1,1.4-0.2c2.9-0.8,4.6-3.8,3.9-6.7 C97,20.7,94.8,19,92.3,19C91.7,19,91.3,19.1,90.8,19.2z M84,31.5c0.7-2.9-1-6-4-6.7c-0.4-0.1-0.9-0.2-1.4-0.2l0,0 c-0.9,0-1.9,0.3-2.8,0.7c-1.3,0.7-2.2,2-2.5,3.3c-0.4,1.5-0.2,2.9,0.6,4.2c0.9,1.7,2.7,2.6,4.7,2.7c0.9,0,2-0.2,2.8-0.7 C82.7,34.1,83.7,32.9,84,31.5z M119.9,29.7c0.5,0.1,0.9,0.2,1.5,0.2c3,0,5.4-2.5,5.4-5.4c0-2.5-1.7-4.6-4-5.2 c-0.5-0.1-0.9-0.2-1.5-0.2c-3,0-5.4,2.5-5.4,5.5C115.8,26.9,117.5,29.1,119.9,29.7z M123.5,16.5c0.4,0.1,0.9,0.2,1.5,0.2 c3,0,5.4-2.5,5.4-5.4c0-2.5-1.7-4.6-4-5.2c-0.5-0.1-0.9-0.2-1.5-0.2c-3,0-5.4,2.5-5.4,5.5C119.5,13.6,121.2,15.8,123.5,16.5z M137.7,25.4c-0.8-0.5-1.8-0.7-2.7-0.7c-3,0-5.4,2.4-5.4,5.4c0,0.4,0.1,0.9,0.2,1.4c0.3,1.4,1.3,2.6,2.5,3.3c2.6,1.6,6,0.6,7.5-2 c0.7-1.3,0.9-2.7,0.6-4.2C139.8,27.4,138.9,26.2,137.7,25.4z M147.2,17c-0.3-1.4-1.3-2.6-2.5-3.3c-2.6-1.6-6-0.6-7.5,2 c-0.7,1.3-0.9,2.7-0.6,4.2c0.3,1.4,1.3,2.6,2.5,3.3c2.6,1.6,6,0.7,7.5-1.9C147.4,19.9,147.6,18.2,147.2,17z M88.7,16.7L88.7,16.7 c0.5,0,1-0.1,1.5-0.2c2.9-0.8,4.6-3.9,3.9-6.7c-0.6-2.4-2.8-4-5.2-4c-0.5,0-0.9,0.1-1.5,0.2c-2.9,0.8-4.6,3.9-3.9,6.7 C84.1,15,86.2,16.7,88.7,16.7z"
style="fill:#e2001a"
></path>
</svg>
</h1>
</a>
<ul class="rc-list rc-list--blank rc-list--inline rc-list--align rc-header__right" role="menubar">
<li class="rc-list__item rc-inline-flex" role="menubar">
<a href="https://weibo.com/chinaroyalcanin?topnav=1&wvr=6&topsug=1&is_all=1" target='_blank' class="rc-lg-up rc-btn rc-btn--icon rc-icon ts-weibo--xs rc-iconography rc-interactive" aria-label="weibo">
<span class="rc-screen-reader-text">
微博
</span>
<a
href="https://weibo.com/chinaroyalcanin?topnav=1&wvr=6&topsug=1&is_all=1"
target="_blank"
class="rc-lg-up rc-btn rc-btn--icon rc-icon ts-weibo--xs rc-iconography rc-interactive"
aria-label="weibo"
>
<span class="rc-screen-reader-text">微博</span>
</a>
<a href="javascript:;" onmouseenter='bindTracking(this)' evt-name='页内弹窗' evt-cat='headerBtnClick' evt-val='微信扫一扫' class="rc-lg-up rc-btn rc-btn--icon rc-icon ts-wechat--xs rc-iconography rc-interactive" aria-label="wechat">
<span class="rc-screen-reader-text">
微信
</span>
<a
href="javascript:;"
onmouseenter="bindTracking(this)"
evt-name="页内弹窗"
evt-cat="headerBtnClick"
evt-val="微信扫一扫"
class="rc-lg-up rc-btn rc-btn--icon rc-icon ts-wechat--xs rc-iconography rc-interactive"
aria-label="wechat"
>
<span class="rc-screen-reader-text">微信</span>
<div class="ts-hover-show">
<span class="rc-text--center">微信扫一扫</span>
<img src="../assets/showimage/royalcanincn-qrcode.jpg">
<img src="../assets/showimage/royalcanincn-qrcode.jpg" />
</div>
</a>
<a class="rc-xl-up rc-btn rc-btn--icon rc-icon ts-login--xs rc-iconography rc-interactive" aria-label="login" @click="turnlogin">
<span class="rc-screen-reader-text">
个人中心
</span>
<span class="rc-screen-reader-text">个人中心</span>
<em class="rc-screen-reader" v-show="loginornot"></em>
</a>
@ -57,24 +70,28 @@
</button>
-->
<button data-js-trigger="search-bar" @click='searchturn' evt-name='页内弹窗' evt-cat='headerBtnClick' evt-val='全文搜索' class="rc-btn rc-btn--icon rc-icon rc-search--xs rc-iconography rc-interactive" aria-label="Search" role="menuitem" data-click-modifier=".rc-hidden">
<button
data-js-trigger="search-bar"
@click="searchturn"
evt-name="页内弹窗"
evt-cat="headerBtnClick"
evt-val="全文搜索"
class="rc-btn rc-btn--icon rc-icon rc-search--xs rc-iconography rc-interactive"
aria-label="Search"
role="menuitem"
data-click-modifier=".rc-hidden"
>
<span class="rc-screen-reader-text">translations.feature.headerbar.search</span>
</button>
</li>
</ul>
</nav>
<nav class="rc-header__nav rc-header__nav--secondary rc-md-up" data-component="nav-track" data-nav-name="Header navigation">
<!-- Menu section-->
<div class="rc-container">
<ul class="rc-list rc-list--blank rc-list--inline rc-list--align rc-header__center">
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/cats" class="rc-list__header" data-ref="nav-link" role="menuitem" title="猫"></a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/dogs" class="rc-list__header" data-ref="nav-link" role="menuitem" title="犬"></a>
</li>
<li class="rc-list__item"><a href="https://royalcanin.com.cn/cats" class="rc-list__header" data-ref="nav-link" role="menuitem" title="猫"></a></li>
<li class="rc-list__item"><a href="https://royalcanin.com.cn/dogs" class="rc-list__header" data-ref="nav-link" role="menuitem" title="犬"></a></li>
<li class="rc-list__item">
<a href="/productdetails/productlist/" class="rc-list__header" data-ref="nav-link" role="menuitem" title="官方商城">官方商城</a>
</li>
@ -87,70 +104,41 @@
<div class="rc-full-width rc-max-width--xl rc-padding--sm">
<ul class="rc-list rc-list--blank rc-list--align ts-list--four-column" role="menubar">
<li class="rc-list__item rc-list__item--group">
<img src="../assets/showimage/sub-nav-1.jpg" class="ts-head-img rc-margin-bottom--xs">
<img src="../assets/showimage/sub-nav-1.jpg" class="ts-head-img rc-margin-bottom--xs" />
<a href="https://royalcanin.com.cn/cats" class="rc-list__header rc-margin--none" role="menuitem"></a>
<ul class="rc-list rc-list--blank rc-list--align test" role="menu">
<li class="rc-list__item">
<a href="/productdetails/productlist/?stype=0" class="rc-list__link" role="menuitem">产品</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/cats/breeds" class="rc-list__link" role="menuitem">品种</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/cats/getting-a-kitten" class="rc-list__link" role="menuitem">想养猫吗</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/cats/kitten" class="rc-list__link" role="menuitem">幼猫</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/cats/kitten/health" class="rc-list__link" role="menuitem">健康和心情</a>
</li>
<li class="rc-list__item"><a href="/productdetails/productlist/?stype=0" class="rc-list__link" role="menuitem">产品</a></li>
<li class="rc-list__item"><a href="https://royalcanin.com.cn/cats/breeds" class="rc-list__link" role="menuitem">品种</a></li>
<li class="rc-list__item"><a href="https://royalcanin.com.cn/cats/getting-a-kitten" class="rc-list__link" role="menuitem">想养猫吗</a></li>
<li class="rc-list__item"><a href="https://royalcanin.com.cn/cats/kitten" class="rc-list__link" role="menuitem">幼猫</a></li>
<li class="rc-list__item"><a href="https://royalcanin.com.cn/cats/kitten/health" class="rc-list__link" role="menuitem">健康和心情</a></li>
</ul>
</li>
<li class="rc-list__item rc-list__item--group">
<img src="../assets/showimage/sub-nav-2.jpg" class="ts-head-img rc-margin-bottom--xs">
<img src="../assets/showimage/sub-nav-2.jpg" class="ts-head-img rc-margin-bottom--xs" />
<a href="https://royalcanin.com.cn/dogs" class="rc-list__header rc-margin--none" role="menuitem"></a>
<ul class="rc-list rc-list--blank rc-list--align test" role="menu">
<li class="rc-list__item">
<a href="/productdetails/productlist/?stype=1" class="rc-list__link" role="menuitem">产品</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/dogs/breeds" class="rc-list__link" role="menuitem">品种</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/dogs/getting-a-puppy" class="rc-list__link" role="menuitem">想养只狗</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/dogs/puppy" class="rc-list__link" role="menuitem">幼犬</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/dogs/puppy/health" class="rc-list__link" role="menuitem">健康和心情</a>
</li>
<li class="rc-list__item"><a href="/productdetails/productlist/?stype=1" class="rc-list__link" role="menuitem">产品</a></li>
<li class="rc-list__item"><a href="https://royalcanin.com.cn/dogs/breeds" class="rc-list__link" role="menuitem">品种</a></li>
<li class="rc-list__item"><a href="https://royalcanin.com.cn/dogs/getting-a-puppy" class="rc-list__link" role="menuitem">想养只狗</a></li>
<li class="rc-list__item"><a href="https://royalcanin.com.cn/dogs/puppy" class="rc-list__link" role="menuitem">幼犬</a></li>
<li class="rc-list__item"><a href="https://royalcanin.com.cn/dogs/puppy/health" class="rc-list__link" role="menuitem">健康和心情</a></li>
</ul>
</li>
<li class="rc-list__item rc-list__item--group">
<img src="../assets/showimage/sub-nav-3.jpg" class="ts-head-img rc-margin-bottom--xs">
<img src="../assets/showimage/sub-nav-3.jpg" class="ts-head-img rc-margin-bottom--xs" />
<a href="/productdetails/productlist/" class="rc-list__header rc-margin--none" role="menuitem">官方商城</a>
<ul class="rc-list rc-list--blank rc-list--align test" role="menu">
<li class="rc-list__item">
<a href="/productdetails/productlist/?stype=0" class="rc-list__link" role="menuitem">猫系列</a>
</li>
<li class="rc-list__item">
<a href="/productdetails/productlist/?stype=1" class="rc-list__link" role="menuitem">狗系列</a>
</li>
<li class="rc-list__item"><a href="/productdetails/productlist/?stype=0" class="rc-list__link" role="menuitem">猫系列</a></li>
<li class="rc-list__item"><a href="/productdetails/productlist/?stype=1" class="rc-list__link" role="menuitem">狗系列</a></li>
</ul>
</li>
<li class="rc-list__item rc-list__item--group">
<img src="../assets/showimage/sub-nav-4.jpg" class="ts-head-img rc-margin-bottom--xs">
<img src="../assets/showimage/sub-nav-4.jpg" class="ts-head-img rc-margin-bottom--xs" />
<a href="https://royalcanin.com.cn/about" class="rc-list__header rc-margin--none" role="menuitem">关于我们</a>
<ul class="rc-list rc-list--blank rc-list--align test" role="menu">
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/about#growth-phase1" class="rc-list__link" role="menuitem">我们的历史</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/about" class="rc-list__link" role="menuitem">我们的价值观</a>
</li>
<li class="rc-list__item"><a href="https://royalcanin.com.cn/about#growth-phase1" class="rc-list__link" role="menuitem">我们的历史</a></li>
<li class="rc-list__item"><a href="https://royalcanin.com.cn/about" class="rc-list__link" role="menuitem">我们的价值观</a></li>
<!--
<li class="rc-list__item">
<a href="#about/future" class="rc-list__link" role="menuitem">可持续发展</a>
@ -174,7 +162,6 @@
</div>
<!-- Menu section end-->
</nav>
</header>
<!-- Popup menu -->
@ -213,13 +200,17 @@
<a href="https://royalcanin.com.cn/cats/breeds" class="rc-list__link ca" role="menuitem" title="Breeds">品种</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/cats/getting-a-kitten" class="rc-list__link ca" role="menuitem" title="Thinking of getting a cat">想养只猫</a>
<a href="https://royalcanin.com.cn/cats/getting-a-kitten" class="rc-list__link ca" role="menuitem" title="Thinking of getting a cat">
想养只猫
</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/cats/kitten" class="rc-list__link ca" role="menuitem" title="Kitten">幼猫</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/cats/kitten/health" class="rc-list__link ca" role="menuitem" title="Health and wellbeing">健康和心情</a>
<a href="https://royalcanin.com.cn/cats/kitten/health" class="rc-list__link ca" role="menuitem" title="Health and wellbeing">
健康和心情
</a>
</li>
</ul>
</li>
@ -240,13 +231,17 @@
<a href="https://royalcanin.com.cn/dogs/breeds" class="rc-list__link ca" role="menuitem" title="Breeds">品种</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/dogs/getting-a-puppy" class="rc-list__link ca" role="menuitem" title="Thinking of getting a dog">想养只犬</a>
<a href="https://royalcanin.com.cn/dogs/getting-a-puppy" class="rc-list__link ca" role="menuitem" title="Thinking of getting a dog">
想养只犬
</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/dogs/puppy" class="rc-list__link ca" role="menuitem" title="Puppy">幼犬</a>
</li>
<li class="rc-list__item">
<a href="https://royalcanin.com.cn/dogs/puppy/health" class="rc-list__link ca" role="menuitem" title="Health and wellbeing">健康和心情</a>
<a href="https://royalcanin.com.cn/dogs/puppy/health" class="rc-list__link ca" role="menuitem" title="Health and wellbeing">
健康和心情
</a>
</li>
</ul>
</li>
@ -260,12 +255,8 @@
<li class="rc-list__item rc-md-down">
<a href="/productdetails/productlist/" class="rc-list__header" title="Nutrition" role="menuitem">官方商城</a>
</li>
<li class="rc-list__item">
<a href="/productdetails/productlist/?stype=0" class="rc-list__link ca" role="menuitem">猫系列</a>
</li>
<li class="rc-list__item">
<a href="/productdetails/productlist/?stype=1" class="rc-list__link ca" role="menuitem">狗系列</a>
</li>
<li class="rc-list__item"><a href="/productdetails/productlist/?stype=0" class="rc-list__link ca" role="menuitem">猫系列</a></li>
<li class="rc-list__item"><a href="/productdetails/productlist/?stype=1" class="rc-list__link ca" role="menuitem">狗系列</a></li>
</ul>
</li>
@ -312,21 +303,32 @@
</a>
</li>
<li class="rc-list__item">
<a class="rc-list__link rc-icon rc-email--xs rc-iconography--xs" role="menuitem" href="https://royalcanin.com.cn/about/contact">
与我们联系
</a>
<a class="rc-list__link rc-icon rc-email--xs rc-iconography--xs" role="menuitem" href="https://royalcanin.com.cn/about/contact">与我们联系</a>
</li>
<li class="rc-list__item">
<a class="rc-list__link rc-icon rc-language--xs ts-weibo--xs" role="menuitem" target='_blank' href="https://weibo.com/chinaroyalcanin?topnav=1&wvr=6&topsug=1&is_all=1">
<a
class="rc-list__link rc-icon rc-language--xs ts-weibo--xs"
role="menuitem"
target="_blank"
href="https://weibo.com/chinaroyalcanin?topnav=1&wvr=6&topsug=1&is_all=1"
>
微博
</a>
</li>
<li class="rc-list__item">
<a onclick='bindTracking(this)' evt-name='页内弹窗' evt-cat='mobNavBtnClick' evt-val='微信扫一扫' class="rc-list__link rc-icon ts-wechat--xs rc-iconography--xs" role="menuitem" href="#">
<a
onclick="bindTracking(this)"
evt-name="页内弹窗"
evt-cat="mobNavBtnClick"
evt-val="微信扫一扫"
class="rc-list__link rc-icon ts-wechat--xs rc-iconography--xs"
role="menuitem"
href="#"
>
微信公众号
<div class="ts-hover-show">
<span class="rc-text--center">微信长按识别</span>
<img src="../assets/showimage/royalcanincn-qrcode.jpg">
<img src="../assets/showimage/royalcanincn-qrcode.jpg" />
</div>
</a>
</li>
@ -339,90 +341,112 @@
-->
</ul>
</div>
</div>
</nav>
</section>
</div>
<!-- Popup menu end-->
</div>
</div>
</template>
<script>
import { mapMutations } from "vuex";
import { mapMutations, mapState } from 'vuex';
export default {
data() {
return {
headerScroll:false,
loginornot:false,//
usermessage:null,//
headerScroll: false,
loginornot: false, //
usermessage: null, //
};
},
created(){
computed: {
...mapState({
loginState: state => state.login.loginState,
userInfo: state => state.user.userInfo
})
},
created() {},
watch: {
userInfo(newVal) {
/* 判断是否登录 */
if (newVal && this.loginState) {
this.loginornot = false;
window._hmt.push(['_setUserId', newVal.mobile]);
} else {
this.loginornot = true;
this.usermessage = newVal;
}
}
},
mounted() {
this.checkIsLogin();
let usernot=this.$store.state.userInfo;
//console.log(usernot);
if(usernot){
window._hmt.push(['_setUserId', usernot.data.mobile]);
this.loginornot=false
}else{
this.loginornot=true
this.usermessage=usernot;
/* 判断是否登录 */
this.$store.dispatch('checkLoginState', this);
if (this.userInfo && this.loginState) {
this.loginornot = false;
window._hmt.push(['_setUserId', this.userInfo.mobile]);
} else {
this.loginornot = true;
this.usermessage = this.userInfo;
}
if(isInitialized)
location.reload();
if(!isInitialized)
isInitialized=true;
console.log('22222show');
// this.refreshMobileNav();
/* 全局刷新 */
if (isInitialized) location.reload();
if (!isInitialized) isInitialized = true;
return false;
/* 用户信息存储旧版 测试完成可删除 开始 */
// this.checkIsLogin();
// let usernot=this.$store.state.userInfo;
// if(usernot){
// window._hmt.push(['_setUserId', usernot.data.mobile]);
// this.loginornot=false
// }else{
// this.loginornot=true
// this.usermessage=usernot;
// }
/* 用户信息存储旧版 测试完成可删除 结束 */
},
methods: {
...mapMutations(["checkIsLogin"]),
refreshDesktopNav:function(){
RCDL.navigation.currentState=null;
...mapMutations(['checkIsLogin']),
refreshDesktopNav: function() {
RCDL.navigation.currentState = null;
RCDL.navigation.rebuild();
},
refreshMobileNav:function(){
let itemGroupList=document.querySelectorAll("nav[data-toggle-group=mobile] .rc-list--align[role=menu]");
itemGroupList.forEach(function(ele,i){
if(ele.className.indexOf("rc-expand--horizontal")<0 && ele.className.indexOf("rc-btn-offset--top")<0)
{
if(ele.id.indexOf("nav-list")>=0)
ele.classList.add("rc-expand--horizontal");
else if(ele.id.indexOf("nav-footer")>=0)
ele.classList.add("rc-expand--vertical");
refreshMobileNav: function() {
let itemGroupList = document.querySelectorAll('nav[data-toggle-group=mobile] .rc-list--align[role=menu]');
itemGroupList.forEach(function(ele, i) {
if (ele.className.indexOf('rc-expand--horizontal') < 0 && ele.className.indexOf('rc-btn-offset--top') < 0) {
if (ele.id.indexOf('nav-list') >= 0) ele.classList.add('rc-expand--horizontal');
else if (ele.id.indexOf('nav-footer') >= 0) ele.classList.add('rc-expand--vertical');
}
})
});
},
bindTracking: function(){
bindTracking: function() {
//console.log('bindTracking');
},
//
//
searchturn(){
this.$router.push({ name: "usersearch-search",})
searchturn() {
this.$router.push({ name: 'usersearch-search' });
},
//
turnlogin(){
let userInfo = this.$store.state.userInfo;
if(!userInfo){
turnlogin() {
// let userInfo = this.$store.state.userInfo; //
let userInfo = this.userInfo;
if (!userInfo) {
this.$router.push({
name: "userlogin-login",
params:{}
})
}else{
name: 'userlogin-login',
params: {}
});
} else {
this.$router.push({
name: "personal-mypersonal",
})
name: 'personal-mypersonal'
});
}
}
}
},
};
</script>
<style lang="less" scoped>
</style>
<style lang="less" scoped></style>

View File

@ -2,85 +2,98 @@
<div class="rc-login">
<div class="userunlogin" v-show="userunlogin" @click="userlogin">
<div class="user-left">
<img src="../assets/image/rc-people.png" alt="">
<span>
登录/注册
</span>
</div>
<div class="user-right">
<img src="../assets/image/rc-left.png" alt="">
<img src="../assets/image/rc-people.png" alt="" />
<span>登录/注册</span>
</div>
<div class="user-right"><img src="../assets/image/rc-left.png" alt="" /></div>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex';
export default {
data(){
return{
userunlogin:false,
}
},
methods:{
//
userlogin(){
this.$router.push({
path: "/userlogin/login",
query: {
stype: 1,
data() {
return {
userunlogin: false
};
},
methods: {
//
userlogin() {
this.$router.push({
path: '/userlogin/login',
query: {
stype: 1
}
});
},
},
mounted(){
/* 初始化数据 */
initData(){
//
let islogin=JSON.parse(localStorage.getItem("userInfo"));
console.log(islogin);
if(islogin==null){
this.userunlogin=true;
console.log(this.userunlogin);
let islogin = this.userInfo;
// // console.log(islogin);
// if (islogin == null) {
// this.userunlogin = true;
// console.log(this.userunlogin);
// }
if (islogin == null || islogin == undefined) {
this.userunlogin = true;
}else{
this.userunlogin = false;
}
if(islogin==null ||islogin==undefined){
this.userunlogin=true
}
}
}
},
mounted() {
this.initData();
},
computed:{
...mapState({
userInfo : state => state.user.userInfo,
})
},
watch: {
userInfo(newVal){
if(newVal){
this.initData();
}
}
}
};
</script>
<style lang="less" scoped >
.rc-login{
<style lang="less" scoped>
.rc-login {
width: 92%;
margin: 0 auto;
margin-top: 0.70rem;
.userunlogin{
margin-top: 0.7rem;
.userunlogin {
width: 100%;
height: 0.60rem;
height: 0.6rem;
display: flex;
justify-content: space-between;
align-items: center;
.user-left{
.user-left {
display: flex;
align-items: center;
img{
img {
width: 0.16rem;
height: 0.16rem;
display: block;
}
span{
span {
color: #444444;
font-size: 0.16rem;
margin-left: 0.06rem;
}
}
.user-right{
img{
.user-right {
img {
width: 0.08rem;
height: 0.16rem;
display: block;
}
}
}
}
</style>

View File

@ -1,6 +1,7 @@
import {
baseUrl
} from './env'
} from './env';
export default async(url = '', data = {}, type = 'GET', method = 'fetch') => {
type = type.toUpperCase()
@ -19,15 +20,17 @@ export default async(url = '', data = {}, type = 'GET', method = 'fetch') => {
}
}
if (fetch && method === 'fetch') {
let token='';
if(process.client) {
let tokenStr = localStorage.getItem("userInfo");
if(tokenStr){
tokenStr = JSON.parse(tokenStr);
if(tokenStr && tokenStr.xaccessToken)
token=tokenStr.xaccessToken;
}
token = localStorage.getItem("token");
// let tokenStr = localStorage.getItem("userInfo");
// if(tokenStr){
// tokenStr = JSON.parse(tokenStr);
// if(tokenStr && tokenStr.xaccessToken)
// token=tokenStr.xaccessToken;
// }
}
let requestConfig = {
method: type,

View File

@ -57,7 +57,7 @@ export default {
'@/plugins/swiper',
'@/plugins/ElementUI',
{ src: '@/plugins/localStorage', ssr: false },
'@/plugins/until/common',
],
@ -73,7 +73,7 @@ export default {
modules: [
'@nuxtjs/axios',
['nuxt-tailvue', {toast: true}],
'cookie-universal-nuxt',
],
styleResources: {

View File

@ -17,6 +17,7 @@
"dependencies": {
"@nuxtjs/axios": "^5.13.6",
"amfe-flexible": "^2.2.1",
"cookie-universal-nuxt": "^2.1.5",
"core-js": "^3.15.1",
"element-ui": "^2.15.6",
"ip": "^1.1.5",

View File

@ -1043,7 +1043,7 @@ import Myheader from "~/components/header.vue";
import FixRight from "~/components/fixed-right.vue";
import Myfooter from "~/components/rc-footer.vue";
import unlogin from "~/components/unlogin.vue";
import { mapMutations } from "vuex";
import { mapMutations,mapState } from "vuex";
import envData from "~/config/env-data.js";
import {
userquery,
@ -1354,11 +1354,22 @@ export default {
FixRight,
// userswiper
},
created() {
computed: {
...mapState({
loginState : state => state.login.loginState,
userInfo : state => state.user.userInfo,
})
},
async created() {
vm = this;
let curEnv = process.env.NODE_ENV;
this.catlistvideo = envData[curEnv].catlistvideo;
this.doglistvideo = envData[curEnv].doglistvideo;
/* 判断是否登录 */
await this.$store.dispatch('checkLoginState',this);
if(this.loginState && !this.userInfo){
this.$store.dispatch('getUserInfo',this);
}
},
watch: {},
mounted() {

View File

@ -8,9 +8,7 @@
<div class="cart-list">
<div class="header">
<div class="list-left">
<label class="check-label" style="visibility: hidden;">
<input type="checkbox" v-model="checkAll" />
</label>
<label class="check-label" style="visibility: hidden;"><input type="checkbox" v-model="checkAll" /></label>
<span class="name">商品</span>
</div>
<ul>
@ -23,28 +21,23 @@
<el-row>
<el-col :span="12">
<div class="list-left" style="visibility: hidden;">
<label class="check-label">
<input type="checkbox" v-model="checkAll" />
</label>
<label class="check-label"><input type="checkbox" v-model="checkAll" /></label>
<span class="name">全选</span>
</div>
</el-col>
<el-col :span="12" class="tr">
<span @click="editList()"
><i class="el-icon-edit"></i>{{ editState }}</span
></el-col
>
<span @click="editList()">
<i class="el-icon-edit"></i>
{{ editState }}
</span>
</el-col>
</el-row>
</div>
<div class="list" v-for="(item, index) in cartData" :key="index">
<div class="list-left">
<label class="check-label">
<input type="checkbox" v-model="item.checked" />
</label>
<label class="check-label"><input type="checkbox" v-model="item.checked" /></label>
<div class="product">
<div class="product-img">
<img :src="item.productImg" alt="" />
</div>
<div class="product-img"><img :src="item.productImg" alt="" /></div>
<div class="right">
<p class="product-title" v-text="item.productName"></p>
<p class="specifications">规格{{ item.specifications }}</p>
@ -55,17 +48,9 @@
<li class="product-price">{{ item.productPrice }}</li>
<li>
<div class="rc-jia">
<img
src="../../assets/image/userjian.png"
alt=""
@click="sub(item.buyCount, index)"
/>
<img src="../../assets/image/userjian.png" alt="" @click="sub(item.buyCount, index)" />
<input type="text" v-model="item.buyCount" />
<img
src="../../assets/image/userjia.png"
alt=""
@click="plus(item.buyCount, index)"
/>
<img src="../../assets/image/userjia.png" alt="" @click="plus(item.buyCount, index)" />
</div>
</li>
<li class="del"><em @click="userdele(item)">删除</em></li>
@ -111,22 +96,22 @@
</template>
<script>
import Myheader from "~/components/header.vue";
import MyFooter from '~/components/rc-footer.vue'
import tabs from "@/components/tabs.vue";
import { mapMutations } from "vuex";
import { isexistCart, generateOrderWX, deleteCart } from "../../ajax/getData";
import Myheader from '~/components/header.vue';
import MyFooter from '~/components/rc-footer.vue';
import tabs from '@/components/tabs.vue';
import { mapMutations,mapState } from 'vuex';
import { isexistCart, generateOrderWX, deleteCart } from '../../ajax/getData';
export default {
middleware: "metaTitle",
meta: { title: "购物车" },
middleware: 'metaTitle',
meta: { title: '购物车' },
data() {
return {
crumbs:[
crumbs: [
{
path:'/productdetails/productlist/',
path: '/productdetails/productlist/'
},
{
path:'/myorder/userrecord/'
path: '/myorder/userrecord/'
}
],
ordersum: 1,
@ -136,12 +121,12 @@ export default {
checkone: false,
ys1: true,
ys2: true,
userdelete: "结算",
orderprice: "¥199.00",
mustpay: "立即结算",
editState: "编辑",
userdelete: '结算',
orderprice: '¥199.00',
mustpay: '立即结算',
editState: '编辑',
dellist: [],
totalMoney: "",
totalMoney: '',
allChecked: false,
userid: null,
cartData: [
@ -178,14 +163,23 @@ export default {
// specifications: "5KG",
// checked: true,
// },
],
]
};
},
mounted() {
if(this.userInfo && this.loginState){
this.carmessage();
this.checkIsLogin();
},
// this.checkIsLogin();
}
},
watch: {
userInfo(newVal){
if(newVal && this.loginState){
this.carmessage();
}
}
},
components: {
Myheader,
tabs,
@ -193,53 +187,55 @@ export default {
},
methods: {
//
...mapMutations(["checkIsLogin"]),
...mapMutations(['checkIsLogin']),
async carmessage() {
let user = this.$store.state.userInfo;
this.userid = user.data.id;
let data = await isexistCart(user.data.id);
let user = this.userInfo;
console.log(user);
this.userid = user.id;
let data = await isexistCart(user.id);
console.log(data,'datadata');
this.cartData = data;
// this.goldmedal = data;
},
async userjie(list) {
let user = this.$store.state.userInfo;
this.userid = user.data.id;
let user = this.userInfo;
this.userid = user.id;
let data = await generateOrderWX(list);
if (data) {
this.$message({
type: "warning",
message: data.msg,
type: 'warning',
message: data.msg
});
this.$router.push({
path: "/personal/settlement",
path: '/personal/settlement',
query: {
wxdata: data.data,
},
wxdata: data.data
}
});
}
},
//
async deletsmessage(productCode) {
let user = this.$store.state.userInfo;
this.userid = user.data.id;
let data = await deleteCart( productCode);
let user = this.userInfo;
this.userid = user.id;
let data = await deleteCart(productCode);
if (data) {
this.$message({
type: "warning",
message: data.msg,
type: 'warning',
message: data.msg
});
this.carmessage();
}
},
editList() {
if (this.editState == "完成") {
this.mustpay = "立即结算";
this.editState = " 编辑";
if (this.editState == '完成') {
this.mustpay = '立即结算';
this.editState = ' 编辑';
} else {
this.mustpay = "删除";
this.editState = "完成";
this.mustpay = '删除';
this.editState = '完成';
}
},
// checkBox(){
@ -258,15 +254,15 @@ export default {
} else {
delform = [item.productCode];
}
this.$confirm("确定删除", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "success",
callback: (action) => {
if (action === "confirm") {
this.$confirm('确定删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
callback: action => {
if (action === 'confirm') {
this.deletsmessage(delform);
}
},
}
});
// this.$message({
// type: "warning",
@ -275,24 +271,22 @@ export default {
},
plus(num, index) {
let leftAllotment = this.cartData[index].leftAllotment;
if(this.cartData[index].buyCount >= leftAllotment) {
if (this.cartData[index].buyCount >= leftAllotment) {
this.$message({
type: "error",
message: "已达到本品最大购买上限",
type: 'error',
message: '已达到本品最大购买上限'
});
return;
}
this.cartData[index].buyCount =
parseInt(this.cartData[index].buyCount) + 1;
this.cartData[index].buyCount = parseInt(this.cartData[index].buyCount) + 1;
},
//
sub(num, index) {
if (parseInt(num) <= 1) {
this.cartData[index].buyCount = 1;
} else {
this.cartData[index].buyCount =
parseInt(this.cartData[index].buyCount) - 1;
this.cartData[index].buyCount = parseInt(this.cartData[index].buyCount) - 1;
}
},
@ -302,17 +296,17 @@ export default {
this.ys1 = !this.ys1;
if (this.ys1 == false) {
this.$nextTick(() => {
this.userdelete = "删除";
this.userdelete = '删除';
});
} else if (this.ys1 == true) {
this.$nextTick(() => {
this.userdelete = "结算";
this.userdelete = '结算';
console.log(this.userdelete);
});
}
if (this.userdelete == "删除") {
if (this.userdelete == '删除') {
}
},
usejiesuan() {
@ -342,27 +336,26 @@ export default {
// });
// });
let list = [];
list = this.cartData.filter((item) => item.checked);
list = this.cartData.filter(item => item.checked);
if (list.length == 0) {
this.$message({
type: "warning",
message: "你还未选择商品",
type: 'warning',
message: '你还未选择商品'
});
return;
} else {
if (this.editState == "完成") {
if (this.editState == '完成') {
let delList = [];
list.forEach((item) => {
list.forEach(item => {
delList.push(item.productCode);
});
this.userdele(delList);
} else {
this.$router.push({
path: "/personal/settlement",
path: '/personal/settlement',
query: {
list: JSON.stringify(list),
},
list: JSON.stringify(list)
}
// params: { test:'222'},
});
}
@ -392,7 +385,7 @@ export default {
// .then((res) => {
// console.log(res);
// });
},
}
// async userdelete(item) {
@ -404,22 +397,19 @@ export default {
checkAll: {
// ,
set(v) {
this.cartData.forEach((item) => {
this.cartData.forEach(item => {
item.checked = v;
});
},
// ,
get() {
return (
this.cartData.length ===
this.cartData.filter((item) => item.checked == true).length
);
},
return this.cartData.length === this.cartData.filter(item => item.checked == true).length;
}
},
//
sumPrice() {
return this.cartData
.filter((item) => item.checked)
.filter(item => item.checked)
.reduce((pre, cur) => {
console.log(pre);
return pre + cur.buyCount * cur.productPrice;
@ -427,9 +417,13 @@ export default {
},
sumlength() {
return this.cartData.filter((item) => item.checked == true).length;
},
return this.cartData.filter(item => item.checked == true).length;
},
...mapState({
userInfo : state => state.user.userInfo,
loginState : state => state.login.loginState,
})
}
};
</script>
@ -440,7 +434,7 @@ export default {
.rc-footera {
background: #f6f6f6;
border: 1px solid #d7d7d7;
margin-bottom:40px;
margin-bottom: 40px;
.rc-foote {
margin: 0 auto;
box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1);
@ -562,8 +556,10 @@ export default {
justify-content: space-between;
border-bottom: 1px solid #d7d7d7;
padding: 15px 0;
.del{
em{ font-style: normal;}
.del {
em {
font-style: normal;
}
}
.product-price {
color: #e1001a;
@ -572,11 +568,11 @@ export default {
width: 60px;
}
.del{
em{
.del {
em {
color: #e1001a;
border-bottom: 1px solid #e1001a;
cursor:pointer ;
cursor: pointer;
}
}
.product {
@ -782,7 +778,7 @@ export default {
.product {
margin-left: 16px;
}
.list-left{
.list-left {
width: 100%;
}
ul {
@ -793,10 +789,10 @@ export default {
display: none;
}
}
.product-title{
.product-title {
width: 225px;
text-overflow: ellipsis;
white-space:nowrap;
white-space: nowrap;
overflow: hidden;
}
}
@ -807,7 +803,7 @@ export default {
bottom: 0;
width: 100%;
z-index: 10;
margin-bottom:0;
margin-bottom: 0;
.rc-shop {
display: none;
}

View File

@ -3,26 +3,15 @@
<Myheader></Myheader>
<div class="rc-top"></div>
<div class="rc-main" v-for="(item, index) in goldmedal" :key="item.id">
<div class="online bold">
</div>
<div class="online bold"></div>
<div class="rc-receiving useruantity">
<em>{{
item.status == "0"
? "待付款"
: item.status == "1"
? "待收货"
: item.status == "2"
? "已完成"
: item.status == "3"
? "已取消"
: "异常订单"
}}</em>
<em>{{ item.status == '0' ? '待付款' : item.status == '1' ? '待收货' : item.status == '2' ? '已完成' : item.status == '3' ? '已取消' : '异常订单' }}</em>
<span>{{ orderstatus }}</span>
</div>
<div class="online bold"></div>
<div class="delivery useruantity" v-if="isshow">
<div class="to-delivery">
<img src="../../static/images/delivery.png" alt="">
<img src="../../static/images/delivery.png" alt="" />
<span>{{ trackingstates }}</span>
<!-- <i>2021-1-21</i> -->
</div>
@ -35,32 +24,21 @@
<img :src="leftico" alt="" />
</div>
</div>
<div class="online bold" v-if="isshow">
</div>
<div class="online bold" v-if="isshow"></div>
<div class="mypersonal useruantity">
<div class="my-delivery">
<span>{{ item.addressUserName }}</span>
<i>{{ item.addressPhoneNumber }}</i>
</div>
<div class="per-delivery">
<span
>{{ item.addressProvinceName }}{{ item.addressCityName
}}{{ item.addressCountyName }}</span
>
<span>{{ item.addressProvinceName }}{{ item.addressCityName }}{{ item.addressCountyName }}</span>
</div>
</div>
<div class="online bold"></div>
<div>
<div class="rc-center">
<div
class="rc-usermain useruantity"
v-for="(userlist, index) in item.orderDetailList"
:key="index"
>
<div class="rc-image">
<img :src="userlist.picFile" alt="" />
</div>
<div class="rc-usermain useruantity" v-for="(userlist, index) in item.orderDetailList" :key="index">
<div class="rc-image"><img :src="userlist.picFile" alt="" /></div>
<div class="rc-right">
<div class="rc-usercenter">
<em>{{ userlist.productName }}</em>
@ -71,7 +49,6 @@
<div class="rc-userbottom">
<span>数量:{{ userlist.pcs }}</span>
<i>{{ userlist.ecPrice }}</i>
</div>
<!-- <div class="rc-userbottomm">
<i>{{ item.userprice }}</i>
@ -127,7 +104,7 @@
<li>
<span>快递单号:</span>
<div class="u-trackingnumber">
<i>{{ logisticsNumber }} </i>
<i>{{ logisticsNumber }}</i>
<!-- <img :src="information.catimage" alt=""> -->
</div>
</li>
@ -142,7 +119,7 @@
</div>
<div class="rc-md-up ts-button-container rc-padding-y--md">
<span class="ts-standard-btn ts-standard-btn--two" @click="userpay(item)">{{ customer }}</span>
<span class="ts-standard-btn" @click="onceagain(item)"> {{ payorsucess }}</span>
<span class="ts-standard-btn" @click="onceagain(item)">{{ payorsucess }}</span>
</div>
</div>
</div>
@ -151,22 +128,15 @@
</div>
<div class="rc-full-width rc-md-down ts-button-container rc-padding-y--md rc-margin-top--md">
<span class="ts-standard-btn ts-standard-btn--two" @click="userpay(item)">{{ customer }}</span>
<i
class="ts-standard-btn"
@click="onceagain()"
>
{{ payorsucess }}
</i>
<i class="ts-standard-btn" @click="onceagain()">{{ payorsucess }}</i>
</div>
<el-dialog :visible.sync="showPaytypeWarning" :close-on-click-modal="false">
<div class="ts-warning-popup">
<div class="title rc-full-width">
<img src="../../assets/error.png" alt="" />
</div>
<div class="title rc-full-width"><img src="../../assets/error.png" alt="" /></div>
<div class="content rc-full-width rc-text--center rc-margin-y--md">
<h3>温馨提示</h3>
<span class="">{{ paytypeWarning.message}}</span>
<span class="">{{ paytypeWarning.message }}</span>
</div>
</div>
</el-dialog>
@ -175,66 +145,61 @@
</template>
<script>
import Myheader from "~/components/header.vue";
import { mapMutations } from "vuex";
import MyFooter from "~/components/rc-footer.vue";
import Vue from "vue";
import Myheader from '~/components/header.vue';
import { mapMutations, mapState } from 'vuex';
import MyFooter from '~/components/rc-footer.vue';
import Vue from 'vue';
let vm = new Vue();
import formatConversion from "../../static/js/date";
import {
userin,
selectaddress,
canceldanhao,
generateOrderWX,
repayOrde
} from "../../ajax/getData";
import formatConversion from '../../static/js/date';
import { userin, selectaddress, canceldanhao, generateOrderWX, repayOrde } from '../../ajax/getData';
import util from "@/ajax/util";
import util from '@/ajax/util';
export default {
data() {
return {
util,
paytypeWarning:{result:true,message:''},
showPaytypeWarning:false,
paytypeWarning: { result: true, message: '' },
showPaytypeWarning: false,
goldmedal: [],
userproductId: "",
logisticsDate: "",
addressPhoneNumber: "",
userphone: "",
logisticsNumber: "",
customer: "", //
payorsucess: "", //
addressUserName: "",
logisticsCompany: "", //
orderstatus: "",
goldastates: "",
userproductId: '',
logisticsDate: '',
addressPhoneNumber: '',
userisdelivery: "待收货",
userdelivery: "派送中",
logisticsNumber: '',
customer: '', //
payorsucess: '', //
addressUserName: '',
logisticsCompany: '', //
orderstatus: '',
goldastates: '',
userisdelivery: '待收货',
userdelivery: '派送中',
isshow: true,
usersalesAmount: "",
leftico: require("../../assets/image/rc-left.png"),
orderNumber: "",
userdata: "",
usermessage: null,
userid: null,
trackingstates: "", //
usersalesAmount: '',
leftico: require('../../assets/image/rc-left.png'),
orderNumber: '',
// userdata: '',
// usermessage: null,
// userid: null,
// userphone: '',
trackingstates: '', //
useralllist: [],
delivery: [],
useraddress: [],
shopprice: {},
information: {
paytypeText: "",
distribution: "快递",
catimage: require("../../assets/image/rc-left.png"),
},
paytypeText: '',
distribution: '快递',
catimage: require('../../assets/image/rc-left.png')
}
};
},
methods: {
...mapMutations(["checkIsLogin"]),
refreshDesktopNav: function () {
...mapMutations(['checkIsLogin']),
refreshDesktopNav: function() {
RCDL.navigation.currentState = null;
RCDL.navigation.rebuild();
},
@ -243,33 +208,33 @@ export default {
let data = await canceldanhao(this.userphone, this.orderNumber);
if (data) {
this.$message({
type: "warning",
message: "取消订单成功",
type: 'warning',
message: '取消订单成功'
});
setTimeout(() => {
this.$router.push({
path: "/personal/useraddress",
path: '/personal/useraddress',
query: {
stype: 1,
},
stype: 1
}
});
}, 500);
}
},
userpay() {
if (this.goldastates == 0) {
if(confirm('确认要取消该订单嘛?')) {
if (confirm('确认要取消该订单嘛?')) {
this.canceldanhao();
}
} else if ((this.customer = "联系客服申请售后")) {
} else if ((this.customer = '联系客服申请售后')) {
var option = {
customer: {
id: "",
name: "",
email: "",
mobile: "",
memberId: this.userdata.data.id,
},
id: '',
name: '',
email: '',
mobile: '',
memberId: this.userdata.id
}
};
dis_livchat(option);
}
@ -278,23 +243,23 @@ export default {
onceagain(item) {
this.paytypeWarning = this.util.checkPaytypeValidated(this.paytype);
this.showPaytypeWarning = !this.paytypeWarning.result;
if(this.paytypeWarning.result) {
if (this.payorsucess == "立即支付") {
if (this.paytypeWarning.result) {
if (this.payorsucess == '立即支付') {
this.getwei(item);
} else {
_hmt.push([
"_trackCustomEvent",
"order_repay",
'_trackCustomEvent',
'order_repay',
{
"status":"fail",
status: 'fail'
}
])
]);
this.$router.push({
path: "/productdetails/producted",
path: '/productdetails/producted',
query: {
stype: 1,
productCode: this.userproductId,
},
productCode: this.userproductId
}
});
}
}
@ -306,19 +271,16 @@ export default {
for (let i = 0; i < this.goldmedal.length; i++) {
this.goldastates = this.goldmedal[i].status;
this.userproductId = this.goldmedal[i].orderDetailList[0].productId;
this.logisticsNumber =
this.goldmedal[i].orderDetailList[0].logisticsNumber; //
this.logisticsNumber = this.goldmedal[i].orderDetailList[0].logisticsNumber; //
this.trackingstates = this.goldmedal[i].orderDetailList[0].status; //
if (this.trackingstates == 0) {
this.trackingstates = "运输中";
this.trackingstates = '运输中';
} else if (this.trackingstates == 1) {
this.trackingstates = "已签收";
this.trackingstates = '已签收';
} else if (this.trackingstates == 2) {
this.trackingstates = "未发货";
this.trackingstates = '未发货';
}
this.logisticsDate = this.formatConversion(
this.goldmedal[i].orderDate
); //
this.logisticsDate = this.formatConversion(this.goldmedal[i].orderDate); //
this.logisticsCompany = this.goldmedal[i].orderDetailList[0].logisticsCompany; //
this.orderNumber = this.goldmedal[i].orderNumber;
this.usersalesAmount = this.goldmedal[i].salesAmount;
@ -334,41 +296,41 @@ export default {
async getwei(user) {
let data = await this.repayOrde(this.orderNumber);
let loginedUser = this.$store.state.userInfo;
if(data.code==1) {
if (data.code == 1) {
let userPayData = {
userprice: this.usersalesAmount,
orderId: this.orderNumber,
userinformation: this.addressUserName + " " + this.addressPhoneNumber,
wxPay:data.msg
userinformation: this.addressUserName + ' ' + this.addressPhoneNumber,
wxPay: data.msg
};
_hmt.push([
"_trackCustomEvent",
"order_repay",
'_trackCustomEvent',
'order_repay',
{
"status":"success",
"member_id": loginedUser.data.id
status: 'success',
member_id: loginedUser.data.id
}
])
]);
this.$router.push({
path: "/personal/userpay",
path: '/personal/userpay',
query: {
userData: this.orderNumber,
stype: 1,
userPayData: JSON.stringify(userPayData),
},
userPayData: JSON.stringify(userPayData)
}
});
} else {
_hmt.push([
"_trackCustomEvent",
"order_repay",
'_trackCustomEvent',
'order_repay',
{
"status":"fail - " + this.orderNumber,
"member_id": loginedUser.data.id
status: 'fail - ' + this.orderNumber,
member_id: loginedUser.data.id
}
])
]);
this.$message({
type: "error",
message: "订单数据错误,请联系客服进行处理",
type: 'error',
message: '订单数据错误,请联系客服进行处理'
});
}
},
@ -394,51 +356,74 @@ export default {
// console.log(this.list);
},
updateButtonByOrderStatus(status){
updateButtonByOrderStatus(status) {
if (status == 2) {
this.orderstatus = "您的订单已完成";
this.orderstatus = '您的订单已完成';
this.isshow = false;
this.userisdelivery = "待发货";
this.customer = "联系客服申请售后";
this.payorsucess = "再次购买";
this.userisdelivery = '待发货';
this.customer = '联系客服申请售后';
this.payorsucess = '再次购买';
} else if (status == 0) {
this.orderstatus = "您的订单还未付款,请尽快付款!";
this.orderstatus = '您的订单还未付款,请尽快付款!';
this.isshow = false;
this.userisdelivery = "待付款";
this.customer = "取消订单";
this.payorsucess = "立即支付";
this.userisdelivery = '待付款';
this.customer = '取消订单';
this.payorsucess = '立即支付';
} else if (status == 1) {
this.orderstatus = "您的订单已发出,请耐心等候。";
this.orderstatus = '您的订单已发出,请耐心等候。';
this.isshow = true;
this.userisdelivery = "待收货";
this.customer = "联系客服申请售后";
this.payorsucess = "再次购买";
this.userisdelivery = '待收货';
this.customer = '联系客服申请售后';
this.payorsucess = '再次购买';
} else if (status == 3) {
this.orderstatus = "您的订单已取消!";
this.orderstatus = '您的订单已取消!';
this.isshow = false;
this.userisdelivery = "已取消";
this.customer = "联系客服申请售后";
this.payorsucess = "再次购买";
this.userisdelivery = '已取消';
this.customer = '联系客服申请售后';
this.payorsucess = '再次购买';
}
},
resetData(){
if(this.userdata && this.loginState){
this.editaddress(this.userid);
this.orderNumber = this.$route.query.orderNumber;
this.orderquantity(this.orderNumber);
}
}
},
mounted() {
this.checkIsLogin();
this.userdata = this.$store.state.userInfo;
this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
this.userid = this.usermessage.data.id;
this.userphone = this.usermessage.data.mobile;
this.editaddress(this.userid);
this.orderNumber = this.$route.query.orderNumber;
this.orderquantity(this.orderNumber);
this.resetData();
return false;
// this.checkIsLogin();
// this.userdata = this.$store.state.userInfo;
// this.usermessage = JSON.parse(localStorage.getItem('userInfo'));
// this.userid = this.usermessage.data.id;
// this.userphone = this.usermessage.data.mobile;
// this.editaddress(this.userid);
// this.orderNumber = this.$route.query.orderNumber;
// this.orderquantity(this.orderNumber);
},
components: {
Myheader,
MyFooter,
MyFooter
},
computed : {
...mapState({
userdata : state => state.user.userInfo,
usermessage : state => state.user.userInfo,
userid : state => state.user.userInfo.id,
userphone : state => state.user.userInfo.mobile,
loginState : state => state.login.loginState,
})
},
watch : {
userdata(){
this.resetData();
}
}
};
</script>
<style lang="less" scoped>
@import url("../../assets/css/usertion.less");
@import url('../../assets/css/usertion.less');
</style>

View File

@ -1,19 +1,12 @@
<template>
<div class="allmain">
<Myheader></Myheader>
<!-- <tabs></tabs> -->
<div class="rc-top"></div>
<tabs :crumbs="crumbs"></tabs>
<div class="rc-usermain">
<div class="rc rc-column">
<span
v-for="(item, index) in discountlist"
:key="index"
@click="selectGoods(item, index)"
:class="activeIndex == index ? 'active' : 'unactive'"
>
<span v-for="(item, index) in discountlist" :key="index" @click="selectGoods(item, index)" :class="activeIndex == index ? 'active' : 'unactive'">
{{ item.title }}
</span>
<!-- <span @click="tanchu()">弹出</span> -->
@ -21,45 +14,27 @@
<div class="online bold"></div>
<div class="rs-dis">
<div class="ts-no-data" v-if="!newlist.length">
暂未发现相关记录
</div>
<div
class="rc-discount"
v-for="(item, index) in newlist"
:key="index"
>
<div class="ts-no-data" v-if="!newlist.length">暂未发现相关记录</div>
<div class="rc-discount" v-for="(item, index) in newlist" :key="index">
<img :src="userimage" alt="" />
<div class="rc-contair">
<div class="rc-left" ref="userleft" id="userleft" :style='usercolor'>
<div class="rc-left" ref="userleft" id="userleft" :style="usercolor">
<div>
<i v-if="(item.couponTypeId!='4' && item.couponAmount>0)">
</i>
<span>
{{ item.couponAmount?item.couponAmount:(parseInt(10 - item.discount*10)+'折') }}
</span>
<i v-if="item.couponTypeId != '4' && item.couponAmount > 0"></i>
<span>{{ item.couponAmount ? item.couponAmount : parseInt(10 - item.discount * 10) + '折' }}</span>
</div>
<strong>{{ item.couponName }}</strong>
</div>
<div class="rc-right">
<i :style='usercolor'>
{{ item.couponDesc }}
</i>
<div class="rc-userfont" :style="(item.validTo?'visibility:visible':'visibility:hidden')">
<i :style="usercolor">{{ item.couponDesc }}</i>
<div class="rc-userfont" :style="item.validTo ? 'visibility:visible' : 'visibility:hidden'">
<strong>有效期</strong>
<span>{{item.validFrom}}</span>
<span>{{ item.validFrom }}</span>
<span></span>
<em>{{item.validTo}}</em>
<em>{{ item.validTo }}</em>
</div>
<nuxt-link :to="`/productdetails/productlist`" v-if="item.canUse">
<div class="ts-standard-btn">
立即使用
<nuxt-link :to="`/productdetails/productlist`" v-if="item.canUse"><div class="ts-standard-btn">立即使用</div></nuxt-link>
</div>
</nuxt-link>
</div>
</div>
</div>
</div>
@ -67,100 +42,97 @@
</div>
</template>
<script>
import {allConfig,getdraw} from "../../ajax/getData";
import tabs from "@/components/tabs.vue";
import { mapMutations } from "vuex";
import { allConfig, getdraw } from '../../ajax/getData';
import tabs from '@/components/tabs.vue';
import { mapMutations, mapState } from 'vuex';
const EXPIRED = 2;
const UNUSE = 0;
const USED = 1;
export default {
async asyncData (context) {
},
async asyncData(context) {},
data() {
return {
crumbs:[
crumbs: [
{
path:'/personal/mypersonal/',
path: '/personal/mypersonal/'
},
{
path:'/personal/discount/',
path: '/personal/discount/'
}
],
userload: true,
pastdue: false,
unused: false,
usercolor:{color:'#e1001a'},
usermessage:[],
userstates:0,
userimage: require("../../assets/image/unused.png"),
fullCouponList:[],
usercolor: { color: '#e1001a' },
usermessage: [],
userstates: 0,
userimage: require('../../assets/image/unused.png'),
fullCouponList: [],
newlist: [],
discountlist: [
{
title: "未使用",
title: '未使用'
},
{
title: "已使用",
title: '已使用'
},
{
title: "已过期",
},
title: '已过期'
}
],
preferential: [
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
price: '30',
pricestype: '新客优惠券',
special: '全场每满299-30',
period: '有效期',
starttime: '2021.11.29-2022.01.28'
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
price: '30',
pricestype: '新客优惠券',
special: '全场每满299-30',
period: '有效期',
starttime: '2021.11.29-2022.01.28'
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
price: '30',
pricestype: '新客优惠券',
special: '全场每满299-30',
period: '有效期',
starttime: '2021.11.29-2022.01.28'
}
],
userdiscount:[],
activeIndex: 0,
userdiscount: [],
activeIndex: 0
};
},
methods: {
...mapMutations(["changemessage","checkIsLogin"]),
...mapMutations(['changemessage', 'checkIsLogin']),
//
async userdraw(mobile) {
//let curDate = new Date();
let paramsToAPI = {
mobile : mobile,
mobile: mobile
//useStartDate : curDate.getYear()+'-'+curDate.getMonth()+'-'+curDate.getDate(),
//productCodes : ''
};
let data = await getdraw(paramsToAPI);
let _self = this;
if(data){
if (data) {
let list = [];
data.data.forEach(function(element,index){
element.validFrom = element.validFrom.slice(0,10);
element.validTo = element.validTo.slice(0,10);
if(element.udf2 && element.udf2 == 'H5') {
data.data.forEach(function(element, index) {
element.validFrom = element.validFrom.slice(0, 10);
element.validTo = element.validTo.slice(0, 10);
if (element.udf2 && element.udf2 == 'H5') {
list.push(element);
}
});
this.fullCouponList = list;
this.selectGoods('',UNUSE);
this.selectGoods('', UNUSE);
}
},
selectGoods(item, index) {
@ -168,53 +140,53 @@ export default {
if (this.activeIndex == USED) {
this.userload = false;
this.pastdue = true;
this.userimage = require("../../assets/image/hasused.png");
this.userstates=1
this.usercolor={color:'white'}
this.userimage = require('../../assets/image/hasused.png');
this.userstates = 1;
this.usercolor = { color: 'white' };
//this.userdraw(this.usermessage.data.mobile,1)
}
if (this.activeIndex == UNUSE) {
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");
this.usercolor = { color: '#e1001a' };
this.userstates = 0;
this.userimage = require('../../assets/image/unused.png');
}
if (this.activeIndex == EXPIRED) {
this.userload = false;
this.pastdue = true;
//this.userdraw(this.usermessage.data.mobile,2)
this.userstates=2
this.usercolor={color:'white'}
this.userimage = require("../../assets/image/expired.png");
this.userstates = 2;
this.usercolor = { color: 'white' };
this.userimage = require('../../assets/image/expired.png');
}
this.couponStatusFilter(this.activeIndex);
},
couponStatusFilter(status){
couponStatusFilter(status) {
let curTime = new Date().getTime();
let valDateFromTime;
let valDateToTime;
this.newlist = [];
status = (!status || status>EXPIRED || status<UNUSE)?UNUSE:status;
for(let coupon of this.fullCouponList) {
switch(status) {
status = !status || status > EXPIRED || status < UNUSE ? UNUSE : status;
for (let coupon of this.fullCouponList) {
switch (status) {
case EXPIRED:
if(coupon) {
if(coupon.fValidTo) {
if (coupon) {
if (coupon.fValidTo) {
valDateToTime = new Date(coupon.fValidTo).getTime();
}
if(curTime > valDateToTime && coupon.status==0) {
coupon.canUse=false;
if (curTime > valDateToTime && coupon.status == 0) {
coupon.canUse = false;
this.newlist.push(coupon);
}
}
break;
case UNUSE:
if(coupon.fValidFrom) {
if (coupon.fValidFrom) {
valDateFromTime = new Date(coupon.fValidFrom).getTime();
}
if(coupon.fValidTo) {
if (coupon.fValidTo) {
valDateToTime = new Date(coupon.fValidTo).getTime();
}
/*
@ -223,53 +195,70 @@ export default {
this.newlist.push(coupon);
}
*/
if(valDateToTime && curTime <= valDateToTime && coupon.status == 0) {
coupon.canUse=true;
if (valDateToTime && curTime <= valDateToTime && coupon.status == 0) {
coupon.canUse = true;
this.newlist.push(coupon);
}
break;
case USED:
if(coupon.status == 1) {
coupon.canUse=false;
if (coupon.status == 1) {
coupon.canUse = false;
this.newlist.push(coupon);
}
break;
}
}
},
usertiao(){
this.$router.push({ name: "productdetails-productlist",})
},
usertiao() {
this.$router.push({ name: 'productdetails-productlist' });
}
},
directives: {
'color': {
bind: function(el, binding){
el.style.color = binding.value
color: {
bind: function(el, binding) {
el.style.color = binding.value;
},
inserted: function(el){
inserted: function(el) {}
}
},
},
mounted() {
this.checkIsLogin();
this.usermessage = this.$store.state.userInfo;
if(!this.usermessage){
this.$router.push({ path: "/userlogin/login"})
if (this.loginState) {
this.usermessage = this.userInfo;
this.userInfo && this.userdraw(this.userInfo.mobile);
} else {
this.$router.push({ path: '/userlogin/login' });
}
// this.checkIsLogin();
// this.usermessage = this.$store.state.userInfo;
// if (!this.usermessage) {
//
// }
// this.userdraw(this.usermessage.data.mobile);
},
watch: {
userInfo(newVal) {
if (newVal && this.loginState) {
this.usermessage = newVal;
this.userInfo && this.userdraw(this.usermessage.mobile);
}
}
this.userdraw(this.usermessage.data.mobile);
},
components: {
Myheader,
tabs
},
computed: {
...mapState({
loginState: state => state.login.loginState,
userInfo: state => state.user.userInfo
})
}
};
import Myheader from "~/components/header.vue";
import Myheader from '~/components/header.vue';
</script>
<style lang="less" scoped>
//
@import url("../../assets/css/discount.less");
@import url('../../assets/css/discount.less');
</style>

View File

@ -1,24 +1,19 @@
<template>
<div>
<div>
<Myheader></Myheader>
<div class="rc-top"></div>
<tabs :crumbs="crumbs"></tabs>
<div class="rc-max-width--xl rc-padding-bottom--md">
<ul>
<li v-for="(item,index) in userrecord" :key="index">
{{item.title}}
</li>
<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 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">
@ -32,96 +27,85 @@
</template>
<script>
import Myheader from '~/components/header.vue'
import { memberAccount } from "../../ajax/getData";
import Myheader from '~/components/header.vue';
import { memberAccount,mapState } from '../../ajax/getData';
export default {
data(){
return{
crumbs:[
data() {
return {
crumbs: [
{
path:'/personal/mypersonal',
path: '/personal/mypersonal'
},
{
path:'/personal/integral/',
path: '/personal/integral/'
}
],
userrecord:[
userrecord: [
{
title:'日期',
title: '日期'
},
{
title:'积分',
title: '积分'
},
{
title:'类型',
},
title: '类型'
}
],
usermessage:[
usermessage: [
{
title:'2021-09-11',
rccord:'+100',
buycord:'购物积分'
title: '2021-09-11',
rccord: '+100',
buycord: '购物积分'
},
{
title:'2021-09-11',
rccord:'+100',
buycord:'购物积分'
title: '2021-09-11',
rccord: '+100',
buycord: '购物积分'
},
{
title:'2021-09-11',
rccord:'+100',
buycord:'购物积分'
title: '2021-09-11',
rccord: '+100',
buycord: '购物积分'
},
{
title:'2021-09-11',
rccord:'+100',
buycord:'购物积分'
title: '2021-09-11',
rccord: '+100',
buycord: '购物积分'
},
{
title:'2021-09-11',
rccord:'+100',
buycord:'购物积分'
},
title: '2021-09-11',
rccord: '+100',
buycord: '购物积分'
}
]
}
};
},
methods:{
methods: {
//
async catmessage() {
let user= JSON.parse(localStorage.getItem("userInfo"));
let data = await memberAccount(user.data.id);
if(data){
this.usermessage=data.data;
// let user = JSON.parse(localStorage.getItem('userInfo'));
let data = await memberAccount(this.user.id);
if (data) {
this.usermessage = data.data;
console.log(this.usermessage.data);
}
}
},
},
mounted(){
mounted() {
this.catmessage();
},
components:{
Myheader,
components: {
Myheader
},
}
computed:{
...mapState({
userInfo : state => state.user.userInfo
})
}
};
</script>
<style lang="less" scoped>
@import url("../../assets/css/integral.less");
@import url('../../assets/css/integral.less');
</style>

View File

@ -1,8 +1,8 @@
<template>
<div>
<Myheader></Myheader>
<div>
<Myheader></Myheader>
<!-- <tabs></tabs> -->
<div class="rc-top"></div>
<div class="rc-top"></div>
<tabs :crumbs="crumbs"></tabs>
<div class="rc-layout-container rc-one-column rc-full-width ts-mypersonal">
<div class="rc-column">
@ -11,47 +11,39 @@
<span>{{ userorder }}</span>
</div> -->
<div class="rc-max-width--xl">
<div class="rc-center">
<img :src='userimage' />
</div>
<div class="rc-center"><img :src="userimage" /></div>
</div>
<div class="rc-max-width--xl ts-special-padding">
<div class="rc-login">
<div class="rc-unlogin">
<div class="rc-people" @click="opendialog()">
<img src="../../assets/image/rc-people.png" alt="" />
</div>
<div class="rc-people" @click="opendialog()"><img src="../../assets/image/rc-people.png" alt="" /></div>
<div class="rc-userlogin">
<div v-if="!islogin">
<span>{{usertitle}}</span>
<em>{{userorder}}</em>
<span>{{ usertitle }}</span>
<em>{{ userorder }}</em>
</div>
<nuxt-link :to="`/userlogin/login/`">
<span v-if="islogin">登录/注册</span>
</nuxt-link>
<nuxt-link :to="`/userlogin/login/`"><span v-if="islogin">登录/注册</span></nuxt-link>
</div>
</div>
<div class="rc-islogin">
<nuxt-link :to="`/personal/usermember/`" class="ts-right-arr">
<span>会员权益</span>
</nuxt-link>
<nuxt-link :to="`/personal/usermember/`" class="ts-right-arr"><span>会员权益</span></nuxt-link>
</div>
</div>
</div>
<div class="online bold"></div>
<div class="rc-max-width--xl ts-special-padding">
<div class="usercord">
<em>当前积分:{{ rcrcord }}</em>
<em>当前积分:{{ rcrcord || 0 }}</em>
<span class="ts-right-arr" @click="userinter">积分明细</span>
</div>
<div class="rc-cordd">
<span>距离升级还差:</span> <span class="lackOfPoint">{{ rcvalue }}</span>
<span>距离升级还差:</span>
<span class="lackOfPoint">{{ rcvalue }}</span>
<div class="block">
<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>
@ -66,13 +58,11 @@
<div class="rc-order">
<em>我的订单</em>
<span class="ts-right-arr" @click="findall" >查看全部</span>
<span class="ts-right-arr" @click="findall">查看全部</span>
</div>
<div class="rc-obligation rc-max-width--lg">
<ul>
<li v-for="(item, index) in prefecture" :key="index" @click="obligation(item,index)">
<li v-for="(item, index) in prefecture" :key="index" @click="obligation(item, index)">
<img :src="item.catimage" alt="" />
<span>{{ item.title }}</span>
</li>
@ -86,7 +76,7 @@
<div class="rc-usermain">
<h2>服务工具</h2>
<div class="rc-buymain rc-max-width--lg ts-special-padding">
<div class="rc-buy" v-for="(item, index) in personallist" :key="index" @click="openaddress(item,index)">
<div class="rc-buy" v-for="(item, index) in personallist" :key="index" @click="openaddress(item, index)">
<div class="rc-cord">
<img :src="item.buyimage" alt="" />
<em>{{ item.title }}</em>
@ -100,117 +90,98 @@
</div>
</div>
<div class="online bold"></div>
<div class="ts-btn" v-if="!islogin">
<div class="ts-standard-btn center" @click="logout">退出登录</div>
</div>
<div class="ts-btn" v-if="!islogin"><div class="ts-standard-btn center" @click="logout">退出登录</div></div>
</div>
</div>
<el-dialog
:visible.sync="dialogInfo1"
hegight="700px"
:before-close="handleClose"
@open="open"
>
<el-dialog :visible.sync="dialogInfo1" hegight="700px" :before-close="handleClose" @open="open">
<div class="rc-full-width rc-max-width--xl rc-text--center">
<div class="rc-title rc-text--center rc-margin-bottom--md">
<img src="../../assets/error.png" alt="">
</div>
<div class="rc-title rc-text--center rc-margin-bottom--md"><img src="../../assets/error.png" alt="" /></div>
<div class="rc-logmain">
<h3>温馨提示</h3>
<span>{{usermessage}}</span>
<span>{{ usermessage }}</span>
</div>
<div class="userer">
<img src="/images/qrcode-aichong.jpg" alt="" class="rc-margin-y--xs">
<img src="/images/qrcode-aichong.jpg" alt="" class="rc-margin-y--xs" />
<span>微信扫一扫识别二维码</span>
</div>
</div>
</el-dialog>
<FixRight></FixRight>
<MyFooter></MyFooter>
</div>
</template>
<script>
import Myheader from '~/components/header.vue'
import MyFooter from '~/components/rc-footer.vue'
import FixRight from "~/components/fixed-right.vue";
import tabs from "@/components/tabs.vue";
import { mapMutations } from "vuex";
import Myheader from '~/components/header.vue';
import MyFooter from '~/components/rc-footer.vue';
import FixRight from '~/components/fixed-right.vue';
import tabs from '@/components/tabs.vue';
import { mapMutations, mapState } from 'vuex';
export default {
middleware: 'metaTitle',
// middleware: 'metaTitle',
meta: {title: '个人中心'},
meta: { title: '个人中心' },
data() {
return {
crumbs:[
crumbs: [
{
path:'/personal/mypersonal',
path: '/personal/mypersonal'
}
],
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: "待付款",
ordernum: "2",
catimage: require("../../assets/image/rc-obligation.png"),
title: '待付款',
ordernum: '2',
catimage: require('../../assets/image/rc-obligation.png')
},
{
title: "待发货",
ordernum: "2",
catimage: require("../../assets/image/rc-pending.png"),
title: '待发货',
ordernum: '2',
catimage: require('../../assets/image/rc-pending.png')
},
{
title: "待收货",
ordernum: "2",
catimage: require("../../assets/image/rc-wait.png"),
},
title: '待收货',
ordernum: '2',
catimage: require('../../assets/image/rc-wait.png')
}
],
personallist: [
{
title: "积分商城",
ordernum: "0",
buyimage: require("../../assets/image/rc-integral.png"),
usertitle: "点击进入爱宠荟",
title: '积分商城',
ordernum: '0',
buyimage: require('../../assets/image/rc-integral.png'),
usertitle: '点击进入爱宠荟'
},
{
title: "优惠券",
ordernum: "1",
buyimage: require("../../assets/image/rc-discount.png"),
usertitle: "查看详情",
title: '优惠券',
ordernum: '1',
buyimage: require('../../assets/image/rc-discount.png'),
usertitle: '查看详情'
},
{
title: "收货地址",
ordernum: "2",
buyimage: require("../../assets/image/rc-address.png"),
usertitle: "查看详情",
},
title: '收货地址',
ordernum: '2',
buyimage: require('../../assets/image/rc-address.png'),
usertitle: '查看详情'
}
],
rcrcord: '',
value: [4, 8],
value: [4, 8]
};
},
components: {
Myheader,
@ -218,212 +189,228 @@ export default {
tabs,
FixRight
},
computed: {
...mapState({
userInfo : state => state.user.userInfo,
loginState : state => state.login.loginState,
})
},
watch:{
userInfo(newVal){
// console.log('22222userInfo=',newVal)
// console.log('this.loginState=',this.loginState)
this.islogin = !this.loginState;
if(newVal && this.loginState){
this.loginState && this.setUserInfoData(newVal);
}
}
},
methods: {
...mapMutations(["logoutSystem","checkIsLogin"]),
...mapMutations(['logoutSystem', 'checkIsLogin']),
logout() {
this.$store.dispatch('logout',this);
this.logoutSystem();
this.$router.push({
path: "/",
path: '/'
});
},
userinter(){
let user= this.$store.state.userInfo;
if(!user){
userinter() {
let user = this.$store.state.userInfo;
if (!user) {
this.$message({
type: 'warning',
message: '您还未登录'
});
return
return;
} else {
this.$router.push({
path: "/personal/integral/",
path: '/personal/integral/',
query: {
stype: 1,
},
stype: 1
}
});
}
},
findall(){
let user= this.$store.state.userInfo;
if(user==undefined||user==null||user==''){
findall() {
let user = this.userInfo;
if ( user && this.loginState) {
this.$router.push({
path: '/personal/useraddress/',
query: {
stype: 0
}
});
} else {
this.$message({
type: 'warning',
message: '您还未登录'
});
return
} else {
this.$router.push({
path: "/personal/useraddress/",
query: {
stype: 0,
},
});
return;
}
},
//
obligation(item,index){
let user= this.$store.state.userInfo;
if(user==undefined||user==null||user==''){
obligation(item, index) {
let user = this.userInfo;
// console.log(!user , !this.loginState,'22222');
// return false;
if (!user && !this.loginState) {
this.$message({
type: 'warning',
message: '您还未登录'
});
return
}else{
if(item.title=='待付款'){
return;
} else {
if (item.title == '待付款') {
this.$router.push({
path: "/personal/useraddress",
path: '/personal/useraddress',
query: {
stype: 1,
},
stype: 1
}
});
} else if(item.title=='待发货') {
} else if (item.title == '待发货') {
this.$router.push({
path: "/personal/useraddress",
path: '/personal/useraddress',
query: {
stype: 2,
},
stype: 2
}
});
} else if(item.title=='待收货') {
} else if (item.title == '待收货') {
this.$router.push({
path: "/personal/useraddress",
path: '/personal/useraddress',
query: {
stype: 3,
},
stype: 3
}
});
}
}
},
handleClose(){
this.dialogInfo1=false;
handleClose() {
this.dialogInfo1 = false;
console.log(this.dialogInfo1);
},
open(){
},
ifadroind(){
open() {},
ifadroind() {
var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid = sUserAgent.match(/android/i) == "android";
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
var bIsIpad = sUserAgent.match(/ipad/i) == 'ipad';
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == 'iphone os';
var bIsMidp = sUserAgent.match(/midp/i) == 'midp';
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == 'rv:1.2.3.4';
var bIsUc = sUserAgent.match(/ucweb/i) == 'ucweb';
var bIsAndroid = sUserAgent.match(/android/i) == 'android';
var bIsCE = sUserAgent.match(/windows ce/i) == 'windows ce';
var bIsWM = sUserAgent.match(/windows mobile/i) == 'windows mobile';
if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
if(this.userlog==true){
this.usermessage='关注皇家爱宠荟,修改个人资料',
this.dialogInfo1=true;
}else{
this.dialogInfo1=false;
this.usermessage='关注皇家爱宠荟,兑换更多福利';
if (this.userlog == true) {
(this.usermessage = '关注皇家爱宠荟,修改个人资料'), (this.dialogInfo1 = true);
} else {
this.dialogInfo1 = false;
this.usermessage = '关注皇家爱宠荟,兑换更多福利';
}
return false;
} else {
this.dialogInfo1=false;
this.dialogInfo1 = false;
return true;
}
},
openaddress(item,index){
let user= this.$store.state.userInfo;
if(user==undefined||user==null||user==''){
openaddress(item, index) {
let user = this.userInfo;
if (user == undefined || user == null || user == '') {
this.$message({
type: 'warning',
message: '您还未登录'
});
return
return;
} else {
if(item.title=='收货地址'){
if (item.title == '收货地址') {
this.$router.push({
path: `/useraddress/openaddress/`
})
});
}
if(index==0){
this.userlog=true
if (index == 0) {
this.userlog = true;
_hmt.push([
"_trackCustomEvent",
"jump_to_crmMiniApp",
'_trackCustomEvent',
'jump_to_crmMiniApp',
{
"type":"积分商城",
type: '积分商城'
}
])
]);
let isMobile = this.ifadroind();
if(isMobile)
window.location.href="weixin://dl/business/?t=BE1OA2AngRs";
if (isMobile) window.location.href = 'weixin://dl/business/?t=BE1OA2AngRs';
}
if(index==1){
if (index == 1) {
this.$router.push({
path: `/personal/discount/`
})
});
}
}
},
opendialog(){
opendialog() {
this.ifadroind();
},
/* 初始化设置用户信息 */
setUserInfoData(userInfo){
// console.log(this.loginState,userInfo,'2222');
let userwidth = 0;
this.userid = userInfo;
this.islogin = false;
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;
let tagEleLeft = userwidth - 1;
if (tagEleLeft <= 0) tagEleLeft = 0;
tagEle.style.left = tagEleLeft + '%';
}
if (this.userid == undefined || this.userid == '' || this.userid == null) {
this.islogin = true;
}
}
},
mounted() {
this.checkIsLogin();
let userwidth=0;
// this.checkIsLogin();
this.$store.dispatch('checkLoginState',this);
this.ifadroind();
let user= this.$store.state.userInfo;
if(user){
this.userid=user.data;
this.islogin=false;
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;
let tagEleLeft=userwidth-1;
if(tagEleLeft<=0)
tagEleLeft=0;
tagEle.style.left=tagEleLeft+"%";
}
let user = this.userInfo;
this.islogin = !this.loginState;
if (user && this.loginState) {
this.setUserInfoData(user);
} else {
this.userid='';
this.userid = '';
}
if(this.userid==undefined ||this.userid==''||this.userid==null){
this.islogin=true;
}
},
};
</script>
<style lang="less" scoped>
@import url("@/assets/css/global.less");
@import url("@/assets/css/mypersonal.less");
@import url('@/assets/css/global.less');
@import url('@/assets/css/mypersonal.less');
</style>

View File

@ -5,18 +5,11 @@
<div class="rc_contline"></div>
<div class="rc-main">
<div class="address-list">
<div
class="mypersonal"
v-for="(item, index) in useraddress"
:key="index"
:class="item.isDefault ? 'active' : ''"
@click="selectAddress(item)"
>
<div class="arrow_ph" v-if="item.isDefault" @click="popGetList()">
<i class="el-icon-arrow-right"></i>
</div>
<div class="mypersonal" v-for="(item, index) in useraddress" :key="index" :class="item.isDefault ? 'active' : ''" @click="selectAddress(item)">
<div class="arrow_ph" v-if="item.isDefault" @click="popGetList()"><i class="el-icon-arrow-right"></i></div>
<div class="edit" @click="editAddress(item)">
<i class="el-icon-edit"></i>编辑
<i class="el-icon-edit"></i>
编辑
</div>
<div class="my-delivery">
<span>{{ item.recipient }}</span>
@ -26,12 +19,8 @@
<span>{{ item.address }}</span>
</div>
</div>
<div class="mypersonal add" :class="useraddress.length>0?'':'show'">
<div
class="my-delivery"
@click="addAddress"
style="justify-content: center"
>
<div class="mypersonal add" :class="useraddress.length > 0 ? '' : 'show'">
<div class="my-delivery" @click="addAddress" style="justify-content: center">
<i class="el-icon-plus"></i>
<span>添加收货地址</span>
</div>
@ -41,9 +30,7 @@
<div class="rc_contline"></div>
<div class="rc-main" v-for="(item, index) in goldmedal" :key="index">
<div class="rc-usermain">
<div class="rc-image">
<img :src="item.productImg" alt="" />
</div>
<div class="rc-image"><img :src="item.productImg" alt="" /></div>
<div class="rc-right">
<div class="rc-usercenter">
<h3>{{ item.productName }}</h3>
@ -67,8 +54,9 @@
</li>
<li>
<span> 活动促销:</span>
<i class="ts-right-arr ts-right-arr--two" @click="userget()">{{ curCoupon.couponName }}</i>
<span>活动促销:</span>
<i class="ts-right-arr ts-right-arr--two" @click="userget()">{{ isHasChose ? curCoupon.couponName : drawlist.length ? `${drawlist.length}张优惠券可选择` : '无优惠券' }}</i>
</li>
<li>
@ -95,45 +83,18 @@
<i>合计金额:</i>
<em>{{ finalAmount }}</em>
</div>
<div style="font-weight: bold">
<span @click="preJiesuan()">提交订单</span>
<div style="font-weight: bold"><span @click="preJiesuan()">提交订单</span></div>
</div>
</div>
</div>
</div>
<el-dialog
:visible.sync="dialogAdd"
class="diallog_width"
width="'100%"
:title="dialogAddTitle"
>
<div class="tc dl_cont" v-if="dialogAdd">
<myAddress
@isClose="dialogCtrl"
:editAddressData="editAddressData"
></myAddress>
</div>
<el-dialog :visible.sync="dialogAdd" class="diallog_width" width="'100%" :title="dialogAddTitle">
<div class="tc dl_cont" v-if="dialogAdd"><myAddress @isClose="dialogCtrl" :editAddressData="editAddressData"></myAddress></div>
</el-dialog>
<el-dialog
:visible.sync="dialogPopList"
class="diallog_width"
width="'100%"
title="选择收货地址"
>
<el-dialog :visible.sync="dialogPopList" class="diallog_width" width="'100%" title="选择收货地址">
<div class="tc dl_cont" style="padding-bottom: 50px; position: relative">
<div class="pop_list">
<el-row
class="mypersonal"
v-for="(item, index) in useraddress"
:key="index"
:class="item.isDefault ? 'active' : ''"
>
<el-col :span="4"
><input
type="checkbox"
v-model="item.checked"
@click="selectPopAddress(item)"
/></el-col>
<el-row class="mypersonal" v-for="(item, index) in useraddress" :key="index" :class="item.isDefault ? 'active' : ''">
<el-col :span="4"><input type="checkbox" v-model="item.checked" @click="selectPopAddress(item)" /></el-col>
<el-col :span="16" class="tl">
<div>
<p class="inline">{{ item.recipient }}</p>
@ -141,49 +102,33 @@
</div>
<p>{{ item.address }}</p>
</el-col>
<el-col :span="4">
<i @click="editAddress(item)" class="el-icon-edit"></i>
</el-col>
<el-col :span="4"><i @click="editAddress(item)" class="el-icon-edit"></i></el-col>
</el-row>
<div class="popnewaddr">
<span class="btn" @click="addAddress">新增收货地址</span>
</div>
<div class="popnewaddr"><span class="btn" @click="addAddress">新增收货地址</span></div>
</div>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogInfo1" class="pop_coupon" :close-on-click-modal="false">
<div class="ts-no-data" v-if="drawlist.length<=0">您还没有优惠券可在商品的详情页面中领取</div>
<div class="ts-no-data" v-if="drawlist.length <= 0">您还没有优惠券可在商品的详情页面中领取</div>
<div class="rs-dis">
<div
class="rc-discount"
v-for="(item, index) in drawlist"
:key="index"
>
<div class="rc-discount" v-for="(item, index) in drawlist" :key="index">
<img :src="userimage" alt="" />
<div class="rc-contair">
<div class="rc-left" :style='usercolor'>
<div class="rc-left" :style="usercolor">
<div>
<i v-if="(item.couponTypeId!='4' && item.couponAmount>0)">
</i>
<span>
{{ item.couponAmount?item.couponAmount:(parseInt(10 - item.discount*10)+'折') }}
</span>
<i v-if="item.couponTypeId != '4' && item.couponAmount > 0"></i>
<span>{{ item.couponAmount ? item.couponAmount : parseInt(10 - item.discount * 10) + '折' }}</span>
</div>
<strong>{{ item.couponName }}</strong>
</div>
<div class="rc-right">
<i :style='usercolor'>
{{ item.couponName }}
</i>
<div class="rc-userfont" :style="(item.validTo?'visibility:visible':'visibility:hidden')">
<i :style="usercolor">{{ item.couponName }}</i>
<div class="rc-userfont" :style="item.validTo ? 'visibility:visible' : 'visibility:hidden'">
<strong>有效期</strong>
<span>{{item.validFrom}}</span>
<em>{{item.validTo}}</em>
</div>
<div class="rc-footer">
<span @click="pickCoupon(item)">立即使用</span>
<span>{{ item.validFrom }}</span>
<em>{{ item.validTo }}</em>
</div>
<div class="rc-footer"><span @click="pickCoupon(item)">立即使用</span></div>
</div>
</div>
</div>
@ -193,46 +138,47 @@
</template>
<script>
import Myheader from "~/components/header.vue";
import { userin, memberAddress, generateOrderWX, getdraw } from "../../ajax/getData";
import util from "@/ajax/util";
import tabs from "@/components/tabs.vue";
import myAddress from "~/components/address.vue";
import { mapMutations } from "vuex";
import itemMixin from "../../../smart-admin-web/src/components/main/components/side-menu/item-mixin";
import Myheader from '~/components/header.vue';
import { userin, memberAddress, generateOrderWX, getdraw } from '../../ajax/getData';
import util from '@/ajax/util';
import tabs from '@/components/tabs.vue';
import myAddress from '~/components/address.vue';
import { mapMutations,mapState } from 'vuex';
import itemMixin from '../../../smart-admin-web/src/components/main/components/side-menu/item-mixin';
export default {
middleware: "metaTitle",
meta: { title: "订单结算" },
middleware: 'metaTitle',
meta: { title: '订单结算' },
data() {
return {
util,
crumbs:[
crumbs: [
{
path:'/productdetails/productlist/',
path: '/productdetails/productlist/'
},
{
path:'/personal/settlement'
path: '/personal/settlement'
}
],
usercolor:{color:'#e1001a'},
userimage: require("../../assets/image/unused.png"),
curCoupon:{couponName:'未选择可用优惠券'},
drawlist:[],
dialogInfo1:false,
usercolor: { color: '#e1001a' },
userimage: require('../../assets/image/unused.png'),
curCoupon: { couponName: '未选择可用优惠券' },
isHasChose : false, //
drawlist: [],
dialogInfo1: false,
goldmedal: [],
dialogAddTitle: "",
dialogAddTitle: '',
addressstype: null,
orderstatus: "",
userisdelivery: "待收货",
userdelivery: "派送中",
orderstatus: '',
userisdelivery: '待收货',
userdelivery: '派送中',
isshow: true,
leftico: require("../../assets/image/rc-left.png"),
orderNumber: "",
leftico: require('../../assets/image/rc-left.png'),
orderNumber: '',
dialogAdd: false,
dialogPopList: false,
editAddressData: {},
curAddress: {},
saveType: "",
saveType: '',
useraddress: [
// {
// state: "",
@ -248,14 +194,14 @@ export default {
// },
],
shopprice: {
price: "标准快递",
distribution: "限时折扣全场商品8折",
promotion: "¥167.00",
payment: "¥0.00 ",
price: '标准快递',
distribution: '限时折扣全场商品8折',
promotion: '¥167.00',
payment: '¥0.00 '
},
discountAmount:0,
finalAmount:0,
discountedProductCode:undefined,
discountAmount: 0,
finalAmount: 0,
discountedProductCode: undefined
};
},
computed: {
@ -265,54 +211,55 @@ export default {
}, 0);
},
//
...mapState({
userInfo : state => state.user.userInfo,
loginState : state => state.login.loginState,
})
},
methods: {
...mapMutations(["checkIsLogin"]),
...mapMutations(['checkIsLogin']),
/* 计算优惠券价格 */
discountedSumPrice() {
/* 判断是否为商品卷 */
if(this.curCoupon.productCodes)
this.finalAmount = this.qualifiedProductDiscount();
else
this.finalAmount = this.wholeOrderDiscount();
if (this.curCoupon.productCodes) this.finalAmount = this.qualifiedProductDiscount();
else this.finalAmount = this.wholeOrderDiscount();
this.finalAmount = parseFloat(this.finalAmount).toFixed(2);
this.discountAmount = parseFloat(this.discountAmount).toFixed(2);
},
wholeOrderDiscount(){
wholeOrderDiscount() {
this.discountedItemIndex = 0;
let checkResult = true;
if(this.curCoupon.minPrice && this.curCoupon.minPrice > this.sumPrice) {
if (this.curCoupon.minPrice && this.curCoupon.minPrice > this.sumPrice) {
checkResult = false;
}
if(this.curCoupon.minQuantity && this.curCoupon.minQuantity > 0) {
if (this.curCoupon.minQuantity && this.curCoupon.minQuantity > 0) {
let totalItemNum = 0;
let tmpShoppingCartList = this.arrSort(this.goldmedal);
for(let itemInCart of tmpShoppingCartList) {
for (let itemInCart of tmpShoppingCartList) {
totalItemNum += itemInCart.buyCount;
}
if(this.curCoupon.minQuantity > totalItemNum)
if (this.curCoupon.minQuantity > totalItemNum) checkResult = false;
}
if (this.curCoupon.couponAmount && this.curCoupon.couponAmount > this.sumPrice) {
checkResult = false;
}
if(this.curCoupon.couponAmount && this.curCoupon.couponAmount > this.sumPrice) {
checkResult = false;
}
if(checkResult) {
this.discountedProductCode = this.goldmedal[0].productCode
if(this.curCoupon.couponAmount && this.curCoupon.couponAmount>0) {
if (checkResult) {
this.discountedProductCode = this.goldmedal[0].productCode;
if (this.curCoupon.couponAmount && this.curCoupon.couponAmount > 0) {
this.discountAmount = this.curCoupon.couponAmount;
return this.sumPrice - this.curCoupon.couponAmount;
} else if(this.curCoupon.discount && this.curCoupon.discount>0) {
this.discountAmount = this.sumPrice*this.curCoupon.discount;
return this.sumPrice * ( 1 - this.curCoupon.discount );
} else if (this.curCoupon.discount && this.curCoupon.discount > 0) {
this.discountAmount = this.sumPrice * this.curCoupon.discount;
return this.sumPrice * (1 - this.curCoupon.discount);
}
} else {
this.discountAmount = 0;
this.curCoupon = {couponName:'未能使用该优惠券'};
this.curCoupon = { couponName: '未能使用该优惠券' };
return this.sumPrice;
}
},
/* 计算价格商品折扣 */
qualifiedProductDiscount(){
qualifiedProductDiscount() {
this.discountedItemIndex = 0;
let total = 0;
let totalItemNum = 0; //
@ -322,23 +269,22 @@ export default {
let skipQualifiedProductAmountCalculating = false;
let checkResult = true; //使
let selectProduct = []; //
for(let itemInCart of tmpShoppingCartList) {
if(this.curCoupon.productCodes.indexOf(itemInCart.productCode)>-1) {
qualifiedProductAmount += (itemInCart.productPrice * itemInCart.buyCount);
for (let itemInCart of tmpShoppingCartList) {
if (this.curCoupon.productCodes.indexOf(itemInCart.productCode) > -1) {
qualifiedProductAmount += itemInCart.productPrice * itemInCart.buyCount;
totalItemNum += itemInCart.buyCount;
}
}
if(this.curCoupon.minPrice && this.curCoupon.minPrice > qualifiedProductAmount) {
if (this.curCoupon.minPrice && this.curCoupon.minPrice > qualifiedProductAmount) {
checkResult = false;
}
if(this.curCoupon.minQuantity && this.curCoupon.minQuantity > totalItemNum) {
if (this.curCoupon.minQuantity && this.curCoupon.minQuantity > totalItemNum) {
checkResult = false;
}
if(this.curCoupon.couponAmount && this.curCoupon.couponAmount > qualifiedProductAmount) {
if (this.curCoupon.couponAmount && this.curCoupon.couponAmount > qualifiedProductAmount) {
checkResult = false;
}
// couponTypeId
// 0-
// 1-50
@ -346,11 +292,11 @@ export default {
// 3-6
// 4-7
// 6-100
for(let itemInCart of tmpShoppingCartList) {
if(this.curCoupon.productCodes && this.curCoupon.productCodes.indexOf(itemInCart.productCode)>-1 && !couponUsed && checkResult) {
console.log(itemInCart,'itemInCart');
for (let itemInCart of tmpShoppingCartList) {
if (this.curCoupon.productCodes && this.curCoupon.productCodes.indexOf(itemInCart.productCode) > -1 && !couponUsed && checkResult) {
console.log(itemInCart, 'itemInCart');
//Into coupon discount calculation
switch(this.curCoupon.couponTypeId) {
switch (this.curCoupon.couponTypeId) {
case 1: //Amount deduct
/*
if(this.curCoupon.couponAmount && this.curCoupon.couponAmount <= (itemInCart.productPrice * itemInCart.buyCount)) {
@ -367,30 +313,34 @@ export default {
*/
case 2: //Amount deduct with minPrice restriction
case 6:
if(this.curCoupon.couponAmount && this.curCoupon.couponAmount <= qualifiedProductAmount && this.curCoupon.productCodes.indexOf(itemInCart.productCode)>-1) {
if (
this.curCoupon.couponAmount &&
this.curCoupon.couponAmount <= qualifiedProductAmount &&
this.curCoupon.productCodes.indexOf(itemInCart.productCode) > -1
) {
total = total + qualifiedProductAmount - this.curCoupon.couponAmount;
this.discountAmount = this.curCoupon.couponAmount;
this.discountedProductCode = itemInCart.productCode;
skipQualifiedProductAmountCalculating = true;
couponUsed=true;
} else if(this.curCoupon.couponAmount && this.curCoupon.couponAmount > qualifiedProductAmount) {
couponUsed = true;
} else if (this.curCoupon.couponAmount && this.curCoupon.couponAmount > qualifiedProductAmount) {
total = total + itemInCart.productPrice * itemInCart.buyCount;
this.discountAmount = 0;
this.curCoupon = {couponName:'未能使用该优惠券'};
this.curCoupon = { couponName: '未能使用该优惠券' };
}
break;
case 3: //Limited product % discount
case 4: //% discount
if(this.curCoupon.discount && this.curCoupon.productCodes.indexOf(itemInCart.productCode)>-1) {
total = total + qualifiedProductAmount * ( 1 - this.curCoupon.discount );
if (this.curCoupon.discount && this.curCoupon.productCodes.indexOf(itemInCart.productCode) > -1) {
total = total + qualifiedProductAmount * (1 - this.curCoupon.discount);
this.discountAmount = qualifiedProductAmount * this.curCoupon.discount;
this.discountedProductCode = itemInCart.productCode;
couponUsed=true;
couponUsed = true;
skipQualifiedProductAmountCalculating = true;
} else if(this.curCoupon.couponAmount && this.curCoupon.couponAmount > qualifiedProductAmount) {
} else if (this.curCoupon.couponAmount && this.curCoupon.couponAmount > qualifiedProductAmount) {
total = total + itemInCart.productPrice * itemInCart.buyCount;
this.discountAmount = 0;
this.curCoupon = {couponName:'未能使用该优惠券'};
this.curCoupon = { couponName: '未能使用该优惠券' };
}
break;
default:
@ -399,53 +349,48 @@ export default {
}
//Into coupon discount calculation end
} else {
if(skipQualifiedProductAmountCalculating && this.curCoupon.productCodes.indexOf(itemInCart.productCode)>-1) {
if (skipQualifiedProductAmountCalculating && this.curCoupon.productCodes.indexOf(itemInCart.productCode) > -1) {
} else {
total += itemInCart.productPrice * itemInCart.buyCount;
}
}
}
if(!couponUsed) {
if (!couponUsed) {
this.discountAmount = 0;
this.curCoupon = {couponName:'未能使用该优惠券'};
this.curCoupon = { couponName: '未能使用该优惠券' };
total = this.sumPrice;
}
return total;
},
arrSort(arr) {
let userarr=[]
let a=[];
for(let i in arr){
arr[i].total=arr[i].productPrice*arr[i].buyCount;
if(arr[i].total){
let userarr = [];
let a = [];
for (let i in arr) {
arr[i].total = arr[i].productPrice * arr[i].buyCount;
if (arr[i].total) {
userarr.push(arr[i]);
}
}
return userarr.sort((n1,n2)=>{
return n2.total-n1.total;
return userarr.sort((n1, n2) => {
return n2.total - n1.total;
});
},
async getAddressList() {
let memberId = JSON.parse(localStorage.getItem("userInfo")).data.id;
let { data } = await memberAddress("getAll", { memberId: memberId });
data.forEach((item) => {
item.address =
item.provinceName +
item.cityName +
item.districtName +
item.detailAddress;
let memberId = this.userInfo.id;
let { data } = await memberAddress('getAll', { memberId: memberId });
data.forEach(item => {
item.address = item.provinceName + item.cityName + item.districtName + item.detailAddress;
});
this.useraddress = data;
},
userget(){
let user = this.$store.state.userInfo;
userget() {
let user = this.userInfo;
if (user) {
//this.userdraw(user.data.mobile);
this.dialogInfo1 = true;
} else {
this.$router.push({
path: "/userlogin/login",
path: '/userlogin/login'
});
}
},
@ -453,25 +398,24 @@ export default {
async userdraw(mobile) {
let curDate = new Date();
let productCodes = [];
for(let itemInCart of this.goldmedal) {
for (let itemInCart of this.goldmedal) {
productCodes.push(itemInCart.productCode);
}
let paramsToAPI = {
mobile : mobile,
useStartDate : curDate.getFullYear()+'-'+(curDate.getMonth()+1)+'-'+curDate.getDate(),
status:0
mobile: mobile,
useStartDate: curDate.getFullYear() + '-' + (curDate.getMonth() + 1) + '-' + curDate.getDate(),
status: 0
};
if(productCodes)
paramsToAPI.productCodes = productCodes.join(',');
if (productCodes) paramsToAPI.productCodes = productCodes.join(',');
let data = await getdraw(paramsToAPI);
let _self = this;
let curTime = new Date().getTime();
let valDateFromTime=0;
let valDateToTime=0;
let dateChecked=true;
let valDateFromTime = 0;
let valDateToTime = 0;
let dateChecked = true;
let avaliableCouponNum = 0;
if (data) {
this.drawlist=[];
this.drawlist = [];
/*
for(let itemInCart of this.goldmedal) {
let tmpIndex=0;
@ -525,19 +469,20 @@ export default {
avaliableCouponNum = data.length;
this.drawlist = data.data;
if(avaliableCouponNum > 0) {
this.curCoupon.couponName = '有 '+avaliableCouponNum+' 张优惠券可以使用';
if (avaliableCouponNum > 0) {
this.curCoupon.couponName = '有 ' + avaliableCouponNum + ' 张优惠券可以使用';
}
}
},
/* 关闭弹出框 计算价格 */
pickCoupon(item){
pickCoupon(item) {
this.curCoupon = item;
this.dialogInfo1 = false;
this.isHasChose = true;
this.discountedSumPrice();
},
editAddress(item) {
this.dialogAddTitle = "修改收货地址";
this.dialogAddTitle = '修改收货地址';
this.editAddressData = {
memberId: item.memberId,
name: item.recipient,
@ -550,17 +495,17 @@ export default {
provinceName: item.provinceName,
cityName: item.cityName,
districtName: item.districtName,
saveType: "edit",
saveType: 'edit'
};
this.dialogAdd = true;
},
addAddress() {
this.dialogAddTitle = "新增收货地址";
this.dialogAddTitle = '新增收货地址';
this.editAddressData = {};
this.dialogAdd = true;
},
selectAddress(cur) {
this.useraddress.forEach((item) => {
this.useraddress.forEach(item => {
if (item.id == cur.id) {
item.isDefault = true;
item.checked = true;
@ -571,7 +516,7 @@ export default {
});
},
selectPopAddress(cur) {
this.useraddress.forEach((item) => {
this.useraddress.forEach(item => {
if (item.id == cur.id) {
item.isDefault = true;
item.checked = true;
@ -588,43 +533,40 @@ export default {
this.dialogAdd = parm;
this.getAddressList();
},
preJiesuan(){
let checkResult=true;
if(this.useraddress.length<=0) {
preJiesuan() {
let checkResult = true;
if (this.useraddress.length <= 0) {
this.$message({
type: "error",
message: '请先添加收件信息',
type: 'error',
message: '请先添加收件信息'
});
checkResult=false;
checkResult = false;
}
if(checkResult)
this.jiesuan();
if (checkResult) this.jiesuan();
},
async jiesuan() {
let orderAddress = this.useraddress.filter((item) => item.isDefault);
let userInfo = this.$store.state.userInfo;
if(!userInfo) {
let orderAddress = this.useraddress.filter(item => item.isDefault);
let userInfo = this.userInfo;
if (!userInfo) {
this.$router.push({
path: "/userlogin/login",
query: {
},
path: '/userlogin/login',
query: {}
});
return;
}
let postData = [];
let tmpCounter=0;
this.goldmedal.forEach((item) => {
let basePoint = (item.basePoint?item.basePoint:0);
let tmpCounter = 0;
this.goldmedal.forEach(item => {
let basePoint = item.basePoint ? item.basePoint : 0;
let oneProduct = {
basePoint:basePoint,
basePoint: basePoint,
productName: item.productName,
buyCount: item.buyCount,
productCode: item.productCode,
payAmount: item.productPrice,
memberId: userInfo.data.id,
phoneNumber: userInfo.data.mobile,
memberId: userInfo.id,
phoneNumber: userInfo.mobile,
// couponId: "NGQ2022P12",
// couponTypeId: "4",
// couponName: "",
@ -636,15 +578,15 @@ export default {
addressProvinceName: orderAddress[0].provinceName,
addressCityName: orderAddress[0].cityName,
addressCountyName: orderAddress[0].districtName,
addressDetailInfo: orderAddress[0].detailAddress,
},
addressDetailInfo: orderAddress[0].detailAddress
}
};
if(this.curCoupon.couponId && item.productCode == this.discountedProductCode) {
if (this.curCoupon.couponId && item.productCode == this.discountedProductCode) {
oneProduct.couponId = this.curCoupon.couponId;
oneProduct.couponTypeId = this.curCoupon.couponTypeId;
oneProduct.couponName = this.curCoupon.couponName;
oneProduct.couponCode = this.curCoupon.couponCode;
oneProduct.couponAmount = (this.curCoupon.couponAmount?this.curCoupon.couponAmount:this.curCoupon.discount);
oneProduct.couponAmount = this.curCoupon.couponAmount ? this.curCoupon.couponAmount : this.curCoupon.discount;
}
postData.push(oneProduct);
tmpCounter++;
@ -694,78 +636,93 @@ export default {
// // },
// ];
let payType = this.util.pickPaytype();
let res = await generateOrderWX(postData,payType);
let res = await generateOrderWX(postData, payType);
if (res.success) {
let userPayData = {
orderId: res.data.orderNumber,
userprice: parseFloat(res.data.orderAmount).toFixed(2),
userinformation:
postData[0].orderAddress.addressUserName +
" " +
postData[0].orderAddress.addressPhoneNumber,
userinformation: postData[0].orderAddress.addressUserName + ' ' + postData[0].orderAddress.addressPhoneNumber,
// wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
// wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
wxPay: (res.msg?res.msg:''),
wxPay: res.msg ? res.msg : ''
};
// console.log('22222');
// console.log(postData, payType);
// console.log(userPayData);
// return false;
this.$router.push({
path: "/personal/userpay",
path: '/personal/userpay',
query: {
userPayData: JSON.stringify(userPayData),
},
userPayData: JSON.stringify(userPayData)
}
});
} else {
this.$message({
type: "warning",
message: res.msg,
type: 'warning',
message: res.msg
});
}
},
async canceldanhao(orderNumber) {
let data = await userin(orderNumber);
},
/* 初始化数据 */
initData(){
this.getAddressList();
let user = this.userInfo;
let memberId = '';
if (user) memberId = user.id;
this.finalAmount = this.sumPrice;
this.goldmedal.forEach(item => {
_hmt.push([
'_trackCustomEvent',
'placing_order',
{
member_id: memberId,
product_id: item.productCode,
product_name: item.productName,
product_quantity: item.buyCount,
product_amount: item.buyCount * item.productPrice
}
]);
});
if (user) {
this.userdraw(user.mobile);
}
}
},
mounted() {
this.goldmedal = JSON.parse(this.$route.query.list);
this.getAddressList();
this.checkIsLogin();
let user = this.$store.state.userInfo;
let memberId = '';
if(user)
memberId = user.data.id;
this.finalAmount = this.sumPrice;
this.goldmedal.forEach((item) => {
_hmt.push([
"_trackCustomEvent",
"placing_order",
{
"member_id": memberId,
"product_id": item.productCode,
"product_name": item.productName,
"product_quantity" : item.buyCount,
"product_amount" : item.buyCount*item.productPrice,
if(this.userInfo && this.loginState){
this.initData();
}
])
});
// this.checkIsLogin();
if(user) {
this.userdraw(user.data.mobile);
}
// this.addressstype = this.$route.query.stype;
// this.orderNumber = this.$route.query.orderNumber;
// this.canceldanhao(this.orderNumber);
// console.log(this.$refs.rccolor);
// this.$refs.rccolor.style.background = "gray";
},
watch: {
userInfo(newVal){
if(newVal && this.loginState){
this.initData();
}
}
},
components: {
Myheader,
tabs,
myAddress,
},
myAddress
}
};
</script>
<style lang="less" scoped>
//@import url("../../assets/css/global.less");
@import "./settlement.less";
@import './settlement.less';
// @import url("../../assets/css/settlement.less");
</style>

View File

@ -6,46 +6,31 @@
<div class="online bold"></div>
<div class="usercontshow rc-max-width--xl">
<div class="rc-headera">
<span
v-for="(item, index) in discountlist"
:key="index"
@click="selectGoods(item, index)"
:class="activeIndex == index ? 'active' : 'unactive'"
>
<span v-for="(item, index) in discountlist" :key="index" @click="selectGoods(item, index)" :class="activeIndex == index ? 'active' : 'unactive'">
{{ item.title }}
</span>
</div>
<div class="online bold" style="height:8px;margin-top:0"></div>
<div class="rc-userheader">
<span v-for="(item, index) in message" :key="index">
{{ item.title }}
</span>
<span v-for="(item, index) in message" :key="index">{{ item.title }}</span>
</div>
<div class="rc-center" v-for="(item, index) in useralllist" :key="index">
<div class="rc-usermaina">
<div class="rc-title">
<div>
<i>订单编号:</i><span>{{ item.orderNumber }}</span>
<i>订单编号:</i>
<span>{{ item.orderNumber }}</span>
</div>
<div class="rc-usertitle">
<strong>订单状态:</strong>
<em>{{
item.status == "0"
? "待付款"
: item.status == "1"
? "待收货"
: item.status == "2"
? "已完成"
: item.status == "3"
? "已取消"
: "异常订单"
}}</em>
<em>
{{ item.status == '0' ? '待付款' : item.status == '1' ? '待收货' : item.status == '2' ? '已完成' : item.status == '3' ? '已取消' : '异常订单' }}
</em>
</div>
</div>
<div class="rc-usermain" >
<div class="rc-image">
<img :src= item.picFile alt="" />
</div>
<div class="rc-usermain">
<div class="rc-image"><img :src="item.picFile" alt="" /></div>
<div class="rc-right" @click="usertiaozhuan(item)">
<div class="rc-usercenter">
<em>{{ item.productName }}</em>
@ -55,7 +40,7 @@
</div>
<div class="rc-userbottom">
<span>数量:{{ item.pcs }}</span>
<i>{{item.ecPrice}}</i>
<i>{{ item.ecPrice }}</i>
</div>
<div class="rc-userbottomm">
<i>{{ item.ecPrice }}</i>
@ -65,81 +50,66 @@
</div>
<div class="pc-bottom">
<span v-if="item.status!=1" @click="userpay(item, index)">{{
item.status == "0"
? "取消订单"
: item.status == "1"
? "确认收货"
: item.status == "2"
? "再次购买"
: item.status == "3"
? "再次购买"
: "异常订单"
}}</span>
<span @click="userfind(item)">{{
item.status == "0"
? "立即支付"
: item.status == "1"
? "查看订单"
: item.status == "2"
? "查看订单"
: item.status == "3"
? "查看订单"
: "异常订单"
}}</span>
<span v-if="item.status != 1" @click="userpay(item, index)">
{{
item.status == '0'
? '取消订单'
: item.status == '1'
? '确认收货'
: item.status == '2'
? '再次购买'
: item.status == '3'
? '再次购买'
: '异常订单'
}}
</span>
<span @click="userfind(item)">
{{
item.status == '0'
? '立即支付'
: item.status == '1'
? '查看订单'
: item.status == '2'
? '查看订单'
: item.status == '3'
? '查看订单'
: '异常订单'
}}
</span>
</div>
</div>
<div class="online" style="display:none"></div>
<div class="rc-usermain rc-price">
<div class="rc-price priceleft">
<span>数量:</span>
<em>{{item.lengthnum}}件商品</em>
<em>{{ item.lengthnum }}件商品</em>
</div>
<div class="rc-price priceright">
<strong>总计:</strong>
<i>{{item.salesAmount}}</i>
<i>{{ item.salesAmount }}</i>
</div>
</div>
<div class="rc-bottom">
<span @click="userpay(item, index)">{{
item.status == "0"
? "取消订单"
: item.status == "1"
? "确认收货"
: item.status == "2"
? "再次购买"
: item.status == "3"
? "再次购买"
: "异常订单"
}}</span>
<span @click="userfind(item)">{{
item.status == "0"
? "立即支付"
: item.status == "1"
? "查看订单"
: item.status == "2"
? "查看订单"
: item.status == "3"
? "查看订单"
: "异常订单"
}}</span>
<span @click="userpay(item, index)">
{{ item.status == '0' ? '取消订单' : item.status == '1' ? '确认收货' : item.status == '2' ? '再次购买' : item.status == '3' ? '再次购买' : '异常订单' }}
</span>
<span @click="userfind(item)">
{{ item.status == '0' ? '立即支付' : item.status == '1' ? '查看订单' : item.status == '2' ? '查看订单' : item.status == '3' ? '查看订单' : '异常订单' }}
</span>
</div>
</div>
<div class="online bold"></div>
</div>
</div>
<el-dialog :visible.sync="showPaytypeWarning" :close-on-click-modal="false">
<div class="ts-warning-popup">
<div class="title rc-full-width">
<img src="../../assets/error.png" alt="" />
</div>
<div class="title rc-full-width"><img src="../../assets/error.png" alt="" /></div>
<div class="content rc-full-width rc-text--center rc-margin-y--md">
<h3>温馨提示</h3>
<span class="">{{ paytypeWarning.message}}</span>
<span class="">{{ paytypeWarning.message }}</span>
</div>
</div>
</el-dialog>
@ -148,187 +118,187 @@
</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";
import util from "@/ajax/util";
import { customerorders, userindent, canceldanhao, repayOrde } from "../../ajax/getData";
import { mapMutations } from "vuex";
import tabs from '~/components/tabs.vue';
import util from '@/ajax/util';
import { customerorders, userindent, canceldanhao, repayOrde } from '../../ajax/getData';
import { mapMutations, mapState } from 'vuex';
export default {
data() {
return {
util,
paytypeWarning:{result:true,message:''},
showPaytypeWarning:false,
crumbs:[
paytypeWarning: { result: true, message: '' },
showPaytypeWarning: false,
crumbs: [
{
path:'/personal/mypersonal/',
path: '/personal/mypersonal/'
},
{
path:'/personal/useraddress/',
path: '/personal/useraddress/'
}
],
activeIndex: 0,
userstype:'',
alllist:[],
obligation:[],//
pending:[],//
receiving :[],//
allmessage:[],
userstype: '',
alllist: [],
obligation: [], //
pending: [], //
receiving: [], //
allmessage: [],
useralllist: [],
usertitle:'',
useraliset:[],
userdata: [],
buttontitle: "再次购买",
usertitle: '',
useraliset: [],
// userdata: [],
buttontitle: '再次购买',
discountlist: [
{
title: "全部",
title: '全部'
},
{
title: "待付款",
title: '待付款'
},
{
title: "待发货",
title: '待发货'
},
{
title: "待收货",
},
title: '待收货'
}
],
message: [
{
title: "商品",
title: '商品'
},
{
title: "单价/元",
title: '单价/元'
},
{
title: "数量",
title: '数量'
},
{
title: "实付款/元",
title: '实付款/元'
},
{
title: "操作",
},
title: '操作'
}
],
goldmedal: [
{
ordernumber: "",
ordernumber: '',
orderstype: 1,
usereat: "",
usereat: '',
ordernum: 0,
num: "",
specification: "",
buttontitle: "",
userprice: "",
catimage: '',
num: '',
specification: '',
buttontitle: '',
userprice: '',
catimage: ''
}
],
]
};
},
mounted() {
this.checkIsLogin();
let user = this.$store.state.userInfo;
this.userdata = user.data.mobile;
let stype = this.$route.query.stype;
this.userstype=this.$route.query.stype;
if (user == "" || user == null) {
this.$message({
type: "warning",
message: "请先去登录",
});
return;
} else {
this.indet(this.userdata, stype);
computed: {
...mapState({
userInfo: state => state.user.userInfo,
userdata: state => state.user.userInfo.mobile,
loginState: state => state.login.loginState
})
},
watch: {
userInfo(newVal) {
this.resetData();
}
},
mounted() {
// this.checkIsLogin();
this.userstype = this.$route.query.stype;
this.resetData();
// this.userdata = user.data.mobile;
},
components: {
Myheader,
MyFooter,
tabs
},
methods: {
...mapMutations(["changemessage","checkIsLogin"]),
...mapMutations(['changemessage', 'checkIsLogin']),
async indet(mobile, stype) {
let data = await userindent(mobile,undefined,1,100);
let data = await userindent(mobile, undefined, 1, 100);
this.activeIndex = stype;
this.goldmedal = data;
this.alllist=[];
this.allmessage=[];
this.useralllist=[];
this.obligation=[];
this.receiving=[];
this.pending=[];
this.alllist = [];
this.allmessage = [];
this.useralllist = [];
this.obligation = [];
this.receiving = [];
this.pending = [];
for (let i = 0; i < this.goldmedal.length; i++) {
if(!this.goldmedal[i].orderDetailList)
continue;
if (!this.goldmedal[i].orderDetailList.length) continue;
this.useralllist.push(this.goldmedal[i].orderDetailList[0]);
this.alllist.push(this.goldmedal[i].orderDetailList[0])
this.allmessage.push(this.goldmedal[i].orderDetailList[0])
if(this.goldmedal[i].status==0){
this.alllist.push(this.goldmedal[i].orderDetailList[0]);
this.allmessage.push(this.goldmedal[i].orderDetailList[0]);
if (this.goldmedal[i].status == 0) {
this.obligation.push(this.goldmedal[i].orderDetailList[0]);
}else if(this.goldmedal[i].status==1){
} else if (this.goldmedal[i].status == 1) {
this.receiving.push(this.goldmedal[i].orderDetailList[0]);
}
else if(this.goldmedal[i].status==2){
} else if (this.goldmedal[i].status == 2) {
this.pending.push(this.goldmedal[i].orderDetailList[0]);
}
}
for (let y = 0; y < this.goldmedal.length; y++) {
if(!this.goldmedal[y].orderDetailList)
continue;
if(!this.useralllist[y]){
if (!this.useralllist[y]) {
this.useralllist[y] = {};
}
if (!this.goldmedal[y].orderDetailList) continue;
this.useralllist[y].orderNumber = this.goldmedal[y].orderNumber;
this.useralllist[y].status = this.goldmedal[y].status;
this.useralllist[y].addressUserName = this.goldmedal[y].addressUserName;
this.useralllist[y].phoneNumber = this.goldmedal[y].addressPhoneNumber;
this.useralllist[y].salesAmount = this.goldmedal[y].salesAmount;
this.useralllist[y].lengthnum=this.goldmedal[y].orderDetailList.length;
this.useralllist[y].paytype=this.goldmedal[y].paytype;
}
if(this.userstype==1){
this.useralllist=this.obligation
}else if(this.userstype==2){
this.useralllist=this.pending
}
else if(this.userstype==0){
this.useralllist=this.allmessage
}
else if(this.userstype==3){
this.useralllist=this.receiving
this.useralllist[y].lengthnum = this.goldmedal[y].orderDetailList.length;
this.useralllist[y].paytype = this.goldmedal[y].paytype;
}
if (this.userstype == 1) {
this.useralllist = this.obligation;
} else if (this.userstype == 2) {
this.useralllist = this.pending;
} else if (this.userstype == 0) {
this.useralllist = this.allmessage;
} else if (this.userstype == 3) {
this.useralllist = this.receiving;
}
/* 过滤空的数据 */
let filterArr = this.useralllist.filter(val=>{
return val != undefined;
});
this.useralllist = filterArr;
},
//
async getwei(item) {
let payType = this.util.pickPaytype();
let data = await this.repayOrde(item.orderNumber, payType);
if(data.code==1) {
if (data.code == 1) {
let userPayData = {
userprice: item.salesAmount,
orderId: item.orderNumber,
userinformation: item.addressUserName + " " + item.phoneNumber,
wxPay:data.msg
userinformation: item.addressUserName + ' ' + item.phoneNumber,
wxPay: data.msg
};
this.$router.push({
path: "/personal/userpay",
path: '/personal/userpay',
query: {
userData: item.orderNumber,
stype: 1,
userPayData: JSON.stringify(userPayData),
},
userPayData: JSON.stringify(userPayData)
}
});
} else {
this.$message({
type: "error",
message: "订单数据错误,请联系客服进行处理",
type: 'error',
message: '订单数据错误,请联系客服进行处理'
});
}
},
@ -339,22 +309,22 @@ export default {
return res;
}
},
usertiaozhuan(item){
usertiaozhuan(item) {
this.$router.push({
path: "/myorder/usertion",
path: '/myorder/usertion',
query: {
stype: item.status,
orderNumber: item.orderNumber,
},
orderNumber: item.orderNumber
}
});
},
async canceldanhao(orderNumber) {
let data = await canceldanhao(this.userdata,orderNumber);
let data = await canceldanhao(this.userdata, orderNumber);
if (data) {
this.$message({
type: "warning",
message: "取消订单成功",
type: 'warning',
message: '取消订单成功'
});
/* 这个在全部变量去除的时候 记得加 */
// setTimeout(() => {
@ -368,112 +338,129 @@ export default {
userpay(item, index) {
if (item.status == 0) {
if(confirm('确认取消该订单嘛?')){
if (confirm('确认取消该订单嘛?')) {
this.canceldanhao(item.orderNumber);
setTimeout(() => {
this.indet(this.userdata);
this.useralllist=[];
this.alllist=[];
this.allmessage=[];
this.obligation=[];
this.receiving=[];
this.pending=[];
this.useralllist = [];
this.alllist = [];
this.allmessage = [];
this.obligation = [];
this.receiving = [];
this.pending = [];
}, 500);
}
} else if(item.status == 1) { //
} else if (item.status == 1) {
//
}
if (item.buttontitle == "立即支付") {
if (item.buttontitle == '立即支付') {
this.$router.push({
path: "/personal/userpay",
path: '/personal/userpay',
query: {
stype: 1,
},
stype: 1
}
});
} else if (item.status == 3) {
this.$router.push({
path: "/productdetails/producted",
path: '/productdetails/producted',
query: {
stype: 1,
productCode:item.productId
},
productCode: item.productId
}
});
}
},
selectGoods(item, index) {
let list=[]
let list = [];
this.activeIndex = index;
if(item.title=='待付款'){
list=this.obligation
} else if(item.title=='待收货'){
list=this.receiving
} else if(item.title=='待发货'){
this.useralllist=this.pending
list=this.pending
if (item.title == '待付款') {
list = this.obligation;
} else if (item.title == '待收货') {
list = this.receiving;
} else if (item.title == '待发货') {
this.useralllist = this.pending;
list = this.pending;
} else if (item.title == '全部') {
list = this.alllist;
}
else if(item.title=='全部'){
list=this.alllist
}
this.useralllist=[];
this.useralllist = [];
for (var i = 0; i < this.useralllist.length; i++) {
this.useralllist[i].orderNumber =this.goldmedal[i].orderNumber;
this.useralllist[i].status = this.goldmedal[i].status
this.useralllist[i].addressUserName =this.goldmedal[i].addressUserName;
this.useralllist[i].orderNumber = this.goldmedal[i].orderNumber;
this.useralllist[i].status = this.goldmedal[i].status;
this.useralllist[i].addressUserName = this.goldmedal[i].addressUserName;
this.useralllist[i].phoneNumber = this.goldmedal[i].phoneNumber;
this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount;
this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length
this.useralllist[i].lengthnum = this.goldmedal[i].orderDetailList.length;
}
this.useralllist=list
console.log(list);
this.useralllist = list.filter(val=>{
return val != undefined;
});;
},
userfind(item) {
this.paytypeWarning = this.util.checkPaytypeValidated(item.paytype);
this.showPaytypeWarning = !this.paytypeWarning.result;
let user = this.$store.state.userInfo;
if(this.paytypeWarning.result) {
if(item.status==0){
let user = this.userInfo;
if (this.paytypeWarning.result) {
if (item.status == 0) {
_hmt.push([
"_trackCustomEvent",
"order_repay",
'_trackCustomEvent',
'order_repay',
{
"status":"success",
"member_id": user.data.id
status: 'success',
member_id: user.id
}
])
]);
this.getwei(item);
}else{
} else {
this.$router.push({
path: "/myorder/usertion",
path: '/myorder/usertion',
query: {
stype: item.status,
orderNumber: item.orderNumber,
},
orderNumber: item.orderNumber
}
});
}
} else {
_hmt.push([
"_trackCustomEvent",
"order_repay",
'_trackCustomEvent',
'order_repay',
{
"status":"fail",
"member_id": user.data.id
status: 'fail',
member_id: user.id
}
])
]);
}
},
usertwo() {
this.$router.push({
path: "/myorder/userrecord",
path: '/myorder/userrecord',
query: {
stype: 1,
},
stype: 1
}
});
},
},
/* 页面初始化设置数据 */
resetData() {
let stype = this.$route.query.stype;
if (this.userInfo && this.loginState) {
this.indet(this.userdata, stype);
} else {
if (!this.loginState) {
this.$message({
type: 'warning',
message: '请先去登录'
});
}
return;
}
}
}
};
</script>
<style lang="less" scoped>
@import url("../../assets/css/orderquantity.less");
@import url('../../assets/css/orderquantity.less');
</style>

View File

@ -5,19 +5,17 @@
<tabs :crumbs="crumbs"></tabs>
<div class="rc-full-width rc-max-width--xl rc-padding-bottom--lg">
<div class="rc-main">
<div class="rc-center" >
<div class="rc-center">
<van-swipe @change="onChange">
<van-swipe-item v-for="(banner, index) in banners" :key="index">
<img :src="banner.src" class="useraimg"/>
</van-swipe-item>
<van-swipe-item v-for="(banner, index) in banners" :key="index"><img :src="banner.src" class="useraimg" /></van-swipe-item>
</van-swipe>
<!-- <img :src='userimage' /> -->
</div>
<div class="rc-order">
<span>当前等级{{userorder}}</span>
<span>当前等级{{ userorder }}</span>
</div>
<div class="rc-cordd">
<span>距离升级还差:{{ rcvalue }} </span>
<span>距离升级还差:{{ rcvalue }}</span>
<div class="block">
<div class="r-block" ref="userblock"></div>
<!-- <el-slider v-model="value" range show-stops :max="10"> </el-slider> -->
@ -29,13 +27,11 @@
</div>
</div>
<div class="rc-layout-container">
<div class="usermember rc-column" v-for="(item,index) in newlist" :key="index">
<div class="rc-image">
<img :src="item.catimage" alt="" />
</div>
<div class="usermember rc-column" v-for="(item, index) in newlist" :key="index">
<div class="rc-image"><img :src="item.catimage" alt="" /></div>
<div class="rc-userorder">
<em>{{item.title}}</em>
<span>{{item.usereat}}</span>
<em>{{ item.title }}</em>
<span>{{ item.usereat }}</span>
</div>
</div>
</div>
@ -44,267 +40,275 @@
<Myfooter></Myfooter>
</div>
</template>
<script>
import Myheader from '~/components/header.vue'
import Myfooter from '~/components/rc-footer.vue'
import tabs from "~/components/tabs.vue";
import Myheader from '~/components/header.vue';
import Myfooter from '~/components/rc-footer.vue';
import tabs from '~/components/tabs.vue';
import { mapState } from 'vuex';
export default {
data(){
return{
crumbs:[
data() {
return {
crumbs: [
{
path:'/personal/mypersonal',
path: '/personal/mypersonal'
},
{
path:'/personal/usermember/',
path: '/personal/usermember/'
}
],
banners:[
{src:require("../../assets/image/rc-new.png"),link:""},
{src:require("../../assets/image/rc-new1.png"),link:""},
{src:require("../../assets/image/rc-new2.png"),link:""},
banners: [
{ src: require('../../assets/image/rc-new.png'), link: '' },
{ src: require('../../assets/image/rc-new1.png'), link: '' },
{ src: require('../../assets/image/rc-new2.png'), link: '' }
],
userid:null,
userimage:require("../../assets/image/rc-new.png"),
userorder:'新手铲屎官',
rcvalue:5000,
uservalue:0,
usrnewlist:[],
newlist:[
userid: null,
userimage: require('../../assets/image/rc-new.png'),
userorder: '新手铲屎官',
rcvalue: 5000,
uservalue: 0,
usrnewlist: [],
newlist: [
{
title: "产品试吃",
usereat:'每年4次免积分产品试吃',
title: '产品试吃',
usereat: '每年4次免积分产品试吃',
ordernum: 0,
catimage: require("../../assets/image/usereat.png"),
catimage: require('../../assets/image/usereat.png')
},
{
title: "成长工具",
usereat:'365天专属养宠工具',
title: '成长工具',
usereat: '365天专属养宠工具',
ordernum: 1,
catimage: require("../../assets/image/rc-growth.png"),
catimage: require('../../assets/image/rc-growth.png')
},
{
title: "1V1咨询",
usereat:'10年专业团队1v1咨询',
title: '1V1咨询',
usereat: '10年专业团队1v1咨询',
ordernum: 2,
catimage: require("../../assets/image/consult.png"),
catimage: require('../../assets/image/consult.png')
},
{
title: "知识课堂",
usereat:'行业大咖专业养宠知识',
title: '知识课堂',
usereat: '行业大咖专业养宠知识',
ordernum: 3,
catimage: require("../../assets/image/rc-book.png"),
catimage: require('../../assets/image/rc-book.png')
},
{
title: "健康服务",
usereat:'每年积分兑换1次价值288元的免费体检及100元医院绝育券',
title: '健康服务',
usereat: '每年积分兑换1次价值288元的免费体检及100元医院绝育券',
ordernum: 4,
catimage: require("../../assets/image/rc-health.png"),
},
catimage: require('../../assets/image/rc-health.png')
}
],
newlista:[
newlista: [
{
title: "产品试吃",
usereat:'每年4次免积分产品试吃',
title: '产品试吃',
usereat: '每年4次免积分产品试吃',
ordernum: 0,
catimage: require("../../assets/image/usereat.png"),
catimage: require('../../assets/image/usereat.png')
},
{
title: "成长工具",
usereat:'365天专属养宠工具',
title: '成长工具',
usereat: '365天专属养宠工具',
ordernum: 1,
catimage: require("../../assets/image/rc-growth.png"),
catimage: require('../../assets/image/rc-growth.png')
},
{
title: "1V1咨询",
usereat:'10年专业团队1v1咨询',
title: '1V1咨询',
usereat: '10年专业团队1v1咨询',
ordernum: 2,
catimage: require("../../assets/image/consult.png"),
catimage: require('../../assets/image/consult.png')
},
{
title: "知识课堂",
usereat:'行业大咖专业养宠知识',
title: '知识课堂',
usereat: '行业大咖专业养宠知识',
ordernum: 3,
catimage: require("../../assets/image/rc-book.png"),
catimage: require('../../assets/image/rc-book.png')
},
{
title: "健康服务",
usereat:'每年积分兑换1次价值288元的免费体检及100元医院绝育券',
title: '健康服务',
usereat: '每年积分兑换1次价值288元的免费体检及100元医院绝育券',
ordernum: 4,
catimage: require("../../assets/image/rc-health.png"),
},
catimage: require('../../assets/image/rc-health.png')
}
],
senior:[
senior: [
{
title: "会员奖励",
usereat:'专属升级奖励',
title: '会员奖励',
usereat: '专属升级奖励',
ordernum: 0,
catimage: require("../../assets/image/rc-win.png"),
catimage: require('../../assets/image/rc-win.png')
},
{
title: "产品试吃",
usereat:'每年4次免积分产品试吃',
title: '产品试吃',
usereat: '每年4次免积分产品试吃',
ordernum: 0,
catimage: require("../../assets/image/usereat.png"),
catimage: require('../../assets/image/usereat.png')
},
{
title: "成长工具",
usereat:'365天专属养宠工具',
title: '成长工具',
usereat: '365天专属养宠工具',
ordernum: 1,
catimage: require("../../assets/image/rc-growth.png"),
catimage: require('../../assets/image/rc-growth.png')
},
{
title: "1V1咨询",
usereat:'10年专业团队1v1咨询',
title: '1V1咨询',
usereat: '10年专业团队1v1咨询',
ordernum: 2,
catimage: require("../../assets/image/consult.png"),
catimage: require('../../assets/image/consult.png')
},
{
title: "知识课堂",
usereat:'行业大咖专业养宠知识',
title: '知识课堂',
usereat: '行业大咖专业养宠知识',
ordernum: 3,
catimage: require("../../assets/image/rc-book.png"),
catimage: require('../../assets/image/rc-book.png')
},
{
title: "专属定制",
usereat:'爱宠生活定制活动高级养宠宝典',
title: '专属定制',
usereat: '爱宠生活定制活动高级养宠宝典',
ordernum: 3,
catimage: require("../../assets/image/userself.png"),
catimage: require('../../assets/image/userself.png')
},
{
title: "健康服务",
usereat:'每年积分兑换1次价值288元的免费体检及100元医院绝育券',
title: '健康服务',
usereat: '每年积分兑换1次价值288元的免费体检及100元医院绝育券',
ordernum: 4,
catimage: require("../../assets/image/rc-health.png"),
},
catimage: require('../../assets/image/rc-health.png')
}
],
goldmedal :[
goldmedal: [
{
title: "会员奖励",
usereat:'专属升级奖励',
title: '会员奖励',
usereat: '专属升级奖励',
ordernum: 0,
catimage: require("../../assets/image/rc-win.png"),
catimage: require('../../assets/image/rc-win.png')
},
{
title: "产品试吃",
usereat:'每年4次免积分产品试吃',
title: '产品试吃',
usereat: '每年4次免积分产品试吃',
ordernum: 0,
catimage: require("../../assets/image/usereat.png"),
catimage: require('../../assets/image/usereat.png')
},
{
title: "产品包邮",
usereat:'尊享订单免邮服务(指点商品)',
title: '产品包邮',
usereat: '尊享订单免邮服务(指点商品)',
ordernum: 0,
catimage: require("../../assets/image/usercar.png"),
catimage: require('../../assets/image/usercar.png')
},
{
title: "成长工具",
usereat:'365天专属养宠工具',
title: '成长工具',
usereat: '365天专属养宠工具',
ordernum: 1,
catimage: require("../../assets/image/rc-growth.png"),
catimage: require('../../assets/image/rc-growth.png')
},
{
title: "1V1咨询",
usereat:'10年专业团队1v1咨询',
title: '1V1咨询',
usereat: '10年专业团队1v1咨询',
ordernum: 2,
catimage: require("../../assets/image/consult.png"),
catimage: require('../../assets/image/consult.png')
},
{
title: "知识课堂",
usereat:'行业大咖专业养宠知识',
title: '知识课堂',
usereat: '行业大咖专业养宠知识',
ordernum: 3,
catimage: require("../../assets/image/rc-book.png"),
catimage: require('../../assets/image/rc-book.png')
},
{
title: "专属定制",
usereat:'爱宠生活定制活动高级养宠宝典',
title: '专属定制',
usereat: '爱宠生活定制活动高级养宠宝典',
ordernum: 3,
catimage: require("../../assets/image/userself.png"),
catimage: require('../../assets/image/userself.png')
},
{
title: "健康服务",
usereat:'每年积分兑换1次价值288元的免费体检及100元医院绝育券',
title: '健康服务',
usereat: '每年积分兑换1次价值288元的免费体检及100元医院绝育券',
ordernum: 4,
catimage: require("../../assets/image/rc-health.png"),
},
catimage: require('../../assets/image/rc-health.png')
}
]
}
},
methods:{
onChange(index){
};
},
methods: {
onChange(index) {
console.log(index);
if(index==0){
this.newlist=this.newlista;
}else if(index==1){
this.newlist=this.senior
}else if(index==2){
this.newlist=this.goldmedal
if (index == 0) {
this.newlist = this.newlista;
} else if (index == 1) {
this.newlist = this.senior;
} else if (index == 2) {
this.newlist = this.goldmedal;
}
console.log(this.newlist)
}
},
components:{
Myheader,
Myfooter,
tabs
},
mounted(){
console.log(this.$refs.userblock);
let userwidth=0;
let user= JSON.parse(localStorage.getItem("userInfo"));
if(user!==null){
this.userid=user.data;
let userlength=this.userid.availiblePoint.toString().length;
console.log(this.newlist);
},
initData(){
let userwidth = 0;
// let user = JSON.parse(localStorage.getItem('userInfo'));
let user = this.userInfo;
console.log('33=',user);
if (user !== null) {
this.userid = user;
let userlength = this.userid.availiblePoint.toString().length;
console.log(this.userid.availiblePoint);
if(this.userid.memberLevel==1){
this.userimage=require('../../assets/image/rc-new.png');
this.userorder='新手铲屎官';
this.newlist=this.newlista;
this.uservalue=5000; //
this.rcvalue=this.uservalue-this.userid.availiblePoint; //
if(userlength==1||userlength==2||userlength==3||userlength==4){
userwidth=this.userid.availiblePoint/100
if (this.userid.memberLevel == 1) {
this.userimage = require('../../assets/image/rc-new.png');
this.userorder = '新手铲屎官';
this.newlist = this.newlista;
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);
}
console.log(userwidth)
}else if( this.userid.memberLevel==2){
this.userimage=require('../../assets/image/rc-new2.png');
this.userorder='资深铲屎官';
this.newlist=this.senior
this.uservalue=10000;
this.rcvalue=this.uservalue-this.userid.availiblePoint;
userwidth=this.userid.availiblePoint/100
console.log('---2222')
}else if( this.userid.memberLevel==3){
this.userimage=require('../../assets/image/rc-new1.png');
this.userorder='金牌铲屎官';
this.newlist=this.goldmedal;
userwidth=100
console.log(userwidth);
} else if (this.userid.memberLevel == 2) {
this.userimage = require('../../assets/image/rc-new2.png');
this.userorder = '资深铲屎官';
this.newlist = this.senior;
this.uservalue = 10000;
this.rcvalue = this.uservalue - this.userid.availiblePoint;
userwidth = this.userid.availiblePoint / 100;
console.log('---2222');
} else if (this.userid.memberLevel == 3) {
this.userimage = require('../../assets/image/rc-new1.png');
this.userorder = '金牌铲屎官';
this.newlist = this.goldmedal;
userwidth = 100;
}
this.$refs.userblock.style.width=userwidth+'%'
}else{
this.$refs.userblock.style.width = userwidth + '%';
} else {
console.log('---');
this.userid=[];
this.userid = [];
}
}
}
}
},
components: {
Myheader,
Myfooter,
tabs
},
computed:{
...mapState({
userInfo : state => state.user.userInfo,
})
},
mounted() {
console.log(this.$refs.userblock);
this.initData();
},
watch: {
userInfo(newVal){
if(newVal){
this.initData();
}
}
}
};
</script>
<style lang="less" scoped>
@import url("../../assets/css/usermember.less");
@import url('../../assets/css/usermember.less');
</style>

View File

@ -6,9 +6,7 @@
<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="sucess_img"><img src="../../assets/image/usersucess.png" alt="" /></li>
<li class="ready">
<p>订单提交成功</p>
<p>等待付款</p>
@ -29,9 +27,7 @@
</el-row>
</div>
<div class="rc_contline"></div>
<div class="cont_modules">
<div class="pay_title color_red">请选择支付方式</div>
</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">
@ -42,9 +38,8 @@
:key="index"
@click="selectGoods(item, index)"
:class="activeIndex == index ? 'active' : ''"
v-if="(!disableAlipay || (disableAlipay && item.type!='alipay'))"
v-if="!disableAlipay || (disableAlipay && item.type != 'alipay')"
>
<div style="display:flex;">
<img :src="item.payimage" alt="" />
<span>{{ item.paytype }}支付</span>
@ -54,12 +49,7 @@
</div>
</div>
<div class="payconfirm rc-padding-y--md" v-if="disableQrcode">
<span class="ts-standard-btn ts-standard-btn--two center" @click="goPayH5">
确认支付
</span>
</div>
<div class="payconfirm rc-padding-y--md" v-if="disableQrcode"><span class="ts-standard-btn ts-standard-btn--two center" @click="goPayH5">确认支付</span></div>
<div class="paycord" v-if="!disableQrcode">
<div class="qrcode"><vue-qr :text="qrtext" :size="260"></vue-qr></div>
@ -68,17 +58,13 @@
<el-dialog :visible.sync="dialogSuccess" @close="closeDialogSuccess">
<div class="tc dl_cont">
<div class="dl_img">
<img src="../../assets/image/usersucess.png" alt="" />
</div>
<div class="dl_img"><img src="../../assets/image/usersucess.png" alt="" /></div>
<h3 class="title">支付成功</h3>
<p>您的商品我们正在抓紧打包请耐心等候</p>
<div class="rc-md-up">
<div class="line_dashed"></div>
<div class="userer">
<div class="qrcode">
<img src="/images/qrcode-wxgroup.jpg">
</div>
<div class="qrcode"><img src="/images/qrcode-wxgroup.jpg" /></div>
<p>微信扫一扫识别二维码</p>
<p class="tips">加入社群0元试用商品随单发放</p>
</div>
@ -91,82 +77,76 @@
</el-dialog>
<el-dialog :visible.sync="dialogFail" @close="closeDialogFail">
<div class="tc dl_cont">
<div class="dl_img">
<img src="../../assets/pay/fail.png" alt="" />
</div>
<div class="dl_img"><img src="../../assets/pay/fail.png" alt="" /></div>
<h3 class="title">支付失败</h3>
<p>请返回商品结算页面重新支付</p>
</div>
</el-dialog>
<div style="display:none" ref="h5SubmitForm">
</div>
<div style="display:none" ref="h5SubmitForm"></div>
</div>
</template>
<script>
import Myheader from "~/components/header.vue";
import tabs from "@/components/tabs.vue";
import vueQr from 'vue-qr'
import { mapMutations } from "vuex";
import { generateOrderAlipay, updateOrderWX, monitorOrderNotify,repayOrde } from "../../ajax/getData";
import util from "@/ajax/util";
import Myheader from '~/components/header.vue';
import tabs from '@/components/tabs.vue';
import vueQr from 'vue-qr';
import { mapMutations } from 'vuex';
import { mapState } from 'vuex';
import { generateOrderAlipay, updateOrderWX, monitorOrderNotify, repayOrde } from '../../ajax/getData';
import util from '@/ajax/util';
export default {
data() {
return {
util,
activeIndex: 0,
paymentTimer:undefined,
paymentTimer: undefined,
isSucess: false,
h5PayUrl:"",
h5PayUrl: '',
dialogSuccess: false,
paytype: "微信",
paytype: '微信',
userpaystype: [
{
paytype: "微信",
payimage: require("../../assets/pay/wx.png"),
type:'wechat'
paytype: '微信',
payimage: require('../../assets/pay/wx.png'),
type: 'wechat'
},
{
paytype: "支付宝",
payimage: require("../../assets/pay/zfb.png"),
type:'alipay'
},
paytype: '支付宝',
payimage: require('../../assets/pay/zfb.png'),
type: 'alipay'
}
],
dialogFail: false,
userPayData: {},
qrtext:'',
userData:'',
disableAlipay:true,
disableQrcode:false,
qrtext: '',
userData: '',
disableAlipay: true,
disableQrcode: false
};
},
created(){
},
created() {},
mounted() {
let isWx = this.util.isWX();
if(!isWx) {
if (!isWx) {
//this.disableAlipay = false; //Disabled due to 0 deposit quota
}
let stype=this.$route.query.stype;
let stype = this.$route.query.stype;
this.userPayData = JSON.parse(this.$route.query.userPayData);
this.defaultHandlePayment();
},
methods: {
...mapMutations(["checkIsLogin"]),
detectQrcodeDisplay(){
...mapMutations(['checkIsLogin']),
detectQrcodeDisplay() {
let payType = this.util.pickPaytype();
switch(payType) {
switch (payType) {
case 1:
this.disableQrcode=false;
this.disableQrcode = false;
break;
case 2:
this.disableQrcode=true;
this.disableQrcode = true;
break;
case 3:
//TODO raise WX jsapi pay
@ -177,55 +157,55 @@ export default {
let isMobile = this.util.isMobile();
let isWx = this.util.isWX();
let payType = this.util.pickPaytype();
if(!this.userPayData.wxPay || this.userPayData.wxPay.length<4)
throw new Error("订单信息错误,请删除商品后再次购买");
if (!this.userPayData.wxPay || this.userPayData.wxPay.length < 4) throw new Error('订单信息错误,请删除商品后再次购买');
this.detectQrcodeDisplay();
//Dictionary : 1: scan qrcode, 2:redirect 3: raise local app
switch(payType) {
switch (payType) {
case 1:
this.qrtext=this.userPayData.wxPay;
this.qrtext = this.userPayData.wxPay;
this.updateOrderNotification();
break;
case 2:
this.$refs["h5SubmitForm"].innerHTML = '<form action="'+this.userPayData.wxPay+'" method="post"><form>';
this.$refs['h5SubmitForm'].innerHTML = '<form action="' + this.userPayData.wxPay + '" method="post"><form>';
break;
case 3:
//TODO raise WX jsapi pay
break;
}
this.checkIsLogin();
let user = this.$store.state.userInfo;
// let user = this.$store.state.userInfo;
let memberId = '';
if(user)
memberId = user.data.id;
_hmt.push([
"_trackCustomEvent",
"payment",
{
"member_id": memberId,
"payType" : payType,
"product_amount" : this.userPayData.userprice,
if (this.userInfo){
memberId = this.userInfo.id;
}
])
_hmt.push([
'_trackCustomEvent',
'payment',
{
member_id: memberId,
payType: payType,
product_amount: this.userPayData.userprice
}
]);
},
goPayH5() {
if(this.userPayData.wxPay) {
if (this.userPayData.wxPay) {
//this.$refs["h5SubmitForm"].action="http://47.96.75.242:10086/royalcanin/royalcanin/redirectUrlWXH5";
//this.$refs["h5SubmitForm"].action=this.userPayData.wxPay;
this.$refs["h5SubmitForm"].children[0].submit()
this.$refs['h5SubmitForm'].children[0].submit();
//window.location.href=this.userPayData.wxPay;
//this.disableQrcode=true;
} else {
throw new Error("订单信息错误,请删除商品后再次购买");
throw new Error('订单信息错误,请删除商品后再次购买');
}
},
closeDialogSuccess() {
this.qrtext = '';
this.$router.push({
path: "/myorder/usertion",
query:{
stype:1,
orderNumber:this.userPayData.orderId
path: '/myorder/usertion',
query: {
stype: 1,
orderNumber: this.userPayData.orderId
}
});
},
@ -237,15 +217,15 @@ export default {
},
toMiniShop() {
_hmt.push([
"_trackCustomEvent",
"jump_to_crmMiniApp",
'_trackCustomEvent',
'jump_to_crmMiniApp',
{
"type": "finish_payment"
type: 'finish_payment'
}
])
setTimeout(function(){
window.location.href="https://miniapp-product.royalcanin.com.cn/rcmini2020/admin/Voucher/urlRedirect.html";
},800);
]);
setTimeout(function() {
window.location.href = 'https://miniapp-product.royalcanin.com.cn/rcmini2020/admin/Voucher/urlRedirect.html';
}, 800);
},
async selectGoods(item, index) {
this.activeIndex = index;
@ -253,18 +233,18 @@ export default {
if (index == 1) {
//
let isMobile = this.util.isMobile();
isMobile = (isMobile?2:1);
isMobile = isMobile ? 2 : 1;
let res = await generateOrderAlipay(this.userPayData.orderId, isMobile);
if (res.success) {
this.disableQrcode = true;
let virtualForm = res.data;
virtualForm = virtualForm.substr(0,virtualForm.indexOf("</form>")+7);
this.$refs["h5SubmitForm"].innerHTML = virtualForm;
virtualForm = virtualForm.substr(0, virtualForm.indexOf('</form>') + 7);
this.$refs['h5SubmitForm'].innerHTML = virtualForm;
}
} else {
this.userPayData = JSON.parse(this.$route.query.userPayData);
this.qrtext=this.userPayData.wxPay;
this.$refs["h5SubmitForm"].innerHTML = '<form method="get" action="'+this.userPayData.wxPay+'"></form>';
this.qrtext = this.userPayData.wxPay;
this.$refs['h5SubmitForm'].innerHTML = '<form method="get" action="' + this.userPayData.wxPay + '"></form>';
this.detectQrcodeDisplay();
}
},
@ -275,40 +255,45 @@ export default {
if (res.success) {
this.qrtext = '成功加入群的二维码';
this.dialogSuccess = true;
let user = this.$store.state.userInfo;
// let user = this.$store.state.userInfo;
let memberId = '';
if(user)
memberId = user.data.id;
_hmt.push([
"_trackCustomEvent",
"payment_finished",
{
"member_id" : memberId,
"payType" : 'native',
"product_amount" : this.userPayData.userprice,
if(this.userInfo){
memberId = this.userInfo.id;
}
])
// if (user) memberId = user.data.id;
_hmt.push([
'_trackCustomEvent',
'payment_finished',
{
member_id: memberId,
payType: 'native',
product_amount: this.userPayData.userprice
}
]);
} else if (res.fail) {
this.dialogFail = true;
} else {
let _self = this;
this.paymentTimer = setTimeout(function(){
_self.updateOrderNotification()
},5000);
this.paymentTimer = setTimeout(function() {
_self.updateOrderNotification();
}, 5000);
}
}
},
components: {
Myheader,
tabs,
vueQr,
vueQr
},
computed: {
...mapState({
userInfo : state => state.user.userInfo,
})
}
};
</script>
<style lang="less" scoped >
<style lang="less" scoped>
.sucess_img {
width: 96px;
height: 96px;
@ -359,7 +344,7 @@ export default {
}
}
&::after {
content: "";
content: '';
display: block;
clear: both;
}
@ -408,11 +393,11 @@ export default {
}
}
@media screen and (max-width: 768px) {
.payconfirm{
position:fixed;
bottom:0;
left:0;
width:100%;
.payconfirm {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
}
.ph_hidden {

View File

@ -1,7 +1,8 @@
<template>
<div>
<div class="user">
<Myheader></Myheader>
<div class="user">
<div class="rc-top"></div>
<tabs :crumbs="crumbs"></tabs>
<div class="online rc-margin--none" id="fixed-catbar-seperator"></div>
@ -17,17 +18,13 @@
>
<div class="rc-column">
<div data-js-carousel="" data-image-gallery="true">
<div
class="rc-carousel rc-carousel__gallery-image"
data-zoom-container="328b2e5f-6904-4cac-9709-51ed18d2500f"
data-zoom-factor="2"
>
<div class="rc-carousel rc-carousel__gallery-image" data-zoom-container="328b2e5f-6904-4cac-9709-51ed18d2500f" data-zoom-factor="2">
<!-- Big images-->
<div v-for="(item, index) in productAttachmentList" :key="index">
<div>
<img v-if="(item.attachmentPath.indexOf('mp4')<0)" :src="item.attachmentPath" />
<video v-if="(item.attachmentPath.indexOf('mp4')>0)" preload="meta" controls="controls">
<source :src= item.attachmentPath type="video/mp4">
<img v-if="item.attachmentPath.indexOf('mp4') < 0" :src="item.attachmentPath" />
<video v-if="item.attachmentPath.indexOf('mp4') > 0" preload="meta" controls="controls">
<source :src="item.attachmentPath" type="video/mp4" />
</video>
</div>
</div>
@ -51,8 +48,8 @@
:key="index"
>
<div class="rc-img--square">
<img :src="item.attachmentPath" v-if="(item.attachmentPath.indexOf('mp4')<0)" />
<img src="/images/default.jpg" class="ts-video-btn" v-if="(item.attachmentPath.indexOf('mp4')>0)" />
<img :src="item.attachmentPath" v-if="item.attachmentPath.indexOf('mp4') < 0" />
<img src="/images/default.jpg" class="ts-video-btn" v-if="item.attachmentPath.indexOf('mp4') > 0" />
</div>
</div>
<!-- <div class="rc-carousel__gallery-thumbnail">
@ -85,15 +82,12 @@
</div>
</div>
<div
class="ts-product-header rc-column"
id="328b2e5f-6904-4cac-9709-51ed18d2500f"
>
<div class="ts-product-header rc-column" id="328b2e5f-6904-4cac-9709-51ed18d2500f">
<div class="usermain">
<div class="online bold rc-md-down"></div>
<div class="rc-main">
<div class="rc-title">
<h2>{{ curItem.brandName + " " + curItem.productName }}</h2>
<h2>{{ curItem.brandName + ' ' + curItem.productName }}</h2>
</div>
</div>
<div class="online rc-md-down"></div>
@ -106,21 +100,18 @@
<div class="rc-productdetail" v-if="!userbuy">
<i class="ts-row-title">所属分类</i>
<span>{{ curItem.categoryName }}</span>
</div>
<div class="rc-button" v-if="!userbuy && curItem.curGoodUrl && curItem.curGoodUrl.length>5">
<div class="rc-button" v-if="!userbuy && curItem.curGoodUrl && curItem.curGoodUrl.length > 5">
<a @click="goBuyRxgoods(curItem)" class="ts-standard-btn">立即购买</a>
</div>
<div class="rc-productdetail" v-if="userbuy">
<i class="ts-row-title">商品价格</i>
<span class="ts-realprice">{{ curItem.ecPrice }}</span>
<s class="ts-ecprice" v-if="curItem.ecPrice<curItem.rsp"
>{{ curItem.rsp }}
</s>
<span class="ts-record" v-if="(curItem.basePoint && curItem.basePoint!==0)">
购买该商品你将获得<span class="rc-zeta">{{curItem.basePoint}}积分</span>
<s class="ts-ecprice" v-if="curItem.ecPrice < curItem.rsp">{{ curItem.rsp }}</s>
<span class="ts-record" v-if="curItem.basePoint && curItem.basePoint !== 0">
购买该商品你将获得
<span class="rc-zeta">{{ curItem.basePoint }}积分</span>
</span>
<!-- <span class="rc-title">购买该商品你将得到22积分</span> -->
@ -135,18 +126,19 @@
</div>
</div>
<div class="online bold rc-md-down"></div>
<div class="rc-main rc-md-up" v-if="userbuy">
<div class="online"></div>
</div>
<div class="rc-main rc-md-up" v-if="userbuy"><div class="online"></div></div>
<div class="rc-productdeta" v-if="userbuy">
<div class="rc-main">
<div class="rc-prodtop">
<div>
<i class="ts-row-title">商品规格</i>
</div>
<div><i class="ts-row-title">商品规格</i></div>
<div class="ts-tag-list">
<em v-for="(item, index) in newlist" :key="index" @click="selectsearch(item, index)" :class="[(activeIndexa==index && item.leftAllotment>0)?'active':'unactive',item.leftAllotment>0?'':'disabled']">
<em
v-for="(item, index) in newlist"
:key="index"
@click="selectsearch(item, index)"
:class="[activeIndexa == index && item.leftAllotment > 0 ? 'active' : 'unactive', item.leftAllotment > 0 ? '' : 'disabled']"
>
{{ item.specifications }}
</em>
</div>
@ -158,103 +150,79 @@
</div>
</div>
<div class="rc-main">
<div class="rc-produnnum" v-if="(userbuy && curItem.leftAllotment>0)">
<div class="rc-produnnum" v-if="userbuy && curItem.leftAllotment > 0">
<div><i class="ts-row-title">商品数量</i></div>
<img
src="../../assets/image/userjian.png"
alt=""
@click="sub()"
/>
<img src="../../assets/image/userjian.png" alt="" @click="sub()" />
<strong>{{ sales_num }}</strong>
<img
src="../../assets/image/userjia.png"
alt=""
@click="plus()"
/>
<img src="../../assets/image/userjia.png" alt="" @click="plus()" />
</div>
</div>
<div class="rc-main rc-md-up" v-if="userbuy">
<div class="online"></div>
</div>
<div class="rc-main rc-md-up" v-if="userbuy"><div class="online"></div></div>
<div class="online rc-md-down"></div>
<div class="rc-main">
<div class="certification">
<ul>
<li>
<span
><i class="ts-row-title">服务说明</i
><i
>当天14点前完成付款即日安排发货;当天14点后完成付款次日安排发货(周日及国家法定节假日顺延至下一个工作日发货,活动期间发货或有延迟敬请理解)</i
></span
>
<span>
<i class="ts-row-title">服务说明</i>
<i>
当天14点前完成付款即日安排发货;当天14点后完成付款次日安排发货(周日及国家法定节假日顺延至下一个工作日发货,活动期间发货或有延迟敬请理解)
</i>
</span>
</li>
<li>
<span
><i class="ts-row-title">商品运费</i
><i>全场包邮(港澳除外)</i></span
>
<span>
<i class="ts-row-title">商品运费</i>
<i>全场包邮(港澳除外)</i>
</span>
</li>
<li>
<span
><i class="ts-row-title">商品编号</i
><i>{{ curItem.productCode }}</i></span
>
<span>
<i class="ts-row-title">商品编号</i>
<i>{{ curItem.productCode }}</i>
</span>
</li>
</ul>
</div>
<div class="rc-button" v-if="(userbuy && curItem.leftAllotment>0)">
<div class="rc-button" v-if="userbuy && curItem.leftAllotment > 0">
<span @click="usertanchu(curItem, 0)">加入购物车</span>
<span @click="usertanchu(curItem, 1)">立即购买</span>
</div>
</div>
<div class="online bold rc-md-down"></div>
</div>
</div>
</div>
</div>
<div class="rc-footimage rc-padding--sm rc-max-width--lg">
<img :src="curItem.showImgFile" alt="" />
</div>
<div class="rc-footimage rc-padding--sm rc-max-width--lg"><img :src="curItem.showImgFile" alt="" /></div>
<FixRight></FixRight>
<Myfooter v-on:litentop="showmesg"></Myfooter>
</div>
<el-dialog :visible.sync="dialogInfo1" @close="userclose" class="pop_coupon" :close-on-click-modal="false">
<div class="ts-no-data" v-if="usernewlist.length<=0">目前还没有可用的优惠券</div>
<div class="ts-no-data" v-if="usernewlist.length <= 0">目前还没有可用的优惠券</div>
<div class="rs-dis">
<div
class="rc-discount"
v-for="(item, index) in usernewlist"
:key="index"
>
<div class="rc-discount" v-for="(item, index) in usernewlist" :key="index">
<img :src="userimage" alt="" />
<div class="rc-contair">
<div class="rc-left">
<div>
<i v-if="(item.couponTypeId!='4' && item.couponAmount>0)">
</i>
<i v-if="item.couponTypeId != '4' && item.couponAmount > 0"></i>
<span>
<!-- 不合并 因为0.1计算器不是0.1 -->
{{ item.couponAmount?item.couponAmount:(parseInt(10 - item.discount*10)+'折') }}
{{ item.couponAmount ? item.couponAmount : parseInt(10 - item.discount * 10) + '折' }}
</span>
</div>
<strong>{{ item.couponName }}</strong>
</div>
<div class="rc-right">
<i>
{{ item.couponName }}
</i>
<div class="rc-userfont" :style="(item.validTo?'visibility:visible':'visibility:hidden')">
<i>{{ item.couponName }}</i>
<div class="rc-userfont" :style="item.validTo ? 'visibility:visible' : 'visibility:hidden'">
<strong>有效期</strong>
<span>{{item.validFrom}}</span>
<em>{{item.validTo}}</em>
</div>
<div class="rc-footer">
<span @click="usergetconf(item)">立即领取</span>
<span>{{ item.validFrom }}</span>
<em>{{ item.validTo }}</em>
</div>
<div class="rc-footer"><span @click="usergetconf(item)">立即领取</span></div>
</div>
</div>
</div>
@ -262,69 +230,54 @@
</el-dialog>
<el-dialog :visible.sync="dialogInfo2" @close="userclose" :close-on-click-modal="false">
<div class="rc-headera">
<div class="rc-title">
<img src="../../assets/error.png" alt="" />
</div>
<div class="rc-title"><img src="../../assets/error.png" alt="" /></div>
<div class="rc-logmain">
<h3>温馨提示</h3>
<span>请先点击下方进行登录/注册</span>
</div>
<nuxt-link :to="`/userlogin/login/`">
<div class="userer">
<span>立即登录</span>
</div>
<div class="userer"><span>立即登录</span></div>
</nuxt-link>
</div>
</el-dialog>
<div class="rc-button rc-md-down" v-if="(userbuy && curItem.leftAllotment>0)">
<div class="rc-button rc-md-down" v-if="userbuy && curItem.leftAllotment > 0">
<span @click="usertanchu(curItem, 0)">加入购物车</span>
<span @click="usertanchu(curItem, 1)">立即购买</span>
</div>
<div class="rc-button rc-md-down " v-if="!userbuy && curItem.goodUrl && curItem.goodUrl.length>5">
<div class="rc-button rc-md-down " v-if="!userbuy && curItem.goodUrl && curItem.goodUrl.length > 5">
<a @click="goBuyRxgoods(curItem)" class="ts-standard-btn">立即购买</a>
</div>
</div>
</template>
<script>
import Myheader from "~/components/header.vue";
import tabs from "@/components/tabs.vue";
import FixRight from "~/components/fixed-right.vue";
import unlogin from "~/components/unlogin.vue";
import Myfooter from "~/components/rc-footer.vue";
import { mapMutations } from "vuex";
import util from "@/ajax/util";
const settings = require("@/config");
import {
goodsmessage,
getConfig,
postCourseId,
getdraw,
alldiscount,
oncequery,
biaomessage,
productQuery
} from "../../ajax/getData";
import Myheader from '~/components/header.vue';
import tabs from '@/components/tabs.vue';
import FixRight from '~/components/fixed-right.vue';
import unlogin from '~/components/unlogin.vue';
import Myfooter from '~/components/rc-footer.vue';
import { mapMutations,mapState } from 'vuex';
import util from '@/ajax/util';
const settings = require('@/config');
import { goodsmessage, getConfig, postCourseId, getdraw, alldiscount, oncequery, biaomessage, productQuery } from '../../ajax/getData';
export default {
async asyncData (context) {
async asyncData(context) {
let isRxGoods = context.route.query.isRxGoods;
let userbuy = true;
let newlist = [];
let curItem = {};
let videolist=[];
let videolist = [];
let productAttachmentList = [];
let userlistmenu = [];
isRxGoods = (isRxGoods == '1'?true:false);
isRxGoods = isRxGoods == '1' ? true : false;
let mainProduct = undefined;
let mainProductCode = context.route.query.mainProductCode;
let productCode = context.route.query.productCode;
let activeIndexa = 0;
if(!productCode || productCode.length<=0)
throw new Error('Empty product code');
productCode = productCode.split(",");
if(isRxGoods){
if (!productCode || productCode.length <= 0) throw new Error('Empty product code');
productCode = productCode.split(',');
if (isRxGoods) {
let data = await oncequery(mainProductCode);
let outputObj = {};
if (data) {
@ -333,44 +286,41 @@ export default {
newlist = [outputObj];
curItem = outputObj;
}
let insertTmpObj = {id:1, attachmentType:1, sort:1, attachmentPath:newlist[0].picture};
let insertTmpObj = { id: 1, attachmentType: 1, sort: 1, attachmentPath: newlist[0].picture };
productAttachmentList = [insertTmpObj];
userbuy = false;
} else {
if(mainProductCode && mainProductCode.length>2) {
if (mainProductCode && mainProductCode.length > 2) {
mainProduct = await productQuery(mainProductCode);
mainProduct = mainProduct.pop();
}
let stopLeftAllotmentChecking = false;
let stopIndex = 0;
for(let singleCode of productCode) {
for (let singleCode of productCode) {
let data = await goodsmessage(singleCode);
if (data && data.length>0) {
if (data && data.length > 0) {
newlist.push(data[0]);
if(data[0].leftAllotment>0 && !stopLeftAllotmentChecking) {
if (data[0].leftAllotment > 0 && !stopLeftAllotmentChecking) {
activeIndexa = stopIndex;
curItem = data[0];
stopLeftAllotmentChecking=true;
stopLeftAllotmentChecking = true;
}
stopIndex++;
}
}
if(curItem.productAttachmentList != undefined)
productAttachmentList = curItem.productAttachmentList;
let list=[];
if(curItem.productName == undefined)
curItem = newlist[0];
if (curItem.productAttachmentList != undefined) productAttachmentList = curItem.productAttachmentList;
let list = [];
if (curItem.productName == undefined) curItem = newlist[0];
userbuy = true;
}
if(!curItem || curItem.productName == undefined)
throw new Error("商品信息错误");
if (!curItem || curItem.productName == undefined) throw new Error('商品信息错误');
let crumbs = [
{
path:'/productdetails/productlist/',
path: '/productdetails/productlist/'
},
{
title: curItem.productName,
title: curItem.productName
}
];
return {
@ -383,27 +333,27 @@ export default {
userbuy,
isRxGoods,
mainProduct
}
};
},
data() {
return {
util,
tableLabelTest: [],
userimage: require("../../assets/image/unused.png"),
userimage: require('../../assets/image/unused.png'),
gotop: false,
dialogInfo1: false,
videolist:[],
videoimg:'',
videolist: [],
videoimg: '',
name: [],
userlist: [],
drawlist: [], //
alldraw: [],
userlistmenu: [],
msg: [""],
parent_msg: [""],
msg: [''],
parent_msg: [''],
usermessage: [],
dialogInfo2: false,
productCode: "", //code
productCode: '', //code
productlist: [],
userbuy: true,
sales_num: 1,
@ -411,42 +361,42 @@ export default {
productAttachmentList: [],
usernewlist: [
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
catimage: require("../../assets/image/unused.png"),
price: '30',
pricestype: '新客优惠券',
special: '全场每满299-30',
period: '有效期',
starttime: '2021.11.29-2022.01.28',
catimage: require('../../assets/image/unused.png')
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
catimage: require("../../assets/image/unused.png"),
},
price: '30',
pricestype: '新客优惠券',
special: '全场每满299-30',
period: '有效期',
starttime: '2021.11.29-2022.01.28',
catimage: require('../../assets/image/unused.png')
}
],
newlist: [
{
price: "167.00",
pricestype: "英国短毛猫成猫全价湿粮",
special: "限时折扣全场商品8折",
period: "今晚20:00前付款明日12:00前发货",
starttime: "商品未满199元 快递费:9.00元",
shangbianhao: "6212263798102432",
catimage: require("../../assets/image/rc-new.png"),
},
price: '167.00',
pricestype: '英国短毛猫成猫全价湿粮',
special: '限时折扣全场商品8折',
period: '今晚20:00前付款明日12:00前发货',
starttime: '商品未满199元 快递费:9.00元',
shangbianhao: '6212263798102432',
catimage: require('../../assets/image/rc-new.png')
}
],
stype: [
{
title: "3kg",
title: '3kg'
},
{
title: "5kg",
},
],
title: '5kg'
}
]
};
},
@ -464,73 +414,71 @@ export default {
mounted() {
this.checkIsLogin();
// console.log(this.curItem);
if(this.isRxGoods) {
if (this.isRxGoods) {
let isMobile = this.util.isMobile();
this.curItem.goodUrl = JSON.parse(this.curItem.goodUrl);
if(isMobile)
this.curItem.curGoodUrl = this.curItem.goodUrl.mobile;
else
this.curItem.curGoodUrl = this.curItem.goodUrl.pc;
if (isMobile) this.curItem.curGoodUrl = this.curItem.goodUrl.mobile;
else this.curItem.curGoodUrl = this.curItem.goodUrl.pc;
}
this.usermessage = this.$store.state.userInfo;
this.usermessage = this.userInfo;
//if (this.usermessage !== "" || this.usermessage.data !== undefined) {
this.productCode = this.$route.query.productCode;
_hmt.push([
"_trackCustomEvent",
"product_visit",
'_trackCustomEvent',
'product_visit',
{
"product_id":this.curItem.productCode,
"product_category":this.curItem.categoryName,
"product_name": this.curItem.productName,
product_id: this.curItem.productCode,
product_category: this.curItem.categoryName,
product_name: this.curItem.productName
}
])
]);
//}
},
methods: {
...mapMutations(["changemessage","checkIsLogin"]),
...mapMutations(['changemessage', 'checkIsLogin']),
showmesg() {
this.toTop();
},
//
usergetconf(item) {
let memberId = '';
if (this.usermessage.data !== "" || this.usermessage.data !== undefined) {
this.getconf(this.usermessage.data.id, item.couponId);
memberId = this.usermessage.data.id;
if (this.usermessage !== '' || this.usermessage !== undefined) {
this.getconf(this.usermessage.id, item.couponId);
memberId = this.usermessage.id;
}
_hmt.push([
"_trackCustomEvent",
"get_coupon",
'_trackCustomEvent',
'get_coupon',
{
"product_id":this.curItem.productCode,
"product_category":this.curItem.categoryName,
"product_name": this.curItem.productName,
"product_quantity" : this.sales_num,
"product_amount" : this.sales_num*this.curItem.ecPrice,
"member_id" : memberId
product_id: this.curItem.productCode,
product_category: this.curItem.categoryName,
product_name: this.curItem.productName,
product_quantity: this.sales_num,
product_amount: this.sales_num * this.curItem.ecPrice,
member_id: memberId
}
])
]);
},
goBuyRxgoods() {
this.checkIsLogin();
let _self = this;
let memberId = '';
if (this.$store.state.userInfo && this.$store.state.userInfo.data !== undefined) {
memberId = this.$store.state.userInfo.data.id;
if (this.userInfo) {
memberId = this.userInfo.id;
}
_hmt.push([
'_trackCustomEvent',
'buy_rxgoods',
{
'member_id': memberId, // ID
'product_name': this.curItem.productName, //
'product_id': this.curItem.productCode // ID
member_id: memberId, // ID
product_name: this.curItem.productName, //
product_id: this.curItem.productCode // ID
}
])
]);
setTimeout(function(){
setTimeout(function() {
window.open(_self.curItem.curGoodUrl, '_blank');
},1000);
}, 1000);
},
//
async getconf(memberId, couponId) {
@ -538,25 +486,25 @@ export default {
let msg = '领取成功';
let msgType = 'success';
if (data) {
if(data.code!='0') {
if (data.code != '0') {
msgType = 'warning';
msg = data.msg;
}
this.$message({
type: msgType,
message: msg,
message: msg
});
}
},
userclose() {
this.userlist = [];
this.dialogInfo1=false;
this.dialogInfo1 = false;
},
async userquery() {
let data = await goodsmessage(this.productCode);
if (data) {
console.log(data)
debugger
console.log(data);
debugger;
this.newlist = data.data;
}
this.productAttachmentList = this.newlist[0].productAttachmentList;
@ -573,7 +521,7 @@ export default {
outputObj.productName = data.name;
this.newlist = [outputObj];
}
let picture = this.newlist[0].picture.split(",");
let picture = this.newlist[0].picture.split(',');
this.productAttachmentList = picture;
},
@ -588,16 +536,15 @@ export default {
//
async alldrawlist() {
this.checkIsLogin();
this.usermessage = this.$store.state.userInfo;
this.usermessage = this.userInfo;
let storeCode = '';
if(this.usermessage && this.usermessage.data && this.usermessage.data.storeCode) {
storeCode = this.usermessage.data.storeCode
if (this.usermessage && this.usermessage.storeCode) {
storeCode = this.usermessage.storeCode;
}
let paramsToAPI={
productCode:this.curItem.productCode,
let paramsToAPI = {
productCode: this.curItem.productCode
};
if(storeCode)
paramsToAPI.stroeCode = stroeCode;
if (storeCode) paramsToAPI.stroeCode = stroeCode;
let data = await alldiscount(paramsToAPI);
let userlist = [];
let menulsit = [];
@ -607,16 +554,16 @@ export default {
let alllist = [];
this.userlist = this.alldraw.data;
this.userlist.forEach((element, index) => {
if (typeof element.productCodes == "string" || !element.productCodes) {
if (typeof element.productCodes == 'string' || !element.productCodes) {
userlist.push(element);
}
});
let menualist = [];
userlist.filter((item) => {
let valDateFromTime=0;
let valDateToTime=0;
userlist.filter(item => {
let valDateFromTime = 0;
let valDateToTime = 0;
let curTime = new Date().getTime();
let dateChecked=true;
let dateChecked = true;
/*
if(item.publishFrom && curTime < item.publishFrom) {
dateChecked=false;
@ -648,16 +595,13 @@ export default {
}
*/
if(this.mainProduct && this.mainProduct.petType && item.petCategoryIds) {
if(this.mainProduct.petType===0 && item.petCategoryIds!='1')
dateChecked=false;
if(this.mainProduct.petType===1 && item.petCategoryIds!='2')
dateChecked=false;
if (this.mainProduct && this.mainProduct.petType && item.petCategoryIds) {
if (this.mainProduct.petType === 0 && item.petCategoryIds != '1') dateChecked = false;
if (this.mainProduct.petType === 1 && item.petCategoryIds != '2') dateChecked = false;
}
if(this.mainProduct && this.mainProduct.tagUsedAge && item.petAgeTypeIds) {
if (this.mainProduct && this.mainProduct.tagUsedAge && item.petAgeTypeIds) {
let productToCouponAgeId = this.util.getAgeMapping(this.mainProduct.tagUsedAge);
if(item.petAgeTypeIds!=productToCouponAgeId)
dateChecked=false;
if (item.petAgeTypeIds != productToCouponAgeId) dateChecked = false;
}
/*
if(dateChecked && item.activityId!=10) {
@ -675,7 +619,7 @@ export default {
//Expired coupons
}
*/
if(dateChecked) {
if (dateChecked) {
menualist.push(item);
} else {
//Expired coupons
@ -686,10 +630,10 @@ export default {
},
plus(num, index) {
if(this.sales_num >= this.curItem.leftAllotment) {
if (this.sales_num >= this.curItem.leftAllotment) {
this.$message({
type: "warning",
message: '已达到本品最大购买上限',
type: 'warning',
message: '已达到本品最大购买上限'
});
} else {
this.sales_num = parseInt(this.sales_num) + 1;
@ -708,13 +652,15 @@ export default {
// let userid=JSON.parse(location.getItem('userInfo'));
// let mobile=JSON.parse(location.getItem('userInfo'));
// console.log(userid,mobile);
this.usermessage = this.userInfo;
// console.log(this.usermessage,'this.usermessage');
let basePoint = item.basePoint;
basePoint = basePoint?basePoint:0;
basePoint = basePoint ? basePoint : 0;
let data = await postCourseId(
item.productCode,
this.sales_num,
this.usermessage.data.id,
this.usermessage.data.mobile,
this.usermessage.id,
this.usermessage.mobile,
item.picFile,
item.productName,
item.ecPrice,
@ -727,7 +673,8 @@ export default {
}
},
usertanchu(item, orderm) {
let user = this.$store.state.userInfo;
let user = this.userInfo;
console.log(user,'user');
if (!user) {
this.dialogInfo2 = true;
return;
@ -735,21 +682,21 @@ export default {
this.courseId(item);
if (orderm == 0) {
this.$message({
type: "success",
message: "加入购物车成功",
type: 'success',
message: '加入购物车成功'
});
_hmt.push([
"_trackCustomEvent",
"add_to_cart",
'_trackCustomEvent',
'add_to_cart',
{
"product_id":this.curItem.productCode,
"product_category":this.curItem.categoryName,
"product_name": this.curItem.productName,
"product_quantity" : this.sales_num,
"product_amount" : this.sales_num*this.curItem.ecPrice,
'member_id': user.data.id
product_id: this.curItem.productCode,
product_category: this.curItem.categoryName,
product_name: this.curItem.productName,
product_quantity: this.sales_num,
product_amount: this.sales_num * this.curItem.ecPrice,
member_id: user.id
}
])
]);
}
if (orderm == 1) {
let list = [
@ -763,34 +710,34 @@ export default {
leftAllotment: item.leftAllotment,
basePoint: item.basePoint,
buyCount: this.sales_num,
memberId: "",
mobile: "",
checked: true,
},
memberId: '',
mobile: '',
checked: true
}
];
_hmt.push([
"_trackCustomEvent",
"add_to_cart",
'_trackCustomEvent',
'add_to_cart',
{
"product_id":this.curItem.productCode,
"product_category":this.curItem.categoryName,
"product_name": this.curItem.productName,
"product_quantity" : this.sales_num,
"product_amount" : this.sales_num*this.curItem.ecPrice,
product_id: this.curItem.productCode,
product_category: this.curItem.categoryName,
product_name: this.curItem.productName,
product_quantity: this.sales_num,
product_amount: this.sales_num * this.curItem.ecPrice
}
])
]);
this.$router.push({
path: "/personal/settlement",
path: '/personal/settlement',
query: {
list: JSON.stringify(list),
},
list: JSON.stringify(list)
}
});
}
}
},
userget() {
let user = this.$store.state.userInfo;
let user = this.userInfo;
if (!user) {
this.dialogInfo2 = true;
return;
@ -801,20 +748,24 @@ export default {
}
},
selectsearch(item, index) {
if(!item.leftAllotment || item.leftAllotment<=0)
return;
if (!item.leftAllotment || item.leftAllotment <= 0) return;
this.activeIndexa = index;
this.curItem = item;
this.productAttachmentList = item.productAttachmentList;
this.crumbs.pop();
this.crumbs.push({title: item.productName});
},
this.crumbs.push({ title: item.productName });
}
},
computed:{
...mapState({
userInfo : state => state.user.userInfo,
})
}
onceproduct() {},
};
</script>
<style lang="less" scoped>
@import url("../../assets/css/producted.less");
@import url("../../assets/css/global.less");
@import url('../../assets/css/producted.less');
</style>

View File

@ -1,32 +1,29 @@
<template>
<div>
<Myheader></Myheader>
<div>
<Myheader></Myheader>
<div class="rc-top"></div>
<div class="usercontend">
<div class="rc-max-width--xl">
<h2>新增收货地址</h2>
<div class="rc-max-width--xl rc-people rc-full-width">
<span>收货人:</span>
<input type="text" placeholder="请输入收货人姓名" v-model="userpeople">
<input type="text" placeholder="请输入收货人姓名" v-model="userpeople" />
</div>
<div class="rc-max-width--xl rc-people rc-phone rc-full-width">
<span>手机号码:</span>
<input type="text" placeholder="请输入11位手机号码" v-model="tel" :error-message="usertel">
<input type="text" placeholder="请输入11位手机号码" v-model="tel" :error-message="usertel" />
</div>
<div class="rc-max-width--xl rc-people rc-address rc-full-width">
<span>所在地区:</span>
<!-- <input type="text" placeholder="请选择所在地区"> -->
<addressInput @getmenu="onGetMenu" @closeDialog = "handleClose1" :dialogInfo1="dialogInfo1"></addressInput>
<addressInput @getmenu="onGetMenu" @closeDialog="handleClose1" :dialogInfo1="dialogInfo1"></addressInput>
</div>
<div class="rc-max-width--xl rc-people rc-useaddress">
<span>详细地址:</span>
<input type="text" placeholder="小区、门牌号等" class="userinput" v-model="alladdress">
<textarea rows="10" cols="30" placeholder="请输入详细地址" v-model="alladdress">
</textarea>
<input type="text" placeholder="小区、门牌号等" class="userinput" v-model="alladdress" />
<textarea rows="10" cols="30" placeholder="请输入详细地址" v-model="alladdress"></textarea>
</div>
</div>
</div>
<div class="rc-button">
<span @click="openclose()">取消</span>
@ -39,158 +36,145 @@
</div> -->
<MyFooter></MyFooter>
</div>
</template>
<script>
import Myheader from '~/components/header.vue'
import addressInput from '~/components/addressInput.vue'
import MyFooter from '~/components/rc-footer.vue'
import {editaddress} from "../../ajax/getData";
import Myheader from '~/components/header.vue';
import addressInput from '~/components/addressInput.vue';
import MyFooter from '~/components/rc-footer.vue';
import { editaddress } from '../../ajax/getData';
import { mapState } from 'vuex';
export default {
data() {
return {
chosenAddressId: "1",
usermessage:null,
chosenAddressId: '1',
usermessage: null,
checked: true,
tel: "",
alladdress:'',
userid: null,
usermessage:null,
dialogInfo1:false,
userpeople:'',
provinceId:'',
cityId:'',
districtId:'',
tel: '',
alladdress: '',
// userid: null,
usermessage: null,
dialogInfo1: false,
userpeople: '',
provinceId: '',
cityId: '',
districtId: '',
list: [
{
id: 1,
name: "张三",
tel: "13000000000",
address: "浙江省杭州市西湖区文三路 138 号",
isDefault: true,
name: '张三',
tel: '13000000000',
address: '浙江省杭州市西湖区文三路 138 号',
isDefault: true
},
{
id: 2,
name: "李四",
tel: "1310000000",
address: "浙江省杭州市拱墅区莫干山路 50 号",
name: '李四',
tel: '1310000000',
address: '浙江省杭州市拱墅区莫干山路 50 号'
},
{
id: 3,
name: "李四",
tel: "1310000000",
address: "浙江省杭州市拱墅区莫干山路 50 号",
},
],
name: '李四',
tel: '1310000000',
address: '浙江省杭州市拱墅区莫干山路 50 号'
}
]
};
},
methods: {
onGetMenu(values){
console.log(values,+'111111');
let user=values[2].id;
user=user.split('-');
this.provinceId=user[0];
this.cityId=user[1];
this.districtId=user[2];
onGetMenu(values) {
console.log(values, +'111111');
let user = values[2].id;
user = user.split('-');
this.provinceId = user[0];
this.cityId = user[1];
this.districtId = user[2];
},
handleClose1(){
this.dialogInfo1 = false
handleClose1() {
this.dialogInfo1 = false;
},
register(){
if (this.alladdress==='') {
register() {
if (this.alladdress === '') {
this.$message({
type: 'warning',
message: '请输入详细地址 '
});
return
}if(!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === ""){
return;
}
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === '') {
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
return
}
else if(this.userpeople===''){
return;
} else if (this.userpeople === '') {
this.$message({
type: 'warning',
message: '请填写收货人'
});
return
}
else if(this.provinceId===''){
return;
} else if (this.provinceId === '') {
this.$message({
type: 'warning',
message: '请选择省区'
});
return
}
else if(this.cityId===''){
return;
} else if (this.cityId === '') {
this.$message({
type: 'warning',
message: '请选择市区'
});
return
}
else if(this.districtId===''){
return;
} else if (this.districtId === '') {
this.$message({
type: 'warning',
message: '请选择详细的区域'
});
return
}
else{
return;
} else {
this.editaddress();
}
},
openclose(){
},
openclose() {
this.$router.push({
path: "/useraddress/openaddress",
path: '/useraddress/openaddress'
// query: {
// id: userid,
// },
});
},
},
//
async editaddress(item) {
// this.userid
let useradd={
memberId:this.userid,
detailAddress:this.alladdress,
recipient:this.userpeople,
recipientPhone:this.tel,
provinceId:this.provinceId,
cityId:this.cityId,
districtId:this.districtId
}
let useradd = {
memberId: this.userid,
detailAddress: this.alladdress,
recipient: this.userpeople,
recipientPhone: this.tel,
provinceId: this.provinceId,
cityId: this.cityId,
districtId: this.districtId
};
let data = await editaddress(useradd);
if(data){
if (data) {
console.log(data);
if(data){
if (data) {
this.$message({
type: 'warning',
message: '地址添加成功'
});
this.$router.push({
path: "/useraddress/openaddress",
path: '/useraddress/openaddress'
// query: {
// id: userid,
// },
});
}
}
},
}
//
// async editaddress(user) {
@ -206,31 +190,33 @@ openclose(){
MyFooter,
addressInput
},
computed:{
computed: {
usertel() {
if (this.tel === "") {
return "";
if (this.tel === '') {
return '';
} else if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel)) {
return "手机号格式错误";
return '手机号格式错误';
} else {
return "";
return '';
}
},
...mapState({
userid : state => state.user.userInfo.id,
})
},
mounted() {
this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
this.usermessage = JSON.parse(localStorage.getItem('userInfo'));
// this.editaddress(this.usermessage);
this.userid = this.usermessage.data.id;
// this.userid = this.usermessage.data.id;
//
// this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
// this.editaddress(this.usermessage);
// this.userid = this.usermessage.data.id;
},
}
};
</script>
<style lang="less" scoped >
@import url("../../assets/css/addaddress.less");
<style lang="less" scoped>
@import url('../../assets/css/addaddress.less');
</style>

View File

@ -1,34 +1,31 @@
<template>
<div>
<Myheader></Myheader>
<div>
<Myheader></Myheader>
<div class="rc-top"></div>
<div class="usercontend">
<div class="rc-max-width--xl">
<div class="rc-max-width--xl rc-people">
<span>收货人:</span>
<input type="text" placeholder="" v-model="recipient">
<input type="text" placeholder="" v-model="recipient" />
</div>
<div class="rc-max-width--xl rc-people rc-phone">
<span>手机号码:</span>
<input type="text" placeholder="" v-model="recipientPhone">
<input type="text" placeholder="" v-model="recipientPhone" />
</div>
<div class="rc-max-width--xl rc-people rc-address">
<span>所在地区:</span>
<addressInput @getmenu="onGetMenu" @closeDialog = "handleClose1" :dialogInfo1="dialogInfo1" :defaultValues="defaultValues"></addressInput>
<addressInput @getmenu="onGetMenu" @closeDialog="handleClose1" :dialogInfo1="dialogInfo1" :defaultValues="defaultValues"></addressInput>
</div>
<div class="rc-max-width--xl rc-people rc-useaddress">
<span>详细地址:</span>
<input type="text" placeholder="" v-model="detailAddress" >
<input type="text" placeholder="" v-model="detailAddress" />
</div>
</div>
<!-- <div class="rc-button">
<div class="rc-footbutton" @click="onAdd()">
<span>新增收货地址</span>
</div>
</div> -->
</div>
<div class="rc-button">
<span @click="openclose()">取消</span>
@ -39,164 +36,152 @@
</template>
<script>
import Myheader from '~/components/header.vue'
import MyFooter from '~/components/rc-footer.vue'
import { editupdate} from "../../ajax/getData";
import addressInput from '~/components/addressInput.vue'
import Myheader from '~/components/header.vue';
import MyFooter from '~/components/rc-footer.vue';
import { editupdate } from '../../ajax/getData';
import addressInput from '~/components/addressInput.vue';
import { mapState } from 'vuex';
export default {
data() {
return {
chosenAddressId: "1",
chosenAddressId: '1',
checked: true,
userid: null,
dialogInfo1:false,
usermessage:null,
useradrname:[],
detailAddress:'',
recipientPhone:'',
recipient:'',
addressid:'',
provinceId:'',
cityId:'',
districtId:'',
defaultValues:[],
// userid: null,
dialogInfo1: false,
usermessage: null,
useradrname: [],
detailAddress: '',
recipientPhone: '',
recipient: '',
addressid: '',
provinceId: '',
cityId: '',
districtId: '',
defaultValues: [],
list: [
{
id: 1,
name: "张三",
tel: "13000000000",
address: "浙江省杭州市西湖区文三路 138 号",
isDefault: true,
name: '张三',
tel: '13000000000',
address: '浙江省杭州市西湖区文三路 138 号',
isDefault: true
},
{
id: 2,
name: "李四",
tel: "1310000000",
address: "浙江省杭州市拱墅区莫干山路 50 号",
name: '李四',
tel: '1310000000',
address: '浙江省杭州市拱墅区莫干山路 50 号'
},
{
id: 3,
name: "李四",
tel: "1310000000",
address: "浙江省杭州市拱墅区莫干山路 50 号",
},
],
name: '李四',
tel: '1310000000',
address: '浙江省杭州市拱墅区莫干山路 50 号'
}
]
};
},
methods: {
onGetMenu(values){
onGetMenu(values) {
let user;
console.log(values,+'111111');
console.log(typeof(values[2]));
console.log(values, +'111111');
console.log(typeof values[2]);
const objToStr = JSON.stringify(values[2]);
console.log(objToStr);
console.log(typeof(objToStr));
if(objToStr.includes('-')){
console.log("===包含符号")
let user=values[2].id;
user=user.split('-');
this.provinceId=user[0];
this.cityId=user[1];
this.districtId=user[2];
}else{
this.provinceId=values[0].id;
this.cityId=values[1].id;
this.districtId=values[2].id;
console.log("---不包含符号");
console.log(typeof objToStr);
if (objToStr.includes('-')) {
console.log('===包含符号');
let user = values[2].id;
user = user.split('-');
this.provinceId = user[0];
this.cityId = user[1];
this.districtId = user[2];
} else {
this.provinceId = values[0].id;
this.cityId = values[1].id;
this.districtId = values[2].id;
console.log('---不包含符号');
}
// let user=values[2].id;
// user=user.split('-');
console.log(this.provinceId,this.cityId,this.districtId);
console.log(this.provinceId, this.cityId, this.districtId);
},
openclose(){
openclose() {
this.$router.push({
path: "/useraddress/openaddress",
path: '/useraddress/openaddress'
});
},
handleClose1(){
this.dialogInfo1 = false
handleClose1() {
this.dialogInfo1 = false;
},
register(){
console.log(this.tel)
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.recipientPhone) || this.recipientPhone === "") {
register() {
console.log(this.tel);
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.recipientPhone) || this.recipientPhone === '') {
this.$message({
type: 'warning',
message: '手机号码输入有误'
});
return
}else if(this.alladdress===''){
return;
} else if (this.alladdress === '') {
this.$message({
type: 'warning',
message: '请输入详细地址'
});
return
}
else if(this.userpeople===''){
return;
} else if (this.userpeople === '') {
this.$message({
type: 'warning',
message: '请输入姓名'
});
return
}
else if(this.provinceId===''){
return;
} else if (this.provinceId === '') {
this.$message({
type: 'warning',
message: '请填写省区'
});
return
}
else if(this.userpeople===''){
return;
} else if (this.userpeople === '') {
this.$message({
type: 'warning',
message: '请填写市区'
});
return
}
else if(this.userpeople===''){
return;
} else if (this.userpeople === '') {
this.$message({
type: '请填写街道',
message: '请输入姓名'
});
return
}
else{
return;
} else {
this.edupdate();
}
},
},
//
async edupdate(item) {
let useradd={
memberId:this.userid,
id:this.id,
provinceId:this.provinceId,//id,
cityId:this.cityId,//id,
districtId:this.districtId,//id,
detailAddress:this.detailAddress, //
recipient:this.recipient, //
recipientPhone:this.recipientPhone, //
}
let useradd = {
memberId: this.userid,
id: this.id,
provinceId: this.provinceId, //id,
cityId: this.cityId, //id,
districtId: this.districtId, //id,
detailAddress: this.detailAddress, //
recipient: this.recipient, //
recipientPhone: this.recipientPhone //
};
let data = await editupdate(useradd);
if(data){
if (data) {
this.$message({
type: 'warning',
message: '地址修改成功'
});
this.$router.push({
path: "/useraddress/openaddress",
path: '/useraddress/openaddress'
});
}
},
}
//
// async userdelete(item) {
@ -220,39 +205,43 @@ export default {
MyFooter,
addressInput
},
created(){
let provinceName=this.$route.query.provinceName;
let districtName=this.$route.query.districtName;
let cityName=this.$route.query.cityName
this.provinceId=this.$route.query.provinceId;
this.districtId=this.$route.query.districtId;
this.cityId=this.$route.query.cityId;
this.defaultValues=[
created() {
let provinceName = this.$route.query.provinceName;
let districtName = this.$route.query.districtName;
let cityName = this.$route.query.cityName;
this.provinceId = this.$route.query.provinceId;
this.districtId = this.$route.query.districtId;
this.cityId = this.$route.query.cityId;
this.defaultValues = [
{
id:this.provinceId,
name:provinceName
id: this.provinceId,
name: provinceName
},
{
id:this.cityId,
name:cityName
id: this.cityId,
name: cityName
},
{
id:this.districtId,
name:districtName
id: this.districtId,
name: districtName
}
];
},
mounted() {
this.userid = JSON.parse(localStorage.getItem("userInfo")).data.id;
this.recipient=this.$route.query.recipient
this.recipientPhone=this.$route.query.recipientPhone
this.detailAddress=this.$route.query.detailAddress
this.id=this.$route.query.id;
// this.userid = JSON.parse(localStorage.getItem('userInfo')).data.id;
this.recipient = this.$route.query.recipient;
this.recipientPhone = this.$route.query.recipientPhone;
this.detailAddress = this.$route.query.detailAddress;
this.id = this.$route.query.id;
},
computed:{
...mapState({
userid : state => state.user.userInfo.id,
})
}
};
</script>
<style lang="less" scoped >
@import url("../../assets/css/addaddress.less");
<style lang="less" scoped>
@import url('../../assets/css/addaddress.less');
</style>

View File

@ -1,32 +1,28 @@
<template>
<div>
<Myheader></Myheader>
<div>
<Myheader></Myheader>
<div class="rc-top"></div>
<tabs :crumbs="crumbs"></tabs>
<div class="online bold"></div>
<div class="usercontshow rc-max-width--xl">
<div class="usercontend" v-for="(item, index) in list" :key="index">
<div class="usercontshow usermain" >
<div class="rc-cat" >
<div class="usercontshow usermain">
<div class="rc-cat">
<div class="rc-center">
<div class=" rc-title">
<em>
{{ item.recipient }}
</em>
<span>
{{ item.recipientPhone }}
</span>
<em>{{ item.recipient }}</em>
<span>{{ item.recipientPhone }}</span>
</div>
<div class="rc-address">
<span>
{{item.provinceName}}{{ item.districtName }}{{item.detailAddress}}
</span>
<span>{{ item.provinceName }}{{ item.districtName }}{{ item.detailAddress }}</span>
</div>
<div class="rc-footer">
<div class="rc-foot">
<img :src="item.isDefault?require('../../assets/image/userred.png'):require('../../assets/image/userselect.png')" @click="changeadddress(item,index)"/>
<img
:src="item.isDefault ? require('../../assets/image/userred.png') : require('../../assets/image/userselect.png')"
@click="changeadddress(item, index)"
/>
<span>设置为默认收货地址</span>
</div>
<div class="rc-right">
<span @click="onEdit(item, index)">编辑</span>
@ -34,106 +30,95 @@
</div>
</div>
</div>
</div>
</div>
<div class="online bold rc-md-down"></div>
<!-- <div class="usercontend useradd">
<img src="../../assets/image/userselect.png" alt="">
<span>添加收货地址</span>
</div> -->
</div>
<div class="userdit" ref="marinaddress">
<div class="alledit" @click="onAdd()">
<img src="../../static/images/adddress.png" alt="">
<img src="../../static/images/adddress.png" alt="" />
<span>添加收货地址</span>
</div>
</div>
</div>
<div class="rc-button">
<div class="rc-footbutton" @click="onAdd()">
<span>新增收货地址</span>
</div>
<div class="rc-footbutton" @click="onAdd()"><span>新增收货地址</span></div>
</div>
<MyFooter></MyFooter>
</div>
</div>
</template>
<script>
import Myheader from '~/components/header.vue'
import MyFooter from '~/components/rc-footer.vue'
import tabs from "~/components/tabs.vue";
import { selectaddress,editupdate,editdelete} from "../../ajax/getData";
import Myheader from '~/components/header.vue';
import MyFooter from '~/components/rc-footer.vue';
import tabs from '~/components/tabs.vue';
import { selectaddress, editupdate, editdelete } from '../../ajax/getData';
import { mapState } from 'vuex';
export default {
data() {
return {
crumbs:[
crumbs: [
{
path:'/personal/mypersonal/',
path: '/personal/mypersonal/'
},
{
path:'/useraddress/openaddress/',
path: '/useraddress/openaddress/'
}
],
chosenAddressId: "1",
chosenAddressId: '1',
checked: true,
userid: null,
userlist:[],
usermessage:null,
list: [
],
userlist: [],
usermessage: null,
list: []
};
},
methods: {
changeadddress(item,index){
console.log(item,index);
console.log(item.isDefault)
if(item.isDefault==false){
item.isDefault=true
}else{
item.isDefault=false;
changeadddress(item, index) {
console.log(item, index);
console.log(item.isDefault);
if (item.isDefault == false) {
item.isDefault = true;
} else {
item.isDefault = false;
}
this.editupdate(this.userid,item.id,item.isDefault)
this.editupdate(this.userid, item.id, item.isDefault);
setTimeout(() => {
this.editaddress();
}, 200);
//
},
onEdit(item, index) {
// let userid = item.id;
console.log(item);
// debugger
this.$router.push({
path: "/useraddress/editaddress",
path: '/useraddress/editaddress',
query: {
recipient: item.recipient,
recipientPhone:item.recipientPhone,
detailAddress:item.detailAddress,
id:item.id,
provinceName:item.provinceName,
districtName:item.cityName,
cityName:item.districtName,
provinceId:item.provinceId,
districtId:item.districtId,
cityId:item.cityId,
},
recipientPhone: item.recipientPhone,
detailAddress: item.detailAddress,
id: item.id,
provinceName: item.provinceName,
districtName: item.cityName,
cityName: item.districtName,
provinceId: item.provinceId,
districtId: item.districtId,
cityId: item.cityId
}
});
},
onAdd(item, index) {
// let userid = item.id;
// console.log(item);
this.$router.push({
path: "/useraddress/addaddress",
path: '/useraddress/addaddress'
// query: {
// id: userid,
// },
@ -141,15 +126,15 @@ export default {
},
//
async editupdate(userid,addressid,isDefault) {
let useradd={
memberId:userid,
id:addressid,
isDefault:isDefault,
}
async editupdate(userid, addressid, isDefault) {
let useradd = {
memberId: userid,
id: addressid,
isDefault: isDefault
};
let data = await editupdate(useradd);
if(data){
if (data) {
this.$message({
type: 'warning',
message: '更改成功'
@ -158,14 +143,13 @@ export default {
// if(data){
// this.editaddress();
// }
},
//
async userdelete(item) {
console.log(item.memberId);
let data = await editdelete(this.userid, item.id);
if(data){
if (data) {
this.$message({
type: 'warning',
message: '地址删除成功'
@ -176,13 +160,16 @@ export default {
},
//
async editaddress(user) {
// user.data.id=844350;
let data = await selectaddress(this.userid);
console.log(data);
this.list=data.data;
this.list = data.data;
// console.log(this.list);
console.log(data);
},
/* 初始化数据 */
async resetData(){
this.usermessage = this.userInfo;
this.userid = this.userInfo.id;
this.editaddress(this.userid);
}
},
components: {
Myheader,
@ -190,17 +177,27 @@ export default {
tabs
},
computed:{
...mapState({
userInfo : state => state.user.userInfo,
})
},
watch:{
userInfo(newVal){
this.resetData(newVal);
}
},
mounted() {
//
this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
this.userid = this.usermessage.data.id;
console.log(this.userid);
this.editaddress(this.userid);
// this.usermessage = JSON.parse(localStorage.getItem('userInfo'));
if(this.userInfo){
this.resetData();
}
},
};
</script>
<style lang="less" scoped >
@import url("../../assets/css/openaddress.less");
<style lang="less" scoped>
@import url('../../assets/css/openaddress.less');
</style>

View File

@ -152,7 +152,8 @@ export default {
envData,
phone: "",
layerMSg: "手机格式不对",
tel: "",
tel: "", // 15766132405 18825059708
sms: "", // 1234
password: "",
userdata:{},
allcheck:false,
@ -165,7 +166,6 @@ export default {
],
hash:'',
text: "",
sms: "",
buttonmsg: "获取验证码",
flag: false,
adminCode: "",
@ -220,13 +220,14 @@ export default {
},
...mapState({
userInfo : state => state.user.userInfo,
loginState : state => state.login.loginState,
})
},
mounted() {
//console.log(this.$route.params);
this.checkIsLogin();
let user = this.$store.state.userInfo;
if(user) {
// this.checkIsLogin();
// let user = this.$store.state.userInfo;
if(this.loginState && this.userInfo) {
this.$router.push({
path: "/personal/mypersonal",
});
@ -401,13 +402,21 @@ export default {
}
}
else{
let data=await this.vadmsg();
/* 暂时关闭短信验证 */
let data = await this.vadmsg();
// let data = {
// code : 1,
// }
if(data.code=="1")
{
data = await userregOrLogin(this.tel);
let token=JSON.stringify(data);
this.changeClod({ cloud: token });
this.checkIsLogin();
this.$store.dispatch('setUserInfo',{
data : data,
app : this,
});
// this.changeClod({ cloud: token });
// this.checkIsLogin();
let returnMessage='';
if(data.type==1) {
if(data.data.memberName===undefined){

View File

@ -571,12 +571,19 @@ export default {
tabs
},
mounted() {
const { query } = this.$route;
this.activeIndex1 = query.type || 0;
this.activeIndex = query.type || 0;
this.value = query.content || '';
this.usetmessage();
this.userst();
//Handling RxGoods filter
let curEnv = process.env.NODE_ENV;
this.rxFilters = envData[curEnv].rxGoodsFilter;
//Handling RxGoods filter end
console.log();
},
methods: {
//
@ -723,6 +730,7 @@ export default {
this.$nextTick(() => {
this.$refs.userstandard[0].style.margin = 0 + "px";
});
console.log(this.activeIndex1, this.value,'this.activeIndex1, this.value');
let data = await biaome(this.activeIndex1, this.value, 1, 10);
if (data) {
this.rccontair = data;

View File

@ -0,0 +1,24 @@
/**
* 这个是一些全局函数方法
*/
import { Message } from 'element-ui';
export default ({ app }, inject) => {
/**
* 消息提示框
* msg 提示语
* type 提示框状态 success/warning/info/error
* duration 默认3秒
*/
inject('messageToast',(msg,type='success',duration=3000)=>{
Message({
type : type || 'success',
message : msg,
duration
})
})
inject('myInjectedFunction', string => Message('That was easy!', string));
}

View File

@ -3,7 +3,7 @@
*/
/**
* 设置cookie的值
* 设置cookie的值(获取的是前端的 nuxt框架不可用 用cookie-universal-nuxt获取存放的token)
* @param {String} key cookie的键
* @param {String} val cookie的值
* @param {String} exdays 过期时间默认的话是7天
@ -16,7 +16,7 @@ const setCookie = (key,val,exdays = 7)=>{
}
/**
* 获取cookie的值
* 获取cookie的值(获取的是前端的 nuxt框架不可用 用cookie-universal-nuxt获取存放的token)
* @param {String} key cookie的键
*/
const getCookie = (key)=>{
@ -30,8 +30,6 @@ const getCookie = (key)=>{
}
export {
setCookie,
getCookie,

View File

@ -1,31 +1,33 @@
import user from './modules/user.js';
import user from './modules/user.js';
import login from './modules/login.js';
const state = () => ({
// 这里是全局数据保存的地方
tabsList: [
{
tabsList: [{
path: '/',
name: 'index',
meta:{
meta: {
title: '首页',
}
},
]
}, ],
userInfo : null, //以前遗留的问题 用户数据后台统一用modal里面的userInfo
userKey : 'user_mobile', //存储用户的KEY值
tokenKey : 'token', //存储用户token的key
})
const mutations = {
// changeLogin(state, val) {
// console.log(state,val);
// let list=[];
// list.push(val);
})
// JSON.parse(list);
// console.log(list);
// localStorage.setItem("cardata", list);
// },
const mutations = {
// changeLogin(state, val) {
// console.log(state,val);
// let list=[];
// list.push(val);
// JSON.parse(list);
// console.log(list);
// localStorage.setItem("cardata", list);
// },
changeClod(state, val) {
localStorage.setItem('userInfo', val.cloud);
},
@ -35,7 +37,7 @@ const mutations = {
checkIsLogin(state) {
let rawUserInfoStr = localStorage.getItem('userInfo');
let rawUserInfo = JSON.parse(rawUserInfoStr);
if(rawUserInfo && rawUserInfo.hasOwnProperty('xaccessToken') && rawUserInfo['xaccessToken'].length>36)
if (rawUserInfo && rawUserInfo.hasOwnProperty('xaccessToken') && rawUserInfo['xaccessToken'].length > 36)
state.userInfo = rawUserInfo;
else
state.userInfo = undefined;
@ -48,27 +50,39 @@ const mutations = {
result === -1 ? state.tabsList.push(val.data) : ''
},
// changeMenu(state, user){
// // console.log("vuex存储的变化",JSON.parse(user))
// // console.log("vuex存储的变化",user)
// state.menuList = user;
// localStorage.setItem('menuList', user);
// }
}
const actions = {
SET_INDEX_USER_INFO(state,data){
state.userInfo = data;
}
// changeMenu(state, user){
// // console.log("vuex存储的变化",JSON.parse(user))
// // console.log("vuex存储的变化",user)
// state.menuList = user;
// localStorage.setItem('menuList', user);
// }
}
const actions = {
setPosition: ({
commit
}, position) => {
commit('setPosition', position)
}
}
}
/* 功能模块 */
const modules = {
/* 功能模块 */
const modules = {
user,
}
login
}
export default {namespaced: true, state, mutations, actions,modules}
export default {
namespaced: true,
state,
mutations,
actions,
modules
}

View File

@ -1,17 +1,57 @@
// import { getCookie } from "../../plugins/until/until.js";
export default {
state : {
des : '这个存储用户登录逻辑操作',
loginState : false, //登录状态
state: {
des: '这个存储用户登录逻辑操作',
loginState: false, //登录状态
},
/* 存储修改状态的静态方法 */
mutations : {
mutations: {
/* 设置登录状态 */
SET_LOGIN_STATE(state){
console.log(state);
}
SET_LOGIN_STATE(state, value) {
state.loginState = value
},
},
/* 存储修改数据的动态方法 */
actions : {
actions: {
/**
* 判断是否登录
* context
* app vue 实例
*/
checkLoginState(context, app) {
let key = context.rootState.userKey;
let mobile = app.$cookies.get(key);
let isHasToken = false;
if (mobile == undefined || !mobile || mobile == 'mobile') {
isHasToken = false;
} else {
isHasToken = true;
/* 更新用户数据 */
if (!context.rootState.user.userInfo) {
context.dispatch('getUserInfo', app, {
root: true
});
}
}
context.commit('SET_LOGIN_STATE', isHasToken);
},
/**
* 退出登录
* @param {Object} context 上下文
* @param {Object} app vue 实例
*/
logout(context, app){
let userKey = context.rootState.userKey;
let tokenKey = context.rootState.tokenKey;
app.$cookies.remove(userKey);
app.$cookies.remove(tokenKey);
context.commit('SET_USER_INFO', null, {
root: true
});
context.commit('SET_INDEX_USER_INFO', null, {
root: true
});
localStorage.removeItem(tokenKey)
}
}
}

View File

@ -1,18 +1,61 @@
import Vue from "vue";
import { userregOrLogin } from '../../ajax/getData.js';
export default {
state : {
des : '这个存储用户数据的模块列表',
userInfo : {}, //用户信息
loginState : false, //登录状态
state: {
des: '这个存储用户数据的模块列表',
userInfo: null, //用户信息
loginState: false, //登录状态
},
/* 存储修改状态的静态方法 */
mutations : {
mutations: {
/* 设置用户信息 */
SET_USER_INFO(state){
console.log(state);
SET_USER_INFO(state, userInfo) {
state.userInfo = userInfo;
}
},
/* 存储修改数据的动态方法 */
actions : {
actions: {
/**
* 设置会员信息
* @param {Object} context 上下文
* @param {Object} {
data : 后台返回的用户数据
app : vue实例this
}
*/
setUserInfo(context, {
data,
app
}) {
const userKey = context.rootState.userKey;
const tokenKey = context.rootState.tokenKey;
const userInfo = data.data;
const {
mobile
} = userInfo;
/* 存储数据 变更登录状态 */
app.$cookies.set(userKey, mobile);
app.$cookies.set(tokenKey, data.xaccessToken);
localStorage.setItem(tokenKey,data.xaccessToken);
context.commit('SET_USER_INFO', userInfo);
context.commit('SET_LOGIN_STATE', true, {
root: true
});
context.commit('SET_INDEX_USER_INFO', data, {
root: true
});
},
/* 获取用户数据 */
async getUserInfo(context,app){
let key = context.rootState.userKey;
let mobile = app.$cookies.get(key);
const data = await userregOrLogin(app.$cookies.get(key));
context.dispatch('setUserInfo',{
data,
app,
})
}
}
}