From eb866d675fe6ea50c41a3dd5879fe5f0bb495246 Mon Sep 17 00:00:00 2001
From: huliyong <2783385703@qq.com>
Date: Mon, 2 Sep 2024 23:58:24 +0800
Subject: [PATCH] =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E4=B8=8A=E7=BA=BF=E6=B5=8B?=
=?UTF-8?q?=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/http.js | 3 +-
.../PrivacyAgreementPoup/PrivacyAgreementPoup.vue | 34 ++++++++++++++-----
config.js | 6 ++--
manifest.json | 4 +--
pages/center/center.vue | 36 ++++++++++++++++++--
pages/login/login.vue | 8 ++---
pages/login/wxUserInfo.vue | 6 ++--
pages/payment/payment.vue | 38 +++++++++++++++-------
store/store.js | 5 +++
9 files changed, 104 insertions(+), 36 deletions(-)
diff --git a/api/http.js b/api/http.js
index 8ae3de7..c78d8c6 100644
--- a/api/http.js
+++ b/api/http.js
@@ -25,7 +25,8 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
}
if(res.statusCode == 401 ||
- res.data.message == '操作失败,token非法无效!'){
+ res.data.message == '操作失败,token非法无效!' ||
+ res.data.message == '操作失败,用户不存在!'){
uni.removeStorageSync('token')
console.error('登录过期');
uni.navigateTo({
diff --git a/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue b/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue
index 5195078..3166553 100644
--- a/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue
+++ b/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue
@@ -6,7 +6,7 @@
- 欢迎来到xx加油!我们根据最新的法律法规、监管政策要求,更新了《用户协议》和《隐私政策》,请您认真阅读。
+ 欢迎来到车队佳油!我们根据最新的法律法规、监管政策要求,更新了《用户协议》和《隐私政策》,请您认真阅读。
@@ -14,18 +14,20 @@
- 同意《xx加油隐私政策》
+ 同意《车队佳油隐私政策》
- 以及《用户协议》
+ 以及《用户协议》
-
+
@@ -40,6 +42,20 @@
checkboxValue : false
}
},
+ mounted() {
+ if(wx.getPrivacySetting){
+ wx.getPrivacySetting({
+ success: res => {
+ console.log(res)
+ if (res.needAuthorization) {
+ // 需要弹出隐私协议
+ this.init()
+ }
+ },
+ fail: () => {}
+ })
+ }
+ },
methods: {
//初始化
@@ -74,10 +90,10 @@
// 同意
handleAgreePrivacyAuthorization() {
// 告知平台用户已经同意,参数传同意按钮的id
- this.resolvePrivacyAuthorization({
- buttonId: 'agree-btn',
- event: 'agree'
- })
+ // this.resolvePrivacyAuthorization({
+ // buttonId: 'agree-btn',
+ // event: 'agree'
+ // })
this.$refs.popup.close()
}
}
diff --git a/config.js b/config.js
index 608bd4f..34f1671 100644
--- a/config.js
+++ b/config.js
@@ -7,17 +7,17 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
-const type = 'dev'
+const type = 'prod'
// 环境配置
const config = {
dev : {
// baseUrl : 'http://8.138.162.67:8000/a-notice-api',
- baseUrl : 'http://h5.xzaiyp.top/a-notice-api',
+ baseUrl : 'http://h5.xzaiyp.top/cheer-admin',
},
prod : {
- baseUrl : 'http://admin.anqi.shop/a-notice-api',
+ baseUrl : 'https://cheer-admin.xzaiyp.top/cheer-admin',
}
}
diff --git a/manifest.json b/manifest.json
index 9fc9c81..37153f1 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,6 +1,6 @@
{
"name" : "unapp模板",
- "appid" : "__UNI__07DB806",
+ "appid" : "__UNI__02A377E",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@@ -52,7 +52,7 @@
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
- "appid" : "wx3c24e397e3b132ea",
+ "appid" : "wxe337e285c449abfc",
"setting" : {
"urlCheck" : false
},
diff --git a/pages/center/center.vue b/pages/center/center.vue
index 5696de5..19d9376 100644
--- a/pages/center/center.vue
+++ b/pages/center/center.vue
@@ -2,7 +2,7 @@
-
+
+
+
+
+
+
+ {{ userInfo.nickName }}
+
+
+
@@ -36,6 +59,7 @@
¥
{{ item.price }}
+ {{ item.oldPrice }}
@@ -71,8 +95,8 @@
onShow() {
if (uni.getStorageSync('token')) {
this.$store.commit('getUserInfo')
+ this.getOrderList()
}
- this.getOrderList()
},
//滚动到屏幕底部
onReachBottom() {
@@ -219,6 +243,12 @@
align-items: center;
margin-top: 20rpx;
}
+
+ .oldPrice{
+ margin-left: 10rpx;
+ color: #757575;
+ text-decoration: line-through;
+ }
.money-detail .unit {
font-size: 34rpx;
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 1b1fc4b..92a935c 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -4,12 +4,12 @@
- 欢迎使用xx加油
+ 欢迎使用车队佳油
-
-
-
+
微信授权登录
diff --git a/pages/login/wxUserInfo.vue b/pages/login/wxUserInfo.vue
index d0ec311..beea224 100644
--- a/pages/login/wxUserInfo.vue
+++ b/pages/login/wxUserInfo.vue
@@ -1,7 +1,7 @@
- 帧视界
+ 车队佳油
申请获取你的头像、昵称
@@ -76,7 +76,9 @@
self.$api('infoUpdateInfo', self.userInfo, res => {
if (res.code == 200) {
- uni.navigateBack(-1)
+ uni.switchTab({
+ url:'/pages/center/center'
+ })
}
})
})
diff --git a/pages/payment/payment.vue b/pages/payment/payment.vue
index e31a3e1..daa4d92 100644
--- a/pages/payment/payment.vue
+++ b/pages/payment/payment.vue
@@ -16,7 +16,7 @@
-
+
@@ -65,7 +65,7 @@
money: ''
},
resolvePrivacyAuthorization: {},
- currentIndex: 0,
+ currentIndex: -1,
content: [{
iconPath: '/static/payment/wedding-celebration.png',
text: '婚庆服务',
@@ -79,14 +79,14 @@
}
},
onShow() {
- if (wx.onNeedPrivacyAuthorization) {
- console.log('onNeedPrivacyAuthorization');
- wx.onNeedPrivacyAuthorization(resolve => {
- console.log('onNeedPrivacyAuthorization');
- this.resolvePrivacyAuthorization = resolve
- this.$refs.showPrivacy.init(resolve)
- })
- }
+ // if (wx.onNeedPrivacyAuthorization) {
+ // console.log('onNeedPrivacyAuthorization');
+ // wx.onNeedPrivacyAuthorization(resolve => {
+ // console.log('onNeedPrivacyAuthorization');
+ // this.resolvePrivacyAuthorization = resolve
+ // this.$refs.showPrivacy.init(resolve)
+ // })
+ // }
// wx.getPrivacySetting({
// success: res => {
// console.log(res)
@@ -127,7 +127,21 @@
url: '/pages/login/login'
})
}
- this.$api('createOrderPay', this.form, res => {
+ let money = (this.form.money *
+ (this.configList.preferential ?
+ this.configList.preferential.keyCentent
+ : 1)).toFixed(2)
+
+ // if(!money){
+ // uni.showToast({
+ // icon: 'none',
+ // title: ''
+ // })
+ // }
+
+ this.$api('createOrderPay', {
+ money
+ }, res => {
this.form.money = ''
if(res.code == 200){
uni.requestPayment({
@@ -157,7 +171,7 @@
// title: '支付成功'
// });
}
- })
+ }, "订单创建中...")
},
//获取充值套餐
diff --git a/store/store.js b/store/store.js
index 02c9437..d301a7f 100644
--- a/store/store.js
+++ b/store/store.js
@@ -39,6 +39,9 @@ const store = new Vuex.Store({
})
},
login(state) {
+ uni.showLoading({
+ title:"登录中..."
+ })
uni.login({
success(res) {
console.log(res);
@@ -48,6 +51,7 @@ const store = new Vuex.Store({
api('loginLogin', {
code: res.code
}, res => {
+ uni.hideLoading()
if (res.code != 200) {
return
}
@@ -69,6 +73,7 @@ const store = new Vuex.Store({
},
fail(err) {
console.error(err)
+ uni.hideLoading()
}
})
},