dev
xiaowen 3 years ago
parent f33d41efeb
commit d37b204f44

@ -72,7 +72,11 @@
"van-transition": "@vant/weapp/transition/index",
"van-uploader": "@vant/weapp/uploader/index",
"van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
"van-dropdown-item": "@vant/weapp/dropdown-item/index"
"van-dropdown-item": "@vant/weapp/dropdown-item/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-calendar": "@vant/weapp/calendar/index",
"van-popup": "@vant/weapp/popup/index",
"van-dialog": "@vant/weapp/dialog/index"
}
}

@ -0,0 +1,81 @@
import moment from "moment"
import Dialog from "../../miniprogram_npm/@vant/weapp/dialog/dialog"
Component({
data: {
start: moment().format("YYYY-MM-DD HH:mm:ss"),
startTime: moment().valueOf(),
end: moment().format("YYYY-MM-DD HH:mm:ss"),
endTime: moment().valueOf(),
show1: false,
show2: false,
dt: '',
dt1: '',
showDialog: false
},
methods: {
onDisplay() {
this.setData({
show1: true
});
},
onDisplay1() {
this.setData({
show2: true
});
},
onInput(event) {
let dt = moment(event.detail).format("YYYY-MM-DD HH:mm:ss");
this.setData({
dt: dt
});
},
onInput1(event) {
let dt = moment(event.detail).format("YYYY-MM-DD HH:mm:ss");
this.setData({
dt1: dt,
});
},
onConfirm() {
let isBefore = moment(this.data.dt).isBefore(this.data.dt1)
if(!isBefore) {
this.setData({
showDialog: true,
});
return
}
this.setData({
show1: false,
start: this.data.dt
});
},
onConfirm1() {
let isBefore = moment(this.data.dt).isBefore(this.data.dt1)
if(!isBefore) {
this.setData({
showDialog: true,
});
return
}
this.setData({
show2: false,
end: this.data.dt1
});
},
onCancel() {
this.setData({
show1: false,
});
},
onCancel1() {
this.setData({
show2: false,
});
},
cdialog() {
this.setData({
showDialog: false,
});
}
},
})

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

@ -0,0 +1,22 @@
<view>
<van-tabs type="card">
<van-tab title="二十四小时"></van-tab>
<van-tab title="最近七天"></van-tab>
<van-tab title="最近三十天"></van-tab>
<van-tab title="自定义">
<van-cell title="选择开始时间" is-link value="{{ start }}" bind:click="onDisplay" />
<van-cell title="选择结束时间" is-link value="{{ end }}" bind:click="onDisplay1" />
<van-popup show="{{ show1 }}" position="bottom">
<van-datetime-picker type="datetime" value="{{startTime}}" bind:input="onInput" bind:confirm="onConfirm"
bind:cancel="onCancel" />
</van-popup>
<van-popup show="{{ show2 }}" position="bottom">
<van-datetime-picker type="datetime" value="{{endTime}}" bind:input="onInput1" bind:confirm="onConfirm1"
bind:cancel="onCancel1" />
</van-popup>
<van-dialog use-slot title="注意" show="{{ showDialog }}" bind:confirm="cdialog">
<view class="tc-d-t">结束时间不能小于开始时间</view>
</van-dialog>
</van-tab>
</van-tabs>
</view>

@ -0,0 +1,6 @@
.tc-d-t {
font-size: 14px;
padding: 15px 0px;
color: #909497;
text-align: center;
}

@ -4,7 +4,7 @@ var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexport
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1657089347816, function(require, module, exports) {
__DEFINE__(1657101272963, function(require, module, exports) {
(function(){
// Copyright (c) 2005 Tom Wu
@ -1368,7 +1368,7 @@ __DEFINE__(1657089347816, function(require, module, exports) {
}).call(this);
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1657089347816);
return __REQUIRE__(1657101272963);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

16
package-lock.json generated

@ -10,7 +10,8 @@
"license": "ISC",
"dependencies": {
"@vant/weapp": "^1.10.3",
"miniprogram-sm-crypto": "^0.3.8"
"miniprogram-sm-crypto": "^0.3.8",
"moment": "^2.29.3"
}
},
"node_modules/@vant/weapp": {
@ -30,6 +31,14 @@
"dependencies": {
"jsbn": "^1.1.0"
}
},
"node_modules/moment": {
"version": "2.29.3",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz",
"integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==",
"engines": {
"node": "*"
}
}
},
"dependencies": {
@ -50,6 +59,11 @@
"requires": {
"jsbn": "^1.1.0"
}
},
"moment": {
"version": "2.29.3",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz",
"integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw=="
}
}
}

@ -17,6 +17,7 @@
"license": "ISC",
"dependencies": {
"@vant/weapp": "^1.10.3",
"miniprogram-sm-crypto": "^0.3.8"
"miniprogram-sm-crypto": "^0.3.8",
"moment": "^2.29.3"
}
}

@ -29,12 +29,14 @@ const words = [
]
Page({
data: {
words: words.map(item => {
item[1] = item[1] + 12
return item;
})
minHour: 10,
maxHour: 20,
// minDate: new Date().getTime(),
// maxDate: new Date().getTime(),
currentDate: new Date().getTime(),
},
onShow() {
this.getTabBar().init();
},
});

@ -1,5 +1,6 @@
{
"usingComponents": {
"word-cloud": "../../components/word-cloud/index"
}
"time-channel": "../../components/time-channel/index"
},
"navigationStyle": "custom"
}

@ -1,6 +1,8 @@
<view class="container">
<word-cloud list="{{words}}" height="130"></word-cloud>
<view class="view-page">
<view class="navigation nav-top" style="background: #006BFF">
<view class="bs-top-title">品牌洞察</view>
<view class="v-t-outer">
<time-channel></time-channel>
</view>
</view>
<view>
<word-cloud list="{{words}}" height="130" color="red"></word-cloud>
</view>

@ -1,4 +1,74 @@
.container {
.view-page {
width: 100%;
height: 330px;
color: #333333;
background: #fff;
}
.bs-top-title {
text-align: center;
color: #fff;
font-size: 14px;
padding-top: 30px;
}
.nav-top {
position: fixed;
width: 100%;
height: auto;
top: 0px;
left: 0px;
z-index: 5000;
}
.bs-top {
display: flex;
justify-content: flex-start;
height: 67px;
align-items: center;
background: #006BFF;
padding-left: 13rpx;
padding-right: 13rpx;
padding-top: 5px;
}
.bs-item {
display: flex;
justify-items: flex-start;
align-items: center;
padding: 15px 13px;
font-size: 14px;
}
.bs-item-image {
display: inline-block;
width: 42px;
height: 42px;
margin-right: 15px;
}
.bs-block {
position: relative;
height: 207px;
}
.bs-bar {
position: relative;
}
.bs-bar .van-index-anchor-wrapper {
background: #F9F9F9;
}
.bs-bar .van-index-bar__sidebar {
top: 63%;
}
.v-t-outer {
margin-top: 16px;
}
.v-t-outer .van-tab {
color: #999999 !important;
}
.v-t-outer .van-tabs__scroll--card {
border-style: none;
}
.v-t-outer .van-tabs__nav--card .van-tab {
border-right-style: none;
}
.v-t-outer .van-tabs__nav--card .van-tab.van-tab--active {
background-color: transparent;
color: #0084FF !important;
}
Loading…
Cancel
Save