1、微信小程序首页面布局模式改成从接口获取

2、增加测试模块,内部人员无需配置权限就可以查看
This commit is contained in:
zzy 2022-09-07 11:29:46 +08:00
parent 8621206925
commit 0cd090c677
13 changed files with 2200 additions and 607 deletions

View File

@ -65,25 +65,23 @@ import request from '@/util/index.js'
// } // }
const netChange = () => { const netChange = () => {
uni.onNetworkStatusChange(function(res) {
uni.onNetworkStatusChange(function(res){
// console.log(res.isConnected) // console.log(res.isConnected)
store.mutations.isConnect( res.isConnected) store.mutations.isConnect(res.isConnected)
if(!res.isConnected) { if (!res.isConnected) {
uni.showToast({ uni.showToast({
title:'网络未连接', title: '网络未连接',
icon:'none' icon: 'none'
}) })
} }
}) })
} }
const cutDate = (dd, type, daynum) => { const cutDate = (dd, type, daynum) => {
dd = new Date(dd) || new Date(); dd = new Date(dd) || new Date();
type = type || 'YYYY/MM/DD' //hh:mm:ss type = type || 'YYYY/MM/DD' //hh:mm:ss
daynum = daynum*24*60*60*1000 || 0 daynum = daynum * 24 * 60 * 60 * 1000 || 0
// console.log(daynum,dd,dd.getTime()+daynum) // console.log(daynum,dd,dd.getTime()+daynum)
dd = new Date(dd.getTime()+daynum )// 获取AddDayCount天后的日期 dd = new Date(dd.getTime() + daynum) // 获取AddDayCount天后的日期
var y = dd.getFullYear() var y = dd.getFullYear()
var m = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1) // 获取当前月份的日期不足10补0 var m = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1) // 获取当前月份的日期不足10补0
var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号不足10补0 var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号不足10补0
@ -93,7 +91,7 @@ const cutDate = (dd, type, daynum) => {
return type.replace('YYYY', y).replace('MM', m).replace('DD', d).replace('hh', h).replace('mm', mi).replace('ss', s) return type.replace('YYYY', y).replace('MM', m).replace('DD', d).replace('hh', h).replace('mm', mi).replace('ss', s)
} }
// 金额格式化处理方法 // 金额格式化处理方法
const fmoney = (s, n)=> { const fmoney = (s, n) => {
/* /*
* 参数说明 * 参数说明
* s要格式化的数字 * s要格式化的数字
@ -101,7 +99,7 @@ const fmoney = (s, n)=> {
* */ * */
n = n > 0 && n <= 20 ? n : 2; n = n > 0 && n <= 20 ? n : 2;
var fuhao = ''; //如果数字小于零则值为- var fuhao = ''; //如果数字小于零则值为-
if(s<0){ if (s < 0) {
s = Math.abs(s); s = Math.abs(s);
fuhao = '-' fuhao = '-'
} }
@ -112,57 +110,100 @@ const fmoney = (s, n)=> {
for (let i = 0; i < l.length; i++) { for (let i = 0; i < l.length; i++) {
t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : ""); t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
} }
return fuhao+[...t].reverse().join("") + "." + r; return fuhao + [...t].reverse().join("") + "." + r;
} }
function toNextRoute (type,url) { /**
uni[type]({ * 将数据转成日期格式
url: url, * @param {string} s: 要格式化的日期数据
success: (result) => { */
function changeStringToDate(s) {
if (s.length === 14) {
return s.substring(0, 4) + '-' + s.substring(4, 6) + '-' + s.substring(6, 8) + ' ' +
s.substring(8, 10) + ':' + s.substring(10, 12) + ':' + s.substring(12, 14);
}
else if (s.length === 8) {
return s.substring(0, 4) + '-' + s.substring(4, 6) + '-' + s.substring(6, 8);
}
}
function toNextRoute(type, url) {
uni[type]({
url: url,
success: (result) => {
addUserBehavior({ intoRoute: url }) addUserBehavior({
} intoRoute: url
}) })
}
})
} }
function addUserBehavior (obj) { function addUserBehavior(obj) {
var pages = getCurrentPages() // 获取加载的页面 var pages = getCurrentPages() // 获取加载的页面
let len = pages.length let len = pages.length
if(len){ if (len) {
var currentPage = pages[len - 1] // 获取当前页面的对象 var currentPage = pages[len - 1] // 获取当前页面的对象
var nowRoute = '/' + currentPage.route // 当前页面url var nowRoute = '/' + currentPage.route // 当前页面url
if (obj) { if (obj) {
obj.outtoRoute = (obj.outtoRoute === '' || obj.outtoRoute) ? obj.outtoRoute : nowRoute obj.outtoRoute = (obj.outtoRoute === '' || obj.outtoRoute) ? obj.outtoRoute : nowRoute
obj.intoRoute = obj.intoRoute ? obj.intoRoute.split('?')[0] : '' obj.intoRoute = obj.intoRoute ? obj.intoRoute.split('?')[0] : ''
} else { } else {
obj = {} obj = {}
obj.outtoRoute = nowRoute obj.outtoRoute = nowRoute
obj.intoRoute = len >1 ? '/' + pages[len - 2].route : '/pages/index/index' obj.intoRoute = len > 1 ? '/' + pages[len - 2].route : '/pages/index/index'
} }
} }
obj.visitChannels = store.state.visitChannels obj.visitChannels = store.state.visitChannels
// request.$webGet('WeChat/AddUserBehaviorNew',obj).then(res => { // request.$webGet('WeChat/AddUserBehaviorNew',obj).then(res => {
request.$webGet('WeChatPushAPI/Member/AddUserBehaviorNew',obj).then(res => { request.$webGet('WeChatPushAPI/Member/AddUserBehaviorNew', obj).then(res => {
// console.log(obj) // console.log(obj)
}) })
} }
/*
根据关键字获取相应的枚举选项文档见 https://api.eshangtech.com/EShangApiMain/swagger/ui/index#!/FrameWork/FrameWork_GetFieldEnumByField
params:{FieldExplainField,FieldEnumStatus}
*/
async function getFieldEnumByField(params) {
if (!params.FieldExplainField) return null
// 缓存了上次请求的数据 如果字段一致 则直接返回缓存数据 否则请求
// 可优化:根据有效期判断是否再次请求
if (!this.dataMap) {
this.dataMap = {}
}
if (this.dataMap[params.FieldExplainField]) {
return this.dataMap[params.FieldExplainField]
}
const data = await request.$webGet('EShangApiMain/FrameWork/GetFieldEnumByField', params)
if (data.Result_Code == 100) {
let typeMap = {}
data.Result_Data.List.map(n => {
typeMap[n.value] = n.label
})
this.dataMap[params.FieldExplainField] = typeMap
return typeMap
}
// 视频播放 }
// 视频播放
const EZUIPlayer = require('./ezuikit.js'); const EZUIPlayer = require('./ezuikit.js');
function playVideo(opt) { function playVideo(opt) {
return new EZUIPlayer(opt) return new EZUIPlayer(opt)
} }
export default { export default {
netChange, netChange,
cutDate, cutDate,
fmoney, fmoney,
changeStringToDate,
toNextRoute, toNextRoute,
addUserBehavior, addUserBehavior,
getFieldEnumByField, // 获取枚举参数
// calculateDistance, // calculateDistance,
// bMapToQQMap, // bMapToQQMap,
playVideo playVideo

1101
pages.json

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,92 @@
<template>
<view class="card cardBorder" @tap='goDetail' v-if="item">
<!-- 卡片第一行数据 -->
<view class="uni-flex jc-between">
<!-- 左侧 -->
<!-- 业主单位名称 -->
<p class="contentName">{{item.OWNERUNIT_NAME || ''}}</p>
</view>
<!-- 卡片第一行角标 -->
<view class="content-index" style="background-color:#FB8B56">{{i+1}}</view>
<!-- 卡片第三行数据 -->
<view class="uni-flex content-box-cashpay">
<!-- 中间 -->
<!-- 门店数量 -->
<text class="content-price">{{item.BUSINESS_STATE || ''}}</text>
<!-- 右侧 -->
<!-- 在营数量 -->
<text class="other-coast">{{item.BUSINESS_STATE_1000 || ''}}</text>
</view>
<!-- 分割线 -->
<view class="bb1"></view>
<!-- 卡片第四行顶部数据 -->
<view class="uni-flex jc-between align-center" v-if="item.BRAND_NAME">
<!-- 左侧 -->
<view class="uni-flex align-top">
<!-- 经营品牌 -->
<!-- 圆点 -->
<text class="G-icon A-icon"></text>
<span class="content-span">经营品牌{{item.BRAND_NAME || ''}}</span>
</view>
</view>
<!-- 卡片第四行中间数据 -->
<view class="uni-flex jc-between" v-if="item.BUSINESS_TRADENAME">
<!-- 左侧 -->
<view class="uni-flex align-top">
<!-- 经营业态 -->
<!-- 圆点 -->
<p class="B-icon A-icon"></p>
<span class="content-span">经营业态{{item.BUSINESS_TRADENAME || ''}}</span>
</view>
</view>
</view>
</template>
<script>
export default {
props: {//
item: {
type: Object,
required: true
},
i: {
type: Number,
required: true
},
},
data() {//
return {
}
},
computed: {},
methods: {//
goDetail() {
this.$emit('goDetail', this.item)
},
dateEmpty(v) {
return this.$util.cutDate(v, 'YYYY/MM/DD')
},
},
}
</script>
<!-- 注意style样式增加scoped私有属性标记后组件样式不能在引用的地方进行修改 -->
<style scoped>
@import url('/common/css/listUnit.css');
.cardBorder {//
box-shadow: 0 0px 6rpx #E2E2E2;
}
.content-box-cashpay {
position: relative;
}
.other-coast {//
color: #D1A271;
background: linear-gradient(to top, #EBDDCF, #FCFBF8);
border-radius: 6rpx;
font-size: 20rpx;
padding: 0 10rpx;
margin-left: 16rpx;
margin-top: 3rpx;
position: absolute;
right: 0rpx;
bottom: 30rpx;
}
</style>

View File

@ -0,0 +1,203 @@
<template>
<view class="page-body">
<!-- 顶部信息卡片 -->
<view class="card-header">
<!-- 顶部信息卡片第一行 -->
<view class="uni-flex ai-center jc-between fs12">
<!-- 左侧 -->
<span>业主单位名称{{dataDetail.OWNERUNIT_NAME || ''}}</span>
</view>
<!-- 顶部信息卡片第二行 -->
<view class="uni-flex ai-center jc-between fs12">
<!-- 左侧 -->
<span>经营品牌{{dataDetail.BRAND_NAME || ''}}</span>
<!-- 右侧 -->
<span>经营业态{{dataDetail.BUSINESS_TRADENAME || ''}}</span>
</view>
</view>
<!-- 详情信息 -->
<view class="modle-title">
<h2>测试接口</h2>
</view>
<!-- 详情信息卡片 -->
<view class="content-detail-box main-card ino-flex ai-center uni-column">
<!-- 单列样式 -->
<!-- 业主单位名称 -->
<view class="cellTopStyle">
<span class="fourth-name">业主单位名称</span>
<span>{{dataDetail.OWNERUNIT_NAME || ''}}</span>
</view>
<!-- 经营品牌 -->
<view class="cellTopStyle">
<span class="fourth-name">经营品牌</span>
<span>{{dataDetail.BRAND_NAME || ''}}</span>
</view>
<!-- 经营业态 -->
<view class="cellTopStyle">
<span class="fourth-name">经营业态</span>
<span>{{dataDetail.BUSINESS_TRADENAME || ''}}</span>
</view>
<!-- 门店数量 -->
<view class="cellTopStyle">
<span class="fourth-name">门店数量</span>
<span>{{dataDetail.BUSINESS_STATE !== null ?
dataDetail.BUSINESS_STATE : ''}}</span>
</view>
<!-- 自营门店数量 -->
<view class="cellTopStyle">
<span class="fourth-name">自营门店数量</span>
<span>{{dataDetail.BUSINESS_TYPE_1000 !== null ?
dataDetail.BUSINESS_TYPE_1000 : ''}}</span>
</view>
<!-- 合作经营数量 -->
<view class="cellTopStyle">
<span class="fourth-name">合作经营数量</span>
<span>{{dataDetail.BUSINESS_TYPE_2000 !== null ?
dataDetail.BUSINESS_TYPE_2000 : ''}}</span>
</view>
<!-- 固定租金数量 -->
<view class="cellTopStyle">
<span class="fourth-name">固定租金数量</span>
<span>{{dataDetail.BUSINESS_TYPE_3000 !== null ?
dataDetail.BUSINESS_TYPE_3000 : ''}}</span>
</view>
<!-- 展销门店数量 -->
<view class="cellTopStyle">
<span class="fourth-name">展销门店数量</span>
<span>{{dataDetail.BUSINESS_TYPE_4000 !== null ?
dataDetail.BUSINESS_TYPE_4000 : ''}}</span>
</view>
<!-- 在营数量 -->
<view class="cellTopStyle">
<span class="fourth-name">在营数量</span>
<span>{{dataDetail.BUSINESS_STATE_1000 !== null ?
dataDetail.BUSINESS_STATE_1000 : ''}}</span>
</view>
<!-- 暂停数量 -->
<view class="cellTopStyle">
<span class="fourth-name">暂停数量</span>
<span>{{dataDetail.BUSINESS_STATE_2000 !== null ?
dataDetail.BUSINESS_STATE_2000 : ''}}</span>
</view>
<!-- 停业数量 -->
<view class="cellTopStyle">
<span class="fourth-name">停业数量</span>
<span>{{dataDetail.BUSINESS_STATE_3000 !== null ?
dataDetail.BUSINESS_STATE_3000 : ''}}</span>
</view>
<!-- 待运营数量 -->
<view class="cellTopStyle">
<span class="fourth-name">待运营数量</span>
<span>{{dataDetail.BUSINESS_STATE_1010 !== null ?
dataDetail.BUSINESS_STATE_1010 : ''}}</span>
</view>
</view>
</view>
</template>
<script>
import {mapGetters,mapMutations} from 'vuex'
export default {
data() {
return {
pageData: {
type: null,
id: null
},
loading: true,
dataDetail: {},
}
},
methods: {
...mapMutations(['shouldReLoadingList']),
/**
* 调用接口获取数据详情
*
* Api接口地址EShangApiMain/AutoTest/GetServerpartshopTotalSummary
*/
getDetail(option) {
this.$request.$webGet("EShangApiMain/AutoTest/GetServerpartshopTotalSummary", {
//
BUSINESS_BRAND: option.BUSINESS_BRAND,
BUSINESS_TRADE: option.BUSINESS_TRADE,
OWNERUNIT_ID: option.OWNERUNIT_ID,
})
.then(res => {
uni.hideLoading()
this.loading = false
if (res.Result_Code !== 100) {
return
}
this.dataDetail = res.Result_Data.List.length > 0 ? res.Result_Data.List[0] : null
})
},
},
onLoad(option) {
uni.showLoading()
this.pageData = option
this.loading = true
this.getDetail(option)
this.$forceUpdate()
}
}
</script>
<style scoped>
.page-body {
min-height: 100%;
padding: 40rpx 25rpx;
background-color: #fff;
box-sizing: border-box;
padding-bottom: 196rpx;
}
.card-header {
border-radius: 10rpx;
margin: 0 26rpx 22rpx 26rpx;
background: linear-gradient(to right, #8998bb 0%, #a9b5d2 100%);
color: #FFFFFF;
padding: 24rpx 16rpx;
}
.card-header h3 {
padding-bottom: 10rpx;
font-size: 30rpx;
}
.card-header .fs12>text {
font-size: 24rpx;
}
.cellTopStyle {
line-height: 45rpx;
width: 100%;
display: flex;
align-items: center; //
justify-content: space-between; //
}
.fourth-name {
min-width: 120rpx;
max-width: 140rpx;
color: #ADB2BF;
font-size: 26rpx;
white-space: nowrap;
}
.modle-title {
color: #000;
padding: 36rpx 30rpx 24rpx 30rpx;
font-size: 26rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.modle-title h2 {
font-weight: bolder;
}
.content-detail-box {
margin: 0 26rpx 22rpx 26rpx;
background: #ffffff;
border-radius: 8rpx;
box-shadow: 0rpx 2rpx 8rpx 0rpx rgba(231, 231, 231, 0.67);
overflow: hidden;
position: relative;
padding: 10rpx 30rpx 16rpx 30rpx;
font-size: 26rpx;
}
.content-detail-box span {
font-size: 26rpx;
}
</style>

View File

@ -0,0 +1,391 @@
<template>
<view class="content">
<!-- 顶部筛选菜单 -->
<view class="uni-flex ai-center screen-box menu-list">
<view class="menu" v-for="(item,index) in menuList" :key="index" @click="handleClick(item)">
<view class="menu-image round" style="height:75rpx;width:75rpx;padding: 18rpx;"
:style="activeType==item.id ? 'background:#f0f7fe;' : 'background:#f6f7f8;'">
<image :src="activeType==item.id? item.active: item.src" mode="aspectFit" style="height:100%;"></image>
</view>
<view class="menuName" :style="activeType==item.id ? 'color:#5B96E9' :'color:#808D97'">{{item.name}}</view>
</view>
</view>
<!-- 数据卡片列表 -->
<view v-if="pageList.length>0">
<list-unit v-for="(item,index) in pageList" :key="index" :item="item" :i="index"
@goDetail="goDetail"></list-unit>
</view>
<!-- 无数据时的页面显示 -->
<view v-else-if="pageData.isLoading===false">
<noFound :nodata="pageList.length>0 ? false : true" :text="searchTime[0]+'至'+searchTime[1]+'无数据,'">
<text name="other">请选择其它日期进行查询</text>
</noFound>
</view>
<!-- 底部提示 -->
<view class="load-more" v-if="pageList.length>0">
<text>{{!pageData.isEnd ? '正在加载,请稍后...':'——— 我是有底线的 ———'}}</text>
</view>
<!-- 更多筛选的弹窗 -->
<UniPop :show="showPop" @hidePopup="closePop" type="bottom" @touchmove.prevent round="true">
<view class="padding-bottom">
<!-- 其他选项 -->
<view class="moduleTitle">{{popData.typeName}}</view>
<view class="uni-flex ai-center menu-list">
<view class="menu" v-for="(item,index) in popData.selectList" :key="index" @click="bindPartChange(item)">
<view class="menu-image round" style="height:74rpx;width:74rpx;border-radius:20rpx;line-height:74rpx;"
:style="'background:' + (popData.colors[index] ? popData.colors[index] : popData.colors[index-popData.colors.length]) + ';'">
<image :src="activeType==item.id ? item.active: item.src" mode="aspectFit" style="height:100%;"></image>
</view>
<view class="menuName" :style="selectTypeIndex==item.typeId ?
'color:' + (popData.colors[index]? popData.colors[index] :
popData.colors[index % 7]) : 'color:#120E2B'">{{item.name}}</view>
</view>
</view>
<view class="popbtn" @click="reloadList">确定</view>
</view>
</UniPop>
</view>
</template>
<script>
import {mapGetters,mapMutations} from 'vuex'
//
import ListUnit from "./components/listUnit.vue"
//
import UniPop from '@/components/uni-popup.vue'
export default {
components: {//import使
ListUnit,
UniPop
},
data() {//
const today = this.$util.cutDate(new Date(), 'YYYY/MM/DD')
const week = this.$util.cutDate(new Date(),'YYYY/MM/DD',-6)
const month = this.$util.cutDate(new Date(),'YYYY/MM/DD',-30)
const threeMonth = this.$util.cutDate(new Date(),'YYYY/MM/DD',-90)
return {
activeType: -1,//
selectTypeIndex: -1,//
dateIndex: 0, //
showPop: false,
searchTime: [week, today],
pageData: {
pageIndex: 1,
pageSize: 10,
isEnd: false,
isLoading: true,
endDate: today
},
menuList: [ //
{
name: '全部',
src: '/static/images/expense/type/yifq.png',
active: '/static/images/expense/type/yifqz.png',
id: -1
},
{
name: '合作经营',
src: '/static/images/expense/type/yifq.png',
active: '/static/images/expense/type/yifqz.png',
id: 2000
},
{
name: '固定租金',
src: '/static/images/expense/type/yifq.png',
active: '/static/images/expense/type/yifqz.png',
id: 3000
},
{
name: '更多筛选',
src: '/static/images/expense/type/shaix.png',
active: '/static/images/expense/type/shaixz.png',
id: 99
},
],
popData:{
//
colors: ['#5B96E9', '#F0A038', '#5B96E9', '#57BAAE', '#D9675C', '#5B96E9', '#57BAAE'],
typeName:"传输类型",
selectList: [//
{
name: '全部',
src: '/static/images/expense/type/qb.png',
typeId: -1
},
{
name: '收银系统',
src: '/static/images/expense/type/qb.png',
typeId: 0
},
{
name: '扫码传输',
src: '/static/images/expense/type/qb.png',
typeId: 1
},
{
name: '接口传输',
src: '/static/images/expense/type/qb.png',
typeId: 2
},
],
},
pageList: []
}
},
computed: {// data
...mapGetters({
reloading: 'shouldReLoadingList'
})
},
methods: {//
...mapMutations(['shouldReLoadingList']),
selectDate(dayIndex, dayValue) {
this.dateIndex = dayIndex
if (dayValue !== 0) {
this.searchTime = this.popData.dateList[this.dateIndex].value
}
this.$forceUpdate()
},
/**
* 日期缓存刷新
* @param {Object} e
* @param {Object} index
*/
bindDateChange(e, index) {
this.searchTime[index] = e.detail.value
this.$forceUpdate()
},
/**
* 查询数据稽查数据
*/
searchList() {
uni.showLoading({
title: '正在加载'
})
this.pageData.isLoading = true
this.pageData.isEnd = false
this.pageData.pageIndex = 1
this.getList()
uni.pageScrollTo({
scrollTop: 0,
duration: 300
})
},
/**
* 调用接口获取
*
* Api接口地址EShangApiMain/AutoTest/GetServerpartshopTotalSummary
*/
getList() {
this.$request.$webGet("EShangApiMain/AutoTest/GetServerpartshopTotalSummary", {
BUSINESS_TYPE: this.activeType === -1 ? '' : this.activeType,
TRANSFER_TYPE: this.selectTypeIndex === -1 ? '' : this.selectTypeIndex,
pageIndex: this.pageData.pageIndex,
pageSize: this.pageData.pageSize,
}).then(res => {
if (!res.Result_Code || res.Result_Code != 100) {
this.pageData.isLoading = false
this.pageList = []
} else {
//
let list = res.Result_Data.List.filter(p => {
//if (this.activeType == 1) {
//return p.CHECKACCOUNT_DESC.length == 0
//} else if (this.activeType == 2) {
//return p.CHECKACCOUNT_DESC.length > 0
//} else {
return true
//}
})
if (list.length > 0) {
if (this.pageData.pageIndex == 1) {
this.pageList = list
} else {
this.pageList = [...this.pageList, ...list]
}
}
if (list.length < this.pageData.pageSize) { //
this.pageData.isEnd = true
}
this.$forceUpdate()
}
uni.hideLoading()
let _this = this
setTimeout(function() {
_this.pageData.isLoading = false
}, 500)
})
},
/**
* 加载下一页
*/
loadMore() {
if (!this.pageData.isEnd) {
this.pageData.pageIndex += 1
this.getList()
}
},
/**
* 绑定信息卡片点击跳转页面
* @param {Object} item
*/
goDetail(item) {
this.$util.toNextRoute('navigateTo', '/pages/autoTest/serverpartshoptotalsummary/detail?BUSINESS_BRAND=' + item.BUSINESS_BRAND + '&BUSINESS_TRADE=' + item.BUSINESS_TRADE + '&OWNERUNIT_ID=' + item.OWNERUNIT_ID)
},
reloadList() {
this.showPop = false
this.pageData.pageIndex = 1
uni.showLoading({
title: '正在加载'
})
this.pageData.isLoading = true
this.pageData.isEnd = false
this.pageList = []
this.getList()
this.$forceUpdate()
},
closePop() {
this.showPop = false
},
handleClick(item) {//
if (item.id == 99) {// id=99
this.showPop = true
} else {
this.activeType = item.id
this.reloadList()
}
},
bindPartChange(item) {
this.selectTypeIndex = item.typeId
},
},
onPullDownRefresh() {
uni.showLoading({
title: '正在加载'
})
this.pageData.pageIndex = 1
this.pageData.isLoading = true
this.pageData.isEnd = false
this.getList()
setTimeout(function() {
uni.stopPullDownRefresh()
}, 1000)
},
//
onReachBottom() {
//
this.loadMore()
},
//
onShow() {
let _this = this
if (this.reloading) {
uni.showLoading({
title: '正在加载'
})
this.pageData.isLoading = true
this.pageData.pageIndex = 1
this.pageData.isEnd = false
this.getList()
this.shouldReLoadingList(false)
}
},
//
onLoad() {
uni.showLoading({
title: '正在加载'
})
this.pageData.isLoading = true
this.getList()
},
//
onUnload() {
this.$util.addUserBehavior()
},
}
</script>
<style scoped>
.menu-list {//
width: 100%;
background-color: #fff;
flex-wrap: wrap;
}
.moduleTitle {
text-align: left;
margin: 16rpx 0 0 24rpx;
font-weight: 700;
font-size: 30rpx;
padding: 24rpx 0 12rpx 0;
}
.popbtn {
width: 639rpx;
height: 80rpx;
line-height: 80rpx;
color: #fff;
font-size: 28rpx;
background: #5b96e9;
border-radius: 8rpx;
margin: 48rpx auto 24rpx auto;
}
.screen-box {
background-color: #fff;
padding: 0 0rpx;
position: sticky;
top: 0;
z-index: 1;
}
.screen-box .screen-unit {
display: flex;
align-items: center;
width: auto;
padding: 0 0rpx;
line-height: 3;
}
.screen-box text {
line-height: 3;
}
.tag-item {
width: 150rpx;
height: 66rpx;
background: #ffffff;
border: 1rpx solid #efefef;
border-radius: 8rpx;
color: #808D97;
font-size: 24rpx;
text-align: center;
line-height: 64rpx;
margin: 24rpx 0 24rpx 24rpx;
}
.tag-item.actived {
background: #e8f3fd;
border: 1rpx solid #e8f3fd;
color: #4D95F0;
}
.padding-bottom {
padding-bottom: 24rpx;
}
.round {
border-radius: 50%;
}
.menu {
text-align: center;
min-width: 185rpx;
padding: 24rpx 0;
}
.menuName {
color: #120E2B;
font-size: 24rpx;
text-align: center;
margin-top: 16rpx;
}
.menu-image {
padding: 12rpx 8rpx;
height: 80rpx;
box-sizing: border-box;
margin: 0 auto;
text-align: center;
}
.menu-image image {
max-width: 100%;
max-height: 100%;
}
</style>

View File

@ -0,0 +1,119 @@
<template>
<view class="card cardBorder" @tap='goDetail' v-if="item">
<!-- 卡片第一行数据 -->
<view class="uni-flex jc-between">
<!-- 左侧 -->
<!-- 门店简称 -->
<p class="contentName">{{item.SHOPSHORTNAME || ''}}</p>
<!-- 右侧 -->
<!-- 行业名称 -->
<text class="typeText">{{item.SHOPTRADE !== null ?
businesstype[item.SHOPTRADE] : ''}}</text>
</view>
<!-- 卡片第一行角标 -->
<view class="content-index" style="background-color:#FB8B56">{{i+1}}</view>
<!-- 卡片第二行数据 -->
<view class="uni-flex jc-between">
<!-- 左侧 -->
<!-- 服务区名称 -->
<text class="content-type-text">{{item.SERVERPART_NAME || ''}}</text>
<!-- 右侧 -->
<!-- 服务区内码 -->
<text class="content-type-text">{{item.SERVERPART_ID || ''}}</text>
</view>
<!-- 卡片第三行数据 -->
<view class="uni-flex content-box-cashpay">
<!-- 中间 -->
<!-- 移动支付金额 -->
<text class="content-price">{{item.FACT_AMOUNT != null ? item.FACT_AMOUNT : ''}}</text>
<!-- 右侧 -->
<!-- 服务区编码 -->
<text class="other-coast">{{item.SERVERPART_CODE || ''}}</text>
</view>
<!-- 分割线 -->
<view class="bb1"></view>
<!-- 卡片第四行顶部数据 -->
<view class="uni-flex jc-between align-center" v-if="item.TICKETBILL">
<!-- 左侧 -->
<view class="uni-flex align-top">
<!-- 微信支付 -->
<!-- 圆点 -->
<text class="G-icon A-icon"></text>
<span class="content-span">微信支付{{item.TICKETBILL || ''}}</span>
</view>
</view>
<!-- 卡片第四行中间数据 -->
<view class="uni-flex jc-between" v-if="item.OTHERPAY">
<!-- 左侧 -->
<view class="uni-flex align-top">
<!-- 其他支付(支付宝) -->
<!-- 圆点 -->
<p class="B-icon A-icon"></p>
<span class="content-span">支付宝{{item.OTHERPAY || ''}}</span>
</view>
</view>
<!-- 卡片第四行底部数据 -->
<view class="uni-flex jc-between" v-if="item.SALE_CORRECT">
<!-- 左侧 -->
<view class="uni-flex align-top">
<!-- 到账实差 -->
<!-- 圆点 -->
<p class="G-icon A-icon"></p>
<span class="content-span">到账实差{{item.SALE_CORRECT || ''}}</span>
</view>
</view>
</view>
</template>
<script>
export default {
props: {//
item: {
type: Object,
required: true
},
i: {
type: Number,
required: true
},
businesstype: {
type: Object,
required: false
},
},
data() {//
return {
}
},
computed: {},
methods: {//
goDetail() {
this.$emit('goDetail', this.item)
},
dateEmpty(v) {
return this.$util.cutDate(v, 'YYYY/MM/DD')
},
},
}
</script>
<!-- 注意style样式增加scoped私有属性标记后组件样式不能在引用的地方进行修改 -->
<style scoped>
@import url('/common/css/listUnit.css');
.cardBorder {//
box-shadow: 0 0px 6rpx #E2E2E2;
}
.content-box-cashpay {
position: relative;
}
.other-coast {//
color: #D1A271;
background: linear-gradient(to top, #EBDDCF, #FCFBF8);
border-radius: 6rpx;
font-size: 20rpx;
padding: 0 10rpx;
margin-left: 16rpx;
margin-top: 3rpx;
position: absolute;
right: 0rpx;
bottom: 30rpx;
}
</style>

View File

@ -0,0 +1,191 @@
<template>
<view class="page-body">
<!-- 顶部信息卡片 -->
<view class="card-header">
<!-- 顶部信息卡片第一行 -->
<view class="uni-flex ai-center jc-between fs12">
<!-- 左侧 -->
<span>门店简称{{dataDetail.SHOPSHORTNAME || ''}}</span>
<!-- 右侧 -->
<span>行业名称{{dataDetail.SHOPTRADE !== null ?
businesstype[dataDetail.SHOPTRADE] : ''}}</span>
</view>
<!-- 顶部信息卡片第二行 -->
<view class="uni-flex ai-center jc-between fs12">
<!-- 左侧 -->
<span>服务区名称{{dataDetail.SERVERPART_NAME || ''}}</span>
<!-- 右侧 -->
<span>移动支付金额{{dataDetail.FACT_AMOUNT || ''}}</span>
</view>
</view>
<!-- 详情信息 -->
<view class="modle-title">
<h2>门店移动支付汇总</h2>
</view>
<!-- 详情信息卡片 -->
<view class="content-detail-box main-card ino-flex ai-center uni-column">
<!-- 单列样式 -->
<!-- 服务区名称 -->
<view class="cellTopStyle">
<span class="fourth-name">服务区名称</span>
<span>{{dataDetail.SERVERPART_NAME || ''}}</span>
</view>
<!-- 行业名称 -->
<view class="cellTopStyle">
<span class="fourth-name">行业名称</span>
<span>{{dataDetail.SHOPTRADE !== null ?
businesstype[dataDetail.SHOPTRADE] : ''}}</span>
</view>
<!-- 服务区编码 -->
<view class="cellTopStyle">
<span class="fourth-name">服务区编码</span>
<span>{{dataDetail.SERVERPART_CODE || ''}}</span>
</view>
<!-- 门店简称 -->
<view class="cellTopStyle">
<span class="fourth-name">门店简称</span>
<span>{{dataDetail.SHOPSHORTNAME || ''}}</span>
</view>
<!-- 微信支付 -->
<view class="cellTopStyle">
<span class="fourth-name">微信支付</span>
<span>{{dataDetail.TICKETBILL !== null ?
dataDetail.TICKETBILL : ''}}</span>
</view>
<!-- 其他支付(支付宝) -->
<view class="cellTopStyle">
<span class="fourth-name">其他支付</span>
<span>{{dataDetail.OTHERPAY !== null ?
dataDetail.OTHERPAY : ''}}</span>
</view>
<!-- 移动支付金额 -->
<view class="cellTopStyle">
<span class="fourth-name">移动支付金额</span>
<span>{{dataDetail.FACT_AMOUNT !== null ?
dataDetail.FACT_AMOUNT : ''}}</span>
</view>
<!-- 到账实差 -->
<view class="cellTopStyle">
<span class="fourth-name">到账实差</span>
<span>{{dataDetail.SALE_CORRECT !== null ?
dataDetail.SALE_CORRECT : ''}}</span>
</view>
</view>
</view>
</template>
<script>
import {mapGetters,mapMutations} from 'vuex'
export default {
data() {
return {
pageData: {
type: null,
id: null
},
loading: true,
businesstype: null,
dataDetail: {},
}
},
methods: {
...mapMutations(['shouldReLoadingList']),
/**
* 调用接口获取数据详情
*
* Api接口地址EShangApiMain/AutoTest/GetShopMobileSummary
*/
getDetail(option) {
this.$request.$webGet("EShangApiMain/AutoTest/GetShopMobileSummary", {
//
SearchStatisticsStartDate: option.SearchStatisticsStartDate,
SearchStatisticsEndDate: option.SearchStatisticsEndDate,
SHOPSHORTNAME: option.SHOPSHORTNAME,
SERVERPART_ID: option.SERVERPART_ID,
})
.then(res => {
uni.hideLoading()
this.loading = false
if (res.Result_Code !== 100) {
return
}
this.dataDetail = res.Result_Data.List.length > 0 ? res.Result_Data.List[0] : null
})
},
//
async getType() {
this.businesstype = await this.$util.getFieldEnumByField({
FieldExplainField: 'BUSINESSTYPE'
})
}
},
onLoad(option) {
uni.showLoading()
this.pageData = option
this.loading = true
this.getType()
this.getDetail(option)
this.$forceUpdate()
}
}
</script>
<style scoped>
.page-body {
min-height: 100%;
padding: 40rpx 25rpx;
background-color: #fff;
box-sizing: border-box;
padding-bottom: 196rpx;
}
.card-header {
border-radius: 10rpx;
margin: 0 26rpx 22rpx 26rpx;
background: linear-gradient(to right, #8998bb 0%, #a9b5d2 100%);
color: #FFFFFF;
padding: 24rpx 16rpx;
}
.card-header h3 {
padding-bottom: 10rpx;
font-size: 30rpx;
}
.card-header .fs12>text {
font-size: 24rpx;
}
.cellTopStyle {
line-height: 45rpx;
width: 100%;
display: flex;
align-items: center; //
justify-content: space-between; //
}
.fourth-name {
min-width: 120rpx;
max-width: 140rpx;
color: #ADB2BF;
font-size: 26rpx;
white-space: nowrap;
}
.modle-title {
color: #000;
padding: 36rpx 30rpx 24rpx 30rpx;
font-size: 26rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.modle-title h2 {
font-weight: bolder;
}
.content-detail-box {
margin: 0 26rpx 22rpx 26rpx;
background: #ffffff;
border-radius: 8rpx;
box-shadow: 0rpx 2rpx 8rpx 0rpx rgba(231, 231, 231, 0.67);
overflow: hidden;
position: relative;
padding: 10rpx 30rpx 16rpx 30rpx;
font-size: 26rpx;
}
.content-detail-box span {
font-size: 26rpx;
}
</style>

View File

@ -0,0 +1,451 @@
<template>
<view class="content">
<!-- 顶部筛选菜单 -->
<view class="uni-flex ai-center screen-box menu-list">
<view class="menu" v-for="(item,index) in menuList" :key="index" @click="handleClick(item)">
<view class="menu-image round" style="height:75rpx;width:75rpx;padding: 18rpx;"
:style="activeType==item.id ? 'background:#f0f7fe;' : 'background:#f6f7f8;'">
<image :src="activeType==item.id? item.active: item.src" mode="aspectFit" style="height:100%;"></image>
</view>
<view class="menuName" :style="activeType==item.id ? 'color:#5B96E9' :'color:#808D97'">{{item.name}}</view>
</view>
</view>
<!-- 数据卡片列表 -->
<view v-if="pageList.length>0">
<list-unit v-for="(item,index) in pageList" :key="index" :item="item" :i="index"
:businesstype="businesstype"
@goDetail="goDetail"></list-unit>
</view>
<!-- 无数据时的页面显示 -->
<view v-else-if="pageData.isLoading===false">
<noFound :nodata="pageList.length>0 ? false : true" :text="searchTime[0]+'至'+searchTime[1]+'无数据,'">
<text name="other">请选择其它日期进行查询</text>
</noFound>
</view>
<!-- 底部提示 -->
<view class="load-more" v-if="pageList.length>0">
<text>{{!pageData.isEnd ? '正在加载,请稍后...':'——— 我是有底线的 ———'}}</text>
</view>
<!-- 更多筛选的弹窗 -->
<UniPop :show="showPop" @hidePopup="closePop" type="bottom" @touchmove.prevent round="true">
<view class="padding-bottom">
<!-- 日期选项 -->
<view class="moduleTitle">{{popData.dateName}}</view>
<!-- 固定日期选项 -->
<view class="uni-flex align-center">
<view v-for="(d,index) in popData.dateList" :key="index" @click="selectDate(index,d.value)" class="tag-item"
:class="{'actived':dateIndex==index}">{{d.name}}</view>
</view>
<!-- 自定义日期选项 -->
<view class="uni-flex align-center screen-box" style="justify-content: space-between; margin: 0 120rpx;" v-if="popData.dateList[dateIndex].value==0">
<picker mode="date" @change="bindDateChange($event,0)" :value="searchTime[0]"
:end="pageData.endDate" start="2019/12/01" class="screen-unit">
<text>{{searchTime[0]}}</text>
<!-- <image src="/static/images/tab_down.png" mode="aspectFit"></image> -->
</picker>
<text class="mr20"></text>
<picker mode="date" @change="bindDateChange($event,1)" :value="searchTime[1]"
:end="pageData.endDate" start="2019/12/01" class="screen-unit">
<text>{{searchTime[1]}}</text>
<!-- <image src="/static/images/tab_down.png" mode="aspectFit"></image> -->
</picker>
</view>
<!-- 其他选项 -->
<view class="moduleTitle">{{popData.typeName}}</view>
<view class="uni-flex ai-center menu-list">
<view class="menu" v-for="(item,index) in popData.selectList" :key="index" @click="bindPartChange(item)">
<view class="menu-image round" style="height:74rpx;width:74rpx;border-radius:20rpx;line-height:74rpx;"
:style="'background:' + (popData.colors[index] ? popData.colors[index] : popData.colors[index-popData.colors.length]) + ';'">
<image :src="activeType==item.id ? item.active: item.src" mode="aspectFit" style="height:100%;"></image>
</view>
<view class="menuName" :style="selectTypeIndex==item.typeId ?
'color:' + (popData.colors[index]? popData.colors[index] :
popData.colors[index % 7]) : 'color:#120E2B'">{{item.name}}</view>
</view>
</view>
<view class="popbtn" @click="reloadList">确定</view>
</view>
</UniPop>
</view>
</template>
<script>
import {mapGetters,mapMutations} from 'vuex'
//
import ListUnit from "./components/listUnit.vue"
//
import UniPop from '@/components/uni-popup.vue'
export default {
components: {//import使
ListUnit,
UniPop
},
data() {//
const today = this.$util.cutDate(new Date(), 'YYYY/MM/DD')
const week = this.$util.cutDate(new Date(),'YYYY/MM/DD',-6)
const month = this.$util.cutDate(new Date(),'YYYY/MM/DD',-30)
const threeMonth = this.$util.cutDate(new Date(),'YYYY/MM/DD',-90)
return {
activeType: -1,//
selectTypeIndex: -1,//
dateIndex: 0, //
showPop: false,
searchTime: [week, today],
businesstype: null,
pageData: {
pageIndex: 1,
pageSize: 10,
isEnd: false,
isLoading: true,
endDate: today
},
menuList: [ //
{
name: '全部',
src: '/static/images/expense/type/yifq.png',
active: '/static/images/expense/type/yifqz.png',
id: -1
},
{
name: '商超',
src: '/static/images/expense/type/yifq.png',
active: '/static/images/expense/type/yifqz.png',
id: 1000
},
{
name: '小吃',
src: '/static/images/expense/type/yifq.png',
active: '/static/images/expense/type/yifqz.png',
id: 2000
},
{
name: '更多筛选',
src: '/static/images/expense/type/shaix.png',
active: '/static/images/expense/type/shaixz.png',
id: 99
},
],
popData:{
//
colors: ['#5B96E9', '#F0A038', '#5B96E9', '#57BAAE', '#D9675C', '#5B96E9', '#57BAAE'],
//
dateName:"日期",
//
dateList: [//
{
name: '近七天',
value: [week,today]
},
{
name: '近一月',
value: [month,today]
},
{
name: '近三月',
value: [threeMonth,today]
},
{
name: '自定义',
value: 0
},
],
typeName:"行业名称",
selectList: [//
{
name: '全部',
src: '/static/images/expense/type/qb.png',
typeId: -1
},
{
name: '特产',
src: '/static/images/expense/type/qb.png',
typeId: 1002
},
{
name: '箱包',
src: '/static/images/expense/type/qb.png',
typeId: 1004
},
{
name: '便利店',
src: '/static/images/expense/type/qb.png',
typeId: 1005
},
{
name: '水果报刊音像',
src: '/static/images/expense/type/qb.png',
typeId: 1006
},
],
},
pageList: []
}
},
computed: {// data
...mapGetters({
reloading: 'shouldReLoadingList'
})
},
methods: {//
...mapMutations(['shouldReLoadingList']),
selectDate(dayIndex, dayValue) {
this.dateIndex = dayIndex
if (dayValue !== 0) {
this.searchTime = this.popData.dateList[this.dateIndex].value
}
this.$forceUpdate()
},
/**
* 日期缓存刷新
* @param {Object} e
* @param {Object} index
*/
bindDateChange(e, index) {
this.searchTime[index] = e.detail.value
this.$forceUpdate()
},
/**
* 查询数据稽查数据
*/
searchList() {
uni.showLoading({
title: '正在加载'
})
this.pageData.isLoading = true
this.pageData.isEnd = false
this.pageData.pageIndex = 1
this.getList()
uni.pageScrollTo({
scrollTop: 0,
duration: 300
})
},
/**
* 调用接口获取
*
* Api接口地址EShangApiMain/AutoTest/GetShopMobileSummary
*/
getList() {
this.$request.$webGet("EShangApiMain/AutoTest/GetShopMobileSummary", {
SHOPTRADE: this.activeType === -1 ? '' : this.activeType,
SearchStatisticsStartDate: this.searchTime[0],
SearchStatisticsEndDate: this.searchTime[1],
SHOPTRADE: this.selectTypeIndex === -1 ? '' : this.selectTypeIndex,
pageIndex: this.pageData.pageIndex,
pageSize: this.pageData.pageSize,
}).then(res => {
if (!res.Result_Code || res.Result_Code != 100) {
this.pageData.isLoading = false
this.pageList = []
} else {
//
let list = res.Result_Data.List.filter(p => {
//if (this.activeType == 1) {
//return p.CHECKACCOUNT_DESC.length == 0
//} else if (this.activeType == 2) {
//return p.CHECKACCOUNT_DESC.length > 0
//} else {
return true
//}
})
if (list.length > 0) {
if (this.pageData.pageIndex == 1) {
this.pageList = list
} else {
this.pageList = [...this.pageList, ...list]
}
}
if (list.length < this.pageData.pageSize) { //
this.pageData.isEnd = true
}
this.$forceUpdate()
}
uni.hideLoading()
let _this = this
setTimeout(function() {
_this.pageData.isLoading = false
}, 500)
})
},
/**
* 加载下一页
*/
loadMore() {
if (!this.pageData.isEnd) {
this.pageData.pageIndex += 1
this.getList()
}
},
/**
* 绑定信息卡片点击跳转页面
* @param {Object} item
*/
goDetail(item) {
this.$util.toNextRoute('navigateTo', '/pages/autoTest/shopmobilesummary/detail?SHOPSHORTNAME=' +
item.SHOPSHORTNAME + '&SERVERPART_ID=' + item.SERVERPART_ID + '&SearchStatisticsStartDate=' +
this.searchTime[0] + '&SearchStatisticsEndDate=' + this.searchTime[1])
},
reloadList() {
this.showPop = false
this.pageData.pageIndex = 1
uni.showLoading({
title: '正在加载'
})
this.pageData.isLoading = true
this.pageData.isEnd = false
this.pageList = []
this.getList()
this.$forceUpdate()
},
closePop() {
this.showPop = false
},
handleClick(item) {//
if (item.id == 99) {// id=99
this.showPop = true
} else {
this.activeType = item.id
this.reloadList()
}
},
bindPartChange(item) {
this.selectTypeIndex = item.typeId
},
//
async getType() {
this.businesstype = await this.$util.getFieldEnumByField({
FieldExplainField: 'BUSINESSTYPE'
})
}
},
onPullDownRefresh() {
uni.showLoading({
title: '正在加载'
})
this.pageData.pageIndex = 1
this.pageData.isLoading = true
this.pageData.isEnd = false
this.getList()
setTimeout(function() {
uni.stopPullDownRefresh()
}, 1000)
},
//
onReachBottom() {
//
this.loadMore()
},
//
onShow() {
let _this = this
if (this.reloading) {
uni.showLoading({
title: '正在加载'
})
this.pageData.isLoading = true
this.pageData.pageIndex = 1
this.pageData.isEnd = false
this.getList()
this.shouldReLoadingList(false)
}
},
//
onLoad() {
uni.showLoading({
title: '正在加载'
})
this.pageData.isLoading = true
this.getList()
this.getType()
},
//
onUnload() {
this.$util.addUserBehavior()
},
}
</script>
<style scoped>
.menu-list {//
width: 100%;
background-color: #fff;
flex-wrap: wrap;
}
.moduleTitle {
text-align: left;
margin: 16rpx 0 0 24rpx;
font-weight: 700;
font-size: 30rpx;
padding: 24rpx 0 12rpx 0;
}
.popbtn {
width: 639rpx;
height: 80rpx;
line-height: 80rpx;
color: #fff;
font-size: 28rpx;
background: #5b96e9;
border-radius: 8rpx;
margin: 48rpx auto 24rpx auto;
}
.screen-box {
background-color: #fff;
padding: 0 0rpx;
position: sticky;
top: 0;
z-index: 1;
}
.screen-box .screen-unit {
display: flex;
align-items: center;
width: auto;
padding: 0 0rpx;
line-height: 3;
}
.screen-box text {
line-height: 3;
}
.tag-item {
width: 150rpx;
height: 66rpx;
background: #ffffff;
border: 1rpx solid #efefef;
border-radius: 8rpx;
color: #808D97;
font-size: 24rpx;
text-align: center;
line-height: 64rpx;
margin: 24rpx 0 24rpx 24rpx;
}
.tag-item.actived {
background: #e8f3fd;
border: 1rpx solid #e8f3fd;
color: #4D95F0;
}
.padding-bottom {
padding-bottom: 24rpx;
}
.round {
border-radius: 50%;
}
.menu {
text-align: center;
min-width: 185rpx;
padding: 24rpx 0;
}
.menuName {
color: #120E2B;
font-size: 24rpx;
text-align: center;
margin-top: 16rpx;
}
.menu-image {
padding: 12rpx 8rpx;
height: 80rpx;
box-sizing: border-box;
margin: 0 auto;
text-align: center;
}
.menu-image image {
max-width: 100%;
max-height: 100%;
}
</style>

View File

@ -96,6 +96,14 @@ const scene = [{
"imagePath": "/static/images/index/syjh.png", "imagePath": "/static/images/index/syjh.png",
"noImagePath": "/static/images/index/syjh-no.png", "noImagePath": "/static/images/index/syjh-no.png",
"homeUrl": "/pages/cashAudit/list" "homeUrl": "/pages/cashAudit/list"
},
{
"name": "稽核异常",
"id": "b548740f-a942-4de3-8d55-c0a2370171ba",
"modelName": "abnormalaudit",
"imagePath": "/static/images/index/syjh.png",
"noImagePath": "/static/images/index/syjh-no.png",
"homeUrl": "/pages/abnormalaudit/index"
}, { }, {
"name": "设备巡检", "name": "设备巡检",
"id": "", "id": "",

View File

@ -7,7 +7,7 @@
:key="item.id" :key="item.id"
:item ="item" :item ="item"
:doCout="toDoMsg ? toDoMsg[item.id] : 0" :doCout="toDoMsg ? toDoMsg[item.id] : 0"
:active="item.id==1 || menus[item.id]==1" :active="item.id=='d5a9e3ef-3699-448f-abcc-819179df60bd' || menus[item.id]==1 || this.membershipType === 9999"
@handleClick="toPage" @handleClick="toPage"
></menuItem> ></menuItem>
@ -126,8 +126,8 @@
export default { export default {
data() { data() {
return { return {
modelMenu: modelMenu, modelMenu: null,
membershipType: null
} }
}, },
components:{ components:{
@ -135,7 +135,7 @@
menuItem menuItem
}, },
onLoad() { onLoad() {
this.loadMenuSetting()
}, },
computed: { computed: {
...mapState({ ...mapState({
@ -144,7 +144,8 @@
UserId: state.userData.UserId, UserId: state.userData.UserId,
UserName: state.userData.UserName, UserName: state.userData.UserName,
Membership_Phone: state.userData.Membership_Phone, Membership_Phone: state.userData.Membership_Phone,
Membership_Id: state.userData.Membership_Id Membership_Id: state.userData.Membership_Id,
Membership_Type: state.userData.Membership_Type
} }
}, },
toDoMsg: (state)=>{ toDoMsg: (state)=>{
@ -175,14 +176,13 @@
_this.$util.toNextRoute('navigateTo', "/pages/mbwa/mbwaUpload?mbwaID=" + mbwaId) _this.$util.toNextRoute('navigateTo', "/pages/mbwa/mbwaUpload?mbwaID=" + mbwaId)
} else if (res.result.indexOf("http") > -1) { } else if (res.result.indexOf("http") > -1) {
_this.$util.toNextRoute('navigateTo', "/pages/webview/webview?src=" + encodeURIComponent(res.result)) _this.$util.toNextRoute('navigateTo', "/pages/webview/webview?src=" +
encodeURIComponent(res.result))
} else { } else {
let invoice = res.result.split(",") let invoice = res.result.split(",")
// console.log(invoice.length) // console.log(invoice.length)
if (invoice.length == 9) { if (invoice.length == 9) {
_this.$util.toNextRoute('navigateTo', "/pages/invoice/invoice?invoice=" + invoice) _this.$util.toNextRoute('navigateTo', "/pages/invoice/invoice?invoice=" + invoice)
} else { } else {
uni.showModal({ uni.showModal({
title: "温馨提示", title: "温馨提示",
@ -194,7 +194,6 @@
} }
} else if (res.scanType.indexOf("EAN_13") > -1) { } else if (res.scanType.indexOf("EAN_13") > -1) {
this.$util.toNextRoute('navigateTo', "/pages/commodtity/commodtity?commodtity=" + res.result) this.$util.toNextRoute('navigateTo', "/pages/commodtity/commodtity?commodtity=" + res.result)
} else { } else {
uni.showModal({ uni.showModal({
title: "温馨提示", title: "温馨提示",
@ -210,15 +209,14 @@
recordBrowsing(item) { // recordBrowsing(item) { //
let _this = this let _this = this
if (!item.id) { if (!item.id) {
uni.showModal({ uni.showModal({
title: ' 温馨提示', title: ' 温馨提示',
content: '该模块正在开发,尽请期待', content: '该模块正在开发,尽请期待',
}) })
} else if (_this.menus && _this.menus[item.id] == 1) { // 访 } else if (_this.menus && (_this.menus[item.id] == 1 ||
this.user.Membership_Type === 9999)) { // 访
this.$util.toNextRoute('navigateTo', item.homeUrl) this.$util.toNextRoute('navigateTo', item.homeUrl)
} else { } else if (this.user.Membership_Type !== 9999) {
uni.showToast({ uni.showToast({
title: '您没有该模块权限', title: '您没有该模块权限',
icon: 'none' icon: 'none'
@ -236,16 +234,12 @@
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
_this.$util.toNextRoute('navigateTo', '/pages/register/register') _this.$util.toNextRoute('navigateTo', '/pages/register/register')
} }
} }
}) })
}else if(item.id==1) { // }else if(item.id=='d5a9e3ef-3699-448f-abcc-819179df60bd') { //
this.scanCode() this.scanCode()
} else if (this.user.UserId == '') { } else if (this.user.UserId == '') {
uni.showModal({ uni.showModal({
title: ' 温馨提示', title: ' 温馨提示',
@ -253,33 +247,35 @@
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
_this.$util.toNextRoute('navigateTo', '/pages/bindingBack/bindingBack') _this.$util.toNextRoute('navigateTo', '/pages/bindingBack/bindingBack')
} }
} }
}) })
} else { } else {
this.recordBrowsing(item) this.recordBrowsing(item)
} }
}, },
async loadMenuSetting(){ //
this.membershipType = this.user.Membership_Type
let res = await this.$request.$webGet("EShangApiMain/APPManage/GetWeChatAppletMenuList",{
ModuleStatus: this.membershipType === 9999 ? '1,2' : '1',
AppletMenuStatus: this.membershipType === 9999 ? '1,2' : '1'
})
this.modelMenu = res.Result_Data.List
}
}, },
onReady() { onReady() {
}, },
onShow() { onShow() {
}, },
onPullDownRefresh() { onPullDownRefresh() {
let _this = this let _this = this
this.updateUser() this.updateUser()
this.loadMenuSetting()
setTimeout(function() { setTimeout(function() {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}, 1000) }, 1000)
}, },
onTabItemTap(e) { onTabItemTap(e) {
this.$util.addUserBehavior({ this.$util.addUserBehavior({
outtoRoute: '/pages/index/index', outtoRoute: '/pages/index/index',
intoRoute: '/pages/userCenter/userCenter' intoRoute: '/pages/userCenter/userCenter'
@ -287,7 +283,6 @@
} }
} }
</script> </script>
<style scoped> <style scoped>
.line-block { .line-block {
border-top: 13rpx solid #F5F5F5; border-top: 13rpx solid #F5F5F5;

View File

@ -1,15 +1,15 @@
import Store from '../store/store' import Store from '../store/store'
const publicOptions = (() => { // 获取本机的信息 const publicOptions = (() => { // 获取本机的信息
let systemInfo= uni.getSystemInfoSync() let systemInfo = uni.getSystemInfoSync()
return { return {
APPGuid: "9880519c-351d-4a05-b6ef-80db0286a7ab", APPGuid: "9880519c-351d-4a05-b6ef-80db0286a7ab",
SourcePlatform: 'minProgram', // 客户端平台 SourcePlatform: 'minProgram', // 客户端平台
brand: systemInfo.brand ||'', // 设备名称 brand: systemInfo.brand || '', // 设备名称
model: encodeURIComponent(systemInfo.model), // 机型 model: encodeURIComponent(systemInfo.model), // 机型
os_version: systemInfo.system, // 安卓版本号 os_version: systemInfo.system, // 安卓版本号
} }
})() })()
export default { export default {
/** /**
@ -28,12 +28,13 @@ export default {
// console.log(Store.state.userData) // console.log(Store.state.userData)
data.provinceCode = Store.state.userData.ProvinceCode || '330000' // 如果用户没有省份编码信息,则默认浙江省 data.provinceCode = Store.state.userData.ProvinceCode || '330000' // 如果用户没有省份编码信息,则默认浙江省
data.time = (new Date()).getTime() data.time = (new Date()).getTime()
data = Object.assign(data,publicOptions); data = Object.assign(data, publicOptions);
data.WeChat_AppId = 'wxa99ef047735c031e' data.WeChat_AppId = 'wxa99ef047735c031e'
data.WeChat_MiniProToken = Store.state.userData.WeChat_MiniProToken || '' data.WeChat_MiniProToken = Store.state.userData.WeChat_MiniProToken || ''
data.WeChatAppId = 'wxa99ef047735c031e' data.WeChatAppId = 'wxa99ef047735c031e'
data.memberShipId = !data.memberShipId ? (Store.state.userData.Membership_Id || '') : data.memberShipId // ||'3255' 1170386 1125717 // data.memberShipId = !data.memberShipId ? (Store.state.userData.Membership_Id || '') :
data.memberShipId // ||'3255' 1170386 1125717 //
let requstOptions = { let requstOptions = {
@ -42,7 +43,7 @@ export default {
method: method, method: method,
} }
if(method=='POST' && !isWebApi){ if (method == 'POST' && !isWebApi) {
requstOptions.header = { requstOptions.header = {
'content-type': 'application/x-www-form-urlencoded;charset=utf-8' 'content-type': 'application/x-www-form-urlencoded;charset=utf-8'
} }
@ -51,18 +52,21 @@ export default {
//服务器返回数据 //服务器返回数据
if (res && (res.statusCode === 200 || res.statusCode === 304 || res.statusCode === 400)) { if (res && (res.statusCode === 200 || res.statusCode === 304 || res.statusCode === 400)) {
if (res.data && ((res.data.ResultCode != '999' && res.data.ResultCode != undefined) ||
if (res.data && ((res.data.ResultCode!='999' && res.data.ResultCode!=undefined) || (res.data.Result_Code!='999' && res.data.Result_Code!=undefined) )) { (res.data.Result_Code != '999' && res.data.Result_Code != undefined))) {
resolve(res.data); resolve(res.data);
}else if(typeof res.data == 'object'){ // 兼容招标投标模块 } else if (typeof res.data == 'object') { // 兼容招标投标模块
resolve(res.data); resolve(res.data);
console.log('错误:'+(res.data.Result_Code || res.data.ResultCode)+',' +(res.data.Result_Desc|| res.data.ResultDesc)) console.log('错误:' + (res.data.Result_Code || res.data.ResultCode) + ',' +
} (res.data.Result_Desc || res.data.ResultDesc))
else{ } else {
resolve({ResultCode:999,Result_Code:999}); resolve({
ResultCode: 999,
Result_Code: 999
});
uni.showToast({ uni.showToast({
title: res.data || '服务器错误,请稍后重试', title: res.data || '服务器错误,请稍后重试',
icon:'none' icon: 'none'
}) })
} }
} else { } else {
@ -72,7 +76,7 @@ export default {
// reject("服务器错误,请稍后重试"); // reject("服务器错误,请稍后重试");
} }
} }
requstOptions.fail = (e)=>{ requstOptions.fail = (e) => {
resolve({ resolve({
data: { data: {
error: '网络连接失败,请重试' error: '网络连接失败,请重试'
@ -80,7 +84,7 @@ export default {
}); });
reject('网络连接失败,请重试'); reject('网络连接失败,请重试');
} }
requstOptions.complete = ()=> { requstOptions.complete = () => {
Store.state.isLoading = false Store.state.isLoading = false
} }
//网络请求 //网络请求

View File

@ -5,10 +5,10 @@ export default {
// baseURL: 'https://tcm.eshangtech.com/Coop.Merchant/Handler/handler_ajax.ashx', // 合作商户请求 // baseURL: 'https://tcm.eshangtech.com/Coop.Merchant/Handler/handler_ajax.ashx', // 合作商户请求
mpUrl: 'https://mp.eshangtech.com/Coop.Merchant/Handler/handler_ajax.ashx', // 接口 mpUrl: 'https://mp.eshangtech.com/Coop.Merchant/Handler/handler_ajax.ashx', // 接口
apiurl: 'https://api.eshangtech.com/', // web api/WeChatPushAPI/ apiurl: 'https://api.eshangtech.com/', // web api正式接口地址
// EshangUrl: 'https://eshangtech.com/', // EshangUrl: 'https://eshangtech.com/',
// apiurl: 'https://erysfeipeng.oicp.net/', // web api // apiurl: 'https://erysfeipeng.oicp.net/', // web api
// apiurl: 'http://192.168.11.136:8999/', // web api testApiurl: 'http://dev.eshangtech.com:8001/', // web api测试接口地址
mobUrl: 'http://192.168.11.125:8000/Coop.Merchant/Handler/handler_ajax.ashx', // 接口 mobUrl: 'http://192.168.11.125:8000/Coop.Merchant/Handler/handler_ajax.ashx', // 接口
testURL1: 'http://192.168.10.123:8000', // 测试ip testURL1: 'http://192.168.10.123:8000', // 测试ip

View File

@ -36,6 +36,11 @@ export default {
}, },
$webPost: function (controller,data) { // webapi $webPost: function (controller,data) { // webapi
return Api.request('POST', ApiPath.apiurl +controller ,data||{},true) return Api.request('POST', ApiPath.apiurl +controller ,data||{},true)
},
$webGetTest: function (controller,data) { // webapi
return Api.request('GET', ApiPath.testApiurl +controller ,data||{},true)
},
$webPostTest: function (controller,data) { // webapi
return Api.request('POST', ApiPath.testApiurl +controller ,data||{},true)
} }
} }