@@ -1,4 +1,6 @@ | |||
// package_first/pages/upload/index.js | |||
import {getUserInfo} from '../../../utils/getUserInfo.js' | |||
Page({ | |||
/** | |||
@@ -7,6 +9,7 @@ Page({ | |||
data: { | |||
// 列表数据筛选条件 | |||
list: [], | |||
params: {}, | |||
current: "/index/westreamScenery/page", | |||
}, | |||
@@ -40,9 +43,18 @@ Page({ | |||
}, | |||
/* 跳转上报问题页面 */ | |||
uploadBeauty(e) { | |||
wx.navigateTo({ | |||
url: '/package_first/pages/uploadBeauty/index', | |||
}) | |||
const openId = wx.getStorageSync('openId') | |||
if(openId) { | |||
wx.navigateTo({ | |||
url: '/package_first/pages/uploadBeauty/index', | |||
}) | |||
} else { | |||
getUserInfo().then(res=> { | |||
wx.navigateTo({ | |||
url: '/package_first/pages/uploadBeauty/index', | |||
}) | |||
}) | |||
} | |||
}, | |||
/* 跳转至详情页 */ | |||
showDetail(e) { |
@@ -1,7 +1,7 @@ | |||
<!--package_first/pages/upload/index.wxml--> | |||
<view class="beauty_container"> | |||
<!-- 列表 --> | |||
<list id="list" class="beauty_list" url="{{current}}" bind:update-list="updateList" list="{{list}}" bind:reset-list="resetList"> | |||
<list id="list" class="beauty_list" url="{{current}}" bind:update-list="updateList" list="{{list}}" bind:reset-list="resetList" params="{{params}}"> | |||
<view class="beauty_item" data-item="{{item}}" bindtap="showDetail" wx:for="{{list}}" wx:key="index"> | |||
<view class="item_head"> | |||
<image class="user_avatar" src="{{item.headimgurl}}"></image> |
@@ -140,24 +140,27 @@ Page({ | |||
// 进入对应页面 | |||
goPage(e) { | |||
// 判断是否有权限 | |||
let positionParams = wx.getStorageSync('positionParams') | |||
let path = e.currentTarget.dataset.path | |||
let type = e.currentTarget.dataset.type | |||
if(Object.keys(positionParams).length) { | |||
if(type === 'tabbar') { | |||
wx.switchTab({ | |||
url: path, | |||
}) | |||
let title = e.currentTarget.dataset.title | |||
if(title !== '敬请期待') { | |||
// 判断是否有权限 | |||
let positionParams = wx.getStorageSync('positionParams') | |||
let path = e.currentTarget.dataset.path | |||
let type = e.currentTarget.dataset.type | |||
if(Object.keys(positionParams).length) { | |||
if(type === 'tabbar') { | |||
wx.switchTab({ | |||
url: path, | |||
}) | |||
} else { | |||
wx.navigateTo({ | |||
url: path, | |||
}) | |||
} | |||
} else { | |||
wx.navigateTo({ | |||
url: path, | |||
wx.redirectTo({ | |||
url: `/pages/login/login?path=${path}&fromType=${type}`, | |||
}) | |||
} | |||
} else { | |||
wx.redirectTo({ | |||
url: `/pages/login/login?path=${path}&fromType=${type}`, | |||
}) | |||
} | |||
}, | |||
@@ -29,7 +29,7 @@ | |||
<!-- 快捷入口 --> | |||
<view class="fast_enters"> | |||
<view class="enter_item" wx:for="{{entersList}}" data-path="{{item.path}}" data-type="{{item.type}}" wx:key="index" bindtap="goPage"> | |||
<view class="enter_item" wx:for="{{entersList}}" data-path="{{item.path}}" data-title="{{item.title}}" data-type="{{item.type}}" wx:key="index" bindtap="goPage"> | |||
<image class="enter_icon" src="{{item.iconPath}}"></image> | |||
<text class="enter_title">{{item.title}}</text> | |||
</view> |