|
@@ -2,7 +2,7 @@
|
|
|
<view class="content">
|
|
|
<view v-if="goldLimit>0" class="info">该类商品需购满{{goldLimit}}乐豆才能下单哦!</view>
|
|
|
<view v-if="goodsList.length">
|
|
|
- <uni-coods :list="goodsList"></uni-coods>
|
|
|
+ <uni-coods :hasLogin="hasLogin" :list="goodsList"></uni-coods>
|
|
|
<view class="loadmore"><u-loadmore @loadmore="loadmore" :status="status" /></view>
|
|
|
</view>
|
|
|
<!-- 购物车 -->
|
|
@@ -14,6 +14,7 @@
|
|
|
import {
|
|
|
getGoodsList
|
|
|
} from '@/api/goods.js'
|
|
|
+ import {checkLogin} from '@/api/login.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -26,6 +27,7 @@
|
|
|
status: 'loadmore',
|
|
|
count: 0,
|
|
|
dragPic: '/static/cart.png', // 购物车图标
|
|
|
+ hasLogin: false
|
|
|
};
|
|
|
},
|
|
|
onLoad(opts) {
|
|
@@ -51,6 +53,12 @@
|
|
|
uni.stopPullDownRefresh()
|
|
|
}, 200)
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ // 是否登录
|
|
|
+ checkLogin().then(res => {
|
|
|
+ this.hasLogin = res.status == 200
|
|
|
+ })
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 查询商品
|
|
|
getGoods(item,index){
|