首次提交
This commit is contained in:
parent
7d5110a10f
commit
7af87512eb
34
.gitignore
vendored
Normal file
34
.gitignore
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
yarn.lock
|
||||||
|
|
||||||
|
uni_modules
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
unpackage
|
||||||
|
dist-ssr
|
||||||
|
*.local
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
|
|
||||||
|
# node_modules
|
||||||
|
node_modules
|
||||||
|
package-lock.json
|
||||||
|
package-lock.json
|
||||||
|
components.d.ts
|
||||||
16
.hbuilderx/launch.json
Normal file
16
.hbuilderx/launch.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||||
|
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||||
|
"version": "0.0",
|
||||||
|
"configurations": [{
|
||||||
|
"app-plus" :
|
||||||
|
{
|
||||||
|
"launchtype" : "local"
|
||||||
|
},
|
||||||
|
"default" :
|
||||||
|
{
|
||||||
|
"launchtype" : "local"
|
||||||
|
},
|
||||||
|
"type" : "uniCloud"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
29
App.vue
Normal file
29
App.vue
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<script setup>
|
||||||
|
import { onLaunch,onShow,onHide } from '@dcloudio/uni-app'
|
||||||
|
onLaunch(()=>{
|
||||||
|
console.log('App Launch')
|
||||||
|
});
|
||||||
|
onShow(()=>{
|
||||||
|
console.log('App Show')
|
||||||
|
});
|
||||||
|
onHide(()=>{
|
||||||
|
console.log('App Hide')
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
/*每个页面公共css */
|
||||||
|
/* #ifdef H5 */
|
||||||
|
*{
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
uni-page-head {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
/* #endif */
|
||||||
|
wx-button:after{
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
163
api/api.js
Normal file
163
api/api.js
Normal file
@ -0,0 +1,163 @@
|
|||||||
|
import {request} from '@/utils/request.js'
|
||||||
|
const api = {
|
||||||
|
wxLogin(data) {
|
||||||
|
return request('/login/wechat_mobile_login', data, 'post', true);
|
||||||
|
},
|
||||||
|
mobileLogin(data) {
|
||||||
|
return request('/login/mobile_login', data, 'post', true);
|
||||||
|
},
|
||||||
|
getCode(data) {
|
||||||
|
return request('/code/phone', data, 'post', true);
|
||||||
|
},
|
||||||
|
|
||||||
|
getHomeData(data) { //首页数据
|
||||||
|
return request('/index', data, 'get', true);
|
||||||
|
},
|
||||||
|
getClassify(id) { //获取分类详情
|
||||||
|
return request('/class/' + id, {}, 'get', true);
|
||||||
|
},
|
||||||
|
getClassifyList() { //获取分类详情
|
||||||
|
return request('/class/list', {}, 'get', false);
|
||||||
|
},
|
||||||
|
getQuestionPage(data) { //获取问题列表-分页
|
||||||
|
return request('/question/page', data, 'post', true, 'application/json');
|
||||||
|
},
|
||||||
|
getQuestionDetail(id,data) { //获取问题详情
|
||||||
|
return request('/question/'+id, data, 'get', false);
|
||||||
|
},
|
||||||
|
collect(data) {
|
||||||
|
return request('/collection/question', data, 'post', false, 'application/json');
|
||||||
|
},
|
||||||
|
cancelCollect(data) {
|
||||||
|
return request('/collection/question/cancel', data, 'put', false, 'application/json');
|
||||||
|
},
|
||||||
|
getHotList() { //获取问题详情
|
||||||
|
return request('/question/hot', {}, 'get', true);
|
||||||
|
},
|
||||||
|
getQuestionStatus(id) { //获取问题解锁状态
|
||||||
|
return request('/question/unlock/status/' + id, {}, 'get', true);
|
||||||
|
},
|
||||||
|
getQuestionCoupon(data) { //获取患者可使用优惠卷-单项
|
||||||
|
return request('/coupon/usable/question', data, 'get', true);
|
||||||
|
},
|
||||||
|
getVipCoupon(data) { //获取会员可使用优惠卷-单项
|
||||||
|
return request('/coupon/usable/member', data, 'get', true);
|
||||||
|
},
|
||||||
|
getVipPrice() { //获取会员配置数据
|
||||||
|
return request('/member', {}, 'get', false);
|
||||||
|
},
|
||||||
|
getRecentList() {
|
||||||
|
return request('/order/member/recent/list', {}, 'get', false);
|
||||||
|
},
|
||||||
|
getUserInfo() {
|
||||||
|
return request('/user', {}, 'get', true);
|
||||||
|
},
|
||||||
|
getUnnotifyCoupon() { //获取还未弹窗的优惠卷
|
||||||
|
return request('/coupon/unnotified', {}, 'get', false);
|
||||||
|
},
|
||||||
|
getLeast() { //获取最少立减金额
|
||||||
|
return request('/member/least', {}, 'get', false);
|
||||||
|
},
|
||||||
|
getItemList(data) { //获取单项订单列表-分页
|
||||||
|
return request('/order/single/page', data, 'get', true);
|
||||||
|
},
|
||||||
|
getVipList(data) { //获取会员订单列表-分页
|
||||||
|
return request('/order/member/page', data, 'get', true);
|
||||||
|
},
|
||||||
|
createItemOrder(data) { //创建单项订单
|
||||||
|
return request('/order/single', data, 'post', true);
|
||||||
|
},
|
||||||
|
createVipOrder(data) { //创建会员订单
|
||||||
|
return request('/order/member', data, 'post', true);
|
||||||
|
},
|
||||||
|
cancelItemOrder(id) {
|
||||||
|
return request('/order/single/cancel/' + id, {}, 'put', false);
|
||||||
|
},
|
||||||
|
getItemPayData(data, id) {
|
||||||
|
return request('/order/single/pay/' + id, data, 'get', true);
|
||||||
|
|
||||||
|
},
|
||||||
|
getWxConfig(url, data) {
|
||||||
|
return request(url, data, 'get', false);
|
||||||
|
},
|
||||||
|
getCollectList(data) { //获取用户收藏题目列表-分页
|
||||||
|
return request('/collection/question', data, 'get', true);
|
||||||
|
},
|
||||||
|
getFuliList(data) { //获取用户收藏题目列表-分页
|
||||||
|
return request('/coupon', data, 'get', true);
|
||||||
|
},
|
||||||
|
addClickCount(id) { //增加问题点击次数(点击进入详情页的人次
|
||||||
|
return request('/question/click/' + id, {}, 'put', false);
|
||||||
|
},
|
||||||
|
addSubmitCount(id) { //增加问题提交次数(提交个人信息进行了算算的人次)
|
||||||
|
return request('/question/click/submit/' + id, {}, 'put', false);
|
||||||
|
},
|
||||||
|
checkUser(data) { //检测用户数据绑定状态
|
||||||
|
return request('/user/check', data, 'GET', false);
|
||||||
|
},
|
||||||
|
getBasic(data) {
|
||||||
|
return request('/user/info', data, 'GET', true);
|
||||||
|
},
|
||||||
|
updateBasic(data) {
|
||||||
|
return request('/user', data, 'PUT', true,'application/json');
|
||||||
|
},
|
||||||
|
getCase(data) {
|
||||||
|
return request('/user/case', data, 'GET', true);
|
||||||
|
},
|
||||||
|
updateCase(data) {
|
||||||
|
return request('/user/case', data, 'PUT', true,'application/json');
|
||||||
|
},
|
||||||
|
getArea(data) {
|
||||||
|
return request('/area/list', data, 'GET', false);
|
||||||
|
},
|
||||||
|
getDiseaseList(data) {
|
||||||
|
return request('/disease/list', data, 'GET', false);
|
||||||
|
},
|
||||||
|
getNation(data) {
|
||||||
|
return request('/nation/list', data, 'GET', false);
|
||||||
|
},
|
||||||
|
getOssSign(data) {
|
||||||
|
return request('/sign/oss', data, 'GET', false);
|
||||||
|
},
|
||||||
|
ossUpload(url,data){
|
||||||
|
return request(url,data,'post',false,'multipart/form-data')
|
||||||
|
},
|
||||||
|
checkItemPaySatus(id) {
|
||||||
|
return request('/order/single/pay/status/'+id, {}, 'GET', false);
|
||||||
|
},
|
||||||
|
checkVipPaySatus(id) {
|
||||||
|
return request('/order/member/pay/status/'+id, {}, 'GET', false);
|
||||||
|
},
|
||||||
|
saveAnswer(data,id){//保存单项答案
|
||||||
|
return request('/order/single/answer/'+id, data, 'post', false);
|
||||||
|
},
|
||||||
|
getAnswer(id){//获取单项答案
|
||||||
|
return request('/order/single/answer/'+id, {}, 'get', false);
|
||||||
|
},
|
||||||
|
getSearchRecommend(){//搜索推荐
|
||||||
|
return request('/class/recommend/list', {}, 'get', false);
|
||||||
|
},
|
||||||
|
changeCoupon(){
|
||||||
|
return request('/coupon/unnotified', {}, 'put', false);
|
||||||
|
},
|
||||||
|
delVipOrder(id){
|
||||||
|
return request('/order/member/'+id, {}, 'DELETE', false);
|
||||||
|
},
|
||||||
|
delItemOrder(id){
|
||||||
|
return request('/order/single/'+id, {}, 'DELETE', false);
|
||||||
|
},
|
||||||
|
shareSign(data){
|
||||||
|
return request('https://dev-app.igandan.com/app/manager/getSignature4bing', data, 'get', false);
|
||||||
|
},
|
||||||
|
getLikeList(){//搜索推荐
|
||||||
|
return request('question/like', {}, 'get', false);
|
||||||
|
},
|
||||||
|
getData(){
|
||||||
|
return request('https://www.fastmock.site/mock/32012a46e9f66a6180214eef5edc79ac/mydata/promote', {}, 'get', false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
export default api
|
||||||
59
components/list/list.vue
Normal file
59
components/list/list.vue
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<view class="u-page">
|
||||||
|
<up-list
|
||||||
|
@scrolltolower="scrolltolower"
|
||||||
|
>
|
||||||
|
<up-list-item
|
||||||
|
v-for="(item, index) in indexList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<up-cell
|
||||||
|
:title="`列表长度-${index + 1}`"
|
||||||
|
>
|
||||||
|
<template #icon>
|
||||||
|
<up-avatar
|
||||||
|
shape="square"
|
||||||
|
size="35"
|
||||||
|
:src="item.url"
|
||||||
|
customStyle="margin: -3px 5px -3px 0"
|
||||||
|
></up-avatar>
|
||||||
|
</template>
|
||||||
|
</up-cell>
|
||||||
|
</up-list-item>
|
||||||
|
</up-list>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||||
|
const indexList = ref([]);
|
||||||
|
const urls = [
|
||||||
|
'https://uview-plus.jiangruyi.com/album/1.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/2.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/3.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/4.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/5.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/6.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/7.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/8.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/9.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/10.jpg',
|
||||||
|
];
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
loadmore();
|
||||||
|
});
|
||||||
|
|
||||||
|
const scrolltolower = () => {
|
||||||
|
loadmore();
|
||||||
|
};
|
||||||
|
|
||||||
|
const loadmore = () => {
|
||||||
|
for (let i = 0; i < 30; i++) {
|
||||||
|
indexList.value.push({
|
||||||
|
url: urls[uni.$u.random(0, urls.length - 1)],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
38
components/tabBar/tabBar.vue
Normal file
38
components/tabBar/tabBar.vue
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<template>
|
||||||
|
<up-tabbar
|
||||||
|
:value="value"
|
||||||
|
:fixed="true"
|
||||||
|
:zIndex="99"
|
||||||
|
:placeholder="true"
|
||||||
|
:safeAreaInsetBottom="true"
|
||||||
|
>
|
||||||
|
<up-tabbar-item text="首页" icon="home" @click="handleClick"></up-tabbar-item>
|
||||||
|
<up-tabbar-item text="放映厅" icon="photo" @click="handleClick"></up-tabbar-item>
|
||||||
|
<up-tabbar-item
|
||||||
|
text="直播"
|
||||||
|
icon="play-right"
|
||||||
|
@click="handleClick"
|
||||||
|
></up-tabbar-item>
|
||||||
|
<up-tabbar-item text="我的" icon="account" @click="handleClick"></up-tabbar-item>
|
||||||
|
</up-tabbar>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from "vue";
|
||||||
|
const props=defineProps({
|
||||||
|
value: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const handleClick = (e) => {
|
||||||
|
if(e==1){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/case/case",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
</style>
|
||||||
20
index.html
Normal file
20
index.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<script>
|
||||||
|
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
||||||
|
CSS.supports('top: constant(a)'))
|
||||||
|
document.write(
|
||||||
|
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||||
|
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||||
|
</script>
|
||||||
|
<title></title>
|
||||||
|
<!--preload-links-->
|
||||||
|
<!--app-context-->
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"><!--app-html--></div>
|
||||||
|
<script type="module" src="/main.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
37
main.js
Normal file
37
main.js
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import App from './App'
|
||||||
|
import uviewPlus, { setConfig } from 'uview-plus'
|
||||||
|
// #ifndef VUE3
|
||||||
|
console.log(222)
|
||||||
|
import Vue from 'vue'
|
||||||
|
import './uni.promisify.adaptor'
|
||||||
|
Vue.config.productionTip = false
|
||||||
|
App.mpType = 'app'
|
||||||
|
const app = new Vue({
|
||||||
|
...App
|
||||||
|
})
|
||||||
|
app.$mount()
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef VUE3
|
||||||
|
import { createSSRApp } from 'vue'
|
||||||
|
export function createApp() {
|
||||||
|
const app = createSSRApp(App)
|
||||||
|
app.use(uviewPlus, () => {
|
||||||
|
return {
|
||||||
|
options: {
|
||||||
|
// 修改$u.config对象的属性
|
||||||
|
config: {
|
||||||
|
// 修改默认单位为rpx,相当于执行 uni.$u.config.unit = 'rpx'
|
||||||
|
unit: 'rpx'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(uni.$u.config.v);
|
||||||
|
return {
|
||||||
|
app
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
console.log(1111)
|
||||||
|
console.log(process.env.NODE_ENV)
|
||||||
86
manifest.json
Normal file
86
manifest.json
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
{
|
||||||
|
"name" : "caseDataBase",
|
||||||
|
"appid" : "__UNI__C5266FA",
|
||||||
|
"description" : "",
|
||||||
|
"versionName" : "1.0.0",
|
||||||
|
"versionCode" : "100",
|
||||||
|
"transformPx" : false,
|
||||||
|
/* 5+App特有相关 */
|
||||||
|
"app-plus" : {
|
||||||
|
"usingComponents" : true,
|
||||||
|
"nvueStyleCompiler" : "uni-app",
|
||||||
|
"compilerVersion" : 3,
|
||||||
|
"compatible" : {
|
||||||
|
"ignoreVersion" : true,
|
||||||
|
"runtimeVersion" : "4.45,4.24,4.18",
|
||||||
|
"compilerVersion" : "4.57"
|
||||||
|
},
|
||||||
|
"splashscreen" : {
|
||||||
|
"alwaysShowBeforeRender" : true,
|
||||||
|
"waiting" : true,
|
||||||
|
"autoclose" : true,
|
||||||
|
"delay" : 0
|
||||||
|
},
|
||||||
|
/* 模块配置 */
|
||||||
|
"modules" : {},
|
||||||
|
/* 应用发布信息 */
|
||||||
|
"distribute" : {
|
||||||
|
/* android打包配置 */
|
||||||
|
"android" : {
|
||||||
|
"permissions" : [
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
/* ios打包配置 */
|
||||||
|
"ios" : {},
|
||||||
|
/* SDK配置 */
|
||||||
|
"sdkConfigs" : {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/* 快应用特有相关 */
|
||||||
|
"quickapp" : {},
|
||||||
|
/* 小程序特有相关 */
|
||||||
|
"mp-weixin" : {
|
||||||
|
"appid" : "",
|
||||||
|
"setting" : {
|
||||||
|
"urlCheck" : false
|
||||||
|
},
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"mp-alipay" : {
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"mp-baidu" : {
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"mp-toutiao" : {
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"uniStatistics" : {
|
||||||
|
"enable" : false
|
||||||
|
},
|
||||||
|
"vueVersion" : "3",
|
||||||
|
"h5" : {
|
||||||
|
"router" : {
|
||||||
|
"mode" : "history",
|
||||||
|
"base" : ""
|
||||||
|
},
|
||||||
|
"devServer" : {
|
||||||
|
"https" : false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
package.json
Normal file
15
package.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "casedatabase",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "main.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"uview-plus": "^3.4.4"
|
||||||
|
}
|
||||||
|
}
|
||||||
67
pages.json
Normal file
67
pages.json
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
"easycom": {
|
||||||
|
"autoscan": true,
|
||||||
|
// 注意一定要放在custom里,否则无效,https://ask.dcloud.net.cn/question/131175
|
||||||
|
"custom": {
|
||||||
|
"^u--(.*)": "@/node_modules/uview-plus/components/u-$1/u-$1.vue",
|
||||||
|
"^up-(.*)": "@/node_modules/uview-plus/components/u-$1/u-$1.vue",
|
||||||
|
"^u-([^-].*)": "@/node_modules/uview-plus/components/u-$1/u-$1.vue"
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pages": [
|
||||||
|
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "pages/login/login",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "登录"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/index/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "uni-app",
|
||||||
|
"enablePullDownRefresh":false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/case/case",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "互动病例"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "pages/apply/apply",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "注册",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"disableScroll": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/register/register",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "注册"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"subPackages": [{
|
||||||
|
"root": "pages_case",
|
||||||
|
"pages": [{
|
||||||
|
"path": "index/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "uni-app分页"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}],
|
||||||
|
|
||||||
|
"globalStyle": {
|
||||||
|
"navigationBarTextStyle": "black",
|
||||||
|
"navigationBarTitleText": "uni-app",
|
||||||
|
"navigationBarBackgroundColor": "#F8F8F8",
|
||||||
|
"backgroundColor": "#F8F8F8"
|
||||||
|
},
|
||||||
|
"uniIdRouter": {}
|
||||||
|
}
|
||||||
225
pages/apply/apply.vue
Normal file
225
pages/apply/apply.vue
Normal file
@ -0,0 +1,225 @@
|
|||||||
|
<template>
|
||||||
|
<view class="logincontent">
|
||||||
|
<up-form labelPosition="left" :model="model" ref="form" labelWidth="115rpx">
|
||||||
|
<up-form-item label="姓名" prop="userInfo.name" borderBottom>
|
||||||
|
<up-input v-model="model.name" placeholder="请输入真实姓名"></up-input>
|
||||||
|
</up-form-item>
|
||||||
|
|
||||||
|
<view class="smsbox">
|
||||||
|
<up-form-item label="医院" prop="userInfo.name" borderBottom @click="showArea=true">
|
||||||
|
<up-input v-model="model.name" placeholder="请选择医院"></up-input>
|
||||||
|
<template #right>
|
||||||
|
<up-icon name="arrow-right"></up-icon>
|
||||||
|
</template>
|
||||||
|
</up-form-item>
|
||||||
|
<up-form-item label="科室" prop="userInfo.name" borderBottom @click="showDepart=true">
|
||||||
|
<up-input v-model="model.name" placeholder="请选择科室"></up-input>
|
||||||
|
<template #right>
|
||||||
|
<up-icon name="arrow-right"></up-icon>
|
||||||
|
</template>
|
||||||
|
</up-form-item>
|
||||||
|
<up-form-item label="职称" prop="userInfo.name" borderBottom @click="showTitle=true">
|
||||||
|
<up-input v-model="model.name" placeholder="请选择职称"></up-input>
|
||||||
|
<template #right>
|
||||||
|
<up-icon name="arrow-right"></up-icon>
|
||||||
|
</template>
|
||||||
|
</up-form-item>
|
||||||
|
<up-form-item label="执业证号(选填)" prop="userInfo.name" borderBottom>
|
||||||
|
<up-input
|
||||||
|
v-model="model.name"
|
||||||
|
placeholder="请输入执业证号"
|
||||||
|
></up-input>
|
||||||
|
</up-form-item>
|
||||||
|
<up-form-item
|
||||||
|
label="执业医师资格证或工作胸牌"
|
||||||
|
prop="userInfo.name"
|
||||||
|
borderBottom
|
||||||
|
>
|
||||||
|
<up-input v-model="model.name" placeholder=""></up-input>
|
||||||
|
<template #right>
|
||||||
|
<view class="rightbox">
|
||||||
|
<view class="uploadwraper">
|
||||||
|
<up-upload @afterRead="afterRead" :maxCount="1"> </up-upload>
|
||||||
|
<image
|
||||||
|
:src="img"
|
||||||
|
mode="widthFix"
|
||||||
|
style="width: 120rpx; height: 80px"
|
||||||
|
class="dimg"
|
||||||
|
></image>
|
||||||
|
</view>
|
||||||
|
<up-icon name="arrow-right"></up-icon>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</up-form-item>
|
||||||
|
</view>
|
||||||
|
</up-form>
|
||||||
|
|
||||||
|
<view class="row">
|
||||||
|
<up-button
|
||||||
|
:customStyle="customStyle"
|
||||||
|
class="custom-style"
|
||||||
|
type="success"
|
||||||
|
text="提交"
|
||||||
|
color="#3cc7c0"
|
||||||
|
size="large"
|
||||||
|
></up-button>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<QfImageCropper
|
||||||
|
v-if="showCroper"
|
||||||
|
:width="500"
|
||||||
|
:height="500"
|
||||||
|
:radius="0"
|
||||||
|
backgroundColor="#000"
|
||||||
|
:src="coperImg"
|
||||||
|
zIndex="999"
|
||||||
|
delay="1500"
|
||||||
|
ref="imgCropper"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@crop="handleCrop"
|
||||||
|
></QfImageCropper>
|
||||||
|
</view>
|
||||||
|
<up-picker @cancel="closeArea" @confirm="confirmArea" :show="showArea" :columns="areacolumns"></up-picker>
|
||||||
|
<up-picker @cancel="closeDepart" @confirm="confirmDepart" :show="showDepart" :columns="departcolumns"></up-picker>
|
||||||
|
<up-picker @cancel="closeTitle" @confirm="confirmTitle" :show="showTitle" :columns="titlecolumns"></up-picker>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, reactive } from "vue";
|
||||||
|
import { onShow } from "@dcloudio/uni-app";
|
||||||
|
import img from "@/static/default.png";
|
||||||
|
import QfImageCropper from "@/uni_modules/qf-image-cropper/components/qf-image-cropper/qf-image-cropper.vue";
|
||||||
|
|
||||||
|
const imgCropper=ref(null);
|
||||||
|
const model = reactive({
|
||||||
|
name: "",
|
||||||
|
});
|
||||||
|
const showCroper = ref(false);
|
||||||
|
const coperImg = ref("");
|
||||||
|
|
||||||
|
const customStyle = reactive({
|
||||||
|
height: "90rpx",
|
||||||
|
fontSize: "36rpx",
|
||||||
|
});
|
||||||
|
const areacolumns = ref([]);
|
||||||
|
const showArea = ref(false);
|
||||||
|
const departcolumns = ref([]);
|
||||||
|
const showDepart = ref(false);
|
||||||
|
const titlecolumns = ref([]);
|
||||||
|
const showTitle = ref(false);
|
||||||
|
const closeArea = () => {
|
||||||
|
showArea.value = false;
|
||||||
|
};
|
||||||
|
const confirmArea = (e) => {
|
||||||
|
|
||||||
|
showArea.value = false;
|
||||||
|
};
|
||||||
|
const closeDepart = () => {
|
||||||
|
showDepart.value = false;
|
||||||
|
};
|
||||||
|
const confirmDepart = (e) => {
|
||||||
|
console.log(e);
|
||||||
|
showDepart.value = false;
|
||||||
|
};
|
||||||
|
const closeTitle = () => {
|
||||||
|
showTitle.value = false;
|
||||||
|
};
|
||||||
|
const confirmTitle = (e) => {
|
||||||
|
showTitle.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const afterRead = (event) => {
|
||||||
|
// console.log(event.file);
|
||||||
|
// console.log(QfImageCropper);
|
||||||
|
coperImg.value =event.file.url;
|
||||||
|
showCroper.value = true;
|
||||||
|
};
|
||||||
|
const handleCrop = (e) => {
|
||||||
|
console.log(e.tempFilePath)
|
||||||
|
// uni.previewImage({
|
||||||
|
// urls: [e.tempFilePath],
|
||||||
|
// current: 0,
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
const handleCancel = () => {
|
||||||
|
showCroper.value = false;
|
||||||
|
};
|
||||||
|
onShow(() => {
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.logincontent {
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
background: #fff;
|
||||||
|
.rightbox {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.uploadwraper {
|
||||||
|
position: relative;
|
||||||
|
width: 140rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
::v-deep .u-upload {
|
||||||
|
width: 140rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.uploadwraper ::v-deep .dimg {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
.smsbox ::v-deep .u-form-item:nth-child(4) .u-form-item__body__left {
|
||||||
|
width: 240rpx !important;
|
||||||
|
}
|
||||||
|
.smsbox ::v-deep .u-form-item:nth-child(5) .u-form-item__body__left {
|
||||||
|
width: 418rpx !important;
|
||||||
|
}
|
||||||
|
::v-deep .u-form-item__body__left__content__label {
|
||||||
|
font-size: 34rpx;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
padding: 124rpx 0 64rpx 30rpx;
|
||||||
|
//padding-left: 30rpx;
|
||||||
|
font-size: 46rpx;
|
||||||
|
font-stretch: normal;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
::v-deep .u-form {
|
||||||
|
padding: 0 30rpx;
|
||||||
|
}
|
||||||
|
.row {
|
||||||
|
margin-top: 60rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
.left {
|
||||||
|
flex: 1;
|
||||||
|
color: #3cc7c0;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.right {
|
||||||
|
flex: 1;
|
||||||
|
color: #666;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
::v-deep .u-button--large .u-button__text {
|
||||||
|
font-size: 36rpx !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep .wrap {
|
||||||
|
border-radius: 16rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
34
pages/case/case.vue
Normal file
34
pages/case/case.vue
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<template>
|
||||||
|
<view class="content">
|
||||||
|
<view class="page">
|
||||||
|
<web-view src="https://wx.igandan.com/hcp/toRegister" @load="loadView"></web-view>
|
||||||
|
</view>
|
||||||
|
<tabBar :value="1"></tabBar>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref } from "vue";
|
||||||
|
import { onShow, onReady } from "@dcloudio/uni-app";
|
||||||
|
import tabBar from "@/components/tabBar/tabBar.vue";
|
||||||
|
|
||||||
|
const loadView = () => {
|
||||||
|
console.log("加载完成");
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: "注册", // 使用data中的title或者动态生成的title
|
||||||
|
});
|
||||||
|
};
|
||||||
|
onShow(() => {
|
||||||
|
|
||||||
|
});
|
||||||
|
onReady(() => {});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.page {
|
||||||
|
width: 100%;
|
||||||
|
height: calc(100vh - 100rpx);
|
||||||
|
overflow-y: scroll;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
89
pages/index/index.vue
Normal file
89
pages/index/index.vue
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<template>
|
||||||
|
<view class="u-page">
|
||||||
|
<scroll-view scroll-y="true"
|
||||||
|
@scrolltolower="scrolltolower" refresher-enabled="true" :refresher-triggered="triggered"
|
||||||
|
@refresherrefresh="onRefresh" @refresherrestore="onRestore" :refresher-threshold="100">
|
||||||
|
<view v-for="(item, index) in indexList" :key="index">
|
||||||
|
<up-cell :title="`111`">
|
||||||
|
<template #icon>
|
||||||
|
<up-avatar shape="square" size="35" :src="item.url"
|
||||||
|
customStyle="margin: -3px 5px -3px 0"></up-avatar>
|
||||||
|
</template>
|
||||||
|
</up-cell>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
<tabBar></tabBar>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
reactive
|
||||||
|
} from 'vue';
|
||||||
|
import {
|
||||||
|
onLoad,
|
||||||
|
onShow,
|
||||||
|
onPullDownRefresh
|
||||||
|
} from '@dcloudio/uni-app';
|
||||||
|
import tabBar from '@/components/tabBar/tabBar.vue';
|
||||||
|
import api from "@/api/api"
|
||||||
|
console.log(api)
|
||||||
|
const indexList = ref([]);
|
||||||
|
const status = ref('loadmore');
|
||||||
|
const triggered = ref(false);
|
||||||
|
const urls = [
|
||||||
|
'https://uview-plus.jiangruyi.com/album/1.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/2.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/3.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/4.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/5.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/6.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/7.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/8.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/9.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/10.jpg',
|
||||||
|
];
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
loadmore();
|
||||||
|
triggered.value = 'restore';
|
||||||
|
});
|
||||||
|
const onRefresh = () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
triggered.value = false
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
|
}
|
||||||
|
const onRestore = () => {
|
||||||
|
triggered.value = 'restore'; // 需要重置
|
||||||
|
console.log("onRestore");
|
||||||
|
};
|
||||||
|
const scrolltolower = () => {
|
||||||
|
loadmore();
|
||||||
|
};
|
||||||
|
// onPullDownRefresh(() => {
|
||||||
|
// getData();
|
||||||
|
|
||||||
|
// });
|
||||||
|
const getData = () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
triggered.value = false;
|
||||||
|
}, 2000)
|
||||||
|
// api.getData().then(res=>{
|
||||||
|
// alert(11)
|
||||||
|
// refresherTriggered.value=false;
|
||||||
|
// uni.stopPullDownRefresh()
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const loadmore = () => {
|
||||||
|
for (let i = 0; i < 30; i++) {
|
||||||
|
indexList.value.push({
|
||||||
|
url: urls[uni.$u.random(0, urls.length - 1)],
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
322
pages/login/login.vue
Normal file
322
pages/login/login.vue
Normal file
@ -0,0 +1,322 @@
|
|||||||
|
<template>
|
||||||
|
<view class="logincontent">
|
||||||
|
<view class="title">登录观看</view>
|
||||||
|
<up-form labelPosition="left" :model="model" ref="form" labelWidth="115rpx">
|
||||||
|
<up-form-item
|
||||||
|
label="手机号"
|
||||||
|
prop="userInfo.name"
|
||||||
|
borderBottom
|
||||||
|
v-if="!isPhoneLogin"
|
||||||
|
>
|
||||||
|
<up-input
|
||||||
|
v-model="model.name"
|
||||||
|
placeholder="请输入肝胆相照专家版手机号"
|
||||||
|
></up-input>
|
||||||
|
</up-form-item>
|
||||||
|
<!-- <view v-if="isPhoneLogin" class="pwdbox">
|
||||||
|
<up-form-item label="密码" prop="userInfo.name" borderBottom>
|
||||||
|
<up-input
|
||||||
|
v-model="model.name"
|
||||||
|
type="password"
|
||||||
|
placeholder="请输入密码"
|
||||||
|
></up-input>
|
||||||
|
</up-form-item>
|
||||||
|
<up-form-item
|
||||||
|
label="图形验证码"
|
||||||
|
prop="userInfo.name"
|
||||||
|
borderBottom
|
||||||
|
v-if="isPwdPic"
|
||||||
|
>
|
||||||
|
<up-input
|
||||||
|
v-model="model.name"
|
||||||
|
placeholder="请输入图形验证码"
|
||||||
|
></up-input>
|
||||||
|
<template #right>
|
||||||
|
<up-image
|
||||||
|
:show-loading="true"
|
||||||
|
src="https://cdn.uviewui.com/uview/album/1.jpg"
|
||||||
|
width="160rpx"
|
||||||
|
height="74rpx"
|
||||||
|
></up-image>
|
||||||
|
</template>
|
||||||
|
</up-form-item>
|
||||||
|
</view> -->
|
||||||
|
<view class="smsbox" v-if="!isPhoneLogin">
|
||||||
|
<!-- <up-form-item label="图形验证码" prop="userInfo.name" borderBottom>
|
||||||
|
<up-input
|
||||||
|
v-model="model.name"
|
||||||
|
placeholder="请输入图形验证码"
|
||||||
|
></up-input>
|
||||||
|
<template #right>
|
||||||
|
<up-image
|
||||||
|
:show-loading="true"
|
||||||
|
src="https://cdn.uviewui.com/uview/album/1.jpg"
|
||||||
|
width="160rpx"
|
||||||
|
height="74rpx"
|
||||||
|
></up-image>
|
||||||
|
</template>
|
||||||
|
</up-form-item> -->
|
||||||
|
<up-form-item label="验证码" prop="userInfo.name" borderBottom>
|
||||||
|
<up-input v-model="model.name" placeholder="请输入验证码"></up-input>
|
||||||
|
<template #right>
|
||||||
|
<view class="wrap">
|
||||||
|
<up-toast ref="uToastRef"></up-toast>
|
||||||
|
<up-code
|
||||||
|
:seconds="seconds"
|
||||||
|
@end="end"
|
||||||
|
@start="start"
|
||||||
|
ref="uCodeRef"
|
||||||
|
@change="codeChange"
|
||||||
|
></up-code>
|
||||||
|
<up-button
|
||||||
|
@tap="getCode"
|
||||||
|
:customStyle="customCode"
|
||||||
|
color="#e2e2e2"
|
||||||
|
class="custom-code"
|
||||||
|
><text class="codetext">{{ tips }}</text></up-button
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</up-form-item>
|
||||||
|
</view>
|
||||||
|
</up-form>
|
||||||
|
|
||||||
|
<view class="row" v-if="!isPhoneLogin">
|
||||||
|
<up-button
|
||||||
|
:customStyle="customStyle"
|
||||||
|
class="custom-style"
|
||||||
|
type="success"
|
||||||
|
text="登录"
|
||||||
|
color="#3cc7c0"
|
||||||
|
size="large"
|
||||||
|
></up-button>
|
||||||
|
</view>
|
||||||
|
<view class="row" style="margin-top: 120rpx" v-else>
|
||||||
|
<up-button
|
||||||
|
:customStyle="customStyle"
|
||||||
|
class="custom-style"
|
||||||
|
type="success"
|
||||||
|
@getphonenumber="getPhoneNumber"
|
||||||
|
open-type="getPhoneNumber"
|
||||||
|
text="手机号快捷登录"
|
||||||
|
color="#3cc7c0"
|
||||||
|
size="large"
|
||||||
|
></up-button>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="left" @click="switchType">
|
||||||
|
{{ isPhoneLogin ? "用短信验证码登录" : "快捷登录" }}
|
||||||
|
</view>
|
||||||
|
<view class="right" @click="goRegister"> 注册 </view>
|
||||||
|
</view>
|
||||||
|
<view class="row" style="margin-top:10rpx">
|
||||||
|
<up-radio-group v-model="checked">
|
||||||
|
<up-radio
|
||||||
|
label="我已阅读并同意<a>《用户协议》</a>"
|
||||||
|
></up-radio>
|
||||||
|
</up-radio-group>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="tip">操作说明</view>
|
||||||
|
</view>
|
||||||
|
<view class="line">
|
||||||
|
<view class="qq">1、</view>
|
||||||
|
肝胆相照注册账号与微信绑定,肝胆相照相关直播、视频无忧随心看
|
||||||
|
</view>
|
||||||
|
<view class="line">
|
||||||
|
<view class="qq">2、</view>
|
||||||
|
仅需操作一次,后续通过微信观看直播、视频无需额外操作,立即进入
|
||||||
|
</view>
|
||||||
|
<view class="line">
|
||||||
|
<view class="qq">3、</view>
|
||||||
|
若您还未注册肝胆相照专家版App, 请直接点击“注册”进行注册操作
|
||||||
|
</view>
|
||||||
|
<view class="desc">
|
||||||
|
若您有任何疑问或需要我们协助,请与您的小助手联系或直接微信联系<text
|
||||||
|
class="red"
|
||||||
|
>igandan1000</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, reactive } from "vue";
|
||||||
|
import { onShow } from "@dcloudio/uni-app";
|
||||||
|
import api from "@/api/api";
|
||||||
|
import auth from "@/utils/auth";
|
||||||
|
const model = reactive({
|
||||||
|
name: "",
|
||||||
|
});
|
||||||
|
const isPwdPic = ref(false);
|
||||||
|
const isPhoneLogin = ref(true);
|
||||||
|
const customStyle = reactive({
|
||||||
|
height: "90rpx",
|
||||||
|
fontSize: "36rpx",
|
||||||
|
});
|
||||||
|
const customCode = reactive({
|
||||||
|
color: "#3ec7c0",
|
||||||
|
height: "64rpx",
|
||||||
|
fontSize: "28rpx",
|
||||||
|
borderColor: "#e2e2e2",
|
||||||
|
opcity: "1",
|
||||||
|
});
|
||||||
|
const tips = ref("");
|
||||||
|
const seconds = ref(10);
|
||||||
|
const uCodeRef = ref(null);
|
||||||
|
const checked = ref(false);
|
||||||
|
const getPhoneNumber = (e) => {
|
||||||
|
if (e.detail.errMsg === "getPhoneNumber:ok") {
|
||||||
|
console.log(e.target.code)
|
||||||
|
auth().then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
api.wxLogin({
|
||||||
|
phone_code: e.target.code,
|
||||||
|
wx_code: res,
|
||||||
|
})
|
||||||
|
.then((data) => {
|
||||||
|
const { envVersion } = uni.getAccountInfoSync().miniProgram;
|
||||||
|
if (envVersion == "release") {
|
||||||
|
uni.setStorageSync("AUTH_TOKEN", data.token);
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync("DEV_AUTH_TOKEN", data.token);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const isPhoneNum = (phonenum) => {
|
||||||
|
let reg = /^1[3456789]\d{9}$/;
|
||||||
|
if (!reg.test(phonenum)) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入有效的手机号码!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const codeChange = (text) => {
|
||||||
|
tips.value = text;
|
||||||
|
};
|
||||||
|
const switchType = () => {
|
||||||
|
isPhoneLogin.value = !isPhoneLogin.value;
|
||||||
|
};
|
||||||
|
const goRegister = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/register/register",
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const getCode = () => {
|
||||||
|
if (uCodeRef.value.canGetCode) {
|
||||||
|
// 模拟向后端请求验证码
|
||||||
|
uni.showLoading({
|
||||||
|
title: "正在获取验证码",
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
// 这里此提示会被start()方法中的提示覆盖
|
||||||
|
uni.$u.toast("验证码已发送");
|
||||||
|
// 通知验证码组件内部开始倒计时
|
||||||
|
uCodeRef.value.start();
|
||||||
|
}, 2000);
|
||||||
|
} else {
|
||||||
|
uni.$u.toast("倒计时结束后再发送");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const end = () => {
|
||||||
|
customCode.opacity = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
const start = () => {
|
||||||
|
customCode.opacity = 0.5;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.logincontent {
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
background: #fff;
|
||||||
|
.pwdbox ::v-deep .u-form-item:nth-child(2) .u-form-item__body__left {
|
||||||
|
width: 180rpx !important;
|
||||||
|
}
|
||||||
|
.smsbox ::v-deep .u-form-item:first-child .u-form-item__body__left {
|
||||||
|
width: 180rpx !important;
|
||||||
|
}
|
||||||
|
::v-deep .u-form-item__body__left__content__label {
|
||||||
|
font-size: 34rpx;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
padding: 124rpx 0 64rpx 30rpx;
|
||||||
|
//padding-left: 30rpx;
|
||||||
|
font-size: 46rpx;
|
||||||
|
font-stretch: normal;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
::v-deep .u-form {
|
||||||
|
padding: 0 30rpx;
|
||||||
|
}
|
||||||
|
.row {
|
||||||
|
margin-top: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
.left {
|
||||||
|
flex: 1;
|
||||||
|
color: #3cc7c0;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.right {
|
||||||
|
flex: 1;
|
||||||
|
color: #666;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
::v-deep .u-button--large .u-button__text {
|
||||||
|
font-size: 36rpx !important;
|
||||||
|
}
|
||||||
|
.tip {
|
||||||
|
color: rgb(51, 51, 51);
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep .wrap {
|
||||||
|
border-radius: 16rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
// ::v-deep .custom-code .codetext,::v-deep .custom-code .u-button{
|
||||||
|
// display: flex;
|
||||||
|
// justify-content: center;
|
||||||
|
// align-content: center;
|
||||||
|
// color:#3ec7c0!important;
|
||||||
|
// height:64rpx!important;
|
||||||
|
// font-size: 28rpx!important;
|
||||||
|
// border:none!important;
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
.line {
|
||||||
|
padding: 0 30rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
color: rgb(153, 153, 153);
|
||||||
|
line-height: 44rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
display: flex;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
}
|
||||||
|
.desc {
|
||||||
|
padding: 0 30rpx;
|
||||||
|
color: rgb(153, 153, 153);
|
||||||
|
line-height: 44rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
.red {
|
||||||
|
color: rgb(255, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
227
pages/register/register.vue
Normal file
227
pages/register/register.vue
Normal file
@ -0,0 +1,227 @@
|
|||||||
|
<template>
|
||||||
|
<view class="logincontent">
|
||||||
|
<up-form labelPosition="left" :model="model" ref="form" labelWidth="115rpx">
|
||||||
|
<up-form-item
|
||||||
|
label="手机号"
|
||||||
|
prop="userInfo.name"
|
||||||
|
borderBottom
|
||||||
|
|
||||||
|
>
|
||||||
|
<up-input v-model="model.name" placeholder="请输入肝胆相照专家版手机号"></up-input>
|
||||||
|
</up-form-item>
|
||||||
|
|
||||||
|
<view class="smsbox" >
|
||||||
|
<up-form-item label="图形验证码" prop="userInfo.name" borderBottom >
|
||||||
|
<up-input v-model="model.name" placeholder="请输入图形验证码"></up-input>
|
||||||
|
<template #right>
|
||||||
|
<up-image :show-loading="true" src="https://cdn.uviewui.com/uview/album/1.jpg" width="160rpx" height="74rpx" ></up-image>
|
||||||
|
</template>
|
||||||
|
</up-form-item>
|
||||||
|
<up-form-item label="验证码" prop="userInfo.name" borderBottom >
|
||||||
|
<up-input v-model="model.name" placeholder="请输入验证码"></up-input>
|
||||||
|
<template #right>
|
||||||
|
<view class="wrap">
|
||||||
|
<up-toast ref="uToastRef"></up-toast>
|
||||||
|
<up-code :seconds="seconds" @end="end" @start="start" ref="uCodeRef"
|
||||||
|
@change="codeChange" ></up-code>
|
||||||
|
<up-button @tap="getCode" :customStyle="customCode" color="#e2e2e2" class="custom-code"><text class="codetext">{{tips}}</text></up-button>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</up-form-item>
|
||||||
|
<up-form-item label="密码" prop="userInfo.name" borderBottom >
|
||||||
|
<up-input v-model="model.name" type="password" placeholder="请输入6-16位字母、数字组合"></up-input>
|
||||||
|
</up-form-item>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</up-form>
|
||||||
|
|
||||||
|
<view class="row">
|
||||||
|
<up-button :customStyle="customStyle" class="custom-style" type="success" text="下一步" color="#3cc7c0" size="large" @click="goApply"></up-button>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="tip">操作说明</view>
|
||||||
|
</view>
|
||||||
|
<view class="line">
|
||||||
|
<view class="qq">1、</view>
|
||||||
|
肝胆相照注册账号与微信绑定,肝胆相照相关直播、视频无忧随心看
|
||||||
|
</view>
|
||||||
|
<view class="line">
|
||||||
|
<view class="qq">2、</view>
|
||||||
|
仅需操作一次,后续通过微信观看直播、视频无需额外操作,立即进入
|
||||||
|
</view>
|
||||||
|
<view class="line">
|
||||||
|
<view class="qq">3、</view>
|
||||||
|
若您还未注册肝胆相照专家版App, 请直接点击“注册”进行注册操作
|
||||||
|
</view>
|
||||||
|
<view class="desc">
|
||||||
|
若您有任何疑问或需要我们协助,请与您的小助手联系或直接微信联系<text class="red">igandan1000</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, reactive } from "vue";
|
||||||
|
import { onShow } from "@dcloudio/uni-app";
|
||||||
|
const model = reactive({
|
||||||
|
name: "",
|
||||||
|
});
|
||||||
|
const isPwdPic = ref(false);
|
||||||
|
const isPhoneLogin = ref(true);
|
||||||
|
const customStyle = reactive({
|
||||||
|
height: '90rpx',
|
||||||
|
fontSize:'36rpx'
|
||||||
|
});
|
||||||
|
const customCode = reactive({
|
||||||
|
color: '#3ec7c0',
|
||||||
|
height: '64rpx',
|
||||||
|
fontSize:'28rpx',
|
||||||
|
borderColor:'#e2e2e2',
|
||||||
|
opcity:'1'
|
||||||
|
});
|
||||||
|
const tips = ref('');
|
||||||
|
const seconds = ref(10);
|
||||||
|
const uCodeRef = ref(null);
|
||||||
|
const isPhoneNum = (phonenum) => {
|
||||||
|
let reg = /^1[3456789]\d{9}$/;
|
||||||
|
if (!reg.test(phonenum)) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入有效的手机号码!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const validate=()=>{
|
||||||
|
if(!(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/.test(pwd))){
|
||||||
|
uni.showToast({
|
||||||
|
title: "密码应为6-16位数字或字母组合",
|
||||||
|
icon: "none",
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
const codeChange = (text) => {
|
||||||
|
tips.value = text;
|
||||||
|
};
|
||||||
|
const goApply = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/apply/apply',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const getCode = () => {
|
||||||
|
if (uCodeRef.value.canGetCode) {
|
||||||
|
// 模拟向后端请求验证码
|
||||||
|
uni.showLoading({
|
||||||
|
title: '正在获取验证码',
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
// 这里此提示会被start()方法中的提示覆盖
|
||||||
|
uni.$u.toast('验证码已发送');
|
||||||
|
// 通知验证码组件内部开始倒计时
|
||||||
|
uCodeRef.value.start();
|
||||||
|
}, 2000);
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('倒计时结束后再发送');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const end = () => {
|
||||||
|
customCode.opacity = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
const start = () => {
|
||||||
|
customCode.opacity = 0.5;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.logincontent {
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
background: #fff;
|
||||||
|
.pwdbox ::v-deep .u-form-item:nth-child(2) .u-form-item__body__left{
|
||||||
|
width:180rpx!important;
|
||||||
|
}
|
||||||
|
.smsbox ::v-deep .u-form-item:first-child .u-form-item__body__left{
|
||||||
|
width:180rpx!important;
|
||||||
|
}
|
||||||
|
::v-deep .u-form-item__body__left__content__label{
|
||||||
|
font-size: 34rpx;
|
||||||
|
color:#000;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
padding: 124rpx 0 64rpx 30rpx;
|
||||||
|
//padding-left: 30rpx;
|
||||||
|
font-size: 46rpx;
|
||||||
|
font-stretch: normal;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
::v-deep .u-form {
|
||||||
|
padding: 0 30rpx;
|
||||||
|
}
|
||||||
|
.row {
|
||||||
|
margin-top: 60rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
.left {
|
||||||
|
flex: 1;
|
||||||
|
color: #3cc7c0;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.right {
|
||||||
|
flex: 1;
|
||||||
|
color: #666;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
::v-deep .u-button--large .u-button__text{
|
||||||
|
font-size:36rpx!important;
|
||||||
|
}
|
||||||
|
.tip{
|
||||||
|
color: rgb(51, 51, 51);
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep .wrap{
|
||||||
|
border-radius: 16rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
border:none;
|
||||||
|
}
|
||||||
|
// ::v-deep .custom-code .codetext,::v-deep .custom-code .u-button{
|
||||||
|
// display: flex;
|
||||||
|
// justify-content: center;
|
||||||
|
// align-content: center;
|
||||||
|
// color:#3ec7c0!important;
|
||||||
|
// height:64rpx!important;
|
||||||
|
// font-size: 28rpx!important;
|
||||||
|
// border:none!important;
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
.line{
|
||||||
|
padding: 0 30rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
color: rgb(153, 153, 153);
|
||||||
|
line-height: 44rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
display: flex;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
}
|
||||||
|
.desc{
|
||||||
|
padding: 0 30rpx;
|
||||||
|
color: rgb(153, 153, 153);
|
||||||
|
line-height: 44rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
.red{
|
||||||
|
color: rgb(255, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
60
pages_case/index/index.vue
Normal file
60
pages_case/index/index.vue
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<template>
|
||||||
|
<view class="u-page">
|
||||||
|
<up-list
|
||||||
|
@scrolltolower="scrolltolower"
|
||||||
|
>
|
||||||
|
<up-list-item
|
||||||
|
v-for="(item, index) in indexList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<up-cell
|
||||||
|
:title="`列表长度-${index + 1}`"
|
||||||
|
>
|
||||||
|
<template #icon>
|
||||||
|
<up-avatar
|
||||||
|
shape="square"
|
||||||
|
size="35"
|
||||||
|
:src="item.url"
|
||||||
|
customStyle="margin: -3px 5px -3px 0"
|
||||||
|
></up-avatar>
|
||||||
|
</template>
|
||||||
|
</up-cell>
|
||||||
|
</up-list-item>
|
||||||
|
</up-list>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||||
|
|
||||||
|
const indexList = ref([]);
|
||||||
|
const urls = [
|
||||||
|
'https://uview-plus.jiangruyi.com/album/1.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/2.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/3.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/4.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/5.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/6.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/7.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/8.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/9.jpg',
|
||||||
|
'https://uview-plus.jiangruyi.com/album/10.jpg',
|
||||||
|
];
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
loadmore();
|
||||||
|
});
|
||||||
|
|
||||||
|
const scrolltolower = () => {
|
||||||
|
loadmore();
|
||||||
|
};
|
||||||
|
|
||||||
|
const loadmore = () => {
|
||||||
|
for (let i = 0; i < 30; i++) {
|
||||||
|
indexList.value.push({
|
||||||
|
url: urls[uni.$u.random(0, urls.length - 1)],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
BIN
static/default.png
Normal file
BIN
static/default.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
BIN
static/logo.png
Normal file
BIN
static/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
10
uni.promisify.adaptor.js
Normal file
10
uni.promisify.adaptor.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
uni.addInterceptor({
|
||||||
|
returnValue (res) {
|
||||||
|
if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
res.then((res) => res[0] ? reject(res[0]) : resolve(res[1]));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
77
uni.scss
Normal file
77
uni.scss
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
/**
|
||||||
|
* 这里是uni-app内置的常用样式变量
|
||||||
|
*
|
||||||
|
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||||
|
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||||
|
*
|
||||||
|
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||||
|
*/
|
||||||
|
@import 'uview-plus/theme.scss';
|
||||||
|
|
||||||
|
/* 颜色变量 */
|
||||||
|
|
||||||
|
/* 行为相关颜色 */
|
||||||
|
$uni-color-primary: #007aff;
|
||||||
|
$uni-color-success: #4cd964;
|
||||||
|
$uni-color-warning: #f0ad4e;
|
||||||
|
$uni-color-error: #dd524d;
|
||||||
|
|
||||||
|
/* 文字基本颜色 */
|
||||||
|
$uni-text-color:#333;//基本色
|
||||||
|
$uni-text-color-inverse:#fff;//反色
|
||||||
|
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
|
||||||
|
$uni-text-color-placeholder: #808080;
|
||||||
|
$uni-text-color-disable:#c0c0c0;
|
||||||
|
|
||||||
|
/* 背景颜色 */
|
||||||
|
$uni-bg-color:#ffffff;
|
||||||
|
$uni-bg-color-grey:#f8f8f8;
|
||||||
|
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
|
||||||
|
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
|
||||||
|
|
||||||
|
/* 边框颜色 */
|
||||||
|
$uni-border-color:#c8c7cc;
|
||||||
|
|
||||||
|
/* 尺寸变量 */
|
||||||
|
|
||||||
|
/* 文字尺寸 */
|
||||||
|
$uni-font-size-sm:12px;
|
||||||
|
$uni-font-size-base:14px;
|
||||||
|
$uni-font-size-lg:16px;
|
||||||
|
|
||||||
|
/* 图片尺寸 */
|
||||||
|
$uni-img-size-sm:20px;
|
||||||
|
$uni-img-size-base:26px;
|
||||||
|
$uni-img-size-lg:40px;
|
||||||
|
|
||||||
|
/* Border Radius */
|
||||||
|
$uni-border-radius-sm: 2px;
|
||||||
|
$uni-border-radius-base: 3px;
|
||||||
|
$uni-border-radius-lg: 6px;
|
||||||
|
$uni-border-radius-circle: 50%;
|
||||||
|
|
||||||
|
/* 水平间距 */
|
||||||
|
$uni-spacing-row-sm: 5px;
|
||||||
|
$uni-spacing-row-base: 10px;
|
||||||
|
$uni-spacing-row-lg: 15px;
|
||||||
|
|
||||||
|
/* 垂直间距 */
|
||||||
|
$uni-spacing-col-sm: 4px;
|
||||||
|
$uni-spacing-col-base: 8px;
|
||||||
|
$uni-spacing-col-lg: 12px;
|
||||||
|
|
||||||
|
/* 透明度 */
|
||||||
|
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
|
||||||
|
|
||||||
|
/* 文章场景相关 */
|
||||||
|
$uni-color-title: #2C405A; // 文章标题颜色
|
||||||
|
$uni-font-size-title:20px;
|
||||||
|
$uni-color-subtitle: #555555; // 二级标题颜色
|
||||||
|
$uni-font-size-subtitle:26px;
|
||||||
|
$uni-color-paragraph: #3F536E; // 文章段落颜色
|
||||||
|
$uni-font-size-paragraph:15px;
|
||||||
22
utils/auth.js
Normal file
22
utils/auth.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
function auth(){ //鉴权
|
||||||
|
return new Promise((resolve,reject)=>{
|
||||||
|
uni.login({
|
||||||
|
provider: 'weixin', //使用微信登录
|
||||||
|
onlyAuthorize: true, //不弹出授权页面,直接进入微信登录流程
|
||||||
|
success(res){
|
||||||
|
if(res.errMsg=="login:ok"){
|
||||||
|
resolve(res.code)
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title:res.errMsg,
|
||||||
|
icon:'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail(err){
|
||||||
|
reject(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export default auth
|
||||||
7
utils/config.js
Normal file
7
utils/config.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
let BASE_URL=''
|
||||||
|
if(process.env.NODE_ENV=='production'){
|
||||||
|
BASE_URL='1111111'
|
||||||
|
}else{
|
||||||
|
BASE_URL='22222222'
|
||||||
|
}
|
||||||
|
export default BASE_URL
|
||||||
22
utils/navTo.js
Normal file
22
utils/navTo.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import pageUrl from './pageUrl'
|
||||||
|
function navTo(obj){
|
||||||
|
// let token='';
|
||||||
|
// if(process.env.NODE_ENV === 'development'){
|
||||||
|
// token = uni.getStorageSync('DEV_AUTH_TOKEN_FIGURE');
|
||||||
|
// }else{
|
||||||
|
// token = uni.getStorageSync('AUTH_TOKEN_FIGURE');
|
||||||
|
// }
|
||||||
|
// if(!token){
|
||||||
|
// let page_url=pageUrl();
|
||||||
|
// uni.setStorageSync('redirectUrl',page_url);
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: '/pages/login/login?redirectUrl=has'
|
||||||
|
// });
|
||||||
|
// }else{
|
||||||
|
// uni.navigateTo(obj)
|
||||||
|
// }
|
||||||
|
uni.navigateTo(obj)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default navTo
|
||||||
19
utils/pageUrl.js
Normal file
19
utils/pageUrl.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
function pageUrl(){
|
||||||
|
// 获取当前页面的实例
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
const currentPage = pages[pages.length - 1];
|
||||||
|
|
||||||
|
// 获取页面的完整URL
|
||||||
|
const url = currentPage.route; // 页面路径
|
||||||
|
const options = currentPage.options; // 如果有查询参数,将会在这里
|
||||||
|
|
||||||
|
// 拼接URL
|
||||||
|
let fullUrl = url + '?';
|
||||||
|
for (let key in options) {
|
||||||
|
fullUrl += `${key}=${options[key]}&`;
|
||||||
|
}
|
||||||
|
fullUrl = fullUrl.substring(0, fullUrl.length - 1); // 移除最后一个"&"
|
||||||
|
|
||||||
|
return fullUrl
|
||||||
|
}
|
||||||
|
export default pageUrl
|
||||||
119
utils/request.js
Normal file
119
utils/request.js
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
/**
|
||||||
|
* @Method Description
|
||||||
|
* @Author: zjd@
|
||||||
|
* @Description: 数据请求整合 处理
|
||||||
|
* @BASE_URL server
|
||||||
|
* @param {a===Object||file} 传给后台参数Method 请求方法 url 所请求的接口路径
|
||||||
|
* @return Promise对象 所有数据信息
|
||||||
|
* @createTime: 2024-7-22 15:05:06
|
||||||
|
*/
|
||||||
|
import BASE_URL from "./config.js";
|
||||||
|
//import host from "@/utils/host";
|
||||||
|
//import {msg} from "./util.js"
|
||||||
|
import pageUrl from './pageUrl'
|
||||||
|
//alert(BASE_URL)
|
||||||
|
//const BASE_URL=host+"/api"
|
||||||
|
export const request = (url, data = {}, method = 'post',loading = false,contentType='application/x-www-form-urlencoded') => {
|
||||||
|
if(loading){
|
||||||
|
uni.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
mask:true
|
||||||
|
})
|
||||||
|
|
||||||
|
};
|
||||||
|
uni.setStorageSync('DEV_AUTH_TOKEN_FIGURE','eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMTgzMzQzMjEwMTI3ODQ1Mzc2MCIsImV4cCI6MTc0MzEzMTY2OCwibmJmIjoxNzQyODcyNDY4LCJpYXQiOjE3NDI4NzI0Njh9.RGsdwvwck8oDNbStbMA18i5VOmy9JbK68hLNILDGUMQ');
|
||||||
|
let token='';
|
||||||
|
if(process.env.NODE_ENV === 'development'){
|
||||||
|
token = uni.getStorageSync('DEV_AUTH_TOKEN_FIGURE');
|
||||||
|
}else{
|
||||||
|
token = uni.getStorageSync('AUTH_TOKEN_FIGURE');
|
||||||
|
}
|
||||||
|
// if(!token){
|
||||||
|
// let freeList=['/login','/code/phone','/login/wx','/index','/user/check'];
|
||||||
|
// if(freeList.indexOf(url) == -1){
|
||||||
|
// let page_url=pageUrl();
|
||||||
|
// if(page_url.indexOf('/login/login')==-1){
|
||||||
|
|
||||||
|
// uni.setStorageSync('redirectUrl',page_url);
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: '/pages/login/login?redirectUrl=has'
|
||||||
|
// });
|
||||||
|
// return false;
|
||||||
|
// }else{
|
||||||
|
|
||||||
|
|
||||||
|
// uni.setStorageSync('redirectUrl','');
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: '/pages/login/login'
|
||||||
|
// });
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
let header = {
|
||||||
|
'content-type':contentType ,
|
||||||
|
'Authorization': 'Bearer ' + token
|
||||||
|
}
|
||||||
|
return new Promise(function(e, n) {
|
||||||
|
let timestamp = Date.now();
|
||||||
|
uni.request({
|
||||||
|
data,
|
||||||
|
url: url.indexOf('http')!=-1?url:encodeURI(BASE_URL+url+"?timestamp="+timestamp),
|
||||||
|
method: method,
|
||||||
|
sslVerify:false,
|
||||||
|
header:url.indexOf('/manager/getSignature4bing')==-1?header:{},
|
||||||
|
timeout:10000,
|
||||||
|
success: function(res) {
|
||||||
|
var Authorization_token = res.header.Authorization;
|
||||||
|
if(Authorization_token){
|
||||||
|
if(process.env.NODE_ENV === 'development'){
|
||||||
|
uni.setStorageSync('DEV_AUTH_TOKEN_FIGURE', Authorization_token);
|
||||||
|
}else{
|
||||||
|
uni.setStorageSync('AUTH_TOKEN_FIGURE', Authorization_token);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if(loading){
|
||||||
|
uni.hideLoading();
|
||||||
|
};
|
||||||
|
if(res.data.code==200){
|
||||||
|
e(res)
|
||||||
|
}else if(res.data.code==401 || res.data.code==403 || res.data.code==405 || res.data.code==406){
|
||||||
|
var u=navigator.userAgent;
|
||||||
|
let isApp=Boolean(u.match(/Gdxz/ig));
|
||||||
|
if(isApp){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
let freeList=['/login','/code/phone','/login/wx','/index','/user/check'];
|
||||||
|
if(freeList.indexOf(url) == -1){
|
||||||
|
|
||||||
|
let page_url=pageUrl();
|
||||||
|
uni.setStorageSync('redirectUrl',page_url);
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/login/login?redirectUrl=has'
|
||||||
|
});
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else if(res.data.code==500){
|
||||||
|
n(res)
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title:res.data.message,
|
||||||
|
icon:'none',
|
||||||
|
|
||||||
|
})
|
||||||
|
n(res)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
"request:fail " === err.errMsg && msg("请求数据失败!"), n(err.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user