gq 7 年之前
父节点
当前提交
0464e890db

+ 23 - 0
server/app/Http/Controllers/Admin/Share/InfoController.php

xqd
@@ -0,0 +1,23 @@
+<?php
+
+namespace App\Http\Controllers\Admin\Share;
+
+use App\Models\DreamInfoModel;
+use Illuminate\Http\Request;
+use App\Http\Controllers\Controller;
+
+class InfoController extends Controller
+{
+    public function view(Request $request){
+        $dream = DreamInfoModel::with('img')->find($request->id);
+        $times = (strtotime($dream->end_time) -strtotime( $dream->created_at));
+        if ($times>=3600*24) {
+            $days =floor($times/3600/24)  .'天';
+        } elseif($times>3600 && $times< 3600*24){
+            $days = floor($times/3600) .'小时';
+        }else{
+            $days =floor ($times/60) .'分钟';
+        }
+        return view('admin.share',compact('dream','days'));
+    }
+}

+ 1 - 1
server/config/app.php

xqd
@@ -181,7 +181,7 @@ return [
         Laravel\Passport\PassportServiceProvider::class,
         Dingo\Api\Provider\LaravelServiceProvider::class,
         Orangehill\Iseed\IseedServiceProvider::class,
-        Ignited\LaravelOmnipay\LaravelOmnipayServiceProvider::class,
+//        Ignited\LaravelOmnipay\LaravelOmnipayServiceProvider::class,
         SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class,
 
     ],

+ 1 - 0
server/public/base/img/down.svg

xqd
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1503989256857" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1840" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20"><defs><style type="text/css"></style></defs><path d="M532.207 718.134v0c3.079-1.777 6.39-3.079 9.112-5.802 0.477-0.594 0.827-1.064 1.303-1.539 0.594-0.709 1.539-0.946 2.128-1.54l319.434-331.383c8.519-8.757 12.781-20.121 12.781-31.483 0-11.836-4.733-23.79-13.964-32.666-18.107-17.398-46.871-16.924-64.265 1.183l-288.071 298.956-283.922-300.139c-17.28-18.225-46.040-19.057-64.265-1.777-18.226 17.281-19.057 46.040-1.777 64.265l316.355 334.462c13.844 14.676 35.149 17.399 52.429 9.113 0.945-0.35 1.777-1.182 2.722-1.653v0zM532.207 718.134z" p-id="1841" fill="#1296db"></path></svg>

+ 1 - 0
server/public/base/img/up.svg

xqd
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1503989399657" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1844" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20"><defs><style type="text/css"></style></defs><path d="M880.102 710.827c18.020 17.82 47.144 17.82 65.097 0 17.954-17.753 17.954-46.611 0-64.429l-401.157-395.954c-18.020-17.82-47.077-17.82-65.097 0l-401.157 395.953c-17.954 17.82-18.020 46.611 0 64.429s47.21 17.82 65.097 0.067l368.641-350.142 368.576 350.076z" p-id="1845" fill="#1296db"></path></svg>

+ 60 - 0
server/resources/views/admin/share.blade.php

xqd
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>分享梦想页</title>
+    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
+    <style>
+        body{
+            padding: 0;
+            margin: 0;
+        }
+        p{
+            -webkit-margin-before: 0.1em;
+            -webkit-margin-after: 0.1em;
+        }
+    </style>
+</head>
+<body>
+<h4 style="text-align: center; font-weight: normal; width: 100%; border-bottom: 1px solid #DEDEDE; padding-bottom: 15px">分享梦想页</h4>
+<img style="width: 100%; height: 100%;" src="{{!empty($dream->img) ? $dream->img->pic : ''}}
+
+">
+<p style="font-size: 17px; padding: 0 10px">{{$dream->name}}</p>
+<div style="border-bottom: 1px solid #DEDEDE">
+    <p style="font-size: 13px; padding: 0 10px; color: #919191">
+        {{mb_substr($dream->about,0,8)}} ...
+    </p>
+  {{--  <p style="text-align: center">
+        <img src="/base/img/down.svg" alt="">
+        <img src="/base/img/up.svg" alt="">
+    </p>--}}
+</div>
+<div style="border-bottom: 1px solid #DEDEDE; height: 50px; padding: 5px 10px;">
+    <div style="float:left;">
+        <p>{{$days}}</p>
+        <p style="font-size: 13px; color: #919191">剩余时间</p>
+    </div>
+    <div style="float:right;">
+        <p style="text-align: right">{{$dream->mark}}</p>
+        <p style="font-size: 13px;; color: #919191">当前获得梦想分数</p>
+    </div>
+</div>
+<div style="clear:both; height: 50px; padding: 5px 10px;">
+    <div style="float:left;">
+        <p>{{$dream->get_coin}}</p>
+        <p style="font-size: 13px; color: #919191">目前已获梦想币</p>
+    </div>
+    <div style="float:right;">
+        <p style="text-align: right">{{$dream->coin}}</p>
+        <p style="font-size: 13px; color: #919191">我要求的梦想币</p>
+    </div>
+</div>
+<div style="padding: 0 10px">
+    <div style="background-color:#E6E6E6; width: 100%;">
+        <div style="width: {{($dream->get_coin / $dream->coin)}} %; background: #FF6600; height: 5px">
+        </div>
+    </div>
+</div>
+</body>
+</html>

+ 4 - 1
server/routes/admin.php

xqd xqd
@@ -18,6 +18,9 @@ Route::get('logout', 'Auth\LoginController@logout');
 Route::get('noauth', 'Auth\LoginController@noauth');
 
 
+//    分享返回页面
+Route::get('share/view', 'Share\InfoController@view');
+
 Route::group(['middleware' => ['auth.admin']], function() {
 //参数设置
     Route::get('setting/banner/index', 'Settings\SettingsController@banner');
@@ -43,9 +46,9 @@ Route::group(['middleware' => ['auth.admin']], function() {
     Route::get('Interaction/Info/view', 'Interaction\InfoController@view');
     Route::post('Interaction/Info/update/{id}', 'Interaction\InfoController@update');
 
+
 //后台显示二维码
 //    Route::get('/Dream/Info/show_code', 'Dream\InfoController@showCode');
-
     $uri =  request()->path();
     $uri = str_replace('admin/' ,'', $uri);
     $uri = str_replace('admin' ,'', $uri);

+ 2 - 0
server/routes/api.php

xqd
@@ -18,6 +18,8 @@
 
 
 
+
+
 $api = app('Dingo\Api\Routing\Router');
 
 $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($api) {