You've already forked guangan-mp
修一下
This commit is contained in:
@ -42,19 +42,13 @@
|
||||
})
|
||||
},
|
||||
goAbout() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/const/about"
|
||||
})
|
||||
wx.openSetting()
|
||||
},
|
||||
goLicense() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/const/license"
|
||||
})
|
||||
wx.openPrivacyContract()
|
||||
},
|
||||
goPrivacy() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/const/privacy"
|
||||
})
|
||||
wx.openPrivacyContract()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
<image src="/static/images/icon-photograph.png" alt="随手拍" class="icon-img"></image>
|
||||
<text class="icon-text">随手拍</text>
|
||||
</view>
|
||||
<view class="icon-block" @click="gotoShop">
|
||||
<view class="icon-block" @click="gotoShop" v-if="shopEnable">
|
||||
<image src="/static/images/icon-store.png" alt="" class="icon-img"></image>
|
||||
<text class="icon-text">积分商城</text>
|
||||
</view>
|
||||
@ -67,6 +67,7 @@
|
||||
id: '',
|
||||
name: '全部'
|
||||
}],
|
||||
shopEnable: false,
|
||||
tabIndex: 0,
|
||||
newsList: [],
|
||||
curPage: 1,
|
||||
@ -90,6 +91,9 @@
|
||||
this.bannerList.push(item)
|
||||
})
|
||||
})
|
||||
TaAjax.get('/points_mall/api.goods/enable').then((res) => {
|
||||
this.shopEnable = res.data;
|
||||
})
|
||||
},
|
||||
onReady() {
|
||||
this.refreshData();
|
||||
|
@ -1,6 +1,14 @@
|
||||
<template>
|
||||
<view class="flex flex-column" style="width:100vw;height: 100vh;">
|
||||
<i-loading v-if="loading" />
|
||||
<scroll-view scroll-x class="scroll-row" style="height: 90rpx;" :scroll-with-animation="true"
|
||||
:show-scrollbar="false">
|
||||
<view class="scroll-row-item px-3" @click="changeTab(index)" v-for="(item,index) in tabBars"
|
||||
:key="item.id">
|
||||
<text style="line-height: 88rpx;" class="d-block"
|
||||
:class="tabIndex === index ? 'font-weight700 font36 border-bottom border-danger text-danger':'font30'">{{item.name}}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="flex flex-column flex-1">
|
||||
<scroll-view class="flex-1" :scroll-y="true" :refresher-enabled="true"
|
||||
:refresher-triggered="refresh" @refresherrefresh="refreshData" @scrolltolower="loadData">
|
||||
@ -34,6 +42,13 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabIndex: 0,
|
||||
tabBars: [
|
||||
{
|
||||
id: -1,
|
||||
name: "全部",
|
||||
}
|
||||
],
|
||||
newsList: [],
|
||||
curPage: 1,
|
||||
loading: true,
|
||||
@ -41,16 +56,39 @@
|
||||
finish: false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.loadCate();
|
||||
},
|
||||
methods: {
|
||||
changeTab(idx) {
|
||||
this.tabIndex = idx;
|
||||
this.refresh = true;
|
||||
this.loadData()
|
||||
},
|
||||
loadCate() {
|
||||
TaAjax.get('/cms/api.category/index', {
|
||||
pid: 1
|
||||
}).then((result) => {
|
||||
this.tabBars = [
|
||||
{
|
||||
id: -1,
|
||||
name: "全部",
|
||||
},
|
||||
...result.data,
|
||||
]
|
||||
})
|
||||
},
|
||||
loadData() {
|
||||
if (this.refresh) {
|
||||
this.newsList.length = 0;
|
||||
this.curPage = 1;
|
||||
this.finish = false;
|
||||
}
|
||||
if (this.finish) {
|
||||
return;
|
||||
}
|
||||
TaAjax.get('/cms/api.tutorial/index', {
|
||||
cid: this.tabBars[this.tabIndex].id,
|
||||
page: this.curPage
|
||||
}).then((result) => {
|
||||
const data = result.data;
|
||||
|
@ -88,14 +88,22 @@
|
||||
created() {
|
||||
const that = this;
|
||||
const userInfo = TaCache.get('auth.user');
|
||||
if (!userInfo) {
|
||||
uni.navigateTo({
|
||||
if (!userInfo || !userInfo.id) {
|
||||
uni.redirectTo({
|
||||
url: "/pages/user/login"
|
||||
})
|
||||
}
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
success(res) {
|
||||
console.log(res)
|
||||
TaPost('/ticket/api.auth.UserShare/query_address', {
|
||||
lat: res.latitude,
|
||||
lng: res.longitude
|
||||
}).then((result) => {
|
||||
const data = result.data;
|
||||
that.form.ticket_address = data;
|
||||
})
|
||||
that.form.ticket_lat = res.latitude;
|
||||
that.form.ticket_lng = res.longitude;
|
||||
},
|
||||
|
@ -56,9 +56,11 @@
|
||||
},
|
||||
onShow() {
|
||||
const userInfo = TaCache.get('auth.user');
|
||||
if (userInfo) {
|
||||
if (userInfo && userInfo.id) {
|
||||
this.userInfo = userInfo;
|
||||
this.isLogin = true;
|
||||
} else {
|
||||
this.goLogin()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -34,7 +34,7 @@
|
||||
this.userInfo = userInfo;
|
||||
if (!this.userInfo.phone) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/user/bind'
|
||||
url: '/pages/user/bind/bind'
|
||||
})
|
||||
}
|
||||
this.form.nickname = this.userInfo.nickname || this.userInfo.extra.nickName
|
||||
|
@ -1,14 +1,10 @@
|
||||
<template>
|
||||
<view class="login">
|
||||
|
||||
<view class="login-head flex-y">
|
||||
<text class="login-head-h1">登录</text>
|
||||
</view>
|
||||
|
||||
<view class="login-body flex-y">
|
||||
<view class="login-body flex-column">
|
||||
|
||||
<view class="flex-center">
|
||||
<text class="login-body-name">微信授权</text>
|
||||
<text class="login-body-name">微信授权登录</text>
|
||||
</view>
|
||||
|
||||
<view style="margin-top:80rpx;" class="flex-center">
|
||||
@ -17,14 +13,12 @@
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!--
|
||||
<view class="login-foot">
|
||||
<view class='login-foot-agent flex-center'>
|
||||
<checkbox label="1" v-model="agent.value">同意协议</checkbox>
|
||||
<text @click="agent.show = true">《用户隐私协议》</text>
|
||||
<checkbox label="1" :value="agent.value">同意协议</checkbox>
|
||||
<text @click="showAgreement">《用户隐私协议》</text>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
@ -45,13 +39,21 @@
|
||||
},
|
||||
created() {
|
||||
const userInfo = TaCache.get('auth.user')
|
||||
if (userInfo) {
|
||||
if (userInfo && userInfo.id) {
|
||||
uni.navigateBack()
|
||||
}
|
||||
this.doLogin()
|
||||
},
|
||||
methods: {
|
||||
showAgreement() {
|
||||
wx.openPrivacyContract()
|
||||
},
|
||||
// 执行注册登录
|
||||
doLogin() {
|
||||
if (!this.agent.value) {
|
||||
TaToast.toast("请先同意协议")
|
||||
return
|
||||
}
|
||||
TaToast.loading("登录中")
|
||||
this.login().then((data) => {
|
||||
TaCache.set('auth.user', data)
|
||||
@ -99,3 +101,43 @@
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.login {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.login-body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.login-body-name {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.login-foot {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background-color: #FFFFFF;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.login-foot-agent {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.login-foot-agent checkbox {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
</style>
|
Reference in New Issue
Block a user