小程序登录
parent
627e56f9fc
commit
14d5a50f73
@ -0,0 +1,3 @@
|
|||||||
|
/xiaochengxu/unpackage
|
||||||
|
/xiaochengxu/unpackage
|
||||||
|
/xiaochengxu/unpackage/dist
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\API\Mp;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
use JWT;
|
||||||
|
|
||||||
|
class LoginController
|
||||||
|
{
|
||||||
|
//微信登录授权获取openid
|
||||||
|
public function wxGetOpenid()
|
||||||
|
{
|
||||||
|
$code = request('code');
|
||||||
|
$url = "https://api.weixin.qq.com/sns/jscode2session?appid=" . config('app.globals.WxAppid') . "&secret=" . config('app.globals.WxAppSecret') . "&js_code=" . $code . "&grant_type=authorization_code";
|
||||||
|
$response = Http::get($url);
|
||||||
|
if ($response->successful()) {
|
||||||
|
$data = $response->json(); // 获取响应的 JSON 数据
|
||||||
|
// var_dump($data);
|
||||||
|
if (isset($data['openid'])) {
|
||||||
|
$openid = $data['openid'];
|
||||||
|
$member = DB::table('members')->where('openid', $openid)->first();
|
||||||
|
$url="https://www.baidu.com";
|
||||||
|
return \Yz::Return(true, '获取openid成功', ['openid' => $openid, 'member' => $member,'url'=>$url]);
|
||||||
|
} else {
|
||||||
|
return \Yz::echoError1('获取openid失败');
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return \Yz::echoError1('获取openid失败');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import {
|
||||||
|
useHttp
|
||||||
|
} from '@/tools/http';
|
||||||
|
const {
|
||||||
|
isLoading,
|
||||||
|
sendRequest
|
||||||
|
} = useHttp();
|
||||||
|
//let Url='https://mbmg.yuluo.online/Laravel/public'
|
||||||
|
let Url='http://huisuo-local';
|
||||||
|
let BaseUrl=Url+'/api/'
|
||||||
|
|
||||||
|
export const BaseFileUrl=()=>{
|
||||||
|
return Url;
|
||||||
|
}
|
||||||
|
//登录授权
|
||||||
|
export const Login = (data) => {
|
||||||
|
return sendRequest({url: BaseUrl+"mp/wxGetOpenid",method: 'POST',data:data});
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<web-view :webview-styles="webviewStyles" :src="url"></web-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref
|
||||||
|
} from "vue"
|
||||||
|
import {
|
||||||
|
onLoad
|
||||||
|
} from "@dcloudio/uni-app"
|
||||||
|
let url=ref('')
|
||||||
|
onLoad((e)=>{
|
||||||
|
url.value=e.url
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -1,108 +1,154 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="hero">
|
<view class="hero">
|
||||||
<image src="/static/logo.png" class="logo" mode="aspectFit" />
|
<image src="/static/logo.png" class="logo" mode="aspectFit" />
|
||||||
<text class="title">秦皇岛安尔然营销策划有限公司</text>
|
<text class="title">秦皇岛安尔然营销策划有限公司</text>
|
||||||
<text class="subtitle">为您提供专业的营销策划服务</text>
|
<text class="subtitle">为您提供专业的营销策划服务</text>
|
||||||
<button class="btn" @click="gotoAbout">了解更多</button>
|
<button class="btn" @click="gotoAbout">了解更多</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<text class="section-title">我们的服务</text>
|
<text class="section-title">我们的服务</text>
|
||||||
<view class="service-list">
|
<view class="service-list">
|
||||||
<view class="service-item" v-for="(item, index) in services" :key="index">
|
<view class="service-item" v-for="(item, index) in services" :key="index">
|
||||||
{{ item }}
|
{{ item }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<text>秦皇岛安尔然营销策划有限公司</text>
|
<text>秦皇岛安尔然营销策划有限公司</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
ref
|
ref
|
||||||
} from "vue"
|
} from "vue"
|
||||||
const services = ['营销策划', '会议服务', '商务咨询', '庆典服务', '礼仪服务']
|
import {
|
||||||
|
Login
|
||||||
|
} from "@/api"
|
||||||
|
import {
|
||||||
|
onLoad
|
||||||
|
} from "@dcloudio/uni-app"
|
||||||
|
const services = ['营销策划', '会议服务', '商务咨询', '庆典服务', '礼仪服务']
|
||||||
|
|
||||||
const gotoAbout = () => {
|
const gotoAbout = () => {
|
||||||
uni.navigateTo({ url: '/pages/about' })
|
uni.navigateTo({
|
||||||
}
|
url: '/pages/about'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const handleLogin = async () => {
|
||||||
|
try {
|
||||||
|
// 1. 调用微信登录接口获取 code
|
||||||
|
const res = await wx.login()
|
||||||
|
if (res.code) {
|
||||||
|
// 2. 将 code 发送给后端
|
||||||
|
console.log(res.code)
|
||||||
|
Login({
|
||||||
|
code: res.code
|
||||||
|
}).then(res => {
|
||||||
|
if (res.status) {
|
||||||
|
if(res.data.member!==null && res.data.url!==null){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/h5?url='+res.data.url
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.error('登录失败', res.errMsg)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('登录异常', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onLoad(()=>{
|
||||||
|
handleLogin()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.container {
|
.container {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
box-sizing: border-box; /* 关键! */
|
box-sizing: border-box;
|
||||||
|
/* 关键! */
|
||||||
|
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero {
|
||||||
|
text-align: center;
|
||||||
|
padding: 80rpx 40rpx;
|
||||||
|
background: linear-gradient(to bottom, #1a365d, #2c5282);
|
||||||
|
color: white;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
width: 180rpx;
|
||||||
|
height: 180rpx;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: white;
|
||||||
|
padding: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 48rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
display: block;
|
||||||
|
margin: 20rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtitle {
|
||||||
|
font-size: 32rpx;
|
||||||
|
opacity: 0.9;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
background: #3b82f6;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 16rpx 60rpx;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.service-list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.service-item {
|
||||||
|
background: #f1f5f9;
|
||||||
|
padding: 20rpx 55rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #1e293b;
|
||||||
|
}
|
||||||
|
|
||||||
height: 100vh;
|
.footer {
|
||||||
}
|
text-align: center;
|
||||||
.hero {
|
margin-top: 60rpx;
|
||||||
text-align: center;
|
color: #94a3b8;
|
||||||
padding: 80rpx 40rpx;
|
font-size: 24rpx;
|
||||||
background: linear-gradient(to bottom, #1a365d, #2c5282);
|
position: absolute;
|
||||||
color: white;
|
bottom: 60rpx;
|
||||||
border-radius: 20rpx;
|
width: 100%;
|
||||||
margin-bottom: 40rpx;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.logo {
|
|
||||||
width: 180rpx;
|
|
||||||
height: 180rpx;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: white;
|
|
||||||
padding: 10rpx;
|
|
||||||
}
|
|
||||||
.title {
|
|
||||||
font-size: 48rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
display: block;
|
|
||||||
margin: 20rpx 0;
|
|
||||||
}
|
|
||||||
.subtitle {
|
|
||||||
font-size: 32rpx;
|
|
||||||
opacity: 0.9;
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 40rpx;
|
|
||||||
}
|
|
||||||
.btn {
|
|
||||||
background: #3b82f6;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
padding: 16rpx 60rpx;
|
|
||||||
border-radius: 50rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
.section-title {
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.service-list {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 20rpx;
|
|
||||||
}
|
|
||||||
.service-item {
|
|
||||||
background: #f1f5f9;
|
|
||||||
padding: 20rpx 55rpx;
|
|
||||||
border-radius: 16rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #1e293b;
|
|
||||||
}
|
|
||||||
.footer {
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 60rpx;
|
|
||||||
color: #94a3b8;
|
|
||||||
font-size: 24rpx;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 60rpx;
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
// http.js
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
// 封装请求拦截器
|
||||||
|
function requestInterceptor(options) {
|
||||||
|
|
||||||
|
// 在请求发送之前做一些处理
|
||||||
|
// 比如添加请求头、修改请求参数等
|
||||||
|
options.header = {
|
||||||
|
'Authorization': 'Bearer ' + uni.getStorageSync("access_token"), // 假设需要添加 token
|
||||||
|
'Content-Type': 'application/json' // 设置请求头
|
||||||
|
};
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 封装响应拦截器
|
||||||
|
function responseInterceptor(response) {
|
||||||
|
// 对响应数据进行处理
|
||||||
|
// 比如根据响应状态码进行不同的操作
|
||||||
|
if (response.statusCode === 200) {
|
||||||
|
// 请求成功
|
||||||
|
if(response.data.status==false){
|
||||||
|
uni.showToast({
|
||||||
|
title: response.data.msg ,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return response.data;
|
||||||
|
} else {
|
||||||
|
// 请求失败
|
||||||
|
uni.showToast({
|
||||||
|
title: '请求失败,请稍后重试',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return Promise.reject(response.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发送请求的方法,内部使用拦截器
|
||||||
|
export function useHttp() {
|
||||||
|
const isLoading = ref(false);
|
||||||
|
|
||||||
|
function sendRequest(options) {
|
||||||
|
// 请求发送之前,先经过请求拦截器处理
|
||||||
|
let processedOptions = requestInterceptor(options);
|
||||||
|
|
||||||
|
isLoading.value = true;
|
||||||
|
uni.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
mask:true
|
||||||
|
});
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.request({
|
||||||
|
...processedOptions,
|
||||||
|
success: (res) => {
|
||||||
|
// 请求成功后,经过响应拦截器处理
|
||||||
|
let processedResponse = responseInterceptor(res);
|
||||||
|
isLoading.value = false;
|
||||||
|
uni.hideLoading();
|
||||||
|
resolve(processedResponse);
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
// 请求失败
|
||||||
|
isLoading.value = false;
|
||||||
|
uni.hideLoading();
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
isLoading,
|
||||||
|
sendRequest
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -1 +1 @@
|
|||||||
{"version":3,"file":"app.js","sources":["App.vue","main.js"],"sourcesContent":["<script>\r\n\texport default {\r\n\t\tonLaunch: function() {\n\t\t\tconsole.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!')\r\n\t\t\tconsole.log('App Launch')\r\n\t\t},\r\n\t\tonShow: function() {\r\n\t\t\tconsole.log('App Show')\r\n\t\t},\r\n\t\tonHide: function() {\r\n\t\t\tconsole.log('App Hide')\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style lang=\"scss\">\r\n\t/*每个页面公共css */\n\t@import '@/uni_modules/uni-scss/index.scss';\n\t/* #ifndef APP-NVUE */\n\t@import '@/static/customicons.css';\n\t// 设置整个项目的背景色\n\tpage {\n\t\tbackground-color: #f5f5f5;\n\t}\n\n\t/* #endif */\n\t.example-info {\n\t\tfont-size: 14px;\n\t\tcolor: #333;\n\t\tpadding: 10px;\n\t}\r\n</style>\n","\n// #ifndef VUE3\r\nimport Vue from 'vue'\r\nimport App from './App'\r\n\r\nVue.config.productionTip = false\r\n\r\nApp.mpType = 'app'\r\n\r\nconst app = new Vue({\r\n ...App\r\n})\r\napp.$mount()\r\n// #endif\n\n// #ifdef VUE3\r\nimport { createSSRApp } from 'vue'\nimport App from './App.vue'\nexport function createApp() {\n const app = createSSRApp(App)\n return {\n app\n }\n}\r\n// #endif"],"names":["uni","createSSRApp","App"],"mappings":";;;;;;;;AACC,MAAK,YAAU;AAAA,EACd,UAAU,WAAW;AACpBA,kBAAAA,MAAA,MAAA,QAAA,gBAAa,uDAAuD;AACpEA,kBAAAA,MAAA,MAAA,OAAA,gBAAY,YAAY;AAAA,EACxB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,gBAAA,UAAU;AAAA,EACtB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,iBAAA,UAAU;AAAA,EACvB;AACD;ACMM,SAAS,YAAY;AAC1B,QAAM,MAAMC,cAAY,aAACC,SAAG;AAC5B,SAAO;AAAA,IACL;AAAA,EACD;AACH;;;"}
|
{"version":3,"file":"app.js","sources":["App.vue","main.js"],"sourcesContent":["<script>\r\n\texport default {\r\n\t\tonLaunch: function() {\n\t\t\tconsole.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!')\r\n\t\t\tconsole.log('App Launch')\r\n\t\t},\r\n\t\tonShow: function() {\r\n\t\t\tconsole.log('App Show')\r\n\t\t},\r\n\t\tonHide: function() {\r\n\t\t\tconsole.log('App Hide')\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style lang=\"scss\">\r\n\t/*每个页面公共css */\n\t@import '@/uni_modules/uni-scss/index.scss';\n\t/* #ifndef APP-NVUE */\n\t@import '@/static/customicons.css';\n\t// 设置整个项目的背景色\n\tpage {\n\t\tbackground-color: #f5f5f5;\n\t}\n\n\t/* #endif */\n\t.example-info {\n\t\tfont-size: 14px;\n\t\tcolor: #333;\n\t\tpadding: 10px;\n\t}\r\n</style>\n","\n// #ifndef VUE3\r\nimport Vue from 'vue'\r\nimport App from './App'\r\n\r\nVue.config.productionTip = false\r\n\r\nApp.mpType = 'app'\r\n\r\nconst app = new Vue({\r\n ...App\r\n})\r\napp.$mount()\r\n// #endif\n\n// #ifdef VUE3\r\nimport { createSSRApp } from 'vue'\nimport App from './App.vue'\nexport function createApp() {\n const app = createSSRApp(App)\n return {\n app\n }\n}\r\n// #endif"],"names":["uni","createSSRApp","App"],"mappings":";;;;;;;;;AACC,MAAK,YAAU;AAAA,EACd,UAAU,WAAW;AACpBA,kBAAAA,MAAA,MAAA,QAAA,gBAAa,uDAAuD;AACpEA,kBAAAA,MAAA,MAAA,OAAA,gBAAY,YAAY;AAAA,EACxB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,gBAAA,UAAU;AAAA,EACtB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,iBAAA,UAAU;AAAA,EACvB;AACD;ACMM,SAAS,YAAY;AAC1B,QAAM,MAAMC,cAAY,aAACC,SAAG;AAC5B,SAAO;AAAA,IACL;AAAA,EACD;AACH;;;"}
|
||||||
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
{"version":3,"file":"index.js","sources":["pages/index/index.vue","../../../../../soft/安装包/HBuilderX.3.8.12.20230817/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvaW5kZXgvaW5kZXgudnVl"],"sourcesContent":["<template>\n <view class=\"container\">\n <view class=\"hero\">\n <image src=\"/static/logo.png\" class=\"logo\" mode=\"aspectFit\" />\n <text class=\"title\">秦皇岛安尔然营销策划有限公司</text>\n <text class=\"subtitle\">为您提供专业的营销策划服务</text>\n <button class=\"btn\" @click=\"gotoAbout\">了解更多</button>\n </view>\n\n <view class=\"section\">\n <text class=\"section-title\">我们的服务</text>\n <view class=\"service-list\">\n <view class=\"service-item\" v-for=\"(item, index) in services\" :key=\"index\">\n {{ item }}\n </view>\n </view>\n </view>\n\n <view class=\"footer\">\n <text>秦皇岛安尔然营销策划有限公司</text>\n </view>\n </view>\n</template>\n\n<script setup>\r\n\timport {\r\n\t\tref\r\n\t} from \"vue\"\nconst services = ['营销策划', '会议服务', '商务咨询', '庆典服务', '礼仪服务']\n\nconst gotoAbout = () => {\n uni.navigateTo({ url: '/pages/about' })\n}\n</script>\n\n<style scoped>\n.container {\n padding: 20rpx;\n background: #fff;\r\n box-sizing: border-box; /* 关键! */\r\n \r\n height: 100vh;\n}\n.hero {\n text-align: center;\n padding: 80rpx 40rpx;\n background: linear-gradient(to bottom, #1a365d, #2c5282);\n color: white;\n border-radius: 20rpx;\n margin-bottom: 40rpx;\n}\n.logo {\n width: 180rpx;\n height: 180rpx;\n margin-bottom: 30rpx;\n border-radius: 50%;\n background: white;\n padding: 10rpx;\n}\n.title {\n font-size: 48rpx;\n font-weight: bold;\n display: block;\n margin: 20rpx 0;\n}\n.subtitle {\n font-size: 32rpx;\n opacity: 0.9;\n display: block;\n margin-bottom: 40rpx;\n}\n.btn {\n background: #3b82f6;\n color: white;\n border: none;\n padding: 16rpx 60rpx;\n border-radius: 50rpx;\n font-size: 32rpx;\n}\n.section-title {\n font-size: 36rpx;\n font-weight: bold;\n margin-bottom: 20rpx;\n display: block;\n}\n.service-list {\n display: flex;\n flex-wrap: wrap;\n gap: 20rpx;\n}\n.service-item {\n background: #f1f5f9;\n padding: 20rpx 55rpx;\n border-radius: 16rpx;\n font-size: 28rpx;\n color: #1e293b;\n}\n.footer {\n text-align: center;\n margin-top: 60rpx;\n color: #94a3b8;\n font-size: 24rpx;\r\n position: absolute;\r\n bottom: 60rpx;\r\n width: 100%;\r\n text-align: center;\n}\n</style>","import MiniProgramPage from 'D:/Code/lanke/other/huisuo/xiaochengxu/pages/index/index.vue'\nwx.createPage(MiniProgramPage)"],"names":["uni"],"mappings":";;;;;;AA4BA,UAAM,WAAW,CAAC,QAAQ,QAAQ,QAAQ,QAAQ,MAAM;AAExD,UAAM,YAAY,MAAM;AACtBA,oBAAAA,MAAI,WAAW,EAAE,KAAK,eAAc,CAAE;AAAA,IACxC;;;;;;;;;;;;;;;;AC/BA,GAAG,WAAW,eAAe;"}
|
{"version":3,"file":"index.js","sources":["pages/index/index.vue","../../../../../soft/安装包/HBuilderX.3.8.12.20230817/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvaW5kZXgvaW5kZXgudnVl"],"sourcesContent":["<template>\r\n\t<view class=\"container\">\r\n\t\t<view class=\"hero\">\r\n\t\t\t<image src=\"/static/logo.png\" class=\"logo\" mode=\"aspectFit\" />\r\n\t\t\t<text class=\"title\">秦皇岛安尔然营销策划有限公司</text>\r\n\t\t\t<text class=\"subtitle\">为您提供专业的营销策划服务</text>\r\n\t\t\t<button class=\"btn\" @click=\"gotoAbout\">了解更多</button>\r\n\t\t</view>\r\n\r\n\t\t<view class=\"section\">\r\n\t\t\t<text class=\"section-title\">我们的服务</text>\r\n\t\t\t<view class=\"service-list\">\r\n\t\t\t\t<view class=\"service-item\" v-for=\"(item, index) in services\" :key=\"index\">\r\n\t\t\t\t\t{{ item }}\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\r\n\t\t<view class=\"footer\">\r\n\t\t\t<text>秦皇岛安尔然营销策划有限公司</text>\r\n\t\t</view>\r\n\t</view>\r\n</template>\r\n\r\n<script setup>\r\n\timport {\r\n\t\tref\r\n\t} from \"vue\"\r\n\timport {\r\n\t\tLogin\r\n\t} from \"@/api\"\r\n\timport {\r\n\t\tonLoad\r\n\t} from \"@dcloudio/uni-app\"\r\n\tconst services = ['营销策划', '会议服务', '商务咨询', '庆典服务', '礼仪服务']\r\n\r\n\tconst gotoAbout = () => {\r\n\t\tuni.navigateTo({\r\n\t\t\turl: '/pages/about'\r\n\t\t})\r\n\t}\r\n\tconst handleLogin = async () => {\r\n\t\ttry {\r\n\t\t\t// 1. 调用微信登录接口获取 code\r\n\t\t\tconst res = await wx.login()\r\n\t\t\tif (res.code) {\r\n\t\t\t\t// 2. 将 code 发送给后端\r\n\t\t\t\t console.log(res.code)\r\n\t\t\t\t Login({\r\n\t\t\t\t \tcode: res.code\r\n\t\t\t\t }).then(res => {\r\n\t\t\t\t \tif (res.status) {\r\n\t\t\t\t \t if(res.data.member!==null && res.data.url!==null){\r\n\t\t\t\t\t\t uni.navigateTo({\r\n\t\t\t\t\t\t \turl:'/pages/h5?url='+res.data.url\r\n\t\t\t\t\t\t })\r\n\t\t\t\t\t }\r\n\t\t\t\t \t}\r\n\t\t\t\t })\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error('登录失败', res.errMsg)\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error('登录异常', error)\r\n\t\t}\r\n\t}\r\n\tonLoad(()=>{\r\n\t\thandleLogin()\r\n\t})\r\n</script>\r\n\r\n<style scoped>\r\n\t.container {\r\n\t\tpadding: 20rpx;\r\n\t\tbackground: #fff;\r\n\t\tbox-sizing: border-box;\r\n\t\t/* 关键! */\r\n\r\n\t\theight: 100vh;\r\n\t}\r\n\r\n\t.hero {\r\n\t\ttext-align: center;\r\n\t\tpadding: 80rpx 40rpx;\r\n\t\tbackground: linear-gradient(to bottom, #1a365d, #2c5282);\r\n\t\tcolor: white;\r\n\t\tborder-radius: 20rpx;\r\n\t\tmargin-bottom: 40rpx;\r\n\t}\r\n\r\n\t.logo {\r\n\t\twidth: 180rpx;\r\n\t\theight: 180rpx;\r\n\t\tmargin-bottom: 30rpx;\r\n\t\tborder-radius: 50%;\r\n\t\tbackground: white;\r\n\t\tpadding: 10rpx;\r\n\t}\r\n\r\n\t.title {\r\n\t\tfont-size: 48rpx;\r\n\t\tfont-weight: bold;\r\n\t\tdisplay: block;\r\n\t\tmargin: 20rpx 0;\r\n\t}\r\n\r\n\t.subtitle {\r\n\t\tfont-size: 32rpx;\r\n\t\topacity: 0.9;\r\n\t\tdisplay: block;\r\n\t\tmargin-bottom: 40rpx;\r\n\t}\r\n\r\n\t.btn {\r\n\t\tbackground: #3b82f6;\r\n\t\tcolor: white;\r\n\t\tborder: none;\r\n\t\tpadding: 16rpx 60rpx;\r\n\t\tborder-radius: 50rpx;\r\n\t\tfont-size: 32rpx;\r\n\t}\r\n\r\n\t.section-title {\r\n\t\tfont-size: 36rpx;\r\n\t\tfont-weight: bold;\r\n\t\tmargin-bottom: 20rpx;\r\n\t\tdisplay: block;\r\n\t}\r\n\r\n\t.service-list {\r\n\t\tdisplay: flex;\r\n\t\tflex-wrap: wrap;\r\n\t\tgap: 20rpx;\r\n\t}\r\n\r\n\t.service-item {\r\n\t\tbackground: #f1f5f9;\r\n\t\tpadding: 20rpx 55rpx;\r\n\t\tborder-radius: 16rpx;\r\n\t\tfont-size: 28rpx;\r\n\t\tcolor: #1e293b;\r\n\t}\r\n\r\n\t.footer {\r\n\t\ttext-align: center;\r\n\t\tmargin-top: 60rpx;\r\n\t\tcolor: #94a3b8;\r\n\t\tfont-size: 24rpx;\r\n\t\tposition: absolute;\r\n\t\tbottom: 60rpx;\r\n\t\twidth: 100%;\r\n\t\ttext-align: center;\r\n\t}\r\n</style>","import MiniProgramPage from 'D:/Code/lanke/other/huisuo/xiaochengxu/pages/index/index.vue'\nwx.createPage(MiniProgramPage)"],"names":["uni","wx","Login","res","onLoad"],"mappings":";;;;;;;AAkCC,UAAM,WAAW,CAAC,QAAQ,QAAQ,QAAQ,QAAQ,MAAM;AAExD,UAAM,YAAY,MAAM;AACvBA,oBAAAA,MAAI,WAAW;AAAA,QACd,KAAK;AAAA,MACR,CAAG;AAAA,IACD;AACD,UAAM,cAAc,YAAY;AAC/B,UAAI;AAEH,cAAM,MAAM,MAAMC,cAAE,KAAC,MAAO;AAC5B,YAAI,IAAI,MAAM;AAEZD,wBAAAA,kDAAY,IAAI,IAAI;AACpBE,0BAAM;AAAA,YACL,MAAM,IAAI;AAAA,UAChB,CAAM,EAAE,KAAK,CAAAC,SAAO;AACd,gBAAIA,KAAI,QAAQ;AACf,kBAAGA,KAAI,KAAK,WAAS,QAAQA,KAAI,KAAK,QAAM,MAAK;AACjDH,8BAAAA,MAAI,WAAW;AAAA,kBACd,KAAI,mBAAiBG,KAAI,KAAK;AAAA,gBACtC,CAAQ;AAAA,cACD;AAAA,YACA;AAAA,UACP,CAAM;AAAA,QACN,OAAU;AACNH,wBAAA,MAAA,MAAA,SAAA,+BAAc,QAAQ,IAAI,MAAM;AAAA,QAChC;AAAA,MACD,SAAQ,OAAO;AACfA,sBAAAA,MAAA,MAAA,SAAA,+BAAc,QAAQ,KAAK;AAAA,MAC3B;AAAA,IACD;AACDI,kBAAAA,OAAO,MAAI;AACV,kBAAa;AAAA,IACf,CAAE;;;;;;;;;;;;;;;;ACnEF,GAAG,WAAW,eAAe;"}
|
||||||
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom",
|
|
||||||
"usingComponents": {}
|
"usingComponents": {}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom",
|
||||||
"usingComponents": {}
|
"usingComponents": {}
|
||||||
}
|
}
|
||||||
@ -1,72 +1,73 @@
|
|||||||
|
|
||||||
.container.data-v-1cf27b2a {
|
.container.data-v-1cf27b2a {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
box-sizing: border-box; /* 关键! */
|
box-sizing: border-box;
|
||||||
|
/* 关键! */
|
||||||
|
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
.hero.data-v-1cf27b2a {
|
.hero.data-v-1cf27b2a {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 80rpx 40rpx;
|
padding: 80rpx 40rpx;
|
||||||
background: linear-gradient(to bottom, #1a365d, #2c5282);
|
background: linear-gradient(to bottom, #1a365d, #2c5282);
|
||||||
color: white;
|
color: white;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
margin-bottom: 40rpx;
|
margin-bottom: 40rpx;
|
||||||
}
|
}
|
||||||
.logo.data-v-1cf27b2a {
|
.logo.data-v-1cf27b2a {
|
||||||
width: 180rpx;
|
width: 180rpx;
|
||||||
height: 180rpx;
|
height: 180rpx;
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: white;
|
background: white;
|
||||||
padding: 10rpx;
|
padding: 10rpx;
|
||||||
}
|
}
|
||||||
.title.data-v-1cf27b2a {
|
.title.data-v-1cf27b2a {
|
||||||
font-size: 48rpx;
|
font-size: 48rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
display: block;
|
display: block;
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
}
|
}
|
||||||
.subtitle.data-v-1cf27b2a {
|
.subtitle.data-v-1cf27b2a {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 40rpx;
|
margin-bottom: 40rpx;
|
||||||
}
|
}
|
||||||
.btn.data-v-1cf27b2a {
|
.btn.data-v-1cf27b2a {
|
||||||
background: #3b82f6;
|
background: #3b82f6;
|
||||||
color: white;
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 16rpx 60rpx;
|
padding: 16rpx 60rpx;
|
||||||
border-radius: 50rpx;
|
border-radius: 50rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
.section-title.data-v-1cf27b2a {
|
.section-title.data-v-1cf27b2a {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.service-list.data-v-1cf27b2a {
|
.service-list.data-v-1cf27b2a {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
}
|
}
|
||||||
.service-item.data-v-1cf27b2a {
|
.service-item.data-v-1cf27b2a {
|
||||||
background: #f1f5f9;
|
background: #f1f5f9;
|
||||||
padding: 20rpx 55rpx;
|
padding: 20rpx 55rpx;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #1e293b;
|
color: #1e293b;
|
||||||
}
|
}
|
||||||
.footer.data-v-1cf27b2a {
|
.footer.data-v-1cf27b2a {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 60rpx;
|
margin-top: 60rpx;
|
||||||
color: #94a3b8;
|
color: #94a3b8;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 60rpx;
|
bottom: 60rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue