|
|
<!DOCTYPE html>
|
|
|
<html lang="zh">
|
|
|
{include file="public/head"/}
|
|
|
<!--swiper引入-->
|
|
|
<link rel="stylesheet" href="__CDN__/assets/store/js/Swiper-3.4.2/css/swiper.min.css">
|
|
|
<script type="text/javascript" src="__CDN__/assets/store/js/Swiper-3.4.2/js/swiper.min.js"></script>
|
|
|
<!--分页插件引入-->
|
|
|
<script type="text/javascript" src="__CDN__/assets/store/js/pagination/js/pagination.min.js"></script>
|
|
|
<link rel="stylesheet" href="__CDN__/assets/store/js/pagination/css/pagination.css">
|
|
|
<style>
|
|
|
.content{
|
|
|
width: 100%;
|
|
|
font-size: 0;
|
|
|
background: rgba(249,249,249,1);
|
|
|
}
|
|
|
|
|
|
/*店铺信息部分样式*/
|
|
|
.content .shopInfoBox{
|
|
|
width: 100%;
|
|
|
height: 322px;
|
|
|
margin-bottom: 12px;
|
|
|
background: rgba(255,255,255,1);
|
|
|
}
|
|
|
.content .shopInfoBox .shopInfoMain{
|
|
|
width: 1200px;
|
|
|
height: 100%;
|
|
|
margin: 0 auto;
|
|
|
padding: 30px;
|
|
|
}
|
|
|
.content .shopInfoBox .shopInfoMain .imgBox{
|
|
|
display: inline-block;
|
|
|
width: 262px;
|
|
|
height: 262px;
|
|
|
}
|
|
|
.content .shopInfoBox .shopInfoMain .imgBox img{
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
.content .shopInfoBox .shopInfoMain .infoBox{
|
|
|
width: 878px;
|
|
|
height: 100%;
|
|
|
float: right;
|
|
|
padding-left: 20px;
|
|
|
}
|
|
|
.content .shopInfoBox .shopInfoMain .infoBox .shopTitle{
|
|
|
width: 100%;
|
|
|
height: 28px;
|
|
|
font-size: 20px;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
|
line-height: 28px;
|
|
|
color: rgba(6,18,30,1);
|
|
|
margin-bottom: 10px;
|
|
|
}
|
|
|
.content .shopInfoBox .shopInfoMain .infoBox .contactNumber{
|
|
|
width: 100%;
|
|
|
height: 22px;
|
|
|
font-size: 14px;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 400;
|
|
|
line-height: 20px;
|
|
|
color: rgba(61,68,77,1);
|
|
|
margin-bottom: 6px;
|
|
|
}
|
|
|
.content .shopInfoBox .shopInfoMain .infoBox .shopAddress{
|
|
|
width: 100%;
|
|
|
height: 22px;
|
|
|
font-size: 14px;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 400;
|
|
|
line-height: 20px;
|
|
|
color: rgba(61,68,77,1);
|
|
|
margin-bottom: 10px;
|
|
|
}
|
|
|
.content .shopInfoBox .shopInfoMain .infoBox .shopIntroduceBox{
|
|
|
width: 100%;
|
|
|
height: 108px;
|
|
|
margin-bottom: 6px;
|
|
|
}
|
|
|
.content .shopInfoBox .shopInfoMain .infoBox .shopIntroduceBox .title{
|
|
|
width: 100%;
|
|
|
height: 22px;
|
|
|
font-size: 16px;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
|
line-height: 22px;
|
|
|
color: rgba(61,68,77,1);
|
|
|
margin: 0 0 6px 0;
|
|
|
}
|
|
|
.content .shopInfoBox .shopInfoMain .infoBox .shopIntroduceBox .contentText{
|
|
|
width: 100%;
|
|
|
height: 80px;
|
|
|
font-size: 14px;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 400;
|
|
|
line-height: 16px;
|
|
|
color: rgba(61,68,77,1);
|
|
|
}
|
|
|
.content .shopInfoBox .shopInfoMain .infoBox .buttonBox{
|
|
|
width: 100%;
|
|
|
height: 51px;
|
|
|
}
|
|
|
.content .shopInfoBox .shopInfoMain .infoBox .buttonBox button{
|
|
|
width: 215px;
|
|
|
height: 51px;
|
|
|
background:rgba(244,244,244,1);
|
|
|
border-radius: 2px;
|
|
|
margin-right: 23px;
|
|
|
border: 0;
|
|
|
font-size: 18px;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
|
line-height: 25px;
|
|
|
color: rgba(91,94,99,1);
|
|
|
}
|
|
|
.content .shopInfoBox .shopInfoMain .infoBox .buttonBox .collected{
|
|
|
color: rgba(255,148,23,1);
|
|
|
}
|
|
|
|
|
|
/*店铺商城部分样式*/
|
|
|
.content .bestSellersBox{
|
|
|
width: 100%;
|
|
|
/*height: 1063px;*/
|
|
|
background: rgba(255,255,255,1);
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain{
|
|
|
width: 1200px;
|
|
|
margin: 0 auto;
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain .titleBox{
|
|
|
width: 1200px;
|
|
|
height: 62px;
|
|
|
line-height: 62px;
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain .titleBox span:first-child{
|
|
|
display: inline-block;
|
|
|
float: left;
|
|
|
width: 6px;
|
|
|
height: 20px;
|
|
|
margin-top: 21px;
|
|
|
background: rgba(0,159,142,1);
|
|
|
border-radius: 2px;
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain .titleBox span:nth-child(2){
|
|
|
height: 22px;
|
|
|
line-height: 22px;
|
|
|
float: left;
|
|
|
margin-top: 20px;
|
|
|
padding-left: 12px;
|
|
|
font-size: 16px;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
|
color: rgba(0,159,142,1);
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain .bestSellersList{
|
|
|
width: 100%;
|
|
|
padding: 0 19px 0 29px;
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain .bestSellersList .commodityBox{
|
|
|
position: relative;
|
|
|
display: inline-block;
|
|
|
width: 182px;
|
|
|
height: 301px;
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain .bestSellersList .commodityBox a .insurance_icon{
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
right: 0;
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain .bestSellersList .commodityBox .imgBox{
|
|
|
position: relative;
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain .bestSellersList .commodityBox .imgBox img{
|
|
|
width: 182px;
|
|
|
height: 182px;
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain .bestSellersList .commodityBox .imgBox span{
|
|
|
display: block;
|
|
|
position: absolute;
|
|
|
top: 152px;
|
|
|
width: 100%;
|
|
|
height: 30px;
|
|
|
padding: 0 12px;
|
|
|
background: rgba(0,0,0,0.5);
|
|
|
border-radius: 0 0 4px 4px;
|
|
|
font-size: 14px;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
|
line-height: 30px;
|
|
|
color: rgba(0,159,142,1);
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain .bestSellersList .commodityBox .commodityPrice{
|
|
|
width: 100%;
|
|
|
height: 33px;
|
|
|
line-height: 40px;
|
|
|
margin: 0;
|
|
|
font-size: 14px;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 600;
|
|
|
color: rgba(255,49,0,1);
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain .bestSellersList .commodityBox .commodityName{
|
|
|
width: 100%;
|
|
|
height: 42px;
|
|
|
line-height: 21px;
|
|
|
margin: 0 0 4px 0;
|
|
|
text-align: left;
|
|
|
font-size: 14px;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
|
color: rgba(6,18,30,1);
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain .bestSellersList .commodityBox .labelBox span{
|
|
|
display: inline-block;
|
|
|
width: 70px;
|
|
|
height: 21px;
|
|
|
margin-right: 6px;
|
|
|
background: rgba(244,244,244,1);
|
|
|
border-radius: 2px;
|
|
|
font-size: 12px;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 400;
|
|
|
line-height: 21px;
|
|
|
text-align: center;
|
|
|
color: rgba(0,0,0,1);
|
|
|
opacity: 0.85;
|
|
|
}
|
|
|
.content .bestSellersBox .bestSellersMain .pagingBox{
|
|
|
width: 100%;
|
|
|
height: 35px;
|
|
|
text-align: center;
|
|
|
font-size: 14px;
|
|
|
font-family: PingFangSC-Regular;
|
|
|
line-height: 22px;
|
|
|
color: rgba(0,0,0,1);
|
|
|
}
|
|
|
</style>
|
|
|
<style>
|
|
|
/*分页样式重写*/
|
|
|
.paginationMyOrder{
|
|
|
margin: 40px 120px;
|
|
|
}
|
|
|
#paginationGoodsCollect,#paginationStoreCollect{
|
|
|
padding: 20px 0 40px 240px;
|
|
|
}
|
|
|
.whj_jqueryPaginationCss-1 .whj_border{
|
|
|
font-size:14px;
|
|
|
font-family:PingFangSC-Regular;
|
|
|
color:rgba(0,0,0,0.65);
|
|
|
/*opacity:0.65;*/
|
|
|
border:1px solid rgba(0,0,0,0.15);
|
|
|
}
|
|
|
.whj_jqueryPaginationCss-1 .whj_padding{
|
|
|
margin: 0 4px;
|
|
|
width:32px;
|
|
|
height:32px;
|
|
|
line-height: 32px;
|
|
|
text-align: center;
|
|
|
border-radius:4px;
|
|
|
padding: 0;
|
|
|
}
|
|
|
|
|
|
.whj_jqueryPaginationCss-1 .whj_checked{
|
|
|
color: #fff;
|
|
|
border: 0;
|
|
|
background:rgba(0,159,142,1);
|
|
|
box-shadow:0px 6px 12px rgba(0,0,0,0.04);
|
|
|
}
|
|
|
.whj_jqueryPaginationCss-1 .whj_padding:hover{
|
|
|
color: #fff;
|
|
|
border: 0;
|
|
|
background:rgba(0,159,142,1);
|
|
|
box-shadow:0px 6px 12px rgba(0,0,0,0.04);
|
|
|
}
|
|
|
.whj_jqueryPaginationCss-1 select:hover{
|
|
|
color: #fff;
|
|
|
}
|
|
|
.whj_jqueryPaginationCss-1 select{
|
|
|
height:32px;
|
|
|
line-height: 32px;
|
|
|
text-align: center;
|
|
|
border-radius:4px;
|
|
|
margin: 0 4px 0 12px;
|
|
|
width:88px;
|
|
|
color:rgba(0,0,0,0.65)!important;
|
|
|
padding: 0 10px;
|
|
|
/*background: url("../images/selectIcon.png") no-repeat no-repeat 60px 8px !important;*/
|
|
|
}
|
|
|
|
|
|
.whj_jqueryPaginationCss-1 .whj_color{
|
|
|
background: transparent!important;
|
|
|
font-size:14px;
|
|
|
font-family:PingFangSC-Regular;
|
|
|
color:rgba(0,0,0,0.65)!important;
|
|
|
}
|
|
|
.whj_jqueryPaginationCss-1 input{
|
|
|
margin: 0 4px;
|
|
|
width:48px;
|
|
|
height:32px;
|
|
|
border:1px solid rgba(0,0,0,0.15)!important;
|
|
|
border-radius:4px!important;
|
|
|
}
|
|
|
</style>
|
|
|
<body>
|
|
|
{include file="public/header"/}
|
|
|
|
|
|
<!--主要内容-->
|
|
|
<div class="content">
|
|
|
{include file="public/nav"}
|
|
|
<!--店铺信息部分-->
|
|
|
<div class="shopInfoBox">
|
|
|
<div class="shopInfoMain">
|
|
|
<div class="imgBox">
|
|
|
<img src="{$data.thumbnail}" alt="img">
|
|
|
</div>
|
|
|
<div class="infoBox">
|
|
|
<p class="shopTitle">{$data.name}</p>
|
|
|
<p class="contactNumber">联系电话:{$data.phone}</p>
|
|
|
<p class="shopAddress">店铺地址:{$data.address}</p>
|
|
|
<div class="shopIntroduceBox">
|
|
|
<p class="title">店铺简介:</p>
|
|
|
<p class="contentText"> {$data.content}</p>
|
|
|
</div>
|
|
|
<div class="buttonBox">
|
|
|
<button id="collectionBtn" class="btn collection {if condition='$data.is_collect eq 1'}collected{/if}" onclick="collection({$data.id})">
|
|
|
{if condition="$data['is_collect'] eq 2"}
|
|
|
<img src="__CDN__/assets/store/images/collection_dark.png" alt="user">
|
|
|
<span style="font-family: 黑体;vertical-align: middle;color: rgba(91,94,99,1);">收藏</span>
|
|
|
{else /}
|
|
|
<img src="__CDN__/assets/store/images/collection_light.png" alt="user">
|
|
|
<span style="font-family: 黑体;vertical-align: middle;color: #FF9417;">收藏</span>
|
|
|
{/if}
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<!--店铺商城部分-->
|
|
|
<div class="bestSellersBox">
|
|
|
<div class="bestSellersMain">
|
|
|
<div class="titleBox">
|
|
|
<span></span>
|
|
|
<span>店铺商城</span>
|
|
|
</div>
|
|
|
<div class="bestSellersList goods_dom">
|
|
|
|
|
|
</div>
|
|
|
<div class="pagingBox">
|
|
|
<div class="paginationMyOrder" id="paginationAllOrder">
|
|
|
<div class="whj_jqueryPaginationCss-1"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
{include file="public/footer"/}
|
|
|
{include file="public/js"/}
|
|
|
<script>
|
|
|
$(function () {
|
|
|
initLocation();
|
|
|
});
|
|
|
|
|
|
//定位当前位置
|
|
|
function initLocation(){
|
|
|
// 百度地图API功能
|
|
|
var map = new BMap.Map("allmap");
|
|
|
var point = new BMap.Point(116.331398,39.897445);
|
|
|
map.centerAndZoom(point,12);
|
|
|
var geolocation = new BMap.Geolocation();
|
|
|
geolocation.getCurrentPosition(function(r){
|
|
|
if(this.getStatus() == BMAP_STATUS_SUCCESS){
|
|
|
var mk = new BMap.Marker(r.point);
|
|
|
map.addOverlay(mk);
|
|
|
map.panTo(r.point);
|
|
|
//省份名称转换为id
|
|
|
$.ajax({
|
|
|
url:"{:url('index/sundry/get_province_id')}",
|
|
|
type:"POST",
|
|
|
data:{"province_name":r.address.province},
|
|
|
async:false,
|
|
|
success:function(res){
|
|
|
if(res.code == 1){
|
|
|
province_id = res.data.province_id;
|
|
|
lng = r.point.lng;
|
|
|
lat = r.point.lat;
|
|
|
//初始化产品热卖
|
|
|
initGoodsList();
|
|
|
}else{
|
|
|
toast(res.msg);
|
|
|
}
|
|
|
},
|
|
|
error:function(res){
|
|
|
toast('与服务器断开连接');
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
toast('failed'+this.getStatus());
|
|
|
}
|
|
|
},{enableHighAccuracy: true})
|
|
|
}
|
|
|
|
|
|
//初始化商品列表
|
|
|
function initGoodsList(page = 1, pageNum = 25){
|
|
|
$.ajax({
|
|
|
url:"{:url('index/goods/get_all')}",
|
|
|
type:"POST",
|
|
|
data:{"province_id":province_id,"page":page,"pageNum":pageNum,'paginate':1},
|
|
|
success:function(res){
|
|
|
console.log(res);
|
|
|
var goods_html = "";
|
|
|
$(res.data.data).each(function (key1, vo) {
|
|
|
var property = "";
|
|
|
$(vo.property).each(function (key2, p) {
|
|
|
property += "<span>"+p+"</span>";
|
|
|
});
|
|
|
var insurance = "";
|
|
|
if(vo.insurance == '1'){
|
|
|
insurance = "<img class=\"insurance_icon\" src=\"__CDN__/assets/store/images/insurance_icon.png\" alt=\"img\">";
|
|
|
}
|
|
|
var str = "<div class=\"commodityBox\">\n" +
|
|
|
" <a href=\"{:url('index/goods/detail',array('goods_id'=>'GOODS_ID'))}\">\n" +
|
|
|
" <div class=\"imgBox\">\n" +
|
|
|
" <img src=\""+vo.thumbnail+"\" alt=\"img\">\n" +
|
|
|
" <span>"+vo.store_name+"</span>\n" +
|
|
|
" </div>\n" +
|
|
|
" <p class=\"commodityPrice\">¥"+vo.price+"</p>\n" +
|
|
|
" <p class=\"commodityName\">"+vo.goodsname+"</p>\n" +
|
|
|
" <div class=\"labelBox\">\n" +
|
|
|
" "+property+"\n" +
|
|
|
" </div>\n" +
|
|
|
" "+insurance+"\n" +
|
|
|
" </a>\n" +
|
|
|
" </div>";
|
|
|
goods_html += str.replace("GOODS_ID",vo.id);
|
|
|
});
|
|
|
$('.goods_dom').html(goods_html);
|
|
|
//初始化分页
|
|
|
var totalPage = Math.ceil(res.data.total/pageNum);
|
|
|
initPaging(res.data.total,res.data.current_page,totalPage,pageNum);
|
|
|
},
|
|
|
error:function(res){
|
|
|
toast('与服务器断开连接');
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//初始化分页
|
|
|
function initPaging(totalSize = 0, current_page = 1, totalPage = 0, pageNum, showPageNum = 5) {
|
|
|
$("#paginationAllOrder").whjPaging({
|
|
|
//每页显示数据条数
|
|
|
pageNum: pageNum,
|
|
|
//当前页
|
|
|
current_page: current_page,
|
|
|
//可选,总条数
|
|
|
totalSize: totalSize,
|
|
|
//可选,总页数
|
|
|
totalPage: totalPage,
|
|
|
//可选,展示页码数量,默认5个页码数量
|
|
|
showPageNum: showPageNum,
|
|
|
//可选,css设置,可设置值:css-1,css-2,css-3,css-4,css-5,默认css-1,可自定义样式
|
|
|
css: 'css-1',
|
|
|
//可选,上一页按钮展示文本,默认显示文本为上一页
|
|
|
previousPage: "<span class=\"glyphicon glyphicon-menu-left\" aria-hidden=\"true\" style='opacity:0.65;font-size:12px;'></span>",
|
|
|
//可选,下一页按钮展示文本,默认显示文本为下一页
|
|
|
nextPage: "<span class=\"glyphicon glyphicon-menu-right\" aria-hidden=\"true\" style='opacity:0.65;font-size:12px;'></span>",
|
|
|
//可选,是否展示刷新,默认true
|
|
|
isShowRefresh: false,
|
|
|
//可选,是否展示首页与尾页,默认true
|
|
|
isShowFL: false,
|
|
|
//可选,是否展示共{}页,默认true
|
|
|
isShowTotalPage: false,
|
|
|
//可选,是否展示共{}条记录,默认true
|
|
|
isShowTotalSize: false,
|
|
|
//可选,是否需要重新设置当前页码、总页数及总条数,默认false,如果设为true,那么在请求服务器返回数据时,需要调用setPage方法
|
|
|
isResetPage: false,
|
|
|
//可选,跳至展示文本,默认显示文本为跳至
|
|
|
skip: "跳至",
|
|
|
//可选,确认按钮展示文本,默认显示文本为确认
|
|
|
confirm: "确认",
|
|
|
//必选,回掉函数,返回参数:第一个参数为页码,第二个参数为每页显示N条
|
|
|
callBack: function (currPage, pageSize) {
|
|
|
console.log('currPage:' + currPage + ' pageSize:' + pageSize);
|
|
|
initGoodsList(currPage, pageSize)
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/*//收藏、取消收藏
|
|
|
function collection() {
|
|
|
var userName = getCookie('user_name');
|
|
|
if(userName == null || userName == ''){
|
|
|
window.location.href = 'login.html?page=shopDetail';
|
|
|
}else{
|
|
|
if($('#collectionBtn').hasClass('collected')){
|
|
|
$('#collectionBtn img').attr('src','images/collection_dark.png');
|
|
|
$('#collectionBtn').removeClass('collected');
|
|
|
}else{
|
|
|
$('#collectionBtn img').attr('src','images/collection_light.png');
|
|
|
$('#collectionBtn').addClass('collected');
|
|
|
}
|
|
|
}
|
|
|
}*/
|
|
|
//收藏、取消收藏
|
|
|
function collection(store_id) {
|
|
|
$.ajax({
|
|
|
url:"{:url('index/shop/collect')}",
|
|
|
type:"POST",
|
|
|
data:{"store_id":store_id},
|
|
|
success:function(res){
|
|
|
if(res.code == 1){
|
|
|
if($('#collectionBtn').hasClass('collected')){
|
|
|
$('#collectionBtn img').attr('src','__CDN__/assets/store/images/collection_dark.png');
|
|
|
$('#collectionBtn span').css('color','rgba(91,94,99,1)');
|
|
|
$('#collectionBtn').removeClass('collected');
|
|
|
}else{
|
|
|
$('#collectionBtn img').attr('src','__CDN__/assets/store/images/collection_light.png');
|
|
|
$('#collectionBtn span').css('color','#FF9417');
|
|
|
$('#collectionBtn').addClass('collected');
|
|
|
}
|
|
|
toast('操作成功');
|
|
|
}else{
|
|
|
toast(res.msg);
|
|
|
}
|
|
|
},
|
|
|
error:function(res){
|
|
|
toast("与服务器断开连接");
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|
|
|
</html> |
|
|
\ No newline at end of file |
...
|
...
|
|