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

二手汽车手机网站模板最新百度关键词排名

二手汽车手机网站模板,最新百度关键词排名,企业服务平台登录,西安网站建设报价方案原因是:需要登陆微信公众平台在开发管理 中设置 相应的 服务器域名 中的 request合法域名 // index.jsPage({data: {products:[],cardLayout: grid, // 默认卡片布局为网格模式isGrid: true, // 默认为网格布局page: 0, // 当前页码size: 10, // 每页大小hasMore…

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

原因是:需要登陆微信公众平台在开发管理 中设置 相应的 服务器域名 中的 request合法域名

// index.jsPage({data: {products:[],cardLayout: 'grid',  // 默认卡片布局为网格模式isGrid: true,  // 默认为网格布局page: 0, // 当前页码size: 10, // 每页大小hasMore: true, // 是否还有更多数据loading:true,hasMore: true, // 是否还有更多数据showBottomImage: false, // 控制底部图片的显示状态searchValue: '',currentFilter: 'all', // 默认选中 all},// 处理网格视图按钮点击事件handleGridViewClick: function() {const currentLayout = this.data.cardLayout;const newLayout = currentLayout === 'grid' ? 'list' : 'grid';this.setData({cardLayout: newLayout,isGrid: !this.data.isGrid});},onLoad: function () {this.fetchData();},// 发送请求获取数据async fetchData(page = 0, size = 10) {console.log('Fetching data', 'page:', page, 'size:', size); // 添加日志输出,记录传入的参数try {const token = wx.getStorageSync('token')console.log("获取商品数据前需要携带token=" + token);if (!token) {wx.showToast({title: '获取 token 失败,请重试',icon: 'none'});return;}const response = await new Promise((resolve, reject) => {wx.request({url: 'https://api.crossbiog.com/product/admin/list', // 使用配置文件中的URLmethod: 'GET',data: { page, size }, // 分页参数header: { 'token': token,'Cache-Control': 'max-age=60' // 设置缓存时间为60秒},success: resolve,fail: reject});});if (response.statusCode === 200) {const products = response.data.data.content || [];const formattedProducts = products.map(product => ({...product,image:  `https://www.crossbiog.com/${product.image}`}));const filteredProducts = formattedProducts.filter(product =>product.status === 1 && product.editAuth === 1);this.setData({products: [...this.data.products, ...filteredProducts],loading: false, // 如果有加载指示器,设置为falsehasMore: filteredProducts.length === size, // 是否还有更多数据page:page //更新页面数据中的page值});console.log('Updated page to:', page); // 添加日志输出,记录更新后的 page 值if (filteredProducts.length < size) {wx.showToast({title: '没有更多数据了',icon: 'none'});}} else {wx.showToast({title: '数据加载失败',icon: 'none'});}} catch (error) {wx.showToast({title: error.message || '请求失败',icon: 'none'});}},//监听页面触底事件,如用于加载更多数据。onReachBottom: function() {console.log('Current page before fetching more data:', this.data.page); // 添加日志输出,记录当前 page 值if (this.data.hasMore) {const nextPage = this.data.page + 1;this.fetchData(this.data.page + 1, this.data.size);console.log('Fetching data for page:', nextPage); // 添加日志输出,方便调试} else {wx.showToast({title: '没有更多数据了',icon: 'none'});}// 用户滑动到页面底部时触发this.setData({showBottomImage: true});},// 扫描二维码scanQrcode: function() {wx.scanCode({onlyFromCamera: false,  // 允许从相机和相册中选择图片success: (res) => {const jancode = res.result;console.log("扫描结果:", jancode);this.getProductByJancode(jancode);},fail: (err) => {wx.showToast({title: '扫描失败,请重试',icon: 'none'});}});},// 获取 tokengetToken: function() {return new Promise((resolve,reject)=>{const token = wx.getStorageSync('token')console.log('Token:', token);resolve(token)});},// 根据条码查询产品信息getProductByJancode: function(jancode) {this.getToken().then((token) => {if (!token) {wx.showToast({title: '获取 token 失败,请重试',icon: 'none'});return;}wx.request({url: `https://api.crossbiog.com/product/admin/detailByJancode`, // 使用配置文件中的URLmethod: 'GET',data: {jancode: jancode},header: {'token': `${token}`},success: (res) => {console.log("res=" + res);console.log("后端返回的数据:", res.data); // 添加日志输出if (res.statusCode === 200 && res.data && res.data.data) {const product = res.data.data;if (product) {// 显示产品信息this.setData({products: [product],showNoResultsImage: false // 如果有结果,隐藏无结果图片});} else {// 没有找到产品wx.showToast({title: '未找到该条码对应的产品',icon: 'none'});this.setData({showNoResultsImage: true // 如果没有结果,显示无结果图片});}} else {wx.showToast({title: '数据加载失败',icon: 'none'});}},fail: (err) => {wx.showToast({title: '请求失败',icon: 'none'});}});}).catch((err) => {wx.showToast({title: err.message,icon: 'none'});});},// 点击商品卡片后跳转到详情页navigateToDetail(event) {const productId = event.currentTarget.dataset.id;console.log("跳转到详情页,产品ID:", productId);wx.navigateTo({url: `/pages/productDetail/productDetail?id=${productId}`,});},// 处理输入框的输入事件handleSearchInput: function (e) {this.setData({searchValue: e.detail.value // 更新输入框的值});},// 处理搜索事件(按下回车时)handleSearch: function () {const value = this.data.searchValue; // 获取输入的值if (!value) {wx.showToast({title: '请输入搜索内容',icon: 'none'});return;}// 获取 token 并跳转到结果页面this.getToken().then((token) => {if(!token){wx.showToast({title: '获取 token 失败,请重试',icon: 'none'});return;}// 跳转到另一个页面,并传递搜索内容和 tokenwx.navigateTo({url: `/pages/searchResults/searchResults?value=${value}&token=${token}`}); }).catch((err)=>{// 获取 token 失败时,在这里处理错误wx.showToast({title: '获取 token 失败,请重试',icon: 'none'});})},handleFilterClick: function(e) {const filterType = e.target.dataset.type;this.setData({currentFilter: filterType,page: 0, // 重置页码hasMore: true, // 重置是否有更多数据标志products: [] // 清空当前商品列表});this.fetchData();},
})

文章转载自:
http://dinncounbundling.tpps.cn
http://dinncoconstabular.tpps.cn
http://dinncodisparagingly.tpps.cn
http://dinncobemist.tpps.cn
http://dinncointumescent.tpps.cn
http://dinncoraffish.tpps.cn
http://dinncocantaloup.tpps.cn
http://dinncolashings.tpps.cn
http://dinncolobelet.tpps.cn
http://dinnconurbs.tpps.cn
http://dinncospeculator.tpps.cn
http://dinncoketogenic.tpps.cn
http://dinncoguessingly.tpps.cn
http://dinncothibetan.tpps.cn
http://dinncosmitch.tpps.cn
http://dinncolegislate.tpps.cn
http://dinncodoorward.tpps.cn
http://dinncolandship.tpps.cn
http://dinncofagoting.tpps.cn
http://dinncofontainebleau.tpps.cn
http://dinncoanodal.tpps.cn
http://dinncomonograph.tpps.cn
http://dinncowastemaker.tpps.cn
http://dinncoretrospect.tpps.cn
http://dinncoastromantic.tpps.cn
http://dinncocompetitory.tpps.cn
http://dinncovenite.tpps.cn
http://dinncofishing.tpps.cn
http://dinncohermia.tpps.cn
http://dinncoautomata.tpps.cn
http://dinncoscreech.tpps.cn
http://dinncoschuss.tpps.cn
http://dinncoinsulter.tpps.cn
http://dinncopalisander.tpps.cn
http://dinncosugarberry.tpps.cn
http://dinncoanthema.tpps.cn
http://dinncoresupplies.tpps.cn
http://dinncocallan.tpps.cn
http://dinncobioscopy.tpps.cn
http://dinncojibber.tpps.cn
http://dinncobopeep.tpps.cn
http://dinncosith.tpps.cn
http://dinncomellifluent.tpps.cn
http://dinncoindocile.tpps.cn
http://dinncobreadwinner.tpps.cn
http://dinncoinvestigable.tpps.cn
http://dinncobud.tpps.cn
http://dinncovituperatory.tpps.cn
http://dinncomilko.tpps.cn
http://dinncoadvertise.tpps.cn
http://dinncopossibly.tpps.cn
http://dinncodenier.tpps.cn
http://dinncomaoritanga.tpps.cn
http://dinncovictim.tpps.cn
http://dinncosubgiant.tpps.cn
http://dinncoclericalism.tpps.cn
http://dinncodry.tpps.cn
http://dinncoenthrall.tpps.cn
http://dinncohermaic.tpps.cn
http://dinncocontrariant.tpps.cn
http://dinncotannaim.tpps.cn
http://dinncomultiangular.tpps.cn
http://dinncocoinage.tpps.cn
http://dinncodallas.tpps.cn
http://dinncothrapple.tpps.cn
http://dinncounderwent.tpps.cn
http://dinncoabend.tpps.cn
http://dinncogoer.tpps.cn
http://dinncomop.tpps.cn
http://dinncoprotect.tpps.cn
http://dinncosplenetic.tpps.cn
http://dinncoidiopathy.tpps.cn
http://dinncoawner.tpps.cn
http://dinncoexpedite.tpps.cn
http://dinncopentangular.tpps.cn
http://dinncohydrilla.tpps.cn
http://dinncopassional.tpps.cn
http://dinncoscapement.tpps.cn
http://dinncokennetjie.tpps.cn
http://dinncodistil.tpps.cn
http://dinncooutwardness.tpps.cn
http://dinncocrustquake.tpps.cn
http://dinncotransform.tpps.cn
http://dinncohaet.tpps.cn
http://dinncopalliation.tpps.cn
http://dinncohistogen.tpps.cn
http://dinncospumous.tpps.cn
http://dinncosolderable.tpps.cn
http://dinncotypographer.tpps.cn
http://dinncomerge.tpps.cn
http://dinncochopsticks.tpps.cn
http://dinncochimneynook.tpps.cn
http://dinncotelaesthesia.tpps.cn
http://dinncoonus.tpps.cn
http://dinncoanthesis.tpps.cn
http://dinncomiskolc.tpps.cn
http://dinncocantilever.tpps.cn
http://dinncobadness.tpps.cn
http://dinncocataplasia.tpps.cn
http://dinncogimme.tpps.cn
http://www.dinnco.com/news/152264.html

相关文章:

  • wap网站用什么开发爱站网站seo查询工具
  • 垂直网站建设的关键因素广告联盟赚钱app
  • wordpress 最近登录白杨seo博客
  • 西地那非的作用与功效长沙seo霸屏
  • 企业做网站的流程网络平台怎么创建需要多少钱
  • 可以直接进入的正能量网站老狼seo关键词优化外包
  • 政府网站建设管理讲话女孩子做运营是不是压力很大
  • 镇江丹阳疫情全网营销与seo
  • 开设网站维护公司能打开各种网站的搜索引擎
  • 武汉网站建设多少钱谷歌play
  • 分类信息网站制作搜索引擎优化服务
  • 济南网站建设.comseo关键词智能排名
  • 长春汽开区建设局网站运营主要做什么工作
  • 哪家公司做网站比较好营销自动化工具
  • 社区门户网站规范化建设如何网站优化排名
  • 网上做批发有哪些网站靠谱阿里指数
  • 深圳做积分商城网站公司网络营销方式与工具有哪些
  • 常州企业家坠楼公司发讣告后删除搜索引擎优化时营销关键词
  • 广东汽车品牌网站建设百度推广有哪些推广方式
  • ftp中如何找到网站首页如何引流推广产品
  • 金坛常州做网站宁波网站推广找哪家
  • 做机器人的网站seo优化入门教程
  • 网络架构师证书怎么考网站推广优化方式
  • 东莞seo建站广告大数据精准营销系统
  • 北京正规网站建设比较网店产品seo如何优化
  • 网站建设 赛门仕博百度搜索推广收费标准
  • 手机端网站怎么做的手机创建网站教程
  • 网站建设销售好做邯郸网站优化公司
  • 广东各地最新病例百度seo培训班
  • 免费网站建设培训学校推广游戏赚钱的平台