From 7984e0d8cebf4179f7ee3e2046207edd12398cf6 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Thu, 09 Nov 2023 14:47:09 +0800
Subject: [PATCH] fix:小程序详情修改
---
App.vue | 270 ++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 184 insertions(+), 86 deletions(-)
diff --git a/App.vue b/App.vue
index 040d57f..3c6773b 100644
--- a/App.vue
+++ b/App.vue
@@ -1,97 +1,164 @@
<script>
-import Vue from 'vue'
-import {
- httpPost,
- httpGet
-} from '@/utils/http.js'
-export default {
- onLaunch: function() {
- // ������������������
- this.getUserInfo()
- },
- methods: {
- /**
+ import {
+ getDic
+ } from '@/utils/login.js' // ������������
+ import store from '@/store/index.js'
+ import routingIntercept from '@/utils/permission.js'
+ import {
+ httpPost,
+ httpGet
+ } from '@/utils/http.js'
+ export default {
+ onShow: function(options) {
+ console.log('optionsonShow', options)
+ if (options.scene === 1007 || options.scene === 1014 || options.scene === 1008) {
+ // ������������������������������������
+ this.getWXCode()
+ }
+ },
+ onLaunch() {
+ // ������������������
+ let token = uni.getStorageSync('token')
+ console.log('apptoken', token)
+ if (!token) {
+ uni.login({
+ provider: 'weixin',
+ success: loginRes => {
+ console.log('loginRes', loginRes)
+ httpGet('/AppUser/wx/login', {
+ 'code': loginRes.code
+ }).then(result => {
+ routingIntercept()
+ try {
+ if (result.data.code === 0) {
+ uni.clearStorageSync()
+ uni.setStorageSync('userInfor', JSON.stringify(result.data))
+ uni.setStorageSync('tonken', result.data.token)
+ uni.setStorageSync('openId', result.data.openId)
+ getDic()
+ this.$isResolve()
+ } else {
+ uni.clearStorageSync()
+ uni.setStorageSync('openId', result.data.openId)
+ uni.showModal({
+ title: '���������',
+ content: '������������������������������������������',
+ showCancel: false,
+ confirmText: '������',
+ success: res => {
+ if (res.confirm) {
+ uni.reLaunch({
+ url: '/pages/login/login',
+ })
+ }
+ },
+ })
+ this.$isResolve()
+ }
+ } catch (e) {
+ console.error(e)
+ }
+ }).catch(errors => {
+ console.log('appdddd', errors)
+ uni.showToast({
+ title: errors,
+ icon: 'none',
+ })
+ this.$isResolve()
+ })
+ }
+ })
+ } else {
+ this.$isResolve()
+ }
+ },
+ methods: {
+ /**
* ������������
* ���������������������������������������������������������������������
*
*/
- getUserInfo() {
- uni.login({
- provider: 'weixin',
- success(res) {
- if (res.code) {
- console.log('code', res.code)
- // ������������������������code������������������������
- httpGet('/AppUser/wx/login', {
- 'code': res.code
- }).then((result)=> {
- if (result.data.code === 0) {
- // ������������
- } else {
- // ���������������
- uni.setStorageSync('openId', result.data.openId)
- uni.showModal({
- title: '���������',
- content: '������������������������������������������',
- showCancel: false,
- confirmText: '������',
- success: (res)=> {
- if (res.confirm) {
- uni.reLaunch({
- url: '/pages/login/login',
- })
- }
- },
+ getWXCode() {
+ let token = uni.getStorageSync('token')
+ console.log('apptoken', token)
+ if (!token) {
+ uni.login({
+ provider: 'weixin',
+ success: loginRes => {
+ console.log('loginRes', loginRes)
+ httpGet('/AppUser/wx/login', {
+ 'code': loginRes.code
+ }).then(result => {
+ routingIntercept()
+ try {
+ if (result.data.code === 0) {
+ uni.clearStorageSync()
+ uni.setStorageSync('userInfor', JSON.stringify(result.data))
+ uni.setStorageSync('tonken', result.data.token)
+ uni.setStorageSync('openId', result.data.openId)
+ getDic()
+ this.$isResolve()
+ } else {
+ uni.clearStorageSync()
+ uni.setStorageSync('openId', result.data.openId)
+ uni.showModal({
+ title: '���������',
+ content: '������������������������������������������',
+ showCancel: false,
+ confirmText: '������',
+ success: res => {
+ if (res.confirm) {
+ uni.reLaunch({
+ url: '/pages/login/login',
+ })
+ }
+ },
+ })
+ this.$isResolve()
+ }
+ } catch (e) {
+ console.error(e)
+ }
+ }).catch(errors => {
+ console.log('appdddd', errors)
+ uni.showToast({
+ title: errors,
+ icon: 'none',
})
- }
-
- })
- } else {
- console.log(res.errMsg)
- }
- }
- })
- },
-
- autoLogin() {
- console.log('Vue.prototype.$storage', Vue.prototype.$storage.get('tonken'))
- let tonken = this.$storage.get('utoken')
- console.log('tonken', tonken)
- // ���������������������������������������������������������������������
- if (!tonken) {
- const params = {
- account: accountInFor.account,
- password: accountInFor.password,
- }
- uni.showLoading({
- title: '���������������...',
- })
- setTimeout(()=> {
- uni.reLaunch({
- url: '/pages/actionChange/agencyPage/index',
- })
- }, 3000)
- } else {
- // ������������������������������������������������������������
- uni.showModal({
- title: '���������',
- content: '������������������������������������������',
- showCancel: false,
- confirmText: '������',
- success: (res)=> {
- if (res.confirm) {
- uni.reLaunch({
- url: '/pages/login/login',
+ this.$isResolve()
})
}
- },
+ })
+ } else {
+ this.$isResolve()
+ }
+ },
+ getLogin(data) {
+ // ������������������������code������������������������
+ httpGet('/AppUser/wx/login', {
+ 'code': data
+ }).then(result => {
+ if (result.data.code === 0) {
+ // ������������
+ uni.clearStorage()
+ store.commit('setUserInfor', result.data)
+ store.commit('setTonken', result.data.token)
+ getDic()
+ try {
+ this.$isResolve()
+ } catch (e) {
+ console.error(e)
+ }
+ // getUserInfor(result.data.token)
+ } else {
+ // ���������������
+ // console.log('openId', result.data.openId)
+ }
})
}
},
- },
-}
+ }
</script>
-
<style lang="scss">
/* ������������������������������������style������������lang="scss"������ */
@import "@/uni_modules/uview-ui/index.scss";
@@ -102,18 +169,49 @@
.formItemContent {
::v-deep.u-form-item {
- padding: 8px 0;
+ padding: 5px 0;
border-bottom: 1px dashed #bbb;
+ }
+
+ ::v-deep.u-form-item__body__left__content__label {
+ font-size: 16px !important;
}
::v-deep.u-form-item__body,
/deep/.u-textarea {
padding: 0 !important;
}
+ }
- ::v-deep.u-form-item__body__left__content__label,
- /deep/.u-radio__text {
- font-size: 13px !important;
+ .tabarStyle {
+ /deep/.u-tabbar-item__text {
+ font-size: 18px !important;
+ }
+
+ /deep/.u-tabbar__content__item-wrapper {
+ height: 60px !important;
+ }
+
+ /deep/.u-icon__icon {
+ font-size: 25px !important;
+ }
+ }
+
+ .dataRangeSerch {
+
+ /deep/.range-separator,
+ /deep/.uni-date__x-input {
+ height: 30px !important;
+ line-height: 30px !important;
+ }
+ }
+
+ .ridoaBox {
+ text-align: center;
+ padding: 10px 0px;
+
+ /deep/.u-radio {
+ padding-right: 10px;
}
}
</style>
\ No newline at end of file
--
Gitblit v1.8.0