🐞 fix:优化分享图片,修复我的页面无法触发用户信息授权弹窗
This commit is contained in:
+5
-23
@@ -44,12 +44,7 @@ export const throttle = (fn, delay) => {
|
||||
export const getFilterData = (val = {}, arr: string[] = []) => {
|
||||
let res = {}
|
||||
for (let key in val) {
|
||||
if (
|
||||
val[key] !== undefined &&
|
||||
val[key] !== null &&
|
||||
val[key] !== '' &&
|
||||
!arr.includes(key)
|
||||
) {
|
||||
if (val[key] !== undefined && val[key] !== null && val[key] !== '' && !arr.includes(key)) {
|
||||
if (typeof val[key] == 'number') {
|
||||
if (!isNaN(val[key])) {
|
||||
res[key] = val[key]
|
||||
@@ -100,15 +95,7 @@ export const screenshot = (url, suffix = '!w200') => {
|
||||
}
|
||||
|
||||
//获取数据加载状态 //0:数据从无到有加载数据,1,没有任何数据, 2:下拉加载,3:下拉没有数据
|
||||
export const dataLoadingStatus = ({
|
||||
list = [],
|
||||
total = 0,
|
||||
status = false,
|
||||
}: {
|
||||
list: any[]
|
||||
total: number
|
||||
status: true | false
|
||||
}) => {
|
||||
export const dataLoadingStatus = ({ list = [], total = 0, status = false }: { list: any[]; total: number; status: true | false }) => {
|
||||
if (list.length == 0 && status) {
|
||||
return 0
|
||||
} else if (list.length == 0 && !status) {
|
||||
@@ -132,25 +119,20 @@ export const shareShop = () => {
|
||||
let path = ''
|
||||
let title = ''
|
||||
let imageUrl = ''
|
||||
let sortCode = Taro.getStorageSync('sort_code')
|
||||
? JSON.parse(Taro.getStorageSync('sort_code'))
|
||||
: ''
|
||||
let sortCode = Taro.getStorageSync('sort_code') ? JSON.parse(Taro.getStorageSync('sort_code')) : ''
|
||||
let pageInfo: any = page
|
||||
//商品详情分享
|
||||
if (pageInfo.route === 'pages/details/index') {
|
||||
path = `/pages/details/index?share=${sortCode.shareShortDetail.code}`
|
||||
title = sortCode.shareShortDetail.title
|
||||
imageUrl = sortCode.shareShortDetail.img
|
||||
imageUrl = formatImgUrl(sortCode.shareShortDetail.img, '!w600')
|
||||
} else {
|
||||
path =
|
||||
pageInfo.route === 'pages/user/index'
|
||||
? `/pages/user/index?share=${sortCode.shareShortPage.code}`
|
||||
: `/pages/index/index?share=${sortCode.shareShortPage.code}`
|
||||
title = sortCode.shareShortPage.title
|
||||
imageUrl =
|
||||
pageInfo.route === 'pages/user/index'
|
||||
? sortCode.shareShortPage.img
|
||||
: formatImgUrl('/mall/share_img_02.png')
|
||||
imageUrl = pageInfo.route === 'pages/user/index' ? formatImgUrl(sortCode.shareShortPage.img, '!w600') : formatImgUrl('/mall/share_img_02.png', '!w600')
|
||||
}
|
||||
return {
|
||||
title,
|
||||
|
||||
Reference in New Issue
Block a user