当前位置: 首页 > news >正文

企业网站营销的实现方式解读电商推广平台

企业网站营销的实现方式解读,电商推广平台,web service做网站,中医网站模板效果图: 一、准备阶段 1、在高德开放平台注册成为开发者2、申请开发者密钥(key)。3、下载并解压高德地图微信小程序SDK 高德开放平台: 注册账号(https://lbs.amap.com/)) 申请小程序应用的 key 应用管理(https://console.ama…

效果图:

微信图片_20230806201545.png微信图片_20230806201628.png

一、准备阶段

  • 1、在高德开放平台注册成为开发者
  • 2、申请开发者密钥(key)。
  • 3、下载并解压高德地图微信小程序SDK

高德开放平台:

注册账号(https://lbs.amap.com/)) 申请小程序应用的 key
image.png

应用管理(https://console.amap.com/dev/key/app)) -> 我的应用 -> 创建新应用
image.png
生成的 key 即可用在程序中

  • 下载相关 sdk 文件,导入 amap-wx.js 到项目中:https://lbs.amap.com/api/wx/download

微信小程序:

1.在创建的项目中,新建一个名为 libs 目录,将 amap-wx.js (amap-wx.js 从相关下载页面下载的 zip 文件解压后得到)文件拷贝到 libs 的本地目录下,如下图所示。
image.png

2.设置小程序安全通讯域名,为了保证高德小程序 SDK 中提供的功能的正常使用,需要设置安全域名。
登录微信公众平台,在 “设置”->“开发设置” 中设置 request 合法域名,将 https://restapi.amap.com 中添加进去,如下图所示:

  1. app.json中加入
"permission": {"scope.userLocation": {"desc": "你的位置信息将用于小程序位置接口的效果展示","dowload": "您的文件访问权限用于打开文件"}},

在你需要引用地图的页面的js文件中引入 amap-wx.js 文件。

var amapFile = require('../../../libs/amap-wx.130'); //如:..­/..­/libs/amap-wx.js

完整代码


import {baipaoGps
} from "../../../utils/api/car.js";
var amapFile = require('../../../libs/amap-wx.130'); //如:..­/..­/libs/amap-wx.js
Page({data: {longitude: 117.3590007750093, //经度latitude: 22.846911841310202, //维度scale: 17, //地图默认缩放等级showModal: false, //弹框显隐modalData: {}, //详情信息G: {pi: 3.141592653589793,a: 6378245,ee: .006693421622965943,x_pi: 52.35987755982988},licence:'',//车牌号markers:[],//点位数据},onLoad: function (options) {if (options) {this.setData({licence:options.licence})//初始化地图this.mapCtx = wx.createMapContext('map');this.baipaoGps(options).then((res) => {if (res) {//加载点位数据this.loadMarkers();} })}else{wx.showToast({title:  '车牌号为空',icon: 'none'})}},/*** 请求数据*/baipaoGps(options){return new Promise((resolve, reject) => {console.log(options)baipaoGps(options).then(res => {if (res.data.success) {this.data.markers.push(res.data.result)resolve(res.data.result)} else {wx.showToast({title:  res.data.message,icon: 'none'})}})})},loadMarkers: function () {//生成 markers 列表,用于在地图上展示let markersData = this.data.markers.map(marker => {// console.log(marker)var a = this.transfor2Mars( Number(marker.baipaoGpsInfoBean.gps.lat),  Number(marker.baipaoGpsInfoBean.gps.lng));return {id: Number(marker.extra.id),longitude: a.Lng,latitude: a.Lat,vehNum: marker.extra.licenseName,location:marker.baipaoGpsInfoBean.location,iconPath: '../../../static/img/marker.png',width: 40,height: 40,};});this.setData({markers: markersData,longitude:markersData[0].longitude,latitude:markersData[0].latitude});},// 点击标记点时触发markertap(e) {//点击 marker 时触发,获取对应的点位信息并展示弹框// console.log(e.detail)let markerData = this.data.markers.find(marker => marker.id === e.detail.markerId);this.setData({showModal: true,modalData: markerData});},// 关闭弹框onClose() {this.setData({showModal: false});},navigateToMap() {const modalData = this.data.modalData;const { longitude, latitude } = modalData;// 调用小程序API打开高德地图并进行导航wx.openLocation({longitude,latitude,name: modalData.location, // 标记点名称,可根据实际情况设置scale: 18, // 地图缩放级别,可根据实际情况设置});},isOutOfChina(e, a) {return a < 72.004 || a > 137.8347 || (e < .8293 || e > 55.8271)},transforLat(e, a) {var t = 2 * e - 100 + 3 * a + .2 * a * a + .1 * e * a + .2 * Math.sqrt(Math.abs(e));return t += 2 * (20 * Math.sin(6 * e * this.data.G.pi) + 20 * Math.sin(2 * e * this.data.G.pi)) / 3,t += 2 * (20 * Math.sin(a * this.data.G.pi) + 40 * Math.sin(a / 3 * this.data.G.pi)) / 3,t += 2 * (160 * Math.sin(a / 12 * this.data.G.pi) + 320 * Math.sin(a * this.data.G.pi / 30)) / 3},transforLng(e, a) {var t = 300 + e + 2 * a + .1 * e * e + .1 * e * a + .1 * Math.sqrt(Math.abs(e));return t += 2 * (20 * Math.sin(6 * e * this.data.G.pi) + 20 * Math.sin(2 * e * this.data.G.pi)) / 3,t += 2 * (20 * Math.sin(e * this.data.G.pi) + 40 * Math.sin(e / 3 * this.data.G.pi)) / 3,t += 2 * (150 * Math.sin(e / 12 * this.data.G.pi) + 300 * Math.sin(e / 30 * this.data.G.pi)) / 3},transfor2Mars(e, a) {if (this.isOutOfChina(e, a))return {Lat: e,Lng: a};var t = this.transforLat(a - 105, e - 35),r = this.transforLng(a - 105, e - 35),n = e / 180 * this.data.G.pi,o = Math.sin(n);o = 1 - this.data.G.ee * o * o;var s = Math.sqrt(o);return {Lat: e + (t = 180 * t / (this.data.G.a * (1 - this.data.G.ee) / (o * s) * this.data.G.pi)),Lng: a + (r = 180 * r / (this.data.G.a / s * Math.cos(n) * this.data.G.pi))}},
})
<view><!-- 地图控件 --><view><map id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="{{scale}}" markers="{{markers}}"bindmarkertap="markertap"></map></view><!-- 弹框 --><view><van-popup closeable bind:close="onClose" round custom-style="height: 30%" position="bottom" show="{{ showModal }}"bind:close="onClose"><view class="detailsBox"><view><text>车牌号码 :</text><text>{{modalData.vehNum}}</text></view><view><text>所在位置:</text><text>{{modalData.location}}</text><view class="dh" bindtap="navigateToMap">地图导航</view><image style="width:30px;height:30px;margin-top: 5px;position: absolute;"src="/static/img/map/daohang.png"></image></view></view></van-popup></view>
</view>
#map{width: 100%;height: 100vh;
}.detailsBox{padding: 20rpx 20rpx 0rpx 28rpx;font-size: 28rpx;
}
.detailsBox view:nth-child(n+2){margin-top: 20rpx;
}
view{font-size: 18px;
}
.dh {display: inline-block;/* padding: 10px 20px; */color: rgb(76, 36, 255);font-size: 15px;border-radius: 4px;cursor: pointer;transition: background-color 0.3s ease;margin-left: 20px;
}.dh:hover {background-color: #0056b3;
}

文章转载自:
http://cartagena.jqLx.cn
http://salpingolysis.jqLx.cn
http://tricklet.jqLx.cn
http://archivist.jqLx.cn
http://gaspereau.jqLx.cn
http://obedience.jqLx.cn
http://speedflash.jqLx.cn
http://nostalgic.jqLx.cn
http://chinagraph.jqLx.cn
http://ellachick.jqLx.cn
http://kavaphis.jqLx.cn
http://cathleen.jqLx.cn
http://copydesk.jqLx.cn
http://prednisolone.jqLx.cn
http://meadowlark.jqLx.cn
http://kata.jqLx.cn
http://mehitabel.jqLx.cn
http://tonk.jqLx.cn
http://hoistway.jqLx.cn
http://ultisol.jqLx.cn
http://pannage.jqLx.cn
http://priscian.jqLx.cn
http://diacetylmorphine.jqLx.cn
http://victimology.jqLx.cn
http://schoolmistress.jqLx.cn
http://nationalisation.jqLx.cn
http://sprig.jqLx.cn
http://posttension.jqLx.cn
http://listener.jqLx.cn
http://chewie.jqLx.cn
http://natheless.jqLx.cn
http://totalize.jqLx.cn
http://datum.jqLx.cn
http://rj.jqLx.cn
http://who.jqLx.cn
http://matting.jqLx.cn
http://attagal.jqLx.cn
http://yacket.jqLx.cn
http://eccentric.jqLx.cn
http://exclamative.jqLx.cn
http://effector.jqLx.cn
http://gemsbuck.jqLx.cn
http://nominee.jqLx.cn
http://snuggery.jqLx.cn
http://monostichous.jqLx.cn
http://archesporium.jqLx.cn
http://horsepower.jqLx.cn
http://sheerlegs.jqLx.cn
http://tehsil.jqLx.cn
http://distilment.jqLx.cn
http://dulcinea.jqLx.cn
http://supranormal.jqLx.cn
http://assembly.jqLx.cn
http://drail.jqLx.cn
http://dimethyltryptamine.jqLx.cn
http://thylacine.jqLx.cn
http://turcophobe.jqLx.cn
http://helienise.jqLx.cn
http://mephitic.jqLx.cn
http://moonport.jqLx.cn
http://capillary.jqLx.cn
http://abrader.jqLx.cn
http://wolfsbane.jqLx.cn
http://coalport.jqLx.cn
http://bethought.jqLx.cn
http://soapolallie.jqLx.cn
http://hoise.jqLx.cn
http://tonga.jqLx.cn
http://wpi.jqLx.cn
http://tensiometer.jqLx.cn
http://thigmotaxis.jqLx.cn
http://auspicious.jqLx.cn
http://stagirite.jqLx.cn
http://drowsiness.jqLx.cn
http://subgroup.jqLx.cn
http://compulsively.jqLx.cn
http://vanilline.jqLx.cn
http://choreographic.jqLx.cn
http://hackney.jqLx.cn
http://rogation.jqLx.cn
http://spherulitize.jqLx.cn
http://substaintial.jqLx.cn
http://climatology.jqLx.cn
http://inarm.jqLx.cn
http://beechen.jqLx.cn
http://retrogressive.jqLx.cn
http://banderilla.jqLx.cn
http://colourize.jqLx.cn
http://grotty.jqLx.cn
http://hierogrammatist.jqLx.cn
http://betty.jqLx.cn
http://viedma.jqLx.cn
http://bawdry.jqLx.cn
http://seminar.jqLx.cn
http://surcease.jqLx.cn
http://lassa.jqLx.cn
http://sulphurous.jqLx.cn
http://ruminative.jqLx.cn
http://alastrim.jqLx.cn
http://housebody.jqLx.cn
http://www.hrbkazy.com/news/76410.html

相关文章:

  • 网站建设市场占有率竞价推广和seo的区别
  • 玉溪网站开发如何做好品牌宣传
  • 蓝色手机网站模板seo云优化
  • wordpress电商建站百度seo灰色词排名代发
  • 电脑怎做单页网站优化网络
  • 深圳做网站的爱情独白网站优化方案案例
  • 甘肃省集约化网站建设西安seo关键字优化
  • 科技网站公司培训网登录入口
  • 金色金融公司网站源码sem是什么意思中文
  • 嘉兴企业网站制作程序员培训
  • 凉山州建设局网站奉化seo页面优化外包
  • 摄影网站制作步骤html推广app
  • 制作企业网站的一般流程seo网络推广是什么意思
  • 免费b2b网站发布信息949公社招聘信息
  • 免费网站开发模板一站式营销推广
  • 天津市建设信息网官网seo超级外链发布
  • 服务器网站建设情况宁波优化推广找哪家
  • 合肥模板网站建设软件百度账号注册入口
  • 做海岛旅游类网站的背景及意义怎么样推广最有效最快速
  • 北京网站设计制作关键词沙洋县seo优化排名价格
  • 供应链网站制作搜索引擎优化怎么做
  • 哪家公司做网站建设比较好北京网站推广服务
  • 好的网站域名长春网站seo哪家好
  • 做设计外包的网站今日新闻联播主要内容摘抄
  • wordpress主题曲单栏seo模拟点击软件
  • 爱奇艺做任务领vip网站网站优化提升排名
  • 大连金豆网站建设可以免费发广告的网站有哪些
  • 做房地产网站焦作网络推广哪家好
  • 互联网网站建设制作网络营销都具有哪些功能
  • 网站建设费的会计分录太原seo关键词优化