作者 lihongjuan

32333

要显示太多修改。

为保证性能只显示 19 of 19+ 个文件。

<script>
export default {
onLaunch: function() {
// console.log('App Launch')
},
onShow: function() {
// console.log('App Show')
},
onHide: function() {
// console.log('App Hide')
},
post: function(url, data,method) {
// (showLoad == undefined || showLoad) ?
// wx.showLoading({
// title: '加载中',
// }) : ''
// wx.showNavigationBarLoading()
var promise = new Promise((resolve, reject) => {
//init
let that = this,
token = uni.getStorageSync('token'),
header = {
token: token || ''
},
postData;
// console.log(token,"token")
//网络请求
uni.request({
url: this.globalData.baseUrl + url,
data: data,
method: method,
header: header,
success: function(res) { //返回取得的数据
console.log(res)
if (res.data.code == 1) {
resolve(res.data.data);
} else {
// uni.showToast({
// title: res.data.msg,
// icon: 'none',
// })
reject(res.data)
if (res.data.code == '401') {}
}
// (showLoad || showLoad == undefined) ? wx.hideLoading(): "";
// wx.hideNavigationBarLoading()
},
fail: function(e) {
console.log(e)
reject('网络出错');
// (showLoad || showLoad == undefined) ? wx.hideLoading() : "";
wx.hideNavigationBarLoading()
},
complete: function(daa) {
console.log(daa)
}
})
});
return promise;
},
timeFormate(timestamp, timeType) {
if (timestamp) {
var timeStamp = timestamp.length == 13 ? timestamp : timestamp * 1000
var date = new Date(timeStamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
var Y = date.getFullYear() + '-';
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
var D = date.getDate() + ' ';
var h = date.getHours() + ':';
var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
var s = date.getSeconds();
if (timeType == 'YYMMDD') {
return Y + M + D;
} else if (timeType == 'YYMMDDHHMM') {
return Y + M + D + " " + h + m;
} else {
return h + m;
}
}
},
globalData: {
userInfo: null,
// baseUrl: 'http://icrgangjuren.w.brotop.cn/'
baseUrl:'https://icr.gangjuren.com/'
}
}
</script>
<style>
/*每个页面公共css */
/*每个页面公共css */
body {
background-color: #f6f6f6;
}
/* 布局 */
.layor_start {
display: flex;
justify-content: flex-start;
align-items: center;
}
.layor_center {
display: flex;
justify-content: center;
align-items: center;
}
.layor_between {
display: flex;
justify-content: space-between;
align-items: center;
}
.layor_around {
display: flex;
justify-content: space-around;
align-items: center;
}
.layor_end {
display: flex;
justify-content: flex-end;
align-items: center;
}
.flex_center {
display: flex;
flex-direction: column;
align-items: center;
}
.layor_start-warp {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.register {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
position: fixed;
top: 0rpx;
left: 0;
right: 0;
z-index: 5;
}
.box{
background: #F5F5F5;
}
.remaintime {
display: flex;
justify-content: space-between;
align-items: center;
width: 686rpx;
height: 100rpx;
background: rgba(62, 58, 57, 1);
box-shadow: 0rpx 4rpx 18rpx rgba(0, 0, 0, 0.04);
opacity: 1;
border-radius: 10rpx;
margin: 24rpx auto 0;
padding: 0 18rpx 0 32rpx;
box-sizing: border-box;
}
.remainleft {
color: #fff;
font-size: 28rpx;
}
.remainright {
width: 48rpx;
height: 48rpx;
font-size: 0;
}
image{
width:100%;
height:100%;
}
.nodata{
color:#999;
font-size: 30rpx;
text-align: center;
margin-top:100rpx;
}
</style>
... ...
import Vue from 'vue'
import App from './App'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
... ...
{
"name" : "gaungjurenxiaochengxu",
"appid" : "__UNI__D47A57A",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
"usingComponents" : true,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* 模块配置 */
"modules" : {},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios打包配置 */
"ios" : {},
/* SDK配置 */
"sdkConfigs" : {}
}
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wx501cda0ef4db38a2",
"setting" : {
"urlCheck" : false,
"postcss" : true
},
"usingComponents" : false
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
}
}
... ...
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/dianshu/dianshu",
"style": {
"navigationBarTitleText": "点数"
}
},
{
"path": "pages/taocangoumai/taocangoumai",
"style": {
"navigationBarTitleText": "套餐购买"
}
},
{
"path": "pages/qidong/qidong",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/binding/binding",
"style": {
"navigationBarTitleText": "首页"
}
},
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "123"
}
}, {
"path": "pages/personcenter/personcenter",
"style": {
"navigationBarTitleText": "个人中心"
}
}, {
"path": "pages/gerenxinxi/gerenxinxi",
"style": {
"navigationBarTitleText": "个人信息"
}
},
{
"path": "pages/tuijianren/tuijianren",
"style": {
"navigationBarTitleText": "首页"
}
},
{
"path": "pages/shubanxinxi/shubanxinxi",
"style": {
"navigationBarTitleText": "数板信息"
}
}
, {
"path": "pages/shubandetail/shubandetail",
"style": {
"navigationBarTitleText": "数板详情"
}
}, {
"path": "pages/shuguan/shuguan",
"style": {
"navigationBarTitleText": "数管"
}
}, {
"path": "pages/shuguanshujulist/shuguanshujulist",
"style": {
"navigationBarTitleText": "数管数据"
}
}, {
"path": "pages/shuguanshujudetail/shuguanshujudetail",
"style": {
"navigationBarTitleText": "数管数据"
}
}, {
"path": "pages/zhifudingdan/zhifudingdan",
"style": {
"navigationBarTitleText": "支付订单"
}
}, {
"path": "pages/zhifudingdanshugaun/zhifudingdanshugaun",
"style": {
"navigationBarTitleText": "支付订单"
}
}, {
"path": "pages/xiaofeijilu/xiaofeijilu",
"style": {
"navigationBarTitleText": "消费记录"
}
}, {
"path": "pages/dingdanxiangqing/dingdanxiangqing",
"style": {
"navigationBarTitleText": "订单详情"
}
}, {
"path": "pages/kaijufapiao/kaijufapiao",
"style": {
"navigationBarTitleText": "开具发票"
}
}, {
"path": "pages/kafapiao/kafapiao",
"style": {
"navigationBarTitleText": "开具发票"
}
}, {
"path": "pages/selectxiaofeijilu/selectxiaofeijilu",
"style": {
"navigationBarTitleText": "选择消费记录"
}
}, {
"path": "pages/kaipiaolishi/kaipiaolishi",
"style": {
"navigationBarTitleText": "开票历史"
}
}, {
"path": "pages/fapiaodetail/fapiaodetail",
"style": {
"navigationBarTitleText": "发票详情"
}
}, {
"path": "pages/myshuju/myshuju",
"style": {
"navigationBarTitleText": "我的数据"
}
},
{
"path": "pages/shuguanshubanintro/shuguanshubanintro",
"style": {
"navigationBarTitleText": "简介"
}
},
{
"path": "pages/aboutus/aboutus",
"style": {
"navigationBarTitleText": "关于我们"
}
}
],
"tabBar": {
"selectedColor": "#F39800",
"list": [{
"pagePath": "pages/taocangoumai/taocangoumai",
"text": "套餐购买",
"selectedColor": "#F39800",
"iconPath": "static/img/taocan.png",
"selectedIconPath": "static/img/seltaocan.png"
},
{
"pagePath": "pages/dianshu/dianshu",
"text": "点数",
"selectedColor": "#F39800",
"iconPath": "static/img/dianshu.png",
"selectedIconPath": "static/img/seldianshu.png"
},
{
"pagePath": "pages/personcenter/personcenter",
"text": "个人中心",
"selectedColor": "#F39800",
"iconPath": "static/img/person.png",
"selectedIconPath": "static/img/selperson.png"
}
]
},
"debug": true,
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"condition": { //模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [{
"name": "", //模式名称
"path": "", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}]
}
}
... ...
<template>
<div class='box'>
<div class="intro">
<rich-text class="conRich" :nodes="aboutus.description"></rich-text>
</div>
</div>
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
aboutus: '',
}
},
methods: {
// 关于我们数据
getus() {
app.post("api/abouts/aboutDetail", '', 'get')
.then(res => {
console.log(res);
this.aboutus = res
})
.catch(err => {});
},
},
onLoad(options) {
},
mounted() {
this.getus()
},
created() {
}
}
</script>
<style>
.box {
background: #F5F5F5;
padding: 40rpx 34rpx;
box-sizing: border-box;
}
.intro {
background: #fff;
height: 1112rpx;
overflow-y: scroll;
padding: 30rpx;
box-sizing: border-box;
color: #404040;
font-size: 28rpx;
line-height: 1.5;
}
</style>
... ...
<template>
<div class='binding'>
<view class="binding_title">绑定客户</view>
<view class="binding_input">
<input type="text" placeholder="请填写推荐码" placeholder-class="bind_input" v-model="code">
</view>
<view class="content">{{content}}</view>
<view class="binding_btn" @click="set_sure">确定</view>
</div>
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
code: "",
content: ""
}
},
methods: {
set_sure() {
let t = this;
let url = "api/person/bindKehu";
let param = {
code: t.code
};
app.post(url, param, 'get').then(r => {
console.log('1234567890',r)
uni.setStorageSync('re_id',1)
uni.switchTab({
url: '/pages/taocangoumai/taocangoumai'
})
}).catch(err => {
console.log(err)
t.content = err.msg
})
}
},
onLoad(options) {
},
mounted() {
},
created() {
}
}
</script>
<style>
.binding {
width: 686rpx;
background: rgba(255, 255, 255, 1);
opacity: 1;
border-radius: 10rpx;
position: absolute;
top: 30%;
left: 50%;
transform: translate(-50%, -30%);
padding: 60rpx 48rpx 56rpx;
box-sizing: border-box;
}
.binding_title {
font-size: 44rpx;
font-weight: bold;
line-height: 60rpx;
color: rgba(6, 18, 30, 1);
}
.content {
margin-top: 20rpx;
font-size: 26rpx;
font-weight: 400;
line-height: 36rpx;
color: rgba(206, 21, 0, 1);
}
.binding_input {
margin-top: 134rpx;
border-bottom: 1rpx solid rgba(235, 235, 235, 1);
padding-bottom: 36rpx;
}
.bind_input {
font-size: 32rpx;
font-weight: 400;
line-height: 44rpx;
color: rgba(210, 210, 210, 1);
text-align: center;
}
.binding_btn {
margin-top: 110rpx;
height: 100rpx;
background: rgba(243, 152, 0, 1);
box-shadow: 0rpx 4rpx 18rpx rgba(0, 0, 0, 0.04);
opacity: 1;
border-radius: 10rpx;
font-size: 32rpx;
font-weight: 400;
line-height: 100rpx;
color: rgba(255, 255, 255, 1);
text-align: center;
}
</style>
... ...
<template>
<view>
<view class="swiper_image">
<swiper :indicator-dots="false" :autoplay="true" :interval="3000" :duration="1000" class="swimg" @change="swiperChange">
<swiper-item v-for="(item,index) in imgUrls" :key="index">
<view class="swiper-item">
<image :src="item.image" mode=""></image>
</view>
</swiper-item>
</swiper>
<view class="dots">
<view class="dot" :class="index==currentSwiper?'active':''" v-for="(item,index) in imgUrls" :key="index"></view>
</view>
</view>
<!-- 列表 -->
<view class="list">
<view class="listitem listitem1" @click="sao">
<view class="itemtitle">数板</view>
<view class="itemimg">
<image src="/static/img/shuban.png"></image>
</view>
</view>
<view class="listitem listitem2" @click="shuguan">
<view class="itemtitle">数管</view>
<view class="itemimg guanimg">
<image src="/static/img/guanzi.png"></image>
</view>
</view>
<view class="listitem listitem1" @click="shubantiao" :data-id="shubanintro.id">
<view class="itemtitle">数板说明</view>
<view class="itemtext">
{{shubanintro.introduce}}
</view>
</view>
<view class="listitem listitem2" @click="shubantiao" :data-id="shuguanintro.id">
<view class="itemtitle">数管说明</view>
<view class="itemtext">
{{shuguanintro.introduce}}
</view>
</view>
</view>
<view class="dibu">
<view class="gangimg">
<view class="heng"></view>
<view class="jurenimg">
<image src="/static/img/gang.png"></image>
</view>
<view class="heng"></view>
</view>
<view class="jurentext">精准的智能识别算法,高效准确地自动计数</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue"
export default {
data() {
return {
imgUrls: [],
indicatorDots: false,
autoplay: true,
interval: 2000,
duration: 1000,
currentSwiper: 0,
shubanintro: "",
shuguanintro: "",
// 判断是否有资格进入详情页
is_allow: "",
// 获取扫码之后的参数
sao_number: ""
}
},
methods: {
swiperChange: function(e) {
this.currentSwiper = e.detail.current
},
// 判断是否有资格进入详情内容
get_cations() {
let t = this;
let url = "api/shuguan/getShuguanRule";
let param = {};
app.post(url, param, 'post').then(r => {
console.log(r)
t.is_allow = r.is_allow
}).catch(err => {
console.log(err)
})
},
// 扫码
sao() {
let t = this;
let re_id = uni.getStorageSync("re_id");
let token = uni.getStorageSync("token");
console.log('9090909090',token)
console.log('9090909090',re_id)
if (token == '') {
uni.showToast({
title: '请登录后操作',
icon: 'none'
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/qidong/qidong"
})
}, 1000)
} else if (token != '' && re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
} else {
uni.scanCode({
success: function(res) {
console.log(res, "扫码之后返回的参数")
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
t.sao_number = res.result;
console.log('909090808080', t.sao_number)
t.get_yes();
},
fail: function(res) {
uni.showToast({
title: '未能识别二维码',
icon: 'none',
duration: 2000
});
}
});
}
},
// 判断是否符合条件
get_yes() {
let t = this;
let url = "api/equipment/getEquipmentNumber";
let param = {
number: t.sao_number
};
app.post(url, param, 'post').then(r => {
console.log(r)
uni.navigateTo({
url: '/pages/shubanxinxi/shubanxinxi?num=' + t.sao_number
})
}).catch(err => {
console.log(err)
uni.showToast({
title: err.msg,
icon: "none",
duration: 2000
});
})
},
// 获取轮播图数据
getbanner() {
app.post("api/index/getBanner", '', 'get')
.then(res => {
console.log(res);
this.imgUrls = res
})
.catch(err => {});
},
// 获取数板数管简介
getintroduce() {
app.post("api/index/getIntroduce", '', 'get')
.then(res => {
console.log(res, "数板数管简介");
this.shubanintro = res[0];
this.shuguanintro = res[1];
})
.catch(err => {});
},
//跳到数板数管详情页
shubantiao(e) {
console.log(e)
let id = e.currentTarget.dataset.id;
uni.navigateTo({
url: '/pages/shuguanshubanintro/shuguanshubanintro?id=' + id
});
},
//数管
shuguan() {
let t = this;
let re_id = uni.getStorageSync("re_id");
let token = uni.getStorageSync("token")
if (token == '') {
uni.showToast({
title: '请登录后操作',
icon: 'none'
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/qidong/qidong"
})
}, 1000)
} else if (token !=''&&re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
}else{
if (t.is_allow == 0) {
console.log(123)
uni.navigateTo({
url: '/pages/shuguan/shuguan?showketime=' + true
});
} else {
uni.navigateTo({
url: '/pages/shuguan/shuguan'
})
}
}
}
},
mounted() {
//获取banner图
this.getbanner();
//获取简介
this.getintroduce()
},
onShow() {
// 判断是否有资格进入详情页
this.get_cations()
}
}
</script>
<style>
.swiper_image {
width: 686rpx;
height: 368rpx;
font-size: 0;
position: relative;
margin: 20rpx auto 0;
border-radius: 10rpx;
}
.swimg {
height: 368rpx;
width: 686rpx;
height: 368rpx;
border-radius: 10rpx;
}
swiper-item {
height: 368rpx;
width: 686rpx;
height: 368rpx;
border-radius: 10rpx;
}
.swiper-item {
width: 686rpx;
height: 368rpx;
border-radius: 10rpx;
}
.swiper-item image {
width: 100%;
height: 100%;
border-radius: 10rpx;
}
.dots {
/* width: 156rpx; */
height: 36rpx;
display: flex;
flex-direction: row;
position: absolute;
justify-content: center;
align-items: center;
left: 0;
right: 0;
bottom: 35rpx;
}
/*未选中时的小圆点样式 */
.dot {
width: 28rpx;
height: 4rpx;
margin-right: 26rpx;
background: rgba(255, 255, 255, 1);
opacity: 0.3;
}
/*选中以后的小圆点样式 */
.active {
width: 28rpx;
height: 4rpx;
background: rgba(255, 255, 255, 1);
opacity: 1;
}
.list {
padding: 0 28rpx;
box-sizing: border-box;
margin-top: 4rpx;
display: flex;
align-items: center;
flex-wrap: wrap
}
.itemimg {
width: 82rpx;
height: 78rpx;
font-size: 0;
margin-top: 64rpx;
}
.guanimg {
width: 67rpx;
height: 79rpx;
}
.itemimg image {
width: 100%;
height: 100%;
}
.listitem {
width: 330rpx;
height: 252rpx;
border-radius: 10rpx;
/* background: #F39800; */
display: flex;
flex-direction: column;
align-items: center;
margin-top: 28rpx;
}
.listitem1 {
background: #F39800;
}
.listitem2 {
background: #3E3A39;
}
.itemtitle {
margin-top: 45rpx;
color: #fff;
position: relative
}
.itemtitle::after {
display: block;
content: '';
width: 46rpx;
height: 5rpx;
background: #fff;
position: absolute;
left: 50%;
right: 50%;
transform: translate(-50%, -50%);
bottom: -20rpx;
}
.listitem:nth-child(2n) {
margin-left: 28rpx;
}
.itemtext {
width: 212rpx;
margin: 47rpx auto 0;
color: #fff;
font-size: 26rpx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.gangimg {
margin-top: 36rpx;
display: flex;
justify-content: center;
align-items: center
}
.jurenimg {
width: 226rpx;
height: 68rpx;
font-size: 0;
margin: 0 32rpx;
}
.jurenimg image {
width: 100%;
height: 100%;
}
.heng {
width: 76rpx;
height: 2rpx;
background: #CCCCCC
}
.jurentext {
color: #CCCCCC;
font-size: 22rpx;
text-align: center;
margin-top: 12rpx;
}
.dibu {
position: absolute;
bottom: 45rpx;
width: 750rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>
... ...
<template>
<view class="box">
<view class="dingdanlist">
<view class="dingdanitem">
<view class="ditemleft">订单编号</view>
<view class="ditemright">{{orderdetail.order_sn}}</view>
</view>
<view class="dingdanitem">
<view class="ditemleft">订单日期</view>
<view class="ditemright">{{orderdetail.createtime}}</view>
</view>
<view class="dingdanitem">
<view class="ditemleft">商品名称</view>
<view class="ditemright">{{orderdetail.name}}</view>
</view>
<view class="dingdanitem">
<view class="ditemleft">商品金额</view>
<view class="ditemright goodmoney">{{orderdetail.pay_money}}元</view>
</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue"
export default {
data() {
return {
id: "",
orderdetail:'',
type:''
}
},
methods: {
getorderdetail() {
let param={
id:this.id,
// type:this.type
}
app.post("api/person/orderDetail", param, 'get')
.then(res => {
console.log(res,"查询的订单信息");
this.orderdetail = res;
})
.catch(err => {});
}
},
mounted() {
this.getorderdetail()
},
onLoad(options) {
console.log(options)
this.id = options.id,
this.type=options.type
}
}
</script>
<style>
.dingdanlist {
padding: 0 32rpx;
box-sizing: border-box;
background: #fff;
}
.dingdanitem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 48rpx 0;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
}
.ditemleft {
color: #0A0808;
font-size: 30rpx;
}
.ditemright {
color: #7F8389;
font-size: 28rpx;
}
.goodmoney {
color: #F29600;
font-size: 28rpx;
}
</style>
... ...
<template>
<view class="box">
<view class="fapiaodetail">
<view class="detailitem">
<view class="detaileft">发票状态</view>
<view class="detailright" v-if="fapiaodetail.status==0">待审核</view>
<view class="detailright" v-if="fapiaodetail.status==1">待开票</view>
<view class="detailright" v-if="fapiaodetail.status==2">待邮寄</view>
<view class="detailright" v-if="fapiaodetail.status==3">已邮寄</view>
</view>
<view class="detailitem">
<view class="detaileft">发票抬头</view>
<view class="detailright">{{fapiaodetail.payable}}</view>
</view>
<view class="detailitem">
<view class="detaileft">快递单号</view>
<view class="detailright">{{fapiaodetail.number}}</view>
</view>
<view class="detailitem">
<view class="detaileft">税号</view>
<view class="detailright">{{fapiaodetail.paragraph}}</view>
</view>
<view class="detailitem">
<view class="detaileft">发票内容</view>
<view class="detailright">{{fapiaodetail.mark}}</view>
</view>
<view class="dizhi">
<view class="detaileft">地址和电话</view>
<view class="detailright address">
<view>{{fapiaodetail.address}}</view>
<view class="code">{{fapiaodetail.mobile}}</view>
</view>
</view>
<view class="dizhi">
<view class="detaileft">开户行和账号</view>
<view class="detailright address">
<view>{{fapiaodetail.open_bank}}</view>
<view class="code">{{fapiaodetail.open_account}}</view>
</view>
</view>
<view class="detailitem">
<view class="detaileft">发票金额</view>
<view class="detailright">{{fapiaodetail.money}}元</view>
</view>
<view class="detailitem">
<view class="detaileft">申请时间</view>
<view class="detailright">{{fapiaodetail.createtime}}</view>
</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue"
export default {
data() {
return {
id: '',
fapiaodetail:''
}
},
methods: {
//获取发票详情
getfapiaodetail() {
let param = {
id: this.id
}
app.post("api/person/invoiceDetail", param, 'get')
.then(res => {
console.log(res);
this.fapiaodetail=res
})
.catch(err => {});
}
},
mounted() {
this.getfapiaodetail()
},
onLoad(options) {
console.log(options)
this.id = options.id
}
}
</script>
<style>
.fapiaodetail {
width: 686rpx;
background: #fff;
border-radius: 14rpx;
margin: 20rpx auto 48rpx;
padding: 0 32rpx;
box-sizing: border-box;
}
.detailitem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 40rpx 0;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
}
.detaileft {
color: #0A0808;
font-size: 30rpx;
}
.detailright {
color: #7F8389;
font-size: 28rpx;
}
.dizhi {
padding: 40rpx 0;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
}
.address {
margin-top: 24rpx
}
.code {
margin-top: 24rpx
}
</style>
... ...
<template>
<view class="gereninfo">
<view class="gerenbox">
<view class="gerenitem">
<view class="gerenleft">
头像
</view>
<view class="gerenright">
<view class="touimg">
<image :src="avatar"></image>
</view>
<view class="rowright">
<image src="/static/img/rowright.png"></image>
</view>
</view>
</view>
<view class="gerenitem">
<view class="gerenleft">
姓名
</view>
<view class="gerenright">
<view class="toutext">
<input type="text" placeholder="请输入姓名" :value="name" @blur="entername" />
</view>
<view class="rowright">
<image src="/static/img/rowright.png"></image>
</view>
</view>
</view>
<view class="gerenitem">
<view class="gerenleft">
推荐人
</view>
<view class="gerenright">
<view class="toutext" v-if="bangdingpeople==''" @click="bangding">
绑定推荐人
</view>
<view class="toutext" v-else>
{{bangdingpeople}}
</view>
<view class="rowright">
<image src="/static/img/rowright.png"></image>
</view>
</view>
</view>
<view class="gerenitem">
<view class="gerenleft">
公司名称
</view>
<view class="gerenright">
<view class="toutext">
{{peopleinfo.company_name==''?'暂无':peopleinfo.company_name}}
</view>
<view class="rowright">
<image src="/static/img/rowright.png"></image>
</view>
</view>
</view>
</view>
<view class="register" v-if="showbang">
<view class="registerwrap">
<view class="bangtitle">绑定推荐人</view>
<view class="tuiphone">
<input placeholder='请输入推荐人手机号' placeholder-class='tuishouji' :value="phone" @input="entrphone" type="number" />
</view>
<view class="tuiwarn" v-if="showfalse">
{{errmsg}}
<!-- 该推荐人不存在,请重新输入 -->
</view>
<!-- <view class="tuiwarn">{{content}}</view> -->
<view class="tuifoot">
<view class="tuifootleft" @click="hideshowbang">取消</view>
<view class="tuifootright" @click="quding">确定</view>
</view>
</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue"
export default {
data() {
return {
showbang: false,
name: '',
peopleinfo: '',
phone: '',
changename: '',
showfalse:false,
avatar:'',
errmsg:'',
bangdingpeople:''
}
},
methods: {
bangding() {
this.showbang = true
},
hideshowbang() {
this.showbang = false
},
// 输入姓名
entername(e) {
this.changename = e.detail.value
let param = {
username: this.changename
}
app.post("api/person/updateInfo", param, 'post')
.then(res => {
console.log(res);
uni.showToast({
title: '修改成功',
icon: 'none',
})
})
.catch(err => {
console.log(err)
uni.showToast({
title: err.msg,
icon: 'none',
})
});
},
// 输入手机号
entrphone(e) {
this.phone = e.detail.value;
console.log(this.phone)
if(this.phone==''){
this.showfalse=false
}
console.log(e)
},
quding() {
let phone = this.phone;
var reg = /^[1][3,4,5,7,8,9][0-9]{9}$/;
if (!reg.test(phone)) {
uni.showToast({
title: "请输入正确的手机号",
icon: 'none',
})
return false
}
let param = {
mobile: this.phone
}
app.post("api/person/bindPerson", param, 'get')
.then(res => {
console.log(res);
uni.showToast({
title: '绑定成功',
icon: 'none',
})
setTimeout(function(){
uni.navigateBack({
checked:true
})
// this.showfalse=false
},1500)
})
.catch(err => {
console.log(err)
// uni.showToast({
// title: err.msg,
// icon: 'none',
// })
this.errmsg=err.msg
this.showfalse=true
});
}
},
onLoad(options) {
console.log(options)
let peopleinfo = JSON.parse(options.peopleinfo)
this.peopleinfo = peopleinfo
this.name = peopleinfo.username;
this.avatar=peopleinfo.avatar;
this.bangdingpeople=peopleinfo.recommender
console.log(this.bangdingpeople)
},
onUnload: function() {
},
}
</script>
<style>
.gereninfo {
background: #F5F5F5;
}
.gerenbox {
width: 686rpx;
margin: 26rpx auto 0;
}
.gerenitem {
padding: 40rpx 32rpx;
box-sizing: border-box;
}
.gerenleft {
color: #0A0808;
font-size: 30rpx;
}
.touimg {
width: 60rpx;
height: 60rpx;
font-size: 0;
border-radius: 50%;
}
.touimg image {
width: 100%;
height: 100%;
border-radius: 50%;
}
.rowright {
width: 48rpx;
height: 48rpx;
font-size: 0;
margin-left: 20rpx;
}
.rowright image {
width: 100%;
height: 100%;
}
.gerenitem {
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
}
.gerenright {
display: flex;
align-items: center;
}
.toutext {
color: #7F8389;
font-size: 24rpx;
}
.toutext input {
text-align: right;
}
.registerwrap {
width: 686rpx;
height: 654rpx;
background: rgba(255, 255, 255, 1);
opacity: 1;
border-radius: 10rpx;
background: #fff;
position: absolute;
top: 50%;
left: 50%;
right: 50%;
transform: translate(-50%, -50%);
padding: 58rpx 40rpx;
box-sizing: border-box;
}
.bangtitle {
color: #06121E;
font-size: 44rpx;
font-weight: bold;
}
.tuiphone {
width: 550rpx;
border-bottom: 1rpx solid #EBEBEB;
padding: 36rpx 0;
box-sizing: border-box;
margin-top: 80rpx;
}
.tuiphone input {
color: #D2D2D2;
font-size: 32rpx;
text-align: center
}
.tuishouji {
color: #D2D2D2;
font-size: 32rpx;
}
.tuiwarn {
color: #CE1500;
font-size: 26rpx;
margin-top: 20rpx;
}
.tuifoot {
margin-top: 110rpx;
display: flex;
justify-content: space-between;
align-items: center
}
.tuifootleft {
width: 254rpx;
height: 100rpx;
border: 2rpx solid rgba(243, 152, 0, 1);
opacity: 1;
border-radius: 10rpx;
color: #F39800;
font-size: 32rpx;
text-align: center;
line-height: 100rpx;
}
.tuifootright {
width: 254rpx;
height: 100rpx;
background: rgba(243, 152, 0, 1);
box-shadow: 0rpx 4rpx 18rpx rgba(0, 0, 0, 0.04);
opacity: 1;
border-radius: 10rpx;
color: #fff;
font-size: 32rpx;
text-align: center;
line-height: 100rpx;
}
</style>
... ...
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200upx;
width: 200upx;
margin-top: 200upx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50upx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36upx;
color: #8f8f94;
}
</style>
... ...
<template>
<view class="box">
<view class="fapiaolist">
<picker @change="selecttaitou" :value="index" :range="array" range-key="name">
<view class="fapiaoitem">
<view class="fleft">抬头类型</view>
<view class="fright">
<!-- <view class="qdan">企业单位</view> -->
<view class="qdan">
{{array[index].name}}
</view>
<view class="qirow">
<image src="/static/img/rowright.png"></image>
</view>
</view>
</view>
</picker>
<view class="fapiaoitem">
<view class="fleft">发票抬头</view>
<view class="fright fatai">
<input type="text" placeholder="填写发票抬头" placeholder-class="fapiao" v-model="taitou" />
</view>
</view>
<view class="fapiaoitem">
<view class="fleft">税号</view>
<view class="fright fatai">
<input type="text" placeholder="填写纳税人识别号" placeholder-class="fapiao" v-model="shuihao" />
</view>
</view>
<view class="fapiaoitem">
<view class="fleft">备注</view>
<view class="fright fatai">
<input type="text" placeholder="填写备注说明" placeholder-class="fapiao" v-model="remark" />
</view>
</view>
<view class="fapiaoitem">
<view class="fleft">地址</view>
<view class="fright fatai">
<input type="text" placeholder="填写地址" placeholder-class="fapiao" v-model="address" />
</view>
</view>
<view class="fapiaoitem">
<view class="fleft">电话</view>
<view class="fright fatai">
<input type="text" placeholder="填写电话" placeholder-class="fapiao" v-model="phone" />
</view>
</view>
<view class="fapiaoitem">
<view class="fleft">开户行</view>
<view class="fright fatai">
<input type="text" placeholder="填写开户行" placeholder-class="fapiao" v-model="bank" />
</view>
</view>
<view class="fapiaoitem">
<view class="fleft">开户行账号</view>
<view class="fright fatai">
<input type="number" placeholder="填写开户行账号" placeholder-class="fapiao" v-model="banknum" />
</view>
</view>
</view>
<!-- 消费记录 -->
<view class="fapiaolist">
<view class="fapiaoitem" @click="selectjilu">
<view class="fleft">选择消费记录</view>
<view class="fright">
<view class="xiaorow">
<image src="/static/img/rowright.png"></image>
</view>
</view>
</view>
<view class="fapiaoitem">
<view class="fleft">发票金额</view>
<view class="fright fajine">
<!-- <input type="number" placeholder="填写发票金额" placeholder-class="fapiao" v-model="fapiaomoney" style="text-align: right;" /> -->
{{fapiaomoney}}
</view>
</view>
</view>
<!-- 收件人信息 -->
<view class="fapiaolist">
<view class="shouinfo">收件人信息</view>
<view class="fapiaoitem">
<view class="fleft">姓名</view>
<view class="fright fatai">
<input type="text" placeholder="填写收件人姓名" placeholder-class="fapiao" v-model="shouname" />
</view>
</view>
<view class="fapiaoitem">
<view class="fleft">电话</view>
<view class="fright fatai">
<input type="text" placeholder="填写收件人电话" placeholder-class="fapiao" v-model="shouphone" />
</view>
</view>
<view class="fapiaoitem">
<view class="fleft">地址</view>
<view class="fright fatai">
<input type="text" placeholder="填写收件人地址" placeholder-class="fapiao" v-model="shouaddress" />
</view>
</view>
</view>
<view class="surekai" @click="queshen">确认开票</view>
</view>
</template>
<script>
import app from "../../App.vue"
export default {
data() {
return {
array: [{
name: "企业单位",
id: 0
},
{
name: "个人/非企业单位 ",
id: 1
}
],
index: 0,
selectid: 0,
taitou: '',
shuihao: '',
remark: '',
address: '',
phone: '',
bank: '',
banknum: '',
shouname: '',
shouphone: '',
shouaddress: '',
fapiaomoney:0,
// 选中的id
select_id:""
}
},
methods: {
selecttaitou(e) {
this.index = e.detail.value,
this.selectid = this.array[e.detail.value].id
},
// 选择消费记录
selectjilu() {
let obj={};
obj.selectid=this.selectid;
obj.taitou=this.taitou;
obj.shuihao=this.shuihao;
obj.remark=this.remark;
obj.address=this.address;
obj.phone=this.phone;
obj.bank=this.bank;
obj.banknum=this.banknum;
obj.fapiaomoney=this.fapiaomoney;
obj.shouname=this.shouname;
obj.shouphone=this.shouphone;
obj.shouaddress=this.shouaddress;
//
uni.setStorageSync("canshu",obj)
uni.navigateTo({
url: '/pages/selectxiaofeijilu/selectxiaofeijilu?id='+this.select_id
})
},
//确认审核
queshen() {
console.log(this.bank)
if (this.taitou == '') {
uni.showToast({
title: '请填写发票抬头',
icon: 'none',
})
return false
}
if (this.shuihao == '') {
uni.showToast({
title: '请填写税号',
icon: 'none',
})
return false
}
if (this.remark == '') {
uni.showToast({
title: '请填写备注说明',
icon: 'none',
})
return false
}
if (this.address == '') {
uni.showToast({
title: '请填写地址',
icon: 'none',
})
return false
}
if (this.phone == '') {
uni.showToast({
title: '请填写电话',
icon: 'none',
})
return false
}
var regphone = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
if (!regphone.test(this.phone)) {
uni.showToast({
title: '请填写正确的电话',
icon: 'none',
})
return false
}
if (this.bank == '') {
uni.showToast({
title: '请填写开户行',
icon: 'none',
})
return false
}
if (this.banknum == '') {
uni.showToast({
title: '请填写开户行账号',
icon: 'none',
})
return false
}
if (this.shouname == '') {
uni.showToast({
title: '请填写收货人姓名',
icon: 'none',
})
return false
}
if (this.shouphone == '') {
uni.showToast({
title: '请填写收货人电话',
icon: 'none',
})
return false
}
var regshouphone = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
if (!regshouphone.test(this.shouphone)) {
uni.showToast({
title: '请填写正确的收货人电话',
icon: 'none',
})
return false
}
if (this.shouaddress == '') {
uni.showToast({
title: '请填写收货人地址',
icon: 'none',
})
return false
}
var param = {
order_ids:this.select_id,
type: this.selectid,
payable: this.taitou,
paragraph: this.shuihao,
mark: this.remark,
address: this.address,
mobile: this.phone,
open_bank: this.bank,
open_account: this.banknum,
money: this.fapiaomoney,
user_name: this.shouname,
user_mobile: this.shouphone,
user_address: this.shouaddress
}
app.post("api/person/applyInvoice", param, 'post')
.then(res => {
console.log(res);
uni.showToast({
title: '开具发票成功',
icon: 'none',
})
uni.removeStorageSync('select_id');
uni.removeStorageSync('totalmoney');
uni.removeStorageSync('totalnum');
uni.removeStorageSync('canshu');
setTimeout(function() {
// uni.navigateBack({
// checked:true
// })
uni.switchTab({
url: '/pages/personcenter/personcenter'
})
}, 1500)
})
.catch(err => {
console.log(err);
uni.showToast({
title: err.msg,
icon: 'none',
})
});
},
},
onLoad(options) {
console.log('123456789',options)
// this.select_id = options.select_id;
// console.log(this.select_id,"选中的id")
// if(options.money!=undefined){
// this.fapiaomoney=options.money
// }
},
onShow() {
let obj=uni.getStorageSync("canshu");
if(obj!=''){
this.selectid=obj.selectid;
this.taitou=obj.taitou;
this.shuihao=obj.shuihao;
this.remark=obj.remark;
this.address=obj.address;
this.phone=obj.phone;
this.bank=obj.bank;
this.banknum=obj.banknum;
this.fapiaomoney=obj.fapiaomoney;
this.shouname=obj.shouname;
this.shouphone=obj.shouphone;
this.shouaddress=obj.shouaddress;
};
let pages = getCurrentPages();
let currPage = pages[pages.length - 1]; //当前页面
this.select_id = currPage.data.selectId;
console.log(this.selectId)
if(currPage.data.totlemoney!=undefined){
this.fapiaomoney=currPage.data.totlemoney
}
}
}
</script>
<style>
.fapiaoitem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 40rpx 0;
box-sizing: border;
border-bottom: 1rpx solid #f5f5f5
}
.fapiaolist {
width: 686rpx;
margin: 20rpx auto 0;
background: #fff;
padding: 0 32rpx;
box-sizing: border-box;
}
.qirow {
width: 48rpx;
height: 48rpx;
font-size: 0;
transform: rotate(90deg);
margin-left: 16rpx;
}
.fright {
display: flex;
align-items: center;
}
.fleft {
color: #0A0808;
font-size: 30rpx;
}
.qdan {
color: #7F8389;
font-size: 28rpx;
}
.fatai {
color: #7F8389;
font-size: 28rpx;
text-align: right;
}
.fapiao {
color: #7F8389;
font-size: 28rpx;
}
.xiaorow {
width: 48rpx;
height: 48rpx;
font-size: 0;
}
.fajine {
color: #7F8389;
font-size: 28rpx;
}
.shouinfo {
color: #0A0808;
font-size: 32rpx;
font-weight: bold;
padding: 38rpx 0;
box-sizing: border-box;
}
.surekai {
width: 686rpx;
height: 100rpx;
background: rgba(243, 152, 0, 1);
box-shadow: 0rpx 4rpx 18rpx rgba(0, 0, 0, 0.04);
opacity: 1;
border-radius: 10rpx;
color: #fff;
font-size: 32rpx;
text-align: center;
line-height: 100rpx;
margin: 34rpx auto;
}
</style>
... ...
<template>
<view class="box">
<view class="kailist">
<view class="kailistitem" @click="qukaipiao">
<view class="kaileft">前往开票</view>
<view class="kairight">
<image src="/static/img/rowright.png"></image>
</view>
</view>
<view class="kailistitem" @click="historykaipiao">
<view class="kaileft">开票历史</view>
<view class="kairight">
<image src="/static/img/rowright.png"></image>
</view>
</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue"
export default {
data() {
return {
}
},
methods: {
qukaipiao(){
uni.navigateTo({
url:'/pages/kafapiao/kafapiao'
})
// uni.removeStorageSync('select_id');
// uni.removeStorageSync('totalmoney');
// uni.removeStorageSync('totalnum');
// uni.removeStorageSync('canshu');
},
// 开票历史
historykaipiao(){
uni.navigateTo({
url:"/pages/kaipiaolishi/kaipiaolishi"
})
}
}
}
</script>
<style>
.kailist{
padding: 0 32rpx;
box-sizing: border-box;
background: #fff;
}
.kailistitem{
display:flex;
align-items: center;
justify-content: space-between;
padding: 42rpx 0;
box-sizing: border-box;
border-bottom:1rpx solid #f5f5f5;
}
.kaileft{
color:#0A0808;
font-size: 30rpx;
}
.kairight{
width:48rpx;
height:48rpx;
font-size: 0;
}
</style>
... ...
<template>
<view class="box">
<view class="kaipiaolist" v-for="(item,index) in fapiaolist" :key="index"
:value="item.id" @click="detail" :data-id="item.id">
<view class="kaipiaotop">
<view class="kaipiaotime">{{item.createtime}}</view>
<view class="kaipiaostate" v-if="item.status==0">待审核</view>
<view class="kaipiaostate" v-if="item.status==1">待开票</view>
<view class="kaipiaostate" v-if="item.status==2">待邮寄</view>
<view class="kaipiaostate yiyou" v-if="item.status==3">已邮寄</view>
</view>
<view class="kaipiaobottom">
<view class="btleft">
{{item.mark}}
</view>
<view class="btright">{{item.money}}元</view>
</view>
</view>
<!-- <view class="kaipiaolist">
<view class="kaipiaotop">
<view class="kaipiaotime">2018-01-29 10:52</view>
<view class="kaipiaostate yiyou">已邮寄</view>
</view>
<view class="kaipiaobottom">
<view class="btleft">
发票内容xxxxxx
</view>
<view class="btright">12.34元</view>
</view>
</view>
<view class="kaipiaolist">
<view class="kaipiaotop">
<view class="kaipiaotime">2018-01-29 10:52</view>
<view class="kaipiaostate">待开票</view>
</view>
<view class="kaipiaobottom">
<view class="btleft">
发票内容xxxxxx
</view>
<view class="btright">12.34元</view>
</view>
</view>
-->
</view>
</template>
<script>
import app from "../../App.vue"
export default {
data() {
return {
page: 1,
fapiaolist:[]
}
},
methods: {
//获取开票历史
gethistory() {
let param = {
page: this.page
}
app.post("api/person/invoiceRecord", param, 'get')
.then(res => {
console.log(res);
this.fapiaolist=res
})
.catch(err => {});
},
detail(e){
console.log(e)
let id=e.currentTarget.dataset.id;
uni.navigateTo({
url:'/pages/fapiaodetail/fapiaodetail?id='+id
})
}
},
mounted() {
this.gethistory()
}
}
</script>
<style>
.kaipiaolist {
width: 686rpx;
margin: 20rpx auto 0;
background: #fff;
padding: 24rpx 30rpx;
box-sizing: border-box;
border-radius: 14rpx;
}
.kaipiaotime {
color: #7F8389;
font-size: 30rpx;
}
.btleft {
color: #0A0808;
font-size: 32rpx;
}
.btright {
color: #F29600;
font-size: 36rpx;
}
.kaipiaostate {
color: #F29600;
font-size: 28rpx;
}
.kaipiaotop {
display: flex;
align-items: center;
justify-content: space-between;
}
.kaipiaobottom {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 66rpx;
}
.yiyou {
color: #7F8389
}
</style>
... ...
<template>
<view class="box">
<view class="shunav">
<view class="shuitem" :class="sel==1?'shuactive':''" data-id="1" @click="xuan">数板</view>
<view class="shuitem" :class="sel==2?'shuactive':''" data-id="2" @click="xuan">数管</view>
</view>
<view class="myshuban" v-if="sel==1">
<view class="qiun-columns">
<view class="qiun-bg-white qiun-title-bar qiun-common-mt">
<view class="qiun-title-dot-light">
<!-- <text class="month">7月</text> -->
<text class="cishu">使用次数</text>
</view>
</view>
<view class="qiun-charts">
<canvas canvas-id="canvasMixone" id="canvasMixone" class="charts" disable-scroll=true @touchstart="touchMix"
@touchmove="moveMix" @touchend="touchEndMix"></canvas>
</view>
</view>
<!-- 我的设备 -->
<view class="shebei">
<view class="shebeihead">我的设备</view>
<view class="shebeilist">
<view class="shebeiitem" v-for="(item,index) in ban_list" :key="index" @click="go_shuban(item)">
<view class="sheleft">
<view class="shebeihao">设备编号:{{item.number}}</view>
<view class="shebeixi">
<view class="company">所属公司:{{item.name}}</view>
<view class="remainday">剩余时间:{{item.time}}</view>
</view>
</view>
<view class="sheright">
<image src="/static/img/rowright.png"></image>
</view>
</view>
</view>
</view>
</view>
<view class="myshuban" v-if="sel==2">
<view class="qiun-columns">
<view class="qiun-bg-white qiun-title-bar qiun-common-mt">
<view class="qiun-title-dot-light">
<!-- <text class="month">7月</text> -->
<text class="cishu">使用次数</text>
</view>
</view>
<view class="qiun-charts">
<canvas canvas-id="canvasMix" id="canvasMix" class="charts" disable-scroll=true @touchstart="touchMix" @touchmove="moveMix"
@touchend="touchEndMix"></canvas>
</view>
</view>
<!-- 我的设备 -->
<view class="shebei">
<view class="shebeihead shugsj">数管数据</view>
<view class="shengyu" v-if="shenyu_times.times != 0">
<view class="sycishuleft">剩余可用次数:{{shenyu_times.times}}</view>
<view class="sycishuright">
<image src="/static/img/you.png"></image>
</view>
</view>
<view class="shengyu" v-if="shenyu_times.shengyu != 0">
<view class="sycishuleft">剩余可用时间:{{shenyu_times.shengyu}}</view>
<view class="sycishuright">
<image src="/static/img/you.png"></image>
</view>
</view>
<view class="shebeilist">
<view class="sybanhead">
<view class="sybanitem">清点时间</view>
<view class="sybanitem">图片编号</view>
<view class="sybanitem">图片</view>
<view class="sybanitem">详情</view>
</view>
<view class="shebeilitem" v-for="(item,index) in guan_list" :key="index" v-if="guan_list != ''">
<view class="sbitem sbdate">{{item.date}}<br/>{{item.time}}</view>
<view class="sbitem sbhao">{{item.image_id}}</view>
<view class="sbitem sbt">
<image :src="item.files"></image>
</view>
<view class="sbitem ck" @click="look_guan(item.id)">查看</view>
</view>
<view class="shebeilitem" v-if="guan_list == ''">
<view class="nodatas">暂无数据</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import uCharts from '@/uchart/u-charts.js';
import app from "../../App.vue"
var _self;
var canvaMix = null;
export default {
data() {
return {
sel: 1,
//图表
cWidth: '',
cHeight: '',
pixelRatio: 1,
// 获取剩余可用次数
shenyu_times:"",
// 图表数据
//*数板*//
shuban: [],
shuban_x: [],
/*数板列表数据*/
ban_list: "",
//*数管*//
shuguan: [],
shuguan_x: [],
/*数管列表数据*/
guan_list:""
}
},
onLoad() {
_self = this;
this.cWidth = uni.upx2px(750);
this.cHeight = uni.upx2px(500);
},
methods: {
// 获取图表数据
//*数板*//
get_shubanchart() {
let t = this;
let url = "api/person/getUserEquipmentLog";
let param = {};
let ban = [];
let banX = []
app.post(url, param, 'post').then(r => {
console.log('88888888',r)
for (var i = 0; i < r.user_equipment_log.length; i++) {
banX.unshift(r.user_equipment_log[i].date)
ban.unshift(r.user_equipment_log[i].count)
}
t.shuban = ban;
t.shuban_x = banX;
t.getServerData1();
t.ban_list = r.equipment;
let newban_list=t.ban_list;
for(var obj of newban_list){
let number = obj.time;
// // 时间戳处理
var totalSecond = number;
var second = totalSecond;
// // 秒数
// var second = totalSecond;
var day = Math.floor(second / 3600 / 24);
var dayStr = day.toString();
if (dayStr.length == 1) dayStr = dayStr;
// 小时位
var hr = Math.floor((second - day * 3600 * 24) / 3600);
var hrStr = hr.toString();
if (hrStr.length == 1) hrStr = hrStr;
// 分钟位
var min = Math.floor((second - day * 3600 * 24 - hr * 3600) / 60);
var minStr = min.toString();
if (minStr.length == 1) minStr = minStr;
// 秒位
var sec = second - day * 3600 * 24 - hr * 3600 - min * 60;
var secStr = sec.toString();
if (secStr.length == 1) secStr = secStr;
obj.time = dayStr + '天' + hrStr + '小时' + minStr + "分钟"
}
this.ban_list=newban_list
}).catch(err => {
console.log(err)
})
},
//*数管*//
get_shuguanchart() {
let t = this;
let url = "api/person/getUserShuguanLog";
let param = {};
let guan = [];
let guanX = []
app.post(url, param, 'post').then(r => {
for (var i = 0; i < r.user_shuguan_log.length; i++) {
guanX.unshift(r.user_shuguan_log[i].date)
guan.unshift(r.user_shuguan_log[i].count)
}
t.shuguan = guan;
t.shuguan_x = guanX;
t.getServerData();
t.guan_list = r.shuguan
}).catch(err => {
console.log(err)
})
},
timechange(){
let number = this.shengyuqixian;
// // 时间戳处理
var totalSecond = number;
var second = totalSecond;
// // 秒数
// var second = totalSecond;
var day = Math.floor(second / 3600 / 24);
var dayStr = day.toString();
if (dayStr.length == 1) dayStr = dayStr;
// 小时位
var hr = Math.floor((second - day * 3600 * 24) / 3600);
var hrStr = hr.toString();
if (hrStr.length == 1) hrStr = hrStr;
// 分钟位
var min = Math.floor((second - day * 3600 * 24 - hr * 3600) / 60);
var minStr = min.toString();
if (minStr.length == 1) minStr = minStr;
// 秒位
var sec = second - day * 3600 * 24 - hr * 3600 - min * 60;
var secStr = sec.toString();
if (secStr.length == 1) secStr = secStr;
this.showshengyuqixian = dayStr + '天' + hrStr + '小时' + minStr + "分钟"
},
getServerData() {
let t = this;
uni.request({
url: 'https://www.ucharts.cn/data.json',
data: {},
success: function(res) {
console.log(res.data.data)
let Mix = {
categories: t.shuguan_x,
series: [{
"name": "曲线",
"data": t.shuguan,
"type": "line",
"style": "curve",
"color": "#F29600"
}],
};
//这里我后台返回的是数组,所以用等于,如果您后台返回的是单条数据,需要push进去
// Mix.categories=res.data.data.Mix.categories;
// Mix.series=res.data.data.Mix.series;
_self.showMix("canvasMix", Mix);
},
fail: () => {
_self.tips = "网络错误,小程序端请检查合法域名";
},
});
},
getServerData1() {
let t = this;
uni.request({
url: 'https://www.ucharts.cn/data.json',
data: {},
success: function(res) {
console.log(res.data.data)
let Mix = {
categories: t.shuban_x,
series: [{
"name": "曲线",
"data": t.shuban,
"type": "line",
"style": "curve",
"color": "#F29600"
}, ],
};
//这里我后台返回的是数组,所以用等于,如果您后台返回的是单条数据,需要push进去
// Mix.categories=res.data.data.Mix.categories;
// Mix.series=res.data.data.Mix.series;
_self.showMix("canvasMixone", Mix);
},
fail: () => {
_self.tips = "网络错误,小程序端请检查合法域名";
},
});
},
// 前往数板详情
go_shuban(e){
console.log(e)
uni.navigateTo({
url: '/pages/shubanxinxi/shubanxinxi?num='+e.number,
success: res => {},
fail: () => {},
complete: () => {}
});
},
// 获取剩余可用次数
get_shenyu(){
let t = this;
let url = "api/shuguan/getShuguanRule";
let param = {};
app.post(url,param,'post').then(r =>{
console.log(r,"获取剩余可用次数")
t.shenyu_times = r;
let newshenyu_times=t.shenyu_times;
let number = newshenyu_times.shengyu;
// // 时间戳处理
var totalSecond = number;
var second = totalSecond;
// // 秒数
// var second = totalSecond;
var day = Math.floor(second / 3600 / 24);
var dayStr = day.toString();
if (dayStr.length == 1) dayStr = dayStr;
// 小时位
var hr = Math.floor((second - day * 3600 * 24) / 3600);
var hrStr = hr.toString();
if (hrStr.length == 1) hrStr = hrStr;
// 分钟位
var min = Math.floor((second - day * 3600 * 24 - hr * 3600) / 60);
var minStr = min.toString();
if (minStr.length == 1) minStr = minStr;
// 秒位
var sec = second - day * 3600 * 24 - hr * 3600 - min * 60;
var secStr = sec.toString();
if (secStr.length == 1) secStr = secStr;
newshenyu_times.shengyu = dayStr + '天' + hrStr + '小时' + minStr + "分钟"
this.shenyu_times=newshenyu_times
}).catch(err =>{
console.log(err)
})
},
// 数管列表查看
look_guan(e){
console.log(e)
uni.navigateTo({
url: '/pages/shuguanshujudetail/shuguanshujudetail?id='+e,
success: res => {},
fail: () => {},
complete: () => {}
});
},
showMix(canvasId, chartData) {
console.log('9090909', chartData)
canvaMix = new uCharts({
$this: _self,
canvasId: canvasId,
type: 'mix',
fontSize: 11,
legend: {
show: true
},
background: '#FFFFFF',
pixelRatio: _self.pixelRatio,
categories: chartData.categories,
series: chartData.series,
animation: true,
enableScroll: true, //开启图表拖拽功能
xAxis: {
disableGrid: false,
type: 'grid',
gridType: 'dash',
itemCount: 4,
scrollShow: true,
scrollAlign: 'left',
},
yAxis: {
gridType: 'dash',
splitNumber: 10,
min: 20,
max: 40,
format: (val) => {
return val.toFixed(0)
}
},
width: _self.cWidth * _self.pixelRatio,
height: _self.cHeight * _self.pixelRatio,
dataLabel: true,
dataPointShape: true,
extra: {
tooltip: {
bgColor: '#000000',
bgOpacity: 0.7,
gridType: 'dash',
dashLength: 8,
gridColor: '#1890ff',
fontColor: '#FFFFFF',
horizentalLine: true,
xAxisLabel: true,
yAxisLabel: true,
labelBgColor: '#DFE8FF',
labelBgOpacity: 0.95,
labelAlign: 'left',
labelFontColor: '#666666'
}
},
});
},
touchMix(e) {
canvaMix.scrollStart(e);
},
moveMix(e) {
canvaMix.scroll(e);
},
touchEndMix(e) {
canvaMix.scrollEnd(e);
//下面是toolTip事件,如果滚动后不需要显示,可不填写
canvaMix.showToolTip(e, {
format: function(item, category) {
return category + ' ' + item.name + ':' + item.data
}
});
},
//切换
xuan(e) {
console.log(e)
this.sel = e.currentTarget.dataset.id;
if (e.currentTarget.dataset.id == 1) {
this.getServerData1();
} else {
this.getServerData();
}
},
},
onShow() {
// 获取数板图表数据
this.get_shubanchart();
// 获取数管图表数据
this.get_shuguanchart();
// 获取剩余可用次数
this.get_shenyu()
}
}
</script>
<style>
.nodatas{
color:#7F8389;
font-size:36rpx;
margin: 100rpx 0 50rpx;
}
/*样式的width和height一定要与定义的cWidth和cHeight相对应*/
.qiun-charts {
width: 750upx;
height: 500upx;
background-color: #FFFFFF;
}
.myshuban {
background: #fff;
}
.charts {
width: 750upx;
height: 500upx;
background-color: #FFFFFF;
}
.month {
color: #F29600;
font-size: 32rpx;
font-weight: bold;
}
.cishu {
color: #0A0808;
font-size: 32rpx;
font-weight: bold;
}
.qiun-columns {
overflow: hidden;
background: #fff;
}
.qiun-charts {
margin-top: 32rpx
}
.qiun-title-dot-light {
margin-top: 38rpx;
padding: 0 32rpx;
box-sizing: border-box;
}
.shunav {
width: 750rpx;
background: #fff;
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 158rpx;
box-sizing: border-box;
}
.shuitem {
color: #7F8389;
font-size: 30rpx;
}
.shuactive {
position: relative;
}
.shuactive:after {
content: "";
display: block;
width: 48rpx;
height: 6rpx;
background: #F29600;
position: absolute;
left: 50%;
right: 50%;
bottom: -18rpx;
transform: translate(-50%, -50%)
}
.sheright {
width: 48rpx;
height: 48rpx;
font-size: 0;
}
.shebeihead {
color: #0A0808;
font-size: 32rpx;
padding: 0 32rpx;
box-sizing: border-box;
margin-top: 10rpx
}
.shebeilist {
padding: 0 32rpx 44rpx;
box-sizing: border-box;
margin-top: 20rpx;
}
.sbitem {
border-right: 1rpx solid #DEDEDE;
border-bottom: 1rpx solid #DEDEDE;
height: 142rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.sbitem:first-child {
border-left: 1rpx solid #D5D5D5
}
.shebeiitem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 26rpx 0;
box-sizing: border-box;
}
.shebeixi {
display: flex;
align-items: center;
margin-top: 28rpx;
}
.shebeihao {
color: #0A0808;
font-size: 28rpx;
}
.company {
color: #7F8389;
font-size: 26rpx;
}
.remainday {
color: #7F8389;
font-size: 26rpx;
margin-left: 64rpx;
}
.shugsj {
font-weight: bold;
}
.sycishuright {
width: 48rpx;
height: 48rpx;
font-size: 0;
}
.shengyu {
display: flex;
align-items: center;
justify-content: space-between;
padding: 48rpx 32rpx 10rpx;
box-sizing: border-box;
}
.sycishuleft {
color: #F29600;
font-size: 28rpx;
}
.sybanhead {
display: flex;
align-items: center;
justify-content: space-around;
border-radius: 14rpx 14rpx 0rpx 0rpx;
background: #F29600;
height: 88rpx;
}
.sybanitem {
color: #fff;
font-size: 30rpx;
}
.shebeilitem {
display: flex;
align-items: center;
justify-content: space-around;
}
.sbdate {
width: 225rpx;
padding: 32rpx 22rpx;
box-sizing: border-box;
color: #7F8389;
font-size: 26rpx;
line-height: 2;
}
.sbhao {
width: 188rpx;
color: #7F8389;
font-size: 26rpx;
text-align: center;
padding: 0 30rpx;
box-sizing: border-box;
}
.sbt {
font-size: 0;
width: 194rpx;
display: flex;
justify-content: center;
}
.sbt image {
width: 96rpx;
height: 96rpx;
margin: 0 auto;
}
.ck {
width: 148rpx;
color: #7F8389;
font-size: 26rpx;
text-align: center;
}
</style>
... ...
<template>
<view class="personpage">
<view class="personimg" @click="enterperson">
<image src="/static/img/personimg.png"></image>
<view class="infobox">
<view class="infoimg">
<image :src="peopleinfo.avatar" v-if="token!=''"></image>
<image :src="touxiang" v-else></image>
</view>
<view class="infoname">{{peopleinfo.nickname}}</view>
<view class="infohead">
<view class="infoheadleft">
<view class="infotui">推荐人</view>
<view class="infoji" v-if="token!=''">{{peopleinfo.recommender==''?'暂无':peopleinfo.recommender}}</view>
<view class="infoji" v-else>{{tuijianren}}</view>
</view>
<view class="infoheadleft">
<view class="infotui">公司名称</view>
<view class="infoji" v-if="token!=''">{{peopleinfo.company_name==''?'暂无':peopleinfo.company_name}}</view>
<view class="infoji" v-else>{{company}}</view>
</view>
</view>
<view class="infobottom">
<view class="bottomleft">完善个人信息获取更好的内容</view>
<view class="wanshan">立即完善</view>
</view>
</view>
</view>
<view class="infoboxlist">
<view class="listitem" @click="myshuju">
<ciew class="itemleft">
<view class='leftimg'>
<image src="/static/img/hezi.png"></image>
</view>
<view class="leftname">我的数据</view>
</ciew>
<view class="itemright">
<image src="/static/img/rowright.png"></image>
</view>
</view>
<view class="listitem" @click="xiaofeijilu">
<ciew class="itemleft">
<view class='leftimg'>
<image src="/static/img/xiaofei.png"></image>
</view>
<view class="leftname">消费记录</view>
</ciew>
<view class="itemright">
<image src="/static/img/rowright.png"></image>
</view>
</view>
<view class="listitem" @click="kaifapiao">
<ciew class="itemleft">
<view class='leftimg'>
<image src="/static/img/fapiao.png"></image>
</view>
<view class="leftname">开具发票</view>
</ciew>
<view class="itemright">
<image src="/static/img/rowright.png"></image>
</view>
</view>
<view class="listitem" @click="aboutus">
<ciew class="itemleft">
<view class='leftimg'>
<image src="/static/img/women.png"></image>
</view>
<view class="leftname">关于我们</view>
</ciew>
<view class="itemright">
<image src="/static/img/rowright.png"></image>
</view>
</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue"
export default {
data() {
return {
peopleinfo: '',
token: '',
touxiang: "../../static/img/morentou3.png",
tuijianren: '暂无',
company: "暂无",
}
},
methods: {
enterperson() {
let re_id = uni.getStorageSync("re_id");
let token = uni.getStorageSync("token")
if (token == '') {
uni.showToast({
title: '请登录后操作',
icon: 'none'
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/qidong/qidong"
})
}, 1000)
} else if (token !=''&&re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
}else {
let peopleinfo = this.peopleinfo;
peopleinfo = JSON.stringify(peopleinfo)
uni.navigateTo({
// url: '/pages/gerenxinxi/gerenxinxi?name='+this.peopleinfo.name+'&avatar='+this.peopleinfo.avatar+'&companyname='+this.peopleinfo.company_name
url: '/pages/gerenxinxi/gerenxinxi?peopleinfo=' + peopleinfo
});
}
},
//我的数据
myshuju() {
let re_id = uni.getStorageSync("re_id");
let token = uni.getStorageSync("token")
if (token == '') {
uni.showToast({
title: '请登录后操作',
icon: 'none'
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/qidong/qidong"
})
}, 1000)
} else if (token !=''&&re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
}else {
uni.navigateTo({
url: '/pages/myshuju/myshuju'
})
}
},
//获取个人信息
getpeopleinfo() {
let re_id = uni.getStorageSync("re_id");
let token = uni.getStorageSync("token")
if (token == '') {
uni.showToast({
title: '请登录后操作',
icon: 'none'
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/qidong/qidong"
})
}, 1000)
} else if (token !=''&&re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
}else {
app.post("api/person/getUserInfo", '', 'get')
.then(res => {
console.log(res);
this.peopleinfo = res
console.log('88888888', this.peopleinfo)
})
.catch(err => {});
}
},
//消费记录
xiaofeijilu() {
let re_id = uni.getStorageSync("re_id");
let token = uni.getStorageSync("token")
if (token == '') {
uni.showToast({
title: '请登录后操作',
icon: 'none'
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/qidong/qidong"
})
}, 1000)
} else if (token !=''&&re_id == 0) {
uni.showToast({
title: '请绑定客户',
icon: "none"
})
setTimeout(function() {
uni.navigateTo({
url: "/pages/binding/binding"
})
}, 1000)
}else {
uni.navigateTo({
url: '/pages/xiaofeijilu/xiaofeijilu',
});
}
},
//开具发票
kaifapiao() {
let token = uni.getStorageSync("token");
if (token == '') {
uni.showToast({
title: '请登录后操作',
icon: 'none'
})
setTimeout(function() {
uni.navigateTo({
url: '/pages/qidong/qidong'
})
}, 1000)
} else {
uni.navigateTo({
url: '/pages/kaijufapiao/kaijufapiao',
});
}
},
//关于我们
aboutus() {
uni.navigateTo({
url: '/pages/aboutus/aboutus',
});
}
},
onShow() {
let token = uni.getStorageSync("token");
this.token = token
if (token == '') {
this.touxiang = "../../static/img/morentou1.png";
this.tuijianren = '暂无';
this.company = "暂无";
} else {
this.getpeopleinfo()
}
},
mounted() {
}
}
</script>
<style>
.personpage {
background: #F5F5F5;
}
.personimg {
width: 686rpx;
height: 446rpx;
font-size: 0;
margin: 32rpx auto 0;
position: relative;
}
.personimg image {
width: 100%;
height: 100%;
}
.infobox {
width: 686rpx;
position: absolute;
top: 38rpx;
}
.infoimg {
width: 125rpx;
height: 125rpx;
font-size: 0;
border-radius: 50%;
margin: 0 auto;
}
.infoimg image {
width: 100%;
height: 100%;
border-radius: 50%;
}
.infoname {
color: #FFFFFF;
font-size: 36rpx;
text-align: center;
margin-top: 20rpx;
}
.infohead {
display: flex;
padding: 0 30rpx;
box-sizing: border-box;
align-items: center;
justify-content: space-between;
margin-top: 22rpx;
}
.infotui {
width: 300rpx;
text-align: center;
color: #F29600;
font-size: 24rpx;
}
.infoji {
width: 300rpx;
color: #fff;
font-size: 28rpx;
margin-top: 20rpx;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.infobottom {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 44rpx;
box-sizing: border-box;
margin-top: 37rpx;
}
.bottomleft {
color: #FFFFFF;
font-size: 22rpx;
}
.wanshan {
width: 162rpx;
height: 44rpx;
border: 2rpx solid rgba(242, 150, 0, 1);
opacity: 1;
color: #F29600;
font-size: 24rpx;
text-align: center;
line-height: 44rpx;
border-radius: 20rpx;
}
.infoboxlist {
background: #fff;
margin-top: 20rpx;
width: 686rpx;
margin: 20rpx auto 0;
}
.listitem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 40rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
}
.leftimg {
width: 44rpx;
height: 44rpx;
font-size: 0;
}
.leftimg image {
width: 100%;
height: 100%;
}
.itemright {
width: 48rpx;
height: 48rpx;
font-size: 0;
}
.itemright image {
width: 100%;
height: 100%;
}
.itemleft {
display: flex;
align-items: center;
}
.leftname {
color: #0A0808;
font-size: 30rpx;
margin-left: 24rpx;
}
.infoheadleft {
flex: 1;
width: 375rpx;
}
</style>
... ...
<template>
<div class="box">
<div class="topimg">
<image src="../../static/img/logo.png"></image>
</div>
<div class="bottom">
<div class="bottom_btn">
<button class='bottom_anniu' open-type="getUserInfo" withCredentials="true" lang="zh_CN" @getuserinfo="wxGetUserInfo"
hover-class="none">
授权登录
</button>
</div>
<div class="quxiao" @click="cancel">取消</div>
</div>
</div>
</template>
<script>
import app from "../../App.vue"
export default {
data() {
return {
code: "",
nickname: "",
avatar: "",
}
},
methods: {
// 暂不授权
no_grant() {
uni.navigateBack();
},
// 获取到code
get_code() {
let t = this;
uni.login({
provider: "weixin",
success(r) {
console.log(r.code)
t.code = r.code
}
})
},
// 用code换去sessionkey和openid
//第一授权获取用户信息===》按钮触发
wxGetUserInfo() {
let t = this;
uni.getUserInfo({
provider: 'weixin',
success: function(infoRes) {
console.log(infoRes)
let param = {
code: t.code,
nickname: infoRes.userInfo.nickName,
avatar: infoRes.userInfo.avatarUrl
}
// t.nickname = infoRes.nickname;
// t.avatar=infoRes.userInfo.avatarUrl
app.post("api/user/login", param, 'post')
.then(res => {
console.log(res,"返回token");
uni.setStorageSync('token', res.userInfo.token);
uni.setStorageSync("openid",res.openid);
uni.setStorageSync("re_id",res.userInfo.re_id);
if(res.userInfo.re_id == 0){
uni.navigateTo({
url: '/pages/binding/binding'
});
}else{
uni.switchTab({
url: '/pages/taocangoumai/taocangoumai'
});
}
})
.catch(err => {});
// t avatar = infoRes.userInfo.avatarUrl;
},
fail(res) {}
});
},
// 取消登录
cancel() {
uni.switchTab({
url: '/pages/taocangoumai/taocangoumai'
})
}
},
onLoad() {
this.get_code()
}
}
</script>
<style>
page {
background: #fff;
}
.box {
background: #fff;
}
.topimg {
width: 180rpx;
height: 200rpx;
font-size: 0;
margin: 250rpx auto 0;
}
.topimg image {
width: 100%;
height: 100%;
}
.bottom_btn {
width: 580rpx;
height: 100rpx;
background: rgba(243, 152, 0, 1);
box-shadow: 0rpx 4rpx 18rpx rgba(0, 0, 0, 0.04);
opacity: 1;
border-radius: 10rpx;
color: #fff;
font-size: 32rpx;
text-align: center;
line-height: 100rpx;
margin: 454rpx auto 0;
}
button {
width: 580rpx;
height: 100rpx;
text-align: center;
line-height: 100rpx;
border: none;
outline: none;
background: transparent;
color: #fff;
font-size: 32rpx;
}
button::after {
border: none;
background: transparent;
}
.quxiao {
width: 580rpx;
height: 100rpx;
border: 2rpx solid rgba(243, 152, 0, 1);
opacity: 1;
border-radius: 10rpx;
color: #F39800;
font-size: 32rpx;
text-align: center;
line-height: 100rpx;
margin: 40rpx auto 0;
}
</style>
... ...
<template>
<view class="box">
<view class="jilulist">
<view class="jiluitem" v-for="(item,index) in selectarr" :key="index">
<view class="jileft" @click="select(item.id,index)">
<view class="selimg" v-if="item.select==false">
<image src="/static/img/selsect.png"></image>
</view>
<view class="selimg" v-else>
<image src="/static/img/xuan.png"></image>
</view>
<view class="dhao">
<view class="seldanhao">订单号:{{item.order_sn}}</view>
<view class="selcishu">{{item.recharge}}</view>
</view>
</view>
<view class="jiright">
<view class="jidate">
{{item.createtime}}
</view>
<view class="jimoney">¥{{item.pay_money}}</view>
</view>
</view>
</view>
<view class="bottom">
<view class="bottomleft">
<view class="selimg" @click="selectall">
<image src="/static/img/selsect.png" v-if="select_all == false"></image>
<image src="/static/img/xuan.png" v-else></image>
</view>
<view class="allsel">全选</view>
<view class="chongjilu">
<view class="jilu">
{{totalnum}}个充值记录
</view>
<text class="total">共</text>
<text class="totalmonety">{{totalmoney}}元</text>
</view>
</view>
<view class="nextstep" @click="next">下一步</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue"
export default {
data() {
return {
selectarr: [],
// 充值记录
totalnum: 0,
//钱数
totalmoney: 0,
select_all: false,
// 选中的id
select_id: []
}
},
methods: {
// 单选选择数板
select(id, index) {
console.log(id)
let t = this;
let newselect_id = t.select_id;
let newselectarr = t.selectarr;
let newtotalmoney = t.totalmoney;
let newtotalnum = t.totalnum;
newselectarr[index].select = !newselectarr[index].select;
if (newselectarr[index].select) {
newtotalmoney = Number(newtotalmoney) + Number(newselectarr[index].pay_money);
newtotalnum = Number(newtotalnum) + 1
newselect_id.push(id)
} else {
newtotalmoney = Number(newtotalmoney) - Number(newselectarr[index].pay_money);
newtotalnum = Number(newtotalnum) - 1
t.select_all = false;
newselect_id.splice(index, 1)
}
t.selectarr = newselectarr;
t.totalmoney = newtotalmoney.toFixed("2");
t.totalnum = newtotalnum;
t.select_id = newselect_id;
if(t.select_id.length==t.selectarr.length){
t.select_all=true
}
console.log('99998888', t.select_id);
uni.setStorageSync("select_id",t.select_id);
uni.setStorageSync("totalmoney",t.totalmoney);
uni.setStorageSync("totalnum",t.totalnum)
},
// select(id, index) {
// console.log(index)
// let newselectarr = this.selectarr;
// let newtotalmoney = this.totalmoney;
// let newtotaljilu = this.totaljilu;
// newselectarr[index].select = !newselectarr[index].select;
// if (newselectarr[index].select == true) {
// newtotalmoney = Number(newtotalmoney) + Number(newselectarr[index].pay_money)
// newtotaljilu = Number(newtotaljilu)+1
// } else {
// newtotalmoney = Number(newtotalmoney) - Number(newselectarr[index].pay_money)
// newtotaljilu = Number(newtotaljilu)-1
// }
// console.log(newtotalmoney)
// this.totalmoney = newtotalmoney.toFixed("2");
// this.selectarr = newselectarr;
// this.totaljilu = newtotaljilu
// },
//选择全部板数
// selectall() {
// let newselectarr = this.selectarr;
// let newtotalmoney = this.totalmoney;
// for (var obj of newselectarr) {
// obj.select = true;
// newtotalmoney = Number(newtotalmoney) + Number(obj.pay_money)
// }
//
// this.totalmoney = newtotalmoney.toFixed("2");
// this.selectarr = newselectarr;
//
// },
selectall() {
let t = this;
let newselectarr = t.selectarr;
let newtotalmoney = t.totalmoney;
let newtotalnum = t.totalnum;
t.select_all = !t.select_all;
let newselect_id = t.select_id
for (var i = 0; i < newselectarr.length; i++) {
if (t.select_all) {
newselectarr[i].select = true;
newselect_id.push(newselectarr[i].id)
newtotalmoney = Number(newtotalmoney) + Number(newselectarr[i].pay_money);
newtotalnum = newselectarr.length
console.log(newselectarr.length, "数组的长度")
} else {
newselectarr[i].select = false;
newtotalmoney = 0;
newtotalnum = 0;
newselect_id = []
}
};
t.selectarr = newselectarr;
t.totalmoney = newtotalmoney.toFixed("2");
t.totalnum = newtotalnum;
t.select_id = newselect_id;
uni.setStorageSync("select_id",t.select_id)
uni.setStorageSync("totalmoney",t.totalmoney)
uni.setStorageSync("totalnum",t.totalnum)
console.log('808080', t.select_id);
},
// 选择消费记录
choose_jilu() {
let t = this;
let url = "api/person/choosePayList";
let param = {};
app.post(url, param, 'post').then(r => {
console.log(r)
for (var i = 0; i < r.length; i++) {
console.log(r[i])
r[i]['select'] = false
}
t.selectarr = r;
let newselect_id=uni.getStorageSync("select_id");
console.log('7777',newselect_id)
let newselectarr=t.selectarr;
console.log('6666',newselectarr)
for(var i=0;i<newselectarr.length;i++){
for(var j=0;j<newselect_id.length;j++){
if(newselectarr[i].id==newselect_id[j]){
console.log('888888')
newselectarr[i].select=true
}
}
}
t.selectarr=newselectarr;
if(uni.getStorageSync("totalmoney")!=''){
t.totalmoney=uni.getStorageSync("totalmoney");
}
if(uni.getStorageSync("totalnum")!=''){
t.totalnum=uni.getStorageSync("totalnum");
}
console.log('99999900000',this.selectarr);
}).catch(err => {
console.log(err)
})
},
//下一步
next() {
let t = this;
let id = t.select_id;
let pages = getCurrentPages();
console.log('5555',pages)
// let currPage = pages[pages.length - 1]; //当前页面
let prevPage = pages[pages.length - 2]; //上一个页面
// console.log(e.currentTarget.dataset.id)
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
prevPage.setData({
selectId: id,
totlemoney:t.totalmoney
});
// uni.navigateTo({
// url: '/pages/kafapiao/kafapiao?money=' + this.totalmoney + '&select_id=' + this.select_id
// })
// uni.navigateTo({
// url: '/pages/kafapiao/kafapiao'
// })
uni.navigateBack({
checked:true
})
}
},
onLoad(options) {
console.log(options);
},
onShow() {
// 选择消费记录
this.choose_jilu();
},
onUnload: function() {
let t = this;
let id = t.select_id;
let pages = getCurrentPages();
// let currPage = pages[pages.length - 1]; //当前页面
let prevPage = pages[pages.length - 2]; //上一个页面
// console.log(e.currentTarget.dataset.id)
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
prevPage.setData({
selectId: id,
totlemoney:t.totalmoney
});
},
}
</script>
<style>
.jiluitem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 34rpx 0;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5
}
.jilulist {
background: #fff;
padding: 0 32rpx;
box-sizing: border-box;
/* padding-bottom: 130rpx; */
margin-bottom: 130rpx;
}
.jileft {
display: flex;
align-items: center;
}
.selimg {
width: 32rpx;
height: 32rpx;
font-size: 0;
}
.seldanhao {
color: #0A0808;
font-size: 30rpx;
}
.selcishu {
color: #7F8389;
font-size: 26rpx;
margin-top: 22rpx
}
.jidate {
color: #7F8389;
font-size: 26rpx;
}
.jimoney {
color: #F29600;
font-size: 28rpx;
margin-top: 22rpx;
}
.dhao {
margin-left: 36rpx
}
.bottom {
width: 750rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 18rpx 32rpx;
box-sizing: border-box;
background: #fff;
position: fixed;
bottom: 0;
left: 0;
}
.bottomleft {
display: flex;
align-items: center;
}
.allsel {
color: #0A0808;
font-size: 28rpx;
margin-left: 20rpx;
}
.jilu {
color: #7F8389;
font-size: 26rpx;
}
.total {
color: #7F8389;
font-size: 26rpx;
}
.totalmonety {
color: #F39800;
font-size: 30rpx;
}
.chongjilu {
margin-left: 48rpx;
}
.nextstep {
width: 200rpx;
height: 100rpx;
background: rgba(243, 152, 0, 1);
box-shadow: 0rpx 4rpx 18rpx rgba(0, 0, 0, 0.04);
opacity: 1;
color: #fff;
font-size: 32rpx;
color: #fff;
text-align: center;
line-height: 100rpx;
border-radius: 10rpx;
}
</style>
... ...
<template>
<view class="box">
<view class="infotou">
<view class="shubaninfohead">
<view class="shubaninfoleft">设备编号:{{equipment_log.number}}</view>
<view class="shubaninforight">
<image src="/static/img/fenxiang.png"></image>
<button open-type="share">享</button>
</view>
</view>
<view class="shucompany">
<view class="shuimg">
<image src="/static/img/company.png"></image>
</view>
<view class="companyname">所属公司:{{equipment_log.name}}</view>
</view>
<view class="shucompany weizhi">
<view class="shuimg">
<image src="/static/img/weizhi.png"></image>
</view>
<view class="companyname">所在位置:{{equipment_log.address}}</view>
</view>
<view class="shucompany weizhi">
<view class="shuimg">
<image src="/static/img/time.png"></image>
</view>
<view class="companyname">数板时间:{{equipment_log.time}}</view>
</view>
<view class="shucompany weizhi">
<view class="shuimg">
<image src="/static/img/yichang.png"></image>
</view>
<view class="companyname" v-if="equipment_log.status == 'normal'">异常状态:正常</view>
<view class="companyname" v-if="equipment_log.status == 'hidden'">异常状态:不正常</view>
</view>
</view>
<view class="yiqi">
<view class="yiqihead">
<view class="yiqiheadleft">仪器读数</view>
<view class="yiqiheadright">{{equipment_log.papers}}</view>
</view>
<view class="yiqihead">
<view class="yiqiheadleft">复核数量</view>
<view class="yiqiheadright">{{equipment_log.fuhe}}</view>
</view>
</view>
<view class="yewu">
<view class="yebiaoshi">
<view class="biaoshileft">业务标识</view>
<view class="enterword">
<input type="text" value="" placeholder="请输入业务标识" placeholder-class="word" v-model="biaoshi" />
</view>
</view>
<view class="yebiaoshi">
<view class="biaoshileft">业务描述</view>
<view class="enterword">
<input type="text" value="" placeholder="请输入业务描述" placeholder-class="word" v-model="description" />
</view>
</view>
<view class="yebiaoshi">
<view class="biaoshileft">字段1</view>
<view class="enterword">
<input type="text" value="" placeholder="填写字段" placeholder-class="word" v-model="ziduan1" />
</view>
</view>
<view class="yebiaoshi">
<view class="biaoshileft">字段2</view>
<view class="enterword">
<input type="text" value="" placeholder="填写字段" placeholder-class="word" v-model="ziduan2" />
</view>
</view>
<view class="yebiaoshi">
<view class="biaoshileft">字段3</view>
<view class="enterword">
<input type="text" value="" placeholder="填写字段" placeholder-class="word" v-model="ziduan3" />
</view>
</view>
<view class="yebiaoshi">
<view class="biaoshileft">字段4</view>
<view class="enterword">
<input type="text" value="" placeholder="填写字段" placeholder-class="word" v-model="ziduan4" />
</view>
</view>
<view class="yebiaoshi">
<view class="biaoshileft">字段5</view>
<view class="enterword">
<input type="text" value="" placeholder="填写字段" placeholder-class="word" v-model="ziduan5" />
</view>
</view>
</view>
<!-- 相关照片 -->
<view class="photo" v-if="fenxiangor">
<view class="aboutphoto">相关照片</view>
<view class="imgbox">
<view v-for="(item,index) in imglist" :key="index" class="imgshang">
<view class="upload" >
<image :src="item"></image>
<view class="chahao" @click="del(index)">
<image src="../../static/img/chahao3.png"></image>
</view>
</view>
</view>
<view class="upload" @click="shoseimg">
<image src="/static/img/upload.png"></image>
</view>
<view class='upload' @click="camera">
<image src="/static/img/camera.png"></image>
</view>
</view>
</view>
<view class="subshuju" @click="set_number" v-if="fenxiangor">提交数据</view>
</view>
</template>
<script>
import app from "../../App.vue"
export default {
data() {
return {
// 详情数据
equipment_log: "",
// 输入框数据
biaoshi: "",
description: "",
ziduan1: "",
ziduan2: "",
ziduan3: "",
ziduan4: "",
ziduan5: "",
image: [],
chuanimg: '/static/img/upload.png',
imglist:[],
number:'',
id:'',
is_share:0,
fenxiangor:true
}
},
methods: {
//选择照片
shoseimg() {
uni.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album'], //从相册选择
// sourceType: ['camera'],//拍摄照片
// sourceType: '',
success: (chooseImageRes) => {
console.log(909090808080)
const tempFilePaths = chooseImageRes.tempFilePaths;
let images = tempFilePaths[0]
console.log(images)
let head = {
'token': uni.getStorageSync('token'),
}
uni.uploadFile({
url: 'https://icr.gangjuren.com/api/person/upload', //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'images',
token: uni.getStorageSync('token'),
formData: {},
header: head,
// images:images
success: (uploadFileRes) => {
console.log(uploadFileRes);
let data = JSON.parse(uploadFileRes.data)
console.log(data)
this.imglist.push(data.data.src)
}
});
},
fail: function(err) {
console.log('76543221')
console.log(err, "失败的回调")
}
});
},
//拍摄照片上传
camera() {
uni.chooseImage({
count:1,
sizeType: ['original', 'compressed'],
//sourceType: ['album'], //从相册选择
sourceType: ['camera'],//拍摄照片
// sourceType: '',
success: (chooseImageRes) => {
console.log(909090808080)
const tempFilePaths = chooseImageRes.tempFilePaths;
let images = tempFilePaths[0]
console.log(images)
let head = {
'token': uni.getStorageSync('token'),
}
uni.uploadFile({
url: 'https://icr.gangjuren.com/api/person/upload', //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'images',
token: uni.getStorageSync('token'),
formData: {},
header: head,
// images:images
success: (uploadFileRes) => {
console.log(uploadFileRes);
let data = JSON.parse(uploadFileRes.data)
console.log(data)
this.imglist.push(data.data.src)
}
});
},
fail: function(err) {
console.log('76543221')
console.log(err, "失败的回调")
}
});
},
//删除图片
del(index){
let newimglist=this.imglist;
for(var i=0;i<newimglist.length;i++){
if(i==index){
newimglist.splice(i,1)
}
}
this.imglist=newimglist
},
// 获取数管剩余时间次数
// 获取数板信息详情
get_shubandetail() {
console.log('666666',this.number)
let t = this;
let url = "api/equipment/getEquipmentDetail";
let param = {
number: this.number,
equipment_log_id: t.id,
is_share:t.is_share
};
app.post(url, param, 'post').then(r => {
console.log(r, "获取数板详情")
t.equipment_log = r.equipment_log;
}).catch(err => {
console.log(err)
})
},
// 提交数据
set_number() {
console.log(123)
let t = this;
if (this.imglist.length == 0) {
uni.showToast({
title: '请上传相关图片',
icon: 'none'
})
return false
}
let url = "api/equipment/setEquipmentLog";
let param = {
number: t.equipment_log.number,
equipment_log_id: t.equipment_log.id,
fuhe: t.equipment_log.fuhe,
biaoshi: t.biaoshi,
description: t.description,
ziduan1: t.ziduan1,
ziduan2: t.ziduan2,
ziduan3: t.ziduan3,
ziduan4: t.ziduan4,
ziduan5: t.ziduan5,
images: t.imglist
}
app.post(url, param, 'post').then(r => {
console.log(r)
}).catch(err => {
console.log(err)
})
}
},
onLoad(options) {
console.log('777777',options)
this.number=options.number;
this.id=options.id;
if(options.type==1){
this.is_share=1;
this.fenxiangor=false
}else{
this.is_share=0;
this.fenxiangor=true
}
},
onShow() {
this.get_shubandetail()
},
onShareAppMessage: function(res) {
if (res.from === 'button') {
// 来自页面内转发按钮
}
return {
title: "钢聚人小程序",
path: 'pages/shubandetail/shubandetail?share=' + 'true'+'&type='+1+'&number='+this.number+'&id='+this.id
}
},
}
</script>
<style>
.imgbox{
display:flex;
align-items: center;
}
.imgshang{
display:flex;
align-items: center;
}
.infotou {
background: #fff;
padding: 34rpx 32rpx;
box-sizing: border-box;
}
.shubaninfohead {
display: flex;
align-items: center;
justify-content: space-between;
}
image {
width: 100%;
height: 100%;
}
.shubaninforight {
width: 31rpx;
height: 31rpx;
font-size: 0;
position: relative;
}
.shubaninforight button {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
opacity: 0;
}
.shubaninfoleft {
color: #0A0808;
font-size: 36rpx;
font-weight: bold;
}
.shucompany {
display: flex;
align-items: center;
margin-top: 30rpx;
}
.shuimg {
width: 30rpx;
height: 30rpx;
font-size: 0;
}
.companyname {
color: #7F8389;
font-size: 28rpx;
margin-left: 30rpx;
}
.weizhi {
margin-top: 18rpx;
}
.yiqihead {
display: flex;
align-items: center;
justify-content: space-between;
}
.yiqi {
background: #fff;
box-sizing: border-box;
}
.yiqihead {
padding: 42rpx 32rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
margin-top: 20rpx;
}
.yebiaoshi {
display: flex;
justify-content: space-between;
align-items: center;
padding: 34rpx 32rpx;
box-sizing: border-box;
}
.yiqiheadleft {
color: #0A0808;
font-size: 30rpx;
font-weight: bold;
}
.yiqiheadright {
color: #7F8389;
font-size: 28rpx;
}
.yewu {
background: #FFFFFF;
}
.yebiaoshi {
color: #0A0808;
font-size: 30rpx;
}
.enterword {
color: #7F8389;
font-size: 28rpx;
width: 300rpx;
}
.enterword input {
text-align: right;
}
.word {
color: #7F8389;
font-size: 28rpx;
}
.photo {
padding: 32rpx;
box-sizing: border-box;
background: #fff;
margin-top: 20rpx;
}
.aboutphoto {
color: #0A0808;
font-size: 30rpx;
}
.upload {
width: 160rpx;
height: 160rpx;
font-size: 0;
margin-top: 30rpx;
margin-left:20rpx;
position: relative;
}
.chahao{
width:40rpx;
height:40rpx;
position:absolute;
top:-10rpx;
right:-10rpx;
}
.subshuju {
width: 686rpx;
height: 100rpx;
background: rgba(243, 152, 0, 1);
box-shadow: 0rpx 4rpx 18rpx rgba(0, 0, 0, 0.04);
opacity: 1;
border-radius: 10rpx;
color: #fff;
font-size: 32rpx;
text-align: center;
line-height: 100rpx;
margin: 42rpx auto;
}
</style>
... ...