创建版本

This commit is contained in:
2021-02-22 12:17:00 +08:00
commit af555f49c3
2332 changed files with 369202 additions and 0 deletions
+274
View File
@@ -0,0 +1,274 @@
<template>
<view>
<view class="header" id="header">
<scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false">
<view v-for="(tab, index) in tabBars" :key="index" class="uni-tab-item" :id="tab.id" @click="ontabtap(index)">
<text class="uni-tab-item-title" :class="tabIndex == index ? 'uni-tab-item-title-active' : ''">{{tab.name}}</text>
</view>
</scroll-view>
<view class="search-controller">
<uni-search-bar radius="50" placeholder="搜索单号" @confirm="search" />
</view>
<view class="line-h"></view>
</view>
<view class="uni-list uni-list-controller" :style="'margin-top:' + listTop + 'px;'">
<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(row, key) in tabBars[tabIndex].data" :key="key" @click="goDetail(row)">
<view class="uni-media-list">
<view class="uni-media-list-body">
<view class="uni-media-list-text-top">
<text>{{ row.master_sn }}</text>
<text>{{ row.master_customer_id_name }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text class="desc">{{ htmlClear(row.master_status) }}</text>
<text class="desc">{{ row.master_created_at }}</text>
</view>
</view>
</view>
</view>
</view>
<uni-load-more :status="tabBars[tabIndex].status" :icon-size="16" :content-text="tabBars[tabIndex].contentText" />
</view>
</template>
<script>
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
import {dateUtils} from '@/util.js';
export default {
components: {
uniLoadMore
},
data() {
return {
tabIndex: 0,
listTop: 103,
tabBars: [{
name: '审核中',
id: 'flow.todo',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}, {
name: '已生效',
id: 'flow.done',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}],
reload: false
};
},
onLoad() {
var me = this;
me.getList(0);
},
onPullDownRefresh() {
let me = this;
me.reload = true;
let tab = me.tabBars[me.tabIndex];
tab.page = 1;
tab.status = 'more';
me.getList(me.tabIndex);
},
onReachBottom() {
let me = this;
let tab = me.tabBars[me.tabIndex];
if (tab.status == 'noMore') {
return;
}
tab.status = 'more';
this.getList(me.tabIndex);
},
mounted() {
let me = this;
uni.createSelectorQuery().in(this).select('#header').boundingClientRect(function(e) {
me.listTop = e.height - 1;
}).exec();
},
methods: {
ontabtap(index) {
var me = this;
me.tabIndex = index;
this.switchTab(index);
},
switchTab(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.data.length == 0) {
me.getList(index);
}
},
htmlClear(str) {
// 正则去掉所有的html标记
return str.replace(/<[^>]+>/g, "");
},
formatDate(value) {
return dateUtils.formatDate(value);
},
getList(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.status == 'noMore') {
if (me.reload) {
me.reload = false;
uni.stopPullDownRefresh();
}
return;
}
me.$api.post('approach/approach/index', {by: tab.id, page: tab.page}).then(res => {
if (me.reload) {
tab.data = [];
me.reload = false;
uni.stopPullDownRefresh();
}
tab.data = tab.data.concat(res.data);
if (res.current_page >= res.last_page) {
tab.status = 'noMore';
} else {
tab.page = res.current_page + 1;
}
}).catch(error => {
});
},
goDetail: function(row) {
uni.navigateTo({
url: '/pages/webview?title=进店详情&url=' + encodeURIComponent('approach/approach/show?id=' + row.master_id),
});
}
}
};
</script>
<style>
page {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: center;
background: rgba(249, 249, 249, 1);
}
.header {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 100;
background: #fff;
width: 100vw;
}
.uni-list-controller {
margin-top: 103px;
width: 100vw;
}
.uni-media-list-logo {
width: 140rpx;
height: 140rpx;
}
.uni-media-list-body {
height: auto;
justify-content: space-around;
}
.uni-media-list-text-top {
display: flex;
font-size: 28rpx;
flex-direction: row;
justify-content: space-between;
}
.uni-media-list-text-bottom {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 15rpx;
}
.uni-media-list-text-bottom .desc {
margin-bottom: 15rpx;
display: block;
}
.uni-media-list-text-bottom .desc:last-child {
margin-bottom: 0;
}
.scroll-h {
width: 750rpx;
height: 80rpx;
flex-direction: row;
white-space: nowrap;
align-items: center;
border-bottom: 1px solid #c8c7cc;
}
.line-h {
height: 1rpx;
background-color: #cccccc;
}
.uni-tab-item {
display: inline-block;
/*
padding-left: 70rpx;
padding-right: 70rpx;
*/
text-align: center;
width: 50%;
}
.uni-tab-item-title {
color: #555;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
white-space: nowrap;
}
.uni-tab-item-title-active {
color: #007AFF;
}
.scroll-v {
flex: 1;
width: 750rpx;
}
.search-controller {
padding: 10rpx;
}
.search-result {
margin-top: 10px;
margin-bottom: 20px;
text-align: center;
}
.search-result-text {
text-align: center;
font-size: 14px;
}
</style>
+299
View File
@@ -0,0 +1,299 @@
<template>
<view>
<view class="header" id="header">
<scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false">
<view v-for="(tab, index) in tabBars" :key="index" class="uni-tab-item" :id="tab.id" @click="ontabtap(index)">
<text class="uni-tab-item-title" :class="tabIndex == index ? 'uni-tab-item-title-active' : ''">{{tab.name}}</text>
</view>
</scroll-view>
<view class="search-controller">
<uni-search-bar radius="50" placeholder="搜索主题" @confirm="search" />
</view>
<view class="line-h"></view>
</view>
<view class="uni-list uni-list-controller" :style="'margin-top:' + listTop + 'px;'">
<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(row, key) in tabBars[tabIndex].data" :key="key" @click="goDetail(row)">
<view class="uni-media-list">
<view class="uni-media-list-body">
<view class="uni-media-list-text-top">
<text>{{ row.name }}</text>
<text>{{ row.description }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text class="desc">{{ row.created_by }}</text>
<text class="desc">{{ row.created_at }}</text>
</view>
</view>
</view>
</view>
</view>
<uni-load-more :status="tabBars[tabIndex].status" :icon-size="16" :content-text="tabBars[tabIndex].contentText" />
</view>
</template>
<script>
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
import {dateUtils} from '@/util.js';
export default {
components: {
uniLoadMore
},
data() {
return {
tabIndex: 0,
listTop: 103,
tabBars: [{
name: '全部',
id: 'all',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}, {
name: '未读',
id: 'unread',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}, {
name: '已读',
id: 'done',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}],
reload: false
};
},
onLoad() {
var me = this;
me.getList(0);
},
mounted() {
let me = this;
uni.createSelectorQuery().in(this).select('#header').boundingClientRect(function(e) {
me.listTop = e.height - 1;
}).exec();
},
onPullDownRefresh() {
let me = this;
me.reload = true;
let tab = me.tabBars[me.tabIndex];
tab.page = 1;
tab.status = 'more';
me.getList(me.tabIndex);
},
onReachBottom() {
let me = this;
let tab = me.tabBars[me.tabIndex];
if (tab.status == 'noMore') {
return;
}
tab.status = 'more';
this.getList(me.tabIndex);
},
methods: {
ontabtap(index) {
var me = this;
me.tabIndex = index;
this.switchTab(index);
},
switchTab(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.data.length == 0) {
me.getList(index);
}
},
formatDate(value) {
return dateUtils.formatDate(value);
},
getList(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.status == 'noMore') {
if (me.reload) {
me.reload = false;
uni.stopPullDownRefresh();
}
return;
}
me.$api.post('article/article/index', {tab: tab.id, page: tab.page}).then(res => {
if (me.reload) {
tab.data = [];
me.reload = false;
uni.stopPullDownRefresh();
}
tab.data = tab.data.concat(res.data);
if (res.current_page >= res.last_page) {
tab.status = 'noMore';
} else {
tab.page = res.current_page + 1;
}
}).catch(error => {
});
},
goDetail: function(row) {
uni.navigateTo({
url: '/pages/webview?title=公告详情&url=' + encodeURIComponent('article/article/show?id=' + row.id),
});
}
}
};
</script>
<style>
page {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: center;
background: rgba(249, 249, 249, 1);
}
.header {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 100;
background: #fff;
width: 100vw;
}
.uni-list-controller {
margin-top: 103px;
width: 100vw;
}
.uni-media-list-logo {
width: 140rpx;
height: 140rpx;
}
.uni-media-list-body {
height: auto;
justify-content: space-around;
}
.uni-media-list-text-top {
font-size: 28rpx;
overflow: hidden;
}
.uni-media-list-text-bottom {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 15rpx;
}
.uni-media-list-text-bottom .desc {
margin-bottom: 15rpx;
display: block;
}
.uni-media-list-text-bottom .desc:last-child {
margin-bottom: 0;
}
.tabs {
flex: 1;
flex-direction: column;
overflow: hidden;
background-color: #ffffff;
height: 100vh;
}
.scroll-h {
width: 750rpx;
height: 80rpx;
flex-direction: row;
white-space: nowrap;
align-items: center;
border-bottom: 1px solid #c8c7cc;
}
.line-h {
height: 1rpx;
background-color: #cccccc;
}
.uni-tab-item {
display: inline-block;
/*
padding-left: 70rpx;
padding-right: 70rpx;
*/
text-align: center;
width: 33.33333%;
}
.uni-tab-item-title {
color: #555;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
white-space: nowrap;
}
.uni-tab-item-title-active {
color: #007AFF;
}
.swiper-box {
flex: 1;
height: 50vh;
}
.swiper-item {
flex: 1;
flex-direction: row;
}
.scroll-v {
flex: 1;
width: 750rpx;
}
.search-controller {
padding: 10rpx;
}
.search-result {
margin-top: 10px;
margin-bottom: 20px;
text-align: center;
}
.search-result-text {
text-align: center;
font-size: 14px;
}
</style>
+313
View File
@@ -0,0 +1,313 @@
<template>
<view>
<view class="header" id="header">
<scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false">
<view v-for="(tab, index) in tabBars" :key="index" class="uni-tab-item" :id="tab.id" @click="ontabtap(index)">
<text class="uni-tab-item-title" :class="tabIndex == index ? 'uni-tab-item-title-active' : ''">{{tab.name}}</text>
</view>
</scroll-view>
<view class="search-controller">
<uni-search-bar radius="50" placeholder="搜索单号" @confirm="search" />
</view>
<view class="line-h"></view>
</view>
<view class="uni-list uni-list-controller" :style="'margin-top:' + listTop + 'px;'">
<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(row, key) in tabBars[tabIndex].data" :key="key" @click="goDetail(row)">
<view class="uni-media-list">
<view class="uni-media-list-body">
<view class="uni-media-list-text-top">
<text>{{ row.master_sn }}</text>
<text>{{ htmlClear(row.master_status) }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text class="desc">{{ row.master_customer_id_name }}</text>
<text class="desc">{{ row.master_invoice_dt }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text class="desc">预计到货日期{{ row.master_invoice_dt }}</text>
<text class="desc">实发数量{{ row.total_quantity }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text class="desc">收货地址{{ row.master_warehouse_address }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text class="desc">物流公司{{ row.master_freight_logistics_id_name }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text class="desc">物流电话{{ row.master_freight_logistics_phone }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text class="desc">运输单号{{ row.master_freight_sn }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text class="desc">配件吨位(T){{ row.master_freight_part_weight }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text class="desc">发运方式{{ row.master_freight_type_name }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text class="desc">承担运费{{ row.master_freight_customer_money }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text class="desc">物流备注{{ row.master_freight_remark }}</text>
</view>
</view>
</view>
</view>
</view>
<uni-load-more :status="tabBars[tabIndex].status" :icon-size="16" :content-text="tabBars[tabIndex].contentText" />
</view>
</template>
<script>
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
import {dateUtils} from '@/util.js';
export default {
components: {
uniLoadMore
},
data() {
return {
tabIndex: 0,
listTop: 103,
tabBars: [{
name: '审核中',
id: 'flow.todo',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}, {
name: '已生效',
id: 'flow.done',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}],
reload: false
};
},
onLoad() {
var me = this;
me.getList(0);
},
mounted() {
let me = this;
uni.createSelectorQuery().in(this).select('#header').boundingClientRect(function(e) {
me.listTop = e.height - 1;
}).exec();
},
onPullDownRefresh() {
let me = this;
me.reload = true;
let tab = me.tabBars[me.tabIndex];
tab.page = 1;
tab.status = 'more';
me.getList(me.tabIndex);
},
onReachBottom() {
let me = this;
let tab = me.tabBars[me.tabIndex];
if (tab.status == 'noMore') {
return;
}
tab.status = 'more';
this.getList(me.tabIndex);
},
methods: {
ontabtap(index) {
var me = this;
me.tabIndex = index;
this.switchTab(index);
},
switchTab(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.data.length == 0) {
me.getList(index);
}
},
htmlClear(str) {
// 正则去掉所有的html标记
return str.replace(/<[^>]+>/g, "");
},
formatDate(value) {
return dateUtils.formatDate(value);
},
getList(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.status == 'noMore') {
if (me.reload) {
me.reload = false;
uni.stopPullDownRefresh();
}
return;
}
me.$api.post('stock/delivery/count', {by: tab.id, page: tab.page}).then(res => {
if (me.reload) {
tab.data = [];
me.reload = false;
uni.stopPullDownRefresh();
}
tab.data = tab.data.concat(res.data);
if (res.current_page >= res.last_page) {
tab.status = 'noMore';
} else {
tab.page = res.current_page + 1;
}
}).catch(error => {
});
},
goDetail: function(row) {
uni.navigateTo({
url: '/pages/webview?title=发货详情&url=' + encodeURIComponent('stock/delivery/show?id=' + row.master_id),
});
}
}
};
</script>
<style>
page {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: center;
background: rgba(249, 249, 249, 1);
}
.header {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 100;
background: #fff;
width: 100vw;
}
.uni-list-controller {
margin-top: 103px;
width: 100vw;
}
.uni-media-list-logo {
width: 140rpx;
height: 140rpx;
}
.uni-media-list-body {
height: auto;
justify-content: space-around;
}
.uni-media-list-text-top {
font-size: 28rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.uni-media-list-text-bottom {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-top: 15rpx;
}
.tabs {
flex: 1;
flex-direction: column;
overflow: hidden;
background-color: #ffffff;
height: 100vh;
}
.scroll-h {
width: 750rpx;
height: 80rpx;
flex-direction: row;
white-space: nowrap;
align-items: center;
border-bottom: 1px solid #c8c7cc;
}
.line-h {
height: 1rpx;
background-color: #cccccc;
}
.uni-tab-item {
display: inline-block;
/*
padding-left: 70rpx;
padding-right: 70rpx;
*/
text-align: center;
width: 50%;
}
.uni-tab-item-title {
color: #555;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
white-space: nowrap;
}
.uni-tab-item-title-active {
color: #007AFF;
}
.swiper-box {
flex: 1;
height: 50vh;
}
.swiper-item {
flex: 1;
flex-direction: row;
}
.scroll-v {
flex: 1;
width: 750rpx;
}
.search-controller {
padding: 10rpx;
}
.search-result {
margin-top: 10px;
margin-bottom: 20px;
text-align: center;
}
.search-result-text {
text-align: center;
font-size: 14px;
}
</style>
+270
View File
@@ -0,0 +1,270 @@
<template>
<view>
<view class="header" id="header">
<scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false">
<view v-for="(tab, index) in tabBars" :key="index" class="uni-tab-item" :id="tab.id" @click="ontabtap(index)">
<text class="uni-tab-item-title" :class="tabIndex == index ? 'uni-tab-item-title-active' : ''">{{tab.name}}</text>
</view>
</scroll-view>
<view class="search-controller">
<uni-search-bar radius="50" placeholder="搜索单号" @confirm="search" />
</view>
<view class="line-h"></view>
</view>
<view class="uni-list uni-list-controller" :style="'margin-top:' + listTop + 'px;'">
<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(row, key) in tabBars[tabIndex].data" :key="key" @click="goDetail(row)">
<view class="uni-media-list">
<view class="uni-media-list-body">
<view class="uni-media-list-text-top">
<text>{{ row.master_sn }}</text>
<text>{{ row.master_customer_id_name }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text>{{ htmlClear(row.master_status) }}</text>
<text>{{ row.master_created_at }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text>开始日期{{ row.master_start_dt }}</text>
<text>结束日期{{ row.master_end_dt }}</text>
</view>
</view>
</view>
</view>
</view>
<uni-load-more :status="tabBars[tabIndex].status" :icon-size="16" :content-text="tabBars[tabIndex].contentText" />
</view>
</template>
<script>
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
import {dateUtils} from '@/util.js';
export default {
components: {
uniLoadMore
},
data() {
return {
tabIndex: 0,
listTop: 103,
tabBars: [{
name: '审核中',
id: 'flow.todo',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}, {
name: '已生效',
id: 'flow.done',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}],
reload: false
};
},
onLoad() {
var me = this;
me.getList(0);
},
onPullDownRefresh() {
let me = this;
me.reload = true;
let tab = me.tabBars[me.tabIndex];
tab.page = 1;
tab.status = 'more';
me.getList(me.tabIndex);
},
onReachBottom() {
let me = this;
let tab = me.tabBars[me.tabIndex];
if (tab.status == 'noMore') {
return;
}
tab.status = 'more';
this.getList(me.tabIndex);
},
mounted() {
let me = this;
uni.createSelectorQuery().in(this).select('#header').boundingClientRect(function(e) {
me.listTop = e.height - 1;
}).exec();
},
methods: {
ontabtap(index) {
var me = this;
me.tabIndex = index;
this.switchTab(index);
},
switchTab(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.data.length == 0) {
me.getList(index);
}
},
htmlClear(str) {
// 正则去掉所有的html标记
return str.replace(/<[^>]+>/g, "");
},
formatDate(value) {
return dateUtils.formatDate(value);
},
getList(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.status == 'noMore') {
if (me.reload) {
me.reload = false;
uni.stopPullDownRefresh();
}
return;
}
me.$api.post('promotion/promotion/index', {by: tab.id, page: tab.page}).then(res => {
if (me.reload) {
tab.data = [];
me.reload = false;
uni.stopPullDownRefresh();
}
tab.data = tab.data.concat(res.data);
if (res.current_page >= res.last_page) {
tab.status = 'noMore';
} else {
tab.page = res.current_page + 1;
}
}).catch(error => {
});
},
goDetail: function(row) {
uni.navigateTo({
url: '/pages/webview?title=促销详情&url=' + encodeURIComponent('promotion/promotion/show?id=' + row.master_id),
});
}
}
};
</script>
<style>
page {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: center;
background: rgba(249, 249, 249, 1);
}
.header {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 100;
background: #fff;
width: 100vw;
}
.uni-list-controller {
margin-top: 103px;
width: 100vw;
}
.uni-media-list-logo {
width: 140rpx;
height: 140rpx;
}
.uni-media-list-body {
height: auto;
justify-content: space-around;
}
.uni-media-list-text-top {
display: flex;
font-size: 28rpx;
flex-direction: row;
justify-content: space-between;
padding-bottom: 15rpx;
}
.uni-media-list-text-bottom {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.scroll-h {
width: 750rpx;
height: 80rpx;
flex-direction: row;
white-space: nowrap;
align-items: center;
border-bottom: 1px solid #c8c7cc;
}
.line-h {
height: 1rpx;
background-color: #cccccc;
}
.uni-tab-item {
display: inline-block;
/*
padding-left: 70rpx;
padding-right: 70rpx;
*/
text-align: center;
width: 50%;
}
.uni-tab-item-title {
color: #555;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
white-space: nowrap;
}
.uni-tab-item-title-active {
color: #007AFF;
}
.scroll-v {
flex: 1;
width: 750rpx;
}
.search-controller {
padding: 10rpx;
}
.search-result {
margin-top: 10px;
margin-bottom: 20px;
text-align: center;
}
.search-result-text {
text-align: center;
font-size: 14px;
}
</style>
+305
View File
@@ -0,0 +1,305 @@
<template>
<view>
<view class="header" id="header">
<uni-nav-bar color="#ffffff" background-color="#007AFF" status-bar="true" left-icon="arrowleft" left-text="返回" :right-text="is_add ? '新增' : ''" @clickLeft="back" @clickRight="add" />
<scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false">
<view v-for="(tab, index) in tabBars" :key="index" class="uni-tab-item" :id="tab.id" @click="ontabtap(index)">
<text class="uni-tab-item-title" :class="tabIndex == index ? 'uni-tab-item-title-active' : ''">{{tab.name}}</text>
</view>
</scroll-view>
</view>
<view class="uni-list uni-list-controller" :style="'margin-top:' + listTop + 'px;'">
<view v-for="(row, key) in tabBars[tabIndex].data" :key="key">
<view class="uni-media-list">
<view class="uni-media-list-body">
<img :src=" baseURL + '/uploads/' + row.path" style="width:100%;">
<view class="uni-media-list-text">
<view class="uni-media-list-text-top">
<text>{{ row.created_by }}</text>
<text>{{ formatDate(row.created_at) }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text>{{ row.location }}</text>
</view>
</view>
</view>
</view>
</view>
</view>
<uni-load-more :status="tabBars[tabIndex].status" :icon-size="16" :content-text="tabBars[tabIndex].contentText" />
</view>
</template>
<script>
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue'
import {dateUtils} from '@/util.js';
import {baseURL} from '@/api.js';
export default {
components: {
uniLoadMore,
uniNavBar
},
data() {
return {
is_add: false,
promotion_id: 0,
tabIndex: 0,
listTop: 103,
baseURL: baseURL,
tabBars: [{
name: '审核中',
id: '0',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}, {
name: '已审核不合格',
id: '1',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}, {
name: '已审核合格',
id: '2',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}],
reload: false
};
},
onLoad(options) {
var me = this;
me.promotion_id = options.promotion_id;
// 判断谁可以上传资料
var user = uni.getStorageSync('user');
if (user.group_id == 3 || user.id == 1) {
me.is_add = true;
}
me.getList(0);
},
onPullDownRefresh() {
let me = this;
me.reload = true;
let tab = me.tabBars[me.tabIndex];
tab.page = 1;
tab.status = 'more';
me.getList(me.tabIndex);
},
onReachBottom() {
let me = this;
let tab = me.tabBars[me.tabIndex];
if (tab.status == 'noMore') {
return;
}
tab.status = 'more';
this.getList(me.tabIndex);
},
mounted() {
let me = this;
uni.createSelectorQuery().in(this).select('#header').boundingClientRect(function(e) {
me.listTop = e.height - 1;
}).exec();
},
methods: {
back() {
uni.navigateBack();
},
add() {
let me = this;
uni.navigateTo({
url: '/pages/app/promotionMaterial/upload?promotion_id=' + me.promotion_id
});
},
ontabtap(index) {
var me = this;
me.tabIndex = index;
this.switchTab(index);
},
switchTab(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.data.length == 0) {
me.getList(index);
}
},
htmlClear(str) {
// 正则去掉所有的html标记
return str.replace(/<[^>]+>/g, "");
},
formatDate(value) {
return dateUtils.formatDate(value);
},
getList(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.status == 'noMore') {
if (me.reload) {
me.reload = false;
uni.stopPullDownRefresh();
}
return;
}
me.$api.post('promotion/material/index', {by: tab.id, page: tab.page}).then(res => {
if (me.reload) {
tab.data = [];
me.reload = false;
uni.stopPullDownRefresh();
}
tab.data = tab.data.concat(res.data);
if (res.current_page >= res.last_page) {
tab.status = 'noMore';
} else {
tab.page = res.current_page + 1;
}
}).catch(error => {
});
}
}
};
</script>
<style>
page {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: center;
background: rgba(249, 249, 249, 1);
}
.header {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 100;
background: #fff;
width: 100vw;
}
.uni-list-controller {
margin-top: 103px;
background-color: #f1f1f1;
width: 100vw;
}
.uni-media-list {
}
.uni-media-list-logo {
width: 140rpx;
height: 140rpx;
}
.uni-media-list-body {
background-color: #fff;
height: auto;
justify-content: space-around;
border-radius: 10rpx;
}
.uni-media-list-text {
width: calc(100% - 30rpx);
padding: 15rpx;
}
.uni-media-list-text-top {
display: flex;
font-size: 28rpx;
flex-direction: row;
justify-content: space-between;
padding-bottom: 0;
}
.uni-media-list-text-bottom {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-bottom: 15rpx;
}
.scroll-h {
width: 750rpx;
height: 80rpx;
flex-direction: row;
white-space: nowrap;
align-items: center;
border-bottom: 1px solid #c8c7cc;
}
.line-h {
height: 1rpx;
background-color: #cccccc;
}
.uni-tab-item {
display: inline-block;
/*
padding-left: 70rpx;
padding-right: 70rpx;
*/
text-align: center;
width: 33.333333%;
}
.uni-tab-item-title {
color: #555;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
white-space: nowrap;
}
.uni-tab-item-title-active {
color: #007AFF;
}
.scroll-v {
flex: 1;
width: 750rpx;
}
.search-controller {
padding: 10rpx;
}
.search-result {
margin-top: 10px;
margin-bottom: 20px;
text-align: center;
}
.search-result-text {
text-align: center;
font-size: 14px;
}
</style>
+249
View File
@@ -0,0 +1,249 @@
<template>
<view>
<view class="upload-box">
<view class="uni-form-item">
<view class="title">位置信息</view>
<input class="uni-input" disabled="disabled" v-model="location" />
</view>
<view class="uni-form-item">
<view class="title">门店名称</view>
<input class="uni-input" placeholder="请输入门店名称" v-model="name" />
</view>
<view class="uni-form-item" style="border:0;">
<img-upload :imgArr="images" imgCount="3" ref="imgUpload" />
</view>
</view>
<view class="notice-box">
<uni-notice-bar :show-close="true" :single="true" :text="'页面将在' + second + '秒后失效'" />
</view>
<view class="submit-box">
<button type="primary" @click="submit">提交</button>
<button type="info" @click="refresh">刷新</button>
</view>
</view>
</template>
<style>
page {
background-color: #fff;
}
.submit-box {
display: flex;
margin-right: 15rpx;
}
.submit-box uni-button {
margin-left: 15rpx;
flex-direction: row;
width: 100%;
justify-content: space-between;
}
.notice-box {
padding: 0 15rpx;
}
.upload-box {
padding-left: 15rpx;
}
.uni-form-item {
border-bottom: 1px solid #F1F1F1;
padding-top: 20rpx;
padding-bottom: 20rpx;
}
.title {
color: #888;
}
.uni-input {
color: #222;
padding: 4px 12px 6px 12px;
line-height: 1.8;
}
</style>
<script>
var wx = require('weixin');
import uniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar.vue'
import imgUpload from '@/components/my-components/uImgUpload.vue';
var InterTimer = null;
export default {
components: {
imgUpload,
uniNoticeBar
},
data() {
return {
name: '',
location: '位置获取中...',
promotion_id: 0,
latitude: 0,
longitude: 0,
images: [],
second: 180,
}
},
onLoad(options) {
var me = this;
me.promotion_id = options.promotion_id;
},
methods: {
getLocation() {
let me = this;
wx.getLocation({
type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
success: function(res) {
console.log('微信定位成功');
me.latitude = res.latitude;
me.longitude = res.longitude;
me.$api.post('wap/wechat/mapGeocoder', {
location: res.latitude + ',' + res.longitude
})
.then(ret => {
if (ret.status == 0) {
me.location = ret.result.address;
}
});
},
fail: function(res) {
console.log(res);
}
});
},
setRemainTime() {
let me = this;
if (me.second > 0) {
me.second = me.second - 1;
} else {
window.clearInterval(InterTimer);
}
},
refresh() {
let me = this;
me.name = '';
me.location = '';
me.latitude = 0;
me.longitude = 0;
me.images = [];
me.second = 180;
me.$refs.imgUpload.imgArray = [];
me.getLocation();
},
submit() {
let me = this;
if (me.second <= 0) {
uni.showModal({
content: "无法提交,表单已超时",
confirmText: "确定",
showCancel: false
});
return;
}
if (me.name == '') {
uni.showModal({
content: "门店信息不能为空",
confirmText: "确定",
showCancel: false
});
return;
}
if (me.location == '') {
uni.showModal({
content: "位置信息不能为空",
confirmText: "确定",
showCancel: false
});
return;
}
if (me.latitude == 0 || me.longitude == 0) {
uni.showModal({
content: "经纬度不能为空",
confirmText: "确定",
showCancel: false
});
return;
}
if (me.promotion_id == 0) {
uni.showModal({
content: "促销编号不能为空",
confirmText: "确定",
showCancel: false
});
return;
}
let files = me.$refs.imgUpload.imgArray.map((uri, index) => {
return {
name: "images[" + index + "]",
uri: uri
}
});
uni.showLoading({
mask: true,
title: '数据处理中...'
});
uni.uploadFile({
url: me.$api.baseURL + "/promotion/material/store",
files: files,
formData: {
name: me.name,
location: me.location,
lat: me.latitude,
lng: me.longitude,
promotion_id: me.promotion_id,
},
header: {
'x-auth-token': uni.getStorageSync('token')
},
success: function(res) {
uni.hideLoading();
let ret = JSON.parse(res.data);
if (ret.status) {
uni.redirectTo({
url: '/pages/app/promotionMaterial/index?promotion_id=' + me.promotion_id
});
} else {
uni.showModal({
content: ret.data,
confirmText: "确定",
showCancel: false
});
}
}
});
}
},
mounted() {
var me = this;
InterTimer = window.setInterval(me.setRemainTime, 1000);
me.$api.post('wap/wechat/jsConfig', {
url: window.location.href
}).then(ret => {
wx.config(ret);
wx.ready(function() {
me.getLocation();
});
wx.error(function(res) {
console.log(res.errMsg);
});
}).catch(error => {
console.log(error);
});
}
}
</script>
+274
View File
@@ -0,0 +1,274 @@
<template>
<view>
<view class="header" id="header">
<scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false">
<view v-for="(tab, index) in tabBars" :key="index" class="uni-tab-item" :id="tab.id" @click="ontabtap(index)">
<text class="uni-tab-item-title" :class="tabIndex == index ? 'uni-tab-item-title-active' : ''">{{tab.name}}</text>
</view>
</scroll-view>
<view class="search-controller">
<uni-search-bar radius="50" placeholder="搜索单号" @confirm="search" />
</view>
<view class="line-h"></view>
</view>
<view class="uni-list uni-list-controller" :style="'margin-top:' + listTop + 'px;'">
<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(row, key) in tabBars[tabIndex].data" :key="key" @click="goDetail(row)">
<view class="uni-media-list">
<view class="uni-media-list-body">
<view class="uni-media-list-text-top">
<text>{{ row.master_sn }}</text>
<text>{{ row.master_customer_id_name }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text class="desc">{{ htmlClear(row.master_status) }}</text>
<text class="desc">{{ row.master_created_at }}</text>
</view>
</view>
</view>
</view>
</view>
<uni-load-more :status="tabBars[tabIndex].status" :icon-size="16" :content-text="tabBars[tabIndex].contentText" />
</view>
</template>
<script>
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
import {dateUtils} from '@/util.js';
export default {
components: {
uniLoadMore
},
data() {
return {
tabIndex: 0,
listTop: 103,
tabBars: [{
name: '审核中',
id: 'flow.todo',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}, {
name: '已生效',
id: 'flow.done',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}],
reload: false
};
},
onLoad() {
var me = this;
me.getList(0);
},
onPullDownRefresh() {
let me = this;
me.reload = true;
let tab = me.tabBars[me.tabIndex];
tab.page = 1;
tab.status = 'more';
me.getList(me.tabIndex);
},
onReachBottom() {
let me = this;
let tab = me.tabBars[me.tabIndex];
if (tab.status == 'noMore') {
return;
}
tab.status = 'more';
this.getList(me.tabIndex);
},
mounted() {
let me = this;
uni.createSelectorQuery().in(this).select('#header').boundingClientRect(function(e) {
me.listTop = e.height - 1;
}).exec();
},
methods: {
ontabtap(index) {
var me = this;
me.tabIndex = index;
this.switchTab(index);
},
switchTab(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.data.length == 0) {
me.getList(index);
}
},
htmlClear(str) {
// 正则去掉所有的html标记
return str.replace(/<[^>]+>/g, "");
},
formatDate(value) {
return dateUtils.formatDate(value);
},
getList(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.status == 'noMore') {
if (me.reload) {
me.reload = false;
uni.stopPullDownRefresh();
}
return;
}
me.$api.post('order/order/count', {by: tab.id, page: tab.page}).then(res => {
if (me.reload) {
tab.data = [];
me.reload = false;
uni.stopPullDownRefresh();
}
tab.data = tab.data.concat(res.data);
if (res.current_page >= res.last_page) {
tab.status = 'noMore';
} else {
tab.page = res.current_page + 1;
}
}).catch(error => {
});
},
goDetail: function(row) {
uni.navigateTo({
url: '/pages/webview?title=销售订单详情&url=' + encodeURIComponent('order/order/show?id=' + row.master_id),
});
}
}
};
</script>
<style>
page {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: center;
background: rgba(249, 249, 249, 1);
}
.header {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 100;
background: #fff;
width: 100vw;
}
.uni-list-controller {
margin-top: 103px;
width: 100vw;
}
.uni-media-list-logo {
width: 140rpx;
height: 140rpx;
}
.uni-media-list-body {
height: auto;
justify-content: space-around;
}
.uni-media-list-text-top {
display: flex;
font-size: 28rpx;
flex-direction: row;
justify-content: space-between;
}
.uni-media-list-text-bottom {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 15rpx;
}
.uni-media-list-text-bottom .desc {
margin-bottom: 15rpx;
display: block;
}
.uni-media-list-text-bottom .desc:last-child {
margin-bottom: 0;
}
.scroll-h {
width: 750rpx;
height: 80rpx;
flex-direction: row;
white-space: nowrap;
align-items: center;
border-bottom: 1px solid #c8c7cc;
}
.line-h {
height: 1rpx;
background-color: #cccccc;
}
.uni-tab-item {
display: inline-block;
/*
padding-left: 70rpx;
padding-right: 70rpx;
*/
text-align: center;
width: 50%;
}
.uni-tab-item-title {
color: #555;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
white-space: nowrap;
}
.uni-tab-item-title-active {
color: #007AFF;
}
.scroll-v {
flex: 1;
width: 750rpx;
}
.search-controller {
padding: 10rpx;
}
.search-result {
margin-top: 10px;
margin-bottom: 20px;
text-align: center;
}
.search-result-text {
text-align: center;
font-size: 14px;
}
</style>
+295
View File
@@ -0,0 +1,295 @@
<template>
<view>
<view class="header" id="header">
<scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false">
<view v-for="(tab, index) in tabBars" :key="index" class="uni-tab-item" :id="tab.id" @click="ontabtap(index)">
<text class="uni-tab-item-title" :class="tabIndex == index ? 'uni-tab-item-title-active' : ''">{{tab.name}}</text>
</view>
</scroll-view>
<view class="search-controller">
<uni-search-bar radius="50" placeholder="搜索主题或文号" @confirm="search" />
</view>
<view class="line-h"></view>
</view>
<view class="uni-list uni-list-controller" :style="'margin-top:' + listTop + 'px;'">
<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(row, key) in tabBars[tabIndex].data" :key="key" @click="goDetail(row)">
<view class="uni-media-list">
<view class="uni-media-list-body">
<view class="uni-media-list-text-top">{{ row.title }}</view>
<view class="uni-media-list-text-bottom">
<text class="desc">{{ row.name }}</text>
<text class="desc">{{ row.step.name }}</text>
</view>
</view>
</view>
</view>
</view>
<uni-load-more :status="tabBars[tabIndex].status" :icon-size="16" :content-text="tabBars[tabIndex].contentText" />
</view>
</template>
<script>
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
export default {
components: {
uniLoadMore
},
data() {
return {
tabIndex: 0,
listTop: 103,
tabBars: [{
name: '待办中',
id: 'todo',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}, {
name: '已办理',
id: 'trans',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}, {
name: '已结束',
id: 'done',
page: 1,
data: [],
status: 'more',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
}],
reload: false
};
},
onLoad() {
var me = this;
me.getList(0);
},
mounted() {
let me = this;
uni.createSelectorQuery().in(this).select('#header').boundingClientRect(function(e) {
me.listTop = e.height - 1;
}).exec();
},
onPullDownRefresh() {
let me = this;
me.reload = true;
let tab = me.tabBars[me.tabIndex];
tab.page = 1;
tab.status = 'more';
me.getList(me.tabIndex);
},
onReachBottom() {
let me = this;
let tab = me.tabBars[me.tabIndex];
if (tab.status == 'noMore') {
return;
}
tab.status = 'more';
this.getList(me.tabIndex);
},
methods: {
ontabtap(index) {
var me = this;
me.tabIndex = index;
this.switchTab(index);
},
switchTab(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.data.length == 0) {
me.getList(index);
}
},
formatDate(value) {
return dateUtils.formatDate(value);
},
getList(index) {
var me = this;
let tab = me.tabBars[index];
if (tab.status == 'noMore') {
if (me.reload) {
me.reload = false;
uni.stopPullDownRefresh();
}
return;
}
me.$api.post('workflow/workflow/index', {option: tab.id, page: tab.page}).then(res => {
if (me.reload) {
tab.data = [];
me.reload = false;
uni.stopPullDownRefresh();
}
tab.data = tab.data.concat(res.data);
if (res.current_page >= res.last_page) {
tab.status = 'noMore';
} else {
tab.page = res.current_page + 1;
}
}).catch(error => {
});
},
goDetail: function(row) {
uni.navigateTo({
url: '/pages/webview?title=流程详情&url=' + encodeURIComponent('workflow/workflow/edit?process_id=' + row.process_id),
});
}
}
};
</script>
<style>
page {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: center;
background: rgba(249, 249, 249, 1);
}
.header {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 100;
background: #fff;
width: 100vw;
}
.uni-list-controller {
width: 100vw;
}
.uni-media-list-logo {
width: 140rpx;
height: 140rpx;
}
.uni-media-list-body {
height: auto;
justify-content: space-around;
}
.uni-media-list-text-top {
font-size: 28rpx;
overflow: hidden;
}
.uni-media-list-text-bottom {
/*
display: flex;
flex-direction: row;
justify-content: space-between;
*/
margin-top: 15rpx;
}
.uni-media-list-text-bottom .desc {
margin-bottom: 15rpx;
display: block;
}
.uni-media-list-text-bottom .desc:last-child {
margin-bottom: 0;
}
.tabs {
flex: 1;
flex-direction: column;
overflow: hidden;
background-color: #ffffff;
height: 100vh;
}
.scroll-h {
width: 750rpx;
height: 80rpx;
flex-direction: row;
white-space: nowrap;
align-items: center;
border-bottom: 1px solid #c8c7cc;
}
.line-h {
height: 1rpx;
background-color: #cccccc;
}
.uni-tab-item {
display: inline-block;
/*
padding-left: 70rpx;
padding-right: 70rpx;
*/
text-align: center;
width: 33.33333%;
}
.uni-tab-item-title {
color: #555;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
white-space: nowrap;
}
.uni-tab-item-title-active {
color: #007AFF;
}
.swiper-box {
flex: 1;
height: 50vh;
}
.swiper-item {
flex: 1;
flex-direction: row;
}
.scroll-v {
flex: 1;
width: 750rpx;
}
.search-controller {
padding: 10rpx;
}
.search-result {
margin-top: 10px;
margin-bottom: 20px;
text-align: center;
}
.search-result-text {
text-align: center;
font-size: 14px;
}
</style>
+409
View File
@@ -0,0 +1,409 @@
<template>
<view class="tabs">
<view class="header">
<scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false">
<view v-for="(tab, index) in tabBars" :key="index" class="uni-tab-item" :id="tab.id" :data-current="index" @click="ontabtap">
<text class="uni-tab-item-title" :class="tabIndex == index ? 'uni-tab-item-title-active' : ''">{{tab.name}}</text>
</view>
</scroll-view>
<view class="search-controller">
<uni-search-bar radius="50" placeholder="搜索主题或文号" @confirm="search" />
</view>
</view>
<view class="line-h"></view>
<swiper :current="tabIndex" class="swiper-box" style="flex:1;" :duration="300" @change="ontabchange">
<swiper-item class="swiper-item" v-for="(tab, index1) in newsList" :key="index1">
<!-- #ifndef APP-NVUE -->
<scroll-view class="scroll-v list" :show-scrollbar="true" refresher-enabled="true" enableBackToTop="true" scroll-y @scrolltolower="loadMore(index1)">
<view v-for="(newsitem, index2) in tab.data" :key="index2">
<media-item :options="newsitem" @click="goDetail(newsitem)"></media-item>
</view>
<view class="loading-more" v-if="tab.isLoading">
<text class="loading-more-text">{{tab.loadingText}}</text>
</view>
</scroll-view>
<!-- #endif -->
</swiper-item>
</swiper>
</view>
</template>
<script>
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
import mediaItem from '@/pages/app/workflow/item.nvue';
import {dateUtils} from '@/util.js';
export default {
components: {
uniLoadMore,
mediaItem
},
data() {
return {
newsList: [],
cacheTab: [],
tabIndex: 0,
tabBars: [{
name: '待办中',
id: 'todo'
}, {
name: '已办理',
id: 'trans'
}, {
name: '已结束',
id: 'done'
}],
page: 1,
scrollInto: "",
showTips: false,
navigateFlag: false,
pulling: false,
refreshIcon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAB5QTFRFcHBw3Nzct7e39vb2ycnJioqK7e3tpqam29vb////D8oK7wAAAAp0Uk5T////////////ALLMLM8AAABxSURBVHja7JVBDoAgDASrjqj//7CJBi90iyYeOHTPMwmFZrHjYyyFYYUy1bwUZqtJIYVxhf1a6u0R7iUvWsCcrEtwJHp8MwMdvh2amHduiZD3rpWId9+BgPd7Cc2LIkPyqvlQvKxKBJ//Qwq/CacAAwDUv0a0YuKhzgAAAABJRU5ErkJggg=="
};
},
onLoad() {
var me = this;
me.tabBars.forEach((tabBar) => {
me.newsList.push({
data: [],
page: 1,
isLoading: false,
isComplete: false,
refreshText: "",
loadingText: '加载更多...'
});
});
this.getList(0);
},
methods: {
loadMore(e) {
this.getList(this.tabIndex);
},
ontabtap(e) {
var me = this;
let index = e.target.dataset.current || e.currentTarget.dataset.current;
// this.switchTab(index);
me.tabIndex = index;
//me.scrollInto = me.tabBars[index].id;
},
ontabchange(e) {
let index = e.target.current || e.detail.current;
this.switchTab(index);
},
switchTab(index) {
var me = this;
me.getList(index);
console.log(22);
/*
// 缓存 tabId
if (this.newsList[this.tabIndex].data.length > MAX_CACHE_DATA) {
let isExist = this.cacheTab.indexOf(this.tabIndex);
if (isExist < 0) {
this.cacheTab.push(this.tabIndex);
//console.log("cache index:: " + this.tabIndex);
}
}
*/
me.tabIndex = index;
me.scrollInto = me.tabBars[index].id;
/*
// 释放 tabId
if (this.cacheTab.length > MAX_CACHE_PAGE) {
let cacheIndex = this.cacheTab[0];
this.clearTabData(cacheIndex);
this.cacheTab.splice(0, 1);
//console.log("remove cache index:: " + cacheIndex);
}
*/
},
clearTabData(e) {
this.newsList[e].data.length = 0;
this.newsList[e].loadingText = "加载更多...";
},
refreshData() {
},
onrefresh(e) {
var tab = this.newsList[this.tabIndex];
if (!tab.refreshFlag) {
return;
}
tab.refreshing = true;
tab.refreshText = "正在刷新...";
setTimeout(() => {
this.refreshData();
this.pulling = true;
tab.refreshing = false;
tab.refreshFlag = false;
tab.refreshText = "已刷新";
setTimeout(() => { // TODO fix ios和Android 动画时间相反问题
this.pulling = false;
}, 500);
}, 2000);
},
onpullingdown(e) {
var tab = this.newsList[this.tabIndex];
if (tab.refreshing || this.pulling) {
return;
}
if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) {
tab.refreshFlag = true;
tab.refreshText = "释放立即刷新";
} else {
tab.refreshFlag = false;
tab.refreshText = "下拉可以刷新";
}
},
formatDate(value) {
return dateUtils.formatDate(value);
},
getList(index) {
var me = this;
let tab = me.newsList[index];
let option = me.tabBars[index].id;
if (tab.isComplete) {
return;
}
me.$api.post('workflow/workflow/index', {option: option, page: tab.page}).then(res => {
tab.data = tab.data.concat(res.data);
uni.stopPullDownRefresh();
if (res.current_page >= res.last_page) {
tab.isComplete = true;
} else {
tab.page = res.current_page + 1;
}
}).catch(error => {
});
},
goDetail: function(e) {
// if (!/前|刚刚/.test(e.published_at)) {
// e.published_at = dateUtils.format(e.published_at);
// }
let detail = {
author_name: e.author_name,
cover: e.cover,
id: e.id,
post_id: e.post_id,
published_at: e.published_at,
title: e.title
};
uni.navigateTo({
url: '../list2detail-detail/list2detail-detail?detailDate=' + encodeURIComponent(JSON.stringify(detail))
});
},
setTime: function(items) {
var newItems = [];
items.forEach(e => {
newItems.push({
author_name: e.author_name,
cover: e.cover,
id: e.id,
post_id: e.post_id,
published_at: dateUtils.format(e.published_at),
title: e.title
});
});
return newItems;
}
}
};
</script>
<style>
.uni-media-list-logo {
width: 140rpx;
height: 140rpx;
}
.uni-media-list-body {
height: auto;
justify-content: space-around;
}
.uni-media-list-text-top {
height: 50rpx;
font-size: 28rpx;
overflow: hidden;
}
.uni-media-list-text-bottom {
/*
display: flex;
flex-direction: row;
justify-content: space-between;
*/
}
.uni-media-list-text-bottom .desc {
margin-bottom: 15rpx;
display: block;
}
.uni-media-list-text-bottom .desc:last-child {
margin-bottom: 0;
}
.tabs {
flex: 1;
flex-direction: column;
overflow: hidden;
background-color: #ffffff;
height: 100vh;
}
.scroll-h {
width: 750rpx;
height: 80rpx;
flex-direction: row;
white-space: nowrap;
align-items: center;
border-bottom: 1px solid #c8c7cc;
}
.line-h {
height: 1rpx;
background-color: #cccccc;
}
.uni-tab-item {
display: inline-block;
/*
padding-left: 70rpx;
padding-right: 70rpx;
*/
text-align: center;
width: 33.33333%;
}
.uni-tab-item-title {
color: #555;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
white-space: nowrap;
}
.uni-tab-item-title-active {
color: #007AFF;
}
.swiper-box {
flex: 1;
height: 50vh;
}
.swiper-item {
flex: 1;
flex-direction: row;
}
.scroll-v {
flex: 1;
/* #ifndef MP-ALIPAY */
flex-direction: column;
/* #endif */
width: 750rpx;
}
.update-tips {
position: absolute;
left: 0;
top: 41px;
right: 0;
padding-top: 5px;
padding-bottom: 5px;
background-color: #FDDD9B;
align-items: center;
justify-content: center;
text-align: center;
}
.update-tips-text {
font-size: 14px;
color: #ffffff;
}
.refresh {
width: 750rpx;
height: 64px;
justify-content: center;
}
.refresh-view {
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
}
.refresh-icon {
width: 30px;
height: 30px;
transition-duration: .5s;
transition-property: transform;
transform: rotate(0deg);
transform-origin: 15px 15px;
}
.refresh-icon-active {
transform: rotate(180deg);
}
.loading-icon {
width: 20px;
height: 20px;
margin-right: 5px;
color: #999999;
}
.loading-text {
margin-left: 2px;
font-size: 16px;
color: #999999;
}
.loading-more {
align-items: center;
justify-content: center;
padding-top: 10px;
padding-bottom: 10px;
text-align: center;
}
.loading-more-text {
font-size: 28rpx;
color: #999;
}
.search-controller {
padding: 10rpx;
}
.search-result {
margin-top: 10px;
margin-bottom: 20px;
text-align: center;
}
.search-result-text {
text-align: center;
font-size: 14px;
}
</style>
+207
View File
@@ -0,0 +1,207 @@
<template>
<!-- remove list-cell layer fix android 4.x overflow limit error: 28 layers! -->
<!-- <view class="list-cell view" @click="click"></view> -->
<view class="media-item view" hover-class="media-item-hover" v-if="options.title" @click="click">
<!-- <view class="view" :style="options.article_type === 2 ? 'flex-direction: row';" :class="{'media-image-right': options.article_type === 2, 'media-image-left': options.article_type === 1}"> -->
<!-- TODO 在支付宝小程序下 需要用 style 覆盖标签的默认样式 -->
<view class="view" :style="{flexDirection: (options.article_type === 1 || options.article_type === 2)?(options.article_type === 2 ?'row':'row-reverse'):'column' }">
<text class="media-title" :class="{'media-title2': options.article_type === 1 || options.article_type === 2}">{{options.title}}</text>
<view v-if="options.image_list || options.image_url" class="image-section flex-row" :class="{'image-section-right': options.article_type === 2, 'image-section-left': options.article_type === 1}"
:style="{flexDirection: 'row' }">
<image class="image-list1" :class="{'image-list2': options.article_type === 1 || options.article_type === 2}" v-if="options.image_url"
:src="options.image_url"></image>
<image class="image-list3" v-if="options.image_list" :src="source.url" v-for="(source, i) in options.image_list"
:key="i" />
</view>
</view>
<view class="media-foot flex-row" style="flex-direction: row;">
<view class="media-info flex-row" style="flex-direction: row;">
<text class="info-text">{{options.source}}</text>
<text class="info-text">{{options.comment_count}}条评论</text>
<text class="info-text">{{options.datetime}}</text>
</view>
<!--
<view class="max-close-view" @click.stop="close">
<view class="close-l close-h"></view>
<view class="close-l close-v"></view>
</view>
-->
</view>
<view class="media-item-line" style="position: absolute;"></view>
</view>
</template>
<script>
export default {
props: {
options: {
type: Object,
default: function(e) {
return {}
}
}
},
methods: {
click() {
this.$emit('click');
},
close(e) {
this.$emit('close');
}
}
}
</script>
<style>
.view {
flex-direction: column;
}
.flex-row {
flex-direction: row;
}
.flex-col {
flex-direction: column;
}
.list-cell {
width: 750rpx;
padding: 0 30rpx;
}
.uni-list-cell-hover {
background-color: #eeeeee;
}
.media-item {
position: relative;
flex: 1;
flex-direction: column;
/* border-bottom-width: 1rpx;
border-bottom-style: solid;
border-bottom-color: #ebebeb; */
padding: 20rpx 30rpx 21rpx 30rpx;
}
.media-item-hover{
background-color: #eee;
}
.media-item-line {
position: absolute;
left: 30rpx;
right: 30rpx;
bottom: 0;
height: 1rpx;
background-color: #ebebeb;
}
.media-image-right {
flex-direction: row;
}
.media-image-left {
flex-direction: row-reverse;
}
.media-title {
flex: 1;
}
.media-title {
lines: 3;
text-overflow: ellipsis;
font-size: 30rpx;
color: #555555;
}
.media-title2 {
flex: 1;
margin-top: 6rpx;
line-height: 40rpx;
}
.image-section {
margin-top: 20rpx;
flex-direction: row;
justify-content: space-between;
}
.image-section-right {
margin-top: 0rpx;
margin-left: 10rpx;
width: 225rpx;
height: 146rpx;
}
.image-section-left {
margin-top: 0rpx;
margin-right: 10rpx;
width: 225rpx;
height: 146rpx;
}
.image-list1 {
width: 690rpx;
height: 481rpx;
}
.image-list2 {
width: 225rpx;
height: 146rpx;
}
.image-list3 {
width: 225rpx;
height: 146rpx;
}
.media-info {
flex-direction: row;
align-items: center;
}
.info-text {
margin-right: 20rpx;
color: #999999;
font-size: 24rpx;
}
.media-foot {
margin-top: 25rpx;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.max-close-view {
position: relative;
align-items: center;
flex-direction: row;
width: 40rpx;
height: 30rpx;
line-height: 30rpx;
border-width: 1rpx;
border-style: solid;
border-color: #aaaaaa;
border-radius: 4px;
justify-content: center;
text-align: center;
}
.close-l {
position: absolute;
width: 18rpx;
height: 1rpx;
background-color: #aaaaaa;
}
.close-h {
transform: rotate(45deg);
}
.close-v {
transform: rotate(-45deg);
}
</style>
+56
View File
@@ -0,0 +1,56 @@
<template>
<view class="page_index">
<view class="head">
<view class="head_inner_title">爱客办公</view>
<view class="head_inner_description">Gdoo Office</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {}
},
onLoad: function() {
var me = this;
me.$api.authorize();
},
methods: {
}
}
</script>
<style>
page {
height: auto;
min-height: 100%;
background-color: #f5f6f8;
font-size: 14px;
}
</style>
<style lang="scss" scoped>
.page_index {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.head {
position: relative;
transform: translateY(-50%);
.head_inner_title {
text-align: center;
font-size: 50rpx;
color: #007aff;
display: block;
}
.head_inner_description {
margin-top: 5rpx;
text-align: center;
font-size: 20rpx;
color: #666;
display: block;
}
}
</style>
+215
View File
@@ -0,0 +1,215 @@
<template>
<view class="page_login">
<!-- 头部logo -->
<view class="head">
<view class="head_inner_title">爱客办公</view>
<view class="head_inner_description">Gdoo Office</view>
</view>
<!-- 登录form -->
<view class="login_form">
<view class="input">
<view class="img">
<span class="iconfont icon-icon_signal"></span>
</view>
<input type="text" v-model="username" placeholder="请输入账号">
</view>
<view class="line" />
<view class="input">
<view class="img">
<span class="iconfont icon-icon_shield"></span>
</view>
<input type="password" v-model="password" placeholder="请输入密码">
</view>
</view>
<!-- 登录提交 -->
<button class="submit" type="primary" @tap="login">登录</button>
<view class="quick_login_line">
<text class="text">爱客办公</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
username: '',
password: ''
}
},
methods: {
login() {
var me = this;
if (me.username == '') {
uni.showToast({
title: '帐号不能为空。'
});
return;
}
if (me.password == '') {
uni.showToast({
title: '密码不能为空。'
});
return;
}
me.$api.post('wap/auth/login', {username: me.username, password: me.password}).then(res => {
if (res.status) {
uni.setStorageSync('access', res.data.access);
uni.setStorageSync('token', res.data.token);
uni.setStorageSync('user', res.data.user);
uni.switchTab({
url: '/pages/tabbar/notice'
});
} else {
uni.showToast({
title: res.data
});
}
}).catch(res => {
console.log(res);
});
}
}
}
</script>
<style>
page {
height: auto;
min-height: 100%;
background-color: #f5f6f8;
font-size: 14px;
}
</style>
<style lang="scss" scoped>
$logo-padding: 100rpx;
$form-border-color: rgba(214, 214, 214, 1);
$text-color: #B6B6B6;
.page_login {
padding: 10rpx;
}
.head {
/*
display: flex;
align-items: center;
justify-content: center;
*/
text-align: center;
padding-top: $logo-padding;
padding-bottom: $logo-padding;
.head_inner_title {
text-align: center;
font-size: 50rpx;
color: #007aff;
}
.head_inner_description {
margin-top: 5rpx;
text-align: center;
font-size: 20rpx;
color: #666;
}
.head_bg {
border: 1px solid #8f8f8f;
border-radius: 50rpx;
width: 100rpx;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
.head_inner_bg {
border-radius: 40rpx;
width: 80rpx;
height: 80rpx;
line-height: 80rpx;
font-size: 30rpx;
display: flex;
background-color: #f8f8f8;
align-items: flex-end;
justify-content: center;
overflow: hidden;
}
}
}
.login_form {
display: flex;
margin: 40rpx;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px solid $form-border-color;
border-radius: 10rpx;
background-color: #fff;
.line {
width: 100%;
height: 1px;
background-color: $form-border-color;
}
.input {
width: 100%;
max-height: 45px;
display: flex;
padding: 3rpx;
flex-direction: row;
align-items: center;
justify-content: center;
.img {
min-width: 40px;
min-height: 40px;
margin: 5px;
display: flex;
align-items: center;
justify-content: center;
.iconfont {
font-size: 45rpx;
color: #999;
}
}
input {
outline: none;
height: 30px;
width: 100%;
&:focus {
outline: none;
}
}
}
}
.submit {
margin-top: 30px;
margin-left: 20px;
margin-right: 20px;
color: white;
}
.quick_login_line {
/*
margin-top: 40px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
*/
position: absolute;
bottom: 30rpx;
left: 50%;
transform: translate(-50%, 0);
.text {
text-align: center;
font-size: 13px;
color: #aaa;
margin: 2px;
}
}
</style>
+224
View File
@@ -0,0 +1,224 @@
<template>
<view class="page_login">
<!-- 头部logo -->
<view class="head">
<view class="head_inner_title">爱客办公</view>
<view class="head_inner_description">Gdoo Office</view>
</view>
<!-- 登录form -->
<view class="login_form">
<view class="input">
<view class="img">
<span class="iconfont icon-icon_signal"></span>
</view>
<input type="text" v-model="username" placeholder="请输入账号">
</view>
<view class="line" />
<view class="input">
<view class="img">
<span class="iconfont icon-icon_shield"></span>
</view>
<input type="password" v-model="password" placeholder="请输入密码">
</view>
</view>
<!-- 登录提交 -->
<button class="submit" type="primary" @tap="register">绑定</button>
<view class="quick_login_line">
<text class="text">爱客ERP</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
username: '',
password: ''
}
},
methods: {
register() {
var me = this;
var openid = uni.getStorageSync('openid');
if (openid == '') {
uni.showToast({
title: 'Openid不能为空。'
});
return;
}
if (me.username == '') {
uni.showToast({
title: '帐号不能为空。'
});
return;
}
if (me.password == '') {
uni.showToast({
title: '密码不能为空。'
});
return;
}
me.$api.post('wap/wechat/login', {openid: openid, username: me.username, password: me.password}).then(res => {
if (res.status) {
uni.setStorageSync('access', res.data.access);
uni.setStorageSync('token', res.data.token);
uni.setStorageSync('user', res.data.user);
uni.switchTab({
url: '/pages/tabbar/notice'
});
} else {
uni.showToast({
title: res.data
});
}
}).catch(res => {
console.log(res);
});
}
}
}
</script>
<style>
page {
height: auto;
min-height: 100%;
background-color: #f5f6f8;
font-size: 14px;
}
</style>
<style lang="scss" scoped>
$logo-padding: 100rpx;
$form-border-color: rgba(214, 214, 214, 1);
$text-color: #B6B6B6;
.page_login {
padding: 10rpx;
}
.head {
/*
display: flex;
align-items: center;
justify-content: center;
*/
text-align: center;
padding-top: $logo-padding;
padding-bottom: $logo-padding;
.head_inner_title {
text-align: center;
font-size: 50rpx;
color: #007aff;
}
.head_inner_description {
margin-top: 5rpx;
text-align: center;
font-size: 20rpx;
color: #666;
}
.head_bg {
border: 1px solid #8f8f8f;
border-radius: 50rpx;
width: 100rpx;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
.head_inner_bg {
border-radius: 40rpx;
width: 80rpx;
height: 80rpx;
line-height: 80rpx;
font-size: 30rpx;
display: flex;
background-color: #f8f8f8;
align-items: flex-end;
justify-content: center;
overflow: hidden;
}
}
}
.login_form {
display: flex;
margin: 40rpx;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px solid $form-border-color;
border-radius: 10rpx;
background-color: #fff;
.line {
width: 100%;
height: 1px;
background-color: $form-border-color;
}
.input {
width: 100%;
max-height: 45px;
display: flex;
padding: 3rpx;
flex-direction: row;
align-items: center;
justify-content: center;
.img {
min-width: 40px;
min-height: 40px;
margin: 5px;
display: flex;
align-items: center;
justify-content: center;
.iconfont {
font-size: 45rpx;
color: #999;
}
}
input {
outline: none;
height: 30px;
width: 100%;
&:focus {
outline: none;
}
}
}
}
.submit {
margin-top: 30px;
margin-left: 20px;
margin-right: 20px;
color: white;
}
.quick_login_line {
/*
margin-top: 40px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
*/
position: absolute;
bottom: 30rpx;
left: 50%;
transform: translate(-50%, 0);
.text {
text-align: center;
font-size: 13px;
color: #aaa;
margin: 2px;
}
}
</style>
+31
View File
@@ -0,0 +1,31 @@
<template>
<view class="content">
<view style="padding-top:20px;">
<img alt="暂无数据" src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjQiIGhlaWdodD0iNDEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxlbGxpcHNlIGZpbGw9IiNGNUY1RjUiIGN4PSIzMiIgY3k9IjMzIiByeD0iMzIiIHJ5PSI3Ii8+CiAgICA8ZyBmaWxsLXJ1bGU9Im5vbnplcm8iIHN0cm9rZT0iI0Q5RDlEOSI+CiAgICAgIDxwYXRoIGQ9Ik01NSAxMi43Nkw0NC44NTQgMS4yNThDNDQuMzY3LjQ3NCA0My42NTYgMCA0Mi45MDcgMEgyMS4wOTNjLS43NDkgMC0xLjQ2LjQ3NC0xLjk0NyAxLjI1N0w5IDEyLjc2MVYyMmg0NnYtOS4yNHoiLz4KICAgICAgPHBhdGggZD0iTTQxLjYxMyAxNS45MzFjMC0xLjYwNS45OTQtMi45MyAyLjIyNy0yLjkzMUg1NXYxOC4xMzdDNTUgMzMuMjYgNTMuNjggMzUgNTIuMDUgMzVoLTQwLjFDMTAuMzIgMzUgOSAzMy4yNTkgOSAzMS4xMzdWMTNoMTEuMTZjMS4yMzMgMCAyLjIyNyAxLjMyMyAyLjIyNyAyLjkyOHYuMDIyYzAgMS42MDUgMS4wMDUgMi45MDEgMi4yMzcgMi45MDFoMTQuNzUyYzEuMjMyIDAgMi4yMzctMS4zMDggMi4yMzctMi45MTN2LS4wMDd6IiBmaWxsPSIjRkFGQUZBIi8+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K">
<view style="padding-top:5px;color:#999;">暂无数据</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.content {
text-align: center;
padding-top: 200upx;
}
</style>
+69
View File
@@ -0,0 +1,69 @@
<template>
<view class="content">
<uni-list>
<uni-list-item title="头像" />
<uni-list-item title="姓名" :rightText="name" />
<uni-list-item title="帐号" :rightText="username" />
<!--
<uni-list-item title="我的订单" />
<uni-list-item title="我的发货" />
-->
</uni-list>
<view class="btns">
<button @click="logout" type="warn" class="text">{{logout_text}}</button>
</view>
</view>
</template>
<script>
import uniSection from '@/components/uni-section/uni-section.vue'
import uniList from '@/components/uni-list/uni-list.vue'
import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
export default {
components: {
uniSection,
uniList,
uniListItem
},
data() {
return {
name: '',
username: '',
logout_text: '帐号注销'
}
},
onLoad() {
let me = this;
let user = uni.getStorageSync('user');
me.name = user.name;
me.username = user.username;
},
methods: {
logout() {
this.$api.logout();
},
openurl() {
uni.navigateTo({
url: '/pages/webview'
});
}
}
}
</script>
<style>
page {
height: auto;
min-height: 100%;
background-color: #f5f6f8;
font-size: 14px;
}
.content {
}
.uni-section {
margin-top: 0;
}
.btns {
padding: 30rpx;
}
</style>
+254
View File
@@ -0,0 +1,254 @@
<template>
<view>
<view class="header" id="header">
<view class="search-controller">
<uni-search-bar radius="50" placeholder="搜索单号" @confirm="search" />
</view>
<view class="line-h"></view>
</view>
<view v-if="rows.length > 0">
<view class="uni-list uni-list-controller" :style="'margin-top:' + listTop + 'px;'">
<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(row, key) in rows" :key="key" @click="goDetail(row)">
<view class="uni-media-list">
<view class="uni-media-list-body">
<view class="uni-media-list-text-top">
<text>{{ row.sn }}</text>
<text>{{ row.name }}</text>
</view>
<view class="uni-media-list-text-bottom">
<text>{{ row.run_name }}</text>
<text>{{ formatDate(row.created_at) }}</text>
</view>
</view>
</view>
</view>
</view>
<!--
<uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
-->
</view>
<view v-else style="padding-top:300rpx;">
<img alt="暂无数据" src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjQiIGhlaWdodD0iNDEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxlbGxpcHNlIGZpbGw9IiNGNUY1RjUiIGN4PSIzMiIgY3k9IjMzIiByeD0iMzIiIHJ5PSI3Ii8+CiAgICA8ZyBmaWxsLXJ1bGU9Im5vbnplcm8iIHN0cm9rZT0iI0Q5RDlEOSI+CiAgICAgIDxwYXRoIGQ9Ik01NSAxMi43Nkw0NC44NTQgMS4yNThDNDQuMzY3LjQ3NCA0My42NTYgMCA0Mi45MDcgMEgyMS4wOTNjLS43NDkgMC0xLjQ2LjQ3NC0xLjk0NyAxLjI1N0w5IDEyLjc2MVYyMmg0NnYtOS4yNHoiLz4KICAgICAgPHBhdGggZD0iTTQxLjYxMyAxNS45MzFjMC0xLjYwNS45OTQtMi45MyAyLjIyNy0yLjkzMUg1NXYxOC4xMzdDNTUgMzMuMjYgNTMuNjggMzUgNTIuMDUgMzVoLTQwLjFDMTAuMzIgMzUgOSAzMy4yNTkgOSAzMS4xMzdWMTNoMTEuMTZjMS4yMzMgMCAyLjIyNyAxLjMyMyAyLjIyNyAyLjkyOHYuMDIyYzAgMS42MDUgMS4wMDUgMi45MDEgMi4yMzcgMi45MDFoMTQuNzUyYzEuMjMyIDAgMi4yMzctMS4zMDggMi4yMzctMi45MTN2LS4wMDd6IiBmaWxsPSIjRkFGQUZBIi8+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K">
<view style="padding-top:5px;color:#999;">暂无数据</view>
</view>
</view>
</template>
<script>
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
import {dateUtils} from '@/util.js';
export default {
components: {
uniLoadMore
},
data() {
return {
page: 1,
rows: [],
listTop: 0,
status: 'more',
reload: false,
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
}
};
},
onLoad() {
var me = this;
me.getList();
},
mounted() {
let me = this;
uni.createSelectorQuery().in(this).select('#header').boundingClientRect(function(e) {
me.listTop = e.height - 1;
}).exec();
},
onPullDownRefresh() {
let me = this;
me.reload = true;
me.page = 1;
me.status = 'more';
me.getList();
},
onReachBottom() {
let me = this;
if (me.status == 'noMore') {
return;
}
me.status = 'more';
this.getList();
},
methods: {
formatDate(value) {
return dateUtils.formatDate(value);
},
getList() {
var me = this;
if (me.status == 'noMore') {
if (me.reload) {
me.reload = false;
uni.stopPullDownRefresh();
}
return;
}
me.$api.post('index/todo/index', {page: me.page}).then(res => {
if (me.reload) {
me.rows = [];
me.reload = false;
uni.stopPullDownRefresh();
}
me.rows = me.rows.concat(res.data);
if (res.current_page >= res.last_page) {
me.status = 'noMore';
} else {
me.page = res.current_page + 1;
}
if (me.rows.length > 0) {
uni.setTabBarBadge({
index: 0,
text: me.rows.length + ''
});
} else {
uni.removeTabBarBadge({index: 0});
}
}).catch(error => {
});
},
goDetail: function(row) {
uni.navigateTo({
url: '/pages/webview?title=' + row.name + '&url=' + encodeURIComponent(row.url + '?id=' + row.data_id),
});
}
}
};
</script>
<style>
page {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: center;
background: rgba(249, 249, 249, 1);
}
.header {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 100;
background: #fff;
width: 100vw;
}
.uni-list-controller {
margin-top: 63px;
width: 100vw;
}
.uni-media-list-logo {
width: 140rpx;
height: 140rpx;
}
.uni-media-list-body {
height: auto;
justify-content: space-around;
}
.uni-media-list-text-top {
font-size: 28rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.uni-media-list-text-bottom {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-top: 15rpx;
}
.tabs {
flex: 1;
flex-direction: column;
overflow: hidden;
background-color: #ffffff;
height: 100vh;
}
.scroll-h {
width: 750rpx;
height: 80rpx;
flex-direction: row;
white-space: nowrap;
align-items: center;
border-bottom: 1px solid #c8c7cc;
}
.line-h {
height: 1rpx;
background-color: #cccccc;
}
.uni-tab-item {
display: inline-block;
/*
padding-left: 70rpx;
padding-right: 70rpx;
*/
text-align: center;
width: 33.33333%;
}
.uni-tab-item-title {
color: #555;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
white-space: nowrap;
}
.uni-tab-item-title-active {
color: #007AFF;
}
.swiper-box {
flex: 1;
height: 50vh;
}
.swiper-item {
flex: 1;
flex-direction: row;
}
.scroll-v {
flex: 1;
width: 750rpx;
}
.search-controller {
padding: 10rpx;
}
.search-result {
margin-top: 10px;
margin-bottom: 20px;
text-align: center;
}
.search-result-text {
text-align: center;
font-size: 14px;
}
</style>
+139
View File
@@ -0,0 +1,139 @@
<template>
<view class="content" :class="{'active':active}">
<image class="logo" :class="{'active':active}" src="../../static/logo.png" mode="aspectFit"></image>
<view class="tabbar-box-wrap">
<view class="tabbar-box">
<view class="tabbar-box-item" @click="goToPage('/pages/tabbar-3-detial/tabbar-3-release/tabbar-3-release')">
<image class="box-image" src="../../static/img/release.png" mode="aspectFit"></image>
<text class="explain">发图文</text>
</view>
<view class="tabbar-box-item" @click="goToPage('/pages/tabbar-3-detial/tabbar-3-video/tabbar-3-video')">
<image class="box-image" src="../../static/img/video.png" mode="aspectFit"></image>
<text class="explain">发视频</text>
</view>
<view class="tabbar-box-item" @click="goToPage('/pages/tabbar-3-detial/tabbar-3-qa/tabbar-3-qa')">
<image class="box-image" src="../../static/img/qa.png" mode="aspectFit"></image>
<text class="explain">提问</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
active: false
};
},
onLoad() {},
onShow() {
// setTimeout(() => {
this.active = true;
// }, 500);
},
onHide() {
this.active = false;
},
methods: {
goToPage(url) {
if (!url) return;
uni.navigateTo({
url
});
}
}
};
</script>
<style lang="scss" scoped>
.content {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
/* #ifdef H5 */
height: calc(100vh - var(--window-bottom) - var(--window-top));
/* #endif */
/* #ifndef H5 */
height: 100vh;
/* #endif */
transition: opacity 0.3s;
background: #999;
opacity: 0;
&.active {
opacity: 1;
}
.logo {
position: relative;
margin-top: -400upx;
width: 200upx;
height: 200upx;
// z-index: -1;
opacity: 0;
transition: opacity 0.3s;
&.active {
opacity: 1;
}
}
}
.tabbar-box-wrap {
position: absolute;
width: 100%;
padding: 50upx;
box-sizing: border-box;
bottom: 0;
left: 0;
.tabbar-box {
position: relative;
display: flex;
width: 100%;
background: #fff;
border-radius: 20upx;
padding: 15upx 20upx;
box-sizing: border-box;
z-index: 2;
box-shadow: 0px 2px 5px 2px rgba(0, 0, 0, 0.1);
&:after {
content: '';
position: absolute;
bottom: -16upx;
left: 0;
right: 0;
margin: auto;
width: 50upx;
height: 50upx;
transform: rotate(45deg);
background: #fff;
z-index: 1;
box-shadow: 2px 2px 5px 1px rgba(0, 0, 0, 0.1);
border-radius: 2px;
}
&:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #ffffff;
border-radius: 20upx;
z-index: 2;
}
.tabbar-box-item {
// position: relative;
width: 100%;
z-index: 3;
margin: 10upx;
color: $uni-color-subtitle;
text-align: center;
font-size: $uni-font-size-base;
.box-image {
width: 100%;
height: $uni-img-size-lg;
}
}
}
}
</style>
+160
View File
@@ -0,0 +1,160 @@
<template>
<view class="content">
<!-- 一般用法 -->
<view class="example-body">
<uni-grid :column="3">
<uni-grid-item v-for="(item, index) in list" :index="index" :key="index">
<view class="grid-item-box" @click="openURL(item)">
<span :class="'iconfont ' + item.icon" :style="'color:' + item.icon_color"></span>
<text class="text">{{ item.text }}</text>
<view v-if="item.badge" class="grid-dot">
<uni-badge :text="item.badge" :type="item.type" />
</view>
</view>
</uni-grid-item>
</uni-grid>
</view>
</view>
</template>
<script>
import uniGrid from "@/components/uni-grid/uni-grid.vue"
import uniGridItem from "@/components/uni-grid-item/uni-grid-item.vue"
import uniBadge from '@/components/uni-badge/uni-badge.vue'
export default {
components: {uniGrid,uniGridItem,uniBadge},
data() {
return {
list: [{
url: '/pages/app/saleOrder/index',
icon: 'icon-icon_dispose',
text: '销售订单',
icon_color: '#007aff',
access: 1,
// badge: '0',
type: "primary"
},{
url: '/pages/app/article/index',
icon: 'icon-icon_notice',
icon_color: '#22ac38',
text: '新闻公告',
access: 1,
// badge: '0',
type: "success"
},
{
url: '/pages/app/delivery/index',
icon: 'icon-icon_send',
icon_color: '#ff9900',
text: '发货列表',
access: 1,
// badge: '0',
type: "warning"
},{
url: '/pages/app/promotion/index',
icon: 'icon-icon_nomemo',
icon_color: '#22ac38',
text: '促销列表',
access: 1,
// badge: '0',
type: "warning"
},{
url: '/pages/app/approach/index',
icon: 'icon-icon_synergy',
icon_color: '#007aff',
text: '进店列表',
access: 1,
// badge: '0',
type: "warning"
},{
url: '/pages/app/workflow/index',
icon: 'icon-icon_subordinate',
icon_color: '#9370DB',
access: 1,
text: '工作流程',
//badge: '0',
type: "warning"
},{
url: '/pages/app/workflow/index',
icon: 'icon-icon_task_done',
icon_color: '#007aff',
access: 1,
text: '工作任务',
// badge: '0',
type: "warning"
},{
url: '/pages/app/workflow/index',
icon: 'icon-icon_calendar',
icon_color: '#ff9900',
access: 1,
text: '个人日程',
// badge: '0',
type: "warning"
},{
url: '/pages/app/workflow/index',
icon: 'icon-icon_group',
icon_color: '#22ac38',
access: 1,
text: '客户列表',
// badge: '0',
type: "warning"
}
]
}
},
onLoad() {
},
methods: {
openURL(item) {
uni.navigateTo({
url: item.url
});
}
}
}
</script>
<style>
view {
font-size: 14px;
line-height: inherit;
}
.content {
text-align: center;
padding: 15rpx;
}
.image {
width: 50rpx;
height: 50rpx;
}
.text {
font-size: 26rpx;
margin-top: 10rpx;
color: #666;
}
.grid-dynamic-box {
margin-bottom: 15px;
}
.grid-item-box {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 15px 0;
}
.grid-item-box .iconfont {
font-size: 80rpx;
}
.grid-dot {
position: absolute;
top: 5px;
right: 15px;
}
</style>
+84
View File
@@ -0,0 +1,84 @@
<template>
<view class="page_index">
<iframe class="webview" ref="iframe" :src="url" id="iframe"></iframe>
</view>
</template>
<script>
export default {
data() {
return {
url: ''
}
},
mounted () {
var me = this;
uni.showLoading({
title:'页面加载中...',
});
const iframe = document.querySelector('#iframe');
iframe.onload = function () {
uni.hideLoading();
}
},
onLoad: function(options) {
var me = this;
document.title = options.title;
var url = decodeURIComponent(options.url);
var token = uni.getStorageSync('token');
if (token) {
me.url = me.$api.baseURL + '/' + url + '&x-auth-token=' + token;
} else {
me.$api.authorize();
}
},
methods: {
}
}
</script>
<style>
page {
height: auto;
min-height: 100%;
background-color: #f0f3f4;
font-size: 14px;
}
.uni-page-head {
border-bottom: 3px solid #333;
}
</style>
<style lang="scss" scoped>
.webview {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 0;
width: 100vw;
height: 100vh;
background-color: #f0f3f4;
}
.page_index {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.head {
position: relative;
transform: translateY(-50%);
.head_inner_title {
text-align: center;
font-size: 60rpx;
color: #007aff;
display: block;
}
.head_inner_description {
margin-top: 5rpx;
text-align: center;
font-size: 30rpx;
color: #666;
display: block;
}
}
</style>