Merge branch 'sit-Carl' of https://gitee.com/carl_Ming_1/smart-admin into sit-He-v3

This commit is contained in:
summation 2022-01-21 21:58:02 +08:00
commit 90756f56b9
17 changed files with 641 additions and 25383 deletions

View File

@ -187,7 +187,7 @@ export const userquery = (stype) => {
goodsName:stype goodsName:stype
} }
return fetch('goods?goodsName='+stype, data, 'POST' ) return fetch('goods?petType='+stype, data, 'POST' )
} }
//商品全部信息 //商品全部信息
export const userque = (stype) => { export const userque = (stype) => {

View File

@ -58,7 +58,7 @@
.rc-max-width--xl{ .rc-max-width--xl{
padding: 24px 20px 0 20px; padding: 24px 20px 0 20px;
input{ input{
width: 258px; width: 100%;
height: 34px; height: 34px;
border: none; border: none;
border-bottom: 1px solid #808285; border-bottom: 1px solid #808285;
@ -69,13 +69,12 @@
span{ span{
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
width: 22%; width: 6rem;
text-align: center; text-align: center;
color: #333333; color: #333333;
margin-top: 2px; margin-top: 2px;
} }
.rc-people{ .rc-people{
width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
span{ span{
@ -106,10 +105,10 @@
justify-content: center; justify-content: center;
font-size: 14px; font-size: 14px;
width: 100%; width: 100%;
box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1);
height: 80px; height: 80px;
align-items: center; align-items: center;
padding:0 20px 0 20px; padding:0 20px 0 20px;
margin-bottom:1.5rem;
span span
{ {
width: 160px; width: 160px;
@ -217,7 +216,7 @@
span{ span{
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
width: 10%; width: 4.75rem;
text-align: center; text-align: center;
color: #333333; color: #333333;
margin-top: 2px; margin-top: 2px;

View File

@ -432,7 +432,8 @@ img, picture {
} }
.ts-product-list{ .ts-product-list{
text-align: left; text-align: left;
display:block; //display:block;
display:flex;
li{ li{
max-width:20rem; max-width:20rem;
min-width:18.75rem; min-width:18.75rem;
@ -621,8 +622,8 @@ img, picture {
display:flex; display:flex;
//justify-content: space-between; //justify-content: space-between;
li{ li{
//margin-left:0; margin-left:0;
//margin-right:0; margin-right:0;
} }
} }
} }

View File

@ -383,6 +383,14 @@
} }
.ts-banner-swiper-container{ .ts-banner-swiper-container{
position:relative; position:relative;
picture
{
min-height:12rem;
width:100%;
img{
margin:0 auto;
}
}
.ts-carousel-indicator{ .ts-carousel-indicator{
position:absolute; position:absolute;
bottom:.4rem; bottom:.4rem;

View File

@ -571,7 +571,7 @@ border-radius: 30px;
h2{ h2{
display: flex; display: flex;
align-items: center; align-items: center;
width: 4%; width: 3.25rem;
} }
.ts-scrollable{ .ts-scrollable{
width: 100%; width: 100%;

View File

@ -230,7 +230,7 @@ margin-left: 0.18rem;
display: block; display: block;
margin-left: 0.5rem; margin-left: 0.5rem;
display: block; display: block;
cursor: pointer;
} }
} }
@ -390,7 +390,7 @@ border-radius: 100px;
h2{ h2{
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
width: 3.25rem;
} }
} }
.rc-padding--md{ .rc-padding--md{
@ -452,6 +452,7 @@ cursor: pointer;
/deep/.el-dialog { /deep/.el-dialog {
width: 920px; width: 920px;
background: #FFFFFF; background: #FFFFFF;
max-width:unset;
} }
/deep/.van-search__action{ /deep/.van-search__action{
display: block; display: block;
@ -511,7 +512,7 @@ margin-left: 8px;
display: block; display: block;
margin-left: 0.5rem; margin-left: 0.5rem;
display: block; display: block;
cursor:pointer;
} }
} }
@ -624,6 +625,7 @@ border-radius: 30px;
} }
/deep/.van-search{ /deep/.van-search{
padding-left: 0; padding-left: 0;
width:100%;
} }
.van-search__content--square{ .van-search__content--square{
display: flex; display: flex;
@ -632,7 +634,7 @@ border-radius: 30px;
background: white; background: white;
border: 1px solid #D7D7D7; border: 1px solid #D7D7D7;
height: 50px; height: 50px;
width: 1200px; width:100%;
border-radius: 200px; border-radius: 200px;
} }
/deep/.van-field__left-icon /deep/.van-field__left-icon
@ -669,6 +671,7 @@ border-radius: 30px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-left: 32px; margin-left: 32px;
cursor: pointer;
} }
li:first-child{ li:first-child{
margin-left: 0; margin-left: 0;

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -63,8 +63,7 @@ export default {
{ {
defaultValues = this.defaultValues; defaultValues = this.defaultValues;
this.onConfirm(defaultValues); this.onConfirm(defaultValues);
} } else {
else{
this.defaultValues = defaultValues; this.defaultValues = defaultValues;
} }
@ -237,6 +236,8 @@ export default {
popAddress() { popAddress() {
this.show=true; this.show=true;
let _self=this; let _self=this;
//mobile
//const picker = this.selectComponent('.ts-area-picker-mobile-component');
if(this.defaultValues && this.defaultValues.length>0) if(this.defaultValues && this.defaultValues.length>0)
{ {
this.defaultValues.forEach(function(ele,index){ this.defaultValues.forEach(function(ele,index){
@ -248,16 +249,6 @@ export default {
}); });
} }
//mobile
//const picker = this.selectComponent('.ts-area-picker-mobile-component');
this.defaultValues.forEach(function(ele,index){
let tmpPointer=parseInt(_self.inArray(ele,_self.columns[index].values));
if(tmpPointer)
{
_self.columns[index].defaultIndex = tmpPointer;
}
});
// setTimeout(function(){ // setTimeout(function(){
// //debugger; // //debugger;
// _self.$children.forEach(function(vueComponent){ // _self.$children.forEach(function(vueComponent){
@ -460,6 +451,18 @@ export default {
/deep/.van-picker__confirm{ /deep/.van-picker__confirm{
display:block; display:block;
} }
.ts-area-picker-container { width:100%; }
.ts-area-picker-value-displayer {
border: none;
border-bottom: 1px solid #808285;
color: #999999;
font-size: 16px;
margin-left: 2px;
width:100%;
padding-bottom:.25rem;
background:url("../assets/image/ico-location.png") no-repeat 98% center;
background-size:16px;
}
.ts-area-picker-mobile{ .ts-area-picker-mobile{
display:flex; display:flex;
flex-direction: column; flex-direction: column;
@ -471,17 +474,6 @@ export default {
} }
.ts-area-picker-desktop{ .ts-area-picker-desktop{
display:none; display:none;
}
.ts-area-picker-value-displayer{
width: 258px;
height: 34px;
border: none;
border-bottom: 1px
solid #808285;
color: #999999;
font-size: 16px;
margin-left: 2px;
padding-left: 0;
} }
} }
@media screen and (min-width:769px) @media screen and (min-width:769px)
@ -493,7 +485,14 @@ export default {
display:none; display:none;
} }
.ts-area-picker-container,.ts-area-picker-value-displayer{ .ts-area-picker-container,.ts-area-picker-value-displayer{
width:40rem; width:42.5rem;
}
.ts-area-picker-value-displayer{
padding-left:1rem;
height:2.8rem;
background:url("../assets/image/arr-down.jpg") no-repeat 98% center;
background-size:20px;
border: 1px solid #808285;
} }
.ts-area-picker-desktop{ .ts-area-picker-desktop{
position:absolute; position:absolute;
@ -505,6 +504,7 @@ export default {
border:1px solid #808285; border:1px solid #808285;
overflow:hidden; overflow:hidden;
background:#fff; background:#fff;
z-index:1;
} }
} }
@keyframes flash-error @keyframes flash-error

File diff suppressed because it is too large Load Diff

View File

@ -129,6 +129,7 @@
<van-tabs @click='catclickShi' class="van-tabs" v-if="onemao" v-model="maoshiCurIndex"> <van-tabs @click='catclickShi' class="van-tabs" v-if="onemao" v-model="maoshiCurIndex">
<van-tab v-for="(item,index) in discoun" :key="index" :title="item.title"> <van-tab v-for="(item,index) in discoun" :key="index" :title="item.title">
<div class="rc-contair"> <div class="rc-contair">
<div class="ts-no-data" v-if="!catshi.length">暂未发现相关记录</div>
<ul class="ts-product-list rc-margin-bottom--lg"> <ul class="ts-product-list rc-margin-bottom--lg">
<li v-for="(item,index) in catshi" :key="index" class="rc-margin-top--md"> <li v-for="(item,index) in catshi" :key="index" class="rc-margin-top--md">
<div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)"> <div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)">
@ -147,7 +148,7 @@
</ul> </ul>
<nuxt-link :to="`/productdetails/productlist/`"> <nuxt-link :to="`/productdetails/productlist/?stype=0&tagStatus=2`">
<div class="userserlect"> <div class="userserlect">
<span class="ts-standard-btn center">查看更多</span> <span class="ts-standard-btn center">查看更多</span>
</div> </div>
@ -183,6 +184,7 @@
</ul> </ul>
</div> </div>
<div class=""> <div class="">
<div class="ts-no-data" v-if="!rccontair.length">暂未发现相关记录</div>
<ul class="ts-product-list rc-margin-bottom--lg"> <ul class="ts-product-list rc-margin-bottom--lg">
<li v-for="(item,index) in rccontair" :key="index" class="rc-margin-top--md"> <li v-for="(item,index) in rccontair" :key="index" class="rc-margin-top--md">
<div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)"> <div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)">
@ -199,7 +201,7 @@
</div> </div>
</li> </li>
</ul> </ul>
<nuxt-link :to="`/productdetails/productlist/`"> <nuxt-link :to="`/productdetails/productlist/?stype=0&tagStatus=2`">
<div class="userserlect"> <div class="userserlect">
<span class="ts-standard-btn center">查看更多</span> <span class="ts-standard-btn center">查看更多</span>
</div> </div>
@ -213,6 +215,7 @@
<van-tabs @click='catclickGan' class="van-tabs" v-if="twomao" v-model="maoganCurIndex"> <van-tabs @click='catclickGan' class="van-tabs" v-if="twomao" v-model="maoganCurIndex">
<van-tab v-for="(item,index) in discoun" :key="index" :title="item.title"> <van-tab v-for="(item,index) in discoun" :key="index" :title="item.title">
<div class="rc-contair"> <div class="rc-contair">
<div class="ts-no-data" v-if="!catgan.length">暂未发现相关记录</div>
<ul class="ts-product-list rc-margin-bottom--lg"> <ul class="ts-product-list rc-margin-bottom--lg">
<li v-for="(item,index) in catgan" :key="index" class="rc-margin-top--md"> <li v-for="(item,index) in catgan" :key="index" class="rc-margin-top--md">
<div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)"> <div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)">
@ -231,7 +234,7 @@
</ul> </ul>
<nuxt-link :to="`/productdetails/productlist/`"> <nuxt-link :to="`/productdetails/productlist/?stype=0&tagStatus=1`">
<div class="userserlect"> <div class="userserlect">
<span class="ts-standard-btn center">查看更多</span> <span class="ts-standard-btn center">查看更多</span>
</div> </div>
@ -270,6 +273,7 @@
</ul> </ul>
</div> </div>
<div class="rc-contair"> <div class="rc-contair">
<div class="ts-no-data" v-if="!rccontair.length">暂未发现相关记录</div>
<ul class="ts-product-list rc-margin-bottom--lg"> <ul class="ts-product-list rc-margin-bottom--lg">
<li v-for="(item,index) in rccontair" :key="index" class="rc-margin-top--md"> <li v-for="(item,index) in rccontair" :key="index" class="rc-margin-top--md">
<div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)"> <div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)">
@ -286,7 +290,7 @@
</div> </div>
</li> </li>
</ul> </ul>
<nuxt-link :to="`/productdetails/productlist/`"> <nuxt-link :to="`/productdetails/productlist/?stype=0&tagStatus=1`">
<div class="userserlect"> <div class="userserlect">
<span class="ts-standard-btn center">查看更多</span> <span class="ts-standard-btn center">查看更多</span>
</div> </div>
@ -377,6 +381,7 @@
</div> </div>
<div class="rc-contair"> <div class="rc-contair">
<div class="ts-no-data" v-if="!dogshi.length">暂未发现相关记录</div>
<ul class="ts-product-list rc-margin-bottom--lg"> <ul class="ts-product-list rc-margin-bottom--lg">
<li v-for="(item,index) in dogshi" :key="index" class="rc-margin-top--md"> <li v-for="(item,index) in dogshi" :key="index" class="rc-margin-top--md">
<div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)"> <div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)">
@ -395,7 +400,7 @@
</ul> </ul>
<nuxt-link :to="`/productdetails/productlist/`"> <nuxt-link :to="`/productdetails/productlist/?stype=1&tagStatus=2`">
<div class="userserlect"> <div class="userserlect">
<span class="ts-standard-btn center">查看更多</span> <span class="ts-standard-btn center">查看更多</span>
</div> </div>
@ -437,6 +442,7 @@
</ul> </ul>
</div> </div>
<div class="rc-contair"> <div class="rc-contair">
<div class="ts-no-data" v-if="!rccontair.length">暂未发现相关记录</div>
<ul class="ts-product-list rc-margin-bottom--lg"> <ul class="ts-product-list rc-margin-bottom--lg">
<li v-for="(item,index) in rccontair" :key="index" class="rc-margin-top--md"> <li v-for="(item,index) in rccontair" :key="index" class="rc-margin-top--md">
<div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)"> <div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)">
@ -454,7 +460,7 @@
</li> </li>
</ul> </ul>
<nuxt-link :to="`/productdetails/productlist/`"> <nuxt-link :to="`/productdetails/productlist/?stype=1&tagStatus=2`">
<div class="userserlect"> <div class="userserlect">
<span class="ts-standard-btn center">查看更多</span> <span class="ts-standard-btn center">查看更多</span>
</div> </div>
@ -491,6 +497,7 @@
</ul> </ul>
</div> </div>
<div class="rc-contair"> <div class="rc-contair">
<div class="ts-no-data" v-if="!doggan.length">暂未发现相关记录</div>
<ul class="ts-product-list rc-margin-bottom--lg"> <ul class="ts-product-list rc-margin-bottom--lg">
<li v-for="(item,index) in doggan" :key="index" class="rc-margin-top--md"> <li v-for="(item,index) in doggan" :key="index" class="rc-margin-top--md">
<div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)"> <div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)">
@ -508,7 +515,7 @@
</li> </li>
</ul> </ul>
<nuxt-link :to="`/productdetails/productlist/`"> <nuxt-link :to="`/productdetails/productlist/?stype=1&tagStatus=1`">
<div class="userserlect"> <div class="userserlect">
<span class="ts-standard-btn center">查看更多</span> <span class="ts-standard-btn center">查看更多</span>
</div> </div>
@ -550,6 +557,7 @@
</ul> </ul>
</div> </div>
<div class="rc-contair"> <div class="rc-contair">
<div class="ts-no-data" v-if="!rccontair.length">暂未发现相关记录</div>
<ul class="ts-product-list rc-margin-bottom--lg"> <ul class="ts-product-list rc-margin-bottom--lg">
<li v-for="(item,index) in rccontair" :key="index" class="rc-margin-top--md"> <li v-for="(item,index) in rccontair" :key="index" class="rc-margin-top--md">
<div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)"> <div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)">
@ -566,7 +574,7 @@
</div> </div>
</li> </li>
</ul> </ul>
<nuxt-link :to="`/productdetails/productlist/`"> <nuxt-link :to="`/productdetails/productlist/?stype=1&tagStatus=1`">
<div class="userserlect"> <div class="userserlect">
<span class="ts-standard-btn center">查看更多</span> <span class="ts-standard-btn center">查看更多</span>
</div> </div>
@ -587,6 +595,7 @@
<van-tabs @click='userclick' class="van-tabs" v-if="fivemao"> <van-tabs @click='userclick' class="van-tabs" v-if="fivemao">
<van-tab v-for="(item,index) in discounchufang" :key="index" :title="item.title"> <van-tab v-for="(item,index) in discounchufang" :key="index" :title="item.title">
<div class="rc-contair"> <div class="rc-contair">
<div class="ts-no-data" v-if="!processinformation.length">暂未发现相关记录</div>
<ul class="ts-product-list rc-margin-bottom--lg"> <ul class="ts-product-list rc-margin-bottom--lg">
<li v-for="(item,index) in processinformation" :key="index" class="rc-margin-top--md rc-padding-bottom--lg"> <li v-for="(item,index) in processinformation" :key="index" class="rc-margin-top--md rc-padding-bottom--lg">
<div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)"> <div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)">
@ -603,7 +612,7 @@
</ul> </ul>
<nuxt-link :to="`/productdetails/productlist/`"> <nuxt-link :to="`/productdetails/productlist/?stype=1&rxgoods=1`">
<div class="userserlect"> <div class="userserlect">
<span class="ts-standard-btn center">查看更多</span> <span class="ts-standard-btn center">查看更多</span>
</div> </div>
@ -645,6 +654,7 @@
</ul> </ul>
</div> </div>
<div class="rc-contair"> <div class="rc-contair">
<div class="ts-no-data" v-if="!rccontair.length">暂未发现相关记录</div>
<ul class="ts-product-list rc-margin-bottom--lg"> <ul class="ts-product-list rc-margin-bottom--lg">
<li v-for="(item,index) in rccontair" :key="index" class="rc-margin-top--md rc-padding-bottom--lg"> <li v-for="(item,index) in rccontair" :key="index" class="rc-margin-top--md rc-padding-bottom--lg">
<div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)"> <div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)">
@ -985,7 +995,7 @@
title: "主食级狗湿粮", title: "主食级狗湿粮",
video:"/images/dog/one.mp4", video:"/images/dog/one.mp4",
catimage: "/images/dog/one.jpg", catimage: "/images/dog/one.jpg",
productimage: "/images/cat/star-1.png", productimage: "/images/dog/star-1.png",
detail:'柔软细腻慕斯 适合离乳期幼犬舔食', detail:'柔软细腻慕斯 适合离乳期幼犬舔食',
price:'¥77', price:'¥77',
}, },

