迭代功能需求

1.修改用户信息存储位置
2.修复订单显示的问题
3.修改优惠卷显示文字显示和选择提示
4.修复地址列表排版错位的问题
5.添加搜索链接跳转查询
This commit is contained in:
lin 2022-03-23 18:04:14 +08:00
parent 6f8a8c628d
commit 9f955a34eb
29 changed files with 5615 additions and 5612 deletions

View File

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

View File

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

View File

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

View File

@ -9,9 +9,7 @@
<em class="rc-screen-reader" v-show="loginornot"></em> <em class="rc-screen-reader" v-show="loginornot"></em>
</button> </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"> <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"> <span class="rc-screen-reader-text">translations.feature.headerbar.menu</span>
translations.feature.headerbar.menu
</span>
</button> </button>
</li> </li>
</ul> </ul>
@ -20,32 +18,47 @@
<span class="rc-screen-reader-text">translations.feature.headerbar.alternatelogotext</span> <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"> <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> <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
<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> 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> </svg>
</h1> </h1>
</a> </a>
<ul class="rc-list rc-list--blank rc-list--inline rc-list--align rc-header__right" role="menubar"> <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"> <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"> <a
<span class="rc-screen-reader-text"> href="https://weibo.com/chinaroyalcanin?topnav=1&wvr=6&topsug=1&is_all=1"
微博 target="_blank"
</span> 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>
<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"> <a
<span class="rc-screen-reader-text"> href="javascript:;"
微信 onmouseenter="bindTracking(this)"
</span> 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"> <div class="ts-hover-show">
<span class="rc-text--center">微信扫一扫</span> <span class="rc-text--center">微信扫一扫</span>
<img src="../assets/showimage/royalcanincn-qrcode.jpg"> <img src="../assets/showimage/royalcanincn-qrcode.jpg" />
</div> </div>
</a> </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"> <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 class="rc-screen-reader-text">个人中心</span>
个人中心
</span>
<em class="rc-screen-reader" v-show="loginornot"></em> <em class="rc-screen-reader" v-show="loginornot"></em>
</a> </a>
@ -57,24 +70,28 @@
</button> </button>
--> -->
<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"> 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> <span class="rc-screen-reader-text">translations.feature.headerbar.search</span>
</button> </button>
</li> </li>
</ul> </ul>
</nav> </nav>
<nav class="rc-header__nav rc-header__nav--secondary rc-md-up" data-component="nav-track" data-nav-name="Header navigation"> <nav class="rc-header__nav rc-header__nav--secondary rc-md-up" data-component="nav-track" data-nav-name="Header navigation">
<!-- Menu section--> <!-- Menu section-->
<div class="rc-container"> <div class="rc-container">
<ul class="rc-list rc-list--blank rc-list--inline rc-list--align rc-header__center"> <ul class="rc-list rc-list--blank rc-list--inline rc-list--align rc-header__center">
<li class="rc-list__item"> <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>
<a href="https://royalcanin.com.cn/cats" class="rc-list__header" data-ref="nav-link" role="menuitem" title="猫"></a> <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>
<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"> <li class="rc-list__item">
<a href="/productdetails/productlist/" class="rc-list__header" data-ref="nav-link" role="menuitem" title="官方商城">官方商城</a> <a href="/productdetails/productlist/" class="rc-list__header" data-ref="nav-link" role="menuitem" title="官方商城">官方商城</a>
</li> </li>
@ -87,70 +104,41 @@
<div class="rc-full-width rc-max-width--xl rc-padding--sm"> <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"> <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"> <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> <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"> <ul class="rc-list rc-list--blank rc-list--align test" role="menu">
<li class="rc-list__item"> <li class="rc-list__item"><a href="/productdetails/productlist/?stype=0" class="rc-list__link" role="menuitem">产品</a></li>
<a href="/productdetails/productlist/?stype=0" class="rc-list__link" role="menuitem">产品</a> <li class="rc-list__item"><a href="https://royalcanin.com.cn/cats/breeds" class="rc-list__link" role="menuitem">品种</a></li>
</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"> <li class="rc-list__item"><a href="https://royalcanin.com.cn/cats/kitten" class="rc-list__link" role="menuitem">幼猫</a></li>
<a href="https://royalcanin.com.cn/cats/breeds" class="rc-list__link" role="menuitem">品种</a> <li class="rc-list__item"><a href="https://royalcanin.com.cn/cats/kitten/health" class="rc-list__link" role="menuitem">健康和心情</a></li>
</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> </ul>
</li> </li>
<li class="rc-list__item rc-list__item--group"> <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> <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"> <ul class="rc-list rc-list--blank rc-list--align test" role="menu">
<li class="rc-list__item"> <li class="rc-list__item"><a href="/productdetails/productlist/?stype=1" class="rc-list__link" role="menuitem">产品</a></li>
<a href="/productdetails/productlist/?stype=1" class="rc-list__link" role="menuitem">产品</a> <li class="rc-list__item"><a href="https://royalcanin.com.cn/dogs/breeds" class="rc-list__link" role="menuitem">品种</a></li>
</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"> <li class="rc-list__item"><a href="https://royalcanin.com.cn/dogs/puppy" class="rc-list__link" role="menuitem">幼犬</a></li>
<a href="https://royalcanin.com.cn/dogs/breeds" class="rc-list__link" role="menuitem">品种</a> <li class="rc-list__item"><a href="https://royalcanin.com.cn/dogs/puppy/health" class="rc-list__link" role="menuitem">健康和心情</a></li>
</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> </ul>
</li> </li>
<li class="rc-list__item rc-list__item--group"> <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> <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"> <ul class="rc-list rc-list--blank rc-list--align test" role="menu">
<li class="rc-list__item"> <li class="rc-list__item"><a href="/productdetails/productlist/?stype=0" class="rc-list__link" role="menuitem">猫系列</a></li>
<a href="/productdetails/productlist/?stype=0" class="rc-list__link" role="menuitem">猫系列</a> <li class="rc-list__item"><a href="/productdetails/productlist/?stype=1" class="rc-list__link" role="menuitem">狗系列</a></li>
</li>
<li class="rc-list__item">
<a href="/productdetails/productlist/?stype=1" class="rc-list__link" role="menuitem">狗系列</a>
</li>
</ul> </ul>
</li> </li>
<li class="rc-list__item rc-list__item--group"> <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> <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"> <ul class="rc-list rc-list--blank rc-list--align test" role="menu">
<li class="rc-list__item"> <li class="rc-list__item"><a href="https://royalcanin.com.cn/about#growth-phase1" class="rc-list__link" role="menuitem">我们的历史</a></li>
<a href="https://royalcanin.com.cn/about#growth-phase1" class="rc-list__link" role="menuitem">我们的历史</a> <li class="rc-list__item"><a href="https://royalcanin.com.cn/about" class="rc-list__link" role="menuitem">我们的价值观</a></li>
</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"> <li class="rc-list__item">
<a href="#about/future" class="rc-list__link" role="menuitem">可持续发展</a> <a href="#about/future" class="rc-list__link" role="menuitem">可持续发展</a>
@ -174,7 +162,6 @@
</div> </div>
<!-- Menu section end--> <!-- Menu section end-->
</nav> </nav>
</header> </header>
<!-- Popup menu --> <!-- Popup menu -->
@ -213,13 +200,17 @@
<a href="https://royalcanin.com.cn/cats/breeds" class="rc-list__link ca" role="menuitem" title="Breeds">品种</a> <a href="https://royalcanin.com.cn/cats/breeds" class="rc-list__link ca" role="menuitem" title="Breeds">品种</a>
</li> </li>
<li class="rc-list__item"> <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>
<li class="rc-list__item"> <li class="rc-list__item">
<a href="https://royalcanin.com.cn/cats/kitten" class="rc-list__link ca" role="menuitem" title="Kitten">幼猫</a> <a href="https://royalcanin.com.cn/cats/kitten" class="rc-list__link ca" role="menuitem" title="Kitten">幼猫</a>
</li> </li>
<li class="rc-list__item"> <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> </li>
</ul> </ul>
</li> </li>
@ -240,13 +231,17 @@
<a href="https://royalcanin.com.cn/dogs/breeds" class="rc-list__link ca" role="menuitem" title="Breeds">品种</a> <a href="https://royalcanin.com.cn/dogs/breeds" class="rc-list__link ca" role="menuitem" title="Breeds">品种</a>
</li> </li>
<li class="rc-list__item"> <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>
<li class="rc-list__item"> <li class="rc-list__item">
<a href="https://royalcanin.com.cn/dogs/puppy" class="rc-list__link ca" role="menuitem" title="Puppy">幼犬</a> <a href="https://royalcanin.com.cn/dogs/puppy" class="rc-list__link ca" role="menuitem" title="Puppy">幼犬</a>
</li> </li>
<li class="rc-list__item"> <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> </li>
</ul> </ul>
</li> </li>
@ -260,12 +255,8 @@
<li class="rc-list__item rc-md-down"> <li class="rc-list__item rc-md-down">
<a href="/productdetails/productlist/" class="rc-list__header" title="Nutrition" role="menuitem">官方商城</a> <a href="/productdetails/productlist/" class="rc-list__header" title="Nutrition" role="menuitem">官方商城</a>
</li> </li>
<li class="rc-list__item"> <li class="rc-list__item"><a href="/productdetails/productlist/?stype=0" class="rc-list__link ca" role="menuitem">猫系列</a></li>
<a href="/productdetails/productlist/?stype=0" class="rc-list__link ca" role="menuitem">猫系列</a> <li class="rc-list__item"><a href="/productdetails/productlist/?stype=1" class="rc-list__link ca" role="menuitem">狗系列</a></li>
</li>
<li class="rc-list__item">
<a href="/productdetails/productlist/?stype=1" class="rc-list__link ca" role="menuitem">狗系列</a>
</li>
</ul> </ul>
</li> </li>
@ -312,21 +303,32 @@
</a> </a>
</li> </li>
<li class="rc-list__item"> <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 class="rc-list__link rc-icon rc-email--xs rc-iconography--xs" role="menuitem" href="https://royalcanin.com.cn/about/contact">与我们联系</a>
与我们联系
</a>
</li> </li>
<li class="rc-list__item"> <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> </a>
</li> </li>
<li class="rc-list__item"> <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"> <div class="ts-hover-show">
<span class="rc-text--center">微信长按识别</span> <span class="rc-text--center">微信长按识别</span>
<img src="../assets/showimage/royalcanincn-qrcode.jpg"> <img src="../assets/showimage/royalcanincn-qrcode.jpg" />
</div> </div>
</a> </a>
</li> </li>
@ -339,7 +341,6 @@
--> -->
</ul> </ul>
</div> </div>
</div> </div>
</nav> </nav>
</section> </section>
@ -348,7 +349,7 @@
</div> </div>
</template> </template>
<script> <script>
import { mapMutations } from "vuex"; import { mapMutations, mapState } from 'vuex';
export default { export default {
data() { data() {
return { return {
@ -357,42 +358,69 @@ export default {
usermessage: null, // 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() { mounted() {
this.checkIsLogin(); /* 判断是否登录 */
let usernot=this.$store.state.userInfo; this.$store.dispatch('checkLoginState', this);
//console.log(usernot); if (this.userInfo && this.loginState) {
if(usernot){ this.loginornot = false;
window._hmt.push(['_setUserId', usernot.data.mobile]); window._hmt.push(['_setUserId', this.userInfo.mobile]);
this.loginornot=false
} else { } else {
this.loginornot=true this.loginornot = true;
this.usermessage=usernot; this.usermessage = this.userInfo;
} }
if(isInitialized) console.log('22222show');
location.reload(); // this.refreshMobileNav();
if(!isInitialized) /* 全局刷新 */
isInitialized=true; 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: { methods: {
...mapMutations(["checkIsLogin"]), ...mapMutations(['checkIsLogin']),
refreshDesktopNav: function() { refreshDesktopNav: function() {
RCDL.navigation.currentState = null; RCDL.navigation.currentState = null;
RCDL.navigation.rebuild(); RCDL.navigation.rebuild();
}, },
refreshMobileNav: function() { refreshMobileNav: function() {
let itemGroupList=document.querySelectorAll("nav[data-toggle-group=mobile] .rc-list--align[role=menu]"); let itemGroupList = document.querySelectorAll('nav[data-toggle-group=mobile] .rc-list--align[role=menu]');
itemGroupList.forEach(function(ele, i) { itemGroupList.forEach(function(ele, i) {
if(ele.className.indexOf("rc-expand--horizontal")<0 && ele.className.indexOf("rc-btn-offset--top")<0) 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');
if(ele.id.indexOf("nav-list")>=0) else if (ele.id.indexOf('nav-footer') >= 0) ele.classList.add('rc-expand--vertical');
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'); //console.log('bindTracking');
@ -401,28 +429,24 @@ export default {
// //
// //
searchturn() { searchturn() {
this.$router.push({ name: "usersearch-search",}) this.$router.push({ name: 'usersearch-search' });
}, },
// //
turnlogin() { turnlogin() {
let userInfo = this.$store.state.userInfo; // let userInfo = this.$store.state.userInfo; //
let userInfo = this.userInfo;
if (!userInfo) { if (!userInfo) {
this.$router.push({ this.$router.push({
name: "userlogin-login", name: 'userlogin-login',
params: {} params: {}
}) });
} else { } else {
this.$router.push({ this.$router.push({
name: "personal-mypersonal", name: 'personal-mypersonal'
}) });
}
} }
} }
},
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,20 +5,15 @@
<tabs :crumbs="crumbs"></tabs> <tabs :crumbs="crumbs"></tabs>
<div class="rc-max-width--xl rc-padding-bottom--md"> <div class="rc-max-width--xl rc-padding-bottom--md">
<ul> <ul>
<li v-for="(item,index) in userrecord" :key="index"> <li v-for="(item, index) in userrecord" :key="index">{{ item.title }}</li>
{{item.title}}
</li>
</ul> </ul>
<ol> <ol>
<li v-for="(item, index) in usermessage" :key="index"> <li v-for="(item, index) in usermessage" :key="index">
<span>{{ item.startDate }}</span> <span>{{ item.startDate }}</span>
<em>{{ item.changeValue }}</em> <em>{{ item.changeValue }}</em>
<i>{{ item.remark }}</i> <i>{{ item.remark }}</i>
</li> </li>
</ol> </ol>
</div> </div>
<!-- <div class="rc-button"> <!-- <div class="rc-button">
@ -32,34 +27,29 @@
</template> </template>
<script> <script>
import Myheader from '~/components/header.vue' import Myheader from '~/components/header.vue';
import { memberAccount } from "../../ajax/getData"; import { memberAccount,mapState } from '../../ajax/getData';
export default { export default {
data() { data() {
return { return {
crumbs: [ crumbs: [
{ {
path:'/personal/mypersonal', path: '/personal/mypersonal'
}, },
{ {
path:'/personal/integral/', path: '/personal/integral/'
} }
], ],
userrecord: [ userrecord: [
{ {
title:'日期', title: '日期'
}, },
{ {
title:'积分', title: '积分'
}, },
{ {
title:'类型', title: '类型'
}
},
], ],
usermessage: [ usermessage: [
@ -67,61 +57,55 @@ export default {
title: '2021-09-11', title: '2021-09-11',
rccord: '+100', rccord: '+100',
buycord: '购物积分' buycord: '购物积分'
}, },
{ {
title: '2021-09-11', title: '2021-09-11',
rccord: '+100', rccord: '+100',
buycord: '购物积分' buycord: '购物积分'
}, },
{ {
title: '2021-09-11', title: '2021-09-11',
rccord: '+100', rccord: '+100',
buycord: '购物积分' buycord: '购物积分'
}, },
{ {
title: '2021-09-11', title: '2021-09-11',
rccord: '+100', rccord: '+100',
buycord: '购物积分' buycord: '购物积分'
}, },
{ {
title: '2021-09-11', title: '2021-09-11',
rccord: '+100', rccord: '+100',
buycord: '购物积分' buycord: '购物积分'
},
]
} }
]
};
}, },
methods: { methods: {
// //
async catmessage() { async catmessage() {
let user= JSON.parse(localStorage.getItem("userInfo")); // let user = JSON.parse(localStorage.getItem('userInfo'));
let data = await memberAccount(user.data.id); let data = await memberAccount(this.user.id);
if (data) { if (data) {
this.usermessage = data.data; this.usermessage = data.data;
console.log(this.usermessage.data); console.log(this.usermessage.data);
} }
}, }
}, },
mounted() { mounted() {
this.catmessage(); this.catmessage();
}, },
components: { components: {
Myheader, Myheader
}, },
computed:{
...mapState({
userInfo : state => state.user.userInfo
})
} }
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import url("../../assets/css/integral.less"); @import url('../../assets/css/integral.less');
</style> </style>

View File

@ -11,47 +11,39 @@
<span>{{ userorder }}</span> <span>{{ userorder }}</span>
</div> --> </div> -->
<div class="rc-max-width--xl"> <div class="rc-max-width--xl">
<div class="rc-center"> <div class="rc-center"><img :src="userimage" /></div>
<img :src='userimage' />
</div>
</div> </div>
<div class="rc-max-width--xl ts-special-padding"> <div class="rc-max-width--xl ts-special-padding">
<div class="rc-login"> <div class="rc-login">
<div class="rc-unlogin"> <div class="rc-unlogin">
<div class="rc-people" @click="opendialog()"> <div class="rc-people" @click="opendialog()"><img src="../../assets/image/rc-people.png" alt="" /></div>
<img src="../../assets/image/rc-people.png" alt="" />
</div>
<div class="rc-userlogin"> <div class="rc-userlogin">
<div v-if="!islogin"> <div v-if="!islogin">
<span>{{ usertitle }}</span> <span>{{ usertitle }}</span>
<em>{{ userorder }}</em> <em>{{ userorder }}</em>
</div> </div>
<nuxt-link :to="`/userlogin/login/`"> <nuxt-link :to="`/userlogin/login/`"><span v-if="islogin">登录/注册</span></nuxt-link>
<span v-if="islogin">登录/注册</span>
</nuxt-link>
</div> </div>
</div> </div>
<div class="rc-islogin"> <div class="rc-islogin">
<nuxt-link :to="`/personal/usermember/`" class="ts-right-arr"> <nuxt-link :to="`/personal/usermember/`" class="ts-right-arr"><span>会员权益</span></nuxt-link>
<span>会员权益</span>
</nuxt-link>
</div> </div>
</div> </div>
</div> </div>
<div class="online bold"></div> <div class="online bold"></div>
<div class="rc-max-width--xl ts-special-padding"> <div class="rc-max-width--xl ts-special-padding">
<div class="usercord"> <div class="usercord">
<em>当前积分:{{ rcrcord }}</em> <em>当前积分:{{ rcrcord || 0 }}</em>
<span class="ts-right-arr" @click="userinter">积分明细</span> <span class="ts-right-arr" @click="userinter">积分明细</span>
</div> </div>
<div class="rc-cordd"> <div class="rc-cordd">
<span>距离升级还差:</span> <span class="lackOfPoint">{{ rcvalue }}</span> <span>距离升级还差:</span>
<span class="lackOfPoint">{{ rcvalue }}</span>
<div class="block"> <div class="block">
<div class="ts-point-tag rc-md-up">0</div> <div class="ts-point-tag rc-md-up">0</div>
<div class="r-block" ref="userblock"></div> <div class="r-block" ref="userblock"></div>
<!-- <el-slider v-model="value" range show-stops :max="10"> </el-slider> --> <!-- <el-slider v-model="value" range show-stops :max="10"> </el-slider> -->
</div> </div>
<div class="rc-value"> <div class="rc-value">
<span>0</span> <span>0</span>
@ -66,9 +58,7 @@
<div class="rc-order"> <div class="rc-order">
<em>我的订单</em> <em>我的订单</em>
<span class="ts-right-arr" @click="findall">查看全部</span> <span class="ts-right-arr" @click="findall">查看全部</span>
</div> </div>
<div class="rc-obligation rc-max-width--lg"> <div class="rc-obligation rc-max-width--lg">
<ul> <ul>
@ -100,53 +90,36 @@
</div> </div>
</div> </div>
<div class="online bold"></div> <div class="online bold"></div>
<div class="ts-btn" v-if="!islogin"> <div class="ts-btn" v-if="!islogin"><div class="ts-standard-btn center" @click="logout">退出登录</div></div>
<div class="ts-standard-btn center" @click="logout">退出登录</div>
</div>
</div> </div>
</div> </div>
<el-dialog <el-dialog :visible.sync="dialogInfo1" hegight="700px" :before-close="handleClose" @open="open">
: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-full-width rc-max-width--xl rc-text--center">
<div class="rc-title rc-text--center rc-margin-bottom--md"> <div class="rc-title rc-text--center rc-margin-bottom--md"><img src="../../assets/error.png" alt="" /></div>
<img src="../../assets/error.png" alt="">
</div>
<div class="rc-logmain"> <div class="rc-logmain">
<h3>温馨提示</h3> <h3>温馨提示</h3>
<span>{{ usermessage }}</span> <span>{{ usermessage }}</span>
</div> </div>
<div class="userer"> <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> <span>微信扫一扫识别二维码</span>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
<FixRight></FixRight> <FixRight></FixRight>
<MyFooter></MyFooter> <MyFooter></MyFooter>
</div> </div>
</template> </template>
<script> <script>
import Myheader from '~/components/header.vue' import Myheader from '~/components/header.vue';
import MyFooter from '~/components/rc-footer.vue' import MyFooter from '~/components/rc-footer.vue';
import FixRight from "~/components/fixed-right.vue"; import FixRight from '~/components/fixed-right.vue';
import tabs from "@/components/tabs.vue"; import tabs from '@/components/tabs.vue';
import { mapMutations } from "vuex"; import { mapMutations, mapState } from 'vuex';
export default { export default {
middleware: 'metaTitle', middleware: 'metaTitle',
// middleware: 'metaTitle', // middleware: 'metaTitle',
@ -155,7 +128,7 @@ export default {
return { return {
crumbs: [ crumbs: [
{ {
path:'/personal/mypersonal', path: '/personal/mypersonal'
} }
], ],
userlog: false, userlog: false,
@ -165,52 +138,50 @@ export default {
usertitle: '', usertitle: '',
rcvalue: 5000, rcvalue: 5000,
usermessage: '关注皇家爱宠荟,修改个人资料', usermessage: '关注皇家爱宠荟,修改个人资料',
userimage:require("../../assets/image/rc-new.png"), userimage: require('../../assets/image/rc-new.png'),
userlogin: '登录注册', userlogin: '登录注册',
userorder: "新手铲屎官", userorder: '新手铲屎官',
prefecture: [ prefecture: [
{ {
title: "待付款", title: '待付款',
ordernum: "2", ordernum: '2',
catimage: require("../../assets/image/rc-obligation.png"), catimage: require('../../assets/image/rc-obligation.png')
}, },
{ {
title: "待发货", title: '待发货',
ordernum: "2", ordernum: '2',
catimage: require("../../assets/image/rc-pending.png"), catimage: require('../../assets/image/rc-pending.png')
}, },
{ {
title: "待收货", title: '待收货',
ordernum: "2", ordernum: '2',
catimage: require("../../assets/image/rc-wait.png"), catimage: require('../../assets/image/rc-wait.png')
}, }
], ],
personallist: [ personallist: [
{ {
title: "积分商城", title: '积分商城',
ordernum: "0", ordernum: '0',
buyimage: require("../../assets/image/rc-integral.png"), buyimage: require('../../assets/image/rc-integral.png'),
usertitle: "点击进入爱宠荟", usertitle: '点击进入爱宠荟'
}, },
{ {
title: "优惠券", title: '优惠券',
ordernum: "1", ordernum: '1',
buyimage: require("../../assets/image/rc-discount.png"), buyimage: require('../../assets/image/rc-discount.png'),
usertitle: "查看详情", usertitle: '查看详情'
}, },
{ {
title: "收货地址", title: '收货地址',
ordernum: "2", ordernum: '2',
buyimage: require("../../assets/image/rc-address.png"), buyimage: require('../../assets/image/rc-address.png'),
usertitle: "查看详情", usertitle: '查看详情'
}, }
], ],
rcrcord: '', rcrcord: '',
value: [4, 8], value: [4, 8]
}; };
}, },
components: { components: {
Myheader, Myheader,
@ -218,15 +189,29 @@ export default {
tabs, tabs,
FixRight FixRight
}, },
computed: {
...mapState({
userInfo : state => state.user.userInfo,
loginState : state => state.login.loginState,
})
},
watch:{ 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: { methods: {
...mapMutations(["logoutSystem","checkIsLogin"]), ...mapMutations(['logoutSystem', 'checkIsLogin']),
logout() { logout() {
this.$store.dispatch('logout',this);
this.logoutSystem(); this.logoutSystem();
this.$router.push({ this.$router.push({
path: "/", path: '/'
}); });
}, },
userinter() { userinter() {
@ -236,64 +221,65 @@ export default {
type: 'warning', type: 'warning',
message: '您还未登录' message: '您还未登录'
}); });
return return;
} else { } else {
this.$router.push({ this.$router.push({
path: "/personal/integral/", path: '/personal/integral/',
query: { query: {
stype: 1, stype: 1
}, }
}); });
} }
}, },
findall() { findall() {
let user= this.$store.state.userInfo; let user = this.userInfo;
if(user==undefined||user==null||user==''){ if ( user && this.loginState) {
this.$router.push({
path: '/personal/useraddress/',
query: {
stype: 0
}
});
} else {
this.$message({ this.$message({
type: 'warning', type: 'warning',
message: '您还未登录' message: '您还未登录'
}); });
return return;
} else {
this.$router.push({
path: "/personal/useraddress/",
query: {
stype: 0,
},
});
} }
}, },
// //
obligation(item, index) { obligation(item, index) {
let user= this.$store.state.userInfo; let user = this.userInfo;
if(user==undefined||user==null||user==''){ // console.log(!user , !this.loginState,'22222');
// return false;
if (!user && !this.loginState) {
this.$message({ this.$message({
type: 'warning', type: 'warning',
message: '您还未登录' message: '您还未登录'
}); });
return return;
} else { } else {
if (item.title == '待付款') { if (item.title == '待付款') {
this.$router.push({ this.$router.push({
path: "/personal/useraddress", path: '/personal/useraddress',
query: { query: {
stype: 1, stype: 1
}, }
}); });
} else if (item.title == '待发货') { } else if (item.title == '待发货') {
this.$router.push({ this.$router.push({
path: "/personal/useraddress", path: '/personal/useraddress',
query: { query: {
stype: 2, stype: 2
}, }
}); });
} else if (item.title == '待收货') { } else if (item.title == '待收货') {
this.$router.push({ this.$router.push({
path: "/personal/useraddress", path: '/personal/useraddress',
query: { query: {
stype: 3, stype: 3
}, }
}); });
} }
} }
@ -302,24 +288,21 @@ export default {
this.dialogInfo1 = false; this.dialogInfo1 = false;
console.log(this.dialogInfo1); console.log(this.dialogInfo1);
}, },
open(){ open() {},
},
ifadroind() { ifadroind() {
var sUserAgent = navigator.userAgent.toLowerCase(); var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; var bIsIpad = sUserAgent.match(/ipad/i) == 'ipad';
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os"; var bIsIphoneOs = sUserAgent.match(/iphone os/i) == 'iphone os';
var bIsMidp = sUserAgent.match(/midp/i) == "midp"; var bIsMidp = sUserAgent.match(/midp/i) == 'midp';
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == 'rv:1.2.3.4';
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb"; var bIsUc = sUserAgent.match(/ucweb/i) == 'ucweb';
var bIsAndroid = sUserAgent.match(/android/i) == "android"; var bIsAndroid = sUserAgent.match(/android/i) == 'android';
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce"; var bIsCE = sUserAgent.match(/windows ce/i) == 'windows ce';
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile"; var bIsWM = sUserAgent.match(/windows mobile/i) == 'windows mobile';
if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) { if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
if (this.userlog == true) { if (this.userlog == true) {
this.usermessage='关注皇家爱宠荟,修改个人资料', (this.usermessage = '关注皇家爱宠荟,修改个人资料'), (this.dialogInfo1 = true);
this.dialogInfo1=true;
} else { } else {
this.dialogInfo1 = false; this.dialogInfo1 = false;
this.usermessage = '关注皇家爱宠荟,兑换更多福利'; this.usermessage = '关注皇家爱宠荟,兑换更多福利';
@ -331,50 +314,46 @@ export default {
} }
}, },
openaddress(item, index) { openaddress(item, index) {
let user= this.$store.state.userInfo; let user = this.userInfo;
if (user == undefined || user == null || user == '') { if (user == undefined || user == null || user == '') {
this.$message({ this.$message({
type: 'warning', type: 'warning',
message: '您还未登录' message: '您还未登录'
}); });
return return;
} else { } else {
if (item.title == '收货地址') { if (item.title == '收货地址') {
this.$router.push({ this.$router.push({
path: `/useraddress/openaddress/` path: `/useraddress/openaddress/`
}) });
} }
if (index == 0) { if (index == 0) {
this.userlog=true this.userlog = true;
_hmt.push([ _hmt.push([
"_trackCustomEvent", '_trackCustomEvent',
"jump_to_crmMiniApp", 'jump_to_crmMiniApp',
{ {
"type":"积分商城", type: '积分商城'
} }
]) ]);
let isMobile = this.ifadroind(); let isMobile = this.ifadroind();
if(isMobile) if (isMobile) window.location.href = 'weixin://dl/business/?t=BE1OA2AngRs';
window.location.href="weixin://dl/business/?t=BE1OA2AngRs";
} }
if (index == 1) { if (index == 1) {
this.$router.push({ this.$router.push({
path: `/personal/discount/` path: `/personal/discount/`
}) });
} }
} }
}, },
opendialog() { opendialog() {
this.ifadroind(); this.ifadroind();
}
}, },
mounted() { /* 初始化设置用户信息 */
this.checkIsLogin(); setUserInfoData(userInfo){
// console.log(this.loginState,userInfo,'2222');
let userwidth = 0; let userwidth = 0;
this.ifadroind(); this.userid = userInfo;
let user= this.$store.state.userInfo;
if(user){
this.userid=user.data;
this.islogin = false; this.islogin = false;
this.usertitle = this.userid.memberName; this.usertitle = this.userid.memberName;
this.rcrcord = this.userid.availiblePoint; this.rcrcord = this.userid.availiblePoint;
@ -385,45 +364,53 @@ export default {
this.uservalue = 5000; // this.uservalue = 5000; //
this.rcvalue = this.uservalue - this.userid.availiblePoint; // this.rcvalue = this.uservalue - this.userid.availiblePoint; //
if (userlength == 1 || userlength == 2 || userlength == 3 || userlength == 4) { if (userlength == 1 || userlength == 2 || userlength == 3 || userlength == 4) {
userwidth=this.userid.availiblePoint/100 userwidth = this.userid.availiblePoint / 100;
console.log(userwidth); console.log(userwidth);
} }
} } else if (this.userid.memberLevel == 2) {
else if(this.userid.memberLevel==2){
this.userimage = require('../../assets/image/rc-new2.png'); this.userimage = require('../../assets/image/rc-new2.png');
this.userorder = '资深铲屎官'; this.userorder = '资深铲屎官';
this.uservalue = 10000; this.uservalue = 10000;
this.rcvalue = this.uservalue - this.userid.availiblePoint; this.rcvalue = this.uservalue - this.userid.availiblePoint;
userwidth=this.userid.availiblePoint/100 userwidth = this.userid.availiblePoint / 100;
} else if (this.userid.memberLevel == 3) { } else if (this.userid.memberLevel == 3) {
this.userimage = require('../../assets/image/rc-new1.png'); this.userimage = require('../../assets/image/rc-new1.png');
this.userorder = '金牌铲屎官'; this.userorder = '金牌铲屎官';
this.usrnewlist = this.goldmedal; this.usrnewlist = this.goldmedal;
userwidth=100 userwidth = 100;
} }
this.$refs.userblock.style.width = userwidth + '%'; this.$refs.userblock.style.width = userwidth + '%';
let tagEle = document.querySelector('.ts-point-tag'); let tagEle = document.querySelector('.ts-point-tag');
if (tagEle) { if (tagEle) {
tagEle.innerText = this.userid.availiblePoint; tagEle.innerText = this.userid.availiblePoint;
let tagEleLeft = userwidth - 1; let tagEleLeft = userwidth - 1;
if(tagEleLeft<=0) if (tagEleLeft <= 0) tagEleLeft = 0;
tagEleLeft=0; tagEle.style.left = tagEleLeft + '%';
tagEle.style.left=tagEleLeft+"%";
} }
if (this.userid == undefined || this.userid == '' || this.userid == null) {
this.islogin = true;
}
}
},
mounted() {
// this.checkIsLogin();
this.$store.dispatch('checkLoginState',this);
this.ifadroind();
let user = this.userInfo;
this.islogin = !this.loginState;
if (user && this.loginState) {
this.setUserInfoData(user);
} else { } else {
this.userid = ''; this.userid = '';
} }
if(this.userid==undefined ||this.userid==''||this.userid==null){
this.islogin=true;
} }
},
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import url("@/assets/css/global.less"); @import url('@/assets/css/global.less');
@import url("@/assets/css/mypersonal.less"); @import url('@/assets/css/mypersonal.less');
</style> </style>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -10,23 +10,19 @@
<div class="rc-cat"> <div class="rc-cat">
<div class="rc-center"> <div class="rc-center">
<div class=" rc-title"> <div class=" rc-title">
<em> <em>{{ item.recipient }}</em>
{{ item.recipient }} <span>{{ item.recipientPhone }}</span>
</em>
<span>
{{ item.recipientPhone }}
</span>
</div> </div>
<div class="rc-address"> <div class="rc-address">
<span> <span>{{ item.provinceName }}{{ item.districtName }}{{ item.detailAddress }}</span>
{{item.provinceName}}{{ item.districtName }}{{item.detailAddress}}
</span>
</div> </div>
<div class="rc-footer"> <div class="rc-footer">
<div class="rc-foot"> <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> <span>设置为默认收货地址</span>
</div> </div>
<div class="rc-right"> <div class="rc-right">
<span @click="onEdit(item, index)">编辑</span> <span @click="onEdit(item, index)">编辑</span>
@ -34,86 +30,76 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="online bold rc-md-down"></div> <div class="online bold rc-md-down"></div>
<!-- <div class="usercontend useradd"> <!-- <div class="usercontend useradd">
<img src="../../assets/image/userselect.png" alt=""> <img src="../../assets/image/userselect.png" alt="">
<span>添加收货地址</span> <span>添加收货地址</span>
</div> --> </div> -->
</div> </div>
<div class="userdit" ref="marinaddress"> <div class="userdit" ref="marinaddress">
<div class="alledit" @click="onAdd()"> <div class="alledit" @click="onAdd()">
<img src="../../static/images/adddress.png" alt=""> <img src="../../static/images/adddress.png" alt="" />
<span>添加收货地址</span> <span>添加收货地址</span>
</div> </div>
</div> </div>
</div> </div>
<div class="rc-button"> <div class="rc-button">
<div class="rc-footbutton" @click="onAdd()"> <div class="rc-footbutton" @click="onAdd()"><span>新增收货地址</span></div>
<span>新增收货地址</span>
</div>
</div> </div>
<MyFooter></MyFooter> <MyFooter></MyFooter>
</div> </div>
</template> </template>
<script> <script>
import Myheader from '~/components/header.vue' import Myheader from '~/components/header.vue';
import MyFooter from '~/components/rc-footer.vue' import MyFooter from '~/components/rc-footer.vue';
import tabs from "~/components/tabs.vue"; import tabs from '~/components/tabs.vue';
import { selectaddress,editupdate,editdelete} from "../../ajax/getData"; import { selectaddress, editupdate, editdelete } from '../../ajax/getData';
import { mapState } from 'vuex';
export default { export default {
data() { data() {
return { return {
crumbs: [ crumbs: [
{ {
path:'/personal/mypersonal/', path: '/personal/mypersonal/'
}, },
{ {
path:'/useraddress/openaddress/', path: '/useraddress/openaddress/'
} }
], ],
chosenAddressId: "1", chosenAddressId: '1',
checked: true, checked: true,
userid: null, userid: null,
userlist: [], userlist: [],
usermessage: null, usermessage: null,
list: [ list: []
],
}; };
}, },
methods: { methods: {
changeadddress(item, index) { changeadddress(item, index) {
console.log(item, index); console.log(item, index);
console.log(item.isDefault) console.log(item.isDefault);
if (item.isDefault == false) { if (item.isDefault == false) {
item.isDefault=true item.isDefault = true;
} else { } else {
item.isDefault = false; item.isDefault = false;
} }
this.editupdate(this.userid,item.id,item.isDefault) this.editupdate(this.userid, item.id, item.isDefault);
setTimeout(() => { setTimeout(() => {
this.editaddress(); this.editaddress();
}, 200); }, 200);
// //
}, },
onEdit(item, index) { onEdit(item, index) {
// let userid = item.id; // let userid = item.id;
console.log(item); console.log(item);
// debugger // debugger
this.$router.push({ this.$router.push({
path: "/useraddress/editaddress", path: '/useraddress/editaddress',
query: { query: {
recipient: item.recipient, recipient: item.recipient,
recipientPhone: item.recipientPhone, recipientPhone: item.recipientPhone,
@ -124,16 +110,15 @@ export default {
cityName: item.districtName, cityName: item.districtName,
provinceId: item.provinceId, provinceId: item.provinceId,
districtId: item.districtId, districtId: item.districtId,
cityId:item.cityId, cityId: item.cityId
}
},
}); });
}, },
onAdd(item, index) { onAdd(item, index) {
// let userid = item.id; // let userid = item.id;
// console.log(item); // console.log(item);
this.$router.push({ this.$router.push({
path: "/useraddress/addaddress", path: '/useraddress/addaddress'
// query: { // query: {
// id: userid, // id: userid,
// }, // },
@ -145,8 +130,8 @@ export default {
let useradd = { let useradd = {
memberId: userid, memberId: userid,
id: addressid, id: addressid,
isDefault:isDefault, isDefault: isDefault
} };
let data = await editupdate(useradd); let data = await editupdate(useradd);
if (data) { if (data) {
@ -158,7 +143,6 @@ export default {
// if(data){ // if(data){
// this.editaddress(); // this.editaddress();
// } // }
}, },
// //
@ -176,13 +160,16 @@ export default {
}, },
// //
async editaddress(user) { async editaddress(user) {
// user.data.id=844350;
let data = await selectaddress(this.userid); let data = await selectaddress(this.userid);
console.log(data);
this.list = data.data; this.list = data.data;
// console.log(this.list); // console.log(this.list);
console.log(data);
}, },
/* 初始化数据 */
async resetData(){
this.usermessage = this.userInfo;
this.userid = this.userInfo.id;
this.editaddress(this.userid);
}
}, },
components: { components: {
Myheader, Myheader,
@ -190,17 +177,27 @@ export default {
tabs tabs
}, },
computed:{
...mapState({
userInfo : state => state.user.userInfo,
})
},
watch:{
userInfo(newVal){
this.resetData(newVal);
}
},
mounted() { mounted() {
// //
this.usermessage = JSON.parse(localStorage.getItem("userInfo")); // this.usermessage = JSON.parse(localStorage.getItem('userInfo'));
this.userid = this.usermessage.data.id; if(this.userInfo){
console.log(this.userid); this.resetData();
this.editaddress(this.userid); }
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import url("../../assets/css/openaddress.less"); @import url('../../assets/css/openaddress.less');
</style> </style>

View File

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

View File

@ -571,12 +571,19 @@ export default {
tabs tabs
}, },
mounted() { mounted() {
const { query } = this.$route;
this.activeIndex1 = query.type || 0;
this.activeIndex = query.type || 0;
this.value = query.content || '';
this.usetmessage(); this.usetmessage();
this.userst(); this.userst();
//Handling RxGoods filter //Handling RxGoods filter
let curEnv = process.env.NODE_ENV; let curEnv = process.env.NODE_ENV;
this.rxFilters = envData[curEnv].rxGoodsFilter; this.rxFilters = envData[curEnv].rxGoodsFilter;
//Handling RxGoods filter end //Handling RxGoods filter end
console.log();
}, },
methods: { methods: {
// //
@ -723,6 +730,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.userstandard[0].style.margin = 0 + "px"; 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); let data = await biaome(this.activeIndex1, this.value, 1, 10);
if (data) { if (data) {
this.rccontair = 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} key cookie的键
* @param {String} val cookie的值 * @param {String} val cookie的值
* @param {String} exdays 过期时间默认的话是7天 * @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的键 * @param {String} key cookie的键
*/ */
const getCookie = (key)=>{ const getCookie = (key)=>{
@ -30,8 +30,6 @@ const getCookie = (key)=>{
} }
export { export {
setCookie, setCookie,
getCookie, getCookie,

View File

@ -1,18 +1,20 @@
import user from './modules/user.js'; import user from './modules/user.js';
import login from './modules/login.js';
const state = () => ({ const state = () => ({
// 这里是全局数据保存的地方 // 这里是全局数据保存的地方
tabsList: [ tabsList: [{
{
path: '/', path: '/',
name: 'index', name: 'index',
meta: { meta: {
title: '首页', title: '首页',
} }
}, }, ],
] userInfo : null, //以前遗留的问题 用户数据后台统一用modal里面的userInfo
userKey : 'user_mobile', //存储用户的KEY值
tokenKey : 'token', //存储用户token的key
}) })
@ -48,6 +50,11 @@ const mutations = {
result === -1 ? state.tabsList.push(val.data) : '' result === -1 ? state.tabsList.push(val.data) : ''
}, },
SET_INDEX_USER_INFO(state,data){
state.userInfo = data;
}
// changeMenu(state, user){ // changeMenu(state, user){
// // console.log("vuex存储的变化",JSON.parse(user)) // // console.log("vuex存储的变化",JSON.parse(user))
// // console.log("vuex存储的变化",user) // // console.log("vuex存储的变化",user)
@ -67,8 +74,15 @@ const actions = {
/* 功能模块 */ /* 功能模块 */
const modules = { const modules = {
user, user,
login
} }
export default {namespaced: true, state, mutations, actions,modules} export default {
namespaced: true,
state,
mutations,
actions,
modules
}

View File

@ -1,3 +1,4 @@
// import { getCookie } from "../../plugins/until/until.js";
export default { export default {
state: { state: {
des: '这个存储用户登录逻辑操作', des: '这个存储用户登录逻辑操作',
@ -6,12 +7,51 @@ export default {
/* 存储修改状态的静态方法 */ /* 存储修改状态的静态方法 */
mutations: { mutations: {
/* 设置登录状态 */ /* 设置登录状态 */
SET_LOGIN_STATE(state){ SET_LOGIN_STATE(state, value) {
console.log(state); 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 { export default {
state: { state: {
des: '这个存储用户数据的模块列表', des: '这个存储用户数据的模块列表',
userInfo : {}, //用户信息 userInfo: null, //用户信息
loginState: false, //登录状态 loginState: false, //登录状态
}, },
/* 存储修改状态的静态方法 */ /* 存储修改状态的静态方法 */
mutations: { mutations: {
/* 设置用户信息 */ /* 设置用户信息 */
SET_USER_INFO(state){ SET_USER_INFO(state, userInfo) {
console.log(state); 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,
})
}
} }
} }