Compare commits
6 Commits
44802a7007
...
458d830ff5
Author | SHA1 | Date |
---|---|---|
kk_888 | 458d830ff5 | 3 years ago |
kk_888 | 11f6d28b18 | 3 years ago |
杨豪 | c90ecea460 | 3 years ago |
杨豪 | f9cc1ac72b | 3 years ago |
杨豪 | 6a7b664ee1 | 3 years ago |
杨豪 | c0e156747c | 3 years ago |
@ -0,0 +1,23 @@
|
||||
import request from '@/utils/request' |
||||
|
||||
|
||||
export function getIndexData(q){ |
||||
return request.get('index', q, {login: false}) |
||||
} |
||||
|
||||
|
||||
/* |
||||
* 文章列表 |
||||
* */ |
||||
export function getArticle(q) { |
||||
return request.get("/article/list", q, { |
||||
login: false |
||||
}); |
||||
} |
||||
|
||||
/* |
||||
* 文章详情 |
||||
* */ |
||||
export function getArticleDetail(q) { |
||||
return request.get("/article/details/" + q.id); |
||||
} |
@ -0,0 +1,169 @@
|
||||
<template> |
||||
<view :style="{width: systemInfo.width + 'px', height: systemInfo.height + 'px', backgroundColor: bgcolor, position: 'absolute', left: 0, top: 0, zIndex: 9998, overflow: 'hidden'}"> |
||||
<view v-for="(item,rect_idx) in skeletonRectLists" :key="rect_idx + 'rect'" :class="[loading == 'chiaroscuro' ? 'chiaroscuro' : '']" :style="{width: item.width + 'px', height: item.height + 'px', backgroundColor: 'rgb(194, 207, 214)', position: 'absolute', left: item.left + 'px', top: item.top + 'px'}"></view> |
||||
<view v-for="(item,circle_idx) in skeletonCircleLists" :key="circle_idx + 'circle'" :class="loading == 'chiaroscuro' ? 'chiaroscuro' : ''" :style="{width: item.width + 'px', height: item.height + 'px', backgroundColor: 'rgb(194, 207, 214)', borderRadius: item.width + 'px', position: 'absolute', left: item.left + 'px', top: item.top + 'px'}"></view> |
||||
|
||||
<view class="spinbox" v-if="loading == 'spin'"> |
||||
<view class="spin"></view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
name: "skeleton", |
||||
props: { |
||||
bgcolor: { |
||||
type: String, |
||||
value: '#FFF' |
||||
}, |
||||
selector: { |
||||
type: String, |
||||
value: 'skeleton' |
||||
}, |
||||
loading: { |
||||
type: String, |
||||
value: 'spin' |
||||
}, |
||||
show: { |
||||
type: Boolean, |
||||
value: false |
||||
} |
||||
}, |
||||
data() { |
||||
return { |
||||
loadingAni: ['spin', 'chiaroscuro'], |
||||
systemInfo: {}, |
||||
skeletonRectLists: [], |
||||
skeletonCircleLists: [] |
||||
} |
||||
}, |
||||
watch: { |
||||
show() { |
||||
this.attachedAction(); |
||||
this.readyAction(); |
||||
} |
||||
}, |
||||
methods: { |
||||
attachedAction: function(){ |
||||
//默认的首屏宽高,防止内容闪现 |
||||
const systemInfo = uni.getSystemInfoSync(); |
||||
this.systemInfo = { |
||||
width: systemInfo.windowWidth, |
||||
height: systemInfo.windowHeight |
||||
}; |
||||
this.loading = this.loadingAni.includes(this.loading) ? this.loading : 'spin'; |
||||
}, |
||||
readyAction: function(){ |
||||
const that = this; |
||||
//绘制背景 |
||||
uni.createSelectorQuery().selectAll(`.${this.selector}`).boundingClientRect().exec(function(res){ |
||||
that.systemInfo.height = res[0][0].height + res[0][0].top; |
||||
}); |
||||
|
||||
//绘制矩形 |
||||
this.rectHandle(); |
||||
|
||||
//绘制圆形 |
||||
this.radiusHandle(); |
||||
}, |
||||
rectHandle: function(){ |
||||
const that = this; |
||||
|
||||
//绘制不带样式的节点 |
||||
uni.createSelectorQuery().selectAll(`.${this.selector}-rect`).boundingClientRect().exec(function(res){ |
||||
that.skeletonRectLists = res[0]; |
||||
}); |
||||
|
||||
}, |
||||
radiusHandle(){ |
||||
const that = this; |
||||
|
||||
uni.createSelectorQuery().selectAll(`.${this.selector}-radius`).boundingClientRect().exec(function(res){ |
||||
that.skeletonCircleLists = res[0]; |
||||
}); |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
.spinbox{ |
||||
position: fixed; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
height: 100%; |
||||
width: 100%; |
||||
z-index: 9999 |
||||
} |
||||
.spin { |
||||
display: inline-block; |
||||
width: 64rpx; |
||||
height: 64rpx; |
||||
} |
||||
.spin:after { |
||||
content: " "; |
||||
display: block; |
||||
width: 46rpx; |
||||
height: 46rpx; |
||||
margin: 1rpx; |
||||
border-radius: 50%; |
||||
border: 5rpx solid #409eff; |
||||
border-color: #409eff transparent #409eff transparent; |
||||
animation: spin 1.2s linear infinite; |
||||
} |
||||
@keyframes spin { |
||||
0% { |
||||
transform: rotate(0deg); |
||||
} |
||||
100% { |
||||
transform: rotate(360deg); |
||||
} |
||||
} |
||||
|
||||
.chiaroscuro{ |
||||
width: 100%; |
||||
height: 100%; |
||||
background: rgb(194, 207, 214); |
||||
animation-duration: 2s; |
||||
animation-name: blink; |
||||
animation-iteration-count: infinite; |
||||
} |
||||
|
||||
@keyframes blink { |
||||
0% { |
||||
opacity: .4; |
||||
} |
||||
50% { |
||||
opacity: 1; |
||||
} |
||||
100% { |
||||
opacity: .4; |
||||
} |
||||
} |
||||
|
||||
@keyframes flush { |
||||
0% { |
||||
left: -100%; |
||||
} |
||||
50% { |
||||
left: 0; |
||||
} |
||||
100% { |
||||
left: 100%; |
||||
} |
||||
} |
||||
.shine { |
||||
animation: flush 2s linear infinite; |
||||
position: absolute; |
||||
top: 0; |
||||
bottom: 0; |
||||
width: 100%; |
||||
background: linear-gradient(to left, |
||||
rgba(255, 255, 255, 0) 0%, |
||||
rgba(255, 255, 255, .85) 50%, |
||||
rgba(255, 255, 255, 0) 100% |
||||
) |
||||
} |
||||
</style> |
@ -0,0 +1,66 @@
|
||||
<template> |
||||
<swiper class="swiper-block" autoplay="true" circular="true" previous-margin="90rpx" next-margin="90rpx" current="0" @change="swiperChange"> |
||||
<block v-for="(item, index) in imgs" :key="index"> |
||||
<swiper-item class="swiper-item" :class="(swiperIndex == index ? 'active' : '')" @tap="previewImg"> |
||||
<image mode="aspectFill" :src="item" :class="'slide-image ' + (swiperIndex == index ? 'active' : '')"></image> |
||||
</swiper-item> |
||||
</block> |
||||
</swiper> |
||||
</template> |
||||
|
||||
<script> |
||||
export default{ |
||||
props: { |
||||
imgs: { |
||||
type: Array, |
||||
default: [] |
||||
} |
||||
}, |
||||
data(){ |
||||
return { |
||||
swiperIndex: 0 |
||||
} |
||||
}, |
||||
methods: { |
||||
swiperChange(e) { |
||||
const that = this; |
||||
that.setData({ |
||||
swiperIndex: e.detail.current |
||||
}); |
||||
}, |
||||
|
||||
previewImg() { |
||||
uni.previewImage({ |
||||
urls: this.imgs |
||||
}); |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="less"> |
||||
.swiper-block { |
||||
height: 300rpx; |
||||
width: 100%; |
||||
} |
||||
|
||||
.swiper-item { |
||||
display: flex; |
||||
flex-direction: column; |
||||
justify-content: center; |
||||
align-items: flex-start; |
||||
overflow: unset; |
||||
} |
||||
.slide-image { |
||||
height: 250rpx; |
||||
width: 520rpx; |
||||
border-radius: 9rpx; |
||||
margin: 0rpx 30rpx; |
||||
z-index: 1; |
||||
} |
||||
.active { |
||||
transform: scale(1.14); |
||||
transition: all 0.2s ease-in 0s; |
||||
z-index: 20; |
||||
} |
||||
</style> |
@ -1,11 +1,10 @@
|
||||
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api'
|
||||
// export const VUE_APP_API_URL = 'http://192.168.0.112:8092/api'
|
||||
export const VUE_APP_API_URL = 'http://192.168.0.111:8092/api' |
||||
// export const VUE_APP_API_URL = 'https://cloud.api.cyjyyjy.com/api'
|
||||
// export const VUE_APP_API_URL = 'http://192.168.0.111:8092/api'
|
||||
export const VUE_APP_API_URL = 'https://cloud.api.cyjyyjy.com/api' |
||||
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||
// export const VUE_APP_API_URL = 'https://thapi.xinxintuan.co/api'
|
||||
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
||||
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
||||
export const VUE_APP_RESOURCES_URL = 'https://h5.yixiang.co/static' |
||||
|
@ -0,0 +1,759 @@
|
||||
<template> |
||||
<view class="home-page"> |
||||
<view class="top-bg-box" @tap="toGuidePage"> |
||||
<image src="https://download.cyjyyjy.com/index-top-bg2.png"></image> |
||||
</view> |
||||
|
||||
<!-- <view class="page-top-box"> |
||||
<image src="../../images/home/top-bg.png" class="top-bg"></image> |
||||
<view class="page-title" style="top:{{menuTop}}px;height:{{menuHeight}}px;line-height: {{menuHeight}}px;">禅意云生态</view> |
||||
<view class="top-box-content" style="top: {{CustomBar + menuHeight}}rpx;"> |
||||
<view class="search-box acea-row row-between-wrapper"> |
||||
<view class="localtion-box acea-row row-middle"> |
||||
<image src="../../images/home/localtion.png"></image> |
||||
<text>{{city}}</text> |
||||
</view> |
||||
<view class="search acea-row row-middle"> |
||||
<image src="../../images/home/search.png"></image> |
||||
<text>大家都在搜 APP开发</text> |
||||
</view> |
||||
<image class="message-icon" src="../../images/home/message.png"></image> |
||||
</view> |
||||
<view class="home-menu-box"> |
||||
<view class="menu-list acea-row row-between"> |
||||
<view class="menu-item acea-row row-column row-middle" wx:for="{{menuList}}" wx:key="index"> |
||||
<image src="{{item.icon}}"></image> |
||||
<text>{{item.text}}</text> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> --> |
||||
<!-- 招商会 --> |
||||
<view class="investment-box"> |
||||
<view class="investment-title-box acea-row row-between-wrapper"> |
||||
<view class="acea-row"> |
||||
<text class="fz32">热门活动</text> |
||||
<view class="hot">热</view> |
||||
</view> |
||||
<!-- <view class="more acea-row row-middle"> |
||||
<text>全部</text> |
||||
<image src="/static/images/home/arrow-r.png"></image> |
||||
</view> --> |
||||
</view> |
||||
<view class="investement-list"> |
||||
<scroll-view class="scroll-view_H" scroll-x="true"> |
||||
<view v-for="(item, index) in recommendActivity" :key="index" class="investment-item" @tap="toActiveDetail" :data-id="item.id"> |
||||
<image class="item-bg" :src="item.images" mode="aspectFill"></image> |
||||
<view class="tips-box acea-row row-right"> |
||||
<view v-for="(flag, index2) in spl.spl(item.flag)" :key="index2" :class="'tips-item ' + (index2%2 == 0 ? 'bg2' : '' )" v-if="index2 < 3">{{flag}}</view> |
||||
</view> |
||||
<view class="item-info-box acea-row row-column row-center"> |
||||
<view class="address-box line1"> |
||||
<image src="/static/images/home/localtion.png"></image> |
||||
<text>{{item.address}}</text> |
||||
</view> |
||||
<view class="time-box"> |
||||
<image src="/static/images/home/time.png"></image> |
||||
<text>{{item.activityStartTime}}</text> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</scroll-view> |
||||
</view> |
||||
</view> |
||||
<!-- 尊享福利 --> |
||||
<!-- <view class="welfare-box"> |
||||
<view class="welfare-title">尊享福利</view> |
||||
<view class="welfare-list-box"> |
||||
<scroll-view class="scroll-view_H" scroll-x="true"> |
||||
<view class="welfare-item" wx:for="{{3}}" wx:key="index"> |
||||
<view class="item-box acea-row"> |
||||
<image src="../../images/home/welfare1.png"></image> |
||||
<view class="welfare-info-box acea-row row-column row-between"> |
||||
<view> |
||||
<view class="w-name">保时捷Porsche-Panamera 4S E-Hybrid 行政加长版</view> |
||||
<view class="w-address">武汉光谷保时捷中心</view> |
||||
</view> |
||||
<view> |
||||
<view class="w-price">140万</view> |
||||
<view class="w-oldPrice">市场价约为¥157万</view> |
||||
</view> |
||||
</view> |
||||
<view class="buy-btn">立即抢购</view> |
||||
</view> |
||||
<view class="item-box acea-row"> |
||||
<image src="../../images/home/welfare1.png"></image> |
||||
<view class="welfare-info-box acea-row row-column row-between"> |
||||
<view> |
||||
<view class="w-name">保时捷Porsche-Panamera 4S E-Hybrid 行政加长版</view> |
||||
<view class="w-address">武汉光谷保时捷中心</view> |
||||
</view> |
||||
<view> |
||||
<view class="w-price">140万</view> |
||||
<view class="w-oldPrice">市场价约为¥157万</view> |
||||
</view> |
||||
</view> |
||||
<view class="buy-btn">立即抢购</view> |
||||
</view> |
||||
data-i </view> |
||||
</scroll-view> |
||||
</view> |
||||
</view> --> |
||||
<!-- 供需模块 --> |
||||
<view class="demandhall-box"> |
||||
<view class="tabs-box acea-row row-around"> |
||||
<view :class="'tab-item ' + (active == 1 ? 'tab-item-a' : '')" data-i="1" @tap="tabClick">最新供应</view> |
||||
<view :class="'tab-item ' + (active == 2 ? 'tab-item-a' : '')" data-i="2" @tap="tabClick">需求广场</view> |
||||
<!-- <view class="tab-item {{active == 3 ? 'tab-item-a' : ''}}" data-i="3" bindtap="tabClick">金牌投资人</view> --> |
||||
</view> |
||||
<view class="list-box" v-if="active == 1"> |
||||
<view v-for="(item, index) in resourcesList" :key="index" class="item"> |
||||
<view class="item-top"> |
||||
<view class="project-name line1">{{item.title}}</view> |
||||
<view class="tag">{{item.cname}}</view> |
||||
<view class="desc line2">{{item.detailedDescription}}</view> |
||||
<view class="buy-btn" @tap="toResourcesDetail" :data-id="item.id">了解详情</view> |
||||
</view> |
||||
<view class="company-box acea-row"> |
||||
<image :src="item.enterpriseDto.enterpriseLogo" class="logo"></image> |
||||
<view class="company-info acea-row row-column row-between"> |
||||
<view class="company-name line1 fz28">{{item.enterpriseDto.enterpriseName}}</view> |
||||
<view class="company-name line2 fz24">{{item.enterpriseDto.enterpriseTitle}}</view> |
||||
<view class="tags-box acea-row"> |
||||
<!-- <view class="tag-item fz20">网站建设</view> --> |
||||
<view class="tag-item fz20 bgG">{{item.cname}}</view> |
||||
<!-- <view class="tag-item fz20 bgO">网站建设</view> --> |
||||
</view> |
||||
</view> |
||||
<view class="into-btn acea-row row-center-wrapper" @tap="toCompanyDetail" :data-id="item.enterpriseId"> |
||||
<image src="/static/images/home/company-icon.png"></image> |
||||
<text>进入企业</text> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<view class="list-box" v-if="active == 2"> |
||||
<view v-for="(item, index) in demandList" :key="index" class="item" @tap="toNeedDetail" :data-id="item.id"> |
||||
<view class="item-top"> |
||||
<view class="project-name">{{item.title}}</view> |
||||
<view class="desc line2">{{item.detailedDescription}}</view> |
||||
<view class="tags-box tags-box2 acea-row"> |
||||
<view class="tag-item fz20">{{item.enterpriseDto.cname}}</view> |
||||
<!-- <view class="tag-item fz20 bgG">网站建设</view> |
||||
<view class="tag-item fz20 bgO">网站建设</view> --> |
||||
</view> |
||||
<view class="price">{{item.capital}}</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<view class="to-demandhall acea-row row-center row-middle" @tap="toTab2"> |
||||
<text>更多内容去供需大厅</text> |
||||
<image src="/static/images/home/arrow-r.png"></image> |
||||
</view> |
||||
<tabbar :current="currentTabIndex" @click="tabBarClick"></tabbar> |
||||
</view> |
||||
</template> |
||||
|
||||
<script module="spl" lang="wxs" src="../../utils/subutil.wxs"></script> |
||||
|
||||
<script> |
||||
// index.js |
||||
// 获取应用实例 |
||||
const app = getApp(); |
||||
import util from '../../utils/util'; |
||||
var QQMapWX = require("../../utils/qqmap-wx-jssdk.min.js"); |
||||
var qqmapsdk; |
||||
import tabbar from "../../tabbarComponent/tabbar"; |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
menuList: [ |
||||
{ |
||||
icon: "/static/images/home/menu1.png", |
||||
text: 'IT制作' |
||||
}, { |
||||
icon: "/static/images/home/menu2.png", |
||||
text: 'logo设计' |
||||
}, { |
||||
icon: "/static/images/home/menu3.png", |
||||
text: '文案策划' |
||||
}, { |
||||
icon: "/static/images/home/menu4.png", |
||||
text: 'app开发' |
||||
}, { |
||||
icon: "/static/images/home/menu5.png", |
||||
text: '装修服务' |
||||
}, { |
||||
icon: "/static/images/home/menu6.png", |
||||
text: '软件定制' |
||||
}, { |
||||
icon: "/static/images/home/menu7.png", |
||||
text: '法律服务' |
||||
}, { |
||||
icon: "/static/images/home/menu8.png", |
||||
text: '小程序' |
||||
}, { |
||||
icon: "/static/images/home/menu9.png", |
||||
text: '网络营销' |
||||
}, { |
||||
icon: "/static/images/home/menu10.png", |
||||
text: '全部分类' |
||||
}, |
||||
], |
||||
CustomBar: app.globalData.CustomBar, |
||||
menuHeight: app.globalData.menuHeight, |
||||
navHeight: app.globalData.navHeight, |
||||
menuTop: app.globalData.menuTop, |
||||
active: 1, |
||||
recommendActivity: [], |
||||
demandList: [], |
||||
resourcesList: [], |
||||
province: '', |
||||
city: '', |
||||
cagetoryList: "", |
||||
latitude: "", |
||||
longitude: "", |
||||
currentTabIndex: 0 |
||||
}; |
||||
}, |
||||
|
||||
components: { |
||||
tabbar |
||||
}, |
||||
props: {}, |
||||
onShareAppMessage: function(res) { |
||||
return { |
||||
title: '禅易云生态', |
||||
path: '/pages/home/index', |
||||
} |
||||
}, |
||||
onLoad() { |
||||
uni.hideTabBar(); |
||||
// app.globalData.editTabbar(); |
||||
this.pagePath = '/pages/home/index' |
||||
this.getCagetoryList(); |
||||
qqmapsdk = new QQMapWX({ |
||||
key: 'UVEBZ-M3VRS-CO4OH-6F5QZ-X7FB7-SVFOX' //这里自己的key秘钥进行填充 |
||||
|
||||
}); |
||||
this.getLocation(); |
||||
}, |
||||
onPullDownRefresh: function () { |
||||
//调用刷新时将执行的方法 |
||||
this.getCagetoryList(); |
||||
}, |
||||
methods: { |
||||
tabBarClick(index){ |
||||
// console.log('返回tabBar索引:' + index) |
||||
this.currentTabIndex = index |
||||
}, |
||||
toGuidePage() { |
||||
uni.navigateTo({ |
||||
url: '/pages/guide/index' |
||||
}); |
||||
}, |
||||
|
||||
toActiveDetail(e) { |
||||
let id = e.currentTarget.dataset.id; |
||||
uni.navigateTo({ |
||||
url: '/pages/activity/detail/index?id=' + id |
||||
}); |
||||
}, |
||||
|
||||
tabClick(e) { |
||||
this.setData({ |
||||
active: e.currentTarget.dataset.i |
||||
}); |
||||
}, |
||||
|
||||
toTab2() { |
||||
uni.switchTab({ |
||||
url: '/pages/demandHall/index' |
||||
}); |
||||
}, |
||||
|
||||
getCagetoryList() { |
||||
uni.showNavigationBarLoading(); |
||||
app.http('get', 'index').then(res => { |
||||
if (res.data.success) { |
||||
res.data.data.recommendActivity.content.forEach(item => { |
||||
item.activityStartTime = util.getWeek(item.activityStartTime); |
||||
}); |
||||
this.setData({ |
||||
demandList: res.data.data.demandList, |
||||
resourcesList: res.data.data.resourcesDtos, |
||||
cagetoryList: res.data.data.cagetoryDtos, |
||||
recommendActivity: res.data.data.recommendActivity.content |
||||
}); //隐藏导航条加载动画 |
||||
uni.hideNavigationBarLoading(); //停止下拉刷新 |
||||
uni.stopPullDownRefresh(); |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
toResourcesDetail(e) { |
||||
let id = e.currentTarget.dataset.id; |
||||
uni.navigateTo({ |
||||
url: '/pages/demandHall/resourcesDetail/index?id=' + id |
||||
}); |
||||
}, |
||||
|
||||
toCompanyDetail(e) { |
||||
let id = e.currentTarget.dataset.id; |
||||
uni.navigateTo({ |
||||
url: '/pages/demandHall/companyDetail/index?id=' + id |
||||
}); |
||||
}, |
||||
|
||||
toNeedDetail(e) { |
||||
let id = e.currentTarget.dataset.id; |
||||
uni.navigateTo({ |
||||
url: '/pages/demandHall/needsDetail/index?id=' + id |
||||
}); |
||||
}, |
||||
|
||||
getLocation() { |
||||
let vm = this; |
||||
uni.getLocation({ |
||||
type: 'wgs84', |
||||
success: function (res) { |
||||
// console.log(JSON.stringify(res)) |
||||
var latitude = res.latitude; |
||||
var longitude = res.longitude; |
||||
var speed = res.speed; |
||||
var accuracy = res.accuracy; |
||||
vm.getLocal(latitude, longitude); |
||||
}, |
||||
fail: function (res) { |
||||
console.log('fail' + JSON.stringify(res)); |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
// 获取当前地理位置 |
||||
getLocal: function (latitude, longitude) { |
||||
let vm = this; |
||||
qqmapsdk.reverseGeocoder({ |
||||
location: { |
||||
latitude: latitude, |
||||
longitude: longitude |
||||
}, |
||||
success: function (res) { |
||||
// console.log(JSON.stringify(res)); |
||||
let province = res.result.ad_info.province; |
||||
let city = res.result.ad_info.city; |
||||
vm.setData({ |
||||
province: province, |
||||
city: city, |
||||
latitude: latitude, |
||||
longitude: longitude |
||||
}); // console.log(city) |
||||
}, |
||||
fail: function (res) { |
||||
console.log(res); |
||||
}, |
||||
complete: function (res) {// console.log(res); |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
<style> |
||||
|
||||
.home-page{ |
||||
padding-bottom: 190rpx; |
||||
} |
||||
.top-bg-box{ |
||||
width: 750rpx; |
||||
height: 420rpx; |
||||
} |
||||
.top-bg-box image{ |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
.page-top-box{ |
||||
width: 100%; |
||||
height: 598rpx; |
||||
position: relative; |
||||
} |
||||
.page-title{ |
||||
width: 100%; |
||||
color: #fff; |
||||
text-align: center; |
||||
position: relative; |
||||
} |
||||
.top-bg{ |
||||
width: 100%; |
||||
height: 598rpx; |
||||
position: absolute; |
||||
} |
||||
.top-box-content{ |
||||
position: relative; |
||||
} |
||||
.search-box{ |
||||
color: #fff; |
||||
font-size: 32rpx; |
||||
padding: 0 60rpx 0 40rpx; |
||||
} |
||||
.localtion-box image{ |
||||
width: 26rpx; |
||||
height: 31rpx; |
||||
margin-right: 10rpx; |
||||
} |
||||
.search{ |
||||
width: 448rpx; |
||||
height: 68rpx; |
||||
font-size: 28rpx; |
||||
padding: 16rpx 20rpx; |
||||
background: rgba(255, 255, 255, 0.38); |
||||
border-radius: 8rpx; |
||||
} |
||||
.search image{ |
||||
width: 35rpx; |
||||
height: 35rpx; |
||||
margin-right: 16rpx; |
||||
} |
||||
.message-icon{ |
||||
width: 36rpx; |
||||
height: 36rpx; |
||||
} |
||||
.home-menu-box{ |
||||
width: 670rpx; |
||||
height: 286rpx; |
||||
background: #FFFFFF; |
||||
box-shadow: 0px 6rpx 20rpx rgba(151, 69, 34, 0.28); |
||||
border-radius: 12rpx; |
||||
margin: 28rpx auto 0; |
||||
padding: 42rpx; |
||||
} |
||||
.menu-list{ |
||||
color: #1D1D1D; |
||||
font-size: 24rpx; |
||||
} |
||||
.menu-item{ |
||||
width: 20%; |
||||
/* margin-right:16rpx; */ |
||||
margin-bottom: 34rpx; |
||||
} |
||||
.menu-item:nth-child(5n){ |
||||
margin-right: 0; |
||||
} |
||||
.menu-item image{ |
||||
width: 52rpx; |
||||
height: 52rpx; |
||||
} |
||||
|
||||
.investment-box{ |
||||
width: 100%; |
||||
padding: 40rpx 0 0 40rpx; |
||||
} |
||||
.investment-title-box{ |
||||
width: 100%; |
||||
padding-right: 40rpx; |
||||
} |
||||
.fz32{ |
||||
font-size: 32rpx; |
||||
color: #1D1D1D; |
||||
} |
||||
.hot{ |
||||
width: 26rpx; |
||||
height: 26rpx; |
||||
text-align: center; |
||||
line-height: 26rpx; |
||||
background: linear-gradient(147deg, #FB7E4A 0%, #FF5100 100%); |
||||
border-radius: 8rpx 0px 8rpx 0px; |
||||
font-size: 18rpx; |
||||
color: #fff; |
||||
margin-left: 16rpx; |
||||
} |
||||
.more{ |
||||
font-size: 24rpx; |
||||
color: #999999; |
||||
} |
||||
.more image{ |
||||
width: 9rpx; |
||||
height: 16rpx; |
||||
margin-left: 12rpx; |
||||
margin-top: 2rpx; |
||||
} |
||||
.investement-list{ |
||||
width: 100%; |
||||
margin-top: 34rpx; |
||||
} |
||||
.scroll-view_H{ |
||||
white-space: nowrap; |
||||
width: 100%; |
||||
} |
||||
.investment-item{ |
||||
display: inline-block; |
||||
width: 324rpx; |
||||
height: 408rpx; |
||||
margin-right:20rpx; |
||||
box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.16); |
||||
position: relative; |
||||
} |
||||
.investment-item .item-bg{ |
||||
width: 324rpx; |
||||
height: 408rpx; |
||||
position: absolute; |
||||
border-radius: 8rpx; |
||||
} |
||||
.tips-box{ |
||||
position: relative; |
||||
top: 20rpx; |
||||
} |
||||
.tips-item{ |
||||
padding: 6rpx 10rpx; |
||||
line-height: 28rpx; |
||||
font-size: 20rpx; |
||||
color: #fff; |
||||
background: rgba(255, 81, 0, 0.63); |
||||
border-radius: 8rpx; |
||||
margin-right: 14rpx; |
||||
} |
||||
.bg2{ |
||||
background: rgba(255, 170, 0, 0.63); |
||||
} |
||||
.item-info-box{ |
||||
width: 300rpx; |
||||
height: 102rpx; |
||||
background: rgba(255, 255, 255, 0.8); |
||||
box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.2); |
||||
border-radius: 8rpx; |
||||
position: absolute; |
||||
bottom: 18rpx; |
||||
left: 50%; |
||||
margin-left: -150rpx; |
||||
font-size: 22rpx; |
||||
color: #404040; |
||||
} |
||||
.item-info-box image{ |
||||
width: 14rpx; |
||||
height: 17rpx; |
||||
margin: 0 12rpx 0 12rpx; |
||||
} |
||||
|
||||
.welfare-box{ |
||||
width: 100%; |
||||
padding-left: 40rpx; |
||||
margin-top: 52rpx; |
||||
} |
||||
.welfare-title{ |
||||
font-size: 32rpx; |
||||
color: #1D1D1D; |
||||
margin-bottom: 38rpx; |
||||
} |
||||
.welfare-list-box{ |
||||
width: 100%; |
||||
} |
||||
.welfare-item{ |
||||
display: inline-block; |
||||
margin-right: 6rpx; |
||||
padding: 12rpx; |
||||
} |
||||
.item-box{ |
||||
width: 650rpx; |
||||
height: 248rpx; |
||||
background: #FFFFFF; |
||||
box-shadow: 0px 0rpx 12rpx rgba(0, 0, 0, 0.16); |
||||
padding: 22rpx 16rpx; |
||||
border-radius: 12rpx; |
||||
margin-bottom: 20rpx; |
||||
position: relative; |
||||
} |
||||
.buy-btn{ |
||||
width: 144rpx; |
||||
height: 52rpx; |
||||
text-align: center; |
||||
line-height: 52rpx; |
||||
background: linear-gradient(315deg, #FB966C 0%, #FFC2AA 100%); |
||||
border-radius: 12rpx; |
||||
color: #fff; |
||||
font-size: 24rpx; |
||||
position: absolute; |
||||
bottom: 30rpx; |
||||
right: 30rpx; |
||||
} |
||||
.item-box image{ |
||||
width: 198rpx; |
||||
height: 204rpx; |
||||
margin-right: 12rpx; |
||||
} |
||||
.welfare-info-box{ |
||||
width: 394rpx; |
||||
} |
||||
.w-name{ |
||||
width: 390rpx; |
||||
font-size: 28rpx; |
||||
line-height: 40rpx; |
||||
color: #1D1D1D; |
||||
overflow: hidden; |
||||
text-overflow: ellipsis; |
||||
display: -webkit-box; |
||||
-webkit-line-clamp: 3; |
||||
-webkit-box-orient: vertical; |
||||
} |
||||
.w-address{ |
||||
font-size: 24rpx; |
||||
line-height: 34rpx; |
||||
color: #707070; |
||||
margin: 8rpx 0 14rpx; |
||||
} |
||||
.w-price{ |
||||
font-size: 28rpx; |
||||
font-weight: bold; |
||||
line-height: 40rpx; |
||||
color: #FF7942; |
||||
} |
||||
.w-oldPrice{ |
||||
font-size: 20rpx; |
||||
color: #BCBCBC; |
||||
text-decoration: line-through; |
||||
} |
||||
|
||||
.demandhall-box{ |
||||
width: 100%; |
||||
padding: 40rpx; |
||||
} |
||||
.tabs-box{ |
||||
padding-left: 30rpx; |
||||
padding-right: 12rpx; |
||||
} |
||||
.tab-item{ |
||||
font-size: 28rpx; |
||||
color: #9C9C9C; |
||||
padding-bottom: 8rpx; |
||||
} |
||||
.tab-item-a{ |
||||
color: #1D1D1D; |
||||
border-bottom: 4rpx solid #FF7942; |
||||
} |
||||
.list-box{ |
||||
width: 100%; |
||||
margin-top: 36rpx; |
||||
} |
||||
.item{ |
||||
width: 670rpx; |
||||
background: #FFFFFF; |
||||
box-shadow: 0px 6rpx 12rpx rgba(190, 190, 190, 0.3); |
||||
border-radius: 12rpx; |
||||
padding: 28rpx 20rpx 18rpx; |
||||
margin-bottom: 32rpx; |
||||
} |
||||
.item-top{ |
||||
padding-bottom: 24rpx; |
||||
position: relative; |
||||
} |
||||
.item-top .buy-btn{ |
||||
right: 0; |
||||
} |
||||
.project-name{ |
||||
width: 400rpx; |
||||
font-size: 32rpx; |
||||
font-weight: 500; |
||||
line-height: 58rpx; |
||||
color: #1D1D1D; |
||||
} |
||||
.tags-box2{ |
||||
margin-top: 12rpx; |
||||
} |
||||
.price{ |
||||
color: #FF5100; |
||||
font-size: 28rpx; |
||||
position: absolute; |
||||
top: 0; |
||||
right: 0rpx; |
||||
} |
||||
.tag{ |
||||
color: #74BDF7; |
||||
font-size: 20rpx; |
||||
line-height: 28rpx; |
||||
margin: 12rpx 0 20rpx; |
||||
} |
||||
.desc{ |
||||
font-size: 24rpx; |
||||
line-height: 34rpx; |
||||
color: #666666; |
||||
margin-top: 8rpx; |
||||
} |
||||
.company-box{ |
||||
padding-top: 12rpx; |
||||
position: relative; |
||||
border-top: 2rpx solid #ECECEC; |
||||
} |
||||
.company-box image{ |
||||
width: 128rpx; |
||||
height: 128rpx; |
||||
border-radius: 8rpx; |
||||
} |
||||
.company-info{ |
||||
width: calc(100% - 298rpx); |
||||
margin-left: 12rpx; |
||||
} |
||||
.fz28{ |
||||
font-size: 28rpx; |
||||
line-height: 40rpx; |
||||
color: #1D1D1D; |
||||
} |
||||
.fz24{ |
||||
font-size: 24rpx; |
||||
line-height: 34rpx; |
||||
} |
||||
.fz20{ |
||||
font-size: 20rpx; |
||||
line-height: 28rpx; |
||||
} |
||||
.item-top .buy-btn{ |
||||
top: 0; |
||||
} |
||||
.into-btn{ |
||||
font-size: 20rpx; |
||||
color: #FF5100; |
||||
width: 144rpx; |
||||
height: 40rpx; |
||||
border: 1rpx solid #FF5100; |
||||
opacity: 1; |
||||
border-radius: 20rpx; |
||||
position: absolute; |
||||
top: 18rpx; |
||||
right: 0rpx; |
||||
} |
||||
.into-btn image{ |
||||
width: 21rpx; |
||||
height: 19rpx; |
||||
margin-right: 6rpx; |
||||
} |
||||
.tag-item{ |
||||
width: 112rpx; |
||||
height: 36rpx; |
||||
line-height: 34rpx; |
||||
text-align: center; |
||||
border: 1rpx solid #FFAA00; |
||||
color: #FFAA00; |
||||
border-radius: 4rpx; |
||||
margin-right: 8rpx; |
||||
} |
||||
.bgG{ |
||||
border: 1rpx solid #3A9EFA; |
||||
color: #3A9EFA; |
||||
} |
||||
.bgO{ |
||||
border: 1rpx solid #FC9367; |
||||
color: #FC9367; |
||||
} |
||||
.to-demandhall{ |
||||
font-size: 28rpx; |
||||
color: #A7A7A7; |
||||
margin-bottom: 28rpx; |
||||
} |
||||
.to-demandhall image{ |
||||
width: 13rpx; |
||||
height: 23rpx; |
||||
margin-left: 15rpx; |
||||
} |
||||
|
||||
</style> |
@ -1,62 +1,159 @@
|
||||
|
||||
<template> |
||||
<view class="article-box"> |
||||
<view class="headline">楚牛电商一季度卖了300亿,原因竟是这?</view> |
||||
<view class="information-box acea-row"> |
||||
<image src="../../../static/images/cart.png" mode=""></image> |
||||
<view class="name">云快讯</view> |
||||
<view class="">203 </view> |
||||
<view>3小时前</view> |
||||
</view> |
||||
<!-- <view class="statement">转载声明:本文由云快讯收录,观点仅代表作者本人。不代表云快讯立场,云快讯不对所包含的准确性,可靠性或完整性提供任何明示,请自行承担任何责任。</view> |
||||
<image src="../../../static/images/gd1.png" mode="" class="article-bg1"></image> --> |
||||
</view> |
||||
<view class="article-box"> |
||||
<view class="article-header"> |
||||
<view class="headline">{{ detail.title }}</view> |
||||
<view class="acea-row"> |
||||
<view class="header-img"><image :src="detail.authorLogo"></image></view> |
||||
<view class=""> |
||||
<view class="release-auth">{{ detail.author }}</view> |
||||
<view class="acea-row"> |
||||
<view class="fz24 acea-row row-middle"> |
||||
<image |
||||
src="../../../static/images/eye.png" |
||||
class="eye-icon" |
||||
></image> |
||||
<text>{{ detail.visit }}</text> |
||||
</view> |
||||
<view class="fz24">{{ detail.formatTime }}</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="content"> |
||||
<view class="explain-box" |
||||
>转载声明:本文由云快讯收录,观点仅代表作者本人。不代表云快讯立场,云快讯不对所包含的准确性,可靠性或完整性提供任何明示,请自行承担任何责任。</view |
||||
> |
||||
<rich-text :nodes="detail.content"></rich-text> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getCategory , getProducts, getArticle} from "@/api/store"; |
||||
export default{ |
||||
data() { |
||||
return{ |
||||
id:this.id, |
||||
} |
||||
}, |
||||
methods:{ |
||||
}, |
||||
onLoad: function (option) { |
||||
this.id= this.$yroute.query.id; |
||||
console.log(this.id) |
||||
|
||||
} |
||||
|
||||
|
||||
} |
||||
import { getArticleDetail } from "@/api/home"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
id: this.id, |
||||
detail: {}, |
||||
}; |
||||
}, |
||||
onShareAppMessage() { |
||||
return { |
||||
title: this.detail.title, |
||||
imageUrl: this.detail.imageInput, |
||||
path: "/pages/life/articleDetail/index?id=" + this.detail.id, |
||||
success(res) { |
||||
uni.showToast({ |
||||
title: "分享成功", |
||||
}); |
||||
}, |
||||
fail(res) { |
||||
uni.showToast({ |
||||
title: "分享失败", |
||||
icon: "none", |
||||
}); |
||||
}, |
||||
}; |
||||
}, |
||||
methods: { |
||||
getArticleDetail() { |
||||
getArticleDetail({ id: this.id }).then((res) => { |
||||
res.data.content = this.formatRichText(res.data.content); |
||||
this.detail = res.data; |
||||
}); |
||||
}, |
||||
formatRichText(html) { |
||||
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) { |
||||
match = match |
||||
.replace(/style="[^"]+"/gi, "") |
||||
.replace(/style='[^']+'/gi, ""); |
||||
match = match |
||||
.replace(/width="[^"]+"/gi, "") |
||||
.replace(/width='[^']+'/gi, ""); |
||||
match = match |
||||
.replace(/height="[^"]+"/gi, "") |
||||
.replace(/height='[^']+'/gi, ""); |
||||
return match; |
||||
}); |
||||
newContent = newContent.replace( |
||||
/style="[^"]+"/gi, |
||||
function (match, capture) { |
||||
match = match |
||||
.replace(/width:[^;]+;/gi, "max-width:100%;") |
||||
.replace(/width:[^;]+;/gi, "max-width:100%;"); |
||||
return match; |
||||
} |
||||
); |
||||
newContent = newContent.replace( |
||||
/\<img/gi, |
||||
'<img style="max-width:100%;height:auto;display:block;margin-top:0;margin-bottom:0;"' |
||||
); |
||||
return newContent; |
||||
}, |
||||
}, |
||||
onLoad: function (option) { |
||||
this.id = this.$yroute.query.id; |
||||
this.getArticleDetail(); |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="less"> |
||||
.article-box{ |
||||
width: 100%; |
||||
min-height: 100vh; |
||||
background: #F5F6F7; |
||||
padding: 0 40rpx; |
||||
} |
||||
.headline{ |
||||
font-size: 32rpx; |
||||
color: #333333; |
||||
padding-top: 30rpx; |
||||
margin-bottom: 60rpx; |
||||
} |
||||
.information-box{ |
||||
width: 278rpx; |
||||
height: 92rpx; |
||||
} |
||||
.information-box image{ |
||||
width: 72rpx; |
||||
height: 72rpx; |
||||
margin-right: 20rpx; |
||||
} |
||||
.name{ |
||||
width: 180rpx; |
||||
height: 40rpx; |
||||
} |
||||
.article-box { |
||||
width: 100%; |
||||
min-height: 100vh; |
||||
.article-header { |
||||
padding: 0 40rpx; |
||||
} |
||||
.headline { |
||||
font-size: 32rpx; |
||||
color: #333333; |
||||
padding-top: 20rpx; |
||||
margin-bottom: 30rpx; |
||||
font-weight: 500; |
||||
} |
||||
.header-img { |
||||
width: 72rpx; |
||||
height: 72rpx; |
||||
margin-right: 20rpx; |
||||
image { |
||||
width: 100%; |
||||
height: 100%; |
||||
border-radius: 25px; |
||||
} |
||||
} |
||||
.release-auth { |
||||
font-size: 32rpx; |
||||
color: #333; |
||||
line-height: 44rpx; |
||||
margin-bottom: 6rpx; |
||||
} |
||||
.fz24 { |
||||
font-size: 24rpx; |
||||
color: #707070; |
||||
margin-right: 20rpx; |
||||
} |
||||
.eye-icon { |
||||
width: 24rpx; |
||||
height: 24rpx; |
||||
margin-right: 8rpx; |
||||
} |
||||
.content { |
||||
width: 100%; |
||||
padding: 24rpx; |
||||
overflow: hidden; |
||||
} |
||||
.explain-box { |
||||
width: 100%; |
||||
padding: 12rpx 34rpx; |
||||
background: #e3e3e3; |
||||
color: #999; |
||||
font-size: 24rpx; |
||||
line-height: 38rpx; |
||||
border-radius: 12rpx; |
||||
margin-bottom: 12rpx; |
||||
} |
||||
} |
||||
</style> |
||||
|
@ -0,0 +1,192 @@
|
||||
<template> |
||||
<view class="list-page"> |
||||
|
||||
<view class="search-box"> |
||||
<view class="search-content acea-row row-middle"> |
||||
<view class="search-icon"><image src="../../../static/images/search.png"> </image></view> |
||||
<input type="text" placeholder="请输入相关关键词" /> |
||||
<view class="search-btn">搜一下</view> |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="list-box"> |
||||
<view class="list-item acea-row row-between row-middle" v-for="(item,index) in articleList" :key="index" @click="toDetail(item.id)"> |
||||
<view class="item-l"> |
||||
<view class="title-box acea-row"> |
||||
<image src="../../../static/images/hot.png" v-if="item.isHot"></image> |
||||
<view class="title line2">{{item.title}}</view> |
||||
</view> |
||||
<view class="auth-info acea-row row-between"> |
||||
<view class="auth">{{item.author}}</view> |
||||
</view> |
||||
<view class="acea-row row-middle"> |
||||
<view class="auth time">{{item.createTime}}</view> |
||||
<view class="see acea-row row-middle"> |
||||
<text>200</text> |
||||
<image src="../../../static/images/eye.png"></image> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<view class="item-r"> |
||||
<image :src="item.imageInput" mode="aspectFill"></image> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="loadStatus-box">{{loadStatus}}</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getArticle } from "@/api/home"; |
||||
export default{ |
||||
data(){ |
||||
return{ |
||||
articleList: [], |
||||
page: 0, |
||||
size: 10, |
||||
isLoading: true, |
||||
loadStatus: '没有更多了...' |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getArticleList() |
||||
}, |
||||
onReachBottom() { |
||||
this.page= this.page+1 |
||||
this.getArticleList() |
||||
}, |
||||
methods:{ |
||||
getArticleList(){ |
||||
if(!this.isLoading) return |
||||
uni.showLoading({ |
||||
title: '加载中...' |
||||
}) |
||||
this.loadStatus = '加载中...' |
||||
getArticle({page: this.page,size: this.size, isHot: 0}).then((res)=>{ |
||||
if(res.data.content.length < this.size){ |
||||
this.loadStatus = '没有更多了...' |
||||
this.isLoading = false |
||||
} else{ |
||||
this.isLoading = true |
||||
this.loadStatus = '上拉加载更多...' |
||||
} |
||||
this.articleList = this.articleList.concat(res.data.content) |
||||
uni.hideLoading() |
||||
}) |
||||
}, |
||||
toDetail(id){ |
||||
this.$yrouter.push({ |
||||
path: '/pages/life/articleDetail/index', |
||||
query: { |
||||
id: id |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="less"> |
||||
.list-page{ |
||||
width: 100%; |
||||
min-height: 100vh; |
||||
background: #EEEEEE; |
||||
.search-box{ |
||||
width: 100%; |
||||
padding: 32rpx 40rpx; |
||||
background: #fff; |
||||
position: fixed; |
||||
top: 0; |
||||
.search-icon{ |
||||
width: 35rpx; |
||||
height: 35rpx; |
||||
margin-right: 12rpx; |
||||
image{ |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
} |
||||
.search-content{ |
||||
width: 100%; |
||||
padding: 0 0 0 50rpx; |
||||
border: 2rpx solid #FF5100; |
||||
border-radius: 8rpx; |
||||
font-size: 28rpx; |
||||
border-right: 0; |
||||
input{ |
||||
color: #BFBFBF; |
||||
} |
||||
.search-btn{ |
||||
width: 132rpx; |
||||
height: 68rpx; |
||||
background: linear-gradient(39deg, #FF5100 0%, #FFA074 100%); |
||||
line-height: 68rpx; |
||||
text-align: center; |
||||
color: #fff; |
||||
border-radius: 8rpx; |
||||
margin-left: auto; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.list-box{ |
||||
width: 100%; |
||||
padding: 180rpx 40rpx 0rpx; |
||||
.list-item{ |
||||
width: 100%; |
||||
background: #fff; |
||||
border-radius: 12rpx; |
||||
padding: 30rpx 28rpx; |
||||
font-size: 24rpx; |
||||
color: #707070; |
||||
margin-bottom: 24rpx; |
||||
.item-l{ |
||||
width: calc(100% - 280rpx); |
||||
display: flex; |
||||
flex-direction: column; |
||||
justify-content: space-between; |
||||
.title-box{ |
||||
font-size: 32rpx; |
||||
color: #4A4A4A; |
||||
margin-bottom: 12rpx; |
||||
image{ |
||||
width: 19rpx; |
||||
height: 22rpx; |
||||
margin-right: 20rpx; |
||||
} |
||||
.title{ |
||||
width: calc(100% - 38rpx); |
||||
margin-top: -10rpx; |
||||
} |
||||
} |
||||
.auth-info{ |
||||
margin-bottom: 12rpx; |
||||
} |
||||
.see{ |
||||
margin-left: 20rpx; |
||||
image{ |
||||
width: 24rpx; |
||||
height: 24rpx; |
||||
margin-left: 6rpx; |
||||
} |
||||
} |
||||
} |
||||
.item-r{ |
||||
width: 240rpx; |
||||
image{ |
||||
width: 100%; |
||||
height: 130rpx; |
||||
border-radius: 16rpx; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
.loadStatus-box{ |
||||
text-align: center; |
||||
font-size: 28rpx; |
||||
color: #000; |
||||
padding: 30rpx 0; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,31 @@
|
||||
<template> |
||||
<swiper class="swiper-box" autoplay="true" indicator-dots='true' indicator-color='#B17815' indicator-active-color='#FFB93E' > |
||||
<swiper-item> |
||||
<image src="../../../static/images/learnMore1.png"></image> |
||||
</swiper-item> |
||||
<swiper-item> |
||||
<image src="../../../static/images/learnMore2.png"></image> |
||||
</swiper-item> |
||||
<swiper-item> |
||||
<image src="../../../static/images/learnMore3.png"></image> |
||||
</swiper-item> |
||||
<swiper-item> |
||||
<image src="../../../static/images/learnMore4.png"></image> |
||||
</swiper-item> |
||||
</swiper> |
||||
</template> |
||||
|
||||
<script> |
||||
</script> |
||||
|
||||
<style> |
||||
.swiper-box{ |
||||
width: 100%; |
||||
height: 100vh; |
||||
background-color: #070604; |
||||
} |
||||
.swiper-box image{ |
||||
width: 100%; |
||||
height: 100vh; |
||||
} |
||||
</style> |
@ -0,0 +1,378 @@
|
||||
<template> |
||||
<view class="information-box"> |
||||
<view class="search-box acea-row row-middle" > |
||||
<image src="../../../static/images/search-icon.png" mode=""></image> |
||||
<input type="text" value="" placeholder="请输入相关关键词"/> |
||||
<view class="search acea-row row-center-wrapper">搜一下</view> |
||||
</view> |
||||
<view class="vote-box"> |
||||
<view class="news"> |
||||
<view class="news-title-h">武汉12月底双层公交车将全面下线</view> |
||||
<view class="news-title-s">趁着有时间和你爱的人再去回味一下,那你认为有下线的必要吗?</view> |
||||
</view> |
||||
<view class="vote"> |
||||
|
||||
</view> |
||||
</view> |
||||
<scroll-view class="scroll-view_N" scroll-x="true" > |
||||
<view class="rotaion" v-for="(item,index) in 7" :key="index"> |
||||
<view class="acea-row row-center"> |
||||
<image src="../../../static/images/collect.png" mode=""></image> |
||||
<view class="rotaion-h">今日大事</view> |
||||
<view class="rotaion-s">每日热点资讯</view> |
||||
</view> |
||||
|
||||
</view> |
||||
</scroll-view> |
||||
<!-- 最新资讯 --> |
||||
<view class="newInfo-box"> |
||||
<image src="../../../static/images/newInfo.png" mode="" class="newInfo-title-img"></image> |
||||
<view class="newInfo" > |
||||
<view class="modular acea-row row-between" v-for="(item,index) in 3" :key="index"> |
||||
<view class="acea-row title" > |
||||
<view class="modular-h">海鸥出行将大巴车市场带入平台化阶段,提高包车出行效率</view> |
||||
<view class="title-l acea-row row-between"> |
||||
<view>云资讯</view> |
||||
<view>1小时前</view> |
||||
<view class="acea-row row-middle">203 |
||||
<image src="../../../static/images/ear.png" mode="" ></image> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<image src="../../../static/images/home/top-bg.png" mode="" ></image> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<!-- 热点精选 --> |
||||
<view class="hotspot-box"> |
||||
<image src="../../../static/images/user/hotspot.png" mode="" class="title-h-img"></image> |
||||
<scroll-view class="scroll-view_H acea-row" scroll-x="true" > |
||||
<view class="slide-box" v-for="(item,index) in 3" :key="index"> |
||||
<image src="../../../static/images/home/top-bg.png" mode=""></image> |
||||
<view class="hotspot-con"> |
||||
<view class="hotspot-icon">热点</view> |
||||
<view class="hotspot-title-h">禅易云生态:加入云生态,共建万亿私域资源圈获取海量资源与福利。</view> |
||||
</view> |
||||
</view> |
||||
</scroll-view> |
||||
</view> |
||||
<!-- 值得关注 --> |
||||
<view class="follow-box"> |
||||
<image src="../../../static/images/follow-title.png" mode="" class="title-h-img"></image> |
||||
<view class="follow-con" v-for="(item,index) in 3" :key="index"> |
||||
<view class="follow-top acea-row row-between"> |
||||
<view class="acea-row follow-title" > |
||||
<view class="follow-h">2021中国酒店与商用厨具行业品牌盛会</view> |
||||
<view class="follow-title-l acea-row row-between"> |
||||
<view>云资讯</view> |
||||
<view>1小时前</view> |
||||
<view class="acea-row row-middle">203 |
||||
<image src="../../../static/images/ear.png" mode="" ></image> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<image src="../../../static/images/home/top-bg.png" mode="" ></image> |
||||
</view> |
||||
<view class="follow-bottom acea-row row-middle"> |
||||
<image src="../../../static/images/collect.png" mode=""></image> |
||||
<view class="follow-title-b"> |
||||
<view class="title-s">云咨詢</view> |
||||
<view class="title-con">每天发布商业/生活等相关内容...</view> |
||||
</view> |
||||
<view class="follow-btn">关注+</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
</script> |
||||
|
||||
<style> |
||||
.information-box{ |
||||
width: 100%; |
||||
height: 100vh; |
||||
position: relative; |
||||
} |
||||
.search-box{ |
||||
width: 670rpx; |
||||
height: 68rpx; |
||||
border: 2rpx solid #FF5100; |
||||
border-radius: 8rpx; |
||||
margin: 52rpx auto; |
||||
font-size: 28rpx; |
||||
position: relative; |
||||
} |
||||
.search-box image{ |
||||
width: 35rpx; |
||||
height: 35rpx; |
||||
margin: 0 29rpx 0 52rpx; |
||||
} |
||||
.search{ |
||||
position: absolute; |
||||
right: 0; |
||||
width: 132rpx; |
||||
height: 68rpx; |
||||
background: linear-gradient(39deg, #FF5100 0%, #FFA074 100%); |
||||
border-radius: 8rpx; |
||||
color: #fff; |
||||
|
||||
} |
||||
.vote-box{ |
||||
width: 670rpx; |
||||
height: 358rpx; |
||||
background: #FFFFFF; |
||||
box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.16); |
||||
border-radius: 16rpx; |
||||
margin: 0 auto; |
||||
position: relative; |
||||
} |
||||
.news{ |
||||
width: 100%; |
||||
height: 248rpx; |
||||
background: #D2D2D2; |
||||
border-radius: 16rpx 16rpx 0 0; |
||||
color: #FFF; |
||||
position: absolute; |
||||
padding-left: 42rpx; |
||||
} |
||||
.news-title-h{ |
||||
font-size: 28rpx; |
||||
position: absolute; |
||||
bottom: 54rpx; |
||||
} |
||||
.news-title-s{ |
||||
font-size: 20rpx; |
||||
position: absolute; |
||||
bottom: 18rpx; |
||||
} |
||||
.vote{ |
||||
width: 100%; |
||||
height: 110rpx; |
||||
position: absolute; |
||||
bottom: 0; |
||||
border: 1rpx solid #000000; |
||||
} |
||||
.scroll-view_N{ |
||||
width: 100%; |
||||
height: 208rpx; |
||||
margin: 40rpx 0 0 40rpx; |
||||
white-space: nowrap; |
||||
} |
||||
.rotaion{ |
||||
width: 168rpx; |
||||
padding: 32rpx 0 16rpx 0; |
||||
background: #FFFFFF; |
||||
box-shadow: 0rpx 6rpx 12rpx rgba(0, 0, 0, 0.16); |
||||
border-radius: 16rpx; |
||||
margin-right: 32rpx; |
||||
display: inline-block; |
||||
} |
||||
.rotaion image{ |
||||
width: 80rpx; |
||||
height: 80rpx; |
||||
background: #FF6D2A; |
||||
border-radius: 50%; |
||||
} |
||||
.rotaion-h{ |
||||
height: 34rpx; |
||||
font-size: 24rpx; |
||||
color: #333333; |
||||
margin: 12rpx 0 4rpx 0; |
||||
font-weight: 600; |
||||
} |
||||
.rotaion-s{ |
||||
height: 26rpx; |
||||
font-size: 18rpx; |
||||
color: #9D9D9D; |
||||
} |
||||
/* 最新资讯 */ |
||||
.newInfo-box{ |
||||
margin: 44rpx 0 0rpx 0; |
||||
} |
||||
.newInfo-title-img{ |
||||
width: 160rpx; |
||||
height: 52rpx; |
||||
margin: 0 0 18rpx 38rpx; |
||||
} |
||||
.newInfo{ |
||||
width: 100%; |
||||
height: 528rpx; |
||||
border-top: 2rpx solid #EFEFEF; |
||||
} |
||||
.modular{ |
||||
width: 100%; |
||||
height: 176rpx; |
||||
border-bottom: 2rpx solid #EFEFEF; |
||||
padding: 20rpx 40rpx 22rpx 40rpx; |
||||
} |
||||
|
||||
.modular-h{ |
||||
width: 392rpx; |
||||
height: 80rpx; |
||||
font-size: 28rpx; |
||||
color: #4A4A4A; |
||||
font-weight: 600; |
||||
} |
||||
.modular image{ |
||||
width: 204rpx; |
||||
height: 134rpx; |
||||
} |
||||
.title{ |
||||
width: 392rpx; |
||||
height: 134rpx; |
||||
} |
||||
.title-l{ |
||||
width: 310rpx; |
||||
height: 34rpx; |
||||
font-size: 24rpx; |
||||
color: #707070; |
||||
} |
||||
.title-l image{ |
||||
width: 24rpx; |
||||
height: 24rpx; |
||||
margin-left: 5rpx; |
||||
} |
||||
/* 热点精选 */ |
||||
.hotspot-box{ |
||||
width: 100%; |
||||
height: 456rpx; |
||||
} |
||||
.title-h-img{ |
||||
width: 162rpx; |
||||
height: 62rpx; |
||||
margin: 32rpx 0 5rpx 40rpx; |
||||
} |
||||
.scroll-view_H{ |
||||
width: 100%; |
||||
height: 344rpx; |
||||
white-space: nowrap; |
||||
} |
||||
.scroll-view_H image{ |
||||
width: 670rpx; |
||||
height: 344rpx; |
||||
border-radius: 10rpx; |
||||
position: absolute; |
||||
} |
||||
.slide-box{ |
||||
position: relative; |
||||
width: 670rpx; |
||||
height: 100%; |
||||
display: inline-block; |
||||
margin-right: 16rpx; |
||||
} |
||||
.hotspot-con{ |
||||
width: 588rpx; |
||||
height: 130rpx; |
||||
bottom: 34rpx; |
||||
left: 24rpx; |
||||
position: absolute; |
||||
} |
||||
.hotspot-icon{ |
||||
width: 72rpx; |
||||
height: 32rpx; |
||||
background: #FE3737; |
||||
border-radius: 12rpx 2rpx 12rpx 0; |
||||
position: absolute; |
||||
font-size: 22rpx; |
||||
color: #fff; |
||||
text-align: center; |
||||
|
||||
} |
||||
.hotspot-title-h{ |
||||
width: 588rpx; |
||||
height: 80rpx; |
||||
font-size: 28rpx; |
||||
color: #FFFFFF; |
||||
position: absolute; |
||||
bottom: 0; |
||||
white-space:pre-wrap; |
||||
} |
||||
/* 值得关注 */ |
||||
.follow-box{ |
||||
width: 100%; |
||||
height: 950rpx; |
||||
margin-bottom: 50rpx; |
||||
} |
||||
.follow-con{ |
||||
width: 670rpx; |
||||
height: 250rpx; |
||||
margin: 0 auto; |
||||
background: #FFFFFF; |
||||
box-shadow: 0rpx 4rpx 10rpx rgba(0, 0, 0, 0.16); |
||||
border-radius: 16rpx; |
||||
margin-bottom: 32rpx; |
||||
} |
||||
.follow-top{ |
||||
width: 100%; |
||||
height: 170rpx; |
||||
padding: 20rpx 20rpx 26rpx 20rpx; |
||||
border-bottom: 1rpx solid #DCDCDC; |
||||
} |
||||
.follow-top image{ |
||||
width: 232rpx; |
||||
height: 130rpx; |
||||
border-radius: 16rpx; |
||||
} |
||||
.follow-title{ |
||||
width: 370rpx; |
||||
height: 100%; |
||||
} |
||||
.follow-h{ |
||||
width: 370rpx; |
||||
height: 80rpx; |
||||
font-size: 28rpx; |
||||
color: #000000; |
||||
font-weight: 600; |
||||
} |
||||
.follow-title-l{ |
||||
width: 250rpx; |
||||
height: 28rpx; |
||||
font-size: 20rpx; |
||||
color: #707070; |
||||
} |
||||
.follow-title-l image{ |
||||
width: 24rpx; |
||||
height: 24rpx; |
||||
margin-left: 5rpx; |
||||
} |
||||
.follow-bottom{ |
||||
width: 100%; |
||||
height: 80rpx; |
||||
padding: 12rpx 20rpx 16rpx 20rpx; |
||||
} |
||||
.follow-bottom image{ |
||||
width: 52rpx; |
||||
height: 52rpx; |
||||
border-radius: 50%; |
||||
margin-right: 8rpx; |
||||
} |
||||
.follow-title-b{ |
||||
|
||||
} |
||||
|
||||
.title-s{ |
||||
height: 28rpx; |
||||
font-size: 20rpx; |
||||
margin-bottom: 6rpx; |
||||
font-weight: 600; |
||||
} |
||||
.title-con{ |
||||
height: 22rpx; |
||||
font-size: 16rpx; |
||||
color: #707070; |
||||
} |
||||
|
||||
.follow-btn{ |
||||
width: 136rpx; |
||||
height: 40rpx; |
||||
background: linear-gradient(39deg, #FF5A0D 0%, #FFAC85 100%); |
||||
border-radius: 26rpx; |
||||
font-size: 28rpx; |
||||
color: #fff; |
||||
text-align: center; |
||||
position: absolute; |
||||
right: 60rpx; |
||||
} |
||||
</style> |
@ -1,262 +1,270 @@
|
||||
<template> |
||||
<!--pages/user/agreement/index.wxml--> |
||||
<view> |
||||
<view class="back-btn" :style="'top:' + navTopHeight + 'rpx'" @tap="backPage"> |
||||
<!--pages/user/agreement/index.wxml--> |
||||
<view> |
||||
<view class="back-btn" :style="'top:' + navTopHeight + 'rpx'" @tap="backPage"> |
||||
<image src="/static/images/back.png" mode></image> |
||||
</view> |
||||
<view class="pay-box" v-if="userInfo.nickname != '' && userInfo.isVip == 1"> |
||||
<image src="https://download.cyjyyjy.com/pay1.png" class="img1"></image> |
||||
<image src="https://download.cyjyyjy.com/pay2.png" class="img2"></image> |
||||
</view> |
||||
<view class="agreement-box" v-else> |
||||
<image src="https://download.cyjyyjy.com/agreement1.png" class="img1"></image> |
||||
<image src="https://download.cyjyyjy.com/agreement2.png" class="img2"></image> |
||||
<image src="https://download.cyjyyjy.com/agreement3.png" class="img3"></image> |
||||
<!-- <image src="../../../images/agreement.png" class="img"></image> --> |
||||
<view class="btn-box" @tap="toPay" v-if="userInfo.nickname"></view> |
||||
<block v-else> |
||||
<button class="btn-box" v-if="canIUseGetUserProfile" @tap="getUserProfile"></button> |
||||
<button class="btn-box" v-else-if="canIUse" open-type="getUserInfo" @getuserinfo="getUserInfo"></button> |
||||
<view v-else> 请使用1.4.4及以上版本基础库 </view> |
||||
</block> |
||||
</view> |
||||
</view> |
||||
<view class="pay-box" v-if="userInfo.nickname != '' && userInfo.isVip == 1"> |
||||
<image src="https://download.cyjyyjy.com/pay1.png" class="img1"></image> |
||||
<image src="https://download.cyjyyjy.com/pay2.png" class="img2"></image> |
||||
</view> |
||||
<view class="agreement-box" v-else> |
||||
<image src="https://download.cyjyyjy.com/agreement1.png" class="img1"></image> |
||||
<image src="https://download.cyjyyjy.com/agreement2.png" class="img2"></image> |
||||
<image src="https://download.cyjyyjy.com/agreement3.png" class="img3"></image> |
||||
<!-- <image src="../../../images/agreement.png" class="img"></image> --> |
||||
<view class="btn-box" @tap="toPay" v-if="userInfo.nickname"></view> |
||||
<block v-else> |
||||
<button class="btn-box" v-if="canIUseGetUserProfile" @tap="getUserProfile"></button> |
||||
<button class="btn-box" v-else-if="canIUse" open-type="getUserInfo" @getuserinfo="getUserInfo"></button> |
||||
<view v-else> 请使用1.4.4及以上版本基础库 </view> |
||||
</block> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
// pages/user/agreement/index.js |
||||
const app = getApp(); |
||||
// pages/user/agreement/index.js |
||||
const app = getApp(); |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
navTopHeight: app.globalData.menuTop + app.globalData.navTopHeight + 10, |
||||
userInfo: null, |
||||
canIUse: uni.canIUse('button.open-type.getUserInfo'), |
||||
canIUseGetUserProfile: false, |
||||
code: "", |
||||
hasUserInfo: false |
||||
}; |
||||
}, |
||||
export default { |
||||
data() { |
||||
return { |
||||
navTopHeight: app.globalData.menuTop + app.globalData.navTopHeight + 10, |
||||
userInfo: null, |
||||
canIUse: uni.canIUse('button.open-type.getUserInfo'), |
||||
canIUseGetUserProfile: false, |
||||
code: "", |
||||
hasUserInfo: false |
||||
}; |
||||
}, |
||||
|
||||
components: {}, |
||||
props: {}, |
||||
components: {}, |
||||
props: {}, |
||||
|
||||
/** |
||||
* 生命周期函数--监听页面加载 |
||||
*/ |
||||
onLoad: function (options) { |
||||
if (uni.getUserProfile) { |
||||
this.setData({ |
||||
canIUseGetUserProfile: true |
||||
}); |
||||
} |
||||
/** |
||||
* 生命周期函数--监听页面加载 |
||||
*/ |
||||
onLoad: function(options) { |
||||
if (uni.getUserProfile) { |
||||
this.setData({ |
||||
canIUseGetUserProfile: true |
||||
}); |
||||
} |
||||
|
||||
uni.login({ |
||||
success: res => { |
||||
// 发送 res.code 到后台换取 openId, sessionKey, unionId |
||||
this.setData({ |
||||
code: res.code |
||||
}); |
||||
} |
||||
}); |
||||
let pages = getCurrentPages(); |
||||
app.http('get', 'userinfo').then(res => { |
||||
if (res.data.success) { |
||||
uni.setStorageSync('userInfo', res.data.data); |
||||
this.setData({ |
||||
userInfo: res.data.data |
||||
}); |
||||
} |
||||
}).then(() => { |
||||
if (pages[pages.length - 2]) { |
||||
uni.login({ |
||||
success: res => { |
||||
// 发送 res.code 到后台换取 openId, sessionKey, unionId |
||||
this.setData({ |
||||
code: res.code |
||||
}); |
||||
} |
||||
}); |
||||
let pages = getCurrentPages(); |
||||
app.http('get', 'userinfo').then(res => { |
||||
if (res.data.success) { |
||||
uni.setStorageSync('userInfo', res.data.data); |
||||
this.setData({ |
||||
userInfo: res.data.data |
||||
}); |
||||
} |
||||
}).then(() => { |
||||
if (pages[pages.length - 2]) { |
||||
|
||||
} else { |
||||
if (this.userInfo.isVip) { |
||||
setTimeout(() => { |
||||
uni.reLaunch({ |
||||
url: '/pages/user/mine/index' |
||||
}); |
||||
}, 2000); |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
} else { |
||||
if (this.userInfo.isVip) { |
||||
setTimeout(() => { |
||||
uni.reLaunch({ |
||||
url: '/pages/user/mine/index' |
||||
}); |
||||
}, 2000); |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
/** |
||||
* 生命周期函数--监听页面初次渲染完成 |
||||
*/ |
||||
onReady: function () {}, |
||||
onShow: function () { |
||||
app.getInfo(); |
||||
}, |
||||
/** |
||||
* 生命周期函数--监听页面初次渲染完成 |
||||
*/ |
||||
onReady: function() {}, |
||||
onShow: function() { |
||||
app.getInfo(); |
||||
}, |
||||
|
||||
/** |
||||
* 生命周期函数--监听页面隐藏 |
||||
*/ |
||||
onHide: function () {}, |
||||
/** |
||||
* 生命周期函数--监听页面隐藏 |
||||
*/ |
||||
onHide: function() {}, |
||||
|
||||
/** |
||||
* 生命周期函数--监听页面卸载 |
||||
*/ |
||||
onUnload: function () {}, |
||||
/** |
||||
* 生命周期函数--监听页面卸载 |
||||
*/ |
||||
onUnload: function() {}, |
||||
|
||||
/** |
||||
* 页面相关事件处理函数--监听用户下拉动作 |
||||
*/ |
||||
onPullDownRefresh: function () {}, |
||||
/** |
||||
* 页面相关事件处理函数--监听用户下拉动作 |
||||
*/ |
||||
onPullDownRefresh: function() {}, |
||||
|
||||
/** |
||||
* 页面上拉触底事件的处理函数 |
||||
*/ |
||||
onReachBottom: function () {}, |
||||
/** |
||||
* 页面上拉触底事件的处理函数 |
||||
*/ |
||||
onReachBottom: function() {}, |
||||
|
||||
/** |
||||
* 用户点击右上角分享 |
||||
*/ |
||||
onShareAppMessage: function () {}, |
||||
methods: { |
||||
getUserProfile(e) { |
||||
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 |
||||
uni.getUserProfile({ |
||||
desc: '展示用户信息', |
||||
// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 |
||||
success: response => { |
||||
uni.showLoading({ |
||||
title: '登陆中...' |
||||
}); |
||||
let data = { |
||||
code: this.code, |
||||
iv: response.iv, |
||||
encryptedData: response.encryptedData, |
||||
spread: 0, |
||||
login_type: 0 |
||||
}; |
||||
app.http('POST', 'wxapp/auth', data).then(result => { |
||||
if (result.data.success) { |
||||
uni.hideLoading(); |
||||
uni.setStorageSync('token', 'Bearer ' + result.data.data.token); |
||||
uni.setStorageSync('userInfo', result.data.data.user); |
||||
uni.showModal({ |
||||
title: "提示", |
||||
content: '登陆成功!点击确定按钮完善信息', |
||||
success: res => { |
||||
if (res.confirm) { |
||||
if (result.data.data.user.isVip == false) { |
||||
uni.navigateTo({ |
||||
url: '../personalData/index' |
||||
}); |
||||
} else { |
||||
setTimeout(() => { |
||||
uni.reLaunch({ |
||||
url: '/pages/user/index' |
||||
}); |
||||
}, 1000); |
||||
} |
||||
} else { |
||||
if (result.data.data.user.isVip == false) { |
||||
uni.navigateTo({ |
||||
url: '../personalData/index' |
||||
}); |
||||
} else { |
||||
setTimeout(() => { |
||||
uni.reLaunch({ |
||||
url: '/pages/user/index' |
||||
}); |
||||
}, 1000); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
} else { |
||||
uni.showToast({ |
||||
title: result.data.msg, |
||||
icon: 'none' |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
}, |
||||
/** |
||||
* 用户点击右上角分享 |
||||
*/ |
||||
onShareAppMessage: function() {}, |
||||
methods: { |
||||
getUserProfile(e) { |
||||
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 |
||||
uni.getUserProfile({ |
||||
desc: '展示用户信息', |
||||
// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 |
||||
success: response => { |
||||
uni.showLoading({ |
||||
title: '登陆中...' |
||||
}); |
||||
let data = { |
||||
code: this.code, |
||||
iv: response.iv, |
||||
encryptedData: response.encryptedData, |
||||
spread: 0, |
||||
login_type: 0 |
||||
}; |
||||
app.http('POST', 'wxapp/auth', data).then(result => { |
||||
if (result.data.success) { |
||||
uni.hideLoading(); |
||||
uni.setStorageSync('token', 'Bearer ' + result.data.data.token); |
||||
uni.setStorageSync('userInfo', result.data.data.user); |
||||
uni.showModal({ |
||||
title: "提示", |
||||
content: '登陆成功!点击确定按钮完善信息', |
||||
success: res => { |
||||
if (res.confirm) { |
||||
if (result.data.data.user.isVip == false) { |
||||
uni.navigateTo({ |
||||
url: '../personalData/index' |
||||
}); |
||||
} else { |
||||
setTimeout(() => { |
||||
uni.reLaunch({ |
||||
url: '/pages/user/index' |
||||
}); |
||||
}, 1000); |
||||
} |
||||
} else { |
||||
if (result.data.data.user.isVip == false) { |
||||
uni.navigateTo({ |
||||
url: '../personalData/index' |
||||
}); |
||||
} else { |
||||
setTimeout(() => { |
||||
uni.reLaunch({ |
||||
url: '/pages/user/index' |
||||
}); |
||||
}, 1000); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
} else { |
||||
uni.showToast({ |
||||
title: result.data.msg, |
||||
icon: 'none' |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
getUserInfo(e) { |
||||
// 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息 |
||||
this.setData({ |
||||
userInfo: e.detail.userInfo, |
||||
hasUserInfo: true |
||||
}); |
||||
}, |
||||
getUserInfo(e) { |
||||
// 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息 |
||||
this.setData({ |
||||
userInfo: e.detail.userInfo, |
||||
hasUserInfo: true |
||||
}); |
||||
}, |
||||
|
||||
toPay() { |
||||
uni.navigateTo({ |
||||
url: '../personalData/index' |
||||
}); |
||||
}, |
||||
toPay() { |
||||
uni.navigateTo({ |
||||
url: '../personalData/index' |
||||
}); |
||||
}, |
||||
|
||||
backPage() { |
||||
uni.navigateBack({ |
||||
delta: 1 |
||||
}); |
||||
}, |
||||
backPage() { |
||||
uni.navigateBack({ |
||||
delta: 1 |
||||
}); |
||||
}, |
||||
|
||||
/** |
||||
* 生命周期函数--监听页面显示 |
||||
*/ |
||||
getUser() { |
||||
this.setData({ |
||||
userInfo: uni.getStorageSync('userInfo') |
||||
}); |
||||
} |
||||
/** |
||||
* 生命周期函数--监听页面显示 |
||||
*/ |
||||
getUser() { |
||||
this.setData({ |
||||
userInfo: uni.getStorageSync('userInfo') |
||||
}); |
||||
} |
||||
|
||||
} |
||||
}; |
||||
} |
||||
}; |
||||
</script> |
||||
<style> |
||||
/* pages/user/agreement/index.wxss */ |
||||
.agreement-box{ |
||||
width: 100%; |
||||
position: relative; |
||||
} |
||||
.agreement-box image{ |
||||
width: 100%; |
||||
display: block; |
||||
} |
||||
.agreement-box .img{ |
||||
height: 2848rpx; |
||||
} |
||||
.agreement-box .img1{ |
||||
height: 924rpx; |
||||
} |
||||
.agreement-box .img2{ |
||||
height: 834rpx; |
||||
} |
||||
.agreement-box .img3{ |
||||
height: 1090rpx; |
||||
} |
||||
/* pages/user/agreement/index.wxss */ |
||||
.agreement-box { |
||||
width: 100%; |
||||
position: relative; |
||||
} |
||||
|
||||
.btn-box{ |
||||
width: 440rpx !important; |
||||
height: 142rpx !important; |
||||
padding: 0 !important; |
||||
position: absolute; |
||||
top: 658rpx; |
||||
left: 50%; |
||||
margin-left: -220rpx !important; |
||||
background: none !important; |
||||
} |
||||
.agreement-box image { |
||||
width: 100%; |
||||
display: block; |
||||
} |
||||
|
||||
.pay-box{ |
||||
width: 100%; |
||||
min-height: 100vh; |
||||
} |
||||
.pay-box image{ |
||||
width: 100%; |
||||
display: block; |
||||
} |
||||
.pay-box .img1{ |
||||
height: 609rpx; |
||||
} |
||||
.pay-box .img2{ |
||||
height: 1235rpx; |
||||
} |
||||
.agreement-box .img { |
||||
height: 2848rpx; |
||||
} |
||||
|
||||
.agreement-box .img1 { |
||||
height: 924rpx; |
||||
} |
||||
|
||||
.agreement-box .img2 { |
||||
height: 834rpx; |
||||
} |
||||
|
||||
.agreement-box .img3 { |
||||
height: 1090rpx; |
||||
} |
||||
|
||||
.btn-box { |
||||
width: 440rpx !important; |
||||
height: 142rpx !important; |
||||
padding: 0 !important; |
||||
position: absolute; |
||||
top: 658rpx; |
||||
left: 50%; |
||||
margin-left: -220rpx !important; |
||||
background: none !important; |
||||
} |
||||
|
||||
.pay-box { |
||||
width: 100%; |
||||
min-height: 100vh; |
||||
} |
||||
|
||||
.pay-box image { |
||||
width: 100%; |
||||
display: block; |
||||
} |
||||
|
||||
.pay-box .img1 { |
||||
height: 609rpx; |
||||
} |
||||
|
||||
.pay-box .img2 { |
||||
height: 1235rpx; |
||||
} |
||||
</style> |
After Width: | Height: | Size: 557 B |
After Width: | Height: | Size: 646 B |
After Width: | Height: | Size: 352 B |
After Width: | Height: | Size: 352 B |
After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 195 KiB |
Before Width: | Height: | Size: 304 KiB |
Before Width: | Height: | Size: 133 KiB |
After Width: | Height: | Size: 524 B |
After Width: | Height: | Size: 839 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 714 KiB |
After Width: | Height: | Size: 477 KiB |
Before Width: | Height: | Size: 377 KiB |
Before Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 763 B |
After Width: | Height: | Size: 826 B |
@ -0,0 +1,22 @@
|
||||
## 1.1.6(2021-09-22) |
||||
- 修复 在字节小程序上样式不生效的 bug |
||||
## 1.1.5(2021-07-30) |
||||
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) |
||||
## 1.1.4(2021-07-29) |
||||
- 修复 去掉 nvue 不支持css 的 align-self 属性,nvue 下不暂支持 absolute 属性 |
||||
## 1.1.3(2021-06-24) |
||||
- 优化 示例项目 |
||||
## 1.1.1(2021-05-12) |
||||
- 新增 组件示例地址 |
||||
## 1.1.0(2021-05-12) |
||||
- 新增 uni-badge 的 absolute 属性,支持定位 |
||||
- 新增 uni-badge 的 offset 属性,支持定位偏移 |
||||
- 新增 uni-badge 的 is-dot 属性,支持仅显示有一个小点 |
||||
- 新增 uni-badge 的 max-num 属性,支持自定义封顶的数字值,超过 99 显示99+ |
||||
- 优化 uni-badge 属性 custom-style, 支持以对象形式自定义样式 |
||||
## 1.0.7(2021-05-07) |
||||
- 修复 uni-badge 在 App 端,数字小于10时不是圆形的bug |
||||
- 修复 uni-badge 在父元素不是 flex 布局时,宽度缩小的bug |
||||
- 新增 uni-badge 属性 custom-style, 支持自定义样式 |
||||
## 1.0.6(2021-02-04) |
||||
- 调整为uni_modules目录规范 |
@ -0,0 +1,253 @@
|
||||
<template> |
||||
<view class="uni-badge--x"> |
||||
<slot /> |
||||
<text v-if="text" :class="classNames" :style="[badgeWidth, positionStyle, customStyle, dotStyle]" |
||||
class="uni-badge" |
||||
@click="onClick()">{{displayValue}}</text> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
/** |
||||
* Badge 数字角标 |
||||
* @description 数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景 |
||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=21 |
||||
* @property {String} text 角标内容 |
||||
* @property {String} type = [default|primary|success|warning|error] 颜色类型 |
||||
* @value default 灰色 |
||||
* @value primary 蓝色 |
||||
* @value success 绿色 |
||||
* @value warning 黄色 |
||||
* @value error 红色 |
||||
* @property {String} size = [normal|small] Badge 大小 |
||||
* @value normal 一般尺寸 |
||||
* @value small 小尺寸 |
||||
* @property {String} inverted = [true|false] 是否无需背景颜色 |
||||
* @event {Function} click 点击 Badge 触发事件 |
||||
* @example <uni-badge text="1"></uni-badge> |
||||
*/ |
||||
export default { |
||||
name: 'UniBadge', |
||||
emits:['click'], |
||||
props: { |
||||
type: { |
||||
type: String, |
||||
default: 'default' |
||||
}, |
||||
inverted: { |
||||
type: Boolean, |
||||
default: false |
||||
}, |
||||
isDot: { |
||||
type: Boolean, |
||||
default: false |
||||
}, |
||||
maxNum: { |
||||
type: Number, |
||||
default: 99 |
||||
}, |
||||
absolute: { |
||||
type: String, |
||||
default: '' |
||||
}, |
||||
offset: { |
||||
type: Array, |
||||
default () { |
||||
return [0, 0] |
||||
} |
||||
}, |
||||
text: { |
||||
type: [String, Number], |
||||
default: '' |
||||
}, |
||||
size: { |
||||
type: String, |
||||
default: 'normal' |
||||
}, |
||||
customStyle: { |
||||
type: Object, |
||||
default () { |
||||
return {} |
||||
} |
||||
} |
||||
}, |
||||
data() { |
||||
return {}; |
||||
}, |
||||
computed: { |
||||
width() { |
||||
return String(this.text).length * 8 + 12 |
||||
}, |
||||
classNames() { |
||||
const { |
||||
inverted, |
||||
type, |
||||
size, |
||||
absolute |
||||
} = this |
||||
return [ |
||||
inverted ? 'uni-badge--' + type + '-inverted' : '', |
||||
'uni-badge--' + type, |
||||
'uni-badge--' + size, |
||||
absolute ? 'uni-badge--absolute' : '' |
||||
].join(' ') |
||||
}, |
||||
positionStyle() { |
||||
if (!this.absolute) return {} |
||||
let w = this.width / 2, |
||||
h = 10 |
||||
if (this.isDot) { |
||||
w = 5 |
||||
h = 5 |
||||
} |
||||
const x = `${- w + this.offset[0]}px` |
||||
const y = `${- h + this.offset[1]}px` |
||||
|
||||
const whiteList = { |
||||
rightTop: { |
||||
right: x, |
||||
top: y |
||||
}, |
||||
rightBottom: { |
||||
right: x, |
||||
bottom: y |
||||
}, |
||||
leftBottom: { |
||||
left: x, |
||||
bottom: y |
||||
}, |
||||
leftTop: { |
||||
left: x, |
||||
top: y |
||||
} |
||||
} |
||||
const match = whiteList[this.absolute] |
||||
return match ? match : whiteList['rightTop'] |
||||
}, |
||||
badgeWidth() { |
||||
return { |
||||
width: `${this.width}px` |
||||
} |
||||
}, |
||||
dotStyle() { |
||||
if (!this.isDot) return {} |
||||
return { |
||||
width: '10px', |
||||
height: '10px', |
||||
borderRadius: '10px' |
||||
} |
||||
}, |
||||
displayValue() { |
||||
const { isDot, text, maxNum } = this |
||||
return isDot ? '' : (Number(text) > maxNum ? `${maxNum}+` : text) |
||||
} |
||||
}, |
||||
methods: { |
||||
onClick() { |
||||
this.$emit('click'); |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
$bage-size: 12px; |
||||
$bage-small: scale(0.8); |
||||
$bage-height: 20px; |
||||
|
||||
.uni-badge--x { |
||||
/* #ifdef APP-NVUE */ |
||||
// align-self: flex-start; |
||||
/* #endif */ |
||||
/* #ifndef APP-NVUE */ |
||||
display: inline-block; |
||||
/* #endif */ |
||||
position: relative; |
||||
} |
||||
|
||||
.uni-badge--absolute { |
||||
position: absolute; |
||||
} |
||||
|
||||
.uni-badge { |
||||
/* #ifndef APP-NVUE */ |
||||
display: flex; |
||||
overflow: hidden; |
||||
box-sizing: border-box; |
||||
/* #endif */ |
||||
justify-content: center; |
||||
flex-direction: row; |
||||
height: $bage-height; |
||||
line-height: $bage-height; |
||||
color: $uni-text-color; |
||||
border-radius: 100px; |
||||
background-color: $uni-bg-color-hover; |
||||
background-color: transparent; |
||||
text-align: center; |
||||
font-family: 'Helvetica Neue', Helvetica, sans-serif; |
||||
font-size: $bage-size; |
||||
/* #ifdef H5 */ |
||||
cursor: pointer; |
||||
/* #endif */ |
||||
} |
||||
|
||||
.uni-badge--inverted { |
||||
padding: 0 5px 0 0; |
||||
color: $uni-bg-color-hover; |
||||
} |
||||
|
||||
.uni-badge--default { |
||||
color: $uni-text-color; |
||||
background-color: $uni-bg-color-hover; |
||||
} |
||||
|
||||
.uni-badge--default-inverted { |
||||
color: $uni-text-color-grey; |
||||
background-color: transparent; |
||||
} |
||||
|
||||
.uni-badge--primary { |
||||
color: $uni-text-color-inverse; |
||||
background-color: $uni-color-primary; |
||||
} |
||||
|
||||
.uni-badge--primary-inverted { |
||||
color: $uni-color-primary; |
||||
background-color: transparent; |
||||
} |
||||
|
||||
.uni-badge--success { |
||||
color: $uni-text-color-inverse; |
||||
background-color: $uni-color-success; |
||||
} |
||||
|
||||
.uni-badge--success-inverted { |
||||
color: $uni-color-success; |
||||
background-color: transparent; |
||||
} |
||||
|
||||
.uni-badge--warning { |
||||
color: $uni-text-color-inverse; |
||||
background-color: $uni-color-warning; |
||||
} |
||||
|
||||
.uni-badge--warning-inverted { |
||||
color: $uni-color-warning; |
||||
background-color: transparent; |
||||
} |
||||
|
||||
.uni-badge--error { |
||||
color: $uni-text-color-inverse; |
||||
background-color: $uni-color-error; |
||||
} |
||||
|
||||
.uni-badge--error-inverted { |
||||
color: $uni-color-error; |
||||
background-color: transparent; |
||||
} |
||||
|
||||
.uni-badge--small { |
||||
transform: $bage-small; |
||||
transform-origin: center center; |
||||
} |
||||
</style> |
@ -0,0 +1,88 @@
|
||||
{ |
||||
"id": "uni-badge", |
||||
"displayName": "uni-badge 数字角标", |
||||
"version": "1.1.6", |
||||
"description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。", |
||||
"keywords": [ |
||||
"", |
||||
"badge", |
||||
"uni-ui", |
||||
"uniui", |
||||
"数字角标", |
||||
"徽章" |
||||
], |
||||
"repository": "https://github.com/dcloudio/uni-ui", |
||||
"engines": { |
||||
"HBuilderX": "" |
||||
}, |
||||
"directories": { |
||||
"example": "../../temps/example_temps" |
||||
}, |
||||
"dcloudext": { |
||||
"category": [ |
||||
"前端组件", |
||||
"通用组件" |
||||
], |
||||
"sale": { |
||||
"regular": { |
||||
"price": "0.00" |
||||
}, |
||||
"sourcecode": { |
||||
"price": "0.00" |
||||
} |
||||
}, |
||||
"contact": { |
||||
"qq": "" |
||||
}, |
||||
"declaration": { |
||||
"ads": "无", |
||||
"data": "无", |
||||
"permissions": "无" |
||||
}, |
||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" |
||||
}, |
||||
"uni_modules": { |
||||
"dependencies": [], |
||||
"encrypt": [], |
||||
"platforms": { |
||||
"cloud": { |
||||
"tcb": "y", |
||||
"aliyun": "y" |
||||
}, |
||||
"client": { |
||||
"App": { |
||||
"app-vue": "y", |
||||
"app-nvue": "y" |
||||
}, |
||||
"H5-mobile": { |
||||
"Safari": "y", |
||||
"Android Browser": "y", |
||||
"微信浏览器(Android)": "y", |
||||
"QQ浏览器(Android)": "y" |
||||
}, |
||||
"H5-pc": { |
||||
"Chrome": "y", |
||||
"IE": "y", |
||||
"Edge": "y", |
||||
"Firefox": "y", |
||||
"Safari": "y" |
||||
}, |
||||
"小程序": { |
||||
"微信": "y", |
||||
"阿里": "y", |
||||
"百度": "y", |
||||
"字节跳动": "y", |
||||
"QQ": "y" |
||||
}, |
||||
"快应用": { |
||||
"华为": "y", |
||||
"联盟": "y" |
||||
}, |
||||
"Vue": { |
||||
"vue2": "y", |
||||
"vue3": "y" |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,58 @@
|
||||
|
||||
|
||||
## Badge 数字角标 |
||||
> **组件名:uni-badge** |
||||
> 代码块: `uBadge` |
||||
|
||||
|
||||
数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景, |
||||
|
||||
### 安装方式 |
||||
|
||||
本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 |
||||
|
||||
如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) |
||||
|
||||
### 基本用法 |
||||
|
||||
在 ``template`` 中使用组件 |
||||
|
||||
```html |
||||
<uni-badge size="small" :text="100" absolute="rightBottom" type="primary"> |
||||
<button type="default">右上</button> |
||||
</uni-badge> |
||||
<uni-badge text="1"></uni-badge> |
||||
<uni-badge text="2" type="purple" @click="bindClick"></uni-badge> |
||||
<uni-badge text="3" type="primary" :inverted="true"></uni-badge> |
||||
|
||||
``` |
||||
|
||||
|
||||
## API |
||||
|
||||
### Badge Props |
||||
|
||||
|属性名 |类型 |默认值 |说明 | |
||||
|:-: |:-: |:-: |:-: | |
||||
|text |String |- |角标内容 | |
||||
|type |String |default|颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)| |
||||
|size |String |normal |Badge 大小,可取值:normal、small | |
||||
|is-dot |Boolean|false |不展示数字,只有一个小点 | |
||||
|max-num |String/Numbuer|99 |展示封顶的数字值,超过 99 显示99+ | |
||||
|custom-style |Object | {} |自定义 Badge 样式, 样式对象语法 | |
||||
|inverted |Boolean|false |是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色 | |
||||
|absolute (不支持 nvue) |String| rightTop|开启绝对定位, 角标将定位到其包裹的标签的四个角上,可选值: rightTop(右上角)、rightBottom(右下角)、leftBottom(左下角) 、leftTop(左上角) | |
||||
|offset |Array[number]| [0, 0]|距定位角中心点的偏移量,[-10, -10] 表示向 absolute 指定的方向偏移 10px,[10, 10] 表示向 absolute 指定的反方向偏移 10px,只有存在 absolute 属性时有效,与absolute 的值一一对应(例如:值为rightTop, 对应 offset 为 [right, Top])| |
||||
|
||||
### Badge Events |
||||
|
||||
|事件名 |事件说明 |返回参数 | |
||||
|:-: |:-: |:-: | |
||||
|@click |点击 Badge 触发事件| - | |
||||
|
||||
|
||||
|
||||
|
||||
## 组件示例 |
||||
|
||||
点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge](https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge) |