Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
zhangxiaoru
8 years ago
Commit
d783bb479fa55be9bee4caf0314929a14d627eea
1 parent
1bbea005
购物车修改
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
13 deletions
compile/m.yohobuy.com/5.3.11/.gitkeep
static/js/cart/chose-panel.js
template/m.yohobuy.com/partials/cart/chose-panel.phtml
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
yohobuy/m.yohobuy.com/public/index-dev.php
compile/m.yohobuy.com/5.3.11/.gitkeep
deleted
100644 → 0
View file @
1bbea00
static/js/cart/chose-panel.js
View file @
d783bb4
...
...
@@ -342,6 +342,30 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) {
return
false
;
});
function
chosedLength
()
{
var
$chosedL
=
$
(
'.block-list>ul>li.chosed'
),
infoHtml
;
$
(
'.choosed-info'
).
removeClass
(
'hide'
);
if
(
!
$
(
'.not-choose'
).
hasClass
(
'hide'
))
{
$
(
'.not-choose'
).
addClass
(
'hide'
);
}
if
(
$chosedL
.
length
===
2
)
{
$chosedL
.
each
(
function
(
val
)
{
infoHtml
=
'已选:'
+
$chosedL
.
eq
(
0
).
html
()
+
'、'
+
$chosedL
.
eq
(
1
).
html
();
})
}
else
if
(
$chosedL
.
length
===
1
)
{
infoHtml
=
'已选:'
+
$chosedL
.
eq
(
0
).
html
();
}
else
{
$
(
'.choosed-info'
).
addClass
(
'hide'
);
$
(
'.not-choose'
).
removeClass
(
'hide'
);
}
$
(
'.choosed-info'
).
html
(
infoHtml
);
}
$yohoPage
.
on
(
'touchstart'
,
'.color-list .block'
,
function
()
{
var
$this
=
$
(
this
),
index
=
$this
.
index
(),
...
...
@@ -422,6 +446,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
return
false
;
}
chosedLength
();
}).
on
(
'touchstart'
,
'.size-list .block'
,
function
()
{
var
$this
=
$
(
this
),
...
...
@@ -479,6 +504,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
$
(
'#good-num'
).
val
(
1
);
}
chosedLength
();
// 设置按钮的样式和文字
updateConformButtonClassAndText
();
});
...
...
template/m.yohobuy.com/partials/cart/chose-panel.phtml
View file @
d783bb4
{
{#cartInfo
}
}
<div
class=
"chose-panel"
>
<div
class=
"main"
>
<div
class=
"close"
>X</div>
<div
class=
"infos {{#if ../tickets}}tickets-info{{/if}}"
>
<div
class=
"basic-info"
>
{
{#thumbs
}
}
<img
class=
"thumb {{#unless @first}}hide{{/if}}"
src=
{
{img
}
}>
{
{/thumbs
}
}
<div
class=
"text-info"
>
<
p
class=
"name"
>
{
{name
}
}</p
>
<
!--
<p
class=
"name"
>
{
{name
}
}</p>
--
>
<p
class=
"price"
>
<span
class=
"sale-price{{^price}} no-price{{/price}}"
>
{
{salePrice
}
}</span>
{
{#if
price
}
}
<span
class=
"market-price"
>
{
{price
}
}</span>
{
{/if
}
}
</p>
<p
class=
"not-choose"
>请选择颜色、尺码</p>
<p
class=
"choosed-info hide"
></p>
<p
class=
"size-info hide"
></p>
</div>
</div>
<div
class=
"chose-items"
>
...
...
@@ -34,7 +38,7 @@
{
{#
sizes
}
}
<ul
class=
"size-row clearfix {{#unless @first}}hide{{/if}}"
>
{
{#
size
}
}
<li
class=
"block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}"
data-num=
"{{sizeNum}}"
data-id=
"{{id}}"
data-skuid=
"{{skuId}}"
>
<li
class=
"block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}"
data-num=
"{{sizeNum}}"
data-id=
"{{id}}"
data-skuid=
"{{skuId}}"
data-info=
"{{sizeInfo}}"
>
{
{name
}
}
</li>
{
{/
size
}
}
...
...
@@ -78,6 +82,6 @@
</div>
</div>
</div>
{
{/cartInfo
}
}
{
{/cartInfo
}
}
<input
id=
"promotionId"
type=
"hidden"
value=
"{{promotionId}}"
>
<input
id=
"single"
type=
"hidden"
value=
"{{single}}"
>
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
d783bb4
...
...
@@ -958,10 +958,11 @@ class CartModel
$oneSize['colorId']
=
$val['color_id']
;
$oneSize['name']
=
$sizeName
;
$oneSize['sizeNum']
= intval(
$one['storage_number']
);
$oneSize['sizeInfo']
=
$one['size_info']
;
$sizeList[$val['product_skc']][]
=
$oneSize
;
// 所有尺码列表,赋值用于前端展示默认尺码的时候 判断出没有库存则显示灰色
$allSizeList[$sizeName]
= empty(
$allSizeList[$sizeName]['storage']
) ? array('storage' =>
$one['storage_number']
, 'id' =>
$one['size_id']
) :
$allSizeList[$sizeName]
;
$allSizeList[$sizeName]
= empty(
$allSizeList[$sizeName]['storage']
) ? array('storage' =>
$one['storage_number']
, 'id' =>
$one['size_id']
, 'sizeInfo' =>
$one['size_info']
) :
$allSizeList[$sizeName]
;
$colorNum
+= intval(
$one['storage_number']
);
...
...
@@ -980,7 +981,7 @@ class CartModel
// 缩略图
$thumbImageList
[] = array(
'img' => Helpers::getImageUrl(
$val['color_image']
,
60, 60
)
'img' => Helpers::getImageUrl(
$val['color_image']
,
300, 417
)
);
// 商品库存总数
...
...
@@ -995,6 +996,7 @@ class CartModel
'name' =>
$sizeName
, // 尺码名称
'sizeNum' => empty(
$value['storage']
) ? false : true, // 是否有库存 (false:表示没有库存,true:表示有库存)
'id' =>
$value['id']
,
'sizeInfo' =>
$value['sizeInfo']
);
// 各个颜色的尺码, 每行显示一个尺码对应的颜色
...
...
yohobuy/m.yohobuy.com/public/index-dev.php
View file @
d783bb4
...
...
@@ -15,15 +15,15 @@ define('USE_INTER_FACE_SHUNT', false);//分流开关
#dev环境
//define('API_URL', 'http://dev-api.yohops.com:9999/');
//define('SERVICE_URL', 'http://dev-service.yohops.com:9999/');
//define('YOHOBUY_URL', 'http://www.yohobuy.com/');
//define('SERVICE_NOTIFY', 'http://dev-service.yohops.com:9999/');
define
(
'API_URL'
,
'http://api-test2.yohops.com:9999/'
);
define
(
'SERVICE_URL'
,
'http://service-test2.yohops.com:9999/'
);
define
(
'API_URL'
,
'http://dev-api.yohops.com:9999/'
);
define
(
'SERVICE_URL'
,
'http://dev-service.yohops.com:9999/'
);
define
(
'YOHOBUY_URL'
,
'http://www.yohobuy.com/'
);
define
(
'SERVICE_NOTIFY'
,
'http://service-test2.yohops.com:9999/'
);
define
(
'SERVICE_NOTIFY'
,
'http://dev-service.yohops.com:9999/'
);
// define('API_URL', 'http://api-test2.yohops.com:9999/');
// define('SERVICE_URL', 'http://service-test2.yohops.com:9999/');
// define('YOHOBUY_URL', 'http://www.yohobuy.com/');
// define('SERVICE_NOTIFY', 'http://service-test2.yohops.com:9999/');
$application
=
new
Application
(
APPLICATION_PATH
.
'/configs/application.developer.ini'
);
$application
->
bootstrap
()
->
run
();
...
...
Please
register
or
login
to post a comment