Commit a177037a authored by 黄奎's avatar 黄奎

代码优化

parent ffb5559a
<template>
<view class="addialog" v-if="show">
<swiper indicator-dots style="height:60%;margin:0 10%;width:80%">
<swiper-item v-for="(item, index) in ads.list" :key="index">
<image
mode="aspectFit"
:src="item.picUrl"
width="100%"
@click="clickHandler(item.link.url)"
style="height:100%"
/>
</swiper-item>
</swiper>
<view class="close">
<u-icon name="close" color="#000" size="56" @click="closeHandler" />
</view>
</view>
<view class="addialog" v-if="show">
<swiper indicator-dots style="height:60%;margin:0 10%;width:80%">
<swiper-item v-for="(item, index) in ads.list" :key="index">
<image mode="aspectFit" :src="item.picUrl" width="100%" @click="clickHandler(item.link.url)" style="height:100%" />
</swiper-item>
</swiper>
<view class="close">
<u-icon name="close" color="#000" size="56" @click="closeHandler" />
</view>
</view>
</template>
<script>
export default {
props: ["ads"],
data() {
return {
show:false
};
},
created() {
if(this.ads.times==1){
let showedAd=uni.getStorageSync('showedAd')?uni.getStorageSync('showedAd'):[]
let isExsit=false
showedAd.forEach(x=>{
if(x.toString()==this.ads.list.toString()){
isExsit=true
return false
}
})
if(isExsit){
this.closeHandler()
}else{
showedAd.push(this.ads.list)
uni.setStorageSync("showedAd", showedAd);
this.show=true
}
}else{
this.show=true
}
},
methods: {
clickHandler(e) {
if (e.currentTarget.dataset.url && e.currentTarget.dataset.url != "") {
uni.navigateTo({ url: e.currentTarget.dataset.url });
}
},
closeHandler(){
this.show=false
}
}
};
export default {
props: ["ads"],
data() {
return {
show: false
};
},
created() {
if (this.ads.times == 1) {
let showedAd = uni.getStorageSync('showedAd') ? uni.getStorageSync('showedAd') : []
let isExsit = false
showedAd.forEach(x => {
if (x.toString() == this.ads.list.toString()) {
isExsit = true
return false
}
})
if (isExsit) {
this.closeHandler()
} else {
showedAd.push(this.ads.list)
uni.setStorageSync("showedAd", showedAd);
this.show = true
}
} else {
this.show = true
}
},
methods: {
clickHandler(e) {
if (e.currentTarget.dataset.url && e.currentTarget.dataset.url != "") {
uni.navigateTo({
url: e.currentTarget.dataset.url
});
}
},
closeHandler() {
this.show = false
}
}
};
</script>
<style>
.addialog {
position: fixed;
bottom: 0;
left: 0;
right: 0;
top: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
z-index: 999999999;
}
.addialog .close{
position: absolute;
bottom: 14%;
left: 50%;
margin-left: -14px;
}
.addialog {
position: fixed;
bottom: 0;
left: 0;
right: 0;
top: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
z-index: 999999999;
}
.addialog .close {
position: absolute;
bottom: 14%;
left: 50%;
margin-left: -14px;
}
</style>
\ No newline at end of file
......@@ -5,174 +5,171 @@
<button :style="sureStyle" class="hotsopt" open-type="getUserInfo" @getuserinfo="getUserInfo"></button>
<button :style="cancelStyle" class="hotsopt" @click="close"></button>
</u-popup>
<coupon
v-if="showCoupons"
:coupon-message="couponMessage"
@goLook="goLook"
@closeBtn="closeBtn"
></coupon>
<coupon v-if="showCoupons" :coupon-message="couponMessage" @goLook="goLook" @closeBtn="closeBtn"></coupon>
</div>
</template>
<script>
import coupon from "@/components/coupons/coupons";
export default {
components:{
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'
});
}
}
});
export default {
components: {
coupon
},
close() {
this.showDialog=false;
this.$emit('gbAuth');
data() {
return {
pageinfo: {},
sureStyle: '',
cancelStyle: '',
showDialog: true,
showCoupons: false,
couponMessage: '',
};
},
//调用获取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);
}
}
);
}
});
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;`;
},
//登录
getLogin(obj) {
var that = this;
let pid = uni.getStorageSync("pid")?uni.getStorageSync("pid").pid:0;
let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0;
let SmallShopId = uni.getStorageSync("SmallShopId")?uni.getStorageSync("SmallShopId").SmallShopId:0;
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,
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() {
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;
uni.setStorageSync('mall_UserInfo', res.data);
that.$emit('changeuserinfo');
if(res.couponResultCode==1){
this.showCoupons = true;
this.couponMessage = res.couponMessage;
});
},
//登录
getLogin(obj) {
var that = this;
let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0;
let SmallShopId = uni.getStorageSync("SmallShopId") ? uni.getStorageSync("SmallShopId").SmallShopId : 0;
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(){
this.showCoupons = false;
},
closeBtn(){
this.showCoupons = false
);
},
goLook() {
this.showCoupons = false;
},
closeBtn() {
this.showCoupons = false
}
}
}
};
};
</script>
<style>
.auth-page img {
width: 650rpx;
height: 700rpx;
}
.auth-page .hotsopt {
position: absolute;
background: transparent;
border: none;
outline: none;
}
.auth-page .hotsopt::after {
border: none;
}
</style>
.auth-page img {
width: 650rpx;
height: 700rpx;
}
.auth-page .hotsopt {
position: absolute;
background: transparent;
border: none;
outline: none;
}
.auth-page .hotsopt::after {
border: none;
}
</style>
\ No newline at end of file
<template>
<div class="catsstyle1">
<u-grid :col="4" :border="false">
<u-grid-item
v-for="(c, i) in d"
:key="i"
@click="clickHandler(c)"
>
<image
:src="getIconLink(c.IconPath)"
style="width: 80rpx; height: 80rpx;"
/>
<text class="grid-text">{{ c.Name }}</text>
</u-grid-item>
</u-grid>
</div>
<div class="catsstyle1">
<u-grid :col="4" :border="false">
<u-grid-item v-for="(c, i) in d" :key="i" @click="clickHandler(c)">
<image :src="getIconLink(c.IconPath)" style="width: 80rpx; height: 80rpx;" />
<text class="grid-text">{{ c.Name }}</text>
</u-grid-item>
</u-grid>
</div>
</template>
<script>
export default {
props: ["d"],
data() {
return {
activeId: 0,
};
},
methods: {
clickHandler(item) {
let IsEducation = uni.getStorageSync('basedata')
? (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation?uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation:0)
:0;
if(IsEducation==1){
uni.navigateTo({ url: '/pages/school/courseList?CategoryIds='+item.Id });
}else{
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+item.Id });
}
},
},
};
export default {
props: ["d"],
data() {
return {
activeId: 0,
};
},
methods: {
clickHandler(item) {
let IsEducation = uni.getStorageSync('basedata') ?
(uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation ? uni.getStorageSync('basedata').mall.setting.mallStyle
.IsEducation : 0) :
0;
if (IsEducation == 1) {
uni.navigateTo({
url: '/pages/school/courseList?CategoryIds=' + item.Id
});
} else {
uni.navigateTo({
url: '/pages/goods/list?CategoryIds=' + item.Id
});
}
},
},
};
</script>
<style>
.catsstyle1 {
padding: 12px 0;
}
.catsstyle1 .grid-text {
font-size: 24rpx;
margin-top: 4rpx;
color: "#330330";
}
.catsstyle1 {
padding: 12px 0;
}
.catsstyle1 .grid-text {
font-size: 24rpx;
margin-top: 4rpx;
color: "#330330";
}
</style>
<template>
<div class="catstyle10" style="height:100%">
<div class="left-slider">
<sidebar
:active="tid"
name="Name"
:active-color="mainColor"
:border="false"
:list="d"
@change="changeHandler"
></sidebar>
</div>
<div class="right-slider">
<div
class="adbox"
v-if="d[tid].advert_pic"
>
<image
mode="aspectFit"
:src="d[tid].advert_url"
style="width: 100%; height: 100%;"
/>
</div>
<div v-for="(c, i) in sd" :key="i">
<div @click="clickHandler(c)" class="sec-title">{{ c.Name }}</div>
<u-grid :column-num="3" :border="false">
<template v-if="c.ChildList && c.ChildList.length > 0">
<u-grid-item
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>
<div class="catstyle10" style="height:100%">
<div class="left-slider">
<sidebar :active="tid" name="Name" :active-color="mainColor" :border="false" :list="d" @change="changeHandler"></sidebar>
</div>
<div class="right-slider">
<div class="adbox" v-if="d[tid].advert_pic">
<image mode="aspectFit" :src="d[tid].advert_url" style="width: 100%; height: 100%;" />
</div>
<div v-for="(c, i) in sd" :key="i">
<div @click="clickHandler(c)" class="sec-title">{{ c.Name }}</div>
<u-grid :column-num="3" :border="false">
<template v-if="c.ChildList && c.ChildList.length > 0">
<u-grid-item 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>
<script>
import sidebar from "../sidebar/index";
export default {
props: ["d", "h"],
data() {
return {
mainColor: "",
activeStyle: "",
page: 1,
page_count: 1,
mh: 0,
tid: 0,
active: 0,
sd: [],
};
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.activeStyle = `background:${this.mainColor};`;
this.sd = this.d[this.tid].ChildList;
},
components:{
sidebar
},
methods: {
changeHandler(e) {
this.tid = e;
this.page = 1;
this.sd = this.d[this.tid].ChildList;
},
clickHandler(item) {
let Id1=this.d[this.tid].Id;
let Id2=item.Id;
// let CategoryIds=Id1+','+Id2;
let CategoryIds=Id2;
let IsEducation = uni.getStorageSync('basedata')
? (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation?uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation:0)
:0;
if(IsEducation==1){
uni.navigateTo({ url: '/pages/school/courseList?CategoryIds='+CategoryIds });
}else{
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+CategoryIds });
}
}
},
};
import sidebar from "../sidebar/index";
export default {
props: ["d", "h"],
data() {
return {
mainColor: "",
activeStyle: "",
page: 1,
page_count: 1,
mh: 0,
tid: 0,
active: 0,
sd: [],
};
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.activeStyle = `background:${this.mainColor};`;
this.sd = this.d[this.tid].ChildList;
},
components: {
sidebar
},
methods: {
changeHandler(e) {
this.tid = e;
this.page = 1;
this.sd = this.d[this.tid].ChildList;
},
clickHandler(item) {
let Id1 = this.d[this.tid].Id;
let Id2 = item.Id;
let CategoryIds = Id2;
let IsEducation = uni.getStorageSync('basedata') ?
(uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation ? uni.getStorageSync('basedata').mall.setting.mallStyle
.IsEducation : 0) :
0;
if (IsEducation == 1) {
uni.navigateTo({
url: '/pages/school/courseList?CategoryIds=' + CategoryIds
});
} else {
uni.navigateTo({
url: '/pages/goods/list?CategoryIds=' + CategoryIds
});
}
}
},
};
</script>
<style>
.catstyle10 {
display: flex;
}
.catstyle10 .left-slider {
width: 85px;
height: 100%;
background: #f5f5f5;
}
.catstyle10 .right-slider {
padding: 10px;
height: 100%;
width: 1px;
flex: 1;
overflow: hidden;
overflow-y: auto;
}
.catstyle10 .right-slider .van-icon--image,
.catstyle10 .right-slider .van-icon {
width: 80rpx;
height: 80rpx;
font-size: 80rpx;
color: gray;
}
.catstyle10 .right-slider .adbox {
width: 100%;
height: calc(100vw - 105px / 3.37);
margin-bottom: 10px;
}
.catstyle10 .sec-title {
font-size: 13px;
font-weight: 500;
margin: 10px 0;
}
.catstyle10 {
display: flex;
}
.catstyle10 .left-slider {
width: 85px;
height: 100%;
background: #f5f5f5;
}
.catstyle10 .right-slider {
padding: 10px;
height: 100%;
width: 1px;
flex: 1;
overflow: hidden;
overflow-y: auto;
}
.catstyle10 .right-slider .van-icon--image,
.catstyle10 .right-slider .van-icon {
width: 80rpx;
height: 80rpx;
font-size: 80rpx;
color: gray;
}
.catstyle10 .right-slider .adbox {
width: 100%;
height: calc(100vw - 105px / 3.37);
margin-bottom: 10px;
}
.catstyle10 .sec-title {
font-size: 13px;
font-weight: 500;
margin: 10px 0;
}
</style>
This diff is collapsed.
<template>
<view class="catsstyle2">
<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="right">
<image :src="getIconLink(x.IconPath)" style="width:100%;height:100%" mode="aspectFit" />
</view>
</view>
</view>
<view class="catsstyle2">
<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="right">
<image :src="getIconLink(x.IconPath)" style="width:100%;height:100%" mode="aspectFit" />
</view>
</view>
</view>
</template>
<script>
export default {
props: ["d"],
methods: {
goUrl(e){
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)
:0;
if(IsEducation==1){
uni.navigateTo({ url: '/pages/school/courseList?CategoryIds='+item.Id });
}else{
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+item.Id });
}
},
},
};
export default {
props: ["d"],
methods: {
goUrl(e) {
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) :
0;
if (IsEducation == 1) {
uni.navigateTo({
url: '/pages/school/courseList?CategoryIds=' + item.Id
});
} else {
uni.navigateTo({
url: '/pages/goods/list?CategoryIds=' + item.Id
});
}
},
},
};
</script>
<style>
.catsstyle2 {
padding: 12px 12px 0 12px;
}
.catsstyle2 .item {
height: 80px;
display: flex;
background: #f5f5f5;
margin-bottom: 12px;
}
.catsstyle2 .item .left {
padding: 15px;
font-size: 18px;
font-weight: 600;
color: #666;
flex: 1;
width: 1px;
}
.catsstyle2 .item .right {
margin-top: 16px;
width: 80px;
height: 64px;
text-align: right;
margin-right: 0px;
}
.catsstyle2 .item .right img {
width: 80px;
height: 64px;
}
</style>
\ No newline at end of file
.catsstyle2 {
padding: 12px 12px 0 12px;
}
.catsstyle2 .item {
height: 80px;
display: flex;
background: #f5f5f5;
margin-bottom: 12px;
}
.catsstyle2 .item .left {
padding: 15px;
font-size: 18px;
font-weight: 600;
color: #666;
flex: 1;
width: 1px;
}
.catsstyle2 .item .right {
margin-top: 16px;
width: 80px;
height: 64px;
text-align: right;
margin-right: 0px;
}
.catsstyle2 .item .right img {
width: 80px;
height: 64px;
}
</style>
This diff is collapsed.
This diff is collapsed.
<template>
<div class="catstyle5" style="height: 100%;">
<div class="left-slider">
<sidebar
:active="tid"
name="Name"
:active-color="mainColor"
:border="false"
:list="d"
@change="changeHandler"
>
</sidebar>
</div>
<div class="right-slider">
<div
class="adbox"
v-if="d[tid].advert_pic"
>
<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>
<div class="catstyle5" style="height: 100%;">
<div class="left-slider">
<sidebar :active="tid" name="Name" :active-color="mainColor" :border="false" :list="d" @change="changeHandler">
</sidebar>
</div>
<div class="right-slider">
<div class="adbox" v-if="d[tid].advert_pic">
<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>
<script>
import sidebar from "../sidebar/index";
export default {
props: ["d", "h"],
data() {
return {
mainColor: "",
page: 1,
page_count: 1,
mh: 0,
tid: 0,
active: 0,
sd: [],
};
},
components: {
sidebar,
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.sd = this.d[this.tid].ChildList;
},
methods: {
changeHandler(i) {
this.tid = i;
this.page = 1;
this.sd = this.d[this.tid].ChildList;
},
clickHandler(item) {
let Id1=this.d[this.tid].Id;
let Id2=item.Id;
// let CategoryIds=Id1+','+Id2;
let CategoryIds=Id2;
let IsEducation = uni.getStorageSync('basedata')
? (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation?uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation:0)
:0;
if(IsEducation==1){
uni.navigateTo({ url: '/pages/school/courseList?CategoryIds='+CategoryIds });
}else{
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+CategoryIds });
}
},
},
};
import sidebar from "../sidebar/index";
export default {
props: ["d", "h"],
data() {
return {
mainColor: "",
page: 1,
page_count: 1,
mh: 0,
tid: 0,
active: 0,
sd: [],
};
},
components: {
sidebar,
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.sd = this.d[this.tid].ChildList;
},
methods: {
changeHandler(i) {
this.tid = i;
this.page = 1;
this.sd = this.d[this.tid].ChildList;
},
clickHandler(item) {
let Id1 = this.d[this.tid].Id;
let Id2 = item.Id;
let CategoryIds = Id2;
let IsEducation = uni.getStorageSync('basedata') ?
(uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation ? uni.getStorageSync('basedata').mall.setting.mallStyle
.IsEducation : 0) :
0;
if (IsEducation == 1) {
uni.navigateTo({
url: '/pages/school/courseList?CategoryIds=' + CategoryIds
});
} else {
uni.navigateTo({
url: '/pages/goods/list?CategoryIds=' + CategoryIds
});
}
},
},
};
</script>
<style>
.catstyle5 {
display: flex;
}
.catstyle5 .left-slider {
width: 85px;
height: 100%;
background: #f5f5f5;
}
.catstyle5 .right-slider {
padding: 10px;
height: 100%;
width: 1px;
flex: 1;
overflow: hidden;
overflow-y: auto;
}
.catstyle5 .right-slider .item {
height: 80px;
display: flex;
background: #f5f5f5;
margin-bottom: 10px;
}
.catstyle5 .right-slider .item .left {
padding: 15px;
font-size: 18px;
font-weight: 600;
color: #666;
flex: 1;
width: 1px;
}
.catstyle5 .right-slider .item .right {
margin-top: 16px;
width: 80px;
height: 64px;
text-align: right;
margin-right: 0px;
}
.catstyle5 .right-slider .item .right img {
width: 80px;
height: 64px;
}
.catstyle5 .right-slider .adbox {
width: 100%;
height: calc(100vw - 105px / 3.37);
margin-bottom: 10px;
}
.catstyle5 {
display: flex;
}
.catstyle5 .left-slider {
width: 85px;
height: 100%;
background: #f5f5f5;
}
.catstyle5 .right-slider {
padding: 10px;
height: 100%;
width: 1px;
flex: 1;
overflow: hidden;
overflow-y: auto;
}
.catstyle5 .right-slider .item {
height: 80px;
display: flex;
background: #f5f5f5;
margin-bottom: 10px;
}
.catstyle5 .right-slider .item .left {
padding: 15px;
font-size: 18px;
font-weight: 600;
color: #666;
flex: 1;
width: 1px;
}
.catstyle5 .right-slider .item .right {
margin-top: 16px;
width: 80px;
height: 64px;
text-align: right;
margin-right: 0px;
}
.catstyle5 .right-slider .item .right img {
width: 80px;
height: 64px;
}
.catstyle5 .right-slider .adbox {
width: 100%;
height: calc(100vw - 105px / 3.37);
margin-bottom: 10px;
}
</style>
<template>
<div class="catstyle6" style="height: 100%;">
<div class="left-slider">
<sidebar
:active="tid"
name="Name"
:active-color="mainColor"
:border="false"
:list="d"
@change="changeHandler"
></sidebar>
</div>
<div class="right-slider">
<div
class="adbox"
v-if="d[tid].advert_pic"
@click="clickHandler(d[tid].advert_url)"
>
<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>
<div class="catstyle6" style="height: 100%;">
<div class="left-slider">
<sidebar :active="tid" name="Name" :active-color="mainColor" :border="false" :list="d" @change="changeHandler"></sidebar>
</div>
<div class="right-slider">
<div class="adbox" v-if="d[tid].advert_pic" @click="clickHandler(d[tid].advert_url)">
<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>
<script>
import sidebar from "../sidebar/index";
export default {
props: ["d", "h"],
data() {
return {
mainColor: "",
activeStyle: "",
page: 1,
page_count: 1,
mh: 0,
tid: 0,
active: 0,
sd: [],
};
},
components: {
sidebar,
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.activeStyle = `background:${this.mainColor};`;
this.sd = this.d[this.tid].ChildList;
},
methods: {
changeHandler(i) {
this.tid = i;
this.page = 1;
this.sd = this.d[this.tid].ChildList;
},
clickHandler(item) {
let Id1=this.d[this.tid].Id;
let Id2=item.Id;
// let CategoryIds=Id1+','+Id2;
let CategoryIds=Id2;
let IsEducation = uni.getStorageSync('basedata')
? (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation?uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation:0)
:0;
if(IsEducation==1){
uni.navigateTo({ url: '/pages/school/courseList?CategoryIds='+CategoryIds });
}else{
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+CategoryIds });
}
},
},
};
import sidebar from "../sidebar/index";
export default {
props: ["d", "h"],
data() {
return {
mainColor: "",
activeStyle: "",
page: 1,
page_count: 1,
mh: 0,
tid: 0,
active: 0,
sd: [],
};
},
components: {
sidebar,
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.activeStyle = `background:${this.mainColor};`;
this.sd = this.d[this.tid].ChildList;
},
methods: {
changeHandler(i) {
this.tid = i;
this.page = 1;
this.sd = this.d[this.tid].ChildList;
},
clickHandler(item) {
let Id1 = this.d[this.tid].Id;
let Id2 = item.Id;
let CategoryIds = Id2;
let IsEducation = uni.getStorageSync('basedata') ?
(uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation ? uni.getStorageSync('basedata').mall.setting.mallStyle
.IsEducation : 0) :
0;
if (IsEducation == 1) {
uni.navigateTo({
url: '/pages/school/courseList?CategoryIds=' + CategoryIds
});
} else {
uni.navigateTo({
url: '/pages/goods/list?CategoryIds=' + CategoryIds
});
}
},
},
};
</script>
<style>
.catstyle6 .imgclass{
display: block;
width: 80rpx; height: 80rpx;
}
.catstyle6 {
display: flex;
}
.catstyle6 .grid-text {
font-size: 24rpx;
margin-top: 4rpx;
color: "#330330";
}
.catstyle6 .left-slider {
width: 85px;
height: 100%;
background: #f5f5f5;
}
.catstyle6 .right-slider {
padding: 10px;
height: 100%;
width: 1px;
flex: 1;
}
.catstyle6 .right-slider .adbox {
width: 100%;
height: calc(100vw - 105px / 3.37);
margin-bottom: 10px;
}
.catstyle6 .imgclass {
display: block;
width: 80rpx;
height: 80rpx;
}
.catstyle6 {
display: flex;
}
.catstyle6 .grid-text {
font-size: 24rpx;
margin-top: 4rpx;
color: "#330330";
}
.catstyle6 .left-slider {
width: 85px;
height: 100%;
background: #f5f5f5;
}
.catstyle6 .right-slider {
padding: 10px;
height: 100%;
width: 1px;
flex: 1;
}
.catstyle6 .right-slider .adbox {
width: 100%;
height: calc(100vw - 105px / 3.37);
margin-bottom: 10px;
}
</style>
This diff is collapsed.
This diff is collapsed.
<template>
<view class="catstyle9" style="height: 100%;">
<view class="left-slider">
<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 class="catstyle9" style="height: 100%;">
<view class="left-slider">
<sidebar :active="tid" name="Name" :active-color="mainColor" :border="false" :list="d" @change="changeHandler"></sidebar>
</view>
<template v-if="x.ChildList && x.ChildList.length > 0">
<view
class="item"
v-for="(cx, ci) in x.ChildList"
:key="ci"
:data-url="cx.page_url"
>
<view class="left">{{ cx.Name }}</view>
<view class="right">
<image
v-if="cx.IconPath && cx.IconPath!=''"
mode="aspectFit"
:src="getIconLink(cx.IconPath)"
style="width: 100%; height: 100%;"
/>
</view>
</view>
</template>
<template v-else>
<view class="item">
<view class="left">无三级分类</view>
<view class="right"></view>
</view>
</template>
</view>
</view>
</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>
<template v-if="x.ChildList && x.ChildList.length > 0">
<view class="item" v-for="(cx, ci) in x.ChildList" :key="ci" :data-url="cx.page_url">
<view class="left">{{ cx.Name }}</view>
<view class="right">
<image v-if="cx.IconPath && cx.IconPath!=''" mode="aspectFit" :src="getIconLink(cx.IconPath)" style="width: 100%; height: 100%;" />
</view>
</view>
</template>
<template v-else>
<view class="item">
<view class="left">无三级分类</view>
<view class="right"></view>
</view>
</template>
</view>
</view>
</view>
</template>
<script>
import sidebar from "../sidebar/index";
export default {
props: ["d", "h"],
components: {
sidebar,
},
data() {
return {
mainColor: "",
page: 1,
page_count: 1,
mh: 0,
tid: 0,
active: 0,
sd: [],
};
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.sd = this.d[this.tid].ChildList;
},
methods: {
changeHandler(e) {
this.tid = e;
this.page = 1;
this.sd = this.d[this.tid].ChildList;
},
clickHandler(item) {
let Id1=this.d[this.tid].Id;
let Id2=item.Id;
// let CategoryIds=Id1+','+Id2;
let CategoryIds=Id2;
let IsEducation = uni.getStorageSync('basedata')
? (uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation?uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation:0)
:0;
if(IsEducation==1){
uni.navigateTo({ url: '/pages/school/courseList?CategoryIds='+CategoryIds });
}else{
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+CategoryIds });
}
},
},
};
import sidebar from "../sidebar/index";
export default {
props: ["d", "h"],
components: {
sidebar,
},
data() {
return {
mainColor: "",
page: 1,
page_count: 1,
mh: 0,
tid: 0,
active: 0,
sd: [],
};
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.sd = this.d[this.tid].ChildList;
},
methods: {
changeHandler(e) {
this.tid = e;
this.page = 1;
this.sd = this.d[this.tid].ChildList;
},
clickHandler(item) {
let Id1 = this.d[this.tid].Id;
let Id2 = item.Id;
let CategoryIds = Id2;
let IsEducation = uni.getStorageSync('basedata') ?
(uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation ? uni.getStorageSync('basedata').mall.setting.mallStyle
.IsEducation : 0) :
0;
if (IsEducation == 1) {
uni.navigateTo({
url: '/pages/school/courseList?CategoryIds=' + CategoryIds
});
} else {
uni.navigateTo({
url: '/pages/goods/list?CategoryIds=' + CategoryIds
});
}
},
},
};
</script>
<style>
.catstyle9 {
display: flex;
}
.catstyle9 .left-slider {
width: 85px;
height: 100%;
background: #f5f5f5;
}
.catstyle9 .right-slider {
padding: 10px;
height: 100%;
width: 1px;
flex: 1;
overflow: hidden;
overflow-y: auto;
}
.catstyle9 .right-slider .item {
height: 80px;
display: flex;
background: #f5f5f5;
margin-bottom: 10px;
}
.catstyle9 .right-slider .item .left {
padding: 15px;
font-size: 16px;
font-weight: 600;
color: #666;
flex: 1;
width: 1px;
}
.catstyle9 .right-slider .item .right {
margin-top: 16px;
width: 80px;
height: 64px;
text-align: right;
margin-right: 0px;
}
.catstyle9 .right-slider .item .right img {
width: 80px;
height: 64px;
}
.catstyle9 .right-slider .adbox {
width: 100%;
height: calc(100vw - 105px / 3.37);
margin-bottom: 10px;
}
.catstyle9 .sec-title {
font-size: 14px;
font-weight: 500;
margin: 10px 0;
}
.catstyle9 {
display: flex;
}
.catstyle9 .left-slider {
width: 85px;
height: 100%;
background: #f5f5f5;
}
.catstyle9 .right-slider {
padding: 10px;
height: 100%;
width: 1px;
flex: 1;
overflow: hidden;
overflow-y: auto;
}
.catstyle9 .right-slider .item {
height: 80px;
display: flex;
background: #f5f5f5;
margin-bottom: 10px;
}
.catstyle9 .right-slider .item .left {
padding: 15px;
font-size: 16px;
font-weight: 600;
color: #666;
flex: 1;
width: 1px;
}
.catstyle9 .right-slider .item .right {
margin-top: 16px;
width: 80px;
height: 64px;
text-align: right;
margin-right: 0px;
}
.catstyle9 .right-slider .item .right img {
width: 80px;
height: 64px;
}
.catstyle9 .right-slider .adbox {
width: 100%;
height: calc(100vw - 105px / 3.37);
margin-bottom: 10px;
}
.catstyle9 .sec-title {
font-size: 14px;
font-weight: 500;
margin: 10px 0;
}
</style>
This diff is collapsed.
<template>
<view
class="checkin"
:style="{
<view class="checkin" :style="{
'background-image': 'url(' + check.backgroundPicUrl + ')',
}"
>
<template v-if="check.showText">
<view style="width:100%" :style="{color:check.textColor,'text-align':check.textPosition}">
<view style="margin-bottom:10px;">今日签到可获得5积分</view>
<!-- todo 签到功能对接 -->
<view>已连续签到9天</view>
</view>
</template>
<view
class="hot-area"
v-if="check.hotspot"
@click="clickHandler"
:style="[formatStyle]"
></view>
</view>
}">
<template v-if="check.showText">
<view style="width:100%" :style="{color:check.textColor,'text-align':check.textPosition}">
<view style="margin-bottom:10px;">今日签到可获得5积分</view>
<!-- todo 签到功能对接 -->
<view>已连续签到9天</view>
</view>
</template>
<view class="hot-area" v-if="check.hotspot" @click="clickHandler" :style="[formatStyle]"></view>
</view>
</template>
<script>
export default {
props: ["check"],
data() {
return {
formatStyle: "",
};
},
created() {
if (this.check.hotspot) {
this.formatStyle = {
height: `${this.check.hotspot.height}rpx`,
width: `${this.check.hotspot.width}rpx`,
left:`${this.check.hotspot.left}rpx`,
top:`${this.check.hotspot.top}rpx;`
}
}
},
methods: {
clickHandler(e) {
if (
this.check.hotspot &&
this.check.hotspot.link &&
this.check.hotspot.link != ""
) {
uni.navigateTo({ url: this.check.hotspot.lin });
}
},
},
};
export default {
props: ["check"],
data() {
return {
formatStyle: "",
};
},
created() {
if (this.check.hotspot) {
this.formatStyle = {
height: `${this.check.hotspot.height}rpx`,
width: `${this.check.hotspot.width}rpx`,
left: `${this.check.hotspot.left}rpx`,
top: `${this.check.hotspot.top}rpx;`
}
}
},
methods: {
clickHandler(e) {
if (
this.check.hotspot &&
this.check.hotspot.link &&
this.check.hotspot.link != ""
) {
uni.navigateTo({
url: this.check.hotspot.lin
});
}
},
},
};
</script>
<style>
.checkin {
background-repeat: no-repeat;
height: 200rpx;
background-size: 100% 100%;
display: flex;
align-items: center;
position: relative;
padding: 0 20px;
}
.checkin text {
line-height: 25px;
}
.checkin .hot-area {
position: absolute;
z-index: 2;
}
.checkin {
background-repeat: no-repeat;
height: 200rpx;
background-size: 100% 100%;
display: flex;
align-items: center;
position: relative;
padding: 0 20px;
}
.checkin text {
line-height: 25px;
}
.checkin .hot-area {
position: absolute;
z-index: 2;
}
</style>
<template>
<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;" />
<text>{{cop.text}}</text>
</view>
<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;" />
<text>{{cop.text}}</text>
</view>
</template>
<script>
export default {
props: ["cop"],
methods: {
clickHandler() {
if (this.cop.url && this.cop.url != "") {
uni.navigateTo({ url: this.cop.url });
}
}
}
};
export default {
props: ["cop"],
methods: {
clickHandler() {
if (this.cop.url && this.cop.url != "") {
uni.navigateTo({
url: this.cop.url
});
}
}
}
};
</script>
<style>
.copyright {
text-align: center;
padding: 15px;
font-size: 13px;
}
</style>
\ No newline at end of file
.copyright {
text-align: center;
padding: 15px;
font-size: 13px;
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<template>
<view :style="{'background':block.background,'height':block.height+'px'}"></view>
<view :style="{'background':block.background,'height':block.height+'px'}"></view>
</template>
<script>
export default {
props:['block'],
data() {
return {
st:{}
}
},
created() {
this.st={'background':this.block.background,'height':this.block.height+'rpx'}
},
}
export default {
props: ['block'],
data() {
return {
st: {}
}
},
created() {
this.st = {
'background': this.block.background,
'height': this.block.height + 'rpx'
}
},
}
</script>
<style>
</style>
\ No newline at end of file
</style>
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