Data tracking / Revision by 0207 ppt

This commit is contained in:
Vion 2022-02-07 18:12:29 +08:00
parent 28c2614ca3
commit 02b361680b
10 changed files with 340 additions and 203 deletions

View File

@ -208,17 +208,22 @@ export const userquery = (stype, ) => {
return fetch('goods?petType='+stype, data, 'POST' ) return fetch('goods?petType='+stype, data, 'POST' )
} }
//处方信息 //处方信息
export const userque = (goodsName, curPage,curRow) => { export const userque = (goodsName, petType, curPage,curRow) => {
if(!curPage) if(!curPage)
curPage=1; curPage=1;
if(!curRow) if(!curRow)
curRow=10; curRow=10;
let queryTail='page='+curPage+'&rows='+curRow; let queryTail='&page='+curPage+'&rows='+curRow;
let query='?0';
if(goodsName) if(goodsName)
queryTail = '?goodsName='+goodsName; query += '&goodsName='+goodsName;
if(petType!==undefined && petType!=='') {
query += '&petType='+petType;
}
query += queryTail;
var data = { var data = {
} }
return fetch('goods'+queryTail, data, 'POST' ) return fetch('goods'+query, data, 'POST' )
} }

View File

@ -1,4 +1,6 @@
let devData={ let devData={
newGuestCoupon:['0000000123','0000000140','0000000122'],
rxGoodsFilter:[{tagName:'体重管理',tagValue:'体重'},{tagName:'提升活力',tagValue:'活力'},{tagName:'泌尿道',tagValue:'泌尿'},{tagName:'消化道',tagValue:'消化'},{tagName:'皮肤',tagValue:'皮肤'}],
catlistvideo:[ catlistvideo:[
{ {
title: "主食级猫湿粮", title: "主食级猫湿粮",
@ -137,6 +139,8 @@ let devData={
//Production data //Production data
let prdData={ let prdData={
newGuestCoupon:['0000000123','0000000140','0000000122','HJXRL20210827'],
rxGoodsFilter:[{tagName:'体重管理',tagValue:'体重'},{tagName:'提升活力',tagValue:'活力'},{tagName:'泌尿道',tagValue:'泌尿'},{tagName:'消化道',tagValue:'消化'},{tagName:'皮肤',tagValue:'皮肤'}],
catlistvideo:[ catlistvideo:[
{ {
title: "主食级猫湿粮", title: "主食级猫湿粮",

View File

@ -1413,6 +1413,13 @@ export default {
}, },
watch: {}, watch: {},
mounted() { mounted() {
let popupMessage = this.$route.query.msg;
if(popupMessage) {
this.$message({
type: 'success',
message: popupMessage,
});
}
this.checkIsLogin(); this.checkIsLogin();
const that = this; const that = this;
@ -1856,7 +1863,7 @@ export default {
if (!item) item = this.discounchufang[0].title; if (!item) item = this.discounchufang[0].title;
this.dataLoaded = false; this.dataLoaded = false;
let list = []; let list = [];
let data = await userque(item, 1, 8); let data = await userque(item, '', 1, 8);
if (data) { if (data) {
list = data.slice(0, 8); list = data.slice(0, 8);
this.processinformation = list; this.processinformation = list;

View File

@ -376,7 +376,7 @@ export default {
userget(){ userget(){
let user = this.$store.state.userInfo; let user = this.$store.state.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({
@ -392,7 +392,7 @@ export default {
let valDateFromTime=0; let valDateFromTime=0;
let valDateToTime=0; let valDateToTime=0;
let dateChecked=true; let dateChecked=true;
let avaliableCouponNum = 0;
if (data) { if (data) {
this.drawlist=[]; this.drawlist=[];
for(let itemInCart of this.goldmedal) { for(let itemInCart of this.goldmedal) {
@ -423,10 +423,14 @@ export default {
if(dateChecked && myCoupon.activityId != 10 && myCoupon.status == 0 && (!myCoupon.productCodes || myCoupon.productCodes.indexOf(itemInCart.productCode)>-1)) { if(dateChecked && myCoupon.activityId != 10 && myCoupon.status == 0 && (!myCoupon.productCodes || myCoupon.productCodes.indexOf(itemInCart.productCode)>-1)) {
data.data.splice(tmpIndex,1); data.data.splice(tmpIndex,1);
_self.drawlist.push(myCoupon); _self.drawlist.push(myCoupon);
avaliableCouponNum++;
} }
tmpIndex++; tmpIndex++;
} }
} }
if(avaliableCouponNum > 0) {
this.curCoupon.couponName = '有 '+avaliableCouponNum+' 张优惠券可以使用';
}
} }
}, },
pickCoupon(item){ pickCoupon(item){
@ -537,8 +541,6 @@ export default {
addressDetailInfo: orderAddress[0].detailAddress, addressDetailInfo: orderAddress[0].detailAddress,
}, },
}; };
console.log(this.curCoupon,item.productCode,this.discountedProductCode);
debugger;
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;
@ -634,13 +636,17 @@ export default {
"_trackCustomEvent", "_trackCustomEvent",
"placing_order", "placing_order",
{ {
"product_id_":item.productCode, "product_id":item.productCode,
"product_name_": item.productName, "product_name": item.productName,
"product_quantity_" : item.buyCount, "product_quantity" : item.buyCount,
"product_amount_" : item.buyCount*item.productPrice, "product_amount" : item.buyCount*item.productPrice,
} }
]) ])
}); });
let user = this.$store.state.userInfo;
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);

View File

@ -180,7 +180,7 @@ export default {
"payment", "payment",
{ {
"payType" : payType, "payType" : payType,
"product_amount_" : this.userPayData.userprice, "product_amount" : this.userPayData.userprice,
} }
]) ])
}, },
@ -241,7 +241,7 @@ export default {
"payment_finished", "payment_finished",
{ {
"payType" : 'native', "payType" : 'native',
"product_amount_" : this.userPayData.userprice, "product_amount" : this.userPayData.userprice,
} }
]) ])
} else if (res.fail) { } else if (res.fail) {

View File

@ -116,11 +116,11 @@
<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>
<span class="ts-remove ts-ecprice" v-if="curItem.ecPrice<curItem.rsp" <s class="ts-ecprice" v-if="curItem.ecPrice<curItem.rsp"
>{{ curItem.rsp }} >{{ curItem.rsp }}
</span> </s>
<span class="ts-record" v-if="curItem.basePoint!==0"> <span class="ts-record" v-if="curItem.basePoint!==0">
购买该商品你将获得{{curItem.basePoint}}积分 购买该商品你将获得<span class="rc-zeta">{{curItem.basePoint}}积分</span>
</span> </span>
<!-- <span class="rc-title">购买该商品你将得到22积分</span> --> <!-- <span class="rc-title">购买该商品你将得到22积分</span> -->
@ -461,9 +461,9 @@ export default {
"_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,
} }
]) ])
} }
@ -479,11 +479,11 @@ export default {
"_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,
} }
]) ])
if (this.usermessage.data !== "" || this.usermessage.data !== undefined) { if (this.usermessage.data !== "" || this.usermessage.data !== undefined) {
@ -656,11 +656,11 @@ export default {
"_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,
} }
]) ])
} }
@ -685,11 +685,11 @@ export default {
"_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,
} }
]) ])

View File

@ -39,8 +39,8 @@
</li> </li>
</ol> </ol>
</div> </div>
<div class="online rc-md-up"></div> <div class="online rc-md-up" v-if="!inRxGoods"></div>
<div class="ts-scrollable-container"> <div class="ts-scrollable-container" v-if="!inRxGoods">
<h2>年龄:</h2> <h2>年龄:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li <li
@ -54,8 +54,8 @@
</li> </li>
</ol> </ol>
</div> </div>
<div class="online rc-md-up"></div> <div class="online rc-md-up" v-if="!inRxGoods"></div>
<div class="ts-scrollable-container"> <div class="ts-scrollable-container" v-if="!inRxGoods">
<h2>功能:</h2> <h2>功能:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li <li
@ -69,8 +69,8 @@
</li> </li>
</ol> </ol>
</div> </div>
<div class="online rc-md-up"></div> <div class="online rc-md-up" v-if="!inRxGoods"></div>
<div class="ts-scrollable-container"> <div class="ts-scrollable-container" v-if="!inRxGoods">
<h2>品种:</h2> <h2>品种:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li <li
@ -84,6 +84,20 @@
</li> </li>
</ol> </ol>
</div> </div>
<div class="online rc-md-up" v-if="inRxGoods"></div>
<div class="ts-scrollable-container" v-if="inRxGoods">
<h2>功能:</h2>
<ol class="ts-scrollable">
<li
v-for="(item, index) in rxFilters"
:key="index"
@click="selectFilter(item, index)"
:class="item.checked ? 'active' : 'unactive'"
>
{{ item.tagName }}
</li>
</ol>
</div>
<div class="online rc-md-up"></div> <div class="online rc-md-up"></div>
</div> </div>
</div> </div>
@ -313,12 +327,14 @@ 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 envData from "~/config/env-data.js";
import { import {
userstype, userstype,
biaome, biaome,
biaomessage, biaomessage,
searchchanpin, searchchanpin,
userquery userquery,
userque
} from "../../ajax/getData"; } from "../../ajax/getData";
export default { export default {
data() { data() {
@ -328,6 +344,8 @@ export default {
path:'/productdetails/productlist/', path:'/productdetails/productlist/',
} }
], ],
envData,
rxFilters:[],
value: "", value: "",
isLoading: false, isLoading: false,
userstype: [], userstype: [],
@ -507,13 +525,10 @@ export default {
_self.chooseDefaultOptions(); _self.chooseDefaultOptions();
//_self.usetmessage(); //_self.usetmessage();
}); });
/* //Handling RxGoods filter
if (stype !== "" && stype !== undefined) { let curEnv = process.env.NODE_ENV;
this.onmessage(stype);//Wont happen this.rxFilters = envData[curEnv].rxGoodsFilter;
} else { //Handling RxGoods filter end
this.usetmessage();
}
*/
}, },
methods: { methods: {
async usersearch(stype, usertype) { async usersearch(stype, usertype) {
@ -598,7 +613,7 @@ export default {
async usetmessage() { async usetmessage() {
this.isLoading = true; this.isLoading = true;
let data = await biaome(this.activeIndex1, "", 1, 10); let data = await biaome(this.activeIndex1, "", 1, 20);
if (data) { if (data) {
this.rccontair = data; this.rccontair = data;
this.isLoading = false; this.isLoading = false;
@ -606,7 +621,16 @@ export default {
}, },
async onmessage(stype) { async onmessage(stype) {
this.isLoading = true; this.isLoading = true;
let data = await biaomessage(stype, "", 1, 10); let data = await biaomessage(stype, "", 1, 20);
if (data) {
this.rccontair = data;
this.isLoading = false;
}
},
async getRxGoodsByFunc(functionName) {
this.isLoading = true;
let petType = this.activeIndex1;
let data = await userque(functionName, petType, 1, 20);
if (data) { if (data) {
this.rccontair = data; this.rccontair = data;
this.isLoading = false; this.isLoading = false;
@ -713,7 +737,23 @@ export default {
else { else {
this.prefecture[this.rxGoodsIndexPointer].checked=false; this.prefecture[this.rxGoodsIndexPointer].checked=false;
this.inRxGoods=false; this.inRxGoods=false;
for(let tmp of this.rxFilters) {
tmp.checked = false;
} }
}
},
selectFilter(item) {
for(let tmp of this.rxFilters) {
if(item.tagValue == tmp.tagValue) {
item.checked = !item.checked;
} else {
tmp.checked = false;
}
}
if(item.checked)
this.getRxGoodsByFunc(item.tagValue);
else
this.getRxGoodsByFunc();
}, },
resetAllOptions(){ resetAllOptions(){
let _self = this; let _self = this;
@ -725,6 +765,7 @@ export default {
allSelectionEles.forEach(function(tmp,index){ allSelectionEles.forEach(function(tmp,index){
tmp.checked=false; tmp.checked=false;
}); });
this.checkRxGoods(false);
this.userserachlist = [ this.userserachlist = [
{ {
categoryName: [], // categoryName: [], //

View File

@ -22,7 +22,7 @@
:key="index" :key="index"
class="rc-margin-top--md" class="rc-margin-top--md"
> >
<h2 class="rc-beta rc-margin-y--md">{{ index==1?'明星犬粮':'明星猫粮' }}</h2> <h2 class="rc-beta rc-margin-y--md">{{ index==1?'明星猫粮':'明星犬粮' }}</h2>
<div <div
class="rc-click rc-margin-bottom--md" class="rc-click rc-margin-bottom--md"
@click="selectproduce(item, index)" @click="selectproduce(item, index)"
@ -43,7 +43,7 @@
center center
" "
@click="selectproduce(item, index)" @click="selectproduce(item, index)"
>点击查看</strong >立即购买</strong
> >
</div> </div>
</li> </li>

View File

@ -144,10 +144,12 @@
<script> <script>
import { userLongin,sendMsg,vadatnmsg,userregOrLogin,inserdiscount } from "../../ajax/getData"; import { userLongin,sendMsg,vadatnmsg,userregOrLogin,inserdiscount } from "../../ajax/getData";
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
import envData from "~/config/env-data.js";
import Myheader from "~/components/header.vue"; // import Myheader from "~/components/header.vue"; //
export default { export default {
data() { data() {
return { return {
envData,
phone: "", phone: "",
layerMSg: "手机格式不对", layerMSg: "手机格式不对",
tel: "", tel: "",
@ -228,7 +230,7 @@ export default {
// //
checkBoxa(e,order){ checkBoxa(e,order){
let checked=e.target.checked; let checked=e.target.checked;
console.log(e.target.checked); // console.log(e.target.checked);
// this.isRank=e.target.checked; // this.isRank=e.target.checked;
// this.isRanka=e.target.checked; // this.isRanka=e.target.checked;
if(order==3){ if(order==3){
@ -241,7 +243,7 @@ export default {
else if(order==1){ else if(order==1){
this.isRanka=e.target.checked; this.isRanka=e.target.checked;
} }
console.log(this.isRank,this.isRanka); //console.log(this.isRank,this.isRanka);
if(this.isRanka==true && this.isRank==true){ if(this.isRanka==true && this.isRank==true){
this.allcheck=true; this.allcheck=true;
}else{ }else{
@ -268,7 +270,7 @@ export default {
//console.log("-----"); //console.log("-----");
let data = await sendMsg(this.tel); let data = await sendMsg(this.tel);
if(data){ if(data){
console.log(data); //console.log(data);
//this.captchadata=data.msgNum; //this.captchadata=data.msgNum;
this.tamp=data.tamp; this.tamp=data.tamp;
this.hash=data.hash; this.hash=data.hash;
@ -280,7 +282,7 @@ export default {
async serdiscount (mobile,couponId) { async serdiscount (mobile,couponId) {
let data = await inserdiscount(mobile,couponId); let data = await inserdiscount(mobile,couponId);
if(data){ if(data){
console.log(data);
} }
//console.log(data); //console.log(data);
}, },
@ -292,26 +294,22 @@ export default {
if(data){ if(data){
return data; return data;
} }
}, },
// //
async userlogin() { async userlogin() {
//console.log("-----");
let data= await userregOrLogin(this.tel); let data= await userregOrLogin(this.tel);
if(data){ if(data){
this.userislogin=data; this.userislogin=data;
console.log(this.userislogin); //console.log(this.userislogin);
} }
}, },
onClickHander(e) { onClickHander(e) {
console.log(e); //console.log(e);
}, },
selectGoods(item, index) { selectGoods(item, index) {
this.activeIndex = index; this.activeIndex = index;
console.log(index);
if (this.activeIndex == 0) { if (this.activeIndex == 0) {
this.ifpassword = false; this.ifpassword = false;
} else { } else {
@ -320,7 +318,6 @@ export default {
}, },
// //
useredd() { useredd() {
//console.log("---");
this.usertitle = false; this.usertitle = false;
}, },
@ -336,7 +333,7 @@ export default {
getCode() { getCode() {
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: 'error',
message: '手机号码输入有误' message: '手机号码输入有误'
}); });
return return
@ -361,79 +358,84 @@ export default {
async register() { async register() {
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: 'error',
message: '手机号码输入有误' message: '手机号码输入有误'
}); });
return return
} }
if(this.sms==''){ if(this.sms==''){
this.$message({ this.$message({
type: 'warning', type: 'error',
message: '请输入验证码' message: '请输入验证码'
}); });
return return
} }
if(this.usercheckbox==false){ if(this.usercheckbox==false){
this.$message({ this.$message({
type: 'warning', type: 'error',
message: '请先勾选相关协议' message: '请先勾选相关协议'
}); });
return return
} }
if(this.usercheckbox==false){ if(this.usercheckbox==false){
//console.log('----');
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: 'error',
message: '手机号码输入有误' message: '手机号码输入有误'
}); });
this.$message({ this.$message({
type: 'warning', type: 'error',
message: '请先同意隐私声明和账号使用协议' message: '请先同意隐私声明和账号使用协议'
}); });
return return
} }
} }
else{ else{
console.log('===')
let data=await this.vadmsg(); let data=await this.vadmsg();
if(data.code=="1") if(data.code=="1")
{ {
data = await userregOrLogin(this.tel); data = await userregOrLogin(this.tel);
console.log(data);
let token=JSON.stringify(data); let token=JSON.stringify(data);
this.changeClod({ cloud: token }); this.changeClod({ cloud: token });
this.checkIsLogin(); this.checkIsLogin();
if(data.type==1){ let returnMessage='';
if(data.type==1) {
if(data.data.memberName===undefined){ if(data.data.memberName===undefined){
this.$message({ returnMessage = '欢迎回来';
type: 'warning',
message: '欢迎回来'
});
console.log('-----')
} }
else{ else{
this.$message({ returnMessage = '欢迎回来'+data.data.memberName;
type: 'warning',
message: '欢迎回来'+data.data.memberName
});
} }
}else if(data.type==2){ _hmt.push([
this.$message({ "_trackCustomEvent",
type: 'warning', "login",
message: '恭喜注册成功' {}
}); ])
let couponId='0000000123'; } else if(data.type==2) {
returnMessage = '恭喜注册成功';
_hmt.push([
"_trackCustomEvent",
"register",
{}
])
let curEnv = process.env.NODE_ENV;
let newGuestCouponCodes = envData[curEnv].newGuestCoupon;
let couponId=newGuestCouponCodes[0];
this.serdiscount(this.tel,couponId); this.serdiscount(this.tel,couponId);
setTimeout(() => { setTimeout(() => {
this.serdiscount(this.tel,"0000000140"); this.serdiscount(this.tel,newGuestCouponCodes[1]);
}, 100); }, 100);
setTimeout(() => { setTimeout(() => {
this.serdiscount(this.tel,"0000000122"); this.serdiscount(this.tel,newGuestCouponCodes[2]);
}, 500);
setTimeout(() => {
this.serdiscount(this.tel,newGuestCouponCodes[3]);
}, 500); }, 500);
} }
this.$router.push({ this.$router.push({
path: "/", path: "/",
query:{msg:returnMessage}
}); });
}else{ }else{
this.$message({ this.$message({

View File

@ -78,7 +78,7 @@
</ol> </ol>
</div> </div>
<div class="ts-scrollable-container"> <div class="ts-scrollable-container" v-if="!inRxGoods">
<h2>年龄:</h2> <h2>年龄:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li <li
@ -92,6 +92,21 @@
</li> </li>
</ol> </ol>
</div> </div>
<div class="ts-scrollable-container" v-if="inRxGoods">
<h2>功能:</h2>
<ol class="ts-scrollable">
<li
v-for="(item, index) in rxFilters"
:key="index"
@click="selectFilter(item, index)"
:class="item.checked ? 'active' : 'unactive'"
>
{{ item.tagName }}
</li>
</ol>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -177,7 +192,7 @@
</ol> </ol>
</div> </div>
<div class="ts-scrollable-container"> <div class="ts-scrollable-container" v-if="!inRxGoods">
<h2>年龄:</h2> <h2>年龄:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li <li
@ -191,7 +206,7 @@
</li> </li>
</ol> </ol>
</div> </div>
<div class="ts-scrollable-container"> <div class="ts-scrollable-container" v-if="!inRxGoods">
<h2>功能:</h2> <h2>功能:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li <li
@ -205,7 +220,7 @@
</li> </li>
</ol> </ol>
</div> </div>
<div class="ts-scrollable-container"> <div class="ts-scrollable-container" v-if="!inRxGoods">
<h2>品种:</h2> <h2>品种:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li <li
@ -220,6 +235,20 @@
</ol> </ol>
</div> </div>
<div class="ts-scrollable-container" v-if="inRxGoods">
<h2>功能:</h2>
<ol class="ts-scrollable">
<li
v-for="(item, index) in rxFilters"
:key="index"
@click="selectFilter(item, index)"
:class="item.checked ? 'active' : 'unactive'"
>
{{ item.tagName }}
</li>
</ol>
</div>
</div> </div>
</div> </div>
@ -263,7 +292,7 @@
</ol> </ol>
</div> </div>
<div class="ts-scrollable-container"> <div class="ts-scrollable-container" v-if="!inRxGoods">
<h2>年龄:</h2> <h2>年龄:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li <li
@ -277,7 +306,7 @@
</li> </li>
</ol> </ol>
</div> </div>
<div class="ts-scrollable-container"> <div class="ts-scrollable-container" v-if="!inRxGoods">
<h2>功能:</h2> <h2>功能:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li <li
@ -291,7 +320,7 @@
</li> </li>
</ol> </ol>
</div> </div>
<div class="ts-scrollable-container"> <div class="ts-scrollable-container" v-if="!inRxGoods">
<h2>品种:</h2> <h2>品种:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li <li
@ -305,6 +334,19 @@
</li> </li>
</ol> </ol>
</div> </div>
<div class="ts-scrollable-container" v-if="inRxGoods">
<h2>功能:</h2>
<ol class="ts-scrollable">
<li
v-for="(item, index) in rxFilters"
:key="index"
@click="selectFilter(item, index)"
:class="item.checked ? 'active' : 'unactive'"
>
{{ item.tagName }}
</li>
</ol>
</div>
</div> </div>
</div> </div>
<!-- <!--
@ -331,16 +373,19 @@ 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 { biaome, userstype, searchchanpin, userquery } from "../../ajax/getData"; import { biaome, userstype, searchchanpin, userquery, userque } from "../../ajax/getData";
import envData from "~/config/env-data.js";
export default { export default {
data() { data() {
return { return {
value: "", value: "",
envData,
crumbs:[ crumbs:[
{ {
path:'/usersearch/search/', path:'/usersearch/search/',
} }
], ],
rxFilters:[],
isLoading: true, isLoading: true,
userserachlist: [ userserachlist: [
{ {
@ -528,6 +573,10 @@ export default {
mounted() { mounted() {
this.usetmessage(); this.usetmessage();
this.userst(); this.userst();
//Handling RxGoods filter
let curEnv = process.env.NODE_ENV;
this.rxFilters = envData[curEnv].rxGoodsFilter;
//Handling RxGoods filter end
}, },
methods: { methods: {
// //
@ -605,6 +654,15 @@ export default {
this.isLoading=false; this.isLoading=false;
} }
}, },
async getRxGoodsByFunc(functionName) {
this.isLoading = true;
let petType = this.activeIndex1;
let data = await userque(functionName, petType, 1, 20);
if (data) {
this.rccontair = data;
this.isLoading = false;
}
},
async userst() { async userst() {
this.isLoading = true; this.isLoading = true;
let pinzhong = []; let pinzhong = [];
@ -721,6 +779,19 @@ export default {
this.inRxGoods=false; this.inRxGoods=false;
} }
}, },
selectFilter(item) {
for(let tmp of this.rxFilters) {
if(item.tagValue == tmp.tagValue) {
item.checked = !item.checked;
} else {
tmp.checked = false;
}
}
if(item.checked)
this.getRxGoodsByFunc(item.tagValue);
else
this.getRxGoodsByFunc();
},
resetAllOptions(){ resetAllOptions(){
let _self = this; let _self = this;
let categoriesSelectionEles=this.prefecture; let categoriesSelectionEles=this.prefecture;
@ -731,6 +802,7 @@ export default {
allSelectionEles.forEach(function(tmp,index){ allSelectionEles.forEach(function(tmp,index){
tmp.checked=false; tmp.checked=false;
}); });
this.checkRxGoods(false);
this.userserachlist = [ this.userserachlist = [
{ {
categoryName: [], // categoryName: [], //