<template>
|
<view class="home-bg">
|
<view class="margin-top-xl home-head">
|
<div class="gq"></div>
|
<view v-if="config.site_title" class="flex align-center justify-center flex-direction padding">
|
<image v-if="config.site_title" :src="main_model.icon ? `${setting_data.base_url+main_model.icon}` : ''" mode="aspectFill"
|
style="background-color: #f4f5f6;width: 200rpx;height: 200rpx;" class="round"></image>
|
<view class="text-bold text-xxl padding-tb"> {{ main_model.title ? main_model.title : '专业版' }} </view>
|
<!-- <view style="width: calc(100vw - 60rpx);" class="padding-bottom" v-if="config.home_notice">
|
<u-notice-bar :text="config.home_notice" mode="closable"></u-notice-bar>
|
</view> -->
|
</view>
|
</view>
|
<view class="flex justify-center align-center flex-direction">
|
<button @click="toChat" style="width: calc(100vw - 60rpx); height: 100rpx;" class="cu-btn text-bold chat-button">
|
开始咨询 (余{{num}}次) </button>
|
</view>
|
<view class="tool padding-top-xl">
|
<view class="header">
|
<view class="title text-bold">功能特性</view>
|
</view>
|
<u-transition :show="true" mode="slide-up">
|
<view class="grid">
|
<view class="item">
|
<view class="icon">
|
<u-icon size="28"
|
name="https://img.alicdn.com/imgextra/i1/2064565174/O1CN01v7Y9311o5k2r5Rwaq_!!2064565174.png">
|
</u-icon>
|
</view>
|
<view class="title">AI回答</view>
|
<view class="desc">浩繁法条直取答案</view>
|
</view>
|
<view class="item">
|
<view class="icon">
|
<u-icon size="28"
|
name="https://img.alicdn.com/imgextra/i1/2064565174/O1CN01H200mY1o5k2ythU1B_!!2064565174.png">
|
</u-icon>
|
</view>
|
<view class="title">智能答案</view>
|
<view class="desc">免去千篇一律</view>
|
</view>
|
<view class="item">
|
<view class="icon">
|
<u-icon size="28"
|
name="https://img.alicdn.com/imgextra/i1/2064565174/O1CN01FDSoxG1o5k2xjTHUD_!!2064565174.png">
|
</u-icon>
|
</view>
|
<view class="title">精准定位</view>
|
<view class="desc">免去繁琐搜索</view>
|
</view>
|
<view class="item">
|
<view class="icon">
|
<u-icon size="28"
|
name="https://img.alicdn.com/imgextra/i4/2064565174/O1CN01UP4ksa1o5k2rDpdOP_!!2064565174.png">
|
</u-icon>
|
</view>
|
<view class="title">引导提示</view>
|
<view class="desc">AI发散思维</view>
|
</view>
|
<view class="item">
|
<view class="icon">
|
<u-icon size="28"
|
name="https://img.alicdn.com/imgextra/i2/2064565174/O1CN01Oep4C01o5k2zlWs2q_!!2064565174.png">
|
</u-icon>
|
</view>
|
<view class="title">安全限制</view>
|
<view class="desc">道德逻辑自洽</view>
|
</view>
|
<view class="item">
|
<view class="icon">
|
<u-icon size="28"
|
name="https://img.alicdn.com/imgextra/i1/2064565174/O1CN01onUFC01o5k2uPHOqj_!!2064565174.png">
|
</u-icon>
|
</view>
|
<view class="title">在线工具</view>
|
<view class="desc">无需下载软件</view>
|
</view>
|
</view>
|
</u-transition>
|
</view>
|
<view class="padding-tb" v-if="config.copyright">
|
<u-loadmore :line="true" status="loadmore" :loadmoreText="config.copyright" color="#909399"></u-loadmore>
|
</view>
|
<m-tabbar v-if="showTab" fixed fill :current="tabIndex" :tabbar="tabbar"></m-tabbar>
|
</view>
|
</template>
|
|
<script>
|
import setting from "@/common/config.js"
|
import wx from '../../node_modules/jweixin-module/lib/index.js'
|
import {
|
mapState
|
} from 'vuex';
|
import mixin from "@/mixin/checkLoaded";
|
export default {
|
mixins: [mixin],
|
data() {
|
return {
|
client_id: "",
|
showTab: false,
|
tabIndex: 0,
|
setting_data:'null',
|
user_data:'null',
|
shar_openid:'null',
|
open_id_data
|
}
|
},
|
computed: {
|
...mapState(['config', 'num', 'userInfo', 'token', 'main_model', 'tabbar'])
|
},
|
onLoad(op) {
|
this.getTabIndex()
|
// #ifdef MP-WEIXIN || MP-JD
|
uni.hideHomeButton()
|
// #endif
|
|
this.setting_data = setting
|
|
|
|
|
},
|
created() {
|
let st_open = uni.getStorageSync('openid')
|
this.shar_openid = st_open
|
var url_local = location.href.split("#")[0]
|
this.open_id_data = this.$store.state.userInfo.openid
|
var urlLink = "http://ai.shsening.com/gpth5/#/pages/index/home?openid="+this.open_id_data
|
this.$request("/api/Member/wxH5ShareId",'POST',{
|
url:url_local
|
}).then((res) => {
|
this.user_data = res.data
|
wx.config({
|
debug: false, // 开启调试模式,调用的所有 api 的返回值会在客户端 alert 出来,若要查看传入的参数,可以在 pc 端打开,参数信息会通过 log 打出,仅在 pc 端时才会打印。
|
appId: this.user_data.appId, // 必填,公众号的唯一标识
|
timestamp: this.user_data.timestamp, // 必填,生成签名的时间戳
|
nonceStr: this.user_data.nonceStr, // 必填,生成签名的随机串
|
signature: this.user_data.signature, // 必填,签名
|
jsApiList: [
|
'updateAppMessageShareData',
|
'updateTimelineShareData',
|
'onMenuShareTimeline',
|
'onMenuShareAppMessage',
|
'onMenuShareQQ',
|
'onMenuShareQZone'
|
] // 必填,需要使用的JS接口列表
|
})
|
|
wx.ready(function () {
|
//分享到好友
|
wx.updateAppMessageShareData({
|
title: "ChatFox", // 分享标题
|
desc: "ChatFox", // 分享描述
|
link: urlLink, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
|
imgUrl: "@/static/h5/download-app/ios.png", // 分享图标
|
success: function () {
|
// 设置成功
|
console.log('成功')
|
},
|
cancel: function () {
|
// 用户取消分享后执行的回调函数
|
console.log('取消')
|
},
|
fail: function () {
|
// 用户分享失败后执行的回调函数
|
console.log('失败')
|
}
|
})
|
//分享到朋友圈
|
wx.updateTimelineShareData({
|
title: "ChatFox", // 分享标题
|
link: urlLink, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
|
imgUrl: "@/static/h5/download-app/ios.png", // 分享图标
|
success: function () {
|
// 设置成功
|
}
|
})
|
})
|
|
});
|
},
|
onShareAppMessage() {
|
console.log('转发+1')
|
},
|
methods: {
|
getTabIndex() {
|
let list = this.tabbar.list;
|
for (var i = 0; i < list.length; i++) {
|
if (list[i].pagePath == '/pages/index/home') {
|
this.tabIndex = i
|
this.showTab = true
|
}
|
}
|
},
|
toChat() {
|
if (!this.userInfo.token) {
|
uni.navigateTo({
|
url: "/pages/login/newlogin"
|
})
|
return
|
}
|
uni.navigateTo({
|
url: "./chat?model=" + JSON.stringify(this.main_model)
|
})
|
},
|
toTax() {
|
uni.showModal({
|
content: "待开放,模型训练中..."
|
})
|
}
|
}
|
}
|
</script>
|
<style lang="scss">
|
@import url("@/static/style/color-ui.css");
|
|
.home-bg {
|
background: url('@/static/home_bg.jpg') #ecf4fd no-repeat;
|
background-size: 100% auto;
|
background-position: 0 -32px;
|
box-sizing: border-box;
|
padding-top: 128rpx;
|
}
|
|
.home-head{
|
position: relative;
|
.gq{
|
position: absolute;
|
width: 328rpx;
|
height: 328rpx;
|
background: url('@/static/gq.png');
|
background-size: 100% 100%;
|
left: -164rpx;
|
top: -40rpx;
|
margin-left: 50%;
|
z-index: 9;
|
}
|
.text-bold{
|
color: #fff;
|
margin-top: 12rpx;
|
margin-bottom: 72rpx;
|
}
|
}
|
.margin-top-xl{
|
margin: 0;
|
}
|
.chat-button{
|
background: #302cd9 !important;
|
color: #fff;
|
box-shadow: 0 2px 6px rgba(48,44,217,.5);
|
}
|
|
.tool {
|
width: calc(100vw - 60rpx);
|
margin: 15rpx auto;
|
|
.header {
|
.title {
|
margin-bottom: 30rpx;
|
}
|
}
|
|
.grid {
|
display: flex;
|
flex-direction: row;
|
flex-wrap: wrap;
|
justify-content: space-between;
|
|
.item {
|
width: calc(calc(100vw - 60rpx - 30rpx) / 3);
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
background-color: #fff;
|
margin: 12rpx 0rpx;
|
padding: 30rpx 0rpx;
|
border-radius: 10rpx;
|
|
.title {
|
color: #30324f;
|
font-size: 28rpx;
|
margin-top: 15rpx;
|
}
|
|
.desc {
|
color: #93949d;
|
font-size: 24rpx;
|
}
|
}
|
}
|
}
|
</style>
|