| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356 |
- <template>
- <!--
- swiper中的transfrom会使fixed失效,此时用height固定高度;
- swiper中无法触发mescroll-mixins.js的onPageScroll和onReachBottom方法,只能用mescroll-uni,不能用mescroll-body
- -->
- <!-- ref动态生成: 字节跳动小程序编辑器不支持一个页面存在相同的ref (如不考虑字节跳动小程序可固定值为 ref="mescrollRef") -->
- <!-- top的高度等于悬浮菜单tabs的高度 -->
- <mescroll-uni :ref="'mescrollRef' + i" @init="mescrollInit" :height="height" :down="downOption" @down="downCallback"
- :up="upOption" @up="upCallback" @emptyclick="emptyClick">
- <view>
- <view class="service-order " v-for="(item,index) in list" :key="index">
- <!-- 门店列表 -->
- <view class="store-wrap" >
- <view :class="{ 'grayscale': item.forstStatus === '1' }">
- <view @click="orderDetail(item)" class="">
- <view class="store-list">
- <view class="store-content">
- <view class="content">
- <view class="desc flex-row justify-start ">
- <view :class="item.serviceAttribute == 1? 'service-type':'service-mode'">
- {{item.serviceAttrDesc}}
- </view>
- </view>
- </view>
- </view>
- <view class="order-state-name">
- <text class="h-text1">{{ item.forstStatus === '1' ? '已冻结' : item.orderStatusDesc }}</text>
- </view>
- </view>
- <view class="order-state">
- <view class="order-num">
- <view class="h-order-num">
- <image src="/static/index/u217.png" mode=""></image>订单编号:{{ item.orderNo }}
- </view>
- <view class="h-order-text">
- <text> {{item.serviceType }} </text>
- </view>
- </view>
- </view>
- <view class="flex-row justify-between ">
- <view class="flex-col detail11 ">
- <view class="d-item-row ">
- <view class="item-icon">
- <image src="/static/order/ud1.png" mode=""></image>
- </view>
- <view class="item-text">
- 服务对象:<text class="item-v">{{ item.serviceObjectName }}</text>
- </view>
- </view>
- <view class="d-item-row ">
- <view class="item-icon">
- <image src="/static/order/ud2.png" mode=""></image>
- </view>
- <view class="item-text">
- 服务门店:<text class="item-v">{{ item.storeName }}</text>
- </view>
- </view>
- <view class="d-item-row ">
- <view class="item-icon">
- <image src="/static/order/ud14.png" mode=""></image>
- </view>
- <view class="item-text">
- 下单时间:<text class="item-v">{{ item.createTime }}</text>
- </view>
- </view>
- </view>
- <view class="flex-col justify-center" v-if="item.serviceAttribute == 1">
- <view class="planNumber flex-row justify-center">
- <text>{{ item.planNumber || '未排号' }}</text>
- </view>
- <view class="planNumber1 flex-row justify-center">
- <text>排号</text>
- </view>
- </view>
- </view>
- <view class="detail flex-row justify-between" v-if="item.serviceAttribute == '2' " >
- <view class="flexLR">
- <view>
- <view class="d-item-row ">
- <view class="item-icon">
- <image src="/static/order/ud3.png" mode=""></image>
- </view>
- <view class="item-text">
- 服务日期:<text class="item-v">{{item.serviceDate.substring(0,10) || ''}}</text>
- </view>
- </view>
- <view class="d-item-row ">
- <view class="item-icon">
- <image src="/static/order/ud3.png" mode=""></image>
- </view>
- <view class="item-text">
- 服务时段:<text>{{item.serviceStartTime || ''}}</text>
- </view>
- </view>
- <view class="d-item-row ">
- <view class="item-icon">
- <image src="/static/order/ud3.png" mode=""></image>
- </view>
- <view class="item-text">
- 服务技师:<text class="item-v">{{item.servicePersonName || '签到成功自动分配'}}</text>
- </view>
- </view>
- </view>
- <view class=" flex-col justify-center">
- <view class="planNumber flex-row justify-center">
- <text>{{ item.planNumber || '未排号' }}</text>
- </view>
- <view class="planNumber1 flex-row justify-center">
- <text>预约号</text>
- </view>
- </view>
- </view>
- </view>
- <view class="price" v-if="item.serviceAttribute == 2">
- 预约金额:<text class="fontColor"> ¥{{ item.subAmount || 0}}</text>
- </view>
- <view class="price">
- 订单总金额:<text class="fontColor"> ¥{{ item.totalAmount || 0}}</text>
- </view>
- </view>
- <view class="nav-bar">
- <view class="btn" v-if="item.orderStatus != 2 && item.orderStatus != 9 && item.orderStatus != 3" @click="scanCodeOrder(item)">
- <u-icon name="scan" size="18" />
- <text>扫码</text>
- </view>
- <view class="btn" v-if="item.orderStatus == 6" @click="oneClickPay(item)">
- <text>一键付款</text>
- </view>
- <view class="btn" v-if="item.orderStatus == 5 || item.orderStatus == 11" @click="cancelOrder(item)">
- <text>取消</text>
- </view>
- <view @click="appointment(item)" class="btn" v-if="item.orderStatus == 9">
- <text>去支付预约费用</text>
- </view>
- <!-- <view @click="orderSign(item)" v-else-if="item.orderStatus == 4" class="btn">-->
- <!-- 立即排队-->
- <!-- <!– <text class="text1">点击开始排号</text> –>-->
- <!-- </view>-->
- <!-- <view @click="getOrderSign(item)" class="btn" v-else-if="item.orderStatus == 5">-->
- <!-- <text>点击查看排号</text>-->
- <!-- </view>-->
- <!-- <view class="btn" v-else-if="item.orderStatus == 6">-->
- <!-- <text>服务中</text>-->
- <!-- </view>-->
- <!-- <view class="btn" v-else-if="item.orderStatus == 7">-->
- <!-- <text>排号过期</text>-->
- <!-- </view>-->
- <!-- <view @click="gotoEvaluate(item)" class="btn" v-else-if="item.orderStatus == 8">-->
- <!-- <text>待评价</text>-->
- <!-- </view>-->
- </view>
- </view>
- </view>
- </view>
- </view>
- </mescroll-uni>
- </template>
- <script>
- import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
- import MescrollMoreItemMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mixins/mescroll-more-item.js"
- export default {
- mixins: [MescrollMixin, MescrollMoreItemMixin], // 注意此处还需使用MescrollMoreItemMixin (必须写在MescrollMixin后面)
- components: {},
- data() {
- return {
- downOption: {
- auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
- },
- upOption: {
- auto: false, // 不自动加载
- // page: {
- // num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
- // size: 10 // 每页数据的数量
- // },
- noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
- empty: {
- icon: '/static/imageIcon/empty.png',
- tip: '暂无内容', // 提示
- // btnText: '去看看'
- },
- textNoMore: '没有更多了'
- },
- list: [],
- }
- },
- props: {
- i: Number, // 每个tab页的专属下标 (除了支付宝小程序必须在这里定义, 其他平台都可不用写, 因为已在MescrollMoreItemMixin定义)
- index: { // 当前tab的下标 (除了支付宝小程序必须在这里定义, 其他平台都可不用写, 因为已在MescrollMoreItemMixin定义)
- type: Number,
- default () {
- return 0
- }
- },
- dataTime: {
- type: String,
- default () {
- return ''
- }
- },
- tabs: { // 为了请求数据,演示用,可根据自己的项目判断是否要传
- type: Array,
- default () {
- return []
- }
- },
- height: [Number, String], // mescroll的高度
- },
- watch: {
- },
- created() {
- this.userInfo = uni.getStorageSync('userInfo')
- },
- methods: {
- appointment(order){
- console.log('+++++++++++++++')
- this.$emit('openPayAppointment',order,2)
- },
- oneClickPay(order){
- this.$emit('openPay',order,1)
- },
- scanCodeOrder(item){
- let that = this
- uni.scanCode({
- scanType: ['qrCode'],
- success: function (res) {
- let json = JSON.parse(res.result)
- if(json.storeId != item.storeId){
- uni.showToast({
- icon: 'error',
- duration: 3000,
- title: '请扫描订单门店二维码'
- });
- return
- }
- uni.navigateTo({
- url:'/orderPages/serviceItems/index?serviceStationId='+ json.stationId + '&orderId='+item.orderId + '&serviceObjectId=' + item.serviceObjectId
- })
- },
- })
- },
- /*下拉刷新的回调 */
- downCallback() {
- // 这里加载你想下拉刷新的数据, 比如刷新轮播数据
- // loadSwiper();
- // 下拉刷新的回调,默认重置上拉加载列表为第一页 (自动执行 page.num=1, 再触发upCallback方法 )
- this.mescroll.resetUpScroll()
- },
- /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
- upCallback(page) {
- let status = this.index
- if (this.index === 3){
- status = 4
- }
- //联网加载数据
- let httpData = {
- pageNum: page.num,
- pageSize: 10,
- orderType:'SERVICE',
- status:status
- }
- this.$api.getOrderList(httpData).then((res) => {
- //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
- this.mescroll.endSuccess(res.data.rows.length, res.data.rows.length === 10);
- //设置列表数据
- if (page.num === 1) this.list = []; //如果是第一页需手动制空列表
- this.list = this.list.concat(res.data.rows); //追加新数据
- console.log(this.list)
- }).catch((err) => {
- //联网失败, 结束加载
- this.mescroll.endErr();
- })
- },
- //点击空布局按钮的回调
- emptyClick() {
- uni.showToast({
- title: '点击了按钮,具体逻辑自行实现'
- })
- },
- // 搜索
- doSearch() {
- this.list = []; // 先清空列表,显示加载进度
- this.mescroll.resetUpScroll();
- },
- cancelOrder(item){
- console.log('++++++++++++++++++++',item)
- uni.showModal({
- content: '请确认是否取消订单!',
- success: function (res) {
- if (res.confirm) {
- let that = this
- this.$api.cancelOrder({
- orderId:item.orderId
- }).then(res=>{
- that.downCallback()
- that.$api.getUserInfo().then( res=> {
- uni.setStorageSync('userInfo', res.data.data);
- });
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }.bind(this)
- })
- },
- orderDetail(item) {
- uni.navigateTo({
- url:'/orderPages/orderDetail/index?id='+ item.orderId
- })
- }
- }
- }
- </script>
- <style>
- @import '/common/css/common.css';
- @import './index.rpx.css';
- </style>
|