Commit a177037a authored by 黄奎's avatar 黄奎

代码优化

parent ffb5559a
<template> <template>
<view class="addialog" v-if="show"> <view class="addialog" v-if="show">
<swiper indicator-dots style="height:60%;margin:0 10%;width:80%"> <swiper indicator-dots style="height:60%;margin:0 10%;width:80%">
<swiper-item v-for="(item, index) in ads.list" :key="index"> <swiper-item v-for="(item, index) in ads.list" :key="index">
<image <image mode="aspectFit" :src="item.picUrl" width="100%" @click="clickHandler(item.link.url)" style="height:100%" />
mode="aspectFit" </swiper-item>
:src="item.picUrl" </swiper>
width="100%" <view class="close">
@click="clickHandler(item.link.url)" <u-icon name="close" color="#000" size="56" @click="closeHandler" />
style="height:100%" </view>
/> </view>
</swiper-item>
</swiper>
<view class="close">
<u-icon name="close" color="#000" size="56" @click="closeHandler" />
</view>
</view>
</template> </template>
<script> <script>
export default { export default {
props: ["ads"], props: ["ads"],
data() { data() {
return { return {
show:false show: false
}; };
}, },
created() { created() {
if(this.ads.times==1){ if (this.ads.times == 1) {
let showedAd=uni.getStorageSync('showedAd')?uni.getStorageSync('showedAd'):[] let showedAd = uni.getStorageSync('showedAd') ? uni.getStorageSync('showedAd') : []
let isExsit=false let isExsit = false
showedAd.forEach(x=>{ showedAd.forEach(x => {
if(x.toString()==this.ads.list.toString()){ if (x.toString() == this.ads.list.toString()) {
isExsit=true isExsit = true
return false return false
} }
}) })
if(isExsit){ if (isExsit) {
this.closeHandler() this.closeHandler()
}else{ } else {
showedAd.push(this.ads.list) showedAd.push(this.ads.list)
uni.setStorageSync("showedAd", showedAd); uni.setStorageSync("showedAd", showedAd);
this.show=true this.show = true
} }
}else{ } else {
this.show=true this.show = true
} }
}, },
methods: { methods: {
clickHandler(e) { clickHandler(e) {
if (e.currentTarget.dataset.url && e.currentTarget.dataset.url != "") { if (e.currentTarget.dataset.url && e.currentTarget.dataset.url != "") {
uni.navigateTo({ url: e.currentTarget.dataset.url }); uni.navigateTo({
} url: e.currentTarget.dataset.url
}, });
closeHandler(){ }
this.show=false },
} closeHandler() {
} this.show = false
}; }
}
};
</script> </script>
<style> <style>
.addialog { .addialog {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
top: 0; top: 0;
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
display: flex; display: flex;
align-items: center; align-items: center;
z-index: 999999999; z-index: 999999999;
} }
.addialog .close{
position: absolute; .addialog .close {
bottom: 14%; position: absolute;
left: 50%; bottom: 14%;
margin-left: -14px; left: 50%;
} margin-left: -14px;
}
</style> </style>
\ No newline at end of file
...@@ -5,174 +5,171 @@ ...@@ -5,174 +5,171 @@
<button :style="sureStyle" class="hotsopt" open-type="getUserInfo" @getuserinfo="getUserInfo"></button> <button :style="sureStyle" class="hotsopt" open-type="getUserInfo" @getuserinfo="getUserInfo"></button>
<button :style="cancelStyle" class="hotsopt" @click="close"></button> <button :style="cancelStyle" class="hotsopt" @click="close"></button>
</u-popup> </u-popup>
<coupon <coupon v-if="showCoupons" :coupon-message="couponMessage" @goLook="goLook" @closeBtn="closeBtn"></coupon>
v-if="showCoupons"
:coupon-message="couponMessage"
@goLook="goLook"
@closeBtn="closeBtn"
></coupon>
</div> </div>
</template> </template>
<script> <script>
import coupon from "@/components/coupons/coupons"; import coupon from "@/components/coupons/coupons";
export default {
export default { components: {
components:{ coupon
coupon
},
data() {
return {
pageinfo: {},
sureStyle: '',
cancelStyle: '',
showDialog: true,
showCoupons:false,
couponMessage:'',
};
},
created() {
this.pageinfo = uni.getStorageSync('basedata') ? uni.getStorageSync('basedata').auth_page : {};
let x = this.pageinfo.hotspot;
let y = this.pageinfo.hotspot_cancel;
this.sureStyle = `height:${x.height}rpx;width:${x.width}rpx;left:${x.left}rpx;top:${x.top}rpx;`;
this.cancelStyle = `height:${y.height}rpx;width:${y.width}rpx;left:${y.left}rpx;top:${y.top}rpx;`;
},
methods: {
getUserInfo(e) {
var that = this;
that.showDialog=true;
uni.getProvider({
service: 'oauth',
success: function(res) {
if (~res.provider.indexOf('weixin')) {
uni.login({
provider: 'weixin',
success: res => {
that.authorization = res.code;
uni.getUserInfo({
provider: 'weixin',
success: info => {
//这里请求接口
let obj = {
Source: 1,
OpenId: '',
Name: info.userInfo.nickName,
Photo: info.userInfo.avatarUrl,
Moblie: '',
SuperiorId: 0,
code: res.code
};
that.getCode(obj);
},
fail: () => {
uni.showToast({ title: '微信登录授权失败', icon: 'none' });
}
});
},
fail: () => {
uni.showToast({ title: '微信登录授权失败', icon: 'none' });
}
});
} else {
uni.showToast({
title: '请先安装微信或升级版本',
icon: 'none'
});
}
}
});
}, },
close() { data() {
this.showDialog=false; return {
this.$emit('gbAuth'); pageinfo: {},
sureStyle: '',
cancelStyle: '',
showDialog: true,
showCoupons: false,
couponMessage: '',
};
}, },
//调用获取code created() {
getCode(obj) { this.pageinfo = uni.getStorageSync('basedata') ? uni.getStorageSync('basedata').auth_page : {};
var that = this; let x = this.pageinfo.hotspot;
uni.getUserInfo({ let y = this.pageinfo.hotspot_cancel;
provider: 'weixin', this.sureStyle = `height:${x.height}rpx;width:${x.width}rpx;left:${x.left}rpx;top:${x.top}rpx;`;
success: info => { this.cancelStyle = `height:${y.height}rpx;width:${y.width}rpx;left:${y.left}rpx;top:${y.top}rpx;`;
//这里请求接口
var OpenId = '';
that.request2(
{
url: '/api/mall/GetWeChatOpenId',
data: {
Code: obj.code
}
},
res => {
if (res.resultCode == 1) {
obj.OpenId = res.data;
that.getLogin(obj);
}
}
);
}
});
}, },
//登录 methods: {
getLogin(obj) { getUserInfo(e) {
var that = this; var that = this;
let pid = uni.getStorageSync("pid")?uni.getStorageSync("pid").pid:0; that.showDialog = true;
let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0; uni.getProvider({
let SmallShopId = uni.getStorageSync("SmallShopId")?uni.getStorageSync("SmallShopId").SmallShopId:0; service: 'oauth',
that.request2( success: function(res) {
{ if (~res.provider.indexOf('weixin')) {
url: '/api/AppletLogin/Login', uni.login({
data: { provider: 'weixin',
Source: 1, success: res => {
OpenId: obj.OpenId, that.authorization = res.code;
Name: obj.Name, uni.getUserInfo({
Photo: obj.Photo, provider: 'weixin',
Moblie: '', success: info => {
SuperiorId: pid, //这里请求接口
SmallShopId:SmallShopId, let obj = {
UserPageType: Up, Source: 1,
OpenId: '',
Name: info.userInfo.nickName,
Photo: info.userInfo.avatarUrl,
Moblie: '',
SuperiorId: 0,
code: res.code
};
that.getCode(obj);
},
fail: () => {
uni.showToast({
title: '微信登录授权失败',
icon: 'none'
});
}
});
},
fail: () => {
uni.showToast({
title: '微信登录授权失败',
icon: 'none'
});
}
});
} else {
uni.showToast({
title: '请先安装微信或升级版本',
icon: 'none'
});
}
}
});
},
close() {
this.showDialog = false;
this.$emit('gbAuth');
},
//调用获取code
getCode(obj) {
var that = this;
uni.getUserInfo({
provider: 'weixin',
success: info => {
//这里请求接口
var OpenId = '';
that.request2({
url: '/api/mall/GetWeChatOpenId',
data: {
Code: obj.code
}
},
res => {
if (res.resultCode == 1) {
obj.OpenId = res.data;
that.getLogin(obj);
}
}
);
} }
}, });
res => { },
if (res.resultCode == 1) { //登录
this.showDialog=false; getLogin(obj) {
uni.setStorageSync('mall_UserInfo', res.data); var that = this;
that.$emit('changeuserinfo'); let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
if(res.couponResultCode==1){ let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0;
this.showCoupons = true; let SmallShopId = uni.getStorageSync("SmallShopId") ? uni.getStorageSync("SmallShopId").SmallShopId : 0;
this.couponMessage = res.couponMessage; that.request2({
url: '/api/AppletLogin/Login',
data: {
Source: 1,
OpenId: obj.OpenId,
Name: obj.Name,
Photo: obj.Photo,
Moblie: '',
SuperiorId: pid,
SmallShopId: SmallShopId,
UserPageType: Up,
}
},
res => {
if (res.resultCode == 1) {
this.showDialog = false;
uni.setStorageSync('mall_UserInfo', res.data);
that.$emit('changeuserinfo');
if (res.couponResultCode == 1) {
this.showCoupons = true;
this.couponMessage = res.couponMessage;
}
uni.removeStorageSync('pid');
uni.removeStorageSync('SmallShopId');
uni.removeStorageSync("Up");
} }
uni.removeStorageSync('pid');
uni.removeStorageSync('SmallShopId');
uni.removeStorageSync("Up");
} }
} );
); },
}, goLook() {
goLook(){ this.showCoupons = false;
this.showCoupons = false; },
closeBtn() {
}, this.showCoupons = false
closeBtn(){ }
this.showCoupons = false
} }
} };
};
</script> </script>
<style> <style>
.auth-page img { .auth-page img {
width: 650rpx; width: 650rpx;
height: 700rpx; height: 700rpx;
} }
.auth-page .hotsopt {
position: absolute; .auth-page .hotsopt {
background: transparent; position: absolute;
border: none; background: transparent;
outline: none; border: none;
} outline: none;
.auth-page .hotsopt::after { }
border: none;
} .auth-page .hotsopt::after {
</style> border: none;
}
</style>
\ No newline at end of file
<template> <template>
<div class="catsstyle1"> <div class="catsstyle1">
<u-grid :col="4" :border="false"> <u-grid :col="4" :border="false">
<u-grid-item <u-grid-item v-for="(c, i) in d" :key="i" @click="clickHandler(c)">
v-for="(c, i) in d" <image :src="getIconLink(c.IconPath)" style="width: 80rpx; height: 80rpx;" />
:key="i" <text class="grid-text">{{ c.Name }}</text>
@click="clickHandler(c)" </u-grid-item>
> </u-grid>
<image </div>
:src="getIconLink(c.IconPath)"
style="width: 80rpx; height: 80rpx;"
/>
<text class="grid-text">{{ c.Name }}</text>
</u-grid-item>
</u-grid>
</div>
</template> </template>
<script> <script>
export default { export default {
props: ["d"], props: ["d"],
data() { data() {
return { return {
activeId: 0, activeId: 0,
}; };
}, },
methods: { methods: {
clickHandler(item) { clickHandler(item) {
let IsEducation = uni.getStorageSync('basedata') let IsEducation = uni.getStorageSync('basedata') ?
? (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation?uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation:0) (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation ? uni.getStorageSync('basedata').mall.setting.mallStyle
:0; .IsEducation : 0) :
if(IsEducation==1){ 0;
uni.navigateTo({ url: '/pages/school/courseList?CategoryIds='+item.Id }); if (IsEducation == 1) {
}else{ uni.navigateTo({
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+item.Id }); url: '/pages/school/courseList?CategoryIds=' + item.Id
} });
}, } else {
}, uni.navigateTo({
}; url: '/pages/goods/list?CategoryIds=' + item.Id
});
}
},
},
};
</script> </script>
<style> <style>
.catsstyle1 { .catsstyle1 {
padding: 12px 0; padding: 12px 0;
} }
.catsstyle1 .grid-text {
font-size: 24rpx; .catsstyle1 .grid-text {
margin-top: 4rpx; font-size: 24rpx;
color: "#330330"; margin-top: 4rpx;
} color: "#330330";
}
</style> </style>
<template> <template>
<div class="catstyle10" style="height:100%"> <div class="catstyle10" style="height:100%">
<div class="left-slider"> <div class="left-slider">
<sidebar <sidebar :active="tid" name="Name" :active-color="mainColor" :border="false" :list="d" @change="changeHandler"></sidebar>
:active="tid" </div>
name="Name" <div class="right-slider">
:active-color="mainColor" <div class="adbox" v-if="d[tid].advert_pic">
:border="false" <image mode="aspectFit" :src="d[tid].advert_url" style="width: 100%; height: 100%;" />
:list="d" </div>
@change="changeHandler" <div v-for="(c, i) in sd" :key="i">
></sidebar> <div @click="clickHandler(c)" class="sec-title">{{ c.Name }}</div>
</div> <u-grid :column-num="3" :border="false">
<div class="right-slider"> <template v-if="c.ChildList && c.ChildList.length > 0">
<div <u-grid-item v-for="(cc, ci) in c.ChildList" :key="ci">
class="adbox" <image :src="getIconLink(c.IconPath)" mode="widthFix" style="width: 80rpx; height: 80rpx;" />
v-if="d[tid].advert_pic" <text class="grid-text">{{ c.Name }}</text>
> </u-grid-item>
<image </template>
mode="aspectFit" <template v-else>
:src="d[tid].advert_url" <u-grid-item>
style="width: 100%; height: 100%;" <u-icon name="photo-o" size="80" :color="'#999'" />
/> <text class="grid-text" style="color:#999">无三级分类</text>
</div> </u-grid-item>
<div v-for="(c, i) in sd" :key="i"> </template>
<div @click="clickHandler(c)" class="sec-title">{{ c.Name }}</div> </u-grid>
<u-grid :column-num="3" :border="false"> </div>
<template v-if="c.ChildList && c.ChildList.length > 0"> </div>
<u-grid-item </div>
v-for="(cc, ci) in c.ChildList"
:key="ci"
>
<image
:src="getIconLink(c.IconPath)"
mode="widthFix"
style="width: 80rpx; height: 80rpx;"
/>
<text class="grid-text">{{ c.Name }}</text>
</u-grid-item>
</template>
<template v-else>
<u-grid-item>
<u-icon name="photo-o" size="80" :color="'#999'" />
<text class="grid-text" style="color:#999">无三级分类</text>
</u-grid-item>
</template>
</u-grid>
</div>
</div>
</div>
</template> </template>
<script> <script>
import sidebar from "../sidebar/index"; import sidebar from "../sidebar/index";
export default { export default {
props: ["d", "h"], props: ["d", "h"],
data() { data() {
return { return {
mainColor: "", mainColor: "",
activeStyle: "", activeStyle: "",
page: 1, page: 1,
page_count: 1, page_count: 1,
mh: 0, mh: 0,
tid: 0, tid: 0,
active: 0, active: 0,
sd: [], sd: [],
}; };
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.activeStyle = `background:${this.mainColor};`; this.activeStyle = `background:${this.mainColor};`;
this.sd = this.d[this.tid].ChildList; this.sd = this.d[this.tid].ChildList;
}, },
components:{ components: {
sidebar sidebar
}, },
methods: { methods: {
changeHandler(e) { changeHandler(e) {
this.tid = e; this.tid = e;
this.page = 1; this.page = 1;
this.sd = this.d[this.tid].ChildList; this.sd = this.d[this.tid].ChildList;
}, },
clickHandler(item) { clickHandler(item) {
let Id1=this.d[this.tid].Id; let Id1 = this.d[this.tid].Id;
let Id2=item.Id; let Id2 = item.Id;
// let CategoryIds=Id1+','+Id2; let CategoryIds = Id2;
let CategoryIds=Id2; let IsEducation = uni.getStorageSync('basedata') ?
let IsEducation = uni.getStorageSync('basedata') (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation ? uni.getStorageSync('basedata').mall.setting.mallStyle
? (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation?uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation:0) .IsEducation : 0) :
:0; 0;
if(IsEducation==1){ if (IsEducation == 1) {
uni.navigateTo({ url: '/pages/school/courseList?CategoryIds='+CategoryIds }); uni.navigateTo({
}else{ url: '/pages/school/courseList?CategoryIds=' + CategoryIds
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+CategoryIds }); });
} } else {
} uni.navigateTo({
}, url: '/pages/goods/list?CategoryIds=' + CategoryIds
}; });
}
}
},
};
</script> </script>
<style> <style>
.catstyle10 { .catstyle10 {
display: flex; display: flex;
} }
.catstyle10 .left-slider {
width: 85px; .catstyle10 .left-slider {
height: 100%; width: 85px;
background: #f5f5f5; height: 100%;
} background: #f5f5f5;
.catstyle10 .right-slider { }
padding: 10px;
height: 100%; .catstyle10 .right-slider {
width: 1px; padding: 10px;
flex: 1; height: 100%;
overflow: hidden; width: 1px;
overflow-y: auto; flex: 1;
} overflow: hidden;
.catstyle10 .right-slider .van-icon--image, overflow-y: auto;
.catstyle10 .right-slider .van-icon { }
width: 80rpx;
height: 80rpx; .catstyle10 .right-slider .van-icon--image,
font-size: 80rpx; .catstyle10 .right-slider .van-icon {
color: gray; width: 80rpx;
} height: 80rpx;
.catstyle10 .right-slider .adbox { font-size: 80rpx;
width: 100%; color: gray;
height: calc(100vw - 105px / 3.37); }
margin-bottom: 10px;
} .catstyle10 .right-slider .adbox {
.catstyle10 .sec-title { width: 100%;
font-size: 13px; height: calc(100vw - 105px / 3.37);
font-weight: 500; margin-bottom: 10px;
margin: 10px 0; }
}
.catstyle10 .sec-title {
font-size: 13px;
font-weight: 500;
margin: 10px 0;
}
</style> </style>
This diff is collapsed.
<template> <template>
<view class="catsstyle2"> <view class="catsstyle2">
<view class="item" v-for="(x, index) in d" :key="index" @click="clickHandler(x)" :data-url='x.page_url'> <view class="item" v-for="(x, index) in d" :key="index" @click="clickHandler(x)" :data-url='x.page_url'>
<view class="left">{{x.Name}}</view> <view class="left">{{x.Name}}</view>
<view class="right"> <view class="right">
<image :src="getIconLink(x.IconPath)" style="width:100%;height:100%" mode="aspectFit" /> <image :src="getIconLink(x.IconPath)" style="width:100%;height:100%" mode="aspectFit" />
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props: ["d"], props: ["d"],
methods: { methods: {
goUrl(e){ goUrl(e) {
uni.navigateTo({url:e.mp.currentTarget.dataset.url}) uni.navigateTo({
}, url: e.mp.currentTarget.dataset.url
clickHandler(item) { })
let IsEducation = uni.getStorageSync('basedata') },
? (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation?uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation:0) clickHandler(item) {
:0; let IsEducation = uni.getStorageSync('basedata') ?
if(IsEducation==1){ (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation ? uni.getStorageSync('basedata').mall.setting.mallStyle
uni.navigateTo({ url: '/pages/school/courseList?CategoryIds='+item.Id }); .IsEducation : 0) :
}else{ 0;
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+item.Id }); if (IsEducation == 1) {
} uni.navigateTo({
}, url: '/pages/school/courseList?CategoryIds=' + item.Id
}, });
}; } else {
uni.navigateTo({
url: '/pages/goods/list?CategoryIds=' + item.Id
});
}
},
},
};
</script> </script>
<style> <style>
.catsstyle2 { .catsstyle2 {
padding: 12px 12px 0 12px; padding: 12px 12px 0 12px;
} }
.catsstyle2 .item {
height: 80px; .catsstyle2 .item {
display: flex; height: 80px;
background: #f5f5f5; display: flex;
margin-bottom: 12px; background: #f5f5f5;
} margin-bottom: 12px;
.catsstyle2 .item .left { }
padding: 15px;
font-size: 18px; .catsstyle2 .item .left {
font-weight: 600; padding: 15px;
color: #666; font-size: 18px;
flex: 1; font-weight: 600;
width: 1px; color: #666;
} flex: 1;
.catsstyle2 .item .right { width: 1px;
margin-top: 16px; }
width: 80px;
height: 64px; .catsstyle2 .item .right {
text-align: right; margin-top: 16px;
margin-right: 0px; width: 80px;
} height: 64px;
.catsstyle2 .item .right img { text-align: right;
width: 80px; margin-right: 0px;
height: 64px; }
}
</style> .catsstyle2 .item .right img {
\ No newline at end of file width: 80px;
height: 64px;
}
</style>
This diff is collapsed.
This diff is collapsed.
<template> <template>
<div class="catstyle5" style="height: 100%;"> <div class="catstyle5" style="height: 100%;">
<div class="left-slider"> <div class="left-slider">
<sidebar <sidebar :active="tid" name="Name" :active-color="mainColor" :border="false" :list="d" @change="changeHandler">
:active="tid" </sidebar>
name="Name" </div>
:active-color="mainColor" <div class="right-slider">
:border="false" <div class="adbox" v-if="d[tid].advert_pic">
:list="d" <image mode="aspectFit" :src="d[tid].advert_url" style="width: 100%; height: 100%;" />
@change="changeHandler" </div>
> <div class="item gg" v-for="(x, index) in sd" :key="index" @click="clickHandler(x)">
</sidebar> <div class="left">{{ x.Name }}</div>
</div> <div class="right">
<div class="right-slider"> <image v-if="x.IconPath && x.IconPath.length > 0" mode="aspectFit" :src="getIconLink(x.IconPath)" style="width: 100%; height: 100%;" />
<div </div>
class="adbox" </div>
v-if="d[tid].advert_pic" </div>
> </div>
<image
mode="aspectFit"
:src="d[tid].advert_url"
style="width: 100%; height: 100%;"
/>
</div>
<div
class="item gg"
v-for="(x, index) in sd"
:key="index"
@click="clickHandler(x)"
>
<div class="left">{{ x.Name }}</div>
<div class="right">
<image
v-if="x.IconPath && x.IconPath.length > 0"
mode="aspectFit"
:src="getIconLink(x.IconPath)"
style="width: 100%; height: 100%;"
/>
</div>
</div>
</div>
</div>
</template> </template>
<script> <script>
import sidebar from "../sidebar/index"; import sidebar from "../sidebar/index";
export default { export default {
props: ["d", "h"], props: ["d", "h"],
data() { data() {
return { return {
mainColor: "", mainColor: "",
page: 1, page: 1,
page_count: 1, page_count: 1,
mh: 0, mh: 0,
tid: 0, tid: 0,
active: 0, active: 0,
sd: [], sd: [],
}; };
}, },
components: { components: {
sidebar, sidebar,
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.sd = this.d[this.tid].ChildList; this.sd = this.d[this.tid].ChildList;
}, },
methods: { methods: {
changeHandler(i) { changeHandler(i) {
this.tid = i; this.tid = i;
this.page = 1; this.page = 1;
this.sd = this.d[this.tid].ChildList; this.sd = this.d[this.tid].ChildList;
}, },
clickHandler(item) { clickHandler(item) {
let Id1=this.d[this.tid].Id; let Id1 = this.d[this.tid].Id;
let Id2=item.Id; let Id2 = item.Id;
// let CategoryIds=Id1+','+Id2; let CategoryIds = Id2;
let CategoryIds=Id2; let IsEducation = uni.getStorageSync('basedata') ?
let IsEducation = uni.getStorageSync('basedata') (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation ? uni.getStorageSync('basedata').mall.setting.mallStyle
? (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation?uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation:0) .IsEducation : 0) :
:0; 0;
if(IsEducation==1){ if (IsEducation == 1) {
uni.navigateTo({ url: '/pages/school/courseList?CategoryIds='+CategoryIds }); uni.navigateTo({
}else{ url: '/pages/school/courseList?CategoryIds=' + CategoryIds
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+CategoryIds }); });
} } else {
uni.navigateTo({
}, url: '/pages/goods/list?CategoryIds=' + CategoryIds
}, });
}; }
},
},
};
</script> </script>
<style> <style>
.catstyle5 { .catstyle5 {
display: flex; display: flex;
} }
.catstyle5 .left-slider {
width: 85px; .catstyle5 .left-slider {
height: 100%; width: 85px;
background: #f5f5f5; height: 100%;
} background: #f5f5f5;
.catstyle5 .right-slider { }
padding: 10px;
height: 100%; .catstyle5 .right-slider {
width: 1px; padding: 10px;
flex: 1; height: 100%;
overflow: hidden; width: 1px;
overflow-y: auto; flex: 1;
} overflow: hidden;
.catstyle5 .right-slider .item { overflow-y: auto;
height: 80px; }
display: flex;
background: #f5f5f5; .catstyle5 .right-slider .item {
margin-bottom: 10px; height: 80px;
} display: flex;
.catstyle5 .right-slider .item .left { background: #f5f5f5;
padding: 15px; margin-bottom: 10px;
font-size: 18px; }
font-weight: 600;
color: #666; .catstyle5 .right-slider .item .left {
flex: 1; padding: 15px;
width: 1px; font-size: 18px;
} font-weight: 600;
.catstyle5 .right-slider .item .right { color: #666;
margin-top: 16px; flex: 1;
width: 80px; width: 1px;
height: 64px; }
text-align: right;
margin-right: 0px; .catstyle5 .right-slider .item .right {
} margin-top: 16px;
.catstyle5 .right-slider .item .right img { width: 80px;
width: 80px; height: 64px;
height: 64px; text-align: right;
} margin-right: 0px;
.catstyle5 .right-slider .adbox { }
width: 100%;
height: calc(100vw - 105px / 3.37); .catstyle5 .right-slider .item .right img {
margin-bottom: 10px; width: 80px;
} height: 64px;
}
.catstyle5 .right-slider .adbox {
width: 100%;
height: calc(100vw - 105px / 3.37);
margin-bottom: 10px;
}
</style> </style>
<template> <template>
<div class="catstyle6" style="height: 100%;"> <div class="catstyle6" style="height: 100%;">
<div class="left-slider"> <div class="left-slider">
<sidebar <sidebar :active="tid" name="Name" :active-color="mainColor" :border="false" :list="d" @change="changeHandler"></sidebar>
:active="tid" </div>
name="Name" <div class="right-slider">
:active-color="mainColor" <div class="adbox" v-if="d[tid].advert_pic" @click="clickHandler(d[tid].advert_url)">
:border="false" <image mode="aspectFit" :src="d[tid].advert_url" style="width: 100%; height: 100%;" />
:list="d" </div>
@change="changeHandler" <u-grid :col="3" :border="false">
></sidebar> <u-grid-item v-for="(c, i) in sd" :key="i" @click="clickHandler(c)">
</div> <image class="imgclass" :src="getIconLink(c.IconPath)" style="width: 80rpx; height: 80rpx;" />
<div class="right-slider"> <text class="grid-text">{{ c.Name }}</text>
<div </u-grid-item>
class="adbox" </u-grid>
v-if="d[tid].advert_pic" </div>
@click="clickHandler(d[tid].advert_url)" </div>
>
<image
mode="aspectFit"
:src="d[tid].advert_url"
style="width: 100%; height: 100%;"
/>
</div>
<u-grid :col="3" :border="false">
<u-grid-item
v-for="(c, i) in sd"
:key="i"
@click="clickHandler(c)"
>
<image
class="imgclass"
:src="getIconLink(c.IconPath)"
style="width: 80rpx; height: 80rpx;"
/>
<text class="grid-text">{{ c.Name }}</text>
</u-grid-item>
</u-grid>
</div>
</div>
</template> </template>
<script> <script>
import sidebar from "../sidebar/index"; import sidebar from "../sidebar/index";
export default { export default {
props: ["d", "h"], props: ["d", "h"],
data() { data() {
return { return {
mainColor: "", mainColor: "",
activeStyle: "", activeStyle: "",
page: 1, page: 1,
page_count: 1, page_count: 1,
mh: 0, mh: 0,
tid: 0, tid: 0,
active: 0, active: 0,
sd: [], sd: [],
}; };
}, },
components: { components: {
sidebar, sidebar,
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.activeStyle = `background:${this.mainColor};`; this.activeStyle = `background:${this.mainColor};`;
this.sd = this.d[this.tid].ChildList; this.sd = this.d[this.tid].ChildList;
}, },
methods: { methods: {
changeHandler(i) { changeHandler(i) {
this.tid = i; this.tid = i;
this.page = 1; this.page = 1;
this.sd = this.d[this.tid].ChildList; this.sd = this.d[this.tid].ChildList;
}, },
clickHandler(item) { clickHandler(item) {
let Id1=this.d[this.tid].Id; let Id1 = this.d[this.tid].Id;
let Id2=item.Id; let Id2 = item.Id;
// let CategoryIds=Id1+','+Id2; let CategoryIds = Id2;
let CategoryIds=Id2; let IsEducation = uni.getStorageSync('basedata') ?
let IsEducation = uni.getStorageSync('basedata') (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation ? uni.getStorageSync('basedata').mall.setting.mallStyle
? (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation?uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation:0) .IsEducation : 0) :
:0; 0;
if(IsEducation==1){ if (IsEducation == 1) {
uni.navigateTo({ url: '/pages/school/courseList?CategoryIds='+CategoryIds }); uni.navigateTo({
}else{ url: '/pages/school/courseList?CategoryIds=' + CategoryIds
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+CategoryIds }); });
} } else {
}, uni.navigateTo({
}, url: '/pages/goods/list?CategoryIds=' + CategoryIds
}; });
}
},
},
};
</script> </script>
<style> <style>
.catstyle6 .imgclass{ .catstyle6 .imgclass {
display: block; display: block;
width: 80rpx; height: 80rpx; width: 80rpx;
} height: 80rpx;
.catstyle6 { }
display: flex;
} .catstyle6 {
.catstyle6 .grid-text { display: flex;
font-size: 24rpx; }
margin-top: 4rpx;
color: "#330330"; .catstyle6 .grid-text {
} font-size: 24rpx;
.catstyle6 .left-slider { margin-top: 4rpx;
width: 85px; color: "#330330";
height: 100%; }
background: #f5f5f5;
} .catstyle6 .left-slider {
.catstyle6 .right-slider { width: 85px;
padding: 10px; height: 100%;
height: 100%; background: #f5f5f5;
width: 1px; }
flex: 1;
} .catstyle6 .right-slider {
.catstyle6 .right-slider .adbox { padding: 10px;
width: 100%; height: 100%;
height: calc(100vw - 105px / 3.37); width: 1px;
margin-bottom: 10px; flex: 1;
} }
.catstyle6 .right-slider .adbox {
width: 100%;
height: calc(100vw - 105px / 3.37);
margin-bottom: 10px;
}
</style> </style>
This diff is collapsed.
This diff is collapsed.
<template> <template>
<view class="catstyle9" style="height: 100%;"> <view class="catstyle9" style="height: 100%;">
<view class="left-slider"> <view class="left-slider">
<sidebar <sidebar :active="tid" name="Name" :active-color="mainColor" :border="false" :list="d" @change="changeHandler"></sidebar>
:active="tid"
name="Name"
:active-color="mainColor"
:border="false"
:list="d"
@change="changeHandler"
></sidebar>
</view>
<view class="right-slider">
<view
class="adbox"
v-if="d[tid].advert_pic"
>
<image
mode="aspectFit"
:src="d[tid].advert_url"
style="width: 100%; height: 100%;"
/>
</view>
<view v-for="(x, index) in sd" :key="index">
<view @click="clickHandler(x)" class="sec-title">{{ x.Name }}
</view> </view>
<template v-if="x.ChildList && x.ChildList.length > 0"> <view class="right-slider">
<view <view class="adbox" v-if="d[tid].advert_pic">
class="item" <image mode="aspectFit" :src="d[tid].advert_url" style="width: 100%; height: 100%;" />
v-for="(cx, ci) in x.ChildList" </view>
:key="ci" <view v-for="(x, index) in sd" :key="index">
<view @click="clickHandler(x)" class="sec-title">{{ x.Name }}
:data-url="cx.page_url" </view>
> <template v-if="x.ChildList && x.ChildList.length > 0">
<view class="left">{{ cx.Name }}</view> <view class="item" v-for="(cx, ci) in x.ChildList" :key="ci" :data-url="cx.page_url">
<view class="right"> <view class="left">{{ cx.Name }}</view>
<image <view class="right">
v-if="cx.IconPath && cx.IconPath!=''" <image v-if="cx.IconPath && cx.IconPath!=''" mode="aspectFit" :src="getIconLink(cx.IconPath)" style="width: 100%; height: 100%;" />
mode="aspectFit" </view>
:src="getIconLink(cx.IconPath)" </view>
style="width: 100%; height: 100%;" </template>
/> <template v-else>
</view> <view class="item">
</view> <view class="left">无三级分类</view>
</template> <view class="right"></view>
<template v-else> </view>
<view class="item"> </template>
<view class="left">无三级分类</view> </view>
<view class="right"></view> </view>
</view> </view>
</template>
</view>
</view>
</view>
</template> </template>
<script> <script>
import sidebar from "../sidebar/index"; import sidebar from "../sidebar/index";
export default { export default {
props: ["d", "h"], props: ["d", "h"],
components: { components: {
sidebar, sidebar,
}, },
data() { data() {
return { return {
mainColor: "", mainColor: "",
page: 1, page: 1,
page_count: 1, page_count: 1,
mh: 0, mh: 0,
tid: 0, tid: 0,
active: 0, active: 0,
sd: [], sd: [],
}; };
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.sd = this.d[this.tid].ChildList; this.sd = this.d[this.tid].ChildList;
}, },
methods: { methods: {
changeHandler(e) { changeHandler(e) {
this.tid = e; this.tid = e;
this.page = 1; this.page = 1;
this.sd = this.d[this.tid].ChildList; this.sd = this.d[this.tid].ChildList;
}, },
clickHandler(item) { clickHandler(item) {
let Id1=this.d[this.tid].Id; let Id1 = this.d[this.tid].Id;
let Id2=item.Id; let Id2 = item.Id;
// let CategoryIds=Id1+','+Id2; let CategoryIds = Id2;
let CategoryIds=Id2;
let IsEducation = uni.getStorageSync('basedata') ?
let IsEducation = uni.getStorageSync('basedata') (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation ? uni.getStorageSync('basedata').mall.setting.mallStyle
? (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation?uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation:0) .IsEducation : 0) :
:0; 0;
if(IsEducation==1){ if (IsEducation == 1) {
uni.navigateTo({ url: '/pages/school/courseList?CategoryIds='+CategoryIds }); uni.navigateTo({
}else{ url: '/pages/school/courseList?CategoryIds=' + CategoryIds
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+CategoryIds }); });
} } else {
}, uni.navigateTo({
}, url: '/pages/goods/list?CategoryIds=' + CategoryIds
}; });
}
},
},
};
</script> </script>
<style> <style>
.catstyle9 { .catstyle9 {
display: flex; display: flex;
} }
.catstyle9 .left-slider {
width: 85px; .catstyle9 .left-slider {
height: 100%; width: 85px;
background: #f5f5f5; height: 100%;
} background: #f5f5f5;
.catstyle9 .right-slider { }
padding: 10px;
height: 100%; .catstyle9 .right-slider {
width: 1px; padding: 10px;
flex: 1; height: 100%;
overflow: hidden; width: 1px;
overflow-y: auto; flex: 1;
} overflow: hidden;
.catstyle9 .right-slider .item { overflow-y: auto;
height: 80px; }
display: flex;
background: #f5f5f5; .catstyle9 .right-slider .item {
margin-bottom: 10px; height: 80px;
} display: flex;
.catstyle9 .right-slider .item .left { background: #f5f5f5;
padding: 15px; margin-bottom: 10px;
font-size: 16px; }
font-weight: 600;
color: #666; .catstyle9 .right-slider .item .left {
flex: 1; padding: 15px;
width: 1px; font-size: 16px;
} font-weight: 600;
.catstyle9 .right-slider .item .right { color: #666;
margin-top: 16px; flex: 1;
width: 80px; width: 1px;
height: 64px; }
text-align: right;
margin-right: 0px; .catstyle9 .right-slider .item .right {
} margin-top: 16px;
.catstyle9 .right-slider .item .right img { width: 80px;
width: 80px; height: 64px;
height: 64px; text-align: right;
} margin-right: 0px;
.catstyle9 .right-slider .adbox { }
width: 100%;
height: calc(100vw - 105px / 3.37); .catstyle9 .right-slider .item .right img {
margin-bottom: 10px; width: 80px;
} height: 64px;
.catstyle9 .sec-title { }
font-size: 14px;
font-weight: 500; .catstyle9 .right-slider .adbox {
margin: 10px 0; width: 100%;
} height: calc(100vw - 105px / 3.37);
margin-bottom: 10px;
}
.catstyle9 .sec-title {
font-size: 14px;
font-weight: 500;
margin: 10px 0;
}
</style> </style>
This diff is collapsed.
<template> <template>
<view <view class="checkin" :style="{
class="checkin"
:style="{
'background-image': 'url(' + check.backgroundPicUrl + ')', 'background-image': 'url(' + check.backgroundPicUrl + ')',
}" }">
> <template v-if="check.showText">
<template v-if="check.showText"> <view style="width:100%" :style="{color:check.textColor,'text-align':check.textPosition}">
<view style="width:100%" :style="{color:check.textColor,'text-align':check.textPosition}"> <view style="margin-bottom:10px;">今日签到可获得5积分</view>
<view style="margin-bottom:10px;">今日签到可获得5积分</view> <!-- todo 签到功能对接 -->
<!-- todo 签到功能对接 --> <view>已连续签到9天</view>
<view>已连续签到9天</view> </view>
</view> </template>
</template> <view class="hot-area" v-if="check.hotspot" @click="clickHandler" :style="[formatStyle]"></view>
<view </view>
class="hot-area"
v-if="check.hotspot"
@click="clickHandler"
:style="[formatStyle]"
></view>
</view>
</template> </template>
<script> <script>
export default { export default {
props: ["check"], props: ["check"],
data() { data() {
return { return {
formatStyle: "", formatStyle: "",
}; };
}, },
created() { created() {
if (this.check.hotspot) { if (this.check.hotspot) {
this.formatStyle = { this.formatStyle = {
height: `${this.check.hotspot.height}rpx`, height: `${this.check.hotspot.height}rpx`,
width: `${this.check.hotspot.width}rpx`, width: `${this.check.hotspot.width}rpx`,
left:`${this.check.hotspot.left}rpx`, left: `${this.check.hotspot.left}rpx`,
top:`${this.check.hotspot.top}rpx;` top: `${this.check.hotspot.top}rpx;`
} }
} }
}, },
methods: { methods: {
clickHandler(e) { clickHandler(e) {
if ( if (
this.check.hotspot && this.check.hotspot &&
this.check.hotspot.link && this.check.hotspot.link &&
this.check.hotspot.link != "" this.check.hotspot.link != ""
) { ) {
uni.navigateTo({ url: this.check.hotspot.lin }); uni.navigateTo({
} url: this.check.hotspot.lin
}, });
}, }
}; },
},
};
</script> </script>
<style> <style>
.checkin { .checkin {
background-repeat: no-repeat; background-repeat: no-repeat;
height: 200rpx; height: 200rpx;
background-size: 100% 100%; background-size: 100% 100%;
display: flex; display: flex;
align-items: center; align-items: center;
position: relative; position: relative;
padding: 0 20px; padding: 0 20px;
} }
.checkin text {
line-height: 25px; .checkin text {
} line-height: 25px;
.checkin .hot-area { }
position: absolute;
z-index: 2; .checkin .hot-area {
} position: absolute;
z-index: 2;
}
</style> </style>
<template> <template>
<view class="copyright" :style="{'background':cop.backgroundColor}" @click="clickHandler"> <view class="copyright" :style="{'background':cop.backgroundColor}" @click="clickHandler">
<image :src="cop.picUrl" mode="widthFix" style=" width: 160rpx;height:50rpx;display: block;margin: 0 auto;margin-bottom: 12rpx;" /> <image :src="cop.picUrl" mode="widthFix" style=" width: 160rpx;height:50rpx;display: block;margin: 0 auto;margin-bottom: 12rpx;" />
<text>{{cop.text}}</text> <text>{{cop.text}}</text>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props: ["cop"], props: ["cop"],
methods: { methods: {
clickHandler() { clickHandler() {
if (this.cop.url && this.cop.url != "") { if (this.cop.url && this.cop.url != "") {
uni.navigateTo({ url: this.cop.url }); uni.navigateTo({
} url: this.cop.url
} });
} }
}; }
}
};
</script> </script>
<style> <style>
.copyright { .copyright {
text-align: center; text-align: center;
padding: 15px; padding: 15px;
font-size: 13px; font-size: 13px;
} }
</style> </style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<template> <template>
<view :style="{'background':block.background,'height':block.height+'px'}"></view> <view :style="{'background':block.background,'height':block.height+'px'}"></view>
</template> </template>
<script> <script>
export default { export default {
props:['block'], props: ['block'],
data() { data() {
return { return {
st:{} st: {}
} }
}, },
created() { created() {
this.st={'background':this.block.background,'height':this.block.height+'rpx'} this.st = {
}, 'background': this.block.background,
} 'height': this.block.height + 'rpx'
}
},
}
</script> </script>
<style> <style>
</style> </style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment