Browse Source

修复

pull/6/head
主管理员 2 months ago
parent
commit
b8055c4e43
3 changed files with 132 additions and 126 deletions
  1. +1
    -1
      api/home.js
  2. +111
    -111
      pages/login/index.vue
  3. +20
    -14
      pages/workbenchManage/index.vue

+ 1
- 1
api/home.js View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
export const banner = (data) => {
return request({
url: '/applet/workIn/bannerList',
url: '/applet/workOut/bannerList',
headers: {
isToken: false
},


+ 111
- 111
pages/login/index.vue View File

@ -28,134 +28,134 @@
</template>
<script setup>
import {
getOpenIdKey,
getToken,
setIsLogin,
setOpenIdKey,
setStorage,
setToken
} from "../../utils/auth";
import {
getOpenId,
getPersonalInfo,
getPhoneNumber,
wxLogin
} from "../../api/system/user";
import {
ref
} from "vue"
import {
getOpenIdKey,
getToken,
setIsLogin,
setOpenIdKey,
setStorage,
setToken
} from "../../utils/auth";
import {
getOpenId,
getPersonalInfo,
getPhoneNumber,
wxLogin
} from "../../api/system/user";
import {
ref
} from "vue"
const value = ref(false)
const value = ref(false)
//
const loginWx = () => {
uni.login({
success: (res) => {
const code = res.code
console.log(code)
wxLogin({
code
}).then(res => {
if (res.code === 200) {
uni.setStorageSync("token", res.data.token)
uni.setStorageSync("baseInfo", JSON.stringify(res.data.userInfo))
uni.navigateBack({
delta: 1
})
}
})
}
})
}
//
const loginWx = () => {
uni.login({
success: (res) => {
const code = res.code
console.log(code)
wxLogin({
code
}).then(res => {
if (res.code === 200) {
uni.setStorageSync("token", res.data.token)
uni.setStorageSync("baseInfo", JSON.stringify(res.data.userInfo))
uni.navigateBack({
delta: 1
})
}
})
}
})
}
// openid
// if (!getOpenIdKey() && !getToken()) {
// uni.login({
// provider: 'weixin',
// success: async (res) => {
// const {
// code,
// data
// } = await getOpenId(res.code)
// if (code === 200 && data) {
// let resData = JSON.parse(data)
// setOpenIdKey(resData.openId)
// }
// },
// fail: function(error) {
// //
// uni.showToast('')
// }
// });
// }
// token
const onGetPhoneNumber = async (e) => {
// uni.login({
// success: res => {
// console.log("====>", res)
// }
// })
console.log(e)
getPhoneNumber({
phoneCode: e.detail.code
})
// if (e.detail.errMsg === "getPhoneNumber:ok") {
// if (getOpenIdKey()) {
// try {
// openid
// if (!getOpenIdKey() && !getToken()) {
// uni.login({
// provider: 'weixin',
// success: async (res) => {
// const {
// code,
// data
// } = await getPhoneNumber({
// "openId": getOpenIdKey(),
// "code": e.detail.code,
// sourceType: 1
// })
// setToken(data.token)
// setIsLogin(true)
// await getUserInfo()
// } catch (e) {
// uni.showToast({
// icon: 'error',
// title: ''
// })
// } = await getOpenId(res.code)
// if (code === 200 && data) {
// let resData = JSON.parse(data)
// setOpenIdKey(resData.openId)
// }
// },
// fail: function(error) {
// //
// uni.showToast('')
// }
// }
// });
// }
}
// token
const onGetPhoneNumber = async (e) => {
// uni.login({
// success: res => {
// console.log("====>", res)
// }
// })
console.log(e)
getPhoneNumber({
phoneCode: e.detail.code
})
// if (e.detail.errMsg === "getPhoneNumber:ok") {
// if (getOpenIdKey()) {
// try {
// const {
// data
// } = await getPhoneNumber({
// "openId": getOpenIdKey(),
// "code": e.detail.code,
// sourceType: 1
// })
// setToken(data.token)
// setIsLogin(true)
// await getUserInfo()
// } catch (e) {
// uni.showToast({
// icon: 'error',
// title: ''
// })
// }
// }
// }
}
// // h
// const getUserInfo = async () => {
// const {
// data
// } = await getPersonalInfo()
// setStorage('userInfo', data)
// uni.navigateBack()
// }
// // h
// const getUserInfo = async () => {
// const {
// data
// } = await getPersonalInfo()
// setStorage('userInfo', data)
// uni.navigateBack()
// }
</script>
<style scoped lang="scss">
@import "index";
@import "@/style/index.scss";
@import "index";
@import "@/style/index.scss";
.select {
width: 24rpx;
height: 24rpx;
border-radius: 50%;
border: 1rpx solid #C7C7C7;
margin-right: 8rpx;
.select {
width: 24rpx;
height: 24rpx;
border-radius: 50%;
border: 1rpx solid #C7C7C7;
margin-right: 8rpx;
.active {
background-color: $mainColor;
.active {
background-color: $mainColor;
}
}
}
.footer {
color: #C7C7C7;
position: fixed;
bottom: 100rpx;
.footer {
color: #C7C7C7;
position: fixed;
bottom: 100rpx;
}
}
</style>

+ 20
- 14
pages/workbenchManage/index.vue View File

@ -4,13 +4,14 @@
<!-- <up-swiper :list="list1" indicator circular indicatorMode="dot" height="370rpx"></up-swiper> -->
<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" style="height: 370rpx;">
<swiper-item class="w-100 h-100" v-for="item in state.banner" :key="item.id">
<image class="w-100 h-100" :src="item.image" mode=""></image>
</swiper-item>
</swiper>
</view>
<view class="container">
<view class="container-list">
<view class="mb28 col3 font32">合伙人工作台</view>
<view class="mb28 col3 font32">合伙人工作台{{state}}</view>
<!-- 申请加入 -->
<view class="container-list-but font28" v-if="userHh!==1||show">
<view class="flex flex-between">
@ -24,9 +25,9 @@
<!-- 申请加入后 -->
<view class="flex flex-between font24 flex-wrap" v-if="userHh===1">
<view class="icon-list" @click="handleGoto(1,item)" v-for="item in iconState.list1" :key="item.id">
<up-image class="mb20" :show-loading="true" :src="item.indexIcon" width="68rpx"
<up-image class="mb20" :show-loading="true" :src="item.image" width="68rpx"
height="68rpx"></up-image>
<view>{{item.indexInfo}}</view>
<view>{{item.name}}</view>
</view>
<view class="icon-list"></view>
</view>
@ -51,9 +52,9 @@
<view class="flex-rowl flex-wrap" v-if="userBcs===1">
<view class="icon-list" v-for="item in iconState.accompanyData" :key="item.id"
@click="handleClick(item)">
<up-image class="mb20" :show-loading="true" :src="item.indexIcon" width="68rpx"
<up-image class="mb20" :show-loading="true" :src="item.image" width="68rpx"
height="68rpx"></up-image>
<view>{{ item.indexInfo }}</view>
<view>{{ item.name }}</view>
</view>
</view>
</view>
@ -117,21 +118,26 @@
const userHh = ref(0)
const userBcs = ref(0)
onShow(() => {
const info = uni.getStorageSync("baseInfo")
if (info) {
const baseInfo = JSON.parse(info)
userHh.value = baseInfo.userHh === 1 ? 0 : 1
userBcs.value = baseInfo.userBcs === 1 ? 0 : 1
if (userHh.value === 1 || userBcs.value === 1) {
show.value = false
}
}
// const info = uni.getStorageSync("baseInfo")
// if (info) {
// const baseInfo = JSON.parse(info)
// userHh.value = baseInfo.userHh === 1 ? 0 : 1
// userBcs.value = baseInfo.userBcs === 1 ? 0 : 1
// if (userHh.value === 1 || userBcs.value === 1) {
// show.value = false
// }
userHh.value == 1
userBcs.value == 1
// }
})
//
const getBanner = async () => {
const res = await banner()
if (res.code === 200) {
console.log("banner图",res)
state.banner = [...res.data]
console.log("state.banner",state.banner)
}
}
//


Loading…
Cancel
Save