Commit 8a368d4f Harvey

no message

1 个父辈 4591d09e
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
})
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
</head>
<body>
<noscript>
<strong>Please enable JavaScript to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
\ No newline at end of file
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
})
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS
.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
</head>
<body>
<noscript>
<strong>Please enable JavaScript to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
<script type="text/javascript">
(function flexible(window, document) {
var docEl = document.documentElement
var dpr = window.devicePixelRatio || 1
// adjust body font size
function setBodyFontSize() {
if (document.body) {
document.body.style.fontSize = (12 * dpr) + 'px'
} else {
document.addEventListener('DOMContentLoaded', setBodyFontSize)
}
}
setBodyFontSize();
// set 1rem = viewWidth / 10
function setRemUnit() {
var rem = docEl.clientWidth / 10
if (rem > 54) {
rem = 54
}
docEl.style.fontSize = rem + 'px'
}
setRemUnit()
// reset rem unit on page resize
window.addEventListener('resize', setRemUnit)
window.addEventListener('pageshow', function(e) {
if (e.persisted) {
setRemUnit()
}
})
// detect 0.5px supports
if (dpr >= 2) {
var fakeBody = document.createElement('body')
var testElement = document.createElement('div')
testElement.style.border = '.5px solid transparent'
fakeBody.appendChild(testElement)
docEl.appendChild(fakeBody)
if (testElement.offsetHeight === 1) {
docEl.classList.add('hairlines')
}
docEl.removeChild(fakeBody)
}
}(window, document))
</script>
</html>
......@@ -78,6 +78,23 @@
"style": {
"navigationStyle": "default"
}
},
{
"path": "pages/posters/list",
"aliasPath": "/posters",
"name": "posters_list",
"style": {
"navigationBarTitleText": "今日营销",
"navigationStyle": "default"
}
},
{
"path": "pages/posters/info",
"aliasPath": "/posters/info",
"name": "posters_info",
"style": {
"navigationStyle": "default"
}
}
],
"globalStyle": {
......
......@@ -47,7 +47,7 @@
uni.navigateBack({
delta: 1
});
})
},
async login() {
if (this.mobile.length != 11) {
......
......@@ -109,8 +109,12 @@
})
if (res.length > 0) {
uni.showToast({
title: '操作成功'
// uni.showToast({
// title: '操作成功'
// })
uni.navigateBack({
delta: 1
})
}
},
......
......@@ -41,7 +41,7 @@
duration: 500,
meun_list1: [{
name: '今日营销',
nav: '',
nav: '/posters',
src: '/static/img/jryx.png'
}, {
name: '开奖查询',
......
<template>
<view>
<view class="page-content">
<image :mode="mode" :src="src"></image>
</view>
<view class="page-tabbar">
<view class="page-tabbar-tip" @click="getContent">获取文案</view>
<view class="page-tabbar-tip red" @click="save">保存海报去分享</view>
</view>
<uni-popup ref="popup" type="bottom" class="popup">
<view class="popup-content">
<view>{{content}}</view>
<view class="popup-copy" @click="copyContent">复制文案</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
title: '快乐8 横屏走势图',
mode: 'widthFix',
text: '快乐8 横屏走势图',
content: '暂无文案',
src: 'https://img2.ydniu.com/app/cd/202204122204/%E5%BF%AB%E4%B9%908%E5%9F%BA%E6%9C%AC%E8%B5%B0%E5%8A%BF%E5%9B%BE.png'
}
},
async onLoad(e) {
if (e) {
this.title = e.text
this.text = e.text
this.src = e.src
if (e.content) this.content = e.content
uni.setNavigationBarTitle({
title: this.title
})
}
//#ifdef H5
if (window.Android) {
const $h5 = require('@/static/js/h5-utils.js')
$h5.head_tv(this.src)
}
//#endif
},
methods: {
getContent() {
this.$refs.popup.open('center')
},
copyContent() {
uni.setClipboardData({
data: this.content
});
uni.showToast({
title: '复制成功'
})
this.$refs.popup.close()
},
save() {
//#ifdef H5
require('@/static/js/h5-utils.js').downloadIamge(this.src)
//#endif
}
}
}
</script>
<style lang="scss" scoped>
.page-content {
padding-bottom: 50px;
}
.page-content image {
width: 90%;
margin: 10px 5%;
}
.page-tabbar {
display: flex;
position: fixed;
bottom: 0;
width: 100%;
max-width: $sys-max-width;
height: 44px;
background-color: #F8F8F8;
justify-content: space-around;
font-size: 16px;
color: #333333;
}
.page-tabbar-tip {
width: 33%;
height: 44px;
line-height: 44px;
text-align: center;
}
.red {
color: #E34439;
}
.popup {
z-index: 9999;
}
.popup-content {
width: 80vw;
max-width: 520px;
padding: 20px 20px 38px 20px;
background-color: #FFFFFF;
color: #101010;
font-size: 14px;
min-height: 80px;
border-radius: 5px;
}
.popup-copy {
position: absolute;
bottom: 0;
left: calc((100% - 50px) / 2);
color: #DAB16B;
font-size: 16px;
padding-bottom: 10px;
}
</style>
<template>
<view>
<view class="top-nav">
<button class="top-nav-btn" :class="{'top-nav-btn-on':sub_module_id == item.value}" v-for="(item,i) in nav"
:data-v="item.value" @click="navChange" :key="i">{{item.text}}</button>
</view>
<view class="content">
<view class='left'>
<div v-for="(item,index) in leftData" class="msg-info" :key="index">
<image :mode="mode" lazy-load="true" :src="item.src+'/300w'" @click="imgClick(item)"></image>
<view class="tip">{{item.text}}</view>
</div>
</view>
<view class="right">
<div v-for="(item,index) in rightData" class="msg-info" :key="index">
<image :mode="mode" lazy-load="true" :src="item.src+'/300w'" @click="imgClick(item)"></image>
<view class="tip">{{item.text}}</view>
</div>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
nav: [{
text: '全部',
value: 0
}, {
text: '双色球',
value: 11
}, {
text: '大乐透',
value: 12
}, {
text: '快乐8',
value: 13
}, {
text: '福彩3d',
value: 14
}, {
text: '排列3',
value: 15
}, {
text: '排列5',
value: 16
}, {
text: '七星彩',
value: 18
}],
leftData: [],
rightData: [],
mode: 'widthFix',
sub_module_id: 0
}
},
async onLoad() {
//#ifdef H5
if (window.Android) {
const $h5 = require('@/static/js/h5-utils.js')
$h5.remove_uni_page_head()
}
//#endif
this.bindData()
},
methods: {
async bindData() {
const res = await uni.$u.request.graphql({
name: 'lottery_shop_get_posters',
args: `module_id:4,sub_module_id:${this.sub_module_id}`
}).then(v => v.map(a => ({
text: a.title,
src: a.main_image_url,
mid: a.module_id,
content: a.content || '',
id: a.id
})))
if (res.length < 2) return
var leftData = []
var rightData = []
for (var i = 1, k = 0; i < res.length; i += 2, k++) {
if (k % 2 == 1) {
leftData.push(res[i])
rightData.push(res[i - 1])
} else {
leftData.push(res[i - 1])
rightData.push(res[i])
}
}
this.leftData = leftData
this.rightData = rightData
},
navChange(e) {
var sid = e.target.dataset.v
if (this.sub_module_id == sid) return
this.sub_module_id = sid
this.bindData()
},
imgClick(img) {
window.location.href = `/tv/info?text=${img.text}&src=${img.src}&content=${img.content}&zq=zq`
}
}
}
</script>
<style lang="scss" scoped>
.top-nav {
display: flex;
padding: 10px;
flex-wrap: wrap;
}
.top-nav-btn {
margin-top: 8px;
width: 22%;
height: 30px;
line-height: 30px;
color: #666666;
background-color: rgb(241, 241, 241);
font-size: 14px;
font-weight: normal;
}
.top-nav-btn-on {
background-color: #E09E0B;
color: #FFFFFF;
}
.content {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-around;
padding: 20px 8px 30px 8px;
}
.left,
.right {
width: 46%;
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.content .msg-info {
position: relative !important;
width: 100%;
}
.content image {
width: 100%;
}
.content .tip {
position: absolute;
bottom: 0;
background: #f6fbfe;
opacity: 0.8;
width: 100%;
line-height: 50px;
height: 50px;
z-index: 9;
text-align: center;
white-space: nowrap;
overflow: hidden;
font-size: 16px;
}
</style>
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!