123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473 |
- <template>
- <view class="app">
- <view class="app-body">
- <!--关键词搜索-->
- <view class="sreach fx-r fx-bc fx-ac">
- <image class="icon" src="/static/img/tb-seach.png"></image>
- <input type="text" v-model="keyword" placeholder="请输入用户昵称/用户ID" placeholder-style="color: #B3B3B3;" />
- <view class="fx-g1"></view>
- <view class="search-btn" @tap="tapSerach">搜索</view>
- </view>
- </view>
-
- <view class="search-tm fx-r">
- <view class="item fx-r fx-bc fx-ac" @tap="tapTime">
- <view class="text">{{ selectDate || '开馆时间' }}</view>
- <image src="/static/img/c-ytime.png" class="icon"></image>
- </view>
-
- <view class="item fx-r fx-bc fx-ac" @tap="tapCg">
- <view class="text">{{ gzItem.id == 0 ? '全部场馆' : gzItem.nickname }}</view>
- <u-icon name="arrow-down" class="icon"></u-icon>
- </view>
- </view>
-
- <scroll-view scroll-y class="scroll" :style="'height: calc(100vh - ' + hFoot + 'px - 140px);'" @scrolltolower="loadMoreData">
- <view class="sc-body">
- <view class="item" v-for="(item,index) in listAr">
- <view class="info fx-r fx-bc">
- <view class="nickname">{{ item.nickname }}</view>
- <view class="fx-r fx-bc" @tap="tapCall(item.mobile)">
- <view class="mobile">{{ item.mobile }}</view>
- <image src="/static/img/call-tel.png" style="width: 15px;height: 15px;margin-left: 5px;"></image>
- </view>
- <view class="fx-g1"></view>
- <view v-if="item.gz_type == 'recycle'" class="status" style="font-size: 12px;color: #FF8034;">订单回收</view>
- <view v-if="item.gz_type == 'slim'" class="status" style="font-size: 12px;color: #FF8034;">已瘦身</view>
- <view v-if="item.gz_type == 'cf'" class="status" style="font-size: 12px;color: #FF8034;">已拆分</view>
- </view>
-
- <view class="info fx-r">
- <view class="id">ID号:{{ item.uid }}</view>
- <view class="fx-g1"></view>
- <view class="changci">订单号:{{ item.order_id }}</view>
- </view>
- <view class="info fx-r">
- <view class="id">卖家:{{ item.collection_nickname }}</view>
- <view class="fx-g1"></view>
- <view class="changci">电话:{{ item.collection_mobile }}</view>
- </view>
-
- <view class="info-list" v-for="item2 in item.sub_order">
- <view class="fx-r">
- <view class="iivi">子订单:{{ item2.order_id }}</view>
- <view class="fx-g1"></view>
- <view class="iivi">价格:<text style="color: red;font-weight: bold;">¥{{ item2.hanging_price }}</text></view>
- </view>
- </view>
- <view class="infos">
- <view class="info fx-r fx-bc">
- <view class="id">瘦身时间:{{ item.time }}</view>
- </view>
- </view>
-
- <view class="infos fx-r">
- <view class="time">订单价格:¥<text style="color: red;">{{ item.hanging_price }}</text></view>
- <view class="fx-g1"></view>
- <view class="sbtn" v-if="item.gz_type == ''" @tap="tapSs(item,index)">瘦身</view>
- <view class="sbtn ihover" v-if="item.gz_type == ''" @tap="tapHs(item,index)" hidden>回收</view>
- <view class="sbtn" v-if="item.gz_type == ''" @tap="tapCf(item,index)">拆分</view>
- </view>
-
- </view>
-
- <view v-if="listAr.length > 0">
- <view class="loading fx-r fx-ac fx-bc" v-if="page.isFrite && !page.isFoot">
- <image src="/static/img/xloading.png"></image>
- <text>正在载入更多...</text>
- </view>
- <view class="loading complete" :hidden="!page.isFoot">已加载全部</view>
- </view>
-
- <view v-if="listAr.length == 0 && isFirst">
- <u-empty
- mode="data"
- icon="/static/img/no-empty.png"
- ></u-empty>
- </view>
-
- </view>
- </scroll-view>
-
- <u-datetime-picker :show="isShowTime"
- v-model="selectTime"
- mode="date"
- @close="isShowTime = false"
- @confirm="tapCkTime"
- @cancel="isShowTime = false"
- ></u-datetime-picker>
-
-
- <u-popup :show="isPop" @close="isPop = false">
- <scroll-view style="height: 40vh;background: #fff;">
- <view class="pop-info">
- <view class="item ihover" @tap="tapGzItem(item)" v-for="item in gzData">{{ item.nickname }}</view>
- </view>
- </scroll-view>
-
-
- </u-popup>
-
- </view>
- </template>
- <script>
- import {mapState,mapMutations } from 'vuex';
- export default {
- computed: mapState(['user']),
- data() {
- return {
- isFirst:false,
- listAr:[],
- keyword : "",
- id : 0,
- hFoot : 0,
- selectTime : "",
- isShowTime : false,
- selectDate : "",
- gzData: [],
-
- isPop:false,
- gzItem : {
- name :"",
- id : 0
- },
-
- page:{
- isFirst:false,
- isLoad:false,
- isFoot:false,
- page:1
- },
- }
- },
- onLoad(options) {
- this.id = options.id || 0;
- this.initView();
- // #ifdef H5
- this.hFoot = 60;
- // #endif
- },
-
- methods: {
- ...mapMutations(['checkUserLogin']),
- /**
- * 加载基础配置
- */
- initView:function(){
- this.getData(true);
- this
- .request
- .get("gzAuction")
- .then(res => {
- if(res.code == 200){
- this.gzData = res.data;
- }
- });
-
- },
- /**
- * 获取数据
- */
- getData:function(isPull = false){
- if(this.page.isLoad) return;
- this.page.isLoad = true;
- if(isPull) {
- this.page.page = 1;
- this.page.isLoad = false;
- this.page.isFoot = false;
- }
- uni.showLoading({ title: '获取数据中..' });
- var post = {};
- post.page = this.page.page;
-
- this
- .request
- .post("gzOrder",{
- keyword : this.keyword,
- page : this.page.page,
- date : this.selectDate,
- auActionId : this.gzItem.id
- })
- .then(res => {
- uni.hideLoading();
- this.page.isFirst = true;
- this.page.isLoad = false;
- this.isFirst = true;
- if(isPull) {
- this.listAr = res.data.list;
- } else {
- this.listAr = this.listAr.concat(res.data.list);
- }
- //是否到底
- if(res.data.list.length != res.data.pageSize) {
- this.page.isFoot = true;
- }
- })
- .catch((res)=>{
- console.log(res);
- uni.hideLoading();
- uni.showModal({title: '系统提示',content: '加载失败,返回在尝试',showCancel: false});
- });
- },
-
- tapSerach:function(){
- this.getData(true);
- },
-
- tapTime:function(){
- this.isShowTime = true;
- },
-
- tapCkTime:function(ev){
- console.log(ev);
- this.isShowTime = false;
- this.selectDate = this.utils.date('Y-m-d',ev / 1000);
- this.getData(true);
- },
- //选择场馆
- tapCg:function(){
- this.isPop = true;
- },
-
- tapGzItem:function(item) {
- this.isPop = false;
- this.gzItem = item;
- this.getData(true);
- },
- /**
- * 确定要回收吗?
- * @param {Object} item
- */
- tapHs:function(item,index) {
- this.utils.showModal("你确定要回" + item.order_id + "订单吗?,回收之后订单所存在将会清理!", ()=>{
- uni.showLoading({ title:"操作..." });
- this
- .request
- .post("auctionOrderRecycle",{id:item.id})
- .then(res=>{
- uni.hideLoading();
- if(res.code == 200) {
- this.utils.Tip("回收成功");
- this.$set(this.listAr[index],'gz_type','recycle');
- } else {
- this.utils.Tip(res.msg);
- }
- })
- .catch(err=>{
- uni.hideLoading();
- this.utils.Tip("加载失败,请重新尝试");
- });
- });
- },
- /**
- * 订单要瘦身吗?
- */
- tapSs:function(item,index){
- this.utils.showModal("你确定要" + item.order_id + "订单瘦身吗?,瘦身之后,订单金额减少!", ()=>{
- uni.showLoading({ title:"操作..." });
- this
- .request
- .post("auctionOrderSlim",{id:item.id})
- .then(res=>{
- uni.hideLoading();
- if(res.code == 200) {
- this.utils.Tip("瘦身成功");
- this.$set(this.listAr[index],'price',res.data.price);
- this.$set(this.listAr[index],'gz_type','slim');
- } else {
- this.utils.Tip(res.msg);
- }
- })
- .catch(err=>{
- uni.hideLoading();
- this.utils.Tip("加载失败,请重新尝试");
- });
- });
- },
-
- tapCf:function(item,index){
- this.utils.showModal("你确定要" + item.order_id + "订单要拆分?,拆分之后,原有订单失效,生成新的2个订单。", ()=>{
- uni.showLoading({ title:"操作..." });
- this
- .request
- .post("auctionOrderCf",{id:item.id})
- .then(res=>{
- uni.hideLoading();
- if(res.code == 200) {
- this.utils.Tip("拆分成功");
- this.$set(this.listAr[index],'gz_type','cf');
- this.$set(this.listAr[index],'sub_order',res.data);
- } else {
- this.utils.Tip(res.msg);
- }
- })
- .catch(err=>{
- uni.hideLoading();
- this.utils.Tip("加载失败,请重新尝试");
- });
- });
- },
-
-
-
-
- loadMoreData:function() {
- if(this.page.isFoot || this.page.isLoad) {
- return;
- }
- this.page.page ++;
- this.getData();
- },
-
- tapCall:function(tel){
- if(tel == null) {
- this.utils.showAlert({
- title:"系统提示",
- content:"暂无联系方式"
- });
- return;
- }
- const info = uni.getSystemInfoSync();
- if(info.platform == 'android'){
- uni.showModal({
- content: "确认拨打" + tel,
- confirmText: "确定",
- cancelText: "取消",
- success:function(res){
- if(res.confirm){
- this.$store.dispatch('permission/requestPermissions', 'CALL_PHONE').then(res => {
- if(res !== 1) return;
- uni.makePhoneCall({
- phoneNumber: tel,
- });
- });
- }
- }
- });
- } else {
- uni.makePhoneCall({
- phoneNumber: tel
- });
- }
- }
- },
- }
- </script>
- <style lang="scss">
- .app-body{
- padding: 0px 20rpx;
- }
- .sreach{
- background: #fff;
- margin:20rpx 0;
- border-radius: 32rpx;
- padding: 16rpx 32rpx;
- .icon{
- width: 46rpx;
- height: 46rpx;
- }
- input{
- width: calc(100% - 46rpx - 16rpx - 50px);
- font-size: 16px;
- }
- .search-btn{
- font-size: 14px;
- color: #FF4C4C;
- }
- }
-
-
- .search-tm{
- background: #fff;
- .item{
- height: 40px;
- width: 50%;
- color: #787878;
- font-size: 14px;
- .icon{
- width: 10px;
- height: 10px;
- margin-left: 5px;
- }
- }
- }
-
- .sc-body{
- padding: 20rpx;
- .item{
- background: #FFFFFF;
- border-radius: 16rpx;
- padding: 26rpx 44rpx;
- margin-bottom: 10px;
- .info{
- margin-bottom: 10rpx;
- .nickname{
- font-weight: bold;
- font-size: 32rpx;
- color: #303133;
- }
- .mobile{
- font-weight: 500;
- font-size: 30rpx;
- color: #999999;
- margin-left: 10px;
- }
- .id{
- font-weight: 500;
- font-size: 26rpx;
- color: #666666;
- }
- .changci{
- font-weight: 500;
- font-size: 26rpx;
- color: #666666;
- text{
- color: #333333;
- }
- }
-
- }
- .infos{
- margin-top: 10px;
- border-top: 1px solid #f1f1f1;
- padding-top: 6px;
- .time{
- font-size: 14px;
- color: #666;
- }
- }
- }
- }
-
- .pop-info{
- .item{
- padding: 20rpx 0;
- text-align: center;
- border-bottom: 1px solid #f1f1f1;
- }
- }
-
- .infos{
- .sbtn{
- border-radius: 28rpx;
- border: 1px solid #EE2F72;
- height: 45rpx;
- font-size: 12px;
- padding: 0 10px;
- color: #EE2F72;
- text-align: center;
- line-height: 45rpx;
- margin-left: 6px;
- }
- }
-
- .info-list{
- padding: 10px 0;
- font-size: 12px;
- border-top: 1px solid #f1f1f1;
- }
-
- </style>
|