- NPM构建为啥会多出一级目录?
[图片][图片]
07-26 - cover-view设置display:inline-block,真机部分文字消
如题,问题截图如下, 代码截图: [图片] 开发工具没有问题,开发工具截图: [图片] 手机客户端截图:[图片]
2019-07-22 - cover-view设置position: sticky真机下无效
问题如题,图一为开发者工具,图二为真机(已测试安卓,ios均无效) 图一: [图片] 图二: [图片]
2019-04-25 - image的mode默认是widthFix,可以设置成其他的mode属性吗?
如题
2019-03-25 - 小程序可用性和完整性不符合规则
问题如图 [图片] 描述: 路径:/pages/center/center 前后端代码检查过,只有一个地方可能出现登录失败的提示,如下两张图,经过多次测试也一直无法重现这个问题!!!再不过明年就不用去上班了!!!爷爷快来救救葫芦娃吧!!! [图片][图片]
2019-02-01 - 小程序意外退出,请稍后重试
问题:如题 一个选择学校的页面,注册时和修改资料会跳转到这,部分用户出现“小程序意外退出,请稍后重试”的情况。 代码 wxml <!--chooseSchool.wxml--> <wxs src="../../common.wxs" module="common"></wxs> <view class='container'> <view class='error-tip' hidden='{{!errorText}}'>{{errorText}}</view> <!--顶部下拉框tab --> <view class="ets-slide-tab flex-wrap"> <view class="tab-item {{nowSlideType==='province'?'active':''}}" bindtap="toggleSlideCon" data-type="province"> <text>{{provinceData[provinceId]?provinceData[provinceId]:'选择省份'}}</text> <view class="icon"></view> </view> <view class="tab-item {{nowSlideType==='city'?'active':''}}" bindtap="toggleSlideCon" data-type="city"> <text>{{cityData[cityId]?cityData[cityId]:'选择市区'}}</text> <view class="icon"></view> </view> <view class="tab-item {{nowSlideType==='area'?'active':''}}" bindtap="toggleSlideCon" data-type="area"> <text>{{areasData[areaId]?areasData[areaId]:'选择地区'}}</text> <view class="icon"></view> </view> </view> <view class="h100per" wx:if="{{areaId}}"> <!--搜索框 --> <view class='search-con'> <view class='float-left search-icon'></view> <input type='text' value='{{searchKeyWord}}' placeholder='请输入关键字搜索' placeholder-class='placeholder' bindinput='changeSearchKeyWord'></input> </view> <!--学校选择区 --> <scroll-view scroll-y class='school-con'> <view class="set-items"> <view class='item' hover-class='hover' wx:for="{{schoolData}}" wx:if="{{item.type===high_school}}" wx:key="{{index}}" hidden='{{common.schoolKeyFilter(item.name, searchKeyWord)}}' data-index="{{index}}" data-type="{{item.type}}" catchtap='chooseSchool'> <view class="float-left {{schoolId==index?'color-lightblue':''}}">{{item.name}}</view> <view class='float-right no-mr' hidden='{{schoolId!=index}}'> <view class="set-item-choosed"></view> </view> </view> <view class='item' hover-class='hover' catchtap='goAddSchool'> <view class="float-left color-lightblue">+ 添加学校</view> </view> </view> </scroll-view> </view> <view class="no-task" wx:else> <view class="white-block"> <image src="{{staticBaseUrl+'/images/teacherend/place-choose-area.png'}}" class="auto-img"></image> </view> <view class="center">请选择地区</view> </view> <view class="btn-con fix-bot"> <button id="submit" class="gra-btn" hover-class="btn-hover" catchtap="submitSave" disabled='{{addSchoolName===""&&schoolId===0}}'>{{from==='myinfo'?'保存':'确定'}}</button> </view> <!--省份选择区 --> <view class="ets-slide-con {{nowSlideType==='province'?'active':''}}"> <view class="slide-item {{provinceId===index?'color-lightblue':''}}" hover-class="hover" wx:for="{{provinceData}}" wx:key="{{index}}" data-key="{{index}}" bindtap="chooseSlideItem" data-type="province">{{item}}</view> </view> <!--市选择区 --> <view class="ets-slide-con {{nowSlideType==='city'?'active':''}}"> <view class="slide-item {{cityId===index?'color-lightblue':''}}" hover-class="hover" wx:for="{{cityData}}" wx:key="{{index}}" data-key="{{index}}" bindtap="chooseSlideItem" data-type="city">{{item}}</view> </view> <!--区域选择区 --> <view class="ets-slide-con {{nowSlideType==='area'?'active':''}}"> <view class="slide-item {{areaId===index?'color-lightblue':''}}" hover-class="hover" wx:for="{{areasData}}" wx:key="{{index}}" data-key="{{index}}" bindtap="chooseSlideItem" data-type="area">{{item}}</view> </view> <view class="mask" hidden='{{maskHidden}}' catchtap='hideSlideCon'></view> </view> js // chooseSchool.js var app = getApp(); var BMAP = require('../../utils/bmap-wx.min.js'); Page({ /** * 页面的初始数据 */ data: { nowSlideType: '', provinceId: '', cityId: '', areaId: '', schoolId: 0, maskHidden: true, searchKeyWord: '', addSchoolName: '', errorText: '', staticBaseUrl: app.globalData.staticBaseUrl, cityData: {}, areasData: {} }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { var that = this; var from = options.from; var high_school = Number(options.high_school); wx.showLoading({ title: ' ', mask: true, }) this.setData({ from: from, high_school: high_school }) if (from === 'myinfo' || from == 'myset') { var token = wx.getStorageSync('ets_token'); that.setData({ token: token, }) //调用应用实例的方法获取全局数据 app.getUserInfo(function (userInfo) { var class_province = userInfo.class_province; // 限制修改的省份 var class_city = userInfo.class_city; //限制修改的市区 var school_id = ''; if(from == 'myinfo'){ school_id = userInfo.school_id; high_school = userInfo.high_school; } var param = {}; param.high_school = high_school; param.province_id = userInfo.province_id; param.city_id = userInfo.city_id; param.area_id = userInfo.area_id; param.school_id = school_id; param.school_name = ''; //更新数据 that.setData({ param: param, class_province: class_province, class_city: class_city, high_school: high_school }) that.getArea(function (data) { that.setData({ areaData: data, provinceData: data[1], cityData: data[userInfo.province_id], areasData: data[userInfo.city_id], provinceId: userInfo.province_id, cityId: userInfo.city_id, areaId: userInfo.area_id, schoolId: school_id }) that.getSchool(userInfo.area_id) }); }) }else{ var schoolId = app.globalData.regData ? app.globalData.regData.school_id : ''; var areaId = app.globalData.regData ? app.globalData.regData.area_id : ''; if (areaId){ var provinceId = app.globalData.regData.province_id; var cityId = app.globalData.regData.city_id; that.getArea(function (data) { that.setData({ areaData: data, provinceData: data[1], cityData: data[provinceId], areasData: data[cityId], provinceId: provinceId, cityId: cityId, areaId: areaId, schoolId: schoolId }) that.getSchool(areaId) }); }else{ var Bmap = new BMAP.BMapWX({ ak: '百度地图ak码' }) Bmap.regeocoding({ fail: function (data) { that.getArea(function (data) { that.setData({ areaData: data, provinceData: data[1], }) }); wx.hideLoading() }, success: function (data) { // console.log(data); var province = data.originalData.result.addressComponent.province; var city = data.originalData.result.addressComponent.city; wx.request({ url: app.globalData.ajaxBaseUrl + '/column/area-id-map?area_search_str=' + province + ',' + city, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'GET', dataType: 'json', success: function (res) { var data = res.data; // 获取定位后自动选择地区 that.getArea(function (d) { var p = data.data.province != 0 ? data.data.province : ''; var c = '', a = ''; var cityData = {}, areasData = {}; if (p) { cityData = d[p]; if (data.data.city != 0) { c = data.data.city } else { c = d[p] ? Object.keys(d[p])[0] : '' } } if (c) { a = d[c] ? Object.keys(d[c])[0] : ''; areasData = d[c] } // if (a) { // that.getSchool(a) // } that.setData({ provinceData: d[1], cityData: cityData, areasData: areasData, provinceId: p, cityId: c || '', // areaId: a || '' nowSlideType: 'area', maskHidden: false }) }); }, complete: function () { wx.hideLoading(); } }) }, }) } } }, onShow: function(){ }, // 获取地区 getArea: function (cb) { var that = this; wx.request({ url: app.globalData.ajaxBaseUrl + '/column/areas', data: { token: that.data.token }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'GET', dataType: 'json', success: function (res) { var data = res.data; app.globalData.etsAreaData = data; // console.log(data); cb(data) } }) }, // 获取学校 getSchool: function (id) { var that = this; wx.showLoading() wx.request({ url: app.globalData.ajaxBaseUrl + '/column/schools', data: { area_id: id, token: that.data.token }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'GET', dataType: 'json', success: function (res) { var data = res.data; // console.log(data); that.setData({ schoolData: data }) }, complete: function(){ wx.hideLoading() } }) }, // 下拉框选择 toggleSlideCon: function (event) { var _type = event.currentTarget.dataset.type; var maskHidden = false; if (_type == 'area' && !this.data.cityId) { wx.showToast({ title: '请先选择市区', icon: 'none', duration: 2000, mask: true, }) return } if (_type === this.data.nowSlideType) { _type = ''; maskHidden = true; } this.setData({ nowSlideType: _type, maskHidden: maskHidden }) }, hideSlideCon: function () { this.setData({ nowSlideType: '', maskHidden: true }) }, // 选择省、市、区 chooseSlideItem: function (event) { var _type = event.currentTarget.dataset.type; var key = event.currentTarget.dataset.key; var from = this.data.from; var that = this; var areaData = app.globalData.etsAreaData; if (from == 'myinfo') { var param = that.data.param; param.school_id = 0; param.school_name = ''; } if (_type === 'province') { if (from == 'myinfo') { param.province_id = key; param.city_id = ''; param.area_id = ''; } that.setData({ provinceId: key, cityId: '', areaId: '', cityData: areaData[key], areasData: [] }) } else if (_type === 'city') { if (from == 'myinfo') { param.city_id = key; param.area_id = ''; } that.setData({ cityId: key, areaId: '', areasData: areaData[key] }) } else if (_type === 'area') { if (from == 'myinfo') { param.area_id = key; } that.setData({ areaId: key, }) this.getSchool(key); } if (from == 'myinfo') { that.setData({ param: param }) } this.setData({ schoolId: 0, }) this.hideSlideCon(); }, // 关键字搜索 changeSearchKeyWord: function (event) { var value = event.detail.value; this.setData({ searchKeyWord: value }) }, // 选择学校 chooseSchool: function (event) { var id = event.currentTarget.dataset.index; var _type = event.currentTarget.dataset.type; this.setData({ schoolId: id, }) }, // 跳转到添加学校 goAddSchool: function () { var provinceId = this.data.provinceId; var cityId = this.data.cityId; var areaId = this.data.areaId; var allArea = app.globalData.etsAreaData; if(allArea[cityId]&&!allArea[cityId][areaId]){ areaId = Object.keys(allArea[cityId])[0] } var from = this.data.from; wx.navigateTo({ url: '/pages/addSchool/addSchool?p_id=' + provinceId + '&c_id=' + cityId + '&a_id=' + areaId + '&from=' + from, }) }, // 跳转到班级选择 submitSave: function () { var from = this.data.from; var param = this.data.param; var high_school = this.data.high_school; var provinceId = this.data.provinceId; var cityId = this.data.cityId; var areaId = this.data.areaId; var schoolData = this.data.schoolData; var schoolId = this.data.schoolId; var schoolName = this.data.addSchoolName; if (from === 'myinfo' || from == 'myset') { if (schoolName) { param.school_name = schoolName; param.school_id = 0; } else { param.school_name = ''; param.school_id = schoolId; } this.sendInfo(param); } else { app.globalData.regData.province_id = provinceId; app.globalData.regData.city_id = cityId; app.globalData.regData.area_id = areaId; app.globalData.regData.school_id = schoolId; app.globalData.regData.school_name = schoolData[schoolId]['name']; wx.navigateBack({ delta: 1, }) } }, // 修改资料request sendInfo: function (obj) { var that = this; var from = this.data.from; obj.token = this.data.token; app.changeUserInfo({ scope: that, prama: obj, success: function(res){ var data = res.data; if (data.code === 0) { app.globalData.myInfoNeedReload = true; app.globalData.myNeedReload = true; var delta = 1; if (from == 'myset'){ delta = 2 } wx.showToast({ title: '修改成功', icon: 'none', duration: 2000, mask: true, success: function(res) { setTimeout(function(){ wx.navigateBack({ delta: delta, }) }, 2000) }, }) } else { var errorText = ''; switch (data.code) { case 70009: case 70010: wx.showModal({ title: '修改学校', // content: '修改学校之前,需要先在班级管理中转让或删除班级。', content: '修改学校之前,需要先在班级管理中删除班级。', showCancel: true, cancelText: '取消', cancelColor: '#1CB0F6', confirmText: '去设置', confirmColor: '#a4aab3', success: function (res) { console.log(res) if (res.confirm) { wx.switchTab({ url: '/pages/class/class', }) } }, fail: function (res) { }, complete: function (res) { }, }) // errorText = '您选择的学校与您不在同个区域'; break default: errorText: data.msg break } if(errorText){ that.setData({ errorText: errorText }) app.hideTip({ scope: that, key: 'errorText', time: 5000, }); } } } }) }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { return app.shareOption }, })
2018-09-30 - 部分用户无法访问web-view
部分用户访问web-view时,地址变了,提示“该地址使用了非标准端口,继续访问将转换成手机预览模式。”,像是被劫持了。 业务域名是: https://teacher.ets100.com 有人碰到过这种情况吗? [图片]
2018-02-05 - 图片上传阿里云OSS问题
用的方案和web一样,从后台获取accessid等参数,然后在上传到oss,可是为什么上传成功后返回的data是空的?web是没问题的。 web上传结果[图片] 小程序上传结果[图片], 上传部分代码如图:[图片]
2017-12-20 - 页面跳转: 参数里面带有问号如何处理?
如题
2017-12-02 - web-view,ios下空白,andriod下正常
[图片] 如题
2017-11-20