首页完善
This commit is contained in:
@@ -73,7 +73,7 @@
|
||||
},
|
||||
watch: {
|
||||
timersetnteritem(newVal, oldVal) {
|
||||
console.log(newVal, oldVal)
|
||||
// console.log(newVal, oldVal)
|
||||
if (newVal == 1) {
|
||||
clearTimeout(this.timersetInterval);
|
||||
this.timersetInterval = null;
|
||||
@@ -99,7 +99,7 @@
|
||||
endMove(e) {
|
||||
// this.itemStyless = []
|
||||
var newList = JSON.parse(JSON.stringify(this.itemStyle))
|
||||
console.log(newList)
|
||||
// console.log(newList)
|
||||
// if ((e.changedTouches[0].pageX - this.slideNote.x) < 0) {
|
||||
// 向左滑动
|
||||
var last = [newList.pop()]
|
||||
|
||||
116
pages/index/components/category.vue
Normal file
116
pages/index/components/category.vue
Normal file
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<view class="fourcontent flex-between">
|
||||
<view class="fourcontent_item flex-start" v-for="(item,index) in menu" :key="index"
|
||||
@click="viewHistorycategoryss(item,index)"
|
||||
:class="!item.isChild && viewHistoryindex == index ? 'fourcontent_itemactev':''">
|
||||
<text>{{item.name}}</text>
|
||||
<u-icon v-if="item.isChild" style="margin-left: 8rpx;" name="arrow-down-fill" color="#333333"
|
||||
size="16"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
props: {
|
||||
menu: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '每日特价'
|
||||
},
|
||||
viewHistoryindex: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
viewHistorycategoryss(item, index) {
|
||||
console.log(item, index)
|
||||
uni.$emit('viewHistory', {
|
||||
item:item,
|
||||
index:index
|
||||
});
|
||||
},
|
||||
clickdistrict(item) {
|
||||
switch (item.jumpType) {
|
||||
case 'absolute':
|
||||
uni.pro.navigateTo('webview/webview', {
|
||||
url: item.absUrl
|
||||
});
|
||||
break;
|
||||
case 'relative':
|
||||
uni.pro.navigateTo(item.absUrl, item);
|
||||
break;
|
||||
case 'scan':
|
||||
if (!uni.utils.pluschooseImage()) {
|
||||
return false
|
||||
}
|
||||
// #ifdef H5
|
||||
if (this.wxSdk) {
|
||||
wx.scanQRCode({
|
||||
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
||||
scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
|
||||
success: res => {
|
||||
// 当needResult 为 1 时,扫码返回的结果
|
||||
console.log(res.resultStr, res)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '注意',
|
||||
content: '微信sdk初始化失败,请重新加载',
|
||||
success: res => {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
// #ifdef APP || MP-WEIXIN
|
||||
uni.scanCode({
|
||||
success: res => {
|
||||
console.log(res.result, res)
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.fourcontent {
|
||||
padding: 32rpx 28rpx 32rpx 28rpx;
|
||||
overflow-x: auto;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
.fourcontent_item {
|
||||
flex-wrap: nowrap;
|
||||
margin-left: 22rpx;
|
||||
padding: 4rpx 14rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
|
||||
text {
|
||||
width: max-content;
|
||||
}
|
||||
}
|
||||
|
||||
.fourcontent_itemactev {
|
||||
background: #fee06a;
|
||||
}
|
||||
|
||||
.fourcontent_item:nth-child(1) {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -102,7 +102,9 @@
|
||||
},
|
||||
methods:{
|
||||
clickproduct(item){
|
||||
uni.pro.navigateTo('product/index',item)
|
||||
uni.pro.navigateTo('product/index',{
|
||||
id:item.id
|
||||
})
|
||||
},
|
||||
jrtoday(e){
|
||||
if(e == 0){
|
||||
|
||||
Reference in New Issue
Block a user