View File

@ -1,9 +1,5 @@
<template> <template>
<div> <div>
<transition name="fade">
<div class="userloding" v-show="isLoading"></div>
</transition>
<Myheader></Myheader> <Myheader></Myheader>
<div class="rc-top"></div> <div class="rc-top"></div>
<div class="rc-max-width--xl rc-main"> <div class="rc-max-width--xl rc-main">
@ -35,6 +31,7 @@
:key="index" :key="index"
@click="selectproduct(item, index)" @click="selectproduct(item, index)"
:class="item.checked ? 'active' : 'unactive'" :class="item.checked ? 'active' : 'unactive'"
v-bind="item"
ref="chosebox" ref="chosebox"
> >
{{ item.tagName }} {{ item.tagName }}
@ -93,7 +90,7 @@
<!-- rc-main end --> <!-- rc-main end -->
<div class="online bold"></div> <div class="online bold"></div>
<!-- rc-main start --> <!-- rc-main start -->
<div class="rc-max-width--xl"> <div class="rc-max-width--xl rc-margin-bottom--lg">
<div class="usersearch"> <div class="usersearch">
<div class="rc-contair"> <div class="rc-contair">
<ul class="ts-product-list"> <ul class="ts-product-list">
@ -113,7 +110,7 @@
<div class="rc-column"> <div class="rc-column">
<div class="rc-click" @click="selectproduce(item)"> <div class="rc-click" @click="selectproduce(item)">
<span>{{ item.categoryName }}</span> <span>{{ item.categoryName }}</span>
<i>{{ item.ecPrice }}</i> <i>{{ item.ecPrice?("¥"+item.ecPrice):'' }}</i>
</div> </div>
<strong <strong
class=" class="
@ -299,6 +296,11 @@
<em>确认</em> <em>确认</em>
</div> </div>
</el-dialog> </el-dialog>
<div v-if="isLoading" class="ts-mask">
<div class="ts-mask-bg"></div>
<div class="userloding"></div>
<span>数据加载中</span>
</div>
<MyFooter></MyFooter> <MyFooter></MyFooter>
</div> </div>
</template> </template>
@ -311,26 +313,24 @@ import {
biaome, biaome,
biaomessage, biaomessage,
searchchanpin, searchchanpin,
userquery
} from "../../ajax/getData"; } from "../../ajax/getData";
export default { export default {
data() { data() {
return { return {
value: "", value: "",
isLoading: true, isLoading: false,
userstype: [], userstype: [],
activeIndex: "-1", activeIndex: 0,
allacindex: 0, allacindex: 0,
userishwo: true, userishwo: true,
userishwo1: true,
userishwo2: true,
userishwo3: true,
userishwo4: true, userishwo4: true,
userserachlist: [ userserachlist: [
{ {
categoryName: "", // categoryName: [], //
tagUsedAge: "", // tagUsedAge: [], //
tagFunction: "", // tagFunction: [], //
tagBreed: "", // tagBreed: [], //
}, },
], ],
activeIndex1: 0, activeIndex1: 0,
@ -393,27 +393,16 @@ export default {
}, },
], ],
extraPrefecture: [
{
tagName: "处方粮",
ordernum: "99",
catimage: require("../../assets/image/rc-dog.png"),
isRxGoods:1
},
],
prefecture: [ prefecture: [
{
title: "猫湿粮",
ordernum: "2",
catimage: require("../../assets/image/rc-dog.png"),
},
{
title: "品种猫粮",
ordernum: "2",
catimage: require("../../assets/image/rc-dog.png"),
},
{
title: "营养猫粮",
ordernum: "2",
catimage: require("../../assets/image/rc-dog.png"),
},
{
title: "功能猫粮",
ordernum: "2",
catimage: require("../../assets/image/rc-dog.png"),
},
], ],
catage: [ catage: [
{ {
@ -472,62 +461,77 @@ export default {
rccontair: [ rccontair: [
{ {
title: "皇家英国短毛猫全价湿粮", title: "",
price: "¥123.45", price: "",
ordernum: 1, ordernum: 1,
catimage: '',
catimage: require("../../assets/image/rc-cat.png"),
},
{
title: "皇家英国短毛猫全价湿粮",
price: "¥123.45",
ordernum: "2",
catimage: require("../../assets/image/rc-dog.png"),
},
{
title: "皇家英国短毛猫全价湿粮",
price: "¥123.45",
ordernum: "2",
catimage: require("../../assets/image/rc-dog.png"),
},
{
title: "皇家英国短毛猫全价湿粮",
price: "¥123.45",
ordernum: "2",
catimage: require("../../assets/image/rc-dog.png"),
},
{
title: "皇家英国短毛猫全价湿粮",
price: "¥123.45",
ordernum: "2",
catimage: require("../../assets/image/rc-dog.png"),
}, },
], ],
routeParams:[],
rxGoodsIndexPointer:0
}; };
}, },
components: { components: {
Myheader, Myheader,
MyFooter MyFooter
}, },
created() {
this.routeParams=this.$route.query;
let stype = this.routeParams.stype;
stype = (stype=='0'?0:1);
if(stype>-1){
this.activeIndex = this.routeParams.stype;//Initialized pet type selection
}
},
mounted() { mounted() {
let stype = this.$route.query.stype;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.userstandard[0].style.margin = 0 + "px"; this.$refs.userstandard[0].style.margin = 0 + "px";
}); });
this.userst(); let tagSettingPromise = this.userst();
// this.activeIndex = stype; let _self = this;
// if (stype !== "" && stype !== undefined) { tagSettingPromise.then(function(resolve){
// this.onmessage(stype); _self.selectGoods(null,_self.activeIndex,true);
// } else { _self.chooseDefaultOptions();
// this.usetmessage(); //_self.usetmessage();
// } });
/*
if (stype !== "" && stype !== undefined) {
this.onmessage(stype);//Wont happen
} else {
this.usetmessage();
}
*/
}, },
methods: { methods: {
async usersearch(stype, usertype) { async usersearch(stype, usertype) {
let data = await searchchanpin(stype, usertype, 1, 10); this.isLoading=true;
let data = undefined;
if(this.prefecture[this.rxGoodsIndexPointer].checked==true){
data = await userquery(usertype, 1, 12);
}
else{
let searchCriteria=[{}];
for(let key in stype[0]){
if(stype[0][key].length>0){
if(typeof stype[0][key] == 'string') {
searchCriteria[0][key]=stype[0][key];
}
else {
searchCriteria[0][key]=stype[0][key].join(',');
}
if(key=='categoryName' && searchCriteria[0][key].indexOf("湿")>-1){
searchCriteria[0]['tagStatus']=2;
}
}
}
data = await searchchanpin(searchCriteria, usertype, 1, 12);
}
if (data) { if (data) {
this.rccontair = data; this.rccontair = data;
this.isLoading=false;
} }
}, },
async userst() { async userst() {
@ -571,9 +575,14 @@ export default {
element.checked = false; element.checked = false;
}); });
} }
console.log(pinzhong); //console.log(pinzhong);
// debugger // debugger
}); });
let _self = this;
this.extraPrefecture.forEach(function(ele){
_self.prefecture.push(ele);
_self.rxGoodsIndexPointer = _self.prefecture.length-1;
});
this.userdoglisgt = this.userstype.filter((item) => item.petType == "1"); this.userdoglisgt = this.userstype.filter((item) => item.petType == "1");
}, },
@ -593,7 +602,125 @@ export default {
this.isLoading = false; this.isLoading = false;
} }
}, },
chooseDefaultOptions(){
let tagStatus = this.routeParams.tagStatus;
let categoryName = this.routeParams.categoryName;
let rxgoods = this.routeParams.rxgoods;
let tagUsedAge = this.routeParams.tagUsedAge;
let key = this.routeParams.key;
let _self = this;
if(tagStatus && tagStatus.length>0) {
tagStatus=='1'?1:2;//1:, 2:湿
} else {
tagStatus = 0;
}
if(rxgoods && rxgoods.length>0) {
rxgoods=='1'?1:0;
} else {
rxgoods = 0;
}
if(categoryName && categoryName.length>0) {
categoryName = categoryName.split(",");
} else {
categoryName = [];
}
if(tagUsedAge && tagUsedAge.length>0) {
tagUsedAge = tagUsedAge.split(",");
} else {
tagUsedAge = [];
}
//RxGood handling
if(rxgoods) {
this.checkRxGoods(true);
this.usersearch([],this.activeIndex);
return;
}
//RxGood handling
//Category Handling
if(tagStatus || categoryName.length>0) {
for(let item of this.prefecture){
if(item.tagName.indexOf('湿')>-1){
if(tagStatus==2) {
item.checked=true;
}
} else {
if(tagStatus==1 && item.tagName!=this.prefecture[this.rxGoodsIndexPointer].tagName){
item.checked=true;
}
}
if(categoryName.indexOf(item.tagName)>-1) {
item.checked=true;
}
}
if(tagStatus)
this.userserachlist[0].tagStatus=tagStatus;
if(categoryName.length>0)
this.userserachlist[0].categoryName=categoryName;
}
//Category Handling end
//Age Handling
if(tagUsedAge.length>0) {
this.catage.forEach(function(item,index){
if(tagUsedAge.indexOf(item.tagName)>-1) {
item.checked=true;
}
});
this.userserachlist[0].tagUsedAge=tagUsedAge;
}
//Age Handling end
//go query
this.usersearch(this.userserachlist,this.activeIndex1);
},
checkRxGoods(toggleSwitch){
let _self = this;
let categoriesSelectionEles=this.prefecture;
let functionalSelectionEles=this.catagea;
let ageSelectionEles=this.catage;
let breedSelectionEles=this.catageb;
let allSelectionEles=categoriesSelectionEles.concat(functionalSelectionEles,ageSelectionEles,breedSelectionEles);
if(toggleSwitch)
{
allSelectionEles.forEach(function(tmp,index){
tmp.checked=false;
if(tmp.isRxGoods)
{
tmp.checked=true;
}
});
}
else
this.prefecture[this.rxGoodsIndexPointer].checked=false;
},
resetAllOptions(){
let _self = this;
let categoriesSelectionEles=this.prefecture;
let functionalSelectionEles=this.catagea;
let ageSelectionEles=this.catage;
let breedSelectionEles=this.catageb;
let allSelectionEles=categoriesSelectionEles.concat(functionalSelectionEles,ageSelectionEles,breedSelectionEles);
allSelectionEles.forEach(function(tmp,index){
tmp.checked=false;
});
this.userserachlist = [
{
categoryName: [], //
tagUsedAge: [], //
tagFunction: [], //
tagBreed: [], //
},
];
},
userbuy() { userbuy() {
this.$router.push({ this.$router.push({
path: "/myorder/userrecord", path: "/myorder/userrecord",
@ -636,7 +763,7 @@ export default {
bIsWM bIsWM
) )
) { ) {
console.log("当前是电脑打开"); //console.log("");
this.$nextTick(() => { this.$nextTick(() => {
this.isadrond = false; this.isadrond = false;
this.dialogInfo1 = true; this.dialogInfo1 = true;
@ -644,7 +771,7 @@ export default {
this.isshow = false; this.isshow = false;
}); });
} else { } else {
console.log("当前是手机打开"); //console.log("");
this.$nextTick(() => { this.$nextTick(() => {
this.isadrond = true; this.isadrond = true;
this.isshow = true; this.isshow = true;
@ -654,25 +781,13 @@ export default {
} }
}, },
selectGoods(item, index) { selectGoods(item, index, onlyRefreshCategory) {
this.activeIndex1 = index; this.activeIndex1 = index;
this.activeIndex = index; this.activeIndex = index;
this.allacindex = index; this.allacindex = index;
this.resetAllOptions();
if(!onlyRefreshCategory)
this.usersearch(this.userserachlist, this.activeIndex1); this.usersearch(this.userserachlist, this.activeIndex1);
// for (let i = 0; i < this.userserachlist.length; i++) {
// if (!this.userserachlist.includes(petType)) {
// this.userserachlist.push(petType);
// }
// }
this.userserachlist = [
{
categoryName: "", //
tagUsedAge: "", //
tagFunction: "", //
tagBreed: "", //
},
];
let pinzhong = []; let pinzhong = [];
let zhuanqu = []; let zhuanqu = [];
let age = []; let age = [];
@ -729,6 +844,11 @@ export default {
}); });
} }
let _self = this;
this.extraPrefecture.forEach(function(ele){
_self.prefecture.push(ele);
_self.rxGoodsIndexPointer = _self.prefecture.length-1;
});
this.activeIndex = index; this.activeIndex = index;
}, },
selectGoodsa(item, index) { selectGoodsa(item, index) {
@ -746,26 +866,32 @@ export default {
this.$refs.usercontent.style.display = "block "; this.$refs.usercontent.style.display = "block ";
}); });
}, },
utilSimpleArrayRemove(haystack,needle){
if(haystack.length<=0)
return false;
let index=haystack.indexOf(needle);
if(index>-1)
{
haystack.splice(index,1);
return true;
}
return false;
},
selectsearch(item, index) { selectsearch(item, index) {
this.activeIndexa = index; this.activeIndexa = index;
}, },
selectage(item, index) { selectage(item, index) {
this.checkRxGoods(false);
if(this.activeIndex=='-1'){ if(this.activeIndex=='-1'){
this.activeIndex=0; this.activeIndex=0;
} }
let tagUsedAge = {}; let tagUsedAge = {};
this.activeIndexc = index; this.activeIndexc = index;
this.userishwo1 = !this.userishwo1; item.checked = !item.checked;
console.log(this.userishwo1);
if (item.checked == false) { if (item.checked == false) {
item.checked = true; this.utilSimpleArrayRemove(this.userserachlist[0].tagUsedAge,item.tagName);
this.userserachlist[0].tagUsedAge = item.tagName;
this.$refs.chosebox1[index].className = "active";
} else { } else {
this.userserachlist[0].tagUsedAge = ""; this.userserachlist[0].tagUsedAge.push(item.tagName);
item.checked = false;
this.$refs.chosebox1[index].className = "unactive";
} }
// for (let i = 0; i < this.userserachlist.length; i++) { // for (let i = 0; i < this.userserachlist.length; i++) {
@ -776,21 +902,19 @@ export default {
this.usersearch(this.userserachlist, this.activeIndex1); this.usersearch(this.userserachlist, this.activeIndex1);
}, },
selectagc(item, index) { selectagc(item, index) {
this.checkRxGoods(false);
// let tagFunction = {}; // let tagFunction = {};
if(this.activeIndex=='-1'){ if(this.activeIndex=='-1'){
this.activeIndex=0; this.activeIndex=0;
} }
this.activeIndexd = index; this.activeIndexd = index;
this.userishwo2 = !this.userishwo2; item.checked = !item.checked;
if (item.checked == false) { if (item.checked == false) {
item.checked = true; this.utilSimpleArrayRemove(this.userserachlist[0].tagFunction,item.tagName);
this.$refs.cgosebox4[index].className = "active";
this.userserachlist[0].tagFunction = item.tagName;
} else { } else {
item.checked = false; this.userserachlist[0].tagFunction.push(item.tagName);
this.$refs.cgosebox4[index].className = "unactive";
this.userserachlist[0].tagFunction = "";
} }
// if (this.userishwo2 == false) { // if (this.userishwo2 == false) {
// tagFunction = { // tagFunction = {
// petType: this.allacindex, // petType: this.allacindex,
@ -810,22 +934,18 @@ export default {
this.usersearch(this.userserachlist, this.activeIndex1); this.usersearch(this.userserachlist, this.activeIndex1);
}, },
selectagd(item, index) { selectagd(item, index) {
this.checkRxGoods(false);
if(this.activeIndex=='-1'){ if(this.activeIndex=='-1'){
this.activeIndex=0; this.activeIndex=0;
} }
let tagBreed = {}; let tagBreed = {};
this.activeIndexe = index; this.activeIndexe = index;
this.userishwo3 = !this.userishwo3; item.checked = !item.checked;
if (item.checked == false) { if (item.checked == false) {
item.checked = true; this.utilSimpleArrayRemove(this.userserachlist[0].tagBreed,item.tagName);
this.$refs.chosebox3[index].className = "active";
this.userserachlist[0].tagBreed = item.tagName;
} else { } else {
item.checked = false; this.userserachlist[0].tagBreed.push(item.tagName);
this.$refs.chosebox3[index].className = "unactive";
this.userserachlist[0].tagBreed = "";
} }
// this.$refs.chosebox3[index].className = "unactive"; // this.$refs.chosebox3[index].className = "unactive";
// for (let i = 0; i < this.userserachlist.length; i++) { // for (let i = 0; i < this.userserachlist.length; i++) {
// if (!this.userserachlist.includes(tagBreed)) { // if (!this.userserachlist.includes(tagBreed)) {
@ -834,21 +954,37 @@ export default {
// } // }
this.usersearch(this.userserachlist, this.activeIndex1); this.usersearch(this.userserachlist, this.activeIndex1);
}, },
//Fetching Categories Products
selectproduct(item, index) { selectproduct(item, index) {
if(this.activeIndex=='-1'){ if(this.activeIndex=='-1'){
this.activeIndex=0; this.activeIndex=0;
} }
this.activeIndexb = index; this.activeIndexb = index;
// console.log(this.userishwo=!this.userishwo) let _self=this;
if (item.checked == false) { //Handling Rx Goods
item.checked = true; if(item.isRxGoods==1)
this.$refs.chosebox[index].className = "active"; {
this.userserachlist[0].categoryName = item.tagName; this.checkRxGoods(true);
} else {
item.checked = false;
this.$refs.chosebox[index].className = "unactive";
this.userserachlist[0].categoryName = "";
} }
//Handling Rx Goods end
//Handling other options
else {
// console.log(this.userishwo=!this.userishwo)
this.checkRxGoods(false);
//item.checked = !item.checked;
//this.prefecture[index].checked = item.checked;
item.checked = !item.checked;
this.prefecture[index].checked = item.checked;
if (item.checked == false) {
this.utilSimpleArrayRemove(this.userserachlist[0].categoryName,item.tagName);
} else {
this.userserachlist[0].categoryName.push(item.tagName);
}
}
//Handling other options end
// if (this.userishwo == false) { // if (this.userishwo == false) {
// console.log("===="); // console.log("====");
// categoryName = { // categoryName = {
@ -866,10 +1002,8 @@ export default {
// this.userserachlist.push(categoryName); // this.userserachlist.push(categoryName);
// } // }
// } // }
this.usersearch(this.userserachlist, this.activeIndex1); this.usersearch(this.userserachlist, this.activeIndex1);
}, },
// //
}, },
}; };

View File

@ -5,20 +5,20 @@
<div class="usercontend"> <div class="usercontend">
<div class="rc-max-width--xl"> <div class="rc-max-width--xl">
<h2>新增收货地址</h2> <h2>新增收货地址</h2>
<div class="rc-max-width--xl rc-people"> <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-phone"> <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-address"> <div class="rc-max-width--xl rc-people rc-address rc-full-width">
<span>所在地区:</span> <span>所在地区:</span>
<!-- <input type="text" placeholder="请选择所在地区"> --> <!-- <input type="text" placeholder="请选择所在地区"> -->
<addressInput @getmenu="onGetMenu" @closeDialog = "handleClose1" :dialogInfo1="dialogInfo1"></addressInput> <addressInput @getmenu="onGetMenu" @closeDialog = "handleClose1" :dialogInfo1="dialogInfo1"></addressInput>
</div> </div>
<div class="rc-max-width--xl 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="请输入详细地址"> <textarea rows="10" cols="30" placeholder="请输入详细地址">
@ -234,6 +234,5 @@ openclose(){
</script> </script>
<style lang="less" scoped > <style lang="less" scoped >
@import url("../../assets/css/global.less");
@import url("../../assets/css/addaddress.less"); @import url("../../assets/css/addaddress.less");
</style> </style>

View File

@ -8,15 +8,15 @@
<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-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-address"> <div class="rc-max-width--xl rc-people rc-address">
<span>所在地区:</span> <span>所在地区:</span>
<addressInput @getmenu="onGetMenu" @closeDialog = "handleClose1" :dialogInfo1="dialogInfo1" :defaultValues="defaultValues"></addressInput> <addressInput @getmenu="onGetMenu" @closeDialog = "handleClose1" :dialogInfo1="dialogInfo1" :defaultValues="defaultValues"></addressInput>
</div> </div>
<div class="rc-max-width--xl 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>
@ -254,6 +254,5 @@ export default {
</script> </script>
<style lang="less" scoped > <style lang="less" scoped >
@import url("../../assets/css/global.less"); @import url("../../assets/css/addaddress.less");
@import url("../../assets/css/editaddress.less");
</style> </style>

View File

@ -100,7 +100,7 @@
</div> </div>
<div class="online"></div> <div class="online"></div>
<!-- rc-main start --> <!-- rc-main start -->
<div class="rc-max-width--xl"> <div class="rc-max-width--xl rc-margin-bottom--lg">
<div class="usersearch"> <div class="usersearch">
<div class="rc-contair"> <div class="rc-contair">
<ul class="ts-product-list"> <ul class="ts-product-list">
@ -120,7 +120,7 @@
<div class="rc-column"> <div class="rc-column">
<div class="rc-click" @click="selectproduce(item)"> <div class="rc-click" @click="selectproduce(item)">
<span>{{ item.categoryName }}</span> <span>{{ item.categoryName }}</span>
<i>{{ item.ecPrice }}</i> <i>{{ item.ecPrice?("¥"+item.ecPrice):'' }}</i>
</div> </div>
<strong <strong
class=" class="
@ -313,6 +313,11 @@
</el-dialog> </el-dialog>
</div> </div>
<!-- rc-main end --> <!-- rc-main end -->
<div v-if="isLoading" class="ts-mask">
<div class="ts-mask-bg"></div>
<div class="userloding"></div>
<span>数据加载中</span>
</div>
<MyFooter></MyFooter> <MyFooter></MyFooter>
</div> </div>
</template> </template>
@ -320,7 +325,7 @@
<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 { biaome, userstype, searchchanpin } from "../../ajax/getData"; import { biaome, userstype, searchchanpin, userquery } from "../../ajax/getData";
export default { export default {
data() { data() {
return { return {
@ -329,14 +334,14 @@ export default {
userserachlist: [ userserachlist: [
{ {
categoryName: "", // categoryName: [], //
tagUsedAge: "", // tagUsedAge: [], //
tagFunction: "", // tagFunction: [], //
tagBreed: "", // tagBreed: [], //
}, },
], ],
userstype: [], userstype: [],
activeIndex: "-1", activeIndex: "0",
activeIndex1: 0, activeIndex1: 0,
activeIndexa: "-1", activeIndexa: "-1",
// userpeolist:[ // userpeolist:[
@ -405,7 +410,14 @@ export default {
catimage: require("../../assets/image/rc-dog.png"), catimage: require("../../assets/image/rc-dog.png"),
}, },
], ],
extraPrefecture: [
{
tagName: "处方粮",
ordernum: "99",
catimage: require("../../assets/image/rc-dog.png"),
isRxGoods:1
},
],
prefecture: [ prefecture: [
{ {
title: "猫湿粮", title: "猫湿粮",
@ -485,36 +497,11 @@ export default {
rccontair: [ rccontair: [
{ {
title: "皇家英国短毛猫全价湿粮", title: "",
price: "¥123.45", price: "",
ordernum: 1, ordernum: 1,
catimage: require("../../assets/image/rc-cat.png"), catimage: '',
},
{
title: "皇家英国短毛猫全价湿粮",
price: "¥123.45",
ordernum: "2",
catimage: require("../../assets/image/rc-dog.png"),
},
{
title: "皇家英国短毛猫全价湿粮",
price: "¥123.45",
ordernum: "2",
catimage: require("../../assets/image/rc-dog.png"),
},
{
title: "皇家英国短毛猫全价湿粮",
price: "¥123.45",
ordernum: "2",
catimage: require("../../assets/image/rc-dog.png"),
},
{
title: "皇家英国短毛猫全价湿粮",
price: "¥123.45",
ordernum: "2",
catimage: require("../../assets/image/rc-dog.png"),
}, },
], ],
usercatlist: [], usercatlist: [],
@ -578,9 +565,31 @@ export default {
}, },
async usersearch(stype, usertype) { async usersearch(stype, usertype) {
let data = await searchchanpin(stype, usertype, 1, 10); this.isLoading=true;
let data = undefined;
if(this.prefecture[this.rxGoodsIndexPointer].checked==true){
data = await userquery(usertype, 1, 12);
}
else{
let searchCriteria=[{}];
for(let key in stype[0]){
if(stype[0][key].length>0){
if(typeof stype[0][key] == 'string') {
searchCriteria[0][key]=stype[0][key];
}
else {
searchCriteria[0][key]=stype[0][key].join(',');
}
if(key=='categoryName' && searchCriteria[0][key].indexOf("湿")>-1){
searchCriteria[0]['tagStatus']=2;
}
}
}
data = await searchchanpin(searchCriteria, usertype, 1, 12);
}
if (data) { if (data) {
this.rccontair = data; this.rccontair = data;
this.isLoading=false;
} }
}, },
async userst() { async userst() {
@ -630,7 +639,11 @@ export default {
}); });
} }
}); });
let _self = this;
this.extraPrefecture.forEach(function(ele){
_self.prefecture.push(ele);
_self.rxGoodsIndexPointer = _self.prefecture.length-1;
});
this.userdoglisgt = this.userstype.filter((item) => item.petType == "1"); this.userdoglisgt = this.userstype.filter((item) => item.petType == "1");
}, },
@ -657,6 +670,46 @@ export default {
}, },
}); });
}, },
checkRxGoods(toggleSwitch){
let _self = this;
let categoriesSelectionEles=this.prefecture;
let functionalSelectionEles=this.catagea;
let ageSelectionEles=this.catage;
let breedSelectionEles=this.catageb;
let allSelectionEles=categoriesSelectionEles.concat(functionalSelectionEles,ageSelectionEles,breedSelectionEles);
if(toggleSwitch)
{
allSelectionEles.forEach(function(tmp,index){
tmp.checked=false;
if(tmp.isRxGoods)
{
tmp.checked=true;
}
});
}
else
this.prefecture[this.rxGoodsIndexPointer].checked=false;
},
resetAllOptions(){
let _self = this;
let categoriesSelectionEles=this.prefecture;
let functionalSelectionEles=this.catagea;
let ageSelectionEles=this.catage;
let breedSelectionEles=this.catageb;
let allSelectionEles=categoriesSelectionEles.concat(functionalSelectionEles,ageSelectionEles,breedSelectionEles);
allSelectionEles.forEach(function(tmp,index){
tmp.checked=false;
});
this.userserachlist = [
{
categoryName: [], //
tagUsedAge: [], //
tagFunction: [], //
tagBreed: [], //
},
];
},
userbuy() { userbuy() {
this.$router.push({ this.$router.push({
path: "/myorder/userrecord", path: "/myorder/userrecord",
@ -713,8 +766,10 @@ export default {
onSearch(e) { onSearch(e) {
this.usetmessage(this.activeIndex1, this.value); this.usetmessage(this.activeIndex1, this.value);
}, },
selectGoods(item, index) { selectGoods(item, index, onlyRefreshCategory) {
this.activeIndex1 = index; this.activeIndex1 = index;
this.resetAllOptions();
if(!onlyRefreshCategory)
this.usersearch(this.userserachlist, this.activeIndex1); this.usersearch(this.userserachlist, this.activeIndex1);
let pinzhong = []; let pinzhong = [];
let zhuanqu = []; let zhuanqu = [];
@ -772,7 +827,11 @@ export default {
} }
}); });
} }
let _self = this;
this.extraPrefecture.forEach(function(ele){
_self.prefecture.push(ele);
_self.rxGoodsIndexPointer = _self.prefecture.length-1;
});
this.activeIndex = index; this.activeIndex = index;
}, },
selectGoodsa(item, index) { selectGoodsa(item, index) {
@ -839,6 +898,17 @@ export default {
this.activeIndexa = index; this.activeIndexa = index;
this.usetmessage(item.title); this.usetmessage(item.title);
}, },
utilSimpleArrayRemove(haystack,needle){
if(haystack.length<=0)
return false;
let index=haystack.indexOf(needle);
if(index>-1)
{
haystack.splice(index,1);
return true;
}
return false;
},
selectage(item, index) { selectage(item, index) {
if(this.activeIndex=='-1'){ if(this.activeIndex=='-1'){
this.activeIndex=0; this.activeIndex=0;
@ -846,26 +916,14 @@ export default {
// debugger; // debugger;
// this.userishwo1 = !this.userishwo1; // this.userishwo1 = !this.userishwo1;
let tagUsedAge = {}; let tagUsedAge = {};
// this.userishwo1 = !this.userishwo1; this.activeIndexc = index;
item.checked = !item.checked;
if (item.checked == false) { if (item.checked == false) {
item.checked = true; this.utilSimpleArrayRemove(this.userserachlist[0].tagUsedAge,item.tagName);
this.userserachlist[0].tagUsedAge = item.tagName;
this.$refs.chosebox1[index].className = "active";
} else { } else {
this.userserachlist[0].tagUsedAge = ""; this.userserachlist[0].tagUsedAge.push(item.tagName);
item.checked = false;
this.$refs.chosebox1[index].className = "unactive";
} }
// if (this.userishwo1 == false) {
// tagUsedAge = {
// petType: this.activeIndex1,
// tagUsedAge: item.tagName,
// };
// } else {
// tagUsedAge = {
// petType: this.activeIndex1,
// };
// }
// for (let i = 0; i < this.userserachlist.length; i++) { // for (let i = 0; i < this.userserachlist.length; i++) {
// if (!this.userserachlist.includes(tagUsedAge)) { // if (!this.userserachlist.includes(tagUsedAge)) {
// this.userserachlist.push(tagUsedAge); // this.userserachlist.push(tagUsedAge);
@ -875,13 +933,11 @@ export default {
this.activeIndexc = index; this.activeIndexc = index;
}, },
selectagc(item, index) { selectagc(item, index) {
this.checkRxGoods(false);
if(this.activeIndex=='-1'){ if(this.activeIndex=='-1'){
this.activeIndex=0; this.activeIndex=0;
} }
// let tagFunction = { /*
// petType: this.activeIndex1,
// tagFunction: item.tagName,
// };
if (item.checked == false) { if (item.checked == false) {
item.checked = true; item.checked = true;
this.$refs.cgosebox4[index].className = "active"; this.$refs.cgosebox4[index].className = "active";
@ -891,16 +947,20 @@ export default {
this.$refs.cgosebox4[index].className = "unactive"; this.$refs.cgosebox4[index].className = "unactive";
this.userserachlist[0].tagFunction = ""; this.userserachlist[0].tagFunction = "";
} }
// for (let i = 0; i < this.userserachlist.length; i++) {
// if (!this.userserachlist.includes(tagFunction)) {
// this.userserachlist.push(tagFunction);
// }
// }
this.usersearch(this.userserachlist, this.activeIndex1); this.usersearch(this.userserachlist, this.activeIndex1);
this.activeIndexd = index; this.activeIndexd = index;
*/
this.activeIndexd = index;
item.checked = !item.checked;
if (item.checked == false) {
this.utilSimpleArrayRemove(this.userserachlist[0].tagFunction,item.tagName);
} else {
this.userserachlist[0].tagFunction.push(item.tagName);
}
this.usersearch(this.userserachlist, this.activeIndex1);
}, },
selectagd(item, index) { selectagd(item, index) {
/*
if(this.activeIndex=='-1'){ if(this.activeIndex=='-1'){
this.activeIndex=0; this.activeIndex=0;
} }
@ -914,25 +974,26 @@ export default {
this.$refs.chosebox3[index].className = "unactive"; this.$refs.chosebox3[index].className = "unactive";
this.userserachlist[0].tagBreed = ""; this.userserachlist[0].tagBreed = "";
} }
// if (this.userishwo3 == false) {
// tagBreed = {
// petType: this.activeIndex1,
// tagBreed: item.tagName,
// };
// } else {
// tagBreed = {
// petType: this.activeIndex1,
// };
// }
// for (let i = 0; i < this.userserachlist.length; i++) {
// if (!this.userserachlist.includes(tagBreed)) {
// this.userserachlist.push(tagBreed);
// }
// }
this.usersearch(this.userserachlist, this.activeIndex1); this.usersearch(this.userserachlist, this.activeIndex1);
this.activeIndexe = index; this.activeIndexe = index;
*/
this.checkRxGoods(false);
if(this.activeIndex=='-1'){
this.activeIndex=0;
}
let tagBreed = {};
this.activeIndexe = index;
item.checked = !item.checked;
if (item.checked == false) {
this.utilSimpleArrayRemove(this.userserachlist[0].tagBreed,item.tagName);
} else {
this.userserachlist[0].tagBreed.push(item.tagName);
}
this.usersearch(this.userserachlist, this.activeIndex1);
}, },
selectproduct(item, index) { selectproduct(item, index) {
/*
this.activeIndexb = index; this.activeIndexb = index;
console.log(this.activeIndex); console.log(this.activeIndex);
if(this.activeIndex=='-1'){ if(this.activeIndex=='-1'){
@ -947,25 +1008,37 @@ export default {
this.$refs.chosebox[index].className = "unactive"; this.$refs.chosebox[index].className = "unactive";
this.userserachlist[0].categoryName = ""; this.userserachlist[0].categoryName = "";
} }
// this.userishwo = !this.userishwo; this.usersearch(this.userserachlist, this.activeIndex1);
// if (this.userishwo == false) { */
// categoryName = { if(this.activeIndex=='-1'){
// petType: this.activeIndex1, this.activeIndex=0;
// categoryName: item.tagName, }
// }; this.activeIndexb = index;
// } else { let _self=this;
// categoryName = { //Handling Rx Goods
// petType: this.activeIndex1, if(item.isRxGoods==1)
// }; {
// } this.checkRxGoods(true);
console.log(this.userserachlist[0].categoryName); }
// for (let i = 0; i < this.userserachlist.length; i++) { //Handling Rx Goods end
// if (!this.userserachlist.includes(categoryName)) {
// this.userserachlist.push(categoryName);
// }
// console.log(this.userserachlist);
// }
//Handling other options
else {
// console.log(this.userishwo=!this.userishwo)
this.checkRxGoods(false);
//item.checked = !item.checked;
//this.prefecture[index].checked = item.checked;
item.checked = !item.checked;
this.prefecture[index].checked = item.checked;
if (item.checked == false) {
this.utilSimpleArrayRemove(this.userserachlist[0].categoryName,item.tagName);
} else {
this.userserachlist[0].categoryName.push(item.tagName);
}
}
//Handling other options end
this.usersearch(this.userserachlist, this.activeIndex1); this.usersearch(this.userserachlist, this.activeIndex1);
}, },

View File

@ -5,6 +5,7 @@ package net.lab1024.smartadmin.module.system.royalcanin.good;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import net.lab1024.smartadmin.common.anno.OperateLog; import net.lab1024.smartadmin.common.anno.OperateLog;
import net.lab1024.smartadmin.common.constant.ResponseCodeConst;
import net.lab1024.smartadmin.common.domain.ResponseDTO; import net.lab1024.smartadmin.common.domain.ResponseDTO;
import net.lab1024.smartadmin.common.heartbeat.StringUtil; import net.lab1024.smartadmin.common.heartbeat.StringUtil;
import net.lab1024.smartadmin.constant.SwaggerTagConst; import net.lab1024.smartadmin.constant.SwaggerTagConst;
@ -165,8 +166,10 @@ public class GoodController {
@ApiOperation(value = "插入购物车信息", notes = "插入购物车信息") @ApiOperation(value = "插入购物车信息", notes = "插入购物车信息")
@PostMapping("royalcanin/insertCartProductInfo") @PostMapping("royalcanin/insertCartProductInfo")
public ResponseDTO<String> insertCartProductInfo(@RequestBody CartEntity cartEntity){ public ResponseDTO<String> insertCartProductInfo(@RequestBody CartEntity cartEntity,HttpServletRequest request){
String memberId = SmartJWTUtil.decodeToken(request.getHeader(TOKEN_NAME));
cartEntity.setMemberId(memberId);
if(cartEntity.getProductCode() != null&&cartEntity.getProductCode() != ""&&cartEntity.getProductName() != null&&cartEntity.getProductName() != ""&&cartEntity.getMemberId() != null&&cartEntity.getMemberId() != "") {
CartEntity cartEntityFromDB = cartService.getInfoByProductCodeAndMemberId(cartEntity.getMemberId(), cartEntity.getProductCode()); CartEntity cartEntityFromDB = cartService.getInfoByProductCodeAndMemberId(cartEntity.getMemberId(), cartEntity.getProductCode());
if (null == cartEntityFromDB) { if (null == cartEntityFromDB) {
if (1 == cartService.insertProductCart(cartEntity)) if (1 == cartService.insertProductCart(cartEntity))
@ -179,7 +182,10 @@ public class GoodController {
if (1 == cartService.updateInfo(cartEntityFromDB)) if (1 == cartService.updateInfo(cartEntityFromDB))
return ResponseDTO.succ(); return ResponseDTO.succ();
else else
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_FAIL); return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM);
}
}else {
return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM);
} }
} }