Merge branch 'sit-Leung' into sit-jiamin-v2

This commit is contained in:
952108534@qq.com
2022-01-23 12:59:13 +08:00
19 changed files with 159 additions and 192 deletions

View File

@@ -81,10 +81,11 @@ export const postCourseId = (productCode,buyCount,memberId, mobile,productImg,pr
* 删除购物车
*/
export const deleteCart = ( productCode) => {
debugger;
var data = {
productCode:productCode
productCode
}
return fetch('cancelCartProductInfo',data,'POST')
return fetch('cancelCartProductInfo',productCode,'POST')
}
/**
* 购物车批量提交
@@ -187,16 +188,14 @@ export const userquery = (stype, ) => {
return fetch('goods?petType='+stype, data, 'POST' )
}
//处方信息
export const userque = (stype, curPage,curRow) => {
export const userque = (goodsName, curPage,curRow) => {
if(!curPage)
curPage=1;
if(!curRow)
curRow=10;
let queryTail='page='+curPage+'&rows='+curRow;
if(stype)
queryTail = '?stype='+queryTail+'&'+queryTail;
else
queryTail = '?'+queryTail;
if(goodsName)
queryTail = '?goodsName='+goodsName;
var data = {
}
return fetch('goods'+queryTail, data, 'POST' )

View File

@@ -88,13 +88,13 @@ export default {
message: "手机号码输入有误",
});
return;
} else if (this.alladdress === "") {
} else if (!this.alladdress || this.alladdress === "") {
this.$message({
type: "warning",
message: "请输入详细地址",
});
return;
} else if (this.userpeople === "") {
} else if (!this.userpeople || this.userpeople === "") {
this.$message({
type: "warning",
message: "请输入姓名",

View File

@@ -169,7 +169,7 @@ export default {
break;
case 1:
//Checking City
if(obj.id.indexOf(provinceId)<0)
if(obj.id.toString().indexOf(provinceId)<0)
{
console.log('500 : error via checking validatePickedValues');
_self.returnValueArr.splice(index,1);
@@ -183,7 +183,7 @@ export default {
break;
case 2:
//Checking Area
if(areaId && obj.id.indexOf(areaId)<0)
if(areaId && obj.id.toString().indexOf(areaId)<0)
{
console.log('501 : error via checking validatePickedValues');
_self.returnValueArr.splice(index,1);
@@ -226,7 +226,7 @@ export default {
stringStartWith=stringStartWith+"-";
let result=[];
dataColArea.forEach(function(ele){
if(ele.id.indexOf(stringStartWith)===0)
if(ele.id.toString().indexOf(stringStartWith)===0)
{
result.push(ele);
}
@@ -462,6 +462,9 @@ export default {
padding-bottom:.25rem;
background:url("../assets/image/ico-location.png") no-repeat 98% center;
background-size:16px;
position:relative;
top:.5rem;
padding-left:.875rem;
}
.ts-area-picker-mobile{
display:flex;
@@ -485,7 +488,7 @@ export default {
display:none;
}
.ts-area-picker-container,.ts-area-picker-value-displayer{
width:42.5rem;
width:42.25rem;
}
.ts-area-picker-value-displayer{
padding-left:1rem;

View File

@@ -44,7 +44,7 @@
<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>
<em class="rc-screen-reader" v-show="loginornot"></em>
</a>
@@ -306,7 +306,7 @@
<li class="rc-list__item">
<a class="rc-list__link rc-icon ts-login--xs rc-iconography--xs" role="menuitem" href="javascript:void();" @click="turnlogin">
个人中心
<em class="rc-screen-reader"></em>
<em class="rc-screen-reader" v-if="loginornot"></em>
</a>
</li>
<li class="rc-list__item">
@@ -362,9 +362,9 @@ export default {
let usernot=this.$store.state.userInfo;
//console.log(usernot);
if(usernot){
this.loginornot=true
}else{
this.loginornot=false
}else{
this.loginornot=true
this.usermessage=usernot;
}
if(isInitialized)
@@ -402,14 +402,16 @@ export default {
},
//判断有无登录跳转不同页面
turnlogin(){
if(this.usermessage==null||this.usermessage==undefined){
this.$router.push({ name: "userlogin-login",
params:{id:12,key:'222'}
})
let userInfo = this.$store.state.userInfo;
if(!userInfo){
this.$router.push({
name: "userlogin-login",
params:{}
})
}else{
this.$router.push({ name: "personal-mypersonal",
})
this.$router.push({
name: "personal-mypersonal",
})
}
}

View File

@@ -1,12 +1,11 @@
<template>
<div class="crumbs" v-if="showTab">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to=item.path v-for="(item, index) in titleLists"
:key="index">{{ item.meta.title }}</el-breadcrumb-item>
<!-- <el-breadcrumb-item>商品管理</el-breadcrumb-item>
<el-breadcrumb-item>商品分类</el-breadcrumb-item> -->
</el-breadcrumb>
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item to="/" >{{ this.homepageName }}</el-breadcrumb-item>
<el-breadcrumb-item :to=item.path v-for="(item, index) in crumbs"
:key="index">{{ item.title }}</el-breadcrumb-item>
</el-breadcrumb>
</div>
</template>
@@ -14,93 +13,25 @@
import { mapState, mapMutations } from "vuex";
export default {
props:["crumbs"],
name:"crumbs",
data() {
return {
title: "",
path: "",
titleLists: [
{
path: '/',
name: 'index',
meta:{
title: '首页',
}
}
],
showTab: true,
isShow: true,
};
},
watch: {
$route() {
this.setTitle();
},
},
mounted() {
this.setTitle();
},
methods: {
...mapMutations(["changemessage",'selectMenu']),
setTitle() {
console.log(this.$route.matched);
console.log(this.titleLists);
let userinfo=[]
let saveUserInfo={
path:'admin',
name:'1',
meta:'b341181c-aced-11e9-89bf-00163e0e8daf',
}
userinfo.push(this.$route.matched);
let list=[];
console.log(userinfo);
userinfo.map(item=>{
console.log(item);
list=item;
})
console.log(list);
let anlist={
path:'admin',
name:'1',
meta:'b341181c-aced-11e9-89bf-00163e0e8daf',
}
list.forEach(element=>{
console.log(element);
anlist=element
})
for(let i in list){
saveUserInfo.path=list[i].path;
saveUserInfo.name=list[i].name;
saveUserInfo.meta=list[i].meta;
}
console.log(saveUserInfo);
// store.commit('se', current.name);
this.selectMenu({ data: saveUserInfo });
console.log(this.$store.state.tabsList);
this.titleLists=this.$store.state.tabsList;
// console.log(userlisa);
console.log(this.titleLists);
},
},
// created(){
// let user=this.$store.state.tabsList;
// this.tags=user;
// console.log(this.tags);
// console.log(user);
// console.log(this.$store.state.tabsList)
// },
// mounted(){
// }
return {
homepageName:'首页'
};
},
created(){
if(this.showTab != false)
this.showTab=true;
},
watch: {
},
mounted() {
},
methods: {
...mapMutations(["changemessage",'selectMenu'])
}
};
</script>

View File

@@ -1164,7 +1164,7 @@
}
window.addEventListener("scroll", this.handleScroll, true);
this.userchufang();//查询处方粮商品信息
this.catmessage();//查询猫的信息
this.catclickGan();
this.catclickShi();
@@ -1468,9 +1468,9 @@
this.dataLoaded=false;
let data=[];
if(stype==undefined||stype==null){
data = await biaomessage(0,'',1,6);
data = await biaomessage(0,'',1,12);
}else{
data = await biaomessage(this.userserachlist,'',1,6);
data = await biaomessage(this.userserachlist,'',1,12);
}
if(data){
let userlist=[];
@@ -1546,12 +1546,14 @@
},
//请求处方量信息数据
async userchufang() {
async userchufang(item) {
if(!item)
item = this.discounchufang[0].title;
this.dataLoaded=false;
let list=[];
let data = await userque();
let data = await userque(item,1,8);
if(data){
list=data.slice(0,6);
list=data.slice(0,8);
this.processinformation=list;
this.chufanlist=data;
this.dataLoaded=true;
@@ -1560,15 +1562,17 @@
//点击请求处方量标签信息数据
async userquery(item) {
this.dataLoaded=false;
let list=[];
let data = await userquery(item);
if(data){
this.processinformation=data;
list=data.slice(0,8);
this.processinformation=list;
this.dataLoaded=true;
}
},
//处方用粮筛选
userclick(item,index){
this.userquery(index)
this.userchufang(index)
},
//全价猫干粮筛选
catclickGan(){

View File

@@ -155,8 +155,6 @@ ul li ol li em strong i {
span {
display: block;
margin-left: 3px;
}
i {

View File

@@ -40,7 +40,7 @@
</div>
</div>
</div>
<div class="rc_contline">1</div>
<div class="rc_contline"></div>
<div class="rc-main" v-for="(item, index) in goldmedal" :key="index">
<div class="rc-usermain">
<div class="rc-image">

View File

@@ -135,7 +135,7 @@
<i class="ts-row-title">商品规格</i>
</div>
<div class="ts-tag-list">
<em v-for="(item, index) in newlist" :key="index" @click="selectsearch(item, index)" :class="[activeIndexa==index?'active':'unactive',item.leftAllotment?'':'disabled']">
<em v-for="(item, index) in newlist" :key="index" @click="selectsearch(item, index)" :class="[activeIndexa==index?'active':'unactive',item.leftAllotment>0?'':'disabled']">
{{ item.specifications }}
</em>
</div>
@@ -218,7 +218,7 @@
<img :src="userimage" alt="" />
<div class="rc-contair">
<div class="rc-left">
<div>
<div v-if="item.couponAmount">
<i></i><span>{{ item.couponAmount }}</span>
</div>
</div>
@@ -313,13 +313,13 @@ export default {
let data = await goodsmessage(singleCode);
if (data && data.data.length>0) {
newlist.push(data.data[0]);
if(data.data[0].leftAllotment && !stopLeftAllotmentChecking) {
if(data.data[0].leftAllotment>0 && !stopLeftAllotmentChecking) {
activeIndexa = stopIndex;
curItem = data.data[0];
stopLeftAllotmentChecking=true;
}
stopIndex++;
}
stopIndex++;
}
productAttachmentList = newlist[0].productAttachmentList;
userbuy = true;
@@ -452,11 +452,14 @@ export default {
//获取用户领取的优惠券
async getconf(memberId, couponId) {
let data = await getConfig(memberId, couponId);
let msg = '领取成功';
if (data) {
this.$message({
type: "warning",
message: data.msg,
});
if(data.code!='0')
msg = data.msg;
this.$message({
type: "warning",
message: msg,
});
}
},
@@ -535,7 +538,14 @@ export default {
},
plus(num, index) {
this.sales_num = parseInt(this.sales_num) + 1;
if(this.sales_num >= this.curItem.leftAllotment) {
this.$message({
type: "warning",
message: '已达到本品最大购买上限',
});
} else {
this.sales_num = parseInt(this.sales_num) + 1;
}
},
// 数量减方法
sub(num, index) {
@@ -551,7 +561,7 @@ export default {
// let mobile=JSON.parse(location.getItem('userInfo'));
// console.log(userid,mobile);
let data = await postCourseId(
this.productCode,
item.productCode,
this.sales_num,
this.usermessage.data.id,
this.usermessage.data.mobile,
@@ -614,7 +624,7 @@ export default {
}
},
selectsearch(item, index) {
if(!item.leftAllotment)
if(!item.leftAllotment || item.leftAllotment<=0)
return;
this.activeIndexa = index;
this.curItem = item;

View File

@@ -2,6 +2,7 @@
<div>
<Myheader></Myheader>
<div class="rc-top"></div>
<tabs :crumbs="crumbs"></tabs>
<div class="rc-max-width--xl rc-main">
<div class="usersearch">
<div class="usercontentshow" ref="usercontent">
@@ -310,6 +311,7 @@
import Myheader from "~/components/header.vue";
import MyFooter from '~/components/rc-footer.vue'
import FixRight from "~/components/fixed-right.vue";
import tabs from "~/components/tabs.vue";
import {
userstype,
biaome,
@@ -320,21 +322,27 @@ import {
export default {
data() {
return {
value: "",
isLoading: false,
userstype: [],
activeIndex: "0",
allacindex: 0,
userishwo: true,
userishwo4: true,
userserachlist: [
{
categoryName: [], //专区
tagUsedAge: [], //年龄
tagFunction: [], //功能
tagBreed: [], //品种
},
],
crumbs:[
{
path:'/productdetails/productlist/',
title:'产品列表',
}
],
value: "",
isLoading: false,
userstype: [],
activeIndex: "0",
allacindex: 0,
userishwo: true,
userishwo4: true,
userserachlist: [
{
categoryName: [], //专区
tagUsedAge: [], //年龄
tagFunction: [], //功能
tagBreed: [], //品种
},
],
activeIndex1: 0,
activeIndexa: "-1",
dialogInfo1: false,
@@ -343,6 +351,7 @@ export default {
activeIndexd: "-1",
activeIndexe: "-1",
activeIndexf: "-1",
inRxGoods:false,
isadrond: true,
isshow: false,
openshow: false,
@@ -476,7 +485,8 @@ export default {
components: {
Myheader,
MyFooter,
FixRight
FixRight,
tabs
},
created() {
this.routeParams=this.$route.query;
@@ -527,7 +537,7 @@ export default {
}
}
}
data = await searchchanpin(searchCriteria, usertype, 1, 12);
data = await searchchanpin(searchCriteria, usertype, 1, 120);
}
if (data) {
this.rccontair = data;
@@ -698,9 +708,12 @@ export default {
tmp.checked=true;
}
});
this.inRxGoods=true;
}
else
else {
this.prefecture[this.rxGoodsIndexPointer].checked=false;
this.inRxGoods=false;
}
},
resetAllOptions(){
let _self = this;
@@ -736,7 +749,7 @@ export default {
let isRxGoods=false;
let productCode = [];
let mainProductCode = item.productCode;
if(!item.ecPrice && !item.price)
if(this.inRxGoods)
{
isRxGoods=1;
productCode = [item.productCode];

View File

@@ -104,6 +104,7 @@
<div class="rc-max-width--xl rc-margin-bottom--lg">
<div class="usersearch">
<div class="rc-contair">
<div class="ts-no-data" v-if="!rccontair.length">暂未发现相关记录</div>
<ul class="ts-product-list">
<li
v-for="(item, index) in rccontair"
@@ -362,6 +363,7 @@ export default {
activeIndexd: "-1",
activeIndexe: "-1",
activeIndexf: "-1",
inRxGoods:false,
isadrond: true,
isshow: false,
openshow: false,
@@ -589,7 +591,7 @@ export default {
}
}
}
data = await searchchanpin(searchCriteria, usertype, 1, 12);
data = await searchchanpin(searchCriteria, usertype, 1, 120);
}
if (data) {
this.rccontair = data;
@@ -705,9 +707,12 @@ export default {
tmp.checked=true;
}
});
this.inRxGoods=true;
}
else
else {
this.prefecture[this.rxGoodsIndexPointer].checked=false;
this.inRxGoods=false;
}
},
resetAllOptions(){
let _self = this;