Commit 8b04d869 authored by huangyuanyuan's avatar huangyuanyuan

支付

parent 4bdcd71c
......@@ -51,8 +51,8 @@ App({
let timestamp = (new Date()).valueOf()
let sign = md5('cmd=' + url + '&' + 'msg=' + encodeURIComponent(data).toLowerCase() + '&' + 'timestamp=' + timestamp + '&' + 'token=' + getApp().state.admin.token + '&' + 'key=' + '')
wx.request({
url: 'http://192.168.2.214:8082/api/Common/Post',
// url: 'http://192.168.2.65:8025/api/Common/Post', //春姐
// url: 'http://192.168.2.214:8082/api/Common/Post',
url: 'http://192.168.2.16:8083/api/Common/Post',
// url: 'https://reborn.oytour.com/api/common/post', //线上
// url: ' http://test.viitto.com/api/common/post',
......
......@@ -58,7 +58,9 @@
"pages/local/TicketOrder/TicketOrder",
"pages/local/LocalFoodDetails/LocalFoodDetails",
"pages/local/FoodOrder/FoodOrder",
"pages/Pay/Pay"
"pages/Pay/Pay",
"pages/mine/Happypassbook/Happypassbook",
"pages/mine/UseDetails/UseDetails"
],
"window": {
"backgroundTextStyle": "light",
......
......@@ -67,13 +67,16 @@ Component({
},
getCity(proInfo) {
console.log("proInfo", proInfo)
let that = this;
app.$api('dict_post_Destination_GetChildList', { Id: proInfo.ID }).then(res => {
this.setData({
cityList: res
})
let index = that.data.index[1];
if(res.length==0){
let index = that.data.index[1];
that.data.selectInfo.name = that.data.provinceList[index].Name;
that.data.selectInfo.id = that.data.provinceList[index].ID;
......
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%;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
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
});
};
});
}
}
images/login/ico_lock1.png

206 Bytes | W: | H:

images/login/ico_lock1.png

891 Bytes | W: | H:

images/login/ico_lock1.png
images/login/ico_lock1.png
images/login/ico_lock1.png
images/login/ico_lock1.png
  • 2-up
  • Swipe
  • Onion skin
images/login/ico_lock2.png

319 Bytes | W: | H:

images/login/ico_lock2.png

1.22 KB | W: | H:

images/login/ico_lock2.png
images/login/ico_lock2.png
images/login/ico_lock2.png
images/login/ico_lock2.png
  • 2-up
  • Swipe
  • Onion skin
images/login/logo.png

2.91 KB | W: | H:

images/login/logo.png

8.09 KB | W: | H:

images/login/logo.png
images/login/logo.png
images/login/logo.png
images/login/logo.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -148,9 +148,7 @@ Page({
})
console.log("lineList", that.data.lineList)
this.GetLoadList(0);
}).catch(err => {
})
}).catch(err => {})
},
loadTiaoshui() {
let that = this;
......
......@@ -12,7 +12,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
......
// pages/Pay/Pay.js
let app=getApp();
Page({
/**
* 页面的初始数据
*/
data: {
orderId:0,
tagID:-1,
Commoditydetails:{},
code:{},
PayOrder:"",
payway:'',
codeInfo:{},
codeshow:false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log("options", options)
// options.tagID = "4";
// options.orderId = "27900";
// 机票
if (options.tagID=="4"){
this.setData({
orderId: options.orderId
})
this.getAirTicket(options.orderId)
}
if (options.tagID == "-1") {
let Visainfo = wx.getStorageSync('payInfoMsg');
this.data.Commoditydetails = Visainfo;
this.data.Commoditydetails.airOrderId = Visainfo.airOrderId;
this.data.code.OrderSource = Visainfo.orderResourceId;
this.data.code.total_fee = Visainfo.preferPrice + '';
this.data.code.body = Visainfo.description;
this.data.code.attach = `${Visainfo.costType}|${Visainfo.customerName}|${Visainfo.AirOrderId}|${Visainfo.customerId}|${Visainfo.outBranchId}`;
this.setData({
Commoditydetails: this.data.Commoditydetails,
code: this.data.code
})
console.log("Commoditydetails", this.data.Commoditydetails)
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
getAirTicket(){
let that=this;
app.$apiJavaNew('/api/dmc/airticket/GetB2BAirtickOrderPayInfo', { AirOrderId: this.data.orderId }).then(res => {
that.data.Commoditydetails = res;
that.data.code.OrderSource = that.data.Commoditydetails.orderResourceId;
that.data.code.total_fee = that.data.Commoditydetails.preferPrice + '';
that.data.code.body = that.data.Commoditydetails.description;
that.data.code.attach = `${that.data.Commoditydetails.costType}|${that.data.Commoditydetails.customerName}|${this.data.orderId}|${that.data.Commoditydetails.customerId}|${that.data.Commoditydetails.outBranchId}`
that.setData({
code: that.data.code,
Commoditydetails: that.data.Commoditydetails,
})
// that.Code('3');
}).catch(err => { })
},
Code(e) {
let str = e.currentTarget.dataset.num;
this.data.payway = str ? this.data.payway = str : this.data.payway;
this.data.code.payway = this.data.payway;
app.$api('OnlinePay_post_GetCodeUrlForAirB2B', this.data.code).then(res => {
let codeInfo = res;
this.data.PayOrder = codeInfo.Pay_Order;
this.setData({
codeInfo: res,
PayOrder: this.data.PayOrder,
codeshow:true,
})
// console.log("codeInfo", this.data.codeInfo)
// clearInterval(this.Pay_timer);
// this.PayStatus();
if (res.IsUpdateAirOrderPayStatus == 1) {
}
}).catch(err => { })
},
closeCode(e){
let self = e.currentTarget.dataset.self;
if(self="self"){
this.setData({
codeshow:false,
})
}
},
onReady: function () {
},
......
......@@ -6,26 +6,31 @@
<view class="body">
<view class="f26">订单号:</view>
<view class="c66 f26">
1213245
{{Commoditydetails.airOrderId}}
</view>
</view>
<view class="money">
<text class="f20 c99">应付总额:</text>
<text class="cee">¥</text>
<text class="f46 cee">9980</text>
<text class="f46 cee">{{Commoditydetails.preferPrice}}</text>
</view>
</view>
<view class="Gray30"></view>
<view class='payType'>
<view class="active">
<view bindtap="Code" data-num="1" class="{{payway!='3'?'active':''}}">
<image style="width:30rpx;height:30rpx" src="/images/group/wx.png"></image>
微信支付
</view>
<view>
<view bindtap="Code" data-num="3" class="{{payway=='3'?'active':''}}">
<image style="width:30rpx;height:30rpx" src="/images/group/zfb.png"></image>
支付宝支付
</view>
</view>
</view>
<view bindtap="closeCode" data-self="self" hidden="{{!codeshow}}" class="codeImg">
<view class="codeUrl">
<image src="{{codeInfo.CodeURL}}"></image>
</view>
</view>
\ No newline at end of file
......@@ -63,4 +63,23 @@
}
.payType>view image{
margin-right: 15rpx;
}
.codeImg{
position: fixed;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
top: 0;
left: 0;
}
.codeImg .codeUrl{
width: 450rpx;
height: 450rpx;
background: #fff;
margin: auto;
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
\ No newline at end of file
......@@ -263,9 +263,12 @@ Page({
that.data.msg.destinationIds = vastr.id;
that.data.msg.destinationNames = vastr.name;
}
// console.log("departureName", vastr)
that.setData({
msg: that.data.msg
})
// console.log("that.data.msg", that.data.msg)
},
getCity(e) {
let that = this;
......
......@@ -45,7 +45,7 @@
</view>
<view wx:for="{{data.ticketList}}" wx:key="index" class="ticketItem">
<view class="left">
<view>{{item.ticketName}}<text wx:if="{{item.ticketDesc}}">({{item.ticketDesc}})</text></view>
<view>{{item.ticketName}}</view>
<view style="margin-top:10rpx" class="c66">{{data.name}}</view>
</view>
<view class="right">
......
<view class="page">
<view class='banner_box'>
<image class='banner_image' src='http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190626095603000.png'></image>
<image class='banner_image' src='http://imgfile.oytour.com/New/Upload/Cloud/2019-07/20190711103504420.png'></image>
</view>
<view class='page__bd'>
<view class='header'>
<image class='header_image' src='../../images/login/logo.png'></image>
<text class='header_text'>同业登录</text>
</view>
<view class='form'>
<view class='form_item1'>
<view class='form_item_icoBox'>
<image class='form_item_ico' src='../../images/login/ico_lock1.png' mode="widthFix"></image>
</view>
<view class='form_item_inBox'>
<input class='form_item_input' type='number' value="{{account}}" placeholder-class="form_item_holder" placeholder="请输入手机号" bindinput="bindAccountInput"></input>
</view>
<view class="headBg">
<image class="headBgImg" src="http://imgfile.oytour.com/New/Upload/Cloud/2019-07/20190716034157622.png"></image>
<view class='header'>
<image class='header_image' src='../../images/login/logo.png'></image>
<text class='header_text'>welcome</text>
</view>
<view class='form_item2'>
<view class='form_item_icoBox'>
<image class='form_item_ico' src='../../images/login/ico_lock2.png' mode="widthFix"></image>
<view class='form'>
<view class='form_item1'>
<view class='form_item_inBox'>
<image style="width:32rpx;height:28rpx" class='form_item_ico' src='../../images/login/ico_lock1.png'></image>
<input class='form_item_input' type='number' value="{{account}}" placeholder-class="form_item_holder" placeholder="请输入手机号" bindinput="bindAccountInput"></input>
</view>
</view>
<view class='form_item_inBox'>
<input class='form_item_input' value="{{password}}" placeholder-class="form_item_holder" placeholder="请输入密码" password="{{isPwd}}" bindinput="bindPasswordInput"></input>
<image class='form_item_eye' src='../../images/login/{{isPwd===true?"hidePwd":"showPwd"}}.png' mode="widthFix" bindtap='pwdToShow'></image>
<view class='form_item2'>
<view class='form_item_inBox'>
<image style="width:28rpx;height:24rpx" class='form_item_ico' src='../../images/login/ico_lock2.png'></image>
<input class='form_item_input' value="{{password}}" placeholder-class="form_item_holder" placeholder="请输入密码" password="{{isPwd}}" bindinput="bindPasswordInput"></input>
<!-- <image class='form_item_eye' src='../../images/login/{{isPwd===true?"hidePwd":"showPwd"}}.png' mode="widthFix" bindtap='pwdToShow'></image> -->
</view>
</view>
<view class='form_link'>
<navigator class='form_link_text' url='smsLogin/smsLogin'>短信验证登录</navigator>
<navigator class='form_link_text' url='revisePwd/revisePwd'>修改密码</navigator>
</view>
</view>
<view class='form_link'>
<navigator class='form_link_text' url='smsLogin/smsLogin'>短信验证登录</navigator>
<navigator class='form_link_text' url='revisePwd/revisePwd'>修改密码</navigator>
</view>
<form bindsubmit="signIn" report-submit>
<button hover-class="btn-hover" form-type="submit">
<view class='login_btn {{loginState===true?"login_btn_true":""}}'>登录</view>
</button>
</form>
</view>
<form bindsubmit="signIn" report-submit>
<button hover-class="btn-hover" form-type="submit">
<view class='login_btn {{loginState===true?"login_btn_true":""}}'>登录</view>
</button>
</form>
<view class='login_wx' bindtap='signWx'>
<image class='login_wx_image' src='../../../images/login/ico_wx.png' mode='widthFix'></image>
<view bindtap='signWx' style="margin-top:120rpx;text-align:center">
<text class='login_wx_text'>微信手机号快捷登录</text>
</view>
</view>
</view>
</view>
\ No newline at end of file
......@@ -22,6 +22,7 @@
.page__bd{
position: relative;
z-index: 2;
padding-top: 250rpx;
}
.header{
......@@ -30,22 +31,34 @@
justify-content: center;
align-items: center;
width: 100%;
height: 450rpx;
/* height: 450rpx; */
}
.header_image{
width: 150rpx;
height: 150rpx;
width: 152rpx;
height: 152rpx;
}
.header_text{
margin: 30rpx 0 0 0;
font-size: 15px;
color: #257BF1;
font-size: 30rpx;
color: #EE4454;
}
.headBg{
position: relative;
width: 669rpx;
height: 631rpx;
margin: 0 auto;
}
.headBgImg{
position: absolute;
width: 100%;
height: 100;
z-index: -1;
}
.form{
margin: 0rpx 0 0 0;
margin: 40rpx 0 0 0;
padding: 0 100rpx;
width: 100%;
}
......@@ -59,7 +72,7 @@
}
.form_item2{
margin: 56rpx 0 0 0;
margin: 30rpx 0 0 0;
width: 100%;
height: 70rpx;
display: flex;
......@@ -78,7 +91,7 @@
}
.form_item_ico{
width: 15px;
margin-left: 5rpx;
}
.form_item_inBox{
......@@ -87,13 +100,14 @@
display: flex;
align-items: center;
height: 30px;
border-bottom: 1px solid #257BF1;
border-bottom: 1px solid #666666;
}
.form_item_input{
flex-grow: 1;
font-size: 14px;
color: #333333;
text-align: center;
}
.form_item_holder{
font-size: 14px;
......@@ -106,7 +120,7 @@
}
.form_link{
margin: 20rpx 0 0 0;
margin: 30rpx 0 0 0;
padding: 0 0 0 40px;
display: flex;
justify-content: space-between;
......@@ -114,45 +128,33 @@
}
.form_link_text{
font-size: 14px;
color: #257BF1;
font-size: 26rpx;
color: #999999;
}
.login_btn{
display: flex;
justify-content: center;
align-items: center;
margin: 60rpx 100rpx 0 100rpx;
height: 80rpx;
margin:0 auto;
font-size: 14px;
color: #FFFFFF;
background-color: #C2D6F2;
border-radius: 20px;
width:220rpx;
height:80rpx;
line-height:80rpx;
background:rgba(238,68,84,1);
box-shadow:0px 6px 6px 0px rgba(139,139,139,0.25);
border-radius:40rpx;
margin-top:45rpx;
}
.login_btn_true{
background-color: #257BF1;
background-color: #EE4454;
}
.login_wx{
display: flex;
justify-content: center;
align-items: center;
margin: 30rpx 100rpx 0 100rpx;
height: 80rpx;
font-size: 0px;
background-color: #257BF1;
border-radius: 20px;
}
.login_wx_image{
width: 20px;
}
.login_wx_text{
margin: 0 0 0 15rpx;
font-size: 15px;
color: #FFFFFF;
font-size: 26rpx;
color: #EE4454;
white-space: nowrap;
}
button{
......
......@@ -115,9 +115,27 @@ Page({
totalPage: 1,
count: 0,
listClass: 'tuan',
tagID: 1,
tagID: 4,
tagIndex: 0,
},
// 门票跳转支付
goCommonPay(e){
let payInfoMsg = e.currentTarget.dataset.item.payInfo;
console.log("payInfoMsg", payInfoMsg);
wx.setStorageSync('payInfoMsg', payInfoMsg)
wx.navigateTo({
url: '/pages/Pay/Pay?tagID=-1',
})
},
// 机票支付跳转
airTicketPay(e){
let item = e.currentTarget.dataset.item;
wx.navigateTo({
url: '/pages/Pay/Pay?orderId=' + item.orderId + '&tagID=' + this.data.tagID,
})
},
formSubmit: function (e) {
console.log(e)
wx.getStorage({
......
......@@ -18,6 +18,7 @@
</view>
</view>
<scroll-view class='data_body' scroll-y bindscrolltolower="scrollGetMore">
({{tagID}})
<view wx:if="{{tagID !== 6 && tagID !== 8 && tagID !== 4}}">
<view class='list-item' wx:for="{{dataList}}" wx:for-item="item" wx:key="index" wx:for-index="index">
<!-- <form bindsubmit="formSubmit" report-submit>
......@@ -74,7 +75,7 @@
<view class='list-item-btn'>
<view wx:if="{{item.status == 1}}">联系客服</view>
<view wx:if="{{item.status == 1 || item.status == 3}}">取消订单</view>
<view wx:if="{{item.status == 3}}" class='btn-red'>付款</view>
<view bindtap="goCommonPay" data-item="{{item}}" wx:if="{{item.status == 3}}" class='btn-red'>付款</view>
<view class='btn-red' wx:if="{{item.orderState == 1}}">再次购买</view>
</view>
<!-- </button>
......@@ -104,13 +105,14 @@
<view class='list-item-btn'>
<view wx:if="{{item.status == 1}}">联系客服</view>
<view wx:if="{{item.status == 1 || item.status == 3}}">取消订单</view>
<view wx:if="{{item.status == 3}}" class='btn-red'>付款</view>
<view bindtap="goCommonPay" data-item="{{item}}" wx:if="{{item.status == 3}}" class='btn-red'>付款</view>
<view class='btn-red' wx:if="{{item.orderState == 1}}">再次购买</view>
</view>
<!-- </button>
</form> -->
</view>
</view>
<!-- 机票 -->
<view wx:elif="{{tagID == 4}}">
<view class='list-item' wx:for="{{dataList}}" wx:for-item="item" wx:key="index" wx:for-index="index">
<!-- <form bindsubmit="formSubmit" report-submit>
......@@ -141,7 +143,7 @@
<view class='list-item-btn'>
<view wx:if="{{item.orderState == 1}}">联系客服</view>
<view wx:if="{{item.orderState == 1}}">取消订单</view>
<view wx:if="{{item.orderState == 1}}" class='btn-red'>付款</view>
<view bindtap="airTicketPay" data-item="{{item}}" wx:if="{{item.orderState == 1}}" class='btn-red'>付款</view>
<view class='btn-red' wx:if="{{item.orderState == 2}}">再次购买</view>
</view>
<!-- </button>
......
import * as echarts from '../../../component/ec-canvas/echarts';
let app=getApp();
Page({
/**
* 页面的初始数据
*/
data: {
zbList:[],
admin: app.state.admin,
xMonth:[],
yMoney1: [],
yMoney2: [],
datainfo:{},
companyId: app.state.companyId,
cityId: app.state.cityId,
saleList:[],
ecScatter: {
lazyLoad: true
},
ec: {
lazyLoad: true
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getZhanbi();
this.getZheXian();
this.getHot();
this.scaComponnet = this.selectComponent('#mychart-dom-multi-scatter');
this.pieComponnet = this.selectComponent('#mychart-pie');
},
initPie: function () {
this.pieComponnet.init((canvas, width, height) => {
// 初始化图表
const scaChart = echarts.init(canvas, null, {
width: width,
height: height
});
scaChart.setOption(this.getPie());
// 注意这里一定要返回 chart 实例,否则会影响事件处理等
return scaChart;
});
},
getPie: function () {
//请求数据
return {
tooltip: {
trigger: "item",
formatter: "{a}{b} : {c} ({d}%)"
},
calculable: true,
graphic: [
{
type: "text",
left: "40%",
top: "45%",
style: {
text: "线路占比",
textAlign: "center",
fill: "#2C3343", //文字的颜色
fontSize: 18,
fontFamily: "pingfangR"
}
}
],
series: [
{
name: "订单来源",
type: "pie",
radius: ["50%", "70%"],
itemStyle: {
normal: {
label: {
show: false
},
labelLine: {
show: false
},
borderWidth: 2,
borderColor: "#fff",
color: function (params) {
//自定义颜色
var colorList = [
"#F8733A",
"#53D277",
"#36C7D9",
"#F8733A",
"#F9B89C"
];
return colorList[params.dataIndex];
}
},
emphasis: {
label: {
show: true,
textStyle: {
fontSize: "20",
fontFamily: "pingfangR"
}
}
}
},
data: this.data.zbList
}
]
}
},
init_sca: function () {
this.scaComponnet.init((canvas, width, height) => {
// 初始化图表
const scaChart = echarts.init(canvas, null, {
width: width,
height: height
});
scaChart.setOption(this.getScaOption());
// 注意这里一定要返回 chart 实例,否则会影响事件处理等
return scaChart;
});
},
getScaOption: function () {
//请求数据
return {
title: {
left: "left",
textStyle: {
fontWeight: "bold",
fontSize: 14,
color: "#333333",
height: "30px"
},
},
xAxis: {
type: "category",
boundaryGap: false,
axisLine: {
show: false,
lineStyle: {
width: 30
}
},
axisTick: false,
data: this.data.xMonth,
},
yAxis: {
type: "value",
min: '10',
axisTick: true,
splitLine: {
show: true,
lineStyle: {
color: "#fff"
}
},
},
series: [
{
type: "line",
smooth: 1,
symbol: 'none',
data: this.data.yMoney1,
lineStyle: {
width: 3,
color: "#36C7D9"
},
itemStyle: {
borderWidth: 5,
color: "#FFFFFF"
},
areaStyle: {
color: "#A4E6EE"
}
},
{
type: "line",
smooth: 2,
data: this.data.yMoney2,
lineStyle: {
width: 3,
color: "#ED6A6B",
type: 'dashed'
},
itemStyle: {
borderWidth: 5,
},
areaStyle: {
color: "#FAD2D2"
}
}
]
};
},
goUrl(e) {
let item = e.currentTarget.dataset.item;
let teamType = e.currentTarget.dataset.teamtype;
wx.navigateTo({
url: '/pages/GroupTour/GroupDetails/GroupDetails?idDes=' + encodeURIComponent(item.idDes) + "&tcid=" + item.tcid + "&teamType=" + teamType,
})
},
getZheXian(){
let that=this;
app.$api('customer_post_GetCustomerBigRedEnvelope', { CustomerId: this.data.admin.customerAccountId }).then(res => {
let datainfo = res;
let arr1 = ['-', '-', '-', '-'];
let newarr = [];
datainfo.JQLRList.forEach((item, index) => {
that.data.xMonth.push(item.Date)
if (index < 5) {
that.data.yMoney1.push(item.Money)
}
if (index > 3) {
newarr.push(item.Money);
that.data.yMoney2 = arr1.concat(newarr);
}
})
datainfo.RatioList.forEach(item => {
item.percent =datainfo.Amount / item.Money;
item.width = (item.percent) * 100;
})
that.data.yMoney1 = that.data.yMoney1.concat(["-"]);
that.setData({
yMoney2: that.data.yMoney2,
yMoney1: that.data.yMoney1,
xMonth: that.data.xMonth,
datainfo:datainfo
})
that.init_sca();
}).catch(err => { })
},
getZhanbi(){
app.$apiJavaNew('/api/b2b/user/getLinePercentage', {}).then(res => {
let data=res;
data.forEach(item=>{
let obj = {};
obj.name = item.LineName;
obj.value = item.num;
this.data.zbList.push(obj);
})
this.setData({
zbList: this.data.zbList
})
this.initPie();
}).catch(err => {
})
},
goUrlUse(){
wx.navigateTo({
url: '/pages/mine/UseDetails/UseDetails',
})
},
getHot() {
let msg = {
pageIndex: 1,
pageSize: 4,
companyId: this.data.companyId,
cityId: this.data.cityId,
};
app.$apiJavaNew('/api/b2b/home/getHomeTravelSpecialSale', msg).then(res => {
let data = res;
this.setData({
saleList: data.pageData
})
}).catch(err => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {
"ec-canvas": "../../../component/ec-canvas/ec-canvas"
}
}
\ No newline at end of file
<view class="commonF Happy" id="Red">
<image class="xfcz" src="/images/mine/xfcz.png"></image>
<view class="banner">
<view class="bannerView">
<view class="leftView">
<view class="f28">可用余额</view>
<view style="font-size:70rpx">¥{{datainfo.Client_Balance}}</view>
</view>
<view class="rightView" style="width:235rpx;height:238rpx">
<image src="/images/mine/t2.png"></image>
</view>
</view>
<view class="bannerbottom">
<text style="border-right:1px solid rgba(255,255,255,0.5)">使用规则</text>
<text bindtap="goUrlUse">使用明细</text>
</view>
</view>
<view class="zbView">
<view class="topView">
<text class="bg"></text>
<text class="f28">人头返佣</text>
</view>
<view id="chart">
<text class="text">线路占比</text>
<ec-canvas id="mychart-pie" canvas-id="mychart-pie" style="height:418rpx" ec="{{ec}}"></ec-canvas>
</view>
<!-- <view class="bottomBtn">查看明细
<image style="width:27rpx;height:14rpx" src="/images/mine/xia.png"></image>
</view> -->
</view>
<view class="zbView">
<view class="topView">
<text class="bg"></text>
<text class="f28">大红包</text>
</view>
<view id="chart1">
<ec-canvas id="mychart-dom-multi-scatter" canvas-id="mychart-multi-scatter" ec="{{ ecScatter }}"></ec-canvas>
</view>
<view class="price">
<view>
<view class="f20 c99">本年累计交易总额</view>
<view class="f40 bold">¥{{datainfo.Amount}}</view>
</view>
<view>
<view class="f20 c99">累计收益</view>
<view class="f40 bold">¥{{datainfo.TotalMoney}}</view>
</view>
</view>
<view style="text-align:center;margin-top:40px">
<text class="f20">当前交易额:¥</text>
<text class="f40">{{datainfo.Amount}}</text>
</view>
<view wx:for="{{datainfo.RatioList}}" wx:key="index" class="RedProgress">
<view class="{{'jyTtem'+index}}">
<view class="progress progress1">
<view class="progressSpan" style="{{'width:'+ item.width +'%;'}}"></view>
<!-- <view class="progressSpan" style="width:70%;"></view> -->
</view>
<view style="margin-top:10rpx">
<view class="desLeft">
<view wx:if="{{item.percent>1}}" style="color:#00B526" class="blod">已激活,预计收益 ¥{{(item.Money*item.Ratio)/1000}}</view>
<view wx:if="{{item.percent<1}}" style="color:#EE4454" class="blod">还差¥{{item.Money-datainfo.Amount}},预计收益 ¥{{(item.Money*item.Ratio)/1000}}</view>
</view>
<view class="desRight">
<view style="color:#999999">年交易额已达
<text class="blod">¥{{item.Money}}</text>
<text>返</text>
<text class="blod">{{item.Ratio}}‰</text>
</view>
</view>
</view>
</view>
</view>
<view class="hotview">
<view bindtap="goUrl" data-item="{{item}}" data-teamType="{{0}}" wx:for="{{saleList}}" wx:key="index" class="hotItem">
<view class="imgView">
<image wx:if="{{item.imgCover[0]}}" src="{{item.imgCover[0].url}}"></image>
</view>
<view style="padding:0 15rpx 5rpx 15rpx">
<view class="f26 text1">{{item.title}}</view>
<view class="cee" style="text-align:right">
<text class="f20">¥</text>
<text class="f26">{{item.b2BPrice}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
.Happy{
background: #F8F5F5
}
.Happy .banner{
width:690rpx;
height:370rpx;
background:linear-gradient(-90deg,rgba(239,125,87,0.88),rgba(234,78,87,0.88));
border:6rpx solid rgba(238, 163, 118, 1);
border-radius:20rpx;
margin:20rpx auto;
position: relative;
}
.bannerView{
padding: 0 30rpx;
box-sizing: border-box;
border-bottom:1px solid rgba(255,255,255,0.5);
}
.leftView,.rightView{
display: inline-block;
color:#F4E0C2;
}
.leftView{
width: 380rpx;
box-sizing: border-box;
position: relative;
top: -50rpx;
}
.bannerbottom text{
display: inline-block;
color:#F4E0C2;
font-size: 28rpx;
text-align: center;
width: 49%;
margin-top:10rpx;
padding:12rpx 0;
}
.xfcz{
width: 226rpx;
height: 66rpx;
position: absolute;
top: 0rpx;
left: 250rpx;
z-index:100;
}
.zbView{
background: #fff;
border-radius:20rpx;
width:690rpx;
margin: 30rpx auto;
}
.zbView .topView{
height: 90rpx;
display: flex;
align-items: center;
padding:0 30rpx;
border-bottom:1px solid #E9E9E9;
}
.zbView .topView .bg{
display: inline-block;
width:6rpx;
height:28rpx;
background:rgba(238,68,84,1);
margin-right: 5rpx;
}
.zbView #chart{
height:418rpx;
width: 100%;
position: relative;
}
.zbView #chart .text{
position: absolute;
left: 38%;
top: 160rpx;
font-size: 40rpx;
}
.zbView #chart1{
height:418rpx;
width: 100%;
}
.zbView .bottomBtn{
height: 90rpx;
line-height: 90rpx;
text-align: center;
font-size: 28rpx;
}
.zbView .price>view{
display: inline-block;
width: 48%;
text-align: center;
}
.desLeft,.desRight{
display: inline-block;
width: 48%;
}
.desLeft{
font-size:22rpx;
}
.desRight{
font-size:20rpx;
text-align: right;
}
.hotview{
width:690rpx;
border-radius:20rpx;
padding:30rpx;
}
.hotview .hotItem{
display: inline-block;
width:300rpx;
border-radius:12rpx;
border: 1px solid #ededed;
margin-bottom: 30rpx;
}
.hotview .hotItem .imgView{
width:100%;
height:224rpx;
}
.hotview .hotItem:nth-child(even){
margin-left: 30rpx;
}
.RedProgress {
padding: 30rpx;
box-sizing: border-box;
}
.RedProgress .progress{
width: 100%;
height: 20rpx;
background:#E3E3E3;
border-radius: 15px;
overflow: hidden;
position: relative;
}
.RedProgress .progress .progressSpan{
position: absolute;
top: 0;
left: 0;
height: 100%;
}
#Red .jyTtem0 .progress>view,#Red .jyTtem3 .progress>view,#Red .jyTtem6 .progress>view {
display: inline-block;
width: 60%;
height: 100%;
background: #2989d8; /* Old browsers */
background: -moz-linear-gradient(-45deg, #36C7D9 33%, #9AE3EC 34%, #9AE3EC 59%, #36C7D9 60%); /* FF3.6+ */
background: -webkit-gradient(linear, left bottom, right top, color-stop(33%,#9AE3EC), color-stop(34%,#9AE3EC), color-stop(59%,#9AE3EC), color-stop(60%,#36C7D9)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(-45deg, #36C7D9 33%,#9AE3EC 34%,#9AE3EC 59%,#36C7D9 60%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(-45deg, #36C7D9 33%,#9AE3EC 34%,#9AE3EC 59%,#36C7D9 60%); /* Opera 11.10+ */
background: -ms-linear-gradient(-45deg, #36C7D9 33%,#9AE3EC 34%,#9AE3EC 59%,#36C7D9 60%); /* IE10+ */
background: linear-gradient(-45deg, #36C7D9 33%,#9AE3EC 34%,#9AE3EC 59%,#36C7D9 60%); /* W3C */
background-size: 60px 30px;
text-align: center;
color:#fff;
}
#Red .jyTtem1 .progress>view,#Red .jyTtem4 .progress>view,#Red .jyTtem7 .progress>view {
display: inline-block;
width: 50%;
height: 100%;
background: #2989d8; /* Old browsers */
background: -moz-linear-gradient(-45deg, #EE4454 33%, #F6A1A9 34%, #F6A1A9 59%, #EE4454 60%); /* FF3.6+ */
background: -webkit-gradient(linear, left bottom, right top, color-stop(33%,#F6A1A9), color-stop(34%,#F6A1A9), color-stop(59%,#F6A1A9), color-stop(60%,#EE4454)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(-45deg, #EE4454 33%,#F6A1A9 34%,#F6A1A9 59%,#EE4454 60%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(-45deg, #EE4454 33%,#F6A1A9 34%,#F6A1A9 59%,#EE4454 60%); /* Opera 11.10+ */
background: -ms-linear-gradient(-45deg, #EE4454 33%,#F6A1A9 34%,#F6A1A9 59%,#EE4454 60%); /* IE10+ */
background: linear-gradient(-45deg, #EE4454 33%,#F6A1A9 34%,#F6A1A9 59%,#EE4454 60%); /* W3C */
background-size: 60px 30px;
text-align: center;
color:#fff;
}
#Red .jyTtem2 .progress>view,#Red .jyTtem5 .progress>view,#Red .jyTtem8 .progress>view {
display: inline-block;
width: 70%;
height: 100%;
background: #2989d8; /* Old browsers */
background: -moz-linear-gradient(-45deg, #F8733A 33%, #F9B89C 34%, #F9B89C 59%, #F8733A 60%); /* FF3.6+ */
background: -webkit-gradient(linear, left bottom, right top, color-stop(33%,#F9B89C), color-stop(34%,#F9B89C), color-stop(59%,#F9B89C), color-stop(60%,#F8733A)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(-45deg, #F8733A 33%,#F9B89C 34%,#F9B89C 59%,#F8733A 60%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(-45deg, #F8733A 33%,#F9B89C 34%,#F9B89C 59%,#F8733A 60%); /* Opera 11.10+ */
background: -ms-linear-gradient(-45deg, #F8733A 33%,#F9B89C 34%,#F9B89C 59%,#F8733A 60%); /* IE10+ */
background: linear-gradient(-45deg, #F8733A 33%,#F9B89C 34%,#F9B89C 59%,#F8733A 60%); /* W3C */
background-size: 60px 30px;
text-align: center;
color:#fff;
}
\ No newline at end of file
var util = require('../../../utils/util.js')
let app=getApp();
Page({
/**
* 页面的初始数据
*/
data: {
date: util.YYMM(new Date()),
dataList:[],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getList();
},
bindDateChange(e){
console.log(e);
let val = e.detail.value.substr(0,7);
console.log("val",val)
this.setData({
date: val
})
this.getList();
},
getList() {
app.$apiJavaNew('/api/b2b/user/getBankbookUseDetail', { queryTime:this.data.date}).then(res => {
let data = res;
data.pageData.forEach(item=>{
item.updateTime = item.updateTime.substr(0,10)
})
this.setData({
dataList: data.pageData
})
console.log(this.data.dataList)
}).catch(err => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="useDetail commonF">
<picker style="background:#F8F5F5;padding-bottom:10rpx" mode="date" value="{{date}}" bindchange="bindDateChange">
<view class="picker">
<view class="date">
{{date}}<image style="width:20rpx;height:16rpx;margin-left:8rpx" src="/images/mine/xia.png"></image>
</view>
</view>
</picker>
<view class="list">
<view wx:for="{{dataList}}" wx:key="index" class="listItem">
<view>
<view class="hidden left f24">{{item.description}}</view>
<view class="right cee f24">¥{{item.money}}</view>
</view>
<view class="f20" style="color:#999999">{{item.updateTime}}</view>
</view>
<view class="nodata" wx:if="{{dataList.length==0}}">
<image style="width:190rpx;height:190rpx" src="/images/home/nodata.png"></image>
</view>
</view>
</view>
\ No newline at end of file
.date{
width:250rpx;
height:68rpx;
background:rgba(255,255,255,1);
border-radius:34rpx;
margin:16rpx 0 16rpx 30rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
}
.listItem{
border-bottom: 1px solid #E9E9E9;
padding:10rpx 30rpx;
}
.listItem:last-child{
border: none;
}
.left{
display: inline-block;
width: 60%;
}
.right{
display: inline-block;
width: 35%;
text-align: right;
}
.hidden{
white-space:nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.nodata{
width: 100%;
height: 500rpx;
line-height: 500rpx;
text-align: center;
}
......@@ -39,7 +39,7 @@
"list": []
},
"miniprogram": {
"current": 15,
"current": 21,
"list": [
{
"id": 2,
......@@ -152,6 +152,47 @@
"pathName": "pages/GroupTour/FillOrder/FillOrder",
"query": "",
"scene": null
},
{
"id": -1,
"name": "幸福存折",
"pathName": "pages/mine/Happypassbook/Happypassbook",
"query": "",
"scene": null
},
{
"id": -1,
"name": "首页",
"pathName": "pages/Home/home",
"query": "",
"scene": null
},
{
"id": -1,
"name": "幸福存折明细",
"pathName": "pages/mine/UseDetails/UseDetails",
"query": "",
"scene": null
},
{
"id": -1,
"name": "登录",
"pathName": "pages/login/login",
"query": "",
"scene": null
},
{
"id": -1,
"name": "支付",
"pathName": "pages/Pay/Pay",
"query": "",
"scene": null
},
{
"id": -1,
"name": "定制游",
"pathName": "pages/freeTravel/PersonalTailor/PersonalTailor",
"scene": null
}
]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment