个人案例
- U艺站
U艺站
U艺站扫码体验
const cityData = require('./data.js').cityData; Page({ data: { rest: "", lat: "", lng: "", page: 1, pageSize: 15, multiArray: [ [], [], ], // 用于存储省市区数据 multiIndex: [0, 0], // 用于存储选择的省市区的索引 cities: ['北京', '上海', '广州', '深圳'], currentCity: '北京', searchQuery: '', selectedCity: '', selectedTitle: '', oneStoressData: [], noData: false, // 新增字段,用于判断是否显示“暂无数据” showModal: true, // 新增字段,用于显示弹窗 }, onLoad: function () { // 检查本地是否已存储手机号 const phoneNumber = wx.getStorageSync('phoneNumber'); if (phoneNumber) { this.setData({ showModal: false, phoneNumber: phoneNumber }); } if (!this.data.phoneNumber) { this.setData({ showModal: true }); } else { // let data = `title=${this.data.selectedTitle}&city=${this.data.selectedCity}`; // this.storesList(data); } const provinces = cityData.map(item => item.name); const cities = cityData[0].city; this.setData({ multiArray: [provinces, cities] }); // 获取用户位置 this.getUserLocation(); }, getUserLocation: function () { wx.getFuzzyLocation({ type: 'wgs84', isHighAccuracy: true, success: (res) => { console.log(res); const latitude = res.latitude; const longitude = res.longitude; // 调用腾讯位置服务 API 获取城市名称 this.reverseGeocode(latitude, longitude); }, fail: (err) => { console.log('获取位置失败', err); } }); }, reverseGeocode: function (latitude, longitude) { console.log(latitude, longitude); const key = 'kWPKGqN5uO3XxLdSuoFQM0WcCp26WjeE'; // 请替换为你自己的腾讯地图密钥 wx.request({ url: `https://api.map.baidu.com/reverse_geocoding/v3/?ak=${key}&output=json&coordtype=wgs84ll&location=${latitude},${longitude}`, success: (res) => { console.log(res.data.result); const city = res.data.result.addressComponent.city; const lat = res.data.result.location.lat; const lng = res.data.result.location.lng; this.setData({ lat: lat, lng: lng, selectedCity: city }); console.log(city, lat, lng); this.setCitySelection(city); let data = `title=${this.data.selectedTitle}&city=${this.data.selectedCity}`; this.storesList(data); }, fail: (err) => { console.log('逆地址解析失败', err); } }); }, setCitySelection: function (city) { let provinceIndex = 0; let cityIndex = 0; for (let i = 0; i < cityData.length; i++) { const cities = cityData[i].city; for (let j = 0; j < cities.length; j++) { if (cities[j].indexOf(city) !== -1) { provinceIndex = i; cityIndex = j; break; } } if (cityIndex !== 0) break; } this.setData({ multiArray: [ cityData.map(item => item.name), cityData[provinceIndex].city ], multiIndex: [provinceIndex, cityIndex] }); }, bindMultiPickerChange: function (e) { this.setData({ multiIndex: e.detail.value }); const selectedProvince = this.data.multiArray[0][this.data.multiIndex[0]]; const selectedCity = this.data.multiArray[1][this.data.multiIndex[1]]; this.setData({ selectedCity: selectedCity }); console.log(`选择的省份: ${selectedProvince}, 选择的城市: ${selectedCity}`); if (selectedCity == "全国") { this.seachAllData(0); } else { this.seachAllData(1); } }, onSearch: function () { this.seachAllData(2); }, seachAllData(type) { let data = ''; if (type === 0) { data = ``; } else if (type === 1) { data = `city=${this.data.selectedCity}`; } else if (type === 2) { data = `title=${this.data.selectedTitle}&city=${this.data.selectedCity}`; } this.setData({ page: 1, oneStoressData: [] }); console.log(data); this.storesList(data, true); }, bindMultiPickerColumnChange: function (e) { const data = { multiArray: this.data.multiArray, multiIndex: this.data.multiIndex }; data.multiIndex[e.detail.column] = e.detail.value; if (e.detail.column === 0) { const cities = cityData[e.detail.value].city; data.multiArray[1] = cities; data.multiIndex[1] = 0; } this.setData(data); }, onReserve: function (e) { const phoneNumber = e.currentTarget.dataset.id; wx.makePhoneCall({ phoneNumber: phoneNumber //仅为示例,并非真实的电话号码 }); }, 我页面已经跳过去了,nerwork请求啥的都有了 就是底下的图标没有亮, 我的js代码 也没有进行tab的其他操作啊 ?
底部tab栏目点击有跳转但没选中颜色,需要二次点击{ "pages": [ "pages/home/home", "pages/stores/stores", "pages/goods/category/index", "pages/cart/index", "pages/usercenter/index", "pages/usercenter/person-info/index", "pages/usercenter/address/list/index", "pages/usercenter/address/edit/index", "pages/goods/details/index", "pages/goods/search/index", "pages/goods/result/index", "pages/order/order-confirm/index", "pages/order/receipt/index", "pages/order/pay-result/index", "pages/order/order-list/index", "pages/order/order-detail/index", "pages/goods/comments/index", "pages/order/apply-service/index", "pages/order/after-service-list/index", "pages/order/after-service-detail/index", "pages/goods/comments/create/index", "pages/coupon/coupon-list/index", "pages/coupon/coupon-detail/index", "pages/coupon/coupon-activity-goods/index", "pages/promotion-detail/index", "pages/order/fill-tracking-no/index", "pages/order/delivery-detail/index", "pages/order/invoice/index", "pages/usercenter/name-edit/index" ], "tabBar": { "custom": true, "color": "#666666", "selectedColor": "#FF5F15", "backgroundColor": "#ffffff", "borderStyle": "black", "list": [ { "pagePath": "pages/home/home", "text": "店家笔记" }, { "pagePath": "pages/goods/category/index", "text": "行业资讯" }, { "pagePath": "pages/stores/stores", "text": "附近门店" }, { "pagePath": "pages/cart/index", "text": "卖家笔记" }, { "pagePath": "pages/usercenter/index", "text": "会员中心" } ] }, "requiredPrivateInfos": [ "getFuzzyLocation" ], "lazyCodeLoading": "requiredComponents", "usingComponents": {}, "window": { "backgroundTextStyle": "light", "navigationBarBackgroundColor": "#fff", "navigationBarTitleText": "Weixin", "navigationBarTextStyle": "black" }, "sitemapLocation": "sitemap.json", "permission": { "scope.userFuzzyLocation": { "desc": "你的位置信息将用于小程序为您推送商家的位置" } } } z这是我的app.json 附近门店这个栏目每次都需要点2次图标才能选中 视频:https://easylink.cc/548iqf
06-27[图片] 我已经开发好了 个人网站直接推送信息到微信或者企业微信都实现了 有偿,白嫖的别来 WX:479292487
用何种方式推送消息到微信账号比较好?问题:我们这里有一款在PC或服务器上运行的本地软件,如果希望推送消息到用户的微信账号,那么是通过什么方式开发比较好?微信小程序吗?还是有其他方式可选?
2021-08-04因为出事的话 第一个找的就是平台 微信不想背锅
我们是一家宠物用品公司,有自己兽医想提供宠物疾病在线咨询的服务为什么非得需要宠物诊疗许可证?我们是一家宠物用品公司,有自己兽医想提供宠物疾病在线咨询的服务为什么非得需要宠物诊疗许可证,我们不是诊所非得开一家诊所才能在线上提供相关服务吗?这样的设置是否合理啊
2020-07-22