登录

parent 3b72ad0a
...@@ -20,4 +20,7 @@ VITE_APP_PREVIEW_URL = 'http://jiaxiu.gyntv.com.cn:8012/onlinePreview?url=' ...@@ -20,4 +20,7 @@ VITE_APP_PREVIEW_URL = 'http://jiaxiu.gyntv.com.cn:8012/onlinePreview?url='
VITE_APP_OUTDIR_FILENAME = 'practice-jiaxiu-mobile-html' VITE_APP_OUTDIR_FILENAME = 'practice-jiaxiu-mobile-html'
#systemCode #systemCode
VITE_APP_SYSTEM_CODE = 'ty-centre' VITE_APP_SYSTEM_CODE = 'ty-centre'
\ No newline at end of file
#爽贵阳appid
VITE_APP_SGY_APPID = 'b48029977be21440fe9db2867f87ac99'
\ No newline at end of file
...@@ -20,4 +20,7 @@ VITE_APP_PREVIEW_URL = 'http://jiaxiu.gyntv.com.cn:8012/onlinePreview?url=' ...@@ -20,4 +20,7 @@ VITE_APP_PREVIEW_URL = 'http://jiaxiu.gyntv.com.cn:8012/onlinePreview?url='
VITE_APP_OUTDIR_FILENAME = 'practice-jiaxiu-mobile-html' VITE_APP_OUTDIR_FILENAME = 'practice-jiaxiu-mobile-html'
#systemCode #systemCode
VITE_APP_SYSTEM_CODE = 'ty-centre' VITE_APP_SYSTEM_CODE = 'ty-centre'
\ No newline at end of file
#爽贵阳appid
VITE_APP_SGY_APPID = 'b48029977be21440fe9db2867f87ac99'
\ No newline at end of file
...@@ -18,3 +18,38 @@ yarn build ...@@ -18,3 +18,38 @@ yarn build
## 默认安装的 UI 库 ## 默认安装的 UI 库
[wot-design-uni](https://wot-design-uni.netlify.app/component/button.html) [wot-design-uni](https://wot-design-uni.netlify.app/component/button.html)
### 自定义爽贵阳条件编译平台 H5-SGY
#### 1.配置扩展平台
```
//package.json
"uni-app": {
"scripts": {
"h5-sgy": {
"title": "爽贵阳平台",
"env": {
"UNI_PLATFORM": "h5"
},
"define": {
"H5-SGY": true
}
}
}
}
```
#### 3.使用方式参考 main.js
```
// #ifdef H5
console.log('当前基准平台:H5')
// #endif
// #ifdef H5-SGY
console.log('当前扩展平台:H5-SGY')
// #endif
```
##### 注意:H5-SGY 条件编译是基于 H5 条件编译进行扩展,H5-SGY 条件编译和 H5 条件编译会同时生效。若需要仅 H5 条件编译生效,请指定运行或打包平台为 H5。
...@@ -57,5 +57,18 @@ ...@@ -57,5 +57,18 @@
"unplugin-vue-components": "^0.27.2", "unplugin-vue-components": "^0.27.2",
"vite": "4.3.5", "vite": "4.3.5",
"vue-tsc": "^1.0.24" "vue-tsc": "^1.0.24"
},
"uni-app": {
"scripts": {
"h5-sgy": {
"title": "爽贵阳平台",
"env": {
"UNI_PLATFORM": "h5"
},
"define": {
"H5-SGY": true
}
}
}
} }
} }
...@@ -11,4 +11,17 @@ export const loginByPassword = (data) => { ...@@ -11,4 +11,17 @@ export const loginByPassword = (data) => {
method: 'post', method: 'post',
data: data data: data
}) })
}
/**
* @description 爽贵阳快捷登录
* @param {any} data 爽贵阳快捷登录
* @returns
*/
export const loginBySgy = (data) => {
return request({
url: '/sgylogin',
method: 'post',
data: data
})
} }
\ No newline at end of file
...@@ -160,6 +160,19 @@ export const insertPictureUrl = (data) => { ...@@ -160,6 +160,19 @@ export const insertPictureUrl = (data) => {
}) })
} }
/**
* @description 删除图组
* @param {Any} data 删除信息对象
* @returns
*/
export const deleteAppCatalog = (data) => {
return request({
url: '/app/appMediaDelete/deleteAppCatalog',
method: 'post',
data: data
})
}
/** /**
* @description 查询图组详情 * @description 查询图组详情
* @param {Number} id 图组id * @param {Number} id 图组id
...@@ -185,4 +198,4 @@ export const selectOrganizeList = (data) => { ...@@ -185,4 +198,4 @@ export const selectOrganizeList = (data) => {
method: 'post', method: 'post',
data: data data: data
}) })
} }
\ No newline at end of file
...@@ -70,6 +70,7 @@ declare global { ...@@ -70,6 +70,7 @@ declare global {
const shallowReactive: typeof import('vue')['shallowReactive'] const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly'] const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef'] const shallowRef: typeof import('vue')['shallowRef']
const showToast: typeof import('vant/es')['showToast']
const toRaw: typeof import('vue')['toRaw'] const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef'] const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs'] const toRefs: typeof import('vue')['toRefs']
......
...@@ -21,3 +21,10 @@ export function createApp() { ...@@ -21,3 +21,10 @@ export function createApp() {
app, app,
}; };
} }
// #ifdef H5
console.log('当前基准平台:H5')
// #endif
// #ifdef H5-SGY
console.log('当前扩展平台:H5-SGY')
// #endif
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="login-top clearfloat box-s"> <div class="login-top clearfloat box-s">
<div class="ge-back"><img src="@/static/image/login.png"></div> <div class="ge-back"><img src="@/static/image/login.png"></div>
<div class="logo-imgs"> <div class="logo-imgs">
<img src=""> <img src="@/static/image/login-circle.png">
</div> </div>
</div> </div>
</div> </div>
...@@ -22,20 +22,26 @@ ...@@ -22,20 +22,26 @@
<form> <form>
<div class="form-group login-group_re"> <div class="form-group login-group_re">
<i class="iconfont icon-shoujihaoma"></i> <i class="iconfont icon-shoujihaoma"></i>
<input type="text" v-model="formData.account" class="form-control inpt-form" placeholder="请输入用户名" <input type="text" v-model="formData.account" class="form-control inpt-form"
:rules="[{ required: true, message: '请填写用户名' }]"> placeholder="请输入手机号" :rules="[{ required: true, message: '请输入手机号' }]">
</div> </div>
<div class="form-group login-group_re"> <div class="form-group login-group_re">
<i class="iconfont icon-mima"></i> <i class="iconfont icon-mima"></i>
<input v-model="formData.password" class="form-control inpt-form" type="password" <input v-model="formData.password" class="form-control inpt-form" type="password"
placeholder="请输入密码" v-if="!passwordVisible"> placeholder="请输入密码" v-if="!passwordVisible">
<input v-model="formData.password" class="form-control inpt-form" type="text" placeholder="请输入密码" <input v-model="formData.password" class="form-control inpt-form" type="text"
v-else> placeholder="请输入密码" v-else>
<i class="icon-icon-test iconfont xian-mi icon-icon-test" @click="passwordVisible = true" <i class="icon-icon-test iconfont xian-mi icon-icon-test" @click="passwordVisible = true"
v-if="!passwordVisible"></i> v-if="!passwordVisible"></i>
<i class="iconfont xian-mi icon-close-eye" @click="passwordVisible = false" v-else></i> <i class="iconfont xian-mi icon-close-eye" @click="passwordVisible = false" v-else></i>
</div> </div>
<button type="button" class="conf-btn login-btns" @click="login">登录</button> <!-- <button type="button" class="conf-btn login-btns" @click="login">登录</button> -->
<div class="login-btns">
<van-button type="primary" round @click="login">登录</van-button>
<!-- #ifdef H5-SGY -->
<van-button plain type="primary" round @click="fastLoginBySgy">爽贵阳用户快捷登录</van-button>
<!-- #endif -->
</div>
</form> </form>
</div> </div>
<div class="tab-pane fade in active" v-if="activeIndex == 1"> <div class="tab-pane fade in active" v-if="activeIndex == 1">
...@@ -53,7 +59,8 @@ ...@@ -53,7 +59,8 @@
</div> </div>
<div class="form-group login-group_re"> <div class="form-group login-group_re">
<i class="iconfont icon-mima"></i> <i class="iconfont icon-mima"></i>
<input data-toggle="password" class="form-control inpt-form" type="password" placeholder="请输入密码"> <input data-toggle="password" class="form-control inpt-form" type="password"
placeholder="请输入密码">
</div> </div>
<button type="button" class="conf-btn login-btns">注册</button> <button type="button" class="conf-btn login-btns">注册</button>
...@@ -65,8 +72,8 @@ ...@@ -65,8 +72,8 @@
</template> </template>
<script setup> <script setup>
import { showToast, showLoadingToast,closeToast } from 'vant' import { showToast, showLoadingToast, closeToast } from 'vant'
import { loginByPassword } from '@/api/account' import { loginByPassword, loginBySgy } from '@/api/account'
import useUserStore from '@/store/user' import useUserStore from '@/store/user'
const router = useRouter() const router = useRouter()
...@@ -90,14 +97,43 @@ const login = async () => { ...@@ -90,14 +97,43 @@ const login = async () => {
showLoadingToast({ showLoadingToast({
message: '登录中', message: '登录中',
forbidClick: true, forbidClick: true,
duration:0 duration: 0
}) })
const res = await loginByPassword(formData.value) const res = await loginByPassword(formData.value)
userStore.login(res) userStore.login(res)
closeToast() closeToast()
showToast('登录成功') showToast('登录成功')
router.pushTab({name:'home'}) router.pushTab({ name: 'home' })
}
const sgyLoginParams = ref({
appid: import.meta.env.VITE_APP_SGY_APPID,
type: "sgy",
encryptDataMap: {}
})
const fastLoginBySgy = () => {
xma.xh.getUserProfile({
range: ['ACCOUNT', 'MOBILE', 'CITIZEN'],
async success(info) {
console.log(info)
showLoadingToast({
message: '登录中',
forbidClick: true,
duration: 0
})
sgyLoginParams.value.encryptDataMap = info.data
const res = await loginBySgy(sgyLoginParams.value)
console.log(res)
userStore.login(res)
closeToast()
xma.showToast({
title: '登录成功',
icon: 'success'
})
router.pushTab({ name: 'home' })
}
});
} }
</script> </script>
...@@ -206,7 +242,7 @@ const login = async () => { ...@@ -206,7 +242,7 @@ const login = async () => {
.logo-imgs { .logo-imgs {
position: relative; position: relative;
left: 35%; left: 44%;
top: -27%; top: -27%;
width: 3rem; width: 3rem;
height: 3rem; height: 3rem;
...@@ -228,12 +264,13 @@ const login = async () => { ...@@ -228,12 +264,13 @@ const login = async () => {
.login-group_re { .login-group_re {
display: flex; display: flex;
gap: 10px; gap: 10px;
margin-bottom: 3%;
} }
.login-group_re i { .login-group_re i {
line-height: 37px; line-height: 37px;
color: #4C82FF; color: #4C82FF;
font-size: 0.5rem; font-size: 1rem;
background: #fff; background: #fff;
} }
...@@ -297,5 +334,15 @@ const login = async () => { ...@@ -297,5 +334,15 @@ const login = async () => {
.login-btns { .login-btns {
margin-top: 4%; margin-top: 4%;
width: 100%;
gap: 15px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.van-button {
width: 100%;
}
} }
</style> </style>
\ No newline at end of file
<template>
<van-popup v-model:show="show" position="bottom" round @close="handleClose">
<div class="more">
<div class="item" @click="handleUpdate">编辑图组</div>
<div class="item delete" @click="handleDelete">删除图组</div>
<div class="item" @click="handleClose">取消</div>
</div>
</van-popup>
</template>
<script setup>
import { ref } from 'vue'
import { deleteAppCatalog } from '@/api/publish'
import { showConfirmDialog } from 'vant'
import useUserStore from '@/store/user'
const userStore = useUserStore()
const emits = defineEmits(["refresh"])
const catalog = reactive({
userId: null,
materialId: '',
delBy: ''
})
const handleClose = () => {
show.value = false
}
const handleDelete = () => {
showConfirmDialog({
title: '删除图组',
message: '确定删除该图组吗?',
})
.then(() => {
catalog.userId = userStore.userinfo.user.id
catalog.materialId = pictrueInfo.value.materialId
catalog.delBy = userStore.userinfo.user.name
deleteAppCatalog(catalog).then(res => {
showToast('删除成功')
emits('refresh')
handleClose()
})
})
}
const handleUpdate = () => {
console.log('编辑')
}
const pictrueInfo = ref(null)
const show = ref(false)
const open = (e) => {
console.log(e)
pictrueInfo.value = e
show.value = true
}
const close = () => {
show.value = false
}
defineExpose({
open,
close
})
</script>
<style lang="scss" scoped>
.more {
padding: 20px;
.delete {
color: #E23535;
}
.item {
padding: 10px 0;
text-align: center;
border-bottom: 1px solid #eee;
&:last-child {
border-bottom: none;
}
}
}
</style>
\ No newline at end of file
...@@ -12,14 +12,22 @@ ...@@ -12,14 +12,22 @@
</span> </span>
<div class="tag"> <div class="tag">
<span v-for="(tagName, index) in item.tagName.split(',')" :key="index">{{ <span v-for="(tagName, index) in item.tagName.split(',')" :key="index">{{
tagName }}</span> tagName }}</span>
</div> </div>
<div class="info"> <div class="info">
<van-button type="primary" size="mini" block @click="handlePublishPicture(item)" <van-button type="primary" size="mini" block @click="handlePublishPicture(item)"
v-if="active == 0">立即发布</van-button> v-if="active == 0">立即发布</van-button>
<div class="user" v-else> <div class="user" v-else>
<img src="@/static/image/avatar.png"> <div class="user-box">
<span>{{ item.author }}</span> <img src="@/static/image/avatar.png">
<span>{{ item.author }}</span>
</div>
<div v-if="active == 1">
<van-icon name="ellipsis" size="26" color="#545454" @click="handleMore(item)" />
</div>
<div v-if="active == 2">
<van-icon name="star" color="#F1C13E" />
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -28,6 +36,8 @@ ...@@ -28,6 +36,8 @@
</van-list> </van-list>
<van-empty description="暂无数据" v-else /> <van-empty description="暂无数据" v-else />
</van-pull-refresh> </van-pull-refresh>
</template> </template>
<script setup> <script setup>
import useUserStore from '@/store/user' import useUserStore from '@/store/user'
...@@ -39,7 +49,7 @@ const props = defineProps({ ...@@ -39,7 +49,7 @@ const props = defineProps({
default: 0 default: 0
} }
}) })
const emits = defineEmits(["total", "refresh"]) const emits = defineEmits(["total", "refresh", "opreation"])
const router = useRouter() const router = useRouter()
const userStore = useUserStore() const userStore = useUserStore()
const refreshing = ref(false) const refreshing = ref(false)
...@@ -95,6 +105,10 @@ const handleRefresh = () => { ...@@ -95,6 +105,10 @@ const handleRefresh = () => {
getList() getList()
} }
const handleMore = (e) => {
emits('opreation', e)
}
const handlePublishPicture = async (e) => { const handlePublishPicture = async (e) => {
showLoadingToast({ showLoadingToast({
message: '发布中', message: '发布中',
...@@ -173,19 +187,28 @@ defineExpose({ ...@@ -173,19 +187,28 @@ defineExpose({
.user { .user {
display: flex; display: flex;
gap: 7px; justify-content: space-between;
align-items: center; align-items: center;
width: 100%;
img {
width: 23px; .user-box {
height: 23px; display: flex;
border-radius: 50%; gap: 7px;
align-items: center;
img {
width: 23px;
height: 23px;
border-radius: 50%;
}
span {
color: #9F9F9F;
font-size: 12px;
}
} }
span {
color: #9F9F9F;
font-size: 12px;
}
} }
} }
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<picture-list :active="0" @total="setTotal" @refresh="handleRefreshPublishPicture"></picture-list> <picture-list :active="0" @total="setTotal" @refresh="handleRefreshPublishPicture"></picture-list>
</van-tab> </van-tab>
<van-tab title="已发布"> <van-tab title="已发布">
<picture-list ref="publishPicture" :active="1" @total="setTotal"></picture-list> <picture-list ref="publishPicture" :active="1" @total="setTotal" @opreation="handleOperation"></picture-list>
</van-tab> </van-tab>
<van-tab title="收藏"> <van-tab title="收藏">
<picture-list :active="2" @total="setTotal"></picture-list> <picture-list :active="2" @total="setTotal"></picture-list>
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
</van-tabs> </van-tabs>
</div> </div>
</div> </div>
<MoreOperations ref="morePopupRef" @refresh="handleRefreshPublishPicture"></MoreOperations>
</template> </template>
<script setup> <script setup>
...@@ -65,6 +66,7 @@ import { showConfirmDialog, showToast } from 'vant' ...@@ -65,6 +66,7 @@ import { showConfirmDialog, showToast } from 'vant'
import useUserStore from '@/store/user' import useUserStore from '@/store/user'
import PictureList from './components/PictureList' import PictureList from './components/PictureList'
import { useInitScroll } from '@/hooks/useScroll' import { useInitScroll } from '@/hooks/useScroll'
import MoreOperations from './components/MoreOperations/index.vue'
useInitScroll() useInitScroll()
const router = useRouter() const router = useRouter()
...@@ -88,7 +90,6 @@ const toLogin = () => { ...@@ -88,7 +90,6 @@ const toLogin = () => {
router.push({ name: 'account-login' }) router.push({ name: 'account-login' })
} }
const setTotal = (e) => { const setTotal = (e) => {
total[e.activeIndex] = e.value total[e.activeIndex] = e.value
} }
...@@ -111,6 +112,11 @@ const logout = () => { ...@@ -111,6 +112,11 @@ const logout = () => {
}) })
} }
const morePopupRef = ref()
const handleOperation = (e) => {
morePopupRef.value.open(e)
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
v-if="dataList.length"> v-if="dataList.length">
<div class="list"> <div class="list">
<div class="item" v-for="(item, index) in dataList" :key="index" <div class="item" v-for="(item, index) in dataList" :key="index"
@click="router.push({ name: 'home-content', query: { id: item.materialId } })"> @click="router.push({ name: 'home-content', params: { id: item.materialId } })">
<img :src="fileDomain + item.coverpicture"> <img :src="fileDomain + item.coverpicture">
<div class="desc"> <div class="desc">
<span class="title"> <span class="title">
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div class="c-title">热门专题</div> <div class="c-title">热门专题</div>
<div class="list"> <div class="list">
<div class="item" <div class="item"
@click="router.push({ name: 'subject-list', query: { tagId: item.tagId, tagName: item.tagName } })" @click="router.push({ name: 'subject-list', params: { tagId: item.tagId, tagName: item.tagName } })"
v-for="(item, index) in dataList" :key="index"> v-for="(item, index) in dataList" :key="index">
<img class="cover" src="../../static/image/subject-cover.png"> <img class="cover" src="../../static/image/subject-cover.png">
<div class="title">{{ item.tagName }}</div> <div class="title">{{ item.tagName }}</div>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="header"> <div class="header">
<div class="h-content"> <div class="h-content">
<img src="../../static/image/subject-list-logo.png" /> <img src="../../static/image/subject-list-logo.png" />
<div class="title">当前专题:{{ route.query.tagName }}</div> <div class="title">当前专题:{{ queryParams.tagName }}</div>
</div> </div>
<div class="overlay"></div> <div class="overlay"></div>
</div> </div>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
@load="getList" v-if="dataList.length"> @load="getList" v-if="dataList.length">
<div class="list"> <div class="list">
<div class="item" v-for="(item, index) in dataList" :key="index" <div class="item" v-for="(item, index) in dataList" :key="index"
@click="router.push({ name: 'home-content', query: { id: item.materialId } })"> @click="router.push({ name: 'home-content', params: { id: item.materialId } })">
<img :src="fileDomain + item.coverpicture"> <img :src="fileDomain + item.coverpicture">
<div class="desc"> <div class="desc">
<span class="title"> <span class="title">
...@@ -72,9 +72,15 @@ const queryParams = reactive({ ...@@ -72,9 +72,15 @@ const queryParams = reactive({
organizeId: null, organizeId: null,
organizeName: '' organizeName: ''
}) })
onLoad((options) => {
queryParams.tagId = options.tagId
queryParams.tagName = options.tagName
getList()
})
const dataList = ref([]) const dataList = ref([])
const handleSelectDataList = async () => { const handleSelectDataList = async () => {
queryParams.tagId = route.query.tagId
const res = await selectSubjectList(page, queryParams) const res = await selectSubjectList(page, queryParams)
setDataList(res) setDataList(res)
} }
...@@ -102,13 +108,13 @@ const handleRefresh = () => { ...@@ -102,13 +108,13 @@ const handleRefresh = () => {
} }
onActivated(() => { // onActivated(() => {
nextTick(() => { }).then(() => { // nextTick(() => { }).then(() => {
if (queryParams.tagId != route.query.tagId) { // if (queryParams.tagId != route.query.tagId) {
handleRefresh() // handleRefresh()
} // }
}) // })
}) // })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment