getuserProfile接口昨天开始弃用了。
小程序微信授权登录问题,手机模拟不显示头像昵称?在电脑端可以正常添加头像和昵称到云数据库,在手机端授权操作的却不行,添加的结果是“微信用户“和“一个灰色头像“
2022-11-09看起来是子组件向父组件传值的问题。 1.父组件里写弹窗的函数,比如说 showModal() 2.子组件里调用 this.props.showModal(data),把数据传过去。
点击组件内部的按钮可以在页面中跳出弹窗吗?地址管理页面,引用了 地址列表组件。 现在需要点击组件中的按钮,在页面中跳出弹窗继续操作。需要实现的效果如图: [图片] 目前,把popup的相关代码放在组件中,可以实现其效果及功能,但弹窗出现在组件的框架范围内,而不是出现在页面中。(代码在下面) [图片][图片] 如果把popup代码写在页面中,点击组件时不会跳出弹窗,组件中的点击操作没有传到页面中,这里的操作可以怎么做吗?组件内的数据传到页面中可以怎么写代码呢? 列表组件代码(AddressItem): import React, { memo, useCallback, useEffect, useMemo, useState } from 'react'; import PropTypes from 'prop-types'; import { View, Text, Image, navigateTo, } from 'remax/wechat'; import request from '@/utils/request' import { clearSearchBase64Url } from '@/actions/common' import { connect } from 'react-redux'; import * as utils from '@/utils/common'; import useSysInfo from '../../hooks/sysInfo' import { Popup } from 'annar'; import styles from './index.css'; import classnames from 'classnames'; const AddressItem = memo(function (props) { const { delCb, } = props; const { id, user_id, phone, name, area, address, is_default } = props; const [isShowModal, setIsShowModal] = useState(false); const [ShowModal, setShowModal] = useState(false); const sysInfo = useSysInfo(); const defaults = parseInt(is_default) const getdelUserAddress = useCallback(() => { return request({ url: '/delUserAddress', method: 'post', data: { id: id }, success: function () { delCb(id) wx.showToast({ title: '删除成功', icon: 'success' }) } }) }) return ( <View className={styles.have}> <View className={styles.addchoose}> <Text>{name}</Text><Text>{phone}</Text> { (defaults) ? <View className={styles.default}>默认</View> : null } <View className={styles.details}>{area}{address}</View> <Image src='http://dxshy.duxieshe.com/uploads/applet_img/more.png' onTap={() => { setIsShowModal(true) }} /> </View> <Popup position="bottom" open={isShowModal} onClose={() => { setIsShowModal(false) }}> <View style={{ paddingBottom: sysInfo.safeBottomHeight + 'PX' }}> <View className={styles.background}> <View className={styles.operate} style={{ "color": "#000000" }} onTap={() => { navigateTo({ url: '/packagePagesE/address/editadr/index?userId=' + id }) setIsShowModal(false) }} >编辑</View> <View className={styles.smaline}></View> <View className={styles.operate} style={{ "color": "#FF0000" }} onTap={() => { setShowModal(true) setIsShowModal(false) }} >删除</View> <View className={styles.larline}></View> <View className={styles.operate} style={{ "color": "#000000" }} onTap={() => { setIsShowModal(false) }}>取消</View> </View> </View> </Popup> <Popup open={ShowModal} onClose={() => { setShowModal(false) }}> <View className={styles.Modal}> <View className={styles.wxts}>温馨提示</View> <Text>删除后数据不可恢复,</Text> <Text>确定要删除吗?</Text> <View className={styles.btn}> <View className={styles.left} onTap={() => { setShowModal(false) }}>取消</View> <View className={styles.right} onTap={() => { setShowModal(false) getdelUserAddress() }}>确认删除</View> </View> </View> </Popup> </View> ) }) AddressItem.propTypes = { id: PropTypes.string.isRequired, user_id: PropTypes.string.isRequired, phone: PropTypes.string.isRequired, name: PropTypes.string.isRequired, area: PropTypes.string.isRequired, address: PropTypes.string.isRequired, is_default: PropTypes.string.isRequired } AddressItem.defaultProps = { address: '' } const mapStateToProps = (state) => { const { userInfo } = state.common return { userInfo } } const mapDispatchToProps = (dispatch) => { return { clearSearchBase64Url: () => { dispatch(clearSearchBase64Url()) } } } export default connect(mapStateToProps, mapDispatchToProps)(AddressItem); 地址管理主页代码(address.js): import React, { useEffect, memo, useState, useCallback, useMemo } from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import { View, Text, Image, ScrollView, setClipboardData, navigateTo, showLoading, hideLoading, } from 'remax/wechat'; import { connect } from 'react-redux'; import { Popup } from 'annar'; import Nav from '@/components/nav'; import Tabbar from '@/components/tabbar'; import request from '@/utils/request'; import useSysInfo from '../../../hooks/sysInfo' import useBackEvent from '@/hooks/navEvent' import AddressItem from '@/components/addressItem'; import styles from './index.css'; import { getSysConf } from '../../../actions/common'; import { setList, setCollectStatus } from '../../../actions/dynamic' const Address = function (props) { const { currentTab } = props; const [refreshTriggered, setRefreshTriggered] = useState(false); const [isLoading, setIsLoading] = useState(false); const { getSysConf, sysConf, userInfo } = props; const [isShowModal, setIsShowModal] = useState(false); const [ShowModal, setShowModal] = useState(false); const [hasData, setHasData] = useState(true); const [list, setList] = useState(); const [page, setPage] = useState(1); const sysInfo = useSysInfo(); useEffect(() => { getSysConf() }, []) const { homeAction, backAction } = useBackEvent(currentTab); // const Cancel = () => { // setShowModal(false) // wx.showToast({ // title: '删除成功', // icon: 'success' // }) // } const loadList = useCallback((passPage) => { return request({ url: '/getUserAddressList', method: 'get', data: { page: passPage ? passPage : page, limit: 10 } }) }, [page]) const init = useCallback(async () => { if (isLoading) return; const page = 1; setPage(page); setHasData(true); setIsLoading(true); const list = await loadList(page); setIsLoading(false); setPage(prevPage => prevPage + 1); setList(list); setRefreshTriggered(false) if (list.length < 10) { setHasData(false); } console.log('list', list); }, [isLoading, page]); const loadMore = useCallback(() => { if (isLoading) return; if (hasData) { setIsLoading(true) loadList().then(moreData => { setList(preList => preList.concat(moreData)) setPage(prev => prev + 1); setIsLoading(false) }) } /* else { wx.showToast({ title: '没有更多了~', icon: 'none' }) } */ }, [page, hasData, isLoading]) useEffect(() => { init(); }, []) useEffect(() => { if (isLoading) { showLoading({ title: '加载中', mask: true }) } else { hideLoading() } }, [isLoading]) return ( sysConf && <View className={styles.personal} style={{ height: sysInfo.safeArea.bottom + 'PX' }}> <Nav title="地址管理" goIndex={homeAction} onBack={backAction} showLeftFunc={true} /> <View className={styles.main}> <View className={styles.add} onTap={() => { navigateTo({ url: '/packagePagesE/address/addadr/index' }) }}> <Image src='http://dxshy.duxieshe.com/uploads/applet_img/add_green.png' /> <Text>添加收货地址</Text> </View> { (list && list.length > 0) ? <ScrollView className={styles.list} scrollY refresherEnabled refresherTriggered={refreshTriggered} lowerThreshold={60} bindscrolltolower={loadMore} bindrefresherrefresh={() => { setRefreshTriggered(true) init(); }}> <View className={styles.have}> <View className={styles.txt}>轻触以选择地址</View> { list.map((v, i) => { return ( <AddressItem key={i} {...v} /> ) }) } </View> </ScrollView> : Array.isArray(list) ? <View className={styles.none}> <Image src='http://dxshy.duxieshe.com/uploads/applet_img/none_02.png' /> <Text>暂无收货地址~</Text> </View> : null } </View> //弹窗 {/* <Popup position="bottom" open={isShowModal} onClose={() => { setIsShowModal(false) }} > <View style={{ paddingBottom: sysInfo.safeBottomHeight + 'PX' }}> <View className={styles.background}> <View className={styles.operate} style={{ "color": "#000000" }} onTap={() => { navigateTo({ url: '/packagePagesE/address/editadr/index' }) setIsShowModal(false) }} >编辑</View> <View className={styles.smaline}></View> <View className={styles.operate} style={{ "color": "#FF0000" }} onTap={() => { setShowModal(true) setIsShowModal(false) }} >删除</View> <View className={styles.larline}></View> <View className={styles.operate} style={{ "color": "#000000" }} onTap={() => { setIsShowModal(false) }}>取消</View> </View> </View> </Popup> <Popup open={ShowModal} onClose={() => { setShowModal(false) }}> <View className={styles.Modal}> <View className={styles.wxts}>温馨提示</View> <Text>删除后数据不可恢复,</Text> <Text>确定要删除吗?</Text> <View className={styles.btn}> <View className={styles.left} onTap={() => { setShowModal(false) }}>取消</View> <View className={styles.right} onTap={() => { Cancel() }}>确认删除</View> </View> </View> </Popup> */} </View > ) } const mapStateToProps = (state) => { const { sysConf, userInfo } = state.common; return { sysConf, userInfo } } const mapDispatchToProps = (dispatch) => { return { getSysConf: (conf) => { dispatch(getSysConf(conf)) } } } export default connect(mapStateToProps, mapDispatchToProps)(Address)
2022-11-09跳回来不会有提示。
从A小程序跳转到B会提示“即将跳转xxx小程序”,从B跳转回A小程序为什么不会询问?从A小程序跳转到B会提示“即将跳转xxx小程序”,从B跳转回A小程序为什么不会询问?
2022-11-09thing7超了? [图片]
同一个模板消息,昨天可以今天不行?47001, errmsg=data format erro{"data":{"name3":{"value":"刘啦啦"},"thing7":{"value":"哥哥哥哥哥哥哥哥哥哥哥哈哈"},"date5":{"value":"2022-11-07 18:29:04"},"phrase6":{"value":"心理咨询"},"name1":{"value":"吴彦祖"}},"lang":"zh_CN","miniprogram_state":"trial","page":"pages/index/index","template_id":"template_id","touser":"touser"} 这个是成功参数, {"data":{"name3":{"value":"回测医"},"thing7":{"value":"11111111111111111111..."},"date5":{"value":"2022-11-08 13:33:44"},"phrase6":{"value":"快速问诊"},"name1":{"value":"很不很不开心"}},"lang":"zh_CN","miniprogram_state":"trial","page":"pages/index/index","template_id":"template_id","touser":"touser"} 这个是错误参数 47001, errmsg=data format erro 麻烦各位大佬解答一下
2022-11-08地理位置相关的,一共就那几个。对照一下: https://developers.weixin.qq.com/community/develop/doc/000a02f2c5026891650e7f40351c01
接口未配置在app.json文件中?[图片] manifest.json 如下: { "name" : "sfunk", "appid" : "__UNI__DA8820F", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { "usingComponents" : true, "nvueStyleCompiler" : "uni-app", "compilerVersion" : 3, "splashscreen" : { "alwaysShowBeforeRender" : true, "waiting" : true, "autoclose" : true, "delay" : 0 }, /* 模块配置 */ "modules" : {}, /* 应用发布信息 */ "distribute" : { /* android打包配置 */ "android" : { "permissions" : [ "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.READ_LOGS\"/>", "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CAMERA\"/>", "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" ] }, /* ios打包配置 */ "ios" : {}, /* SDK配置 */ "sdkConfigs" : {} } }, /* 快应用特有相关 */ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { "appid" : "wx46dc81e93e1711c3", "setting" : { "urlCheck" : false, "postcss" : true, "minified" : true }, "usingComponents" : true }, "mp-alipay" : { "usingComponents" : true }, "mp-baidu" : { "usingComponents" : true }, "mp-toutiao" : { "usingComponents" : true }, "uniStatistics" : { "enable" : false }, "vueVersion" : "2" }
2022-11-08扫码直接填充,可以用view嘛。
小程序的input框, 怎样才能不弹出键盘? 谢谢.需求是小程序input框,聚焦的时候,不想弹出软键盘。因为外接了扫码枪, 扫码枪可以将商品条码数据, 填充到input框中。
2022-11-08request请求头加Authotization,服务器验证不行吗?服务器验证通过再返给你image url
请问怎么在image组件里添加header头?服务器传过来的图片要求身份认证才能读取,image里面可以添加header吗?或者有没有类似的方法可以验证header里面的'AUTHORIZATION'呢?
2022-11-07刷新一下 重新选择不行吗
“工单完成提醒” 消息模板先选最下面的字段后无法继续选择[图片][图片]
2022-11-07用模版字符串 `url: /pages/xq/xq?id=${item.id}`
wx.navigateTo在js中如何动态传递参数?for循环展示出绑定bindtap点击事件,调用wx.navigateTo跳转到其他页面,但是在JS中无法使用“ {{ }} ”语法进行动态传递参数。 如何才能在JS文件中进行动态传递参数? 望各位大佬指教 [图片]
2022-11-07这个参数是rsa吗? https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/order/requestOrderPayment.html [图片]
wx.requestOrderPayment调起失败?视频号使用wx.requestOrderPayment调起支付后 返回这个报错 请问有遇到过的嘛?[图片]
2022-11-07