牟新芬 3 years ago
parent
commit
9fd403cea7
3 changed files with 51 additions and 4 deletions
  1. 1 1
      app/api/controller/v1/Index.php
  2. 2 1
      composer.json
  3. 48 2
      composer.lock

+ 1 - 1
app/api/controller/v1/Index.php

@@ -61,7 +61,7 @@ class Index extends BaseController
     {
         if (!$id || !($storeInfo = Product::getValidProduct($id))) return app('json')->fail('商品不存在或已下架');
         $storeInfo['slider_image'] = json_decode($storeInfo['slider_image'], true);
-        $storeInfo['code_base'] = QrcodeService::getWechatQrcodePath($id . '_product_detail_wap.jpg', '/pages/product/detail?id=' . $id);
+        $storeInfo['code_base'] = QrcodeService::getWechatQrcodePath($id . '_product_detail_wap.jpg', '/h5/pages/product/detail?id=' . $id);
         //替换windows服务器下正反斜杠问题导致图片无法显示
         $storeInfo['description'] = preg_replace_callback('#<img.*?src="([^"]*)"[^>]*>#i', function ($imagsSrc) {
             return isset($imagsSrc[1]) && isset($imagsSrc[0]) ? str_replace($imagsSrc[1], str_replace('\\', '/', $imagsSrc[1]), $imagsSrc[0]) : '';

+ 2 - 1
composer.json

@@ -35,7 +35,8 @@
         "overtrue/wechat": "~4.0",
         "ext-json": "*",
         "ext-simplexml": "*",
-        "ext-libxml": "*"
+        "ext-libxml": "*",
+        "dh2y/think-qrcode": "^2.0"
     },
     "require-dev": {
         "symfony/var-dumper": "^4.2",

+ 48 - 2
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "7b92e610e68072d99d607ebf62072f38",
+    "content-hash": "9452f54013c75cb486e7c4f0f89b23fb",
     "packages": [
         {
             "name": "adbario/php-dot-notation",
@@ -304,6 +304,49 @@
             ],
             "time": "2017-06-12T01:10:27+00:00"
         },
+        {
+            "name": "dh2y/think-qrcode",
+            "version": "2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/cinaofdai/think-qrcode.git",
+                "reference": "977d032afa27b1852f5fc5441fad2497f6db7ff5"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/cinaofdai/think-qrcode/zipball/977d032afa27b1852f5fc5441fad2497f6db7ff5",
+                "reference": "977d032afa27b1852f5fc5441fad2497f6db7ff5",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "php": ">=5.4.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "dh2y\\qrcode\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "dh2y",
+                    "email": "xiaodai54_long@163.com"
+                }
+            ],
+            "description": "qrcode for thinkphp5",
+            "homepage": "https://github.com/cinaofdai/think-qrcode",
+            "time": "2019-07-10T02:57:29+00:00"
+        },
         {
             "name": "easywechat-composer/easywechat-composer",
             "version": "1.4.0",
@@ -4078,7 +4121,10 @@
     "prefer-stable": false,
     "prefer-lowest": false,
     "platform": {
-        "php": ">=7.1.0"
+        "php": ">=7.1.0",
+        "ext-json": "*",
+        "ext-simplexml": "*",
+        "ext-libxml": "*"
     },
     "platform-dev": [],
     "plugin-api-version": "1.1.0"