mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-04 21:09:43 +08:00
home
This commit is contained in:
parent
bd8e395564
commit
8cfd312a9d
@ -44,8 +44,8 @@ App({
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 请求地址
|
// 请求地址
|
||||||
//request_url: "http://demo.shopxo.net/",
|
request_url: "https://demo.shopxo.net/",
|
||||||
request_url: 'http://localhost/project/shopxo/service/',
|
//request_url: 'http://localhost/project/shopxo/service/',
|
||||||
|
|
||||||
// 基础信息
|
// 基础信息
|
||||||
application_title: "ShopXO电商系统",
|
application_title: "ShopXO电商系统",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<view a:if="{{data_list.length > 0}}">
|
<view a:if="{{data_list.length > 0}}">
|
||||||
<view class="data-list">
|
<view class="data-list bg-white spacing-mb">
|
||||||
<view class="items" a:for="{{data_list}}">
|
<view class="items" a:for="{{data_list}}">
|
||||||
<view class="items-content" style="background-color:{{item.bg_color}}" data-value="{{item.event_value}}" data-type="{{item.event_type}}" onTap="nav_event">
|
<view class="items-content" style="background-color:{{item.bg_color}}" data-value="{{item.event_value}}" data-type="{{item.event_type}}" onTap="nav_event">
|
||||||
<image class="wh-auto" src="{{item.images_url}}" mode="aspectFit" />
|
<image class="wh-auto" src="{{item.images_url}}" mode="aspectFit" />
|
||||||
|
@ -1,23 +1,16 @@
|
|||||||
.floor {
|
.floor-list, .floor-left {
|
||||||
|
|
||||||
}
|
|
||||||
.floor, .floor-list, .floor-left {
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.floor .nav-name {
|
|
||||||
font-size: 34rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
text-align: center;
|
|
||||||
padding: 10rpx 0;
|
|
||||||
}
|
|
||||||
.floor .vice-name {
|
.floor .vice-name {
|
||||||
top: 20rpx;
|
color: #fff;
|
||||||
left: 20rpx;
|
margin-top: 20rpx;
|
||||||
|
padding: 0 10rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
line-height: 48rpx;
|
||||||
}
|
}
|
||||||
.floor-left {
|
.floor-left {
|
||||||
width: 40%;
|
width: 40%;
|
||||||
float: left;
|
|
||||||
height: 660rpx;
|
height: 660rpx;
|
||||||
}
|
}
|
||||||
.floor-left image {
|
.floor-left image {
|
||||||
@ -27,32 +20,36 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.floor .vice-name,
|
|
||||||
.floor-left image,
|
.floor-left image,
|
||||||
.goods-list .goods:nth-child(1),
|
.goods-list .goods:nth-child(1),
|
||||||
.goods-list .goods:nth-child(2) {
|
.goods-list .goods:nth-child(2),
|
||||||
|
.goods-list .goods:nth-child(1) .goods-base,
|
||||||
|
.goods-list .goods:nth-child(2) .goods-base {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-list .goods {
|
.goods-list .goods {
|
||||||
height: 330rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.goods-list .goods image {
|
.goods-list .goods image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 330rpx;
|
||||||
}
|
}
|
||||||
.goods-list .goods:nth-child(1),
|
.goods-list .goods:nth-child(1),
|
||||||
.goods-list .goods:nth-child(2) {
|
.goods-list .goods:nth-child(2) {
|
||||||
width: 60%;
|
width: 60%;
|
||||||
|
height: 330rpx;
|
||||||
}
|
}
|
||||||
.goods-list .goods:nth-child(1) .goods-base,
|
.goods-list .goods:nth-child(1) .goods-base,
|
||||||
.goods-list .goods:nth-child(2) .goods-base {
|
.goods-list .goods:nth-child(2) .goods-base {
|
||||||
float: left;
|
padding-left: 10rpx;
|
||||||
|
width: calc(40% - 10rpx);
|
||||||
|
bottom: 20rpx;
|
||||||
}
|
}
|
||||||
.goods-list .goods:nth-child(1) image,
|
.goods-list .goods:nth-child(1) image,
|
||||||
.goods-list .goods:nth-child(2) image {
|
.goods-list .goods:nth-child(2) image {
|
||||||
width: 60%;
|
width: 60%;
|
||||||
|
height: 330rpx;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
.goods-list .goods:nth-child(1) {
|
.goods-list .goods:nth-child(1) {
|
||||||
@ -67,6 +64,17 @@
|
|||||||
.goods-list .goods:nth-child(4),
|
.goods-list .goods:nth-child(4),
|
||||||
.goods-list .goods:nth-child(5),
|
.goods-list .goods:nth-child(5),
|
||||||
.goods-list .goods:nth-child(6) {
|
.goods-list .goods:nth-child(6) {
|
||||||
margin-top: 330rpx;
|
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
height: 430rpx;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.goods-list .goods-base {
|
||||||
|
padding: 0 10rpx;
|
||||||
|
}
|
||||||
|
.goods-base .goods-title {
|
||||||
|
line-height: 52rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
.goods-base .sales-price {
|
||||||
|
font-size: 30rpx;
|
||||||
}
|
}
|
@ -5,11 +5,11 @@
|
|||||||
<component-home-nav />
|
<component-home-nav />
|
||||||
|
|
||||||
<!-- 楼层数据 -->
|
<!-- 楼层数据 -->
|
||||||
|
|
||||||
<block a:if="{{data_list.length > 0}}">
|
<block a:if="{{data_list.length > 0}}">
|
||||||
<view a:for="{{data_list}}" a:for-item="floor" class="floor">
|
<view a:for="{{data_list}}" a:for-item="floor" class="floor spacing-mb">
|
||||||
<view class="nav-name">
|
<view class="spacing-nav-title">
|
||||||
{{floor.name}}
|
<text class="line"></text>
|
||||||
|
<text class="text-wrapper">{{floor.name}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="floor-list" style="background-color:{{floor.bg_color}}">
|
<view class="floor-list" style="background-color:{{floor.bg_color}}">
|
||||||
<view class="floor-left">
|
<view class="floor-left">
|
||||||
@ -17,24 +17,27 @@
|
|||||||
<image src="{{floor.big_images}}" mode="aspectFit" />
|
<image src="{{floor.big_images}}" mode="aspectFit" />
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-list" a:if="{{floor.goods.length > 0}}">
|
<view class="goods-list" a:if="{{floor.goods.length > 0}}">
|
||||||
<view a:for="{{floor.goods}}" a:for-item="goods" class="goods">
|
<view a:for="{{floor.goods}}" a:for-item="goods" class="goods bg-white">
|
||||||
<image src="{{goods.home_recommended_images}}" mode="aspectFit" />
|
<navigator url="/pages/goods-detail/goods-detail?goods_id={{goods.id}}" hover-class="none">
|
||||||
<view class="goods-base">
|
<image src="{{goods.home_recommended_images}}" mode="aspectFit" />
|
||||||
<view class="goods-itle">{{goods.title}}</view>
|
<view class="goods-base">
|
||||||
</view>
|
<view class="goods-title single-text">{{goods.title}}</view>
|
||||||
|
<view class="sales-price">¥{{goods.price}}</view>
|
||||||
|
</view>
|
||||||
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
|
<!-- 留言 -->
|
||||||
<view a:if="{{load_status == 1}}" class="spacing-10">
|
<view a:if="{{load_status == 1}}" class="spacing-10">
|
||||||
<navigator url="/pages/answer-form/answer-form" hover-class="none" class="bg-white">
|
<navigator url="/pages/answer-form/answer-form" hover-class="none" class="bg-white">
|
||||||
<image class="wh-auto" mode="widthFix" src="/images/home-consulting-image.jpg" />
|
<image class="wh-auto" mode="widthFix" src="/images/home-consulting-image.jpg" />
|
||||||
</navigator>
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 结尾 -->
|
||||||
<import src="/pages/common/bottom_line.axml" />
|
<import src="/pages/common/bottom_line.axml" />
|
||||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||||
|
@ -44,7 +44,8 @@ class GoodsService
|
|||||||
*/
|
*/
|
||||||
public static function GoodsCategory($params = [])
|
public static function GoodsCategory($params = [])
|
||||||
{
|
{
|
||||||
$data = self::GoodsCategoryList(['pid'=>0]);
|
$where = empty($params['where']) ? ['pid'=>0] : $params['where'];
|
||||||
|
$data = self::GoodsCategoryList($where);
|
||||||
if(!empty($data))
|
if(!empty($data))
|
||||||
{
|
{
|
||||||
foreach($data as &$v)
|
foreach($data as &$v)
|
||||||
@ -69,13 +70,13 @@ class GoodsService
|
|||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @date 2018-08-29
|
* @date 2018-08-29
|
||||||
* @desc description
|
* @desc description
|
||||||
* @param [array] $params [输入参数]
|
* @param [array] $where [条件]
|
||||||
*/
|
*/
|
||||||
public static function GoodsCategoryList($params = [])
|
public static function GoodsCategoryList($where = [])
|
||||||
{
|
{
|
||||||
$pid = isset($params['pid']) ? intval($params['pid']) : 0;
|
$where['is_enable'] = 1;
|
||||||
$field = 'id,pid,icon,name,vice_name,describe,bg_color,big_images,sort,is_home_recommended';
|
$field = 'id,pid,icon,name,vice_name,describe,bg_color,big_images,sort,is_home_recommended';
|
||||||
$data = M('GoodsCategory')->field($field)->where(['is_enable'=>1, 'pid'=>$pid])->order('sort asc')->select();
|
$data = M('GoodsCategory')->field($field)->where($where)->order('sort asc')->select();
|
||||||
return self::GoodsCategoryDataDealWith($data);
|
return self::GoodsCategoryDataDealWith($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,13 +125,14 @@ class GoodsService
|
|||||||
public static function HomeFloorList($params = [])
|
public static function HomeFloorList($params = [])
|
||||||
{
|
{
|
||||||
// 商品大分类
|
// 商品大分类
|
||||||
$goods_category = self::GoodsCategory();
|
$params['where'] = ['pid'=>0, 'is_home_recommended'=>1];
|
||||||
|
$goods_category = self::GoodsCategory($params);
|
||||||
if(!empty($goods_category))
|
if(!empty($goods_category))
|
||||||
{
|
{
|
||||||
foreach($goods_category as &$v)
|
foreach($goods_category as &$v)
|
||||||
{
|
{
|
||||||
$category_ids = self::GoodsCategoryItemsIds(['category_id'=>$v['id']]);
|
$category_ids = self::GoodsCategoryItemsIds(['category_id'=>$v['id']]);
|
||||||
$v['goods'] = self::GoodsList(['where'=>['gci.category_id'=>['in', $category_ids], 'is_home_recommended'=>1], 'm'=>0, 'n'=>6, 'field'=>'g.title,g.title_color,g.images,g.home_recommended_images,g.original_price,g.price,g.inventory,g.buy_min_number,g.buy_max_number']);
|
$v['goods'] = self::GoodsList(['where'=>['gci.category_id'=>['in', $category_ids], 'is_home_recommended'=>1], 'm'=>0, 'n'=>6, 'field'=>'g.id,g.title,g.title_color,g.images,g.home_recommended_images,g.original_price,g.price,g.inventory,g.buy_min_number,g.buy_max_number']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $goods_category;
|
return $goods_category;
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user