作者 王晓刚
1 个管道 的构建 通过 耗费 11 秒

广告详情

... ... @@ -3,7 +3,12 @@
<component name="ChangeListManager">
<list default="true" id="309ad746-5b2a-4c29-af46-e7925a35765c" name="默认的" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/application/home/controller/Collect.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/home/controller/Collect.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/application/home/controller/Goods.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/home/controller/Goods.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/application/home/controller/Index.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/home/controller/Index.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/application/home/controller/User.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/home/controller/User.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/application/home/view/goods/content_detail.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/home/view/goods/content_detail.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/public/assets/advertising/css/advDetail.css" beforeDir="false" afterPath="$PROJECT_DIR$/public/assets/advertising/css/advDetail.css" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
... ... @@ -29,8 +34,20 @@
<file leaf-file-name="content_detail.html" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/application/home/view/goods/content_detail.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="527">
<caret line="31" column="69" selection-start-line="31" selection-start-column="69" selection-end-line="31" selection-end-column="69" />
<state relative-caret-position="407">
<caret line="282" column="22" selection-start-line="282" selection-start-column="22" selection-end-line="282" selection-end-column="22" />
<folding>
<element signature="n#style#0;n#div#2;n#div#4;n#div#0;n#body#0;n#html#0;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="advDetail.css" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/public/assets/advertising/css/advDetail.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="305">
<caret line="40" column="37" selection-start-line="40" selection-start-column="37" selection-end-line="40" selection-end-column="37" />
</state>
</provider>
</entry>
... ... @@ -38,17 +55,17 @@
<file leaf-file-name="User.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/home/controller/User.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="493">
<caret line="149" column="46" selection-start-line="149" selection-start-column="35" selection-end-line="149" selection-end-column="46" />
<state relative-caret-position="674">
<caret line="185" column="14" selection-start-line="185" selection-start-column="14" selection-end-line="185" selection-end-column="14" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="WechatBase.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/common/controller/WechatBase.php">
<file leaf-file-name="User.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/home/model/User.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="623">
<caret line="81" column="14" selection-start-line="81" selection-start-column="14" selection-end-line="81" selection-end-column="14" />
<state relative-caret-position="238">
<caret line="20" column="20" selection-start-line="20" selection-start-column="20" selection-end-line="20" selection-end-column="20" />
</state>
</provider>
</entry>
... ... @@ -56,8 +73,8 @@
<file leaf-file-name="Index.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/home/controller/Index.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="334">
<caret line="78" column="13" selection-start-line="78" selection-start-column="13" selection-end-line="78" selection-end-column="13" />
<state relative-caret-position="623">
<caret line="123" column="52" selection-start-line="123" selection-start-column="52" selection-end-line="123" selection-end-column="52" />
</state>
</provider>
</entry>
... ... @@ -65,17 +82,17 @@
<file leaf-file-name="Goods.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/home/controller/Goods.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="470">
<caret line="69" column="32" lean-forward="true" selection-start-line="69" selection-start-column="32" selection-end-line="69" selection-end-column="32" />
<state relative-caret-position="606">
<caret line="78" column="22" selection-start-line="78" selection-start-column="22" selection-end-line="78" selection-end-column="22" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Jump.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/thinkphp/library/traits/controller/Jump.php">
<file leaf-file-name="Question.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/home/controller/Question.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="341">
<caret line="142" column="45" selection-start-line="142" selection-start-column="38" selection-end-line="142" selection-end-column="45" />
<state relative-caret-position="510">
<caret line="46" column="13" selection-start-line="46" selection-start-column="13" selection-end-line="46" selection-end-column="13" />
</state>
</provider>
</entry>
... ... @@ -92,8 +109,8 @@
<file leaf-file-name="js.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/home/view/public/js.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="119">
<caret line="7" column="16" selection-start-line="7" selection-start-column="16" selection-end-line="7" selection-end-column="16" />
<state relative-caret-position="187">
<caret line="11" column="18" selection-start-line="11" selection-start-column="18" selection-end-line="11" selection-end-column="18" />
</state>
</provider>
</entry>
... ... @@ -117,6 +134,14 @@
<find>statusList</find>
<find>money</find>
<find>target_url</find>
<find>sun_05</find>
<find>collect_img</find>
<find>bottom_collect</find>
<find>quest_ans</find>
<find>btn_all</find>
<find>btn_msg</find>
<find>quest_condition</find>
<find>detail_qust</find>
</findStrings>
<replaceStrings>
<replace />
... ... @@ -128,8 +153,6 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/application/admin/view/pay_view/index.html" />
<option value="$PROJECT_DIR$/public/assets/js/backend/pay_view.js" />
<option value="$PROJECT_DIR$/application/admin/view/user_money_log/index.html" />
<option value="$PROJECT_DIR$/application/admin/controller/UserMoneyLog.php" />
<option value="$PROJECT_DIR$/public/assets/js/backend/user_money_log.js" />
... ... @@ -171,13 +194,15 @@
<option value="$PROJECT_DIR$/application/home/view/public/NAV.html" />
<option value="$PROJECT_DIR$/application/home/view/public/nav.html" />
<option value="$PROJECT_DIR$/application/home/view/public/js.html" />
<option value="$PROJECT_DIR$/application/home/controller/Index.php" />
<option value="$PROJECT_DIR$/application/home/view/public/head.html" />
<option value="$PROJECT_DIR$/application/home/view/index/index.html" />
<option value="$PROJECT_DIR$/application/home/view/user/authorization_view.html" />
<option value="$PROJECT_DIR$/application/home/controller/User.php" />
<option value="$PROJECT_DIR$/application/common/controller/WechatBase.php" />
<option value="$PROJECT_DIR$/application/home/controller/Collect.php" />
<option value="$PROJECT_DIR$/application/home/controller/Index.php" />
<option value="$PROJECT_DIR$/application/home/controller/Goods.php" />
<option value="$PROJECT_DIR$/public/assets/advertising/css/advDetail.css" />
<option value="$PROJECT_DIR$/application/home/controller/User.php" />
<option value="$PROJECT_DIR$/application/home/view/goods/content_detail.html" />
</list>
</option>
... ... @@ -362,6 +387,14 @@
<item name="public" type="462c0819:PsiDirectoryNode" />
<item name="assets" type="462c0819:PsiDirectoryNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="css" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="public" type="462c0819:PsiDirectoryNode" />
<item name="assets" type="462c0819:PsiDirectoryNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="js" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
... ... @@ -428,14 +461,7 @@
<workItem from="1572223206994" duration="28857000" />
<workItem from="1572309778506" duration="26117000" />
<workItem from="1572395935540" duration="28313000" />
<workItem from="1572483209367" duration="16289000" />
</task>
<task id="LOCAL-00009" summary="调试授权">
<created>1571979680270</created>
<option name="number" value="00009" />
<option name="presentableId" value="LOCAL-00009" />
<option name="project" value="LOCAL" />
<updated>1571979680270</updated>
<workItem from="1572483209367" duration="27197000" />
</task>
<task id="LOCAL-00010" summary="调试授权">
<created>1571979769963</created>
... ... @@ -773,11 +799,18 @@
<option name="project" value="LOCAL" />
<updated>1572507187873</updated>
</task>
<option name="localTasksCounter" value="58" />
<task id="LOCAL-00058" summary="广告详情">
<created>1572507400807</created>
<option name="number" value="00058" />
<option name="presentableId" value="LOCAL-00058" />
<option name="project" value="LOCAL" />
<updated>1572507400807</updated>
</task>
<option name="localTasksCounter" value="59" />
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="229827000" />
<option name="totallyTimeSpent" value="240735000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
... ... @@ -851,39 +884,6 @@
<option name="LAST_COMMIT_MESSAGE" value="广告详情" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/merchant_goods.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-408">
<caret line="27" column="70" selection-start-line="27" selection-start-column="70" selection-end-line="27" selection-end-column="70" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/merchant_audit.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-153" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/goods.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="82" column="28" selection-start-line="82" selection-start-column="28" selection-end-line="142" selection-end-column="30" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/goods/add.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2442">
<caret line="249" selection-start-line="249" selection-end-line="249" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/exp_ratio/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="238">
<caret line="14" column="28" selection-start-line="14" selection-start-column="24" selection-end-line="20" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/exp_ratio.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="408">
... ... @@ -1121,20 +1121,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/view/public/js.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="119">
<caret line="7" column="16" selection-start-line="7" selection-start-column="16" selection-end-line="7" selection-end-column="16" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/thinkphp/helper.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="289">
<caret line="279" column="63" selection-start-line="279" selection-start-column="56" selection-end-line="279" selection-end-column="63" />
</state>
</provider>
</entry>
<entry file="jar://$APPLICATION_HOME_DIR$/plugins/php/lib/php.jar!/stubs/standard/standard_2.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="204">
... ... @@ -1166,48 +1152,98 @@
<entry file="file://$PROJECT_DIR$/application/home/view/goods/video_detail.html">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/application/home/controller/Index.php">
<entry file="file://$PROJECT_DIR$/application/home/view/user/authorization_view.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="334">
<caret line="78" column="13" selection-start-line="78" selection-start-column="13" selection-end-line="78" selection-end-column="13" />
<state relative-caret-position="306">
<caret line="63" selection-start-line="63" selection-end-line="63" selection-end-column="28" />
<folding>
<element signature="n#style#0;n#html#0;n#!!top" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/controller/User.php">
<entry file="file://$PROJECT_DIR$/application/home/view/public/js.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="493">
<caret line="149" column="46" selection-start-line="149" selection-start-column="35" selection-end-line="149" selection-end-column="46" />
<state relative-caret-position="187">
<caret line="11" column="18" selection-start-line="11" selection-start-column="18" selection-end-line="11" selection-end-column="18" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/thinkphp/helper.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="289">
<caret line="279" column="63" selection-start-line="279" selection-start-column="56" selection-end-line="279" selection-end-column="63" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/view/index/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="476">
<caret line="43" column="57" selection-start-line="43" selection-start-column="30" selection-end-line="43" selection-end-column="57" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/controller/Collect.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="527">
<caret line="37" column="5" selection-start-line="37" selection-start-column="5" selection-end-line="37" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/controller/Question.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="510">
<caret line="46" column="13" selection-start-line="46" selection-start-column="13" selection-end-line="46" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/controller/Goods.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="470">
<caret line="69" column="32" lean-forward="true" selection-start-line="69" selection-start-column="32" selection-end-line="69" selection-end-column="32" />
<state relative-caret-position="606">
<caret line="78" column="22" selection-start-line="78" selection-start-column="22" selection-end-line="78" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/view/user/authorization_view.html">
<entry file="file://$PROJECT_DIR$/application/home/controller/Member.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="306">
<caret line="63" selection-start-line="63" selection-end-line="63" selection-end-column="28" />
<folding>
<element signature="n#style#0;n#html#0;n#!!top" />
</folding>
<state relative-caret-position="-2142" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/controller/Index.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="623">
<caret line="123" column="52" selection-start-line="123" selection-start-column="52" selection-end-line="123" selection-end-column="52" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/view/index/index.html">
<entry file="file://$PROJECT_DIR$/public/assets/advertising/css/advDetail.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="476">
<caret line="43" column="57" selection-start-line="43" selection-start-column="30" selection-end-line="43" selection-end-column="57" />
<state relative-caret-position="305">
<caret line="40" column="37" selection-start-line="40" selection-start-column="37" selection-end-line="40" selection-end-column="37" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/model/User.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="238">
<caret line="20" column="20" selection-start-line="20" selection-start-column="20" selection-end-line="20" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/controller/User.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="674">
<caret line="185" column="14" selection-start-line="185" selection-start-column="14" selection-end-line="185" selection-end-column="14" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/view/goods/content_detail.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="527">
<caret line="31" column="69" selection-start-line="31" selection-start-column="69" selection-end-line="31" selection-end-column="69" />
<state relative-caret-position="407">
<caret line="282" column="22" selection-start-line="282" selection-start-column="22" selection-end-line="282" selection-end-column="22" />
<folding>
<element signature="n#style#0;n#div#2;n#div#4;n#div#0;n#body#0;n#html#0;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
... ...
... ... @@ -25,27 +25,8 @@ class Collect extends WechatBase
}
$this->user_id = $user_id;
}
public function index(){
$type = $this->request->param('type',0,'intval');
$goods_id = $this->request->param('goods_id',0,'intval');
if(empty($type) || empty($goods_id)){
$this->error('404');
}
if($type == 1){
//收藏
if(empty($collect)){
$arr['user_id'] = $this->user_id;
$arr['goods_id'] = $goods_id;
$arr['createtime'] = time();
Db::name('collect')->insert($arr);
}
}else if($type == 2){
//取消收藏
Db::name('collect')->where(['user_id'=>$this->user_id,'goods_id'=>$goods_id])->delete();
}
$this->success('SUCCESS');
}
public function get_all(){
$data = Db::name('collect')
->alias('c')
->field('g.*,c.id as c_id')
... ...
... ... @@ -21,7 +21,7 @@ class Goods extends WechatBase
{
parent::_initialize();
//判断是否授权
$user_id = get_current_user_id();
$user_id = 3;//get_current_user_id();
if(empty($user_id)){
$goods_id = $this->request->param('goods_id',0,'intval');
$target_url = rawurlencode(url('',array('goods_id'=>$goods_id),false,true));
... ... @@ -72,6 +72,13 @@ class Goods extends WechatBase
if(empty($user)){
$this->error('查无此人');
}
//判断用户是否完成答题条件
if(empty($user['mobile']) || empty($user['name']) || empty($user['card'])){
$user['is_satisfy'] = 0;
}else{
$user['is_satisfy'] = 1;
}
$this->assign('user',$user);
$this->assign('data',$data);
if($data['type'] == 1){
return $this->fetch('video_detail');
... ...
... ... @@ -104,6 +104,28 @@ class Index extends WechatBase
$this->success('SUCCESS','',$data);
}
public function collect(){
$type = $this->request->param('type',0,'intval');
$goods_id = $this->request->param('goods_id',0,'intval');
$user_id = $this->request->param('user_id',0,'intval');
if(empty($type) || empty($goods_id) || empty($user_id)){
$this->error('404');
}
if($type == 1){
//收藏
if(empty($collect)){
$arr['user_id'] = $user_id;
$arr['goods_id'] = $goods_id;
$arr['createtime'] = time();
Db::name('collect')->insert($arr);
}
}else if($type == 2){
//取消收藏
Db::name('collect')->where(['user_id'=>$user_id,'goods_id'=>$goods_id])->delete();
}
$this->success('SUCCESS');
}
}
\ No newline at end of file
... ...
... ... @@ -183,6 +183,7 @@ class User extends WechatBase
$this->error($validate->getError());
}
$where['id'] = ['eq',$param['user_id']];
unset($param['user_id']);
$userModel = new \app\home\model\User();
$result = $userModel->updateData($where,$param);
$this->success('SUCCESS');
... ...
... ... @@ -2,8 +2,12 @@
<html lang="en">
{include file="public/head"/}
<link rel="stylesheet" href="css/advDetail.css">
<link rel="stylesheet" href="__CDN__/assets/advertising/css/advDetail.css">
<style>
.btn {
margin-top: 0.64rem
}
</style>
<body>
<div class="adv_detail clearfix">
<!-- 详情内容 -->
... ... @@ -11,7 +15,7 @@
<!-- 标题 -->
<div class="detail_title">{$data.goods_name}</div>
<!-- 日期 -->
<div class="detail_date">截止日期:<i class="end_day">{:date('Y/m/d',$vo['end_time'])}</i></div>
<div class="detail_date">截止日期:<i class="end_day">{:date('Y/m/d',$data['end_time'])}</i></div>
<!-- 描述 -->
<div class="detail_word_wrap">
{$data.content}
... ... @@ -19,89 +23,48 @@
</div>
<!-- 答题 -->
<div class="detail_qust">
<!-- 单选题 -->
<div class="quest_box quest_ans">
<div class="quest_title">题目</div>
<div class="quest_single">
<div class="question">
1、方面便是什么味道
</div>
<div class="answer layout align_center flex_row">
<div class="layout align_center flex_row ans_single" data-index="1">
<div class="ans_img">
<img src="__CDN__/assets/advertising/img/sun_07@2x.png" alt="" class="choice_img">
</div>
<div class="answer_word choice_ans">老坛酸菜牛肉面</div>
</div>
<div class="layout align_center flex_row ans_single" data-index="2">
<div class="ans_img">
<img src="__CDN__/assets/advertising/img/sun_06@2x.png" alt="" class="choice_img">
{php}$question = json_decode($data['question'],true);{/php}
{foreach name="$question" item="q"}
{if condition="$q['question_type'] eq 2"}
<div class="quest_single">
<div class="question">
{$key+1}、{$q.question_name}
</div>
<div class="answer_word">红烧牛肉鸡蛋面</div>
</div>
<div class="layout align_center flex_row ans_single" data-index="3">
<div class="ans_img">
<img src="__CDN__/assets/advertising/img/sun_06@2x.png" alt="" class="choice_img">
<div class="answer layout align_center flex_row">
{php}$option = explode(',',$q['option']);{/php}
{foreach name="$option" item="o"}
<div class="layout align_center flex_row ans_single" data-index="1">
<div class="ans_img">
<img src="__CDN__/assets/advertising/img/sun_06@2x.png" alt="" class="choice_img">
</div>
<div class="answer_word">{$o}</div>
</div>
{/foreach}
</div>
<div class="answer_word">黑椒牛排酸菜牛肉面</div>
</div>
<div class="layout align_center flex_row ans_single" data-index="4">
<div class="ans_img">
<img src="__CDN__/assets/advertising/img/sun_06@2x.png" alt="" class="choice_img">
{else if condition="$q.question_type eq 1"}
<div class="quest_single">
<div class="question">
{$key+1}、{$q.question_name}
</div>
<div class="answer_word">牛骨酸菜牛肉面</div>
</div>
</div>
</div>
<div class="quest_single">
<div class="question">
2、方面便是什么味道
</div>
<div class="answer layout align_center flex_row">
<div class="layout align_center flex_row ans_single" data-index="5">
<div class="ans_img">
<img src="__CDN__/assets/advertising/img/sun_07@2x.png" alt="" class="choice_img">
</div>
<div class="answer_word choice_ans">老坛酸菜牛肉面</div>
</div>
<div class="layout align_center flex_row ans_single" data-index="6">
<div class="ans_img">
<img src="__CDN__/assets/advertising/img/sun_06@2x.png" alt="" class="choice_img">
<div class="answer_fill">答案:{$q.question_answer}</div>
<div class="answer_input_box">
<input type="text" class="answer_input" placeholder="请输入答案" />
</div>
<div class="answer_word">红烧牛肉鸡蛋面</div>
</div>
<div class="layout align_center flex_row ans_single" data-index="7">
<div class="ans_img">
<img src="__CDN__/assets/advertising/img/sun_06@2x.png" alt="" class="choice_img">
</div>
<div class="answer_word">黑椒牛排酸菜牛肉面</div>
</div>
<div class="layout align_center flex_row ans_single" data-index="8">
<div class="ans_img">
<img src="__CDN__/assets/advertising/img/sun_06@2x.png" alt="" class="choice_img">
</div>
<div class="answer_word">牛骨酸菜牛肉面</div>
</div>
</div>
</div>
<div class="quest_single">
<div class="question">
3、大家好才是()。
</div>
<div class="answer_fill">答案:真的好</div>
<div class="answer_input_box">
<input type="text" class="answer_input" placeholder="请输入答案" />
</div>
</div>
{/if}
{/foreach}
<div class="btn right_btn" onclick="submit()">提交答案</div>
<div class="btn error_btn">重新答题(<i class="new_time"></i></div>
</div>
<!-- 未满足答题条件 -->
<div class="quest_box quest_condition">
<div class="quest_box {if condition='$user.is_satisfy eq 1'}quest_condition{/if}">
<div class="quest_title">对不起,您未满足当前题目答题条件</div>
<div class="btn_group layout align_center flex_row justify">
<div class="btn_l btn_msg">完善信息</div>
<div class="btn_l btn_more">查看更多</div>
<div class="btn_l {if condition='$user.is_satisfy eq 1'}btn_all{else /}btn_msg{/if}" onclick="window.location.href='{:url('home/member/index')}'">完善信息</div>
<div class="btn_l btn_more" onclick="window.location.href='{:url('home/index/index')}'">查看更多</div>
</div>
</div>
</div>
... ... @@ -149,39 +112,50 @@
<div class="link_img">
<img src="__CDN__/assets/advertising/img/sun_10@2x.png" alt="">
</div>
<a class="jump_a">https://www.baidu.com/</a>
<a class="jump_a">{$data.url}</a>
</div>
<div class="bottom_collect layout align_center justify_center flex_diection">
<div class="collect_img">
<img src="__CDN__/assets/advertising/img/sun_05@2x.png" alt="" class="collect_img_link">
{if condition="$data.is_collect eq 0"}
<div class="bottom_collect layout align_center justify_center flex_diection">
<div class="collect_img">
<img src="__CDN__/assets/advertising/img/sun_05@2x.png" alt="" class="collect_img_link">
</div>
<div>收藏</div>
</div>
<div>收藏</div>
</div>
{else/}
<div class="bottom_collect layout align_center justify_center flex_diection" style="color:#FB7A17;">
<div class="collect_img">
<img src="__CDN__/assets/advertising/img/sun_08@2x.png" alt="" class="collect_img_link">
</div>
<div>收藏</div>
</div>
{/if}
</div>
</div>
{include file="public/js" /}
<script>
// 截止日期
var endDay = 212321312312; //后台时间戳
$(".end_day").text(showYear(endDay));
// 图文显示
var contenTimer = null;
let timer = 3000;
contenTimer = setInterval(function() {
$(".detail_qust").show();
$(".quest_box").removeClass("quest_ans");
// 重新答题
$(".error_btn").hide();
// 未满足答题条件
// $(".quest_condition").hide();
$(".detail_top").css("margin-bottom", "0");
clearInterval(contenTimer);
}, timer)
//全局变量
var goods_id = "{$data.id}";//用户id
var user_id = "{$user.id}";//广告id
var is_satisfy = "{$user.is_satisfy}";//是否满足答题条件(用户是否完善信息)
var is_where_satisfy = 0;//是否满足商户条件
// 观看X时间后出现题
function init(){
var contenTimer = null;
let timer = "{$data.view_time*1000}";
contenTimer = setInterval(function() {
$(".detail_qust").show();
$(".quest_box").removeClass("quest_ans");
// 重新答题
$(".error_btn").hide();
// 未满足答题条件
// $(".quest_condition").hide();
$(".detail_top").css("margin-bottom", "0");
clearInterval(contenTimer);
}, timer);
}
function showQuest(satisfy) {
function showQuest() {
// 是否满足答题条件
var satisfy = 2;
if (satisfy == 1) {
... ... @@ -205,15 +179,15 @@
// 查看更多 完善信息
$(".btn_more").click(function() {
window.location.href = "index.html"
window.location.href = "{:url('home/index/index')}"
})
// 选择答案
$(".ans_single").click(function() {
$(this).find(".answer_word").addClass("choice_ans");
$(this).find(".choice_img").attr("src", "img/sun_07@2x.png");
$(this).find(".choice_img").attr("src", "__CDN__/assets/advertising/img/sun_07@2x.png");
$(this).siblings().find(".answer_word").removeClass("choice_ans");
$(this).siblings().find(".choice_img").attr("src", "img/sun_06@2x.png");
$(this).siblings().find(".choice_img").attr("src", "__CDN__/assets/advertising/img/sun_06@2x.png");
})
... ... @@ -255,52 +229,87 @@
};
// 是否收藏
var isCollect = 2;
$(".bottom_collect").click(function() {
})
if (isCollect == 1) {
// 收藏
let url = "img/sun_08@2x.png";
$(".collect_img_link").attr("src", url);
$(".bottom_collect").css("color", "#FB7A17");
} else {
let url = "img/sun_05@2x.png";
$(".collect_img_link").attr("src", url);
}
var img = $('.collect_img').find('img').attr('src');
var type = '';
if(img == '/assets/advertising/img/sun_08@2x.png'){
//取消收藏操作
type = 2;
}else if(img == '/assets/advertising/img/sun_05@2x.png'){
//收藏操作
type = 1;
}
$.ajax({
url:"{:url('home/index/collect')}",
type:"POST",
data:{'type':type,'goods_id':goods_id,'user_id':user_id},
success:function(res){
if(res.code == 1){
toast('操作成功');
if (type == 1) {
// 收藏
let url = "__CDN__/assets/advertising/img/sun_08@2x.png";
$(".collect_img_link").attr("src", url);
$(".bottom_collect").css("color", "#FB7A17");
} else {
let url = "__CDN__/assets/advertising/img/sun_05@2x.png";
$(".collect_img_link").attr("src", url);
$(".bottom_collect").css("color", "#BDC4CE");
}
}else{
toast('与服务器断开连接');
}
},
error:function(res){
toast('与服务器断开连接');
}
});
});
</script>
<script>
// 地图定位
var geolocation = new qq.maps.Geolocation("LQNBZ-F3L34-EQMUR-DILMD-LBR4Q-GDFOH", "myapp");
var positionNum = 0;
var options = {
timeout: 5000
};
$(function(){
var city = '';
var lat = '';
var lng = '';
//定位当前位置
// 地图定位
var geolocation = new qq.maps.Geolocation("LQNBZ-F3L34-EQMUR-DILMD-LBR4Q-GDFOH", "myapp");
var positionNum = 0;
var options = {
timeout: 5000
};
function showPosition(position) {
var city = position.city; //城市
var addr = position.addr; //详细地址
var lat = position.lat; //
var lng = position.lng; //经纬度
}
function showPosition(position) {
console.log(position);
city = position.city; //城市
lat = position.lat; //经度
lng = position.lng; //纬度
$.ajax({
url:"{:url('home/user/location')}",
type:"POST",
data:{'user_id':user_id,'longitude':lng,'latitude':lat},
success:function(res){
if(res.code == 1){
toast('定位成功');
}else{
toast('定位失败');
}
},
error:function(res){
toast('与服务器断开连接')
}
})
}
function showErr() {
Toast.init();
Toast.show('定位失败', 'success', null);
setTimeout(function() {
Toast.hide();
}, 20000);
};
$(function() { //定位
geolocation.getLocation(showPosition, showErr, options);
})
function showErr() {
toast('定位失败');
};
$(function() {
//定位
geolocation.getLocation(showPosition, showErr, options);
});
});
</script>
<style>
.btn {
margin-top: 0.64rem
}
</style>
</body>
... ...
... ... @@ -39,7 +39,6 @@
.detail_qust {
background-color: #f9f9f9;
padding: 0.24rem 0.34rem 1.78rem;
display: none
}
.quest_box {
... ... @@ -173,6 +172,7 @@
.btn_all {
background-color: #eee;
color: #8C9198;
pointer-events: none;
}
... ...