金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

103 lines
2.4 KiB

<template>
<view class="preview-box">
<view class="category_mask" :hidden="!show" @tap="clone"></view>
<view class="group-list" :hidden="!show">
<view class="group-box">
<view class="group-item" :data-id="item.goods_id" v-for="(item, index) in list" :key="index" @tap="jump">
<view class="group-item-content">
<view class="group-img-box">
<image mode="widthFix" :src="item.goods_img" alt></image>
</view>
<view class="goods-name">
{{item.goods_name}}
</view>
<view class="goods-money">
¥{{item.goods_sell_price}}
</view>
</view>
</view>
<view class="group-item" v-if="list.length % 2 != 0" @tap="go">
<view class="group-item-content">
<view class="more-box">
查看更多
</view>
</view>
</view>
</view>
<view class="close">
<image mode="widthFix" src=".../../../static/the-close.png" alt></image>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
components: {},
props: {
show: {
type: Boolean,
value: false
},
list: {
type: Array,
value: []
}
},
methods: {
clone() {
this.setData({
show: false
});
this.$emit('clone');
},
jump(e) {
var id = e.currentTarget.dataset.id;
wx.navigateTo({
url: `/pages/store/detail/detail?id=${id}`
});
this.$emit('clone');
},
go() {
wx.navigateTo({
url: "/pages/store/list/list"
});
this.$emit('clone');
},
setData: function (obj) {
let that = this;
let keys = [];
let val, data;
Object.keys(obj).forEach(function (key) {
keys = key.split('.');
val = obj[key];
data = that.$data;
keys.forEach(function (key2, index) {
if (index + 1 == keys.length) {
that.$set(data, key2, val);
} else {
if (!data[key2]) {
that.$set(data, key2, {});
}
}
data = data[key2];
});
});
}
},
computed: {},
watch: {}
};
</script>
<style rel="stylesheet/less" lang="less">
@import "preview";
</style>