| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475 |
- <template>
- <view class="page-container">
- <webviewPoint ref="webviewRef"/>
- <z-paging ref="paging" v-model="dataList"
- :paging-style="{
- background: 'linear-gradient(180deg, #C1FFF8 0%, #B8FFF3 34%, #F5FFFF 100%)'
- }" @query="queryList">
- <template #top>
- <view class="tab-box">
- <view v-for="(item,index) in statusList" :key="index"
- :class="{ item: true, active: current === index }"
- @click="onTabChange(item.code, index)">
- {{item.info}}
- </view>
- </view>
- </template>
- <view class="list-box" v-if="dataList && dataList.length > 0">
- <view class="item" v-for="(item,index) in dataList" :key="index">
- <view class="lTitle" @click="goDetails(item.cId)">
- <view style="font-weight: bold;">上门时间:{{item.dtCreateTime}}</view>
- <!-- <view class="status">{{item.nStatus === 0 ? "待接单" : item.nStatus === 1 ? "服务中": item.nStatus === 2 ? "待评价": item.nStatus === 3 ? "已完成": item.nStatus === -1 ? "待付款" : item.nStatus === -2 ? "已取消" :'已拒绝'}}</view>-->
- <view class="status" :style="{color:item.statusName ==='已取消'?'#999':''}">{{item.statusName}}</view>
- </view>
- <view class="cont" @click="goDetails(item.cId)">
- <!-- <view>商家:{{item.js.cNickName}}</view> -->
- <view>项目:{{item.cGoods ? item.cGoods[0].cTitle : ''}}</view>
- </view>
- <!-- <view class="cont" @click="goDetails(item.cId)">
- <view>订单金额:</view>
- <view style="color: #333;font-weight: bold;">¥{{item.totalPrice}}</view>
- </view> -->
- <view class="cont" @click="goDetails(item.cId)">
- <view>下单时间:{{item.dtCreateTime}}</view>
- <!-- <view style="color: #333;font-weight: bold;">¥{{item.totalPrice}}</view> -->
- </view>
- <view class="btn">
- <view class="count_down">
- <text>¥</text>{{item.totalPrice}}
- <!-- 剩余<u-count-down :time="item.remainingTime" @finish="" v-if="item.dtCreateTime>0"></u-count-down> -->
- </view>
- <view class="button">
- <text class="pay" @click="onCancleOrder(item)" v-if="[0, 1, 2, 3, 6].includes(item.nStatus)">取消订单</text>
- <text class="pay" @click="onCancleApply(item)" v-if="item.nStatus == 7">取消申请</text>
- <text class="pay" @click="onPayOrder(item)" v-if="item.nStatus == -1 && item.nStatus < 1">支付订单</text>
- <text class="pay" @click="goEvaluate(item)" v-if="item.nStatus == 4">去评价</text>
- <text class="pay" @click="onDelOrder(item)" v-if="item.nStatus <= -2 || item.nStatus == 5">删除订单</text>
- </view>
- </view>
- </view>
- </view>
- <template v-slot:empty>
- <u-empty
- :text="!isLogin ? '您还没有登录' : '您还没有相关订单呦~'"
- icon="/static/common/logo1.png"
- >
- <u-button
- size="small"
- text="去登录"
- color="linear-gradient(to right, #35c99d, #27aea7)"
- :customStyle="{ marginTop: '20rpx' }"
- v-if="!isLogin"
- @click="goLogin"
- >
- </u-button>
- </u-empty>
- </template>
- </z-paging>
- <!-- 取消订单弹窗 -->
- <u-popup :show="cancelOrderPopup.show" mode="center" :width="700" :round="10" closeable @close="closePopup">
- <view class="popup-content">
- <view v-if="cancelOrderPopup.isOk" class="success-tip">{{ cancelOrderPopup.successTip }}</view>
- <view v-else>
- <uni-table border stripe>
- <uni-tr class="table-header">
- <uni-th width="200rpx" align="center">项目</uni-th>
- <uni-th width="150rpx" align="center">实付金额</uni-th>
- <uni-th width="180rpx" align="center">已服务时间</uni-th>
- </uni-tr>
- <uni-tr v-for="(item, index) in cancelOrderPopup.orderList" :key="index">
- <uni-td align="center"> {{ item.cTitle }} </uni-td>
- <uni-td align="center"> {{ item.dYuanPrice }} </uni-td>
- <uni-td align="center"> {{ item.serviceDuration }} </uni-td>
- </uni-tr>
- </uni-table>
- <u--textarea v-model="cancelOrderPopup.reason" placeholder="请输入退单原因" count maxlength="50" class="reson"></u--textarea>
- </view>
- <view v-if="!cancelOrderPopup.isOk" class="popup-btn">
- <u-button size="small" plain shape="circle" text="取消" style="margin-right: 50rpx;" @click="closePopup"></u-button>
- <u-button size="small" shape="circle" type="error" text="提交申请" @click="onSubmitApply"></u-button>
- </view>
- <view class="popup-btn">
- <u-button v-if="cancelOrderPopup.isOk" size="small" shape="circle" color="linear-gradient(135deg, #1AD8CF 0%, #21C8C0 100%)" text="确认" @click="closePopup"></u-button>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import {
- getIsLottery,
- getStatusList,
- } from '@/api/index.js';
- import {
- delOrder,
- cancleOrder,
- cancleApply,
- orderDeatails,
- } from '@/api/order.js';
- import webviewPoint from "@/components/webviewPoint.vue";
- export default {
- components: { webviewPoint },
- data() {
- return {
- dataList: [],
- current: 0,
- statusList: [],
- nStatus: '',
- isLogin: false,
- // 取消订单
- cancelOrderPopup: {
- show: false, // 弹窗显示状态
- isOk: false, // 是否确认
- successTip: '您的申请已提交,客服审核中,请注意接听客服电话:19936963696',
- orderList: [],
- orderInfo: null, // 当前要取消的订单信息
- cId: '', // 订单ID
- reason: '' // 用户输入的取消原因
- }
- }
- },
- onLoad(query) {
- this.isLogin = !!uni.getStorageSync('wx_copenid');
- },
- onShow() {
- var _this = this;
- getIsLottery({types:[1,3]}).then(res=>{
- if(res.data.data?.isLottery === 1){
- _this.$refs.webviewRef?.getRow(res.data.data);
- }
- })
- this.getStatus()
- },
- methods: {
- queryList(pageNo, pageSize) {
- let params = {
- current: pageNo,
- size: pageSize,
- cOpenId: uni.getStorageSync('wx_copenid'),
- nStatus: this.nStatus,
- }
- orderDeatails(params).then(res => {
- if (res.data.code === 200) {
- this.dataList = res.data.data.records;
- // let data = res.data.data.records.forEach(item => {
- // item.dtCreateTime = item.dtCreateTime.replace('T', ' ')
- // });
- this.$refs.paging.complete(this.dataList);
- } else {
- this.$refs.paging.complete([]);
- }
- });
- },
- onPayOrder(item) {
- if (item.remainingTime <= 0) {
- uni.showToast({
- title: '订单已超时',
- icon: 'none'
- })
- } else {
- let str = uni.$u.queryParams({
- page: 'order',
- orderNo: item.orderNo
- });
- uni.navigateTo({
- url: `/pages/identify/pay_order${str}`
- })
- }
- },
- // 取消退单申请
- onCancleApply(item) {
- uni.showModal({
- title: '提示',
- content: '确定取消退单申请吗?',
- showCancel: true,
- success: (res) => {
- if (res.confirm) {
- let params = {
- cId: item.cId
- }
- cancleApply(params).then(res => {
- if (res.data.code == 200) {
- this.$refs.paging.reload();
- uni.showToast({
- title: '已取消',
- icon: 'none'
- })
- } else {
- uni.showToast({
- title: res.data.msg,
- icon: 'none'
- })
- }
- })
- }
- }
- })
- },
- // 取消订单
- onCancleOrder(item) {
- this.cancelOrderPopup.cId = item.cId
- this.cancelOrderPopup.orderList = item.cGoods || []
- this.cancelOrderPopup.show = true;
- },
- // 提交退单申请
- onSubmitApply() {
- if (this.cancelOrderPopup.reason === '') {
- uni.showToast({
- title: '请输入退单原因',
- icon: 'none'
- })
- return
- }
- let params = {
- cId: this.cancelOrderPopup.cId,
- cancelReason: this.cancelOrderPopup.reason
- }
- cancleOrder(params).then(res => {
- if (res.data.code == 200) {
- this.cancelOrderPopup.isOk = true
- this.$refs.paging.reload();
- } else {
- uni.showToast({
- title: res.data.msg,
- icon: 'none'
- })
- }
- })
- },
- // 关闭弹窗
- closePopup() {
- this.cancelOrderPopup.show = false;
- this.cancelOrderPopup.isOk = false;
- this.cancelOrderPopup.reason = '';
- },
- // 删除订单
- onDelOrder(item) {
- uni.showModal({
- title: '提示',
- content: '确定删除订单吗?',
- showCancel: true, // 是否显示取消按钮
- success: (res) => {
- if (res.confirm) {
- let params = {
- cId: item.cId
- }
- delOrder(params).then(res => {
- if (res.data.code == 200) {
- this.$refs.paging.reload();
- uni.showToast({
- title: '删除订单成功!',
- icon: 'none'
- })
- } else {
- uni.showToast({
- title: res.data.msg,
- icon: 'none'
- })
- }
- })
- }
- }
- })
- },
- getStatus() {
- getStatusList().then(res => {
- this.statusList = res.data.data,
- this.nStatus = '';
- // 判断其它页面跳转过来
- let orderTab = this.$store.state.other.orderTab;
- if (orderTab !== '') {
- let i = this.statusList.findIndex(item => item.code === orderTab);
- // 请求数据
- this.onTabChange(orderTab, i);
- // 赋值完成后清除
- this.$store.dispatch('setOrderTab', '');
- }
- });
- },
- // 切换订单
- onTabChange(code, index) {
- this.current = index;
- this.nStatus = code;
- this.$refs.paging.reload();
- },
- // 跳转订单详情
- goDetails(cid) {
- let str = uni.$u.queryParams({
- cid
- });
- uni.navigateTo({
- url: `/pages/order/order_detail${str}`
- });
- },
- goEvaluate(item) {
- console.log(item)
- let str = uni.$u.queryParams({
- orderNo: item.orderNo,
- cId: item.cId,
- cJsId: item.cJsId,
- cName: item.js.cName,
- nickName:item.wxUser.nickName
- });
- uni.navigateTo({
- url: `/pages/order/comment${str}`
- });
- },
- goLogin() {
- uni.navigateTo({
- url: '/setting/myNew/phone',
- })
- // uni.navigateTo({
- // url: '/pages/login/wxLogin'
- // })
- },
- },
- }
- </script>
- <style scoped lang="scss">
- .page-container {
- background: linear-gradient(180deg, #C1FFF8 0%, #B8FFF3 34%, #F5FFFF 100%);
- .tab-box {
- height: 90rpx;
- display: flex;
- justify-content: space-around;
- align-items: center;
- font-size: 30rpx;
- z-index: 999;
- background: radial-gradient(circle, #fcfdff, #fcfdff);
- .item {
- height: 100%;
- padding: 0 10rpx;
- background-color: #fff;
- display: flex;
- align-items: center;
- }
- .active {
- font-weight: 400;
- font-size: 30rpx;
- color: #03C8BE;
- position: relative;
- &::after{
- content: '';
- width: 36rpx;
- height: 4rpx;
- position: absolute;
- bottom: 0;
- left: 50%;
- transform: translateX(-50%);
- background-color: #03C8BE;
- }
- }
- }
- .list-box {
- flex: 1;
- padding: 32rpx;
- .item {
- width: 100%;
- padding: 24rpx 32rpx;
- margin-bottom: 10rpx;
- font-size: 28rpx;
- margin-bottom: 28rpx;
- box-sizing: border-box;
- background: #FFFFFF;
- box-shadow: 0px 4px 12px 0px rgba(88, 209, 187, 0.1);
- border-radius: 24px 24px 24px 24px;
- .lTitle {
- display: flex;
- justify-content: space-between;
- border-bottom: 1px solid #eeeeee;
- margin-bottom: 10rpx;
- padding-bottom: 20rpx;
- font-size: 28rpx;
- .status {
- color: #03C8BE;
- }
- }
- .cont {
- color: rgb(162, 162, 162);
- font-size: 26rpx;
- line-height: 45rpx;
- }
- .btn {
- height: 48rpx;
- margin-top: 20rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .count_down {
- font-size: 26rpx;
- color: #F53E54;
- text {
- font-size: 20rpx;
- }
- }
- .button {
- .pay {
- display: inline-block;
- background-color: rgb(46, 188, 215);
- color: #fff;
- margin-left: 20rpx;
- padding: 0rpx 30rpx;
- height: 48rpx;
- line-height: 48rpx;
- background: linear-gradient(135deg, #1AD8CF 0%, #21C8C0 100%);
- border-radius: 98rpx 98rpx 98rpx 98rpx;
- }
- .cancel {
- width: 152rpx;
- height: 48rpx;
- border-radius: 98rpx;
- border: 2rpx solid #BBBBBB;
- padding: 5rpx 30rpx;
- }
- }
- }
- }
- }
- .popup-content {
- width: 90vw;
- padding: 100rpx 30rpx 30rpx;
- box-sizing: border-box;
- .table-header {
- background-color: #FBFBFB;
- }
- .success-tip {
- padding: 50rpx;
- font-size: 32rpx;
- text-align: center;
- margin-bottom: 30rpx;
- }
- .reson {
- margin: 30rpx;
- }
- .popup-btn {
- padding: 0 80rpx;
- display: flex;
- justify-content: space-between;
- }
- }
- }
- </style>
|