|
@@ -18,11 +18,8 @@ class Index extends Api
|
|
|
$this->success();
|
|
|
}
|
|
|
|
|
|
- public function mini_code()
|
|
|
+ private function mini_code($scene, $page_url, $introcode)
|
|
|
{
|
|
|
- $scene = 'kongjianyuyue';
|
|
|
- $page_url = '/pages/active/reserve';
|
|
|
-
|
|
|
$value = config('wxMiniProgram');
|
|
|
$appid = $value['appid'];
|
|
|
$secret = $value['secret'];
|
|
@@ -32,9 +29,9 @@ class Index extends Api
|
|
|
$token = json_decode($res, true)['access_token'];
|
|
|
$URL = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=' . $token;
|
|
|
$data = [
|
|
|
-// 'scene' => '', //二维码传入参数
|
|
|
+ 'scene' => 'introcode='.$introcode, //二维码传入参数
|
|
|
'page' => $page_url, //扫码后进入页面
|
|
|
- 'env_version' => 'trial', //要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。
|
|
|
+ 'env_version' => 'release', //要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。
|
|
|
'width' => 280, //二维码的宽度,单位 px,最小 280px,最大 1280px
|
|
|
'auto_color' => false, //自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false
|
|
|
'is_hyaline' => false, //是否需要透明底色,为 true 时,生成透明底色的小程序
|
|
@@ -54,10 +51,21 @@ class Index extends Api
|
|
|
$path2 = $path2 . '/' . $scene . '.png'; //最后要写入的目录及文件名
|
|
|
|
|
|
file_put_contents($path, $result);
|
|
|
- dump($path2);
|
|
|
- dump(httpurllocal($path2));
|
|
|
|
|
|
- echo '<html><body><img src="'.httpurllocal($path2).'"></body></html>';
|
|
|
+ return $path2;
|
|
|
+ }
|
|
|
+
|
|
|
+ //生成视频分享海报
|
|
|
+ public function shareposter() {
|
|
|
+ // if($this->auth->group_id != 2){$this->error('你是不是来错地方了?');}
|
|
|
+
|
|
|
+ $inviteimage = $this->mini_code($this->auth->id,'pages/index/index',$this->auth->username);
|
|
|
+
|
|
|
+
|
|
|
+ echo httpurllocal($inviteimage);//"https://metavision.oss-cn-hongkong.aliyuncs.com/uploads/20220615/f00cb545deb4c4e7296f444239d83e84.jpg"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|