为什么用touchmove?
小程序自定义弹窗 点击弹窗外部 弹窗就消失了,这个怎么回事小程序自定义弹窗 点击弹窗外部 弹窗就消失了,但是我的需求是不让他消失,我在组件的最外层写了 catchtouchmove="myCatchTouch",但是好像没用,请问这个该怎么办。 代码如下:[图片] [图片]
2019-07-29text-align属性是定义文字的排版模式,和图片没啥关系,图片剧中可以直接在wxss里面写image{display:block;margin: 0 auto}, img会被解析成image标签的
内容包含图片,设置图片居中,小程序端没有效果- 需求的场景描述(希望解决的问题) [图片] 图片居中设置,小程序端图片没有居中 - 希望提供的能力 单独给图片增加居中或者居左居右选项
2019-03-25后端说有时候微信没返回uniod_id,只返回了 {"session_key":"7jJ2nCx8Mq7KaDfaWvsQvg==","openid":"o_osH0bwknfqD-F-U-_sEwHYaS4s"} ,奇怪了,第一次审核过了,后边也没有改这边的逻辑,就改了个文案,一直过不了,有木有处理一下呀! 找到原因了--------------为关注过服务号的无法获取uniod_id。。。
小程序可用性和完整性不符合规则问题如图 [图片] 描述: 路径:/pages/center/center 前后端代码检查过,只有一个地方可能出现登录失败的提示,如下两张图,经过多次测试也一直无法重现这个问题!!!再不过明年就不用去上班了!!!爷爷快来救救葫芦娃吧!!! [图片][图片]
2019-02-01顶
在app.json中使用插件时不允许使用“cloud” wx.cloud- 当前 Bug 的表现(可附上截图) [图片] - 预期表现 VM2471:1 [non-writable] modification of global variable "wx.cloud" is not allowed when using plugins at app.json. - 复现路径 - 提供一个最简复现 Demo
2019-01-02[图片] 好像大部分都是iPhone上出的问题
小程序意外退出,请稍后重试问题:如题 一个选择学校的页面,注册时和修改资料会跳转到这,部分用户出现“小程序意外退出,请稍后重试”的情况。 代码 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以前可以通过navigateBack退出,现在不行了,我也是服了...
退出小程序方法公司内部开发了一款小程序,希望内部人员使用,后台禁用的用户,当他打开小程序时提示,没有权限然后强制该用户退出小程序,目前没有找到退出小程序的方法
2018-05-25