123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478 |
- <template>
- <view class="content">
- <view class="filter-box">
- <u-search placeholder="请输入关键字" v-model="filterText" @search="setFilterText" @custom="setFilterText"></u-search>
- </view>
- <u-tabs-swiper ref="uTabs" :active-color="mainColor" :list="tabList" :current="current" @change="tabsChange"
- :is-scroll="false"></u-tabs-swiper>
- <swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" class="swiper-box">
- <swiper-item class="swiper-item" v-for="(item, index1) in tabList" :key="index1">
- <scroll-view scroll-y class="scroll-box" @scrolltolower="handleLoadMore" :refresher-enabled="true"
- :refresher-triggered="triggered" :refresher-threshold="100" refresher-background="white" @refresherrefresh="onRefresh"
- @refresherrestore="onRestore">
- <u-card :show-head="false" :foot-border-top="false" margin="10px 15px" borderRadius="40" :foot-style="{padding: '0 10px 5px 0'}" v-for="(site, index2) in item.tableList"
- :key="index2" class="card-box" @click="goToOrderList(site)">
- <view slot="body" class="card-content">
- <view class="student-info">
- <view class="info-name">{{site.studentName}}</view>
- <!-- <view class="info-type" :class="site.status == 1 ? 'info-type-active' : ''">{{site.status == 0 ? '未报名' : '已报名'}}</view> -->
- <view class="info-name" style="width:100px;">{{site.parentName}}</view>
- <view class="info-phone">{{site.parentPhone}}</view>
- </view>
- <!-- <u-image width="28px" height="28px" :src="site.type == 2 ? iconPath1 : iconPath2"></u-image> -->
- </view>
- <view class="venue-content" slot="foot" style="text-align: right;">
- <u-button style="margin-right:10px" type="warning" :ripple="true" shape="circle" :custom-style="handleCustomStyle" size="mini" @click="checkContract(site.id)">查看合同</u-button>
- <u-button v-if="current != 2" type="warning" :ripple="true" shape="circle" :custom-style="handleCustomStyle" size="mini" @click="handleInvalidClick(site.id,0)">无效</u-button>
- <u-button v-else type="warning" :ripple="true" shape="circle" :custom-style="handleCustomStyle" size="mini" @click="handleInvalidClick(site.id,1)">有效</u-button>
- </view>
- <!--<view class="venue-content" slot="foot" style="text-align: right;" v-else>
- <u-button type="warning" :ripple="true" shape="circle" :custom-style="handleCustomStyle" size="mini" @click="handleInvalidClick(site.id)">查看合同</u-button>
-
- </view>-->
- </u-card>
- <u-divider v-if="item.isOver" bg-color="transparent" :style="{paddingTop : item.tableList.length == 0 ? '10px' : ''}">没有更多了</u-divider>
- </scroll-view>
- </swiper-item>
- </swiper>
- <!-- 新增客户 -->
- <u-icon v-if="userId!=274" name="plus-circle-fill" :color="mainColor" size="96" class="fix-add-icon" @click="handleAddApplyClick"></u-icon>
- <!-- 无效备注 -->
- <u-popup v-model="invalidShow" mode="center" border-radius="30" width="600rpx">
- <view class="common-title">备注</view>
- <view class="menber-box">
- <u-form :model="invalidForm" ref="invalidFormRef" label-width="140">
- <u-form-item label="备注" prop="content" required>
- <u-input v-model="invalidForm.content" type="text" />
- </u-form-item>
- </u-form>
- <view style="height:20px;"></view>
- <u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="handleConfirmClick">确定</u-button>
- </view>
- </u-popup>
- <u-popup v-model="contractShow" mode="center" border-radius="30" width="600rpx" height="500px">
- <view class="common-title">合同列表</view>
- <view class="menber-box" style="overflow-y: auto;height:390px;">
- <template v-for="(item, index) in contractUrls">
- <div v-if="item.payTime!=null">
- <view class="orderNumber">
- {{item.orderNumber}}
- </view>
- <view class="card-item" :key="index0" @click="handleContractShowClick(item0)" v-for="(item0, index0) in item.url">
- {{ item0.name }}
- </view>
- </div>
- </template>
- </view>
- <view class="button-box">
- <u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="contractShow = false">确定</u-button>
- </view>
- </u-popup>
- <u-top-tips ref="uTips"></u-top-tips>
- </view>
- </template>
- <script>
- import {
- mapGetters
- } from 'vuex'
- const NET = require('@/utils/request')
- const API = require('@/config/api')
- export default {
- computed: {
- ...mapGetters([
- 'mainColor',
- 'customStyle',
- 'handleCustomStyle',
- 'handleDefaultCustomStyle',
- ])
- },
- data() {
- return {
- userId:'',
- contractShow:false,
- contractUrls:[
- ],
- filterText: '',
- triggered: false,
- tabList: [
- {
- name: '已报名',
- isOver: false,
- pageIndex: 1,
- filterText: '',
- type: 1,
- tableList: [],
- }, {
- name: '已续费',
- isOver: false,
- pageIndex: 1,
- filterText: '',
- type: 2,
- tableList: [],
- }, {
- name: '无效',
- isOver: false,
- pageIndex: 1,
- filterText: '',
- type: 0,
- tableList: [],
- }],
- current: 0,
- swiperCurrent: 0,
- iconPath1: API.getServerImg + 'weibaoming.png',
- iconPath2: API.getServerImg + 'xianshangkehu.png',
- // 无效备注
- invalidShow: false,
- // 备注
- invalidForm: {
- customerId: null,
- content: '',
- joinState: 0
- },
- // 备注校验规则
- invalidRules: {
- content: [
- {
- required: true,
- message: '请输入备注',
- trigger: 'change'
- }],
- }
- }
- },
- onShow() {
- this.userId=uni.getStorageSync('userData').userId
- this.tabList = Object.assign([], this.$options.data().tabList)
- this.getTableList(0)
- this.getTableList(1)
- this.getTableList(2)
- },
- onReady() {},
- methods: {
- // 跳转添加信息
- handleAddApplyClick() {
- uni.navigateTo({
- url: '/pagesEnroll/enrolledForm'
- });
- },
- // 备注弹窗显示
- handleInvalidClick(id,type) {
- this.invalidForm.joinState=type
- this.invalidForm.customerId = id
- this.$refs.invalidFormRef.setRules(this.invalidRules)
- this.invalidShow = true
- },
- // 无效备注确认
- handleConfirmClick(){
- this.$refs.invalidFormRef.validate(valid => {
- if (valid) {
- NET.request(API.updateCustomerState, {...this.invalidForm}, 'POST').then(res => {
- if(res.status == 10000) {
- this.invalidShow = false
- this.tabList = this.$options.data().tabList
- this.getTableList(0)
- this.getTableList(1)
- this.getTableList(2)
- } else {
- this.invalidShow = false
- this.$refs.uTips.show({
- title: error.msg,
- type: 'warning',
- })
- }
- })
- }
- })
- },
- // 设置过滤字段
- setFilterText(value) {
- this.tabList[this.current].filterText = value
- this.onRefresh()
- },
- // tab页面切换
- tabsChange(index) {
- this.swiperCurrent = index;
- },
- // swiper-item左右移动,通知tabs的滑块跟随移动
- transition(e) {
- let dx = e.detail.dx;
- this.$refs.uTabs.setDx(dx);
- },
- // swiper滑动结束,分别设置tabs和swiper的状态
- animationfinish(e) {
- let current = e.detail.current;
- this.$refs.uTabs.setFinishCurrent(current);
- this.swiperCurrent = current;
- this.current = current;
- },
- // 下拉刷新
- onRefresh() {
- if (!this.triggered) {
- this.triggered = true
- this.tabList[this.current].isOver = false
- this.tabList[this.current].pageIndex = 1
- this.tabList[this.current].tableList = []
- this.getTableList(this.current, 'refresh')
- }
- },
- // 重置下拉刷新状态
- onRestore() {
- this.triggered = 'restore'
- this.triggered = false
- },
- // 懒加载
- handleLoadMore() {
- if (!this.tabList[this.current].isOver) {
- this.tabList[this.current].pageIndex++
- this.getTableList(this.current)
- }
- },
- // 获取列表数据
- getTableList(index) {
- NET.request(API.getCustomerList, {
- isSignUp: 0,
- name: this.tabList[index].filterText,
- type: this.tabList[index].type,
- page: this.tabList[index].pageIndex,
- saleIsMeFlag: true,
- size: 10,
- }, 'POST').then(res => {
- this.triggered = false
- this.tabList[index].tableList = this.tabList[index].tableList.concat(res.data.row)
- this.tabList[index].isOver = res.data.row.length != 10
- }).catch(error => {
- this.triggered = false
- this.$refs.uTips.show({
- title: error.msg,
- type: 'warning',
- })
- })
- NET.request(API.getOrderContract, {
- customerId: 23185
- }, 'GET').then(res => {
-
- }).catch(error => {
- this.triggered = false
- this.$refs.uTips.show({
- title: error.msg,
- type: 'warning',
- })
- })
- },
- // 跳转到报名详情
- goToOrderList(item) {
- uni.navigateTo({
- url: `/pagesMain/customerInfo?id=${item.id}&title=客户信息`
- })
- },
- checkContract(id) {
- this.contractShow = true
- this.contractUrls = []
- NET.request(API.getOrderContract, {
- customerId: id
- }, 'GET').then(res => {
- this.contractUrls = res.data
- }).catch(error => {
- this.triggered = false
- this.$refs.uTips.show({
- title: error.msg,
- type: 'warning',
- })
- })
-
- },
- // 查看合同
- handleContractShowClick(item) {
- console.log(item);
- uni.downloadFile({
- url: item.url,
- success: (res) => {
- console.log(res);
- uni.openDocument({
- filePath: res.tempFilePath,
- });
- }
- })
- },
- },
- }
- </script>
- <style>
- page {
- width: 100%;
- height: 100%;
- background-color: #f7f7f7;
- }
- </style>
- <style lang="scss" scoped>
- @import "@/static/css/themes.scss";
- .content {
- width: 100%;
- float: left;
- .filter-box {
- height: 48px;
- padding: 10px 15px;
- background-color: #FFFFFF;
- }
- .swiper-box {
- height: calc(100vh - 82px);
- .swiper-item {
- height: calc(100vh - 82px);
- .scroll-box {
- width: 100%;
- height: calc(100vh - 82px);
- .card-box {
- .card-content {
- display: flex;
- align-items: center;
- .student-info {
- flex: 1;
- .info-name {
- width: 64px;
- float: left;
- line-height: 28px;
- font-size: 14px;
- font-weight: bold;
- }
- .info-type {
- padding: 0 10px;
- margin-top: 3px;
- border-radius: 20px;
- float: left;
- line-height: 20px;
- font-size: 10px;
- color: #FFFFFF;
- background-color: #999999;
- }
- .info-type-active {
- background-color: $mainColor;
- }
- .info-phone {
- width: calc(100% - 64px);
- float: left;
- line-height: 28px;
- font-size: 12px;
- color: #999999;
- }
- }
- }
- }
- }
- }
- }
- }
- .menber-box {
- width: 100%;
- // float: left;
- padding: 10px 15px;
- margin-bottom: 10px;
-
- .menber-col {
- width: 100%;
- padding: 15px;
- margin-bottom: 10px;
- display: inline-block;
- background-color: #FFFFFF;
- border-radius: 15px;
- box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
- position: relative;
- overflow: hidden;
- box-sizing: border-box;
-
- .menber-label {
- width: 100%;
- margin-bottom: 5px;
- float: left;
- font-size: 14px;
- // line-height: 20px;
- }
-
- .menber-num {
- width: 100%;
- float: left;
- font-size: 26px;
- line-height: 28px;
- color: $mainColor;
- }
-
- .menber-icon {
- font-size: 100px;
- color: $mainColor;
- position: absolute;
- right: -5px;
- bottom: -30px;
- opacity: 0.5;
- }
- }
- }
- .common-title {
- width:100%;
- text-align: center;
- font-size: 20px;
- margin: 10px 0;
- }
- .fix-add-icon {
- position: fixed;
- bottom: 15px;
- right: 15px;
- z-index: 10;
- }
- .menber-box {
- width: 100%;
- padding: 10px 15px;
-
- .menber-col {
- width: 100%;
- padding: 15px;
- display: inline-block;
- background-color: #FFFFFF;
- border-radius: 15px;
- box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
- position: relative;
- overflow: hidden;
- box-sizing: border-box;
-
- .menber-label {
- width: 100%;
- font-size: 14px;
- // line-height: 20px;
- }
- .menber-num {
- width: 100%;
- font-size: 26px;
- line-height: 28px;
- color: $mainColor;
- }
- }
- }
- .common-title {
- width:100%;
- text-align: center;
- font-size: 20px;
- padding: 10px 0;
- }
- .card-item {
- width: 100%;
- padding:8px;
- border-radius: 10px;
- background-color: #ff6e3e;
- margin-bottom: 8px;
- color: #fff;
- }
- .orderNumber{
- margin-bottom: 6px;
- }
- </style>
|