Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eduline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
eduline
Commits
d06edf78
Commit
d06edf78
authored
May 19, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
ad488e7f
f3c708db
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1429 additions
and
573 deletions
+1429
-573
addons/theme/stv1/_static/img/address_icon.png
+0
-0
addons/theme/stv1/_static_w3g/css/common.css
+36
-0
apps/classroom/Tpl/default/Index/search_w3g.html
+0
-1
apps/classroom/Tpl/default/Index/theme_x7_w3g.html
+2
-0
apps/home/Tpl/default/Home/exams_w3g.html
+235
-239
apps/home/Tpl/default/Home/exams_w3g_old.html
+265
-0
apps/home/Tpl/default/User/index_w3g.html
+2
-0
apps/mall/Lib/Action/GoodsAction.class.php
+1
-1
apps/mall/Tpl/default/Goods/index_w3g.html
+92
-3
apps/mall/Tpl/default/Goods/pay_w3g.html
+125
-324
apps/mall/Tpl/default/Goods/pay_w3g_old.html
+383
-0
apps/mall/Tpl/default/Goods/view_w3g.html
+28
-5
apps/mall/Tpl/default/Goods/view_w3g_old.html
+260
-0
No files found.
addons/theme/stv1/_static/img/address_icon.png
0 → 100755
View file @
d06edf78
1.48 KB
addons/theme/stv1/_static_w3g/css/common.css
View file @
d06edf78
...
@@ -900,3 +900,38 @@ div::-webkit-scrollbar {
...
@@ -900,3 +900,38 @@ div::-webkit-scrollbar {
.goods_detail_top
{
.goods_detail_top
{
}
}
/* 真题 */
.zhenti_my_collect_list_container
{
position
:
relative
;
box-sizing
:
border-box
;
padding-top
:
2.25rem
;
}
.zhenti_tab
{
position
:
fixed
!important
;
top
:
2.75rem
;
width
:
100%
;
height
:
2.25rem
;
}
.zhenti_tab_normal
{
font-size
:
14px
;
font-weight
:
600
;
color
:
rgba
(
51
,
51
,
51
,
1
);
}
.zhenti_tab_selected
{
font-size
:
14px
;
font-weight
:
600
;
color
:
rgba
(
101
,
192
,
0
,
1
);
}
.zhenti_my_collect_cell
{
padding
:
0.75rem
;
margin-bottom
:
0.5rem
;
}
.zhenti_my_collect_cell_time
{
margin-top
:
0.75rem
;
}
\ No newline at end of file
apps/classroom/Tpl/default/Index/search_w3g.html
View file @
d06edf78
...
@@ -180,7 +180,6 @@
...
@@ -180,7 +180,6 @@
<div
@
click=
"onHotKeyword('{$vo.video_title|mStr=10}')"
class=
"search_flex_item layout_center"
>
<div
@
click=
"onHotKeyword('{$vo.video_title|mStr=10}')"
class=
"search_flex_item layout_center"
>
<span
class=
"text_14_400 color_999999"
>
{$vo.video_title|mStr=10}
</span>
<span
class=
"text_14_400 color_999999"
>
{$vo.video_title|mStr=10}
</span>
</div>
</div>
<!-- <li><a <eq name="vo.type" value="1">href="{:U('course/Video/view',array('id'=>$vo['id']))}"<else/>href="{:U('live/Index/view',array('id'=>$vo['id']))}"</eq>>{$vo.video_title|mStr=10}</a></li> -->
</volist>
</volist>
</div>
</div>
</div>
</div>
...
...
apps/classroom/Tpl/default/Index/theme_x7_w3g.html
View file @
d06edf78
...
@@ -139,7 +139,9 @@
...
@@ -139,7 +139,9 @@
<van-tabbar-item>
<van-tabbar-item>
<span
class=
"text_10_400"
>
真题题库
</span>
<span
class=
"text_10_400"
>
真题题库
</span>
<template
#
icon=
"props"
>
<template
#
icon=
"props"
>
<a
href=
"{:U('home/Home/exams')}"
>
<img
:src=
"props.active ? '__THEME__/img/zhenti.png' : '__THEME__/img/zhenti_s.png'"
/>
<img
:src=
"props.active ? '__THEME__/img/zhenti.png' : '__THEME__/img/zhenti_s.png'"
/>
</a>
</template>
</template>
</van-tabbar-item>
</van-tabbar-item>
<van-tabbar-item>
<van-tabbar-item>
...
...
apps/home/Tpl/default/Home/exams_w3g.html
View file @
d06edf78
<include
file=
"__THEME__/public_header_w3g"
/>
<include
file=
"__THEME__/public_header_w3g"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{$Think.APPS_URL}/exams/_static/css/public.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{$Think.APPS_URL}/exams/_static/icon/iconfont.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{$Think.APPS_URL}/exams/_static/css/public_header_footer_media.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{$Think.APPS_URL}/exams/_static/css/exam_2.0.css"
>
<div
class=
"cover"
></div>
<div
id=
"app"
>
<div
class=
"layout_v tab_container"
>
<van-tabs
:border=
"false"
v-model=
"tab"
sticky
@
change=
"onTopTab"
line-width=
"72px"
line-height=
"4px"
background=
"white"
color=
"#A3E460"
title-inactive-color=
"#333333"
title-active-color=
"#A3E460"
>
<div
class=
"min-height-wrap"
>
<van-tab>
<div
class=
"suren-box"
>
<span
slot=
"title"
v-bind:class=
"tab == 0 ? 'tab_text_selected' : 'tab_text_normal'"
>
<ul
class=
"suren-coas"
>
真题演练
<li
<
php
>
if(!$_GET['tab'] || $_GET['tab'] == 1){
</php>
class="on"
<php>
}
</php>
>
<a
href=
"{:U('home/Home/exams',['tab'=>1])}"
>
练习记录
</a></li>
<li
<
eq
name=
"Think.get.tab"
value=
"2"
>
class="on"
</eq>
>
<a
href=
"{:U('home/Home/exams',['tab'=>2])}"
>
考试记录
</a></li>
<li
<
eq
name=
"Think.get.tab"
value=
"3"
>
class="on"
</eq>
>
<a
href=
"{:U('home/Home/exams',['tab'=>3])}"
>
错题记录
</a></li>
<li
<
eq
name=
"Think.get.tab"
value=
"4"
>
class="on"
</eq>
>
<a
href=
"{:U('home/Home/exams',['tab'=>4])}"
>
题目收藏
</a></li>
<li
<
eq
name=
"Think.get.tab"
value=
"5"
>
class="on"
</eq>
>
<a
href=
"{:U('home/Home/exams',['tab'=>5])}"
>
高频练习
</a></li>
</ul>
<div
class=
"asmarfr-pr"
>
<switch
name=
"Think.get.tab"
>
<case
value=
"3"
>
<!--错题记录-->
<php>
if($list['data']){
</php>
<ul
class=
"suren-content"
>
<volist
name=
"list.data"
id=
"vo"
>
<li>
<a
href=
"#"
>
<span>
<h4>
{$vo.paper_info.exams_paper_title}
</h4>
<p>
{$vo['update_time']|friendlyDate}
</p>
</span>
</span>
<strong>
{$vo.wrong_count}道错题
</strong>
<van-sticky
:offset-top=
"44"
>
<a
href=
"{:U('exams/Index/wrongExamsroom',['joinType'=>1,'paper_id'=>$vo['exams_paper_id'],'temp'=>$vo['exams_users_id']])}"
class=
'btn exams'
>
错题再练
</a>
<div
class=
"layout_v"
>
<a
class=
'btn del deleteExeams'
data-temp_id=
"{$vo.exams_users_id}"
>
删除
</a>
<van-dropdown-menu
active-color=
"#333333"
>
</a>
<van-dropdown-item
title=
"筛选"
ref=
"item"
>
</li>
<div
class=
"drop_down_grid"
>
</volist>
<div
class=
"drop_down_option_selected"
>
全部
</div>
</ul>
<div
class=
"drop_down_option"
>
事业单位
</div>
<php>
}else{
</php>
<div
class=
"drop_down_option"
>
公考面试
</div>
<include
file=
"__THEME__/no_data_w3g"
/>
<div
class=
"drop_down_option"
>
教师
</div>
<php>
}
</php>
<div
class=
"drop_down_option"
>
财会
</div>
</case>
<div
class=
"drop_down_option"
>
银行
</div>
<case
value=
"4"
>
<div
class=
"drop_down_option"
>
法考
</div>
<!--题目收藏-->
<div
class=
"drop_down_option"
>
考研
</div>
<php>
if($list['data']){
</php>
</div>
<ul
class=
"suren-content collection"
>
</van-dropdown-item>
<volist
name=
"list.data"
id=
"vo"
>
</van-dropdown-menu>
<li>
<div
class=
"drop_down_selected_container"
>
<a
href=
"#"
>
<div
class=
"color_primary text_14_400 drop_down_selected_item"
>
公务员
</div>
<span>
</div>
<php>
if($vo['question_info']['content']){
</php>
</div>
<h4>
{:t($vo['question_info']['content'])}
</h4>
</van-sticky>
<php>
}else{
</php>
<div
class=
"layout_v list_container"
>
<h4
style=
"color: #F00;"
>
该试题已被删除
</h4>
<!-- 项目1 -->
<php>
}
</php>
<div
v-for=
"(item, index) in zhenti"
:key=
"index"
class=
"class_item layout_h"
>
<p>
{$vo['ctime']|friendlyDate}
</p>
<div
class=
"class_left layout_v weight_full"
>
</span>
<div
class=
"layout_h"
>
<php>
if($vo['question_info']['content']){
</php>
<div
v-if=
"item.price > 0"
class=
"mark_orange layout_center"
>
付费
</div>
<a
href=
"{:U('exams/Index/showQuestioninfo',['question_id'=>$vo['source_id']])}"
class=
"btn exams"
>
查看题目
</a>
<div
v-if=
"item.price == 0"
class=
"mark_green layout_center"
>
免费
</div>
<a
class=
'btn del deleteCollection'
data-question_id=
"{$vo.source_id}"
>
删除
</a>
<span
class=
"text_14_600 color_333333 weight_full van-multi-ellipsis--l2"
style=
"margin-left: 0.625rem;"
>
{{item.title}}
</span>
<php>
}else{
</php>
</div>
<a
class=
'btn del deleteCollection'
style=
"right: -95px;"
data-question_id=
"{$vo.source_id}"
>
删除
</a>
<div
class=
"layout_h"
style=
"margin-top: 1.25rem;"
>
<php>
}
</php>
<span
class=
"text_12_400 color_999999"
>
题数:{{item.count}}
</span>
<span
class=
"class_attr text_12_400 color_999999"
>
推荐用时:{{item.time}}m
</span>
<span
class=
"class_attr text_12_400 color_999999"
>
{{item.person}}
</span>
</div>
</div>
<div
class=
"class_right layout_center"
>
<div
v-if=
"item.price > 0"
class=
"button_orange layout_center"
>
¥{{item.price}}
</div>
<div
v-if=
"item.price == 0"
class=
"button_green layout_center"
>
开始做题
</div>
</div>
</div>
</div>
</van-tab>
</a>
<van-tab>
</li>
<span
slot=
"title"
v-bind:class=
"tab == 1 ? 'tab_text_selected' : 'tab_text_normal'"
>
</volist>
真题下载
</ul>
<php>
}else{
</php>
<include
file=
"__THEME__/no_data_w3g"
/>
<php>
}
</php>
</case>
<case
value=
"5"
>
<!--高频练习-->
<php>
if($list['data']){
</php>
<ul
class=
"suren-content"
>
<volist
name=
"list.data"
id=
"vo"
>
<li>
<a
href=
"#"
>
<span>
<h4>
{$vo.exams_paper_title}
</h4>
<p>
{$vo['update_time']|friendlyDate}
</p>
</span>
</span>
<strong>
0分
</strong>
<van-sticky
:offset-top=
"44"
>
<a
href=
"{:U('exams/Index/wrongExamsroom',['joinType'=>1,'paper_id'=>$vo['exams_paper_id'],'temp'=>$vo['exams_users_id'],'is_highwrong'=>1])}"
class=
'btn exams'
>
开始练习
</a>
<van-dropdown-menu
active-color=
"#333333"
>
<!-- <a class='btn del deleteExeams' data-temp_id="{$vo.exams_users_id}">删除</a> -->
<van-dropdown-item
title=
"筛选"
ref=
"item"
>
</a>
<div
class=
"drop_down_grid"
>
</li>
<div
class=
"drop_down_option_selected"
>
全部
</div>
</volist>
<div
class=
"drop_down_option"
>
事业单位
</div>
</ul>
<div
class=
"drop_down_option"
>
公考面试
</div>
<php>
}else{
</php>
<div
class=
"drop_down_option"
>
教师
</div>
<include
file=
"__THEME__/no_data_w3g"
/>
<div
class=
"drop_down_option"
>
财会
</div>
<php>
}
</php>
<div
class=
"drop_down_option"
>
银行
</div>
</case>
<div
class=
"drop_down_option"
>
法考
</div>
<default
/>
<div
class=
"drop_down_option"
>
考研
</div>
<!--练习记录 考试记录-->
</div>
<php>
if($list['data']){
</php>
</van-dropdown-item>
<ul
class=
"suren-content"
>
</van-dropdown-menu>
<volist
name=
"list.data"
id=
"vo"
>
</van-sticky>
<li>
<div
class=
"layout_v list_container"
>
<span>
<!-- 项目1 -->
<h4>
{$vo.paper_info.exams_paper_title}
<if
condition=
"$vo['course_title']"
><a
href=
"{:U('course/Video/view',array('id'=>$vo['vid']))}"
>
{$vo.course_title}
</a></if></h4>
<div
class=
"class_item layout_h"
>
<p>
{$vo['update_time']|friendlyDate}
</p>
<div
class=
"class_left layout_v weight_full"
>
<div
class=
"layout_h"
>
<div
class=
"mark_green layout_center"
>
免费
</div>
<span
class=
"text_14_600 color_333333 weight_full van-multi-ellipsis--l2"
style=
"margin-left: 0.625rem;"
>
2020年国家公务员《行测》试卷(省级)-名师版
</span>
</div>
<div
class=
"layout_h"
style=
"margin-top: 1.25rem;"
>
<span
class=
"text_12_400 color_999999"
>
题数:45
</span>
<span
class=
"class_attr text_12_400 color_999999"
>
推荐用时:45m
</span>
<span
class=
"class_attr text_12_400 color_999999"
>
45121已做
</span>
</div>
</div>
<div
class=
"class_right layout_center"
>
<div
class=
"button_green layout_center"
>
下载试题
</div>
</div>
</div>
<!-- 项目2 -->
<div
class=
"class_item layout_h"
>
<div
class=
"class_left layout_v weight_full"
>
<div
class=
"layout_h"
>
<div
class=
"mark_orange layout_center"
>
付费
</div>
<span
class=
"text_14_600 color_333333 weight_full van-multi-ellipsis--l2"
style=
"margin-left: 0.625rem;"
>
2020年国家公务员《行测》试卷(省级)-名师版
</span>
</div>
<div
class=
"layout_h"
style=
"margin-top: 1.25rem;"
>
<span
class=
"text_12_400 color_999999"
>
题数:45
</span>
<span
class=
"class_attr text_12_400 color_999999"
>
推荐用时:45m
</span>
<span
class=
"class_attr text_12_400 color_999999"
>
45121已做
</span>
</div>
</div>
<div
class=
"class_right layout_center"
>
<div
class=
"button_green layout_center"
>
下载试题
</div>
</div>
</div>
</div>
</van-tab>
<van-tab>
<span
slot=
"title"
v-bind:class=
"tab == 2 ? 'tab_text_selected' : 'tab_text_normal'"
>
我的题库
</span>
</span>
<php>
if($vo['progress'] == 100){
</php>
<div
class=
"layout_v zhenti_my_collect_list_container"
>
<strong>
{$vo.score|default="0"}分
</strong>
<div
class=
"layout_h zhenti_tab"
>
<a
href=
"{:U('exams/Index/examsresult',['joinType'=>$vo['exams_mode'],'paper_id'=>$vo['exams_paper_id'],'temp'=>$vo['exams_users_id']])}"
class=
'btn show'
>
查看结果
</a>
<div
@
click=
"onMyTab(0)"
class=
"layout_center weight_full"
:class=
"myTab == 0 ? 'zhenti_tab_selected' : 'zhenti_tab_normal'"
>
已做
</div>
<a
class=
'btn del deleteExeams'
data-temp_id=
"{$vo.exams_users_id}"
>
删除
</a>
<div
@
click=
"onMyTab(1)"
class=
"layout_center weight_full"
:class=
"myTab == 1 ? 'zhenti_tab_selected' : 'zhenti_tab_normal'"
>
收藏
</div>
<php>
}else{
</php>
</div>
<i
class=
"icon icon-weiwancheng"
></i>
<div
v-if=
"myTab == 1"
class=
"zhenti_my_collect_cell layout_v"
>
<a
href=
"{:U('exams/Index/examsroom',['joinType'=>$vo['exams_mode'],'paper_id'=>$vo['exams_paper_id'],'temp'=>$vo['exams_users_id']])}"
class=
'btn exams'
>
继续答题
</a>
<div
class=
"text_16_600 color_333333"
>
某种糖果的进价为12元/千克,现购进这种糖果若干千克,每天销售10千克,且从第二天起每天都比前一天降价2元/千克。已知以6元/千克的价格销售的那天正好卖完最后10千克,且总销售额是总进货成本的2倍。问总共进了多少千克这种糖果?
</div>
<a
class=
'btn del deleteExeams'
data-temp_id=
"{$vo.exams_users_id}"
>
删除
</a>
<div
class=
"text_12_400 color_999999 zhenti_my_collect_cell_time"
>
2020-04-04 03:12:56
</div>
<php>
}
</php>
</div>
</li>
<!-- 项目2 -->
</volist>
<div
v-if=
"myTab == 0"
class=
"class_item layout_h"
>
</ul>
<div
class=
"class_left layout_v weight_full"
>
<php>
}else{
</php>
<div
class=
"layout_h"
>
<include
file=
"__THEME__/no_data_w3g"
/>
<div
class=
"mark_orange layout_center"
>
付费
</div>
<php>
}
</php>
<span
class=
"text_14_600 color_333333 weight_full van-multi-ellipsis--l2"
style=
"margin-left: 0.625rem;"
>
2020年国家公务员《行测》试卷(省级)-名师版
</span>
</switch>
</div>
<div
class=
"layout_h"
style=
"margin-top: 1.25rem;"
>
<span
class=
"text_12_400 color_primary"
>
得分:80
</span>
<span
class=
"class_attr text_12_400 color_999999"
>
2020-04-04 03:12:56
</span>
</div>
</div>
</div>
<div
class=
"class_right layout_center"
>
<div
class=
"button_green layout_center"
>
查看详情
</div>
</div>
</div>
</div>
</div>
</van-tab>
</van-tabs>
</div>
<van-tabbar
v-model=
"active"
@
change=
"onChange"
:fixed=
"true"
:route=
"false"
:safe-area-inset-bottom=
"true"
active-color=
"#65C000"
inactive-color=
"#363636"
>
<van-tabbar-item>
<span
class=
"text_10_400"
>
名师课堂
</span>
<template
#
icon=
"props"
>
<a
href=
"{:U('classroom/Index/index')}"
>
<img
:src=
"props.active ? '__THEME__/img/minshi.png' : '__THEME__/img/minshi_s.png'"
/>
</a>
</template>
</van-tabbar-item>
<van-tabbar-item>
<span
class=
"text_10_400"
>
真题题库
</span>
<template
#
icon=
"props"
>
<a
href=
"{:U('home/Home/exams')}"
>
<img
:src=
"props.active ? '__THEME__/img/zhenti.png' : '__THEME__/img/zhenti_s.png'"
/>
</a>
</template>
</van-tabbar-item>
<van-tabbar-item>
<span
class=
"text_10_400"
>
考试咨询
</span>
<template
#
icon=
"props"
>
<a
href=
"{:U('classroom/Index/find')}"
>
<img
:src=
"props.active ? '__THEME__/img/zixun.png' : '__THEME__/img/zixun_s.png'"
/>
</a>
</template>
</van-tabbar-item>
<van-tabbar-item>
<span
class=
"text_10_400"
>
会员中心
</span>
<template
#
icon=
"props"
>
<if
condition=
"$_SESSION['mid']"
>
<a
href=
"{:U('home/User/index')}"
>
<else
/>
<a
href=
"{:U('basic/Passport/login')}"
>
</if>
<img
:src=
"props.active ? '__THEME__/img/huiyuan.png' : '__THEME__/img/huiyuan_s.png'"
/>
</a>
</template>
</van-tabbar-item>
</van-tabbar>
</div>
</div>
<include
file=
"__THEME__/public_footer_w3g"
/>
<script
src=
"{$Think.APPS_URL}/exams/_static/js/public_header_footer_media.js"
></script>
<script
src=
"{$Think.APPS_URL}/exams/_static/js/swipe.js"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
$
(
function
(){
new
Vue
({
$
(
'.suren-content li'
).
rhuiSwipe
(
'swipeLeft'
,
function
(
event
){
el
:
'#app'
,
var
left
=
0
;
data
:
function
()
{
$
(
this
).
find
(
".btn"
).
each
(
function
(){
return
{
left
+=
$
(
this
).
width
();
active
:
1
,
$
(
this
).
css
({
lineHeight
:
$
(
this
).
height
()
+
'px'
});
tab
:
0
,
});
myTab
:
0
,
$
(
this
).
animate
({
left
:
"-"
+
left
+
"px"
},
500
);
zhenti
:
[],
$
(
this
).
siblings
().
css
(
"left"
,
"0px"
);
download
:
[],
},
{
myYiZuo
:
[],
// 可选参数
myCollect
:
[]
isStopPropagation
:
false
,
isPreventDefault
:
false
,
triggerOnMove
:
true
});
$
(
'.suren-content li'
).
rhuiSwipe
(
'swipeRight'
,
function
(
event
){
$
(
this
).
animate
({
left
:
"0px"
},
500
);
$
(
this
).
siblings
().
animate
({
left
:
0
},
500
);
},
{
// 可选参数
isStopPropagation
:
false
,
isPreventDefault
:
false
,
triggerOnMove
:
true
});
$
(
'.suren-content li'
).
click
(
function
(){
if
(
$
(
this
).
css
(
"left"
)
==
'0px'
){
var
left
=
0
;
$
(
this
).
find
(
".btn"
).
each
(
function
(){
left
+=
$
(
this
).
width
();
$
(
this
).
css
({
lineHeight
:
$
(
this
).
height
()
+
'px'
});
});
$
(
this
).
animate
({
left
:
"-"
+
left
+
"px"
},
500
);
$
(
this
).
siblings
().
css
(
"left"
,
"0px"
);
}
else
{
$
(
this
).
animate
({
left
:
"0px"
},
500
);
$
(
this
).
siblings
().
animate
({
left
:
0
},
500
);
}
}
},
});
mounted
:
function
(){
$
(
"#preloader"
).
hide
();
this
.
onTopTab
(
0
)
// 删除考试记录
},
$
(
".deleteExeams"
).
live
(
'click'
,
function
(){
computed
:
{
var
temp_id
=
$
(
this
).
data
(
'temp_id'
);
currentItems
:
function
()
{
ui
.
confirm
(
'确认删除该记录吗?'
,
{
if
(
this
.
tab
==
0
)
{
yes
:
function
()
{
return
this
.
zhenti
$
.
post
(
'{:U("exams/Index/deleteExeams")}'
,{
temp_id
:
temp_id
},
function
(
res
){
}
else
if
(
this
.
tab
==
1
)
{
if
(
typeof
(
res
)
!=
"object"
){
return
this
.
download
try
{
}
else
{
var
res
=
JSON
.
parse
(
res
);
return
this
.
myTab
==
0
?
this
.
myYiZuo
:
this
.
myCollect
}
catch
(
e
){
ui
.
error
(
"请求出错,请稍后再试"
);
return
false
;
}
}
if
(
res
.
status
==
1
){
ui
.
success
(
res
.
data
.
info
);
window
.
location
.
reload
();
}
else
{
ui
.
error
(
res
.
message
);
return
false
;
}
}
});
}
}
});
},
});
methods
:
{
// 取消收藏
onChange
:
function
(
tab
)
{
$
(
".deleteCollection"
).
live
(
'click'
,
function
(){
var
question_id
=
$
(
this
).
data
(
'question_id'
);
ui
.
confirm
(
'确认删除该试题吗?'
,
{
},
yes
:
function
()
{
onTopTab
:
function
(
tab
)
{
// 后台
if
(
this
.
tab
==
0
)
{
$
.
post
(
U
(
'exams/Index/collect'
),{
action
:
0
,
source_id
:
question_id
},
function
(
res
){
this
.
loadZhenti
()
if
(
typeof
(
res
)
!=
'object'
){
}
else
if
(
this
.
tab
==
1
)
{
try
{
var
res
=
JSON
.
parse
(
res
);
}
catch
(
e
){
ui
.
error
(
"处理异常,请重新尝试"
);
return
false
;
}
}
if
(
res
.
status
==
1
){
}
else
{
ui
.
success
(
res
.
data
.
info
);
window
.
location
.
reload
();
return
true
;
}
else
{
ui
.
error
(
res
.
message
);
return
false
;
}
});
}
});
});
var
p
=
1
;
}
$
(
window
).
scroll
(
function
(){
},
var
scrollTop
=
$
(
this
).
scrollTop
();
onMyTab
:
function
(
tab
)
{
var
scrollHeight
=
$
(
document
).
height
();
this
.
myTab
=
tab
var
windowHeight
=
$
(
this
).
height
();
},
if
(
scrollTop
+
windowHeight
==
scrollHeight
){
//加载真题
if
(
!
p
||
p
>=
parseInt
(
"{$list['totalPages']}"
)){
loadZhenti
:
function
()
{
return
false
;
let
that
=
this
}
else
{
p
=
p
+
1
;
$
.
ajax
({
$
.
ajax
({
type
:
"GET"
,
type
:
"GET"
,
url
:
"{:U('home/Home/exams',['tab'=>$_GET['tab']])}
"
,
url
:
"{:U('exams/Index/paper')}"
+
"&api=1
"
,
data
:{
dataType
:
"json"
,
tab
:
'{$Think.get.tab}'
,
success
:
function
(
res
)
{
p
:
p
if
(
res
.
status
==
1
)
{
},
let
array
=
res
.
data
.
data
dataType
:
"json"
,
that
.
zhenti
=
[].
concat
(
array
.
map
(
r
=>
{
success
:
function
(
res
)
{
return
{
if
(
typeof
(
res
)
!=
'object'
){
id
:
r
.
exams_paper_id
,
try
{
title
:
r
.
exams_paper_title
,
var
res
=
JSON
.
parse
(
res
);
price
:
r
.
price
,
}
catch
(
e
){
count
:
r
.
questions_count
,
ui
.
error
(
"处理异常,请重新尝试"
);
time
:
r
.
reply_time
,
return
false
;
person
:
"0已做"
}
}
}))
}
}
if
(
res
.
status
==
1
){
$
(
".asmarfr-pr ul"
).
append
(
res
.
data
.
html
);
return
true
;
}
}
}
});
})
}
}
}
}
});
})
});
</script>
</script>
apps/home/Tpl/default/Home/exams_w3g_old.html
0 → 100644
View file @
d06edf78
<include
file=
"__THEME__/public_header_w3g"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{$Think.APPS_URL}/exams/_static/css/public.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{$Think.APPS_URL}/exams/_static/icon/iconfont.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{$Think.APPS_URL}/exams/_static/css/public_header_footer_media.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{$Think.APPS_URL}/exams/_static/css/exam_2.0.css"
>
<div
class=
"cover"
></div>
<div
class=
"min-height-wrap"
>
<div
class=
"suren-box"
>
<ul
class=
"suren-coas"
>
<li
<
php
>
if(!$_GET['tab'] || $_GET['tab'] == 1){
</php>
class="on"
<php>
}
</php>
>
<a
href=
"{:U('home/Home/exams',['tab'=>1])}"
>
练习记录
</a></li>
<li
<
eq
name=
"Think.get.tab"
value=
"2"
>
class="on"
</eq>
>
<a
href=
"{:U('home/Home/exams',['tab'=>2])}"
>
考试记录
</a></li>
<li
<
eq
name=
"Think.get.tab"
value=
"3"
>
class="on"
</eq>
>
<a
href=
"{:U('home/Home/exams',['tab'=>3])}"
>
错题记录
</a></li>
<li
<
eq
name=
"Think.get.tab"
value=
"4"
>
class="on"
</eq>
>
<a
href=
"{:U('home/Home/exams',['tab'=>4])}"
>
题目收藏
</a></li>
<li
<
eq
name=
"Think.get.tab"
value=
"5"
>
class="on"
</eq>
>
<a
href=
"{:U('home/Home/exams',['tab'=>5])}"
>
高频练习
</a></li>
</ul>
<div
class=
"asmarfr-pr"
>
<switch
name=
"Think.get.tab"
>
<case
value=
"3"
>
<!--错题记录-->
<php>
if($list['data']){
</php>
<ul
class=
"suren-content"
>
<volist
name=
"list.data"
id=
"vo"
>
<li>
<a
href=
"#"
>
<span>
<h4>
{$vo.paper_info.exams_paper_title}
</h4>
<p>
{$vo['update_time']|friendlyDate}
</p>
</span>
<strong>
{$vo.wrong_count}道错题
</strong>
<a
href=
"{:U('exams/Index/wrongExamsroom',['joinType'=>1,'paper_id'=>$vo['exams_paper_id'],'temp'=>$vo['exams_users_id']])}"
class=
'btn exams'
>
错题再练
</a>
<a
class=
'btn del deleteExeams'
data-temp_id=
"{$vo.exams_users_id}"
>
删除
</a>
</a>
</li>
</volist>
</ul>
<php>
}else{
</php>
<include
file=
"__THEME__/no_data_w3g"
/>
<php>
}
</php>
</case>
<case
value=
"4"
>
<!--题目收藏-->
<php>
if($list['data']){
</php>
<ul
class=
"suren-content collection"
>
<volist
name=
"list.data"
id=
"vo"
>
<li>
<a
href=
"#"
>
<span>
<php>
if($vo['question_info']['content']){
</php>
<h4>
{:t($vo['question_info']['content'])}
</h4>
<php>
}else{
</php>
<h4
style=
"color: #F00;"
>
该试题已被删除
</h4>
<php>
}
</php>
<p>
{$vo['ctime']|friendlyDate}
</p>
</span>
<php>
if($vo['question_info']['content']){
</php>
<a
href=
"{:U('exams/Index/showQuestioninfo',['question_id'=>$vo['source_id']])}"
class=
"btn exams"
>
查看题目
</a>
<a
class=
'btn del deleteCollection'
data-question_id=
"{$vo.source_id}"
>
删除
</a>
<php>
}else{
</php>
<a
class=
'btn del deleteCollection'
style=
"right: -95px;"
data-question_id=
"{$vo.source_id}"
>
删除
</a>
<php>
}
</php>
</a>
</li>
</volist>
</ul>
<php>
}else{
</php>
<include
file=
"__THEME__/no_data_w3g"
/>
<php>
}
</php>
</case>
<case
value=
"5"
>
<!--高频练习-->
<php>
if($list['data']){
</php>
<ul
class=
"suren-content"
>
<volist
name=
"list.data"
id=
"vo"
>
<li>
<a
href=
"#"
>
<span>
<h4>
{$vo.exams_paper_title}
</h4>
<p>
{$vo['update_time']|friendlyDate}
</p>
</span>
<strong>
0分
</strong>
<a
href=
"{:U('exams/Index/wrongExamsroom',['joinType'=>1,'paper_id'=>$vo['exams_paper_id'],'temp'=>$vo['exams_users_id'],'is_highwrong'=>1])}"
class=
'btn exams'
>
开始练习
</a>
<!-- <a class='btn del deleteExeams' data-temp_id="{$vo.exams_users_id}">删除</a> -->
</a>
</li>
</volist>
</ul>
<php>
}else{
</php>
<include
file=
"__THEME__/no_data_w3g"
/>
<php>
}
</php>
</case>
<default
/>
<!--练习记录 考试记录-->
<php>
if($list['data']){
</php>
<ul
class=
"suren-content"
>
<volist
name=
"list.data"
id=
"vo"
>
<li>
<span>
<h4>
{$vo.paper_info.exams_paper_title}
<if
condition=
"$vo['course_title']"
><a
href=
"{:U('course/Video/view',array('id'=>$vo['vid']))}"
>
{$vo.course_title}
</a></if></h4>
<p>
{$vo['update_time']|friendlyDate}
</p>
</span>
<php>
if($vo['progress'] == 100){
</php>
<strong>
{$vo.score|default="0"}分
</strong>
<a
href=
"{:U('exams/Index/examsresult',['joinType'=>$vo['exams_mode'],'paper_id'=>$vo['exams_paper_id'],'temp'=>$vo['exams_users_id']])}"
class=
'btn show'
>
查看结果
</a>
<a
class=
'btn del deleteExeams'
data-temp_id=
"{$vo.exams_users_id}"
>
删除
</a>
<php>
}else{
</php>
<i
class=
"icon icon-weiwancheng"
></i>
<a
href=
"{:U('exams/Index/examsroom',['joinType'=>$vo['exams_mode'],'paper_id'=>$vo['exams_paper_id'],'temp'=>$vo['exams_users_id']])}"
class=
'btn exams'
>
继续答题
</a>
<a
class=
'btn del deleteExeams'
data-temp_id=
"{$vo.exams_users_id}"
>
删除
</a>
<php>
}
</php>
</li>
</volist>
</ul>
<php>
}else{
</php>
<include
file=
"__THEME__/no_data_w3g"
/>
<php>
}
</php>
</switch>
</div>
</div>
</div>
<include
file=
"__THEME__/public_footer_w3g"
/>
<script
src=
"{$Think.APPS_URL}/exams/_static/js/public_header_footer_media.js"
></script>
<script
src=
"{$Think.APPS_URL}/exams/_static/js/swipe.js"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
>
$
(
function
(){
$
(
'.suren-content li'
).
rhuiSwipe
(
'swipeLeft'
,
function
(
event
){
var
left
=
0
;
$
(
this
).
find
(
".btn"
).
each
(
function
(){
left
+=
$
(
this
).
width
();
$
(
this
).
css
({
lineHeight
:
$
(
this
).
height
()
+
'px'
});
});
$
(
this
).
animate
({
left
:
"-"
+
left
+
"px"
},
500
);
$
(
this
).
siblings
().
css
(
"left"
,
"0px"
);
},
{
// 可选参数
isStopPropagation
:
false
,
isPreventDefault
:
false
,
triggerOnMove
:
true
});
$
(
'.suren-content li'
).
rhuiSwipe
(
'swipeRight'
,
function
(
event
){
$
(
this
).
animate
({
left
:
"0px"
},
500
);
$
(
this
).
siblings
().
animate
({
left
:
0
},
500
);
},
{
// 可选参数
isStopPropagation
:
false
,
isPreventDefault
:
false
,
triggerOnMove
:
true
});
$
(
'.suren-content li'
).
click
(
function
(){
if
(
$
(
this
).
css
(
"left"
)
==
'0px'
){
var
left
=
0
;
$
(
this
).
find
(
".btn"
).
each
(
function
(){
left
+=
$
(
this
).
width
();
$
(
this
).
css
({
lineHeight
:
$
(
this
).
height
()
+
'px'
});
});
$
(
this
).
animate
({
left
:
"-"
+
left
+
"px"
},
500
);
$
(
this
).
siblings
().
css
(
"left"
,
"0px"
);
}
else
{
$
(
this
).
animate
({
left
:
"0px"
},
500
);
$
(
this
).
siblings
().
animate
({
left
:
0
},
500
);
}
});
// 删除考试记录
$
(
".deleteExeams"
).
live
(
'click'
,
function
(){
var
temp_id
=
$
(
this
).
data
(
'temp_id'
);
ui
.
confirm
(
'确认删除该记录吗?'
,
{
yes
:
function
()
{
$
.
post
(
'{:U("exams/Index/deleteExeams")}'
,{
temp_id
:
temp_id
},
function
(
res
){
if
(
typeof
(
res
)
!=
"object"
){
try
{
var
res
=
JSON
.
parse
(
res
);
}
catch
(
e
){
ui
.
error
(
"请求出错,请稍后再试"
);
return
false
;
}
}
if
(
res
.
status
==
1
){
ui
.
success
(
res
.
data
.
info
);
window
.
location
.
reload
();
}
else
{
ui
.
error
(
res
.
message
);
return
false
;
}
});
}
});
});
// 取消收藏
$
(
".deleteCollection"
).
live
(
'click'
,
function
(){
var
question_id
=
$
(
this
).
data
(
'question_id'
);
ui
.
confirm
(
'确认删除该试题吗?'
,
{
yes
:
function
()
{
// 后台
$
.
post
(
U
(
'exams/Index/collect'
),{
action
:
0
,
source_id
:
question_id
},
function
(
res
){
if
(
typeof
(
res
)
!=
'object'
){
try
{
var
res
=
JSON
.
parse
(
res
);
}
catch
(
e
){
ui
.
error
(
"处理异常,请重新尝试"
);
return
false
;
}
}
if
(
res
.
status
==
1
){
ui
.
success
(
res
.
data
.
info
);
window
.
location
.
reload
();
return
true
;
}
else
{
ui
.
error
(
res
.
message
);
return
false
;
}
});
}
});
});
var
p
=
1
;
$
(
window
).
scroll
(
function
(){
var
scrollTop
=
$
(
this
).
scrollTop
();
var
scrollHeight
=
$
(
document
).
height
();
var
windowHeight
=
$
(
this
).
height
();
if
(
scrollTop
+
windowHeight
==
scrollHeight
){
if
(
!
p
||
p
>=
parseInt
(
"{$list['totalPages']}"
)){
return
false
;
}
else
{
p
=
p
+
1
;
$
.
ajax
({
type
:
"GET"
,
url
:
"{:U('home/Home/exams',['tab'=>$_GET['tab']])}"
,
data
:{
tab
:
'{$Think.get.tab}'
,
p
:
p
},
dataType
:
"json"
,
success
:
function
(
res
){
if
(
typeof
(
res
)
!=
'object'
){
try
{
var
res
=
JSON
.
parse
(
res
);
}
catch
(
e
){
ui
.
error
(
"处理异常,请重新尝试"
);
return
false
;
}
}
if
(
res
.
status
==
1
){
$
(
".asmarfr-pr ul"
).
append
(
res
.
data
.
html
);
return
true
;
}
}
});
}
}
});
});
</script>
\ No newline at end of file
apps/home/Tpl/default/User/index_w3g.html
View file @
d06edf78
...
@@ -103,7 +103,9 @@
...
@@ -103,7 +103,9 @@
<van-tabbar-item>
<van-tabbar-item>
<span
class=
"text_10_400"
>
真题题库
</span>
<span
class=
"text_10_400"
>
真题题库
</span>
<template
#
icon=
"props"
>
<template
#
icon=
"props"
>
<a
href=
"{:U('home/Home/exams')}"
>
<img
:src=
"props.active ? '__THEME__/img/zhenti.png' : '__THEME__/img/zhenti_s.png'"
/>
<img
:src=
"props.active ? '__THEME__/img/zhenti.png' : '__THEME__/img/zhenti_s.png'"
/>
</a>
</template>
</template>
</van-tabbar-item>
</van-tabbar-item>
<van-tabbar-item>
<van-tabbar-item>
...
...
apps/mall/Lib/Action/GoodsAction.class.php
View file @
d06edf78
...
@@ -423,7 +423,7 @@ class GoodsAction extends Action
...
@@ -423,7 +423,7 @@ class GoodsAction extends Action
$this
->
assign
(
'sple_score'
,
$sple_score
);
$this
->
assign
(
'sple_score'
,
$sple_score
);
$this
->
assign
(
'split_score_pro'
,
$split_score
[
'sple_score'
]);
$this
->
assign
(
'split_score_pro'
,
$split_score
[
'sple_score'
]);
$this
->
assign
(
$data
);
$this
->
assign
(
'data'
,
$data
);
$this
->
assign
(
'address'
,
$address
);
$this
->
assign
(
'address'
,
$address
);
$this
->
assign
(
'address_list'
,
$address_list
);
$this
->
assign
(
'address_list'
,
$address_list
);
$this
->
assign
(
'credit'
,
(
int
)
$credit
[
'score'
]);
$this
->
assign
(
'credit'
,
(
int
)
$credit
[
'score'
]);
...
...
apps/mall/Tpl/default/Goods/index_w3g.html
View file @
d06edf78
...
@@ -35,6 +35,45 @@
...
@@ -35,6 +35,45 @@
finished-text=
"没有更多了"
finished-text=
"没有更多了"
@
load=
"onLoad"
>
@
load=
"onLoad"
>
<template
v-if=
"tab == 0"
>
<div
@
click=
"onItem(item)"
v-for=
"(item, idx) in options[0].items"
:key=
"idx"
class=
"home_class_item layout_v"
>
<div
class=
"layout_h"
>
<van-image
style=
"margin-right: 0.75rem;"
height=
"72"
width=
"128"
fit=
"cover"
:src=
"item.cover"
>
</van-image>
<div
class=
"weight_full layout_v"
>
<span
class=
"text_14_600 color_333333 van-multi-ellipsis--l2"
>
{{item.title}}
</span>
<span
class=
"text_14_600 color_FF3B3B"
style=
"margin-top: 0.5rem;"
>
{{item.price}}
</span>
<span
class=
"text_12_400 color_999999"
>
{{item.count}}人正在学习
</span>
</div>
</div>
</div>
</template>
<template
v-if=
"tab == 1"
>
<div
v-for=
"(item, idx) in options[1].items"
:key=
"idx"
class=
"layout_v home_question_item"
>
<div
v-if=
"item.price == 0"
class=
"layout_h"
>
<div
class=
"home_item_mark_green layout_center"
>
免费
</div>
<span
class=
"text_14_600 color_333333 weight_full van-multi-ellipsis--l2"
style=
"margin-right: 1.5rem;margin-left: 0.625rem;"
>
{{item.title}}
</span>
<div
@
click=
"onItem(item)"
class=
"home_button_green layout_center"
>
开始做题
</div>
</div>
<div
v-else
class=
"layout_h"
>
<div
class=
"home_item_mark_orange layout_center"
>
付费
</div>
<span
class=
"text_14_600 color_333333 weight_full van-multi-ellipsis--l2"
style=
"margin-right: 1.5rem;margin-left: 0.625rem;"
>
{{item.title}}
</span>
<div
@
click=
"onItem(item)"
class=
"home_button_orange layout_center"
>
¥{{item.price}}
</div>
</div>
<div
class=
"layout_h_b"
style=
"margin-top: 0.5rem;"
>
<span
class=
"text_14_600 color_FF3B3B"
>
¥{{item.price}}
</span>
<van-image
src=
"__THEME__/img/down_load_icon.png"
width=
"13"
height=
"16"
></van-image>
</div>
<div
class=
"home_divider divider"
></div>
</div>
</template>
<template
v-if=
"tab == 2"
>
<template
v-if=
"tab == 2"
>
<div
@
click=
"onItem(item)"
v-for=
"(item, idx) in options[2].items"
:key=
"idx"
class=
"home_item_goods layout_h"
>
<div
@
click=
"onItem(item)"
v-for=
"(item, idx) in options[2].items"
:key=
"idx"
class=
"home_item_goods layout_h"
>
<van-image
<van-image
...
@@ -181,6 +220,11 @@
...
@@ -181,6 +220,11 @@
if
(
this
.
tab
==
2
)
{
if
(
this
.
tab
==
2
)
{
let
url
=
"{:U('mall/Goods/view')}"
let
url
=
"{:U('mall/Goods/view')}"
window
.
location
.
href
=
url
.
replace
(
/
\[
.*
?\]
/g
,
item
.
uid
)
window
.
location
.
href
=
url
.
replace
(
/
\[
.*
?\]
/g
,
item
.
uid
)
}
else
if
(
this
.
tab
==
0
)
{
let
url
=
"{:U('course/Video/view')}"
window
.
location
.
href
=
url
.
replace
(
/
\[
.*
?\]
/g
,
item
.
id
)
}
else
{
}
}
},
},
onTab
:
function
(
idx
)
{
onTab
:
function
(
idx
)
{
...
@@ -206,7 +250,6 @@
...
@@ -206,7 +250,6 @@
success
:
function
(
data
)
{
success
:
function
(
data
)
{
that
.
loading
=
false
that
.
loading
=
false
let
res
=
data
let
res
=
data
let
opt
=
that
.
options
[
2
]
opt
.
items
=
opt
.
items
.
concat
(
res
.
data
.
map
(
r
=>
{
return
{
opt
.
items
=
opt
.
items
.
concat
(
res
.
data
.
map
(
r
=>
{
return
{
uid
:
r
.
uid
,
uid
:
r
.
uid
,
title
:
r
.
title
,
title
:
r
.
title
,
...
@@ -219,11 +262,57 @@
...
@@ -219,11 +262,57 @@
}
}
})
})
}
else
if
(
that
.
tab
==
1
)
{
}
else
if
(
that
.
tab
==
1
)
{
$
.
ajax
({
type
:
"GET"
,
url
:
"{:U('exams/Index/paper')}"
+
"&api=1"
,
dataType
:
"json"
,
success
:
function
(
data
)
{
that
.
loading
=
false
let
res
=
data
let
opt
=
that
.
options
[
1
]
if
(
res
.
status
==
1
)
{
let
result
=
res
.
data
let
array
=
result
.
data
.
length
>
0
?
result
.
data
:
[]
opt
.
items
=
array
.
map
(
r
=>
{
return
{
id
:
r
.
exams_paper_id
,
title
:
r
.
exams_paper_title
,
price
:
r
.
price
}
})
opt
.
page
=
result
.
nowPage
opt
.
finished
=
result
.
nowPage
>=
result
.
totalPages
that
.
finished
=
result
.
nowPage
>=
result
.
totalPages
}
}
})
}
else
{
}
else
{
let
on
=
"{$marketConf['order_switch']}"
==
1
$
.
ajax
({
type
:
"GET"
,
url
:
"{:U('course/Video/index')}"
+
"?api=1"
,
dataType
:
"json"
,
success
:
function
(
data
)
{
that
.
loading
=
false
let
res
=
data
let
array
=
res
.
data
.
length
>
0
?
res
.
data
:
[]
opt
.
items
=
array
.
map
(
r
=>
{
let
pi
=
r
.
mz_price
return
{
id
:
r
.
id
,
title
:
r
.
video_title
,
cover
:
r
.
image_url
,
price
:
pi
.
price
==
0
?
'免费'
:
(
'¥'
+
pi
.
price
),
count
:
on
?
r
.
video_order_count_mark
:
r
.
video_order_count
}
})
opt
.
page
=
res
.
nowPage
opt
.
finished
=
res
.
nowPage
>=
res
.
totalPages
that
.
finished
=
res
.
nowPage
>=
res
.
totalPages
}
}
})
}
}
},
}
}
})
})
...
...
apps/mall/Tpl/default/Goods/pay_w3g.html
View file @
d06edf78
<include
file=
"__THEME__/public_header_w3g"
/>
<include
file=
"__THEME__/public_header_w3g"
/>
<link
href=
"__APP__/css/pay_video_3g.css"
rel=
"stylesheet"
>
<style>
<style>
#BOX
{
width
:
100%
;
background-color
:
white
;
display
:
none
;}
body
{
#BOX
>
div
:nth-child
(
1
)
{
width
:
100%
;
height
:
40px
;
text-align
:
center
;
line-height
:
40px
;
border-bottom
:
solid
2px
#d3d7db
;
font-size
:
16px
;}
padding
:
0
!important
;
#BOX
>
div
:nth-child
(
2
)
{
width
:
100%
;
border-bottom
:
solid
1px
#d3d7db
;}
.add
{
width
:
90%
;
margin
:
0
auto
;
line-height
:
40px
;
padding
:
0
5px
;
margin
:
5px
auto
;
background-color
:
#f8f8f8
;}
#BOX
.add
.add_name
{
float
:
left
;}
#BOX
.add
.add_phone
{
float
:
right
;}
#BOX
.add
.add_address
{
clear
:
both
;}
.df_administration
>
dd
>
a
{
display
:
none
;}
.df_administration
>
dd
>
div
>
p
>
a
{
margin-top
:
10px
;
text-align
:
right
;}
.xianzhilength
{
width
:
70%
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
display
:
inline-block
;}
.body
{
background-color
:
#f5f5f5
;
}
}
</style>
</style>
<div
class=
"body"
>
<div
id=
"app"
>
<div
class=
"wrap"
>
<div
class=
"layout_v"
>
<div
class=
"min-height-wrap"
>
<div
class=
"pay_course_info layout_h"
>
<div
class=
"class_order_tit"
>
确认订单
</div>
<van-image
:src=
"info.cover"
fit=
"cover"
width=
"120"
height=
"68"
></van-image>
<!--商品信息-->
<div
class=
"layout_v"
style=
"margin-left: 0.75rem;"
>
<dl
class=
"df_course-info"
>
<span
class=
"text_14_600 color_333333"
>
{{info.title}}
</span>
<dt><h3>
商品信息
</h3></dt>
<span
class=
"text_14_600 color_FF3B3B"
style=
"margin-top: 0.5rem;"
>
¥{{info.price}}
</span>
<dd>
<a
href=
"{:U('mall/Goods/view',['id'=>$goods_id])}"
>
<span>
<img
src=
"{:getCover($cover_id,120,120)}"
width=
"120"
height=
"70"
alt=
"{:mStr($title,10)}"
>
</span>
<h3>
{:mStr($title,20)}
</h3>
<div>
{:mStr($info,50)}
</div>
</a>
</dd>
</dl>
<!--支付方式-->
<dl
class=
"df_pay-style"
>
<dt><h3>
支付方式
</h3></dt>
<php>
if($is_wx){unset($payWay['支付宝支付']);}$firstPayWay = current($payWay);
</php>
<if
condition=
"in_array('alipay',$payConfig['pay']) and ($is_wx eq false)"
>
<dd
value=
"alipay"
class=
"paytype"
><a
class=
"icon icon-zhifubao1"
></a><span
class=
"name"
>
支付宝
</span><i
<
if
condition=
'($firstPayWay eq alipay)'
>
class="icon icon-xuanze"
</if>
>
</i></dd>
</if>
<if
condition=
"in_array('wxpay',$payConfig['pay'])"
>
<dd
value=
"wxpay"
class=
"paytype"
><a
class=
"icon icon-weixinzhifu1"
></a><span
class=
"name"
>
微信支付
</span><i
<
if
condition=
'$is_wx or $firstPayWay eq wxpay'
>
class="icon icon-xuanze"
</if>
style="border: 1px solid rgb(237, 237, 237);">
</i></dd>
</if>
<if
condition=
"in_array('credpay',$payConfig['pay'])"
>
<dd
value=
"credpay"
class=
"paytype"
><a
class=
"icon icon-iconfont"
></a><span
class=
"name"
>
积分支付
</span><span>
(剩余积分{$credit|default=0})
</span><i
<
if
condition=
'($firstPayWay eq credpay)'
>
class="icon icon-xuanze"
</if>
style="border: 1px solid rgb(237, 237, 237);">
</i></dd>
</if>
</dl>
<p
class=
"other"
>
注:人民币与积分的兑换比例为 {$split_score_pro}
</p>
<!-- 新增功能-收货管理 -->
<dl
class=
"df_administration"
>
<a
href=
"JavaScript:"
>
<dt><h3>
收货管理
</h3></dt>
<dd>
<div>
<p>
<if
condition=
"$address"
>
<span
class=
"name"
>
{$address.name}
</span>
<span
class=
"phone"
>
{$address.phone}
</span>
<span
class=
"address"
>
{$address.location}
</span>
<!-- 修改-->
<span
class=
"xianzhilength"
>
{$address.address}
</span>
<else/>
<a
class=
"xinzeng"
href=
"{:U('home/User/address',['param'=>$_GET['vst']])}"
>
新增地址
</a>
</if>
</p>
<if
condition=
"$address_list"
>
<i
class=
"icon icon-youjiantou"
></i>
</if>
</div>
</div>
</dd>
</a>
</dl>
<!--实付金额-->
<dl
class=
"df_pay-price"
>
<dd><h3>
实付金额
</h3><p
id=
"pay_money"
>
¥{$lastPrice/$sple_score}
</p></dt>
</dl>
<!--购买协议-->
<div
class=
"df_pay-protocol"
>
<p><i
class=
"icon icon-xuanze"
attr=
"1"
></i>
我已阅读并同意
<a
href=
"{:U('basic/Single/info',array('id'=>'buy'))}"
>
《{$site['site_keyword']}购买协议》
</a></p>
</div>
</div>
<div
class=
"layout_h_v pay_course_bottom"
>
<!--提交订单-->
<span
class=
"text_16_600 color_333333"
>
选择数量
</span>
<div
class=
"df_pay-buy"
>
<div
class=
"layout_h_v_c"
style=
"margin-top: 0.75rem;"
>
<h3>
合计:
<strong
id=
"pay_money2"
>
¥{$lastPrice/$sple_score}
</strong></h3>
<span
style=
"margin-right: 0.25rem;"
>
数量:
</span>
<a
href=
"javascript:;"
onclick=
"buyOperat(this,{$goods_id});"
type=
"submit"
>
提交
</a>
<van-icon
@
click=
"onMinus"
name=
"__THEME__/img/minus.png"
size=
"20"
></van-icon>
<span
class=
"text_16_600 color_primary"
style=
"margin-left: 0.5rem;margin-right: 0.5rem;"
>
{{count}}
</span>
<van-icon
@
click=
"onPlus"
name=
"__THEME__/img/plus.png"
size=
"20"
></van-icon>
</div>
</div>
<form
action=
"{:U('classroom/Pay/buyGoods')}"
method=
"POST"
id=
"buyfrom"
>
<if
condition=
"$is_wx and in_array('wxpay',$payConfig['pay'])"
>
<input
type=
"hidden"
value=
"wxpay"
name=
"pay"
/>
<else/>
<volist
name=
"payWay"
id=
"vo"
offset=
"0"
length=
"1"
>
<input
type=
"hidden"
value=
"{$vo}"
name=
"pay"
/>
</volist>
</if>
<input
type=
"hidden"
value=
"{$lastPrice}"
name=
"total"
/>
<input
type=
"hidden"
value=
"{$count}"
name=
"count"
/>
<input
type=
"hidden"
value=
"{$goods_id}"
name=
"goods_id"
/>
<input
type=
"hidden"
value=
"{$address.id}"
name=
"address_id"
/>
</form>
</div>
</div>
<div
@
click=
"onAddress"
class=
"layout_h"
style=
"padding: 0.75rem;min-height: 5.5rem;"
>
<van-icon
class=
"self_center"
name=
"__THEME__/img/address_icon.png"
size=
"28"
></van-icon>
<div
class=
"layout_v weight_full self_center"
style=
"margin-right: 0.625rem;margin-left: 0.75rem;"
>
<span
v-if=
"!hasAddress"
class=
"text_16_400 color_999999"
>
添加收货信息
</span>
<div
v-if=
"hasAddress"
class=
"layout_h"
>
<span
class=
"text_16_400 color_333333"
style=
"margin-right: 0.5rem;"
>
{{address.address}}
</span>
<span
class=
"text_14_400 color_999999"
>
{{address.phone}}
</span>
</div>
</div>
</div>
<div
v-if=
"hasAddress"
class=
"text_14_400 color_333333"
style=
"margin-top: 0.5rem;"
>
{{address.location + address.address}}
</div>
<!--选择收货地址弹框-->
<div
id=
"BOX"
>
<div>
选择收货地址
</div>
<div>
<foreach
name=
"address_list"
item=
"l"
>
<div
class=
"add"
data-id=
"{$l.id}"
>
<div
class=
"add_name"
>
{$l.name}
</div>
<div
class=
"add_phone"
>
{$l.phone}
</div>
<div
class=
"add_address"
>
<span
class=
"add_address1"
>
{$l.location}
</span>
<span
class=
"add_address2"
>
{$l.address}
</span>
</div>
</div>
<van-icon
class=
"self_center"
name=
"__THEME__/img/right_arrow.png"
size=
"12"
></van-icon>
</div>
</div>
</foreach>
<div
class=
"layout_v pay_course_bottom"
>
<span
class=
"text_16_600 color_333333"
style=
"margin-bottom: 0.75rem;"
>
选择支付方式
</span>
<div
class=
"layout_h_b"
>
<div
class=
"layout_h_v_c"
>
<van-image
height=
"28"
width=
"28"
fit=
"cover"
src=
"__THEME__/img/weichat_logo.png"
></van-image>
<span
class=
"text_14_400 color_333333"
style=
"margin-left: 0.75rem;"
>
微信
</span>
</div>
<van-icon
class=
"self_center"
name=
"__THEME__/img/picker_y@3x.png"
size=
"20"
></van-icon>
</div>
</div>
<div
style=
"margin: 1.5rem 0.75rem;"
class=
"layout_h_v_c"
>
<van-icon
@
click=
"agree = !agree"
size=
"22"
:name=
"agree ? '__THEME__/img/picker_y@3x.png' : '__THEME__/img/unpicker.png'"
style=
"margin-right: 0.5rem;"
></van-icon>
我已阅读并同意
<a
href=
"{:U('basic/Single/info',array('id'=>'buy'))}"
><span
class=
"color_primary"
>
《{$site['site_keyword']}购买协议》
</span></a>
</div>
</div>
</div>
<if
condition=
"$is_wx eq false"
>
<style>
#_ts_box_h5
{
width
:
290px
;
height
:
180px
;
text-align
:
center
;
color
:
#535353
;
border-radius
:
5px
;
position
:
fixed
;
background
:
#fff
;
-webkit-box-shadow
:
0
2px
5px
#dddddd
;
-moz-box-shadow
:
0
2px
5px
#dddddd
;
-khtml-box-shadow
:
0
2px
5px
#dddddd
;
-ms-box-shadow
:
0
0
15px
#888888
;
box-shadow
:
0
0
15px
#888888
;
z-index
:
997
;
left
:
5%
;
top
:
35%
;
margin
:
0
auto
;
background
:
#fff
;}
._hide_box_h5
{
z-index
:
996
;
filter
:
alpha
(
opacity
=
50
);
background
:
#666
;
opacity
:
0.5
;
-moz-opacity
:
0.5
;
left
:
0
;
top
:
0
;
height
:
99%
;
width
:
100%
;
position
:
fixed
;}
#_ts_box_h5
._box_hd
{
padding
:
20px
0px
;
color
:
black
;
font-size
:
16px
;
border-bottom
:
1px
solid
rgba
(
0
,
0
,
0
,
0.16
);}
#_layer-content
{
padding
:
15px
0px
;
color
:
rgba
(
255
,
35
,
0
,
0.69
);
font-size
:
16px
;
border-bottom
:
1px
solid
rgba
(
0
,
0
,
0
,
0.1
);}
._layer-wt
{
padding
:
15px
0px
;
color
:
#908d8d
;
font-size
:
16px
;}
</style>
<div
class=
"_hide_box_h5"
style=
"display: none;"
></div>
<div
id=
"_ts_box_h5"
style=
"display: none;"
>
<div
class=
"_box_hd"
>
请确认微信支付是否完成
</div>
<div
id=
"_layer-content"
>
已完成支付
</div>
<div
class=
"_layer-wt"
><a
href=
"{:U('classroom/Pay/buyGoods',['vst'=>$_GET['vst']])}"
>
支付遇到问题,联系客服
</a></div>
</div>
</div>
</if>
<div
class=
"layout_h_v_c fixed_bottom_bar"
>
<span
class=
"text_14_600 color_333333"
style=
"margin-right: 0.5rem;"
>
合计
</span>
<span
class=
"text_14_600 color_FF3B3B"
>
¥{{totalPrice}}
</span>
<span
class=
"text_12_400 color_999999"
>
{{discount}}
</span>
<div
class=
"weight_full layout_h_r"
>
<div
@
click=
"onBuy"
class=
"vip_buy_pay_button layout_center"
><span
class=
"text_14_400 color_white"
>
确认支付
</span></div>
</div>
</div>
</div>
<script>
<script>
new
Vue
({
$
(
function
(){
el
:
"#app"
,
$
(
".df_pay-style dd:last-child"
).
children
(
"i"
).
css
(
"border"
,
"1px solid #ededed"
);
data
:
function
()
{
$
(
".df_pay-style dd"
).
on
(
"click"
,
function
(){
return
{
var
val
=
$
(
this
).
attr
(
'value'
),
count
:
1
,
total
=
"{$lastPrice}"
,
agree
:
false
,
multiple
=
"{$sple_score}"
,
info
:
""
,
actual_pay
=
total
/
multiple
;
address
:
""
$
(
'input:hidden[name="pay"]'
).
val
(
val
);
//$('input:hidden[name="total"]').val(actual_pay);
if
(
val
==
'credpay'
){
$
(
"#pay_money,#pay_money2"
).
text
(
"¥"
+
actual_pay
+
" ("
+
total
+
"积分)"
);
}
else
{
$
(
"#pay_money,#pay_money2"
).
text
(
"¥"
+
actual_pay
);
}
}
$
(
this
).
children
(
"i"
).
attr
(
"class"
,
"icon icon-xuanze"
).
css
(
"border"
,
"1px solid transparent"
).
parent
().
siblings
().
children
(
"i"
).
removeAttr
(
"class"
,
"icon icon-xuanze"
).
css
(
"border"
,
"1px solid #ededed"
);
},
});
$
(
".df_pay-protocol i"
).
on
(
"click"
,
function
(){
var
proVal
=
$
(
this
).
attr
(
"attr"
);
if
(
proVal
==
1
){
$
(
this
).
attr
(
"attr"
,
"0"
).
css
(
"color"
,
"#656565"
);
}
else
{
$
(
this
).
attr
(
"attr"
,
"1"
).
css
(
"color"
,
"#57BC4C"
)
}
});
//修改地址操作
created
:
function
(){
$
(
".icon-youjiantou"
).
click
(
function
(){
let
d
=
{:
json_encode
(
$data
)};
var
param
=
"{$_GET['vst']}"
;
let
ad
=
{:
json_encode
(
$address
)};
location
.
href
=
"{:U('home/User/address')}"
+
'?'
+
'param'
+
'='
+
param
;
this
.
info
=
d
});
this
.
address
=
ad
})
console
.
log
(
d
)
console
.
log
(
ad
)
},
'<if condition="$is_wx eq false">'
computed
:
{
$
(
function
(){
hasAddress
:
function
()
{
var
wpay
=
"{$_GET['wpay']}"
;
return
this
.
address
!=
""
&&
this
.
address
!=
undefined
var
ppn
=
"{$_GET['ppn']}"
;
},
if
(
wpay
!=
''
){
totalPrice
:
function
()
{
$
(
'._hide_box_h5,#_ts_box_h5'
).
show
();
return
this
.
info
.
lastPrice
$
(
'#_layer-content'
).
click
(
function
(){
},
$
(
'._hide_box_h5,#_ts_box_h5'
).
hide
();
discount
:
function
()
{
s
=
setInterval
(
function
(){
return
"(运费:¥"
+
this
.
info
.
fare
+
")"
$
.
ajax
({
url
:
"{:U('classroom/Pay/getPayStatus')}"
,
data
:{
pay_pass_num
:
ppn
},
type
:
'post'
,
success
:
function
(
res
){
try
{
res
=
JSON
.
parse
(
res
);
if
(
res
.
status
==
1
){
clearInterval
(
s
);
ui
.
success
(
'购买成功'
);
setTimeout
(
function
(){
window
.
location
.
href
=
res
.
data
;
},
2000
);
}
}
catch
(
e
){
return
;
}
}
});
},
1800
);
});
}
}
});
},
'</if>'
methods
:
{
/**
onMinus
:
function
()
{
* 删除字符串str的首尾空格
if
(
this
.
count
-
1
>
1
)
{
* @name trim
this
.
count
+=
1
* @grammar UM.utils.trim(str) => String
*/
var
trim
=
function
(
str
)
{
return
str
.
replace
(
/
(
^
[
\t\n\r]
+
)
|
([
\t\n\r]
+$
)
/g
,
''
);
}
}
},
onPlus
:
function
()
{
this
.
count
+=
1
},
//购买操作
onBuy
:
function
()
{
var
buyOperat
=
function
(
sbt
,
gid
){
if
(
MID
<=
0
)
{
if
(
MID
<=
0
){
ui
.
confirm
(
'请先登录'
,
{
ui
.
confirm
(
'请先登录'
,
{
yes
:
function
()
{
yes
:
function
()
{
window
.
location
.
href
=
"{:U('basic/Passport/login')}"
;
window
.
location
.
href
=
"{:U('basic/Passport/login')}"
;
}
}
});
})
return
false
;
return
}
}
if
(
!
gid
){
let
that
=
this
ui
.
error
(
'参数错误'
);
if
(
!
that
.
hasAddress
)
{
return
false
;
ui
.
error
(
"请选择收货地址"
)
return
}
}
if
(
!
that
.
agree
)
{
var
address_id
=
$
(
'input:hidden[name="address_id"]'
).
val
();
ui
.
error
(
"购买必须同意《{$site['site_keyword']}购买协议》"
)
if
(
!
address_id
){
return
ui
.
error
(
"请选择收货地址"
);
return
false
;
}
}
if
(
$
(
'.df_pay-protocol i.icon-xuanze'
).
attr
(
'attr'
)
!=
'1'
){
ui
.
error
(
"购买必须同意《{$site['site_keyword']}购买协议》"
);
return
false
;
}
var
form
=
$
(
sbt
).
parents
(
'form'
);
var
pay
=
$
(
'input:hidden[name="pay"]'
).
val
();
if
(
pay
!=
'alipay'
&&
pay
!=
'wxpay'
&&
pay
!=
'credpay'
){
ui
.
error
(
'支付方式错误'
);
return
false
;
}
$
(
sbt
).
attr
(
'style'
,
'background:rgba(102, 102, 102, 0.65)'
).
removeAttr
(
'onclick'
);
if
(
pay
==
'wxpay'
){
var
s
=
0
;
$
.
ajax
({
$
.
ajax
({
url
:
"{:U('classroom/Pay/buyGoods')}"
,
url
:
"{:U('classroom/Pay/buyGoods')}"
,
data
:
$
(
'#buyfrom'
).
serialize
(),
data
:
{
goods_id
:
that
.
info
.
uid
,
total
:
that
.
totalPrice
,
count
:
that
.
count
,
address_id
:
that
.
address
.
id
,
pay
:
"wxpay"
},
async
:
false
,
async
:
false
,
type
:
'post'
,
type
:
'post'
,
success
:
function
(
data
){
success
:
function
(
res
)
{
if
(
typeof
data
!=
'object'
){
console
.
log
(
res
)
var
data
=
eval
(
'('
+
data
+
')'
);
if
(
res
.
status
==
1
)
{
}
else
{
ui
.
error
(
res
.
info
?
res
.
info
:
res
.
data
)
}
}
clearInterval
(
s
);
}
if
(
data
.
status
==
1
){
})
var
pay_pass_num
=
data
.
data
.
pay_pass_num
;
},
'<if condition="$is_wx">'
WeixinJSBridge
.
invoke
(
checkPayStatus
:
function
(
num
)
{
'getBrandWCPayRequest'
,
JSON
.
parse
(
data
.
data
.
html
),
let
that
=
this
function
(
res
){
if
(
res
.
err_msg
==
"get_brand_wcpay_request:ok"
){
s
=
setInterval
(
function
(){
$
.
ajax
({
$
.
ajax
({
url
:
"{:U('classroom/Pay/getPayStatus')}"
,
url
:
"{:U('classroom/Pay/getPayStatus')}"
,
data
:{
pay_pass_num
:
pay_pass_
num
},
data
:{
pay_pass_num
:
num
},
type
:
'post'
,
type
:
'post'
,
success
:
function
(
res
){
success
:
function
(
res
){
try
{
try
{
res
=
JSON
.
parse
(
res
);
res
=
JSON
.
parse
(
res
)
if
(
res
.
status
==
1
){
if
(
res
.
status
==
1
){
clearInterval
(
s
);
ui
.
success
(
'购买成功'
)
ui
.
success
(
'购买成功'
);
setTimeout
(
function
(){
setTimeout
(
function
(){
window
.
location
.
href
=
res
.
data
;
window
.
location
.
href
=
res
.
data
},
1500
);
},
1500
);
}
else
{
that
.
setTimeout
(()
=>
{
that
.
checkPayStatus
(
num
)
},
1000
)
}
}
}
catch
(
e
){
}
catch
(
e
){
return
;
return
}
}
}
}
});
})
},
1800
);
}
}
);
'<else/>'
var
a
=
document
.
createElement
(
'a'
);
a
.
href
=
data
.
data
.
html
;
a
.
click
();
return
false
;
'</if>'
}
else
{
ui
.
error
(
data
.
info
);
setTimeout
(
function
(){
window
.
location
.
href
=
window
.
location
.
href
;
},
1500
);
}
},
},
error
:
function
(){
return
false
}
});
onAddress
:
function
()
{
}
else
{
let
url
=
"{:U('home/User/address',['param'=>$_GET['vst']])}"
if
(
pay
==
'alipay'
){
window
.
location
.
href
=
url
$
(
"#buyfrom"
).
submit
();
}
else
{
var
url
=
"{:U('mall/Goods/doSaveGoods')}"
;
}
$
.
ajax
({
type
:
"POST"
,
url
:
url
,
data
:
$
(
'#buyfrom'
).
serialize
(),
dataType
:
"json"
,
success
:
function
(
res
){
var
res
=
getResponseData
(
res
);
if
(
res
.
status
==
1
){
ui
.
success
(
res
.
message
);
setTimeout
(
function
(){
window
.
location
.
href
=
"{:U('mall/Goods/view',['id'=>$goods_id])}"
;
},
'1500'
);
}
else
{
//显示提交按钮
setInterval
(
function
(){
$
(
sbt
).
attr
(
"onclick"
,
"buyOperat(this,'{$goods_id}')"
).
removeAttr
(
'style'
);
},
1000
);
ui
.
error
(
res
.
message
);
return
false
;
}
}
});
}
}
}
window
.
onload
=
function
(){
$
(
".add"
).
on
(
"click"
,
function
(){
var
id
=
$
(
this
).
data
(
'id'
);
$
(
"input[name='address_id']"
).
val
(
id
);
$
(
".df_administration .name"
).
html
(
$
(
this
).
children
(
'.add_name'
).
html
())
$
(
".df_administration .phone"
).
html
(
$
(
this
).
children
(
'.add_phone'
).
html
())
$
(
".df_administration .address"
).
html
(
$
(
this
).
children
().
children
(
'.add_address1'
).
html
())
$
(
".df_administration .xianzhilength"
).
html
(
$
(
this
).
children
().
children
(
'.add_address2'
).
html
())
})
$
(
".df_administration"
).
on
(
"click"
,
function
(){
if
(
$
(
".add"
).
length
>
0
){
$
(
".body"
).
css
(
"display"
,
"none"
)
$
(
"#BOX"
).
css
(
"display"
,
"block"
)
$
(
"#BOX"
).
on
(
"click"
,
".add"
,
function
(){
$
(
"#BOX"
).
css
(
"display"
,
"none"
)
$
(
".body"
).
css
(
"display"
,
"block"
)
})
$
(
"#BOX"
).
on
(
"click"
,
function
(){
$
(
"#BOX"
).
css
(
"display"
,
"none"
)
$
(
".body"
).
css
(
"display"
,
"block"
)
})
}
}
})
})
}
</script>
</script>
...
...
apps/mall/Tpl/default/Goods/pay_w3g_old.html
0 → 100644
View file @
d06edf78
<include
file=
"__THEME__/public_header_w3g"
/>
<link
href=
"__APP__/css/pay_video_3g.css"
rel=
"stylesheet"
>
<style>
#BOX
{
width
:
100%
;
background-color
:
white
;
display
:
none
;}
#BOX
>
div
:nth-child
(
1
)
{
width
:
100%
;
height
:
40px
;
text-align
:
center
;
line-height
:
40px
;
border-bottom
:
solid
2px
#d3d7db
;
font-size
:
16px
;}
#BOX
>
div
:nth-child
(
2
)
{
width
:
100%
;
border-bottom
:
solid
1px
#d3d7db
;}
.add
{
width
:
90%
;
margin
:
0
auto
;
line-height
:
40px
;
padding
:
0
5px
;
margin
:
5px
auto
;
background-color
:
#f8f8f8
;}
#BOX
.add
.add_name
{
float
:
left
;}
#BOX
.add
.add_phone
{
float
:
right
;}
#BOX
.add
.add_address
{
clear
:
both
;}
.df_administration
>
dd
>
a
{
display
:
none
;}
.df_administration
>
dd
>
div
>
p
>
a
{
margin-top
:
10px
;
text-align
:
right
;}
.xianzhilength
{
width
:
70%
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
display
:
inline-block
;}
.body
{
background-color
:
#f5f5f5
;
}
</style>
<div
class=
"body"
>
<div
class=
"wrap"
>
<div
class=
"min-height-wrap"
>
<div
class=
"class_order_tit"
>
确认订单
</div>
<!--商品信息-->
<dl
class=
"df_course-info"
>
<dt><h3>
商品信息
</h3></dt>
<dd>
<a
href=
"{:U('mall/Goods/view',['id'=>$goods_id])}"
>
<span>
<img
src=
"{:getCover($cover_id,120,120)}"
width=
"120"
height=
"70"
alt=
"{:mStr($title,10)}"
>
</span>
<h3>
{:mStr($title,20)}
</h3>
<div>
{:mStr($info,50)}
</div>
</a>
</dd>
</dl>
<!--支付方式-->
<dl
class=
"df_pay-style"
>
<dt><h3>
支付方式
</h3></dt>
<php>
if($is_wx){unset($payWay['支付宝支付']);}$firstPayWay = current($payWay);
</php>
<if
condition=
"in_array('alipay',$payConfig['pay']) and ($is_wx eq false)"
>
<dd
value=
"alipay"
class=
"paytype"
><a
class=
"icon icon-zhifubao1"
></a><span
class=
"name"
>
支付宝
</span><i
<
if
condition=
'($firstPayWay eq alipay)'
>
class="icon icon-xuanze"
</if>
>
</i></dd>
</if>
<if
condition=
"in_array('wxpay',$payConfig['pay'])"
>
<dd
value=
"wxpay"
class=
"paytype"
><a
class=
"icon icon-weixinzhifu1"
></a><span
class=
"name"
>
微信支付
</span><i
<
if
condition=
'$is_wx or $firstPayWay eq wxpay'
>
class="icon icon-xuanze"
</if>
style="border: 1px solid rgb(237, 237, 237);">
</i></dd>
</if>
<if
condition=
"in_array('credpay',$payConfig['pay'])"
>
<dd
value=
"credpay"
class=
"paytype"
><a
class=
"icon icon-iconfont"
></a><span
class=
"name"
>
积分支付
</span><span>
(剩余积分{$credit|default=0})
</span><i
<
if
condition=
'($firstPayWay eq credpay)'
>
class="icon icon-xuanze"
</if>
style="border: 1px solid rgb(237, 237, 237);">
</i></dd>
</if>
</dl>
<p
class=
"other"
>
注:人民币与积分的兑换比例为 {$split_score_pro}
</p>
<!-- 新增功能-收货管理 -->
<dl
class=
"df_administration"
>
<a
href=
"JavaScript:"
>
<dt><h3>
收货管理
</h3></dt>
<dd>
<div>
<p>
<if
condition=
"$address"
>
<span
class=
"name"
>
{$address.name}
</span>
<span
class=
"phone"
>
{$address.phone}
</span>
<span
class=
"address"
>
{$address.location}
</span>
<!-- 修改-->
<span
class=
"xianzhilength"
>
{$address.address}
</span>
<else/>
<a
class=
"xinzeng"
href=
"{:U('home/User/address',['param'=>$_GET['vst']])}"
>
新增地址
</a>
</if>
</p>
<if
condition=
"$address_list"
>
<i
class=
"icon icon-youjiantou"
></i>
</if>
</div>
</dd>
</a>
</dl>
<!--实付金额-->
<dl
class=
"df_pay-price"
>
<dd><h3>
实付金额
</h3><p
id=
"pay_money"
>
¥{$lastPrice/$sple_score}
</p></dt>
</dl>
<!--购买协议-->
<div
class=
"df_pay-protocol"
>
<p><i
class=
"icon icon-xuanze"
attr=
"1"
></i>
我已阅读并同意
<a
href=
"{:U('basic/Single/info',array('id'=>'buy'))}"
>
《{$site['site_keyword']}购买协议》
</a></p>
</div>
<!--提交订单-->
<div
class=
"df_pay-buy"
>
<h3>
合计:
<strong
id=
"pay_money2"
>
¥{$lastPrice/$sple_score}
</strong></h3>
<a
href=
"javascript:;"
onclick=
"buyOperat(this,{$goods_id});"
type=
"submit"
>
提交
</a>
</div>
<form
action=
"{:U('classroom/Pay/buyGoods')}"
method=
"POST"
id=
"buyfrom"
>
<if
condition=
"$is_wx and in_array('wxpay',$payConfig['pay'])"
>
<input
type=
"hidden"
value=
"wxpay"
name=
"pay"
/>
<else/>
<volist
name=
"payWay"
id=
"vo"
offset=
"0"
length=
"1"
>
<input
type=
"hidden"
value=
"{$vo}"
name=
"pay"
/>
</volist>
</if>
<input
type=
"hidden"
value=
"{$lastPrice}"
name=
"total"
/>
<input
type=
"hidden"
value=
"{$count}"
name=
"count"
/>
<input
type=
"hidden"
value=
"{$goods_id}"
name=
"goods_id"
/>
<input
type=
"hidden"
value=
"{$address.id}"
name=
"address_id"
/>
</form>
</div>
</div>
</div>
<!--选择收货地址弹框-->
<div
id=
"BOX"
>
<div>
选择收货地址
</div>
<div>
<foreach
name=
"address_list"
item=
"l"
>
<div
class=
"add"
data-id=
"{$l.id}"
>
<div
class=
"add_name"
>
{$l.name}
</div>
<div
class=
"add_phone"
>
{$l.phone}
</div>
<div
class=
"add_address"
>
<span
class=
"add_address1"
>
{$l.location}
</span>
<span
class=
"add_address2"
>
{$l.address}
</span>
</div>
</div>
</foreach>
</div>
</div>
<if
condition=
"$is_wx eq false"
>
<style>
#_ts_box_h5
{
width
:
290px
;
height
:
180px
;
text-align
:
center
;
color
:
#535353
;
border-radius
:
5px
;
position
:
fixed
;
background
:
#fff
;
-webkit-box-shadow
:
0
2px
5px
#dddddd
;
-moz-box-shadow
:
0
2px
5px
#dddddd
;
-khtml-box-shadow
:
0
2px
5px
#dddddd
;
-ms-box-shadow
:
0
0
15px
#888888
;
box-shadow
:
0
0
15px
#888888
;
z-index
:
997
;
left
:
5%
;
top
:
35%
;
margin
:
0
auto
;
background
:
#fff
;}
._hide_box_h5
{
z-index
:
996
;
filter
:
alpha
(
opacity
=
50
);
background
:
#666
;
opacity
:
0.5
;
-moz-opacity
:
0.5
;
left
:
0
;
top
:
0
;
height
:
99%
;
width
:
100%
;
position
:
fixed
;}
#_ts_box_h5
._box_hd
{
padding
:
20px
0px
;
color
:
black
;
font-size
:
16px
;
border-bottom
:
1px
solid
rgba
(
0
,
0
,
0
,
0.16
);}
#_layer-content
{
padding
:
15px
0px
;
color
:
rgba
(
255
,
35
,
0
,
0.69
);
font-size
:
16px
;
border-bottom
:
1px
solid
rgba
(
0
,
0
,
0
,
0.1
);}
._layer-wt
{
padding
:
15px
0px
;
color
:
#908d8d
;
font-size
:
16px
;}
</style>
<div
class=
"_hide_box_h5"
style=
"display: none;"
></div>
<div
id=
"_ts_box_h5"
style=
"display: none;"
>
<div
class=
"_box_hd"
>
请确认微信支付是否完成
</div>
<div
id=
"_layer-content"
>
已完成支付
</div>
<div
class=
"_layer-wt"
><a
href=
"{:U('classroom/Pay/buyGoods',['vst'=>$_GET['vst']])}"
>
支付遇到问题,联系客服
</a></div>
</div>
</if>
<script>
$
(
function
(){
$
(
".df_pay-style dd:last-child"
).
children
(
"i"
).
css
(
"border"
,
"1px solid #ededed"
);
$
(
".df_pay-style dd"
).
on
(
"click"
,
function
(){
var
val
=
$
(
this
).
attr
(
'value'
),
total
=
"{$lastPrice}"
,
multiple
=
"{$sple_score}"
,
actual_pay
=
total
/
multiple
;
$
(
'input:hidden[name="pay"]'
).
val
(
val
);
//$('input:hidden[name="total"]').val(actual_pay);
if
(
val
==
'credpay'
){
$
(
"#pay_money,#pay_money2"
).
text
(
"¥"
+
actual_pay
+
" ("
+
total
+
"积分)"
);
}
else
{
$
(
"#pay_money,#pay_money2"
).
text
(
"¥"
+
actual_pay
);
}
$
(
this
).
children
(
"i"
).
attr
(
"class"
,
"icon icon-xuanze"
).
css
(
"border"
,
"1px solid transparent"
).
parent
().
siblings
().
children
(
"i"
).
removeAttr
(
"class"
,
"icon icon-xuanze"
).
css
(
"border"
,
"1px solid #ededed"
);
});
$
(
".df_pay-protocol i"
).
on
(
"click"
,
function
(){
var
proVal
=
$
(
this
).
attr
(
"attr"
);
if
(
proVal
==
1
){
$
(
this
).
attr
(
"attr"
,
"0"
).
css
(
"color"
,
"#656565"
);
}
else
{
$
(
this
).
attr
(
"attr"
,
"1"
).
css
(
"color"
,
"#57BC4C"
)
}
});
//修改地址操作
$
(
".icon-youjiantou"
).
click
(
function
(){
var
param
=
"{$_GET['vst']}"
;
location
.
href
=
"{:U('home/User/address')}"
+
'?'
+
'param'
+
'='
+
param
;
});
})
'<if condition="$is_wx eq false">'
$
(
function
(){
var
wpay
=
"{$_GET['wpay']}"
;
var
ppn
=
"{$_GET['ppn']}"
;
if
(
wpay
!=
''
){
$
(
'._hide_box_h5,#_ts_box_h5'
).
show
();
$
(
'#_layer-content'
).
click
(
function
(){
$
(
'._hide_box_h5,#_ts_box_h5'
).
hide
();
s
=
setInterval
(
function
(){
$
.
ajax
({
url
:
"{:U('classroom/Pay/getPayStatus')}"
,
data
:{
pay_pass_num
:
ppn
},
type
:
'post'
,
success
:
function
(
res
){
try
{
res
=
JSON
.
parse
(
res
);
if
(
res
.
status
==
1
){
clearInterval
(
s
);
ui
.
success
(
'购买成功'
);
setTimeout
(
function
(){
window
.
location
.
href
=
res
.
data
;
},
2000
);
}
}
catch
(
e
){
return
;
}
}
});
},
1800
);
});
}
});
'</if>'
/**
* 删除字符串str的首尾空格
* @name trim
* @grammar UM.utils.trim(str) => String
*/
var
trim
=
function
(
str
)
{
return
str
.
replace
(
/
(
^
[
\t\n\r]
+
)
|
([
\t\n\r]
+$
)
/g
,
''
);
}
//购买操作
var
buyOperat
=
function
(
sbt
,
gid
){
if
(
MID
<=
0
){
ui
.
confirm
(
'请先登录'
,
{
yes
:
function
()
{
window
.
location
.
href
=
"{:U('basic/Passport/login')}"
;
}
});
return
false
;
}
if
(
!
gid
){
ui
.
error
(
'参数错误'
);
return
false
;
}
var
address_id
=
$
(
'input:hidden[name="address_id"]'
).
val
();
if
(
!
address_id
){
ui
.
error
(
"请选择收货地址"
);
return
false
;
}
if
(
$
(
'.df_pay-protocol i.icon-xuanze'
).
attr
(
'attr'
)
!=
'1'
){
ui
.
error
(
"购买必须同意《{$site['site_keyword']}购买协议》"
);
return
false
;
}
var
form
=
$
(
sbt
).
parents
(
'form'
);
var
pay
=
$
(
'input:hidden[name="pay"]'
).
val
();
if
(
pay
!=
'alipay'
&&
pay
!=
'wxpay'
&&
pay
!=
'credpay'
){
ui
.
error
(
'支付方式错误'
);
return
false
;
}
$
(
sbt
).
attr
(
'style'
,
'background:rgba(102, 102, 102, 0.65)'
).
removeAttr
(
'onclick'
);
if
(
pay
==
'wxpay'
){
var
s
=
0
;
$
.
ajax
({
url
:
"{:U('classroom/Pay/buyGoods')}"
,
data
:
$
(
'#buyfrom'
).
serialize
(),
async
:
false
,
type
:
'post'
,
success
:
function
(
data
){
if
(
typeof
data
!=
'object'
){
var
data
=
eval
(
'('
+
data
+
')'
);
}
clearInterval
(
s
);
if
(
data
.
status
==
1
){
var
pay_pass_num
=
data
.
data
.
pay_pass_num
;
'<if condition="$is_wx">'
WeixinJSBridge
.
invoke
(
'getBrandWCPayRequest'
,
JSON
.
parse
(
data
.
data
.
html
),
function
(
res
){
if
(
res
.
err_msg
==
"get_brand_wcpay_request:ok"
){
s
=
setInterval
(
function
(){
$
.
ajax
({
url
:
"{:U('classroom/Pay/getPayStatus')}"
,
data
:{
pay_pass_num
:
pay_pass_num
},
type
:
'post'
,
success
:
function
(
res
){
try
{
res
=
JSON
.
parse
(
res
);
if
(
res
.
status
==
1
){
clearInterval
(
s
);
ui
.
success
(
'购买成功'
);
setTimeout
(
function
(){
window
.
location
.
href
=
res
.
data
;
},
1500
);
}
}
catch
(
e
){
return
;
}
}
});
},
1800
);
}
}
);
'<else/>'
var
a
=
document
.
createElement
(
'a'
);
a
.
href
=
data
.
data
.
html
;
a
.
click
();
return
false
;
'</if>'
}
else
{
ui
.
error
(
data
.
info
);
setTimeout
(
function
(){
window
.
location
.
href
=
window
.
location
.
href
;
},
1500
);
}
},
error
:
function
(){
return
false
}
});
}
else
{
if
(
pay
==
'alipay'
){
$
(
"#buyfrom"
).
submit
();
}
else
{
var
url
=
"{:U('mall/Goods/doSaveGoods')}"
;
}
$
.
ajax
({
type
:
"POST"
,
url
:
url
,
data
:
$
(
'#buyfrom'
).
serialize
(),
dataType
:
"json"
,
success
:
function
(
res
){
var
res
=
getResponseData
(
res
);
if
(
res
.
status
==
1
){
ui
.
success
(
res
.
message
);
setTimeout
(
function
(){
window
.
location
.
href
=
"{:U('mall/Goods/view',['id'=>$goods_id])}"
;
},
'1500'
);
}
else
{
//显示提交按钮
setInterval
(
function
(){
$
(
sbt
).
attr
(
"onclick"
,
"buyOperat(this,'{$goods_id}')"
).
removeAttr
(
'style'
);
},
1000
);
ui
.
error
(
res
.
message
);
return
false
;
}
}
});
}
}
window
.
onload
=
function
(){
$
(
".add"
).
on
(
"click"
,
function
(){
var
id
=
$
(
this
).
data
(
'id'
);
$
(
"input[name='address_id']"
).
val
(
id
);
$
(
".df_administration .name"
).
html
(
$
(
this
).
children
(
'.add_name'
).
html
())
$
(
".df_administration .phone"
).
html
(
$
(
this
).
children
(
'.add_phone'
).
html
())
$
(
".df_administration .address"
).
html
(
$
(
this
).
children
().
children
(
'.add_address1'
).
html
())
$
(
".df_administration .xianzhilength"
).
html
(
$
(
this
).
children
().
children
(
'.add_address2'
).
html
())
})
$
(
".df_administration"
).
on
(
"click"
,
function
(){
if
(
$
(
".add"
).
length
>
0
){
$
(
".body"
).
css
(
"display"
,
"none"
)
$
(
"#BOX"
).
css
(
"display"
,
"block"
)
$
(
"#BOX"
).
on
(
"click"
,
".add"
,
function
(){
$
(
"#BOX"
).
css
(
"display"
,
"none"
)
$
(
".body"
).
css
(
"display"
,
"block"
)
})
$
(
"#BOX"
).
on
(
"click"
,
function
(){
$
(
"#BOX"
).
css
(
"display"
,
"none"
)
$
(
".body"
).
css
(
"display"
,
"block"
)
})
}
})
}
</script>
<include
file=
"__THEME__/public_footer_w3g"
/>
apps/mall/Tpl/default/Goods/view_w3g.html
View file @
d06edf78
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
</style>
</style>
<div
id=
"app"
>
<div
id=
"app"
>
<div
class=
"layout_v"
>
<div
class=
"layout_v"
style=
"padding-bottom: 5rem;"
>
<div
class=
"goods_detail_top layout_v"
>
<div
class=
"goods_detail_top layout_v"
>
<van-image
width=
"100%"
height=
"160"
:src=
"info.cover"
></van-image>
<van-image
width=
"100%"
height=
"160"
:src=
"info.cover"
></van-image>
<span
class=
"text_18_600 color_333333"
style=
"margin: 0.75rem;margin-bottom: 0;"
>
{{info.title}}
</span>
<span
class=
"text_18_600 color_333333"
style=
"margin: 0.75rem;margin-bottom: 0;"
>
{{info.title}}
</span>
...
@@ -27,21 +27,20 @@
...
@@ -27,21 +27,20 @@
<div
class=
"weight_full layout_h_r"
>
<div
class=
"weight_full layout_h_r"
>
<div
@
click=
"onBuy"
class=
"vip_buy_pay_button layout_center"
><span
class=
"text_14_400 color_white"
>
立即购买
</span></div>
<div
@
click=
"onBuy"
class=
"vip_buy_pay_button layout_center"
><span
class=
"text_14_400 color_white"
>
立即购买
</span></div>
<span
style=
"margin-right: 0.75rem;"
class=
"text_12_400 color_999999 self_center"
>
0
</span>
<span
style=
"margin-right: 0.75rem;"
class=
"text_12_400 color_999999 self_center"
>
{{info.num}}人已购买
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
<script>
let
uid
=
'{$uid}'
new
Vue
({
new
Vue
({
el
:
"#app"
,
el
:
"#app"
,
created
:
function
(){
created
:
function
(){
this
.
info
=
{:
json_encode
(
$data
)};
this
.
info
=
{:
json_encode
(
$data
)};
this
.
order
=
{:
json_encode
(
$goodsOrder
)};
console
.
log
(
this
.
info
)
console
.
log
(
this
.
info
)
console
.
log
(
this
.
order
)
},
},
data
:
function
()
{
data
:
function
()
{
...
@@ -53,9 +52,33 @@
...
@@ -53,9 +52,33 @@
methods
:
{
methods
:
{
onBuy
:
function
()
{
onBuy
:
function
()
{
if
(
uid
<=
0
)
{
ui
.
confirm
(
'请先登录'
,
{
yes
:
function
()
{
window
.
location
.
href
=
"{:U('basic/Passport/login')}"
}
})
}
else
{
$
.
ajax
({
type
:
"POST"
,
url
:
"{:U('mall/Goods/getPayUrl')}"
,
data
:{
count
:
1
,
goods_id
:
this
.
info
.
uid
,
},
dataType
:
"json"
,
success
:
function
(
res
){
var
res
=
getResponseData
(
res
);
if
(
res
.
status
==
1
){
window
.
location
.
href
=
res
.
data
;
}
else
{
ui
.
error
(
res
.
message
);
}
}
}
}
})
})
}
},
}
})
</script>
</script>
<include
file=
"__THEME__/public_footer_w3g"
/>
<include
file=
"__THEME__/public_footer_w3g"
/>
apps/mall/Tpl/default/Goods/view_w3g_old.html
0 → 100644
View file @
d06edf78
<include
file=
"__THEME__/public_header_w3g"
/>
<!-- <script src="__THEME__/js/core.js"></script>
<script src="__THEME__/js/common.js"></script>
<link rel="stylesheet" href="__APP__/css/view_3g.css"> -->
<div
id=
"app"
>
<div
class=
"layout_v"
>
</div>
</div>
<div
class=
"body"
>
<div
class=
"malltop clearfix"
>
<img
class=
"bg"
src=
"{:getCover($data['cover_id'],360,360)}"
alt=
"{$data.title}"
/>
<a
class=
"malltop_nav"
href=
"javascript:history.go(-1);"
></a>
<div
class=
"boxcont"
>
<div
class=
"briefIntr"
>
{$data.title}
</div>
<div
class=
"Price_new"
>
<p><if
condition=
"in_array('credpay',$payConfig['pay'])"
>
积分
<else/>
金额
</if>
:
<input
type=
"hidden"
id=
"price"
name=
"price"
value=
"{$data.price}"
/><if
condition=
"in_array('credpay',$payConfig['pay'])"
>
{$data.price}
<else/>
{$data['price']/$sple_score}
</if>
<span>
(快递费:
<if
condition=
"in_array('credpay',$payConfig['pay'])"
>
{$data.fare}积分
<else/>
¥{$data['fare']/$sple_score}
</if>
)
</span></p>
<p>
兑换人数:{$data.goods_count}
</p>
</div>
<div
class=
"portant"
>
<div>
<span
class=
"exchange"
>
兑换数量
</span>
<div>
<a
class=
"adbtn minus"
href=
"javascript:;"
>
-
</a>
<input
id=
"count"
name=
"count"
type=
"text"
value=
"1"
onkeyup=
"formatMoneyWith6digts(this);"
/>
<a
class=
"adbtn add"
href=
"javascript:;"
>
+
</a>
</div>
<if
condition=
"$data.stock heq 0"
>
<span
style=
"color: #FF3C41;"
>
(无货)
</span>
<else/>
<span
style=
"color: #7B7B7B;"
>
(有货)
</span>
</if>
</div>
<div>
<if
condition=
"$data.stock heq 0"
>
<a
class=
"clickhd"
href=
"javascript:;"
style=
'background-color: gray'
>
兑换
</a>
<else
/>
<a
class=
"clickhd"
href=
"javascript:;"
onclick=
"saveGoods();"
>
兑换
</a>
</if>
</div>
</div>
</div>
<!-- <div class="txt">
<div class="info">
<div class="fl">所需<if condition="in_array('credpay',$payConfig['pay'])">积分<else/>金额</if><input type="hidden" id="price" name="price" value="{$data.price}" /><span><if condition="in_array('credpay',$payConfig['pay'])">{$data.price}<else/>{$data['price']/$sple_score}</if></span></div>
<ul class="fr">
<li><p>{$data.stock}</p>仓库剩余</li>
<li><p>{$data.goods_count}</p>兑换人数</li>
</ul>
</div>
<dl>
<dt>配送</dt>
<php>if($address['location']){</php>
<dd id="charge_address">
<em id="old">{$address.location} {$address.address}</em>
</dd>
<php>}else{</php>
<a href="{:U('home/User/address')}" style="color: #188eee;">新增地址</a>
<php>}</php>
<input class="address_id" name="address_id" value="{$address.id}" type="hidden" />
<dt>快递费</dt>
<dd><if condition="in_array('credpay',$payConfig['pay'])">{$data.fare}积分<else/>¥{$data['fare']/$sple_score}</if></dd>
</dl>
<dl>
<dt>简介</dt>
<dd><php>if($data['info']){</php>{$data.info|msubstr=0,87,'utf-8',true}<php>}else{</php>暂时没有该商品的相关简介<php>}</php></dd>
</dl>
<dl class="position">
<dt>数量</dt>
<dd>
<a class="adbtn minus" href="javascript:;">-</a>
<input id="count" name="count" type="text" value="1" onkeyup="formatMoneyWith6digts(this);"/>
<a class="adbtn add" href="javascript:;">+</a><span>件</span>
</dd>
<a class="dh" href="javascript:;" onclick="saveGoods();">兑换</a>
</dl>
</div> -->
</div>
<div
class=
"mallbot"
>
<div
class=
"mallmain-hd"
>
<ul>
<li
class=
"choose on"
><a
href=
"javascript:;"
>
详情
</a></li>
<li
class=
"choose"
><a
href=
"javascript:;"
>
兑换记录
</a></li>
</ul>
</div>
<div
class=
"mallmain-bd goodsInfo"
style=
"display: block;font-size: 13px;"
>
<php>
if(!$data['details']){
</php>
<p>
暂时没有该商品的详情介绍
</p>
<php>
}else{
</php>
{$data.details}
<php>
}
</php>
</div>
<div
class=
"mallmain-bd goodsInfo"
style=
"display: none;"
>
<ul
class=
"mallrecordlist"
>
<php>
if(!$goodsOrder){
</php>
<li><span>
暂时还没有人兑换过该商品
</span></li>
<php>
}else{
</php>
<volist
name=
"goodsOrder"
id=
"re"
offset=
"0"
length=
"6"
>
<li>
<img
src=
"{:getUserFace($re['uid'],'m')}"
alt=
"{$re.uname}"
>
<h3><span>
{$re.ctime}
</span>
{$re.uname}
</h3>
<p><span>
{$re.price}
</span>
积分兑换了{$re.count}个{$re['goods_info'].title}
</p>
</li>
</volist>
<php>
}
</php>
</ul>
</div>
</div>
</div>
<a
class=
"backtop"
></a>
<script>
$
(
function
(){
$
(
".choose"
).
click
(
function
(){
$
(
this
).
addClass
(
"on"
).
siblings
().
removeClass
();
var
index
=
$
(
this
).
index
();
$
(
".goodsInfo"
).
hide
().
eq
(
index
).
show
();
});
var
total_count
=
'{$data.stock}'
;
if
(
total_count
<
1
){
total_count
=
1
;
}
$
(
".add"
).
click
(
function
(){
var
t
=
$
(
this
).
prev
(
"input"
);
var
num
=
parseInt
(
t
.
val
());
if
(
num
>=
total_count
){
t
.
val
(
total_count
);
}
else
{
t
.
val
(
num
+
1
);
}
});
$
(
".minus"
).
click
(
function
(){
var
inputObj
=
$
(
this
).
next
(
"input"
);
var
t
=
parseInt
(
inputObj
.
val
());
if
(
t
<=
1
){
inputObj
.
val
(
1
);
}
else
{
inputObj
.
val
(
t
-
1
);
}
});
//地址选择操作
$
(
"#charge_address"
).
click
(
function
(){
ui
.
box
.
load
(
U
(
'mall/Goods/getAddress'
),
'选择收货地址'
);
});
});
/*function changeAddress() {
var address_id = $("input[type='radio']:checked").val();
if(!address_id || address_id == '' || address_id == undefined){
ui.error("请选择地址");
return false;
}
$.post(U('mall/Goods/getAddress'),{address_id:address_id},function(msg){
var msg = getResponseData(msg);
if(msg.status == 1){
$(".address_id").val(msg.data['id']);
msg.data = msg.data['location'] + msg.data['address'];
$("#old").html(msg.data);
ui.box.close();
}
});
};*/
// 关闭弹窗
function
cancel
()
{
ui
.
box
.
close
();
}
function
formatMoneyWith6digts
(
obj
){
obj
.
value
=
obj
.
value
.
replace
(
/
\D
/g
,
''
)
var
stock
=
parseInt
(
'{$data.stock}'
);
if
(
obj
.
value
<
1
){
obj
.
value
=
1
;
}
if
(
obj
.
value
>
stock
){
obj
.
value
=
stock
;
}
}
var
uid
=
'{$uid}'
;
var
goods_id
=
"{$data['goods_id']}"
;
function
saveGoods
(){
if
(
uid
<=
0
){
ui
.
confirm
(
'请先登录'
,
{
yes
:
function
()
{
window
.
location
.
href
=
"{:U('basic/Passport/login')}"
;
}
});
return
false
;
}
var
price
=
$
(
"#price"
).
val
();
var
count
=
$
(
"#count"
).
val
();
var
fare
=
'{$data.fare}'
;
var
total
=
price
*
count
;
var
goods_id
=
'{$Think.get.id}'
;
/*var address_id = $(".address_id").val();
if(!address_id){
ui.error("请选择收货地址");
return false;
}*/
$
.
ajax
({
type
:
"POST"
,
url
:
"{:U('mall/Goods/getPayUrl')}"
,
data
:{
count
:
count
,
goods_id
:
goods_id
,
//address_id:address_id,
},
dataType
:
"json"
,
success
:
function
(
res
){
var
res
=
getResponseData
(
res
);
if
(
res
.
status
==
1
){
window
.
location
.
href
=
res
.
data
;
}
else
{
ui
.
error
(
res
.
message
);
return
false
;
}
}
});
/*ui.confirm("确定要花费"+total+"积分兑换"+count+"个{$data.title}?", {
yes: function () {
$.ajax({
type: "POST",
url:"{:U('mall/Goods/doSaveGoods')}",
data:{
count:count,
total:total,
fare:fare,
goods_id:goods_id,
address_id:address_id,
},
dataType:"json",
success:function(res){
var res = getResponseData(res);
if(res.status == 1){
ui.success(res.message);
setTimeout(function(){
location.reload();
},'1500');
}else{
ui.error(res.message);
return false;
}
}
});
}
});*/
}
function
charge_address
(){
ui
.
box
.
load
(
U
(
'mall/Goods/getAddress'
),
'选择收货地址'
);
}
</script>
<include
file=
"__THEME__/public_footer_w3g"
/>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment