作者 lihongjuan

2332

{
"pages": [
"pages/login/login",
"pages/companybox/qiyedetail/qiyedetail",
"pages/qiye/qiye",
"pages/changqu/changqu",
"pages/login/login",
"pages/shebei/shebeilist/shebeilist",
"pages/mine/mine",
"pages/index/index",
"pages/logs/logs",
"pages/qiye/qiye",
"pages/yujing/yujing",
"pages/shebei/shebeidetail/shebeidetail"
],
"window": {
"backgroundTextStyle": "light",
... ...
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
page{
background: #fff;
}
image{
width:100%;
... ... @@ -17,3 +12,15 @@ image{
height:23rpx;
font-size: 0
}
.register {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 5;
}
\ No newline at end of file
... ...
import WxCanvas from './wx-canvas';
import * as echarts from './echarts';
let ctx;
Component({
properties: {
canvasId: {
type: String,
value: 'ec-canvas'
},
ec: {
type: Object
}
},
data: {
},
ready: function () {
if (!this.data.ec) {
console.warn('组件需绑定 ec 变量,例:<ec-canvas id="mychart-dom-bar" '
+ 'canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>');
return;
}
if (!this.data.ec.lazyLoad) {
this.init();
}
},
methods: {
init: function (callback) {
const version = wx.version.version.split('.').map(n => parseInt(n, 10));
const isValid = version[0] > 1 || (version[0] === 1 && version[1] > 9)
|| (version[0] === 1 && version[1] === 9 && version[2] >= 91);
if (!isValid) {
console.error('微信基础库版本过低,需大于等于 1.9.91。'
+ '参见:https://github.com/ecomfe/echarts-for-weixin'
+ '#%E5%BE%AE%E4%BF%A1%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82');
return;
}
ctx = wx.createCanvasContext(this.data.canvasId, this);
const canvas = new WxCanvas(ctx, this.data.canvasId);
echarts.setCanvasCreator(() => {
return canvas;
});
var query = wx.createSelectorQuery().in(this);
query.select('.ec-canvas').boundingClientRect(res => {
if (typeof callback === 'function') {
this.chart = callback(canvas, res.width, res.height);
}
else if (this.data.ec && typeof this.data.ec.onInit === 'function') {
this.chart = this.data.ec.onInit(canvas, res.width, res.height);
}
else {
this.triggerEvent('init', {
canvas: canvas,
width: res.width,
height: res.height
});
}
}).exec();
},
canvasToTempFilePath(opt) {
if (!opt.canvasId) {
opt.canvasId = this.data.canvasId;
}
ctx.draw(true, () => {
wx.canvasToTempFilePath(opt, this);
});
},
touchStart(e) {
if (this.chart && e.touches.length > 0) {
var touch = e.touches[0];
var handler = this.chart.getZr().handler;
handler.dispatch('mousedown', {
zrX: touch.x,
zrY: touch.y
});
handler.dispatch('mousemove', {
zrX: touch.x,
zrY: touch.y
});
handler.processGesture(wrapTouch(e), 'start');
}
},
touchMove(e) {
if (this.chart && e.touches.length > 0) {
var touch = e.touches[0];
var handler = this.chart.getZr().handler;
handler.dispatch('mousemove', {
zrX: touch.x,
zrY: touch.y
});
handler.processGesture(wrapTouch(e), 'change');
}
},
touchEnd(e) {
if (this.chart) {
const touch = e.changedTouches ? e.changedTouches[0] : {};
var handler = this.chart.getZr().handler;
handler.dispatch('mouseup', {
zrX: touch.x,
zrY: touch.y
});
handler.dispatch('click', {
zrX: touch.x,
zrY: touch.y
});
handler.processGesture(wrapTouch(e), 'end');
}
}
}
});
function wrapTouch(event) {
for (let i = 0; i < event.touches.length; ++i) {
const touch = event.touches[i];
touch.offsetX = touch.x;
touch.offsetY = touch.y;
}
return event;
}
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<canvas class="ec-canvas" canvas-id="{{ canvasId }}"
bindinit="init"
bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}">
</canvas>
... ...
.ec-canvas {
width: 100%;
height: 100%;
}
... ...
此 diff 太大无法显示。
export default class WxCanvas {
constructor(ctx, canvasId) {
this.ctx = ctx;
this.canvasId = canvasId;
this.chart = null;
// this._initCanvas(zrender, ctx);
this._initStyle(ctx);
this._initEvent();
}
getContext(contextType) {
if (contextType === '2d') {
return this.ctx;
}
}
// canvasToTempFilePath(opt) {
// if (!opt.canvasId) {
// opt.canvasId = this.canvasId;
// }
// return wx.canvasToTempFilePath(opt, this);
// }
setChart(chart) {
this.chart = chart;
}
attachEvent () {
// noop
}
detachEvent() {
// noop
}
_initCanvas(zrender, ctx) {
zrender.util.getContext = function () {
return ctx;
};
zrender.util.$override('measureText', function (text, font) {
ctx.font = font || '12px sans-serif';
return ctx.measureText(text);
});
}
_initStyle(ctx) {
var styles = ['fillStyle', 'strokeStyle', 'globalAlpha',
'textAlign', 'textBaseAlign', 'shadow', 'lineWidth',
'lineCap', 'lineJoin', 'lineDash', 'miterLimit', 'fontSize'];
styles.forEach(style => {
Object.defineProperty(ctx, style, {
set: value => {
if (style !== 'fillStyle' && style !== 'strokeStyle'
|| value !== 'none' && value !== null
) {
ctx['set' + style.charAt(0).toUpperCase() + style.slice(1)](value);
}
}
});
});
ctx.createRadialGradient = () => {
return ctx.createCircularGradient(arguments);
};
}
_initEvent() {
this.event = {};
const eventNames = [{
wxName: 'touchStart',
ecName: 'mousedown'
}, {
wxName: 'touchMove',
ecName: 'mousemove'
}, {
wxName: 'touchEnd',
ecName: 'mouseup'
}, {
wxName: 'touchEnd',
ecName: 'click'
}];
eventNames.forEach(name => {
this.event[name.wxName] = e => {
const touch = e.touches[0];
this.chart.getZr().handler.dispatch(name.ecName, {
zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
zrY: name.wxName === 'tap' ? touch.clientY : touch.y
});
};
});
}
}
... ...

274 字节

1021 字节

<view class="mapbox">
<view class="search">
<view class="searchimg">
<image src="img/demo (10).png"></image>
<image src="/img/search.png"></image>
</view>
<view class="searchinput">
<input placeholder='湖南' placeholder-class='searchword'/>
... ...
import * as echarts from '../../../ec-canvas/echarts';
const app = getApp();
function initChart(canvas, width, height) {
const chart = echarts.init(canvas, null, {
width: width,
height: height
});
canvas.setChart(chart);
var option = {
tooltip: {
trigger: 'axis'
},
radar: [{
indicator: [{
text: '生产:90分',
max: 100
},
{
text: '预警:60分',
max: 100
},
{
text: '稳定性:80分',
max: 100
}
],
center: ['50%', '60%'],
radius: 80
},
],
series: [{
type: 'radar',
symbolSize: 6,
symbol: 'rect',
tooltip: {
trigger: 'item'
},
itemStyle: {
normal: {
color: '#FBCB77',
areaStyle: {
type: 'default',
color: '#FBCB77'
},
lineStyle:{
color:'#FBCB77',
}
}
},
data: [{
value: [60, 73, 85],
itemStyle: {
normal: {
areaStyle: {
type: 'default',
color: '#FBCB77'
}
}
}
// name: '某软件'
}]
},
]
};
chart.setOption(option);
return chart;
}
Page({
onShareAppMessage: function(res) {
return {
title: 'ECharts 可以在微信小程序中使用啦!',
path: '',
success: function() {},
fail: function() {}
}
},
data: {
ec: {
onInit: initChart
}
},
onReady() {}
});
\ No newline at end of file
... ...
{
"usingComponents": {
"ec-canvas": "../../../ec-canvas/ec-canvas"
}
}
\ No newline at end of file
... ...
<!--index.wxml-->
<view class="coint">
<text class="cointleft">87</text>
<text class="cointword">分</text>
</view>
<view class="zonghe">综合得分</view>
<view class="container" >
<ec-canvas id="mychart-dom-graph" canvas-id="mychart-graph" ec="{{ ec }}"></ec-canvas>
</view>
<view class="xian"></view>
<view class="middle">
<view class="companyname">无锡万峰金属制品有限公司</view>
<view class="middlelist">
<view class="middleitemleft">企业法人</view>
<view class="middleitemright">王刚</view>
</view>
<view class="middlelist">
<view class="middleitemleft">统一信用代码</view>
<view class="middleitemright">895597347547548758574</view>
</view>
<view class="middlelist">
<view class="middleitemleft">行业标签</view>
<view class="middleitemright">金属加工</view>
</view>
</view>
... ...
/**index.wxss**/
page {
height: 100%;
}
.container {
width: 750rpx;
height: 382rpx;
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
}
ec-canvas {
width: 100%;
height: 100%;
}
.coint {
color: #ff9400ff;
text-align: center;
margin-top: 77rpx;
}
.zonghe {
color: #ff9400ff;
font-size: 30rpx;
text-align: center;
}
.cointleft {
font-size: 80rpx;
}
.cointword {
font-size: 30rpx;
}
.xian {
width: 750rpx;
height: 16rpx;
background: #F4F4F4;
opacity: 1;
margin-top:70rpx;
}
.middle{
padding: 48rpx 32rpx;
box-sizing: border-box;
border-bottom:16rpx solid #F4F4F4
}
.companyname{
color:#333333;
font-size: 34rpx;
font-weight: bold
}
.middlelist{
display:flex;
align-items: center;
margin-top:26rpx;
}
.middleitemleft{
width:168rpx;
color:#777777;
font-size: 28rpx;
}
.middleitemright{
color:#777777;
font-size: 28rpx;
margin-left:24rpx;
}
\ No newline at end of file
... ...
... ... @@ -5,14 +5,74 @@ Page({
* 页面的初始数据
*/
data: {
array: ['金属加工', '金属加工1', '金属加工2', '金属加工3'],
index: 0,
banklist:[
{
id:1,
name:'工商银行',
sel:false
},
{
id: 2,
name: '建设银行',
sel: false
},
{
id:3,
name: '农业银行',
sel: false
},
{
id: 4,
name: '中国银行',
sel: false
}
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
gaoji:false
},
bindPickerChange: function (e) {
this.setData({
index: e.detail.value
})
},
//选择银行
chosebank(e){
console.log(e)
let id=e.currentTarget.dataset.id;
let newbanklist=this.data.banklist
for(var i=0;i<newbanklist.length;i++){
if (id == newbanklist[i].id){
newbanklist[i].sel = !newbanklist[i].sel;
}else{
newbanklist[i].sel=false
}
}
this.setData({
banklist:newbanklist
})
},
shaishow(){
this.setData({
gaoji:true
})
},
hideshow(){
this.setData({
gaoji: false
})
},
/**
... ...
<!--pages/qiye/qiye.wxml-->
<text>pages/qiye/qiye.wxml</text>
<view class="pagebox">
<view class="companytou">
<view class="qiyehead">
<view class="qiname">企业清单</view>
<view class="qiye">
<input placeholder='搜索' placeholder-class='qiword' />
</view>
<view class="souimg">
<view class="searchimg">
<image src="/img/qisearch.png"></image>
</view>
</view>
<view class="shai" bindtap="shaishow">
<image src="/img/shaixuan.png"></image>
</view>
</view>
<view class="qibrand">
<view class="branditem ming">企业名称</view>
<view class="branditem ">行业分类</view>
<view class="branditem ping">
<text>评分</text>
<view class="brandimg">
<image src="/img/rowup.png"></image>
</view>
</view>
<view class="branditem ping">
<text>创建时间</text>
<view class="brandimg">
<image src="/img/rowup.png"></image>
</view>
</view>
</view>
</view>
<view class="qiyelist" >
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
<view class="listitem">
<view class="itemname">无锡/万利达无锡/万利达</view>
<view class="hangname">金属加工</view>
<view class="pingname fenshu">98</view>
<view class="creattime">2018-02-16</view>
</view>
</view>
</view>
<view class="register" catchtouchmove='true' wx:if="{{gaoji}}">
<view class="chaimg" bindtap="hideshow">
<image src="/img/cha.png"></image>
</view>
<view class="wrap">
<view class="gaojisearch">高级搜索</view>
<view class="hangfen">行业分类</view>
<view class="fenlist">
<view class="fenleft">
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
<view class="picker">
{{array[index]}}
</view>
</picker>
</view>
<view class="fenright">
<image src="/img/low.png"></image>
</view>
</view>
<view class="hangfen">评分段</view>
<view class="fenduan">
<view class="fenleft">
<input placeholder='0.0' type="number" />
</view>
<view class="fenheng">-</view>
<view class="fenleft">
<input placeholder='0.0' type="number" />
</view>
</view>
<!-- 所属银行 -->
<view class="bankname">所属银行</view>
<view class="banklist" >
<view class="bankitem" wx:for="{{banklist}}" wx:key="" bindtap="chosebank"data-id="{{item.id}}">
<view class="bankleft" wx:if="{{item.sel==true}}">
<image src="/img/select.png"></image>
</view>
<view class="bankleft" wx:else>
<image src="/img/noselect.png"></image>
</view>
<view class="bankright">{{item.name}}</view>
</view>
</view>
<view class="queding">确定</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/qiye/qiye.wxss */
\ No newline at end of file
.companytou{
position: fixed;
top:0;
left:0;
background: #fff;
}
.qiyehead {
display: flex;
align-items: center;
padding: 22rpx 30rpx 22rpx 38rpx;
}
.souimg {
width: 80rpx;
height: 64rpx;
background: #ff9400ff;
border-radius: 8rpx;
display: flex;
align-items: center;
justify-content: center;
}
.searchimg {
width: 36rpx;
height: 36rpx;
font-size: 0;
}
.shai {
width: 29rpx;
height: 32rpx;
font-size: 0;
margin-left: 35rpx;
}
.qiname {
color: #333333ff;
font-size: 36rpx;
font-weight: bold;
}
.qiye {
width: 368rpx;
height: 64rpx;
margin-left: 26rpx;
background: #f7f8faff;
color: #ccccccff;
font-size: 24rpx;
}
.qiword {
color: #ccccccff;
font-size: 24rpx;
}
.ming {
width: 206rpx;
}
.qiye input {
width: 368rpx;
height: 64rpx;
padding: 0 24rpx;
box-sizing: border-box;
}
.qibrand {
display: flex;
align-items: center;
padding: 20rpx 26rpx 20rpx 40rpx;
box-sizing: border-box;
justify-content: space-between;
background: #f7f8faff;
}
.ping {
display: flex;
align-items: center;
}
.branditem {
color: #666666ff;
font-size: 28rpx;
/* margin-right:73rpx; */
}
.brandimg {
width: 20rpx;
height: 27rpx;
font-size: 0;
margin-left: 8rpx;
}
.fenlei {
margin-left: 73rpx;
}
.fen {
margin-left: 73rpx;
}
.time {
margin-left: 73rpx;
}
.qiyelist{
margin-top:180rpx;
}
.listitem {
display: flex;
align-items: center;
padding: 40rpx;
box-sizing: border-box;
justify-content: space-between;
border-bottom: 1rpx solid #f5f5f5;
}
.itemname {
width: 182rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #333333ff;
font-size: 28rpx;
}
.hangname {
color: #333333ff;
font-size: 28rpx;
width: 112rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.fenshu {
color: #ff3038ff;
font-size: 28rpx;
}
.creattime {
color: #999999ff;
font-size: 24rpx;
}
.register {
display: flex;
}
.wrap {
width: 582rpx;
height: 100%;
background: rgba(255, 255, 255, 1);
opacity: 1;
position: absolute;
right: 0;
top: 0;
padding: 0 70rpx 48rpx;
box-sizing: border-box;
}
.chaimg {
width: 65rpx;
height: 65rpx;
font-size: 0;
margin-top: 80rpx;
margin-left: 63rpx;
}
.hangfen {
color: #777777ff;
font-size: 24rpx;
margin-top: 64rpx;
}
.gaojisearch {
color: #161616ff;
font-size: 36rpx;
font-weight: bold;
margin-top: 86rpx;
}
.fenlist {
width: 464rpx;
height: 64rpx;
background: #f7f8faff;
padding: 13rpx 16rpx;
box-sizing: border-box;
margin-top: 22rpx;
border-radius: 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.fenleft {
color: #ccccccff;
font-size: 27rpx;
width: 350rpx;
}
.fenright {
width: 18rpx;
height: 10rpx;
font-size: 0;
}
.fenduan {
display: flex;
align-items: center;
margin-top: 21rpx;
}
.fenleft {
width: 224rpx;
height: 64rpx;
background: #f7f8faff;
border-radius: 10rpx;
text-align: center;
line-height: 64rpx;
}
.fenheng {
color: #777777ff;
margin-right: 2rpx;
margin-left: 2rpx;
}
.bankname {
margin-top: 42rpx;
width: 464rpx;
border-bottom: 1rpx solid #f5f5f5;
padding-bottom: 20rpx;
color: #777777ff;
font-size: 24rpx;
}
.banklist {
margin-top: 44rpx;
border-bottom: 1rpx solid #f5f5f5;
}
.bankitem {
display: flex;
align-items: center;
margin-bottom: 31rpx;
}
.bankleft {
width: 28rpx;
height: 28rpx;
font-size: 0;
}
.bankright {
color: #161616ff;
font-size: 28rpx;
margin-left: 10rpx;
}
.queding {
width: 304rpx;
height: 80rpx;
background: rgba(252, 178, 55, 1);
box-shadow: 0rpx 4rpx 12rpx rgba(252, 178, 55, 0.4);
opacity: 1;
border-radius: 105rpx;
margin:79rpx auto 0;
text-align: center;
line-height: 80rpx;
color:#fff;
font-size: 34rpx
}
... ...