request->get(); $lng = $get['lng'] ?? ''; $lat = $get['lat'] ?? ''; //花束重量默认1.5 $weight = 1.5; if (empty($lng) || empty($lat)) { util::fail('请填写收花地址吧'); } $shop = $this->shop; $shopLong = $shop->long ?? ''; $shopLat = $shop->lat ?? ''; if (empty($shopLong) || empty($shopLat)) { util::fail('门店地址有问题'); } $respond = OrderClass::getDistanceFee($lat, $lng, $shopLat, $shopLong, $weight); $distance = $respond['distance'] ?? 0; $showDistance = $respond['showDistance'] ?? 0; $fee = $respond['fee'] ?? 0; util::success(['distance' => $distance, 'showDistance' => $showDistance, 'fee' => $fee]); } // 获取字典中的 hasMap public function actionGetHasMap() { // 补充店铺信息 $shop = []; $intraCityRet = \biz\shop\classes\ShopClass::hasIntraCity($this->shop); $shop['openIntraCity'] = $intraCityRet['openIntraCity']; $shop['hcFreeKm'] = $intraCityRet['hcFreeKm']; $shop['hcMap'] = $intraCityRet['hcMap']; $shop['hsFreeKm'] = $intraCityRet['hsFreeKm']; $shop['hsAddFee'] = $intraCityRet['hsAddFee']; util::success(['hasMap' => dict::getDict('hasMap'), 'shop'=>$shop]); } }