|
|
@@ -28,17 +28,27 @@ class xhWxMenuService
|
|
|
$mallDomain = str_replace('http', 'https', $mallDomain);
|
|
|
$shopDomain = str_replace('http', 'https', $shopDomain);
|
|
|
}
|
|
|
+// $button = [
|
|
|
+// ["type" => 'view', "name" => "鲜花速递", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+// ["type" => 'view', "name" => "会员服务", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+// ["type" => 'view', "name" => "我的订单", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+// ];
|
|
|
$button = [
|
|
|
- ["type" => 'view', "name" => "鲜花速递", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
- ["type" => 'view', "name" => "会员服务", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
- ["type" => 'view', "name" => "我的订单", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+ ["type" => 'miniprogram', "name" => "鲜花速递", "appid" => $merchant['miniAppId'], "pagepath" => "pages/home/index", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+ ["type" => 'miniprogram', "name" => "会员服务", "appid" => $merchant['miniAppId'], "pagepath" => "pages/home/user", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+ ["type" => 'miniprogram', "name" => "我的订单", "appid" => $merchant['miniAppId'], "pagepath" => "pages/order/list", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
];
|
|
|
$open = WxOpenService::getById(1);
|
|
|
//平台使用的公众号菜单与花店公众号菜单不一样
|
|
|
if (isset($open['merchantId']) && $open['merchantId'] == $merchantId) {
|
|
|
+// $button = [
|
|
|
+// ["type" => "view", "name" => "官网", "menuOption" => $menuOption['redirectToCustomUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+// ["type" => "view", "name" => "后台", "menuOption" => $menuOption['redirectToCustomUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+// ];
|
|
|
$button = [
|
|
|
- ["type" => "view", "name" => "官网", "menuOption" => $menuOption['redirectToCustomUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
- ["type" => "view", "name" => "后台", "menuOption" => $menuOption['redirectToCustomUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+ ["type" => 'miniprogram', "name" => "官网", "appid" => $merchant['miniAppId'], "pagepath" => "", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+ ["type" => 'miniprogram', "name" => "申请", "appid" => $merchant['miniAppId'], "pagepath" => "", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+ ["type" => 'miniprogram', "name" => "后台", "appid" => $merchant['miniAppId'], "pagepath" => "", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
];
|
|
|
}
|
|
|
$wxUtil = new wxUtil($merchant);
|
|
|
@@ -49,6 +59,10 @@ class xhWxMenuService
|
|
|
$menu['button'] = $button;
|
|
|
$info = $wxUtil->userMenuToWeiXin($menu);
|
|
|
$info = json_decode($info, true);
|
|
|
+
|
|
|
+ print_r($info);
|
|
|
+ die;
|
|
|
+
|
|
|
xhMerchantExtendService::updateByMerchantId($merchantId, ['wxMenuInit' => 1]);
|
|
|
$now = time();
|
|
|
$date = date("Y-m-d H:i:s", $now);
|
|
|
@@ -83,7 +97,7 @@ class xhWxMenuService
|
|
|
$sonAddData['menuKey'] = $merchantId . '_' . $key . '_' . $sonKey;
|
|
|
$sonAddData['createTime'] = $date;
|
|
|
$sonAddData['replyType'] = $redirectUrl;//回复类型:常用链接、自定义网址、文字、报名类活动
|
|
|
- $sonAddData['targetId'] = isset($sonVal['keyName']) ? $mapped[$sonVal['keyName']] : 0;//常用链接的链接选项id;活动id等
|
|
|
+ $sonAddData['targetId'] = isset($sonVal['keyName']) ? $mapped[$sonVal['keyName']] : 0;//常用链接选项id、活动id
|
|
|
$sonAddData['replyUrl'] = isset($sonVal['url']) ? $sonVal['url'] : '';
|
|
|
self::add($sonAddData);
|
|
|
}
|