From 9b2f38e5cb2b0ca233a690dcc19acd61d87a6e1f Mon Sep 17 00:00:00 2001
From: Jerry Yan <792602257@qq.com>
Date: Fri, 20 Jun 2025 16:59:15 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E4=B8=80=E4=B8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/const/more.vue | 12 ++----
pages/index/index.vue | 6 ++-
pages/tutorial/tutorial.vue | 38 ++++++++++++++++++
pages/user-share/user-share.vue | 12 +++++-
pages/user/index.vue | 4 +-
pages/user/info.vue | 2 +-
pages/user/login.vue | 68 ++++++++++++++++++++++++++-------
7 files changed, 115 insertions(+), 27 deletions(-)
diff --git a/pages/const/more.vue b/pages/const/more.vue
index 2fab532..97a9b24 100644
--- a/pages/const/more.vue
+++ b/pages/const/more.vue
@@ -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()
},
}
}
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 87267b2..42d0a9c 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -13,7 +13,7 @@
随手拍
-
+
积分商城
@@ -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();
diff --git a/pages/tutorial/tutorial.vue b/pages/tutorial/tutorial.vue
index 7372792..a4cc2bc 100644
--- a/pages/tutorial/tutorial.vue
+++ b/pages/tutorial/tutorial.vue
@@ -1,6 +1,14 @@
+
+
+ {{item.name}}
+
+
@@ -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;
diff --git a/pages/user-share/user-share.vue b/pages/user-share/user-share.vue
index 5c8713e..0819102 100644
--- a/pages/user-share/user-share.vue
+++ b/pages/user-share/user-share.vue
@@ -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;
},
diff --git a/pages/user/index.vue b/pages/user/index.vue
index 66d567f..9d0806e 100644
--- a/pages/user/index.vue
+++ b/pages/user/index.vue
@@ -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: {
diff --git a/pages/user/info.vue b/pages/user/info.vue
index 2308a3c..a31989f 100644
--- a/pages/user/info.vue
+++ b/pages/user/info.vue
@@ -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
diff --git a/pages/user/login.vue b/pages/user/login.vue
index 649ea8c..cb960a6 100644
--- a/pages/user/login.vue
+++ b/pages/user/login.vue
@@ -1,14 +1,10 @@
-
- 登录
-
-
-
+
- 微信授权
+ 微信授权登录
@@ -17,14 +13,12 @@
-
-
+
@@ -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)
@@ -98,4 +100,44 @@
}
},
}
-
\ No newline at end of file
+
+
\ No newline at end of file