123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462 |
- <template>
- <view>
- <view v-if="orderList.length > 0">
- <view class='cancellate'>
- <view>
- <view class="order acea-row row-between">
- <view class="order_sn">订单号:{{orderData.order_sn}}</view>
- <view class="btn" @click="goBack">上一步</view>
- </view>
- <view class='list'>
- <view class="acea-row row-between header">
- <view class="info">
- <view class="name">共{{orderData.total_num}}件</view>
- </view>
-
- </view>
- <view class='item acea-row row-between-wrapper'>
- <view v-for="goods in orderList" :key="goods.cart_id" class='picTxt acea-row'>
- <view v-if="goods.refund_num > 0 && orderData.status == 0" class="checkbox" @click.stop="goodsCheck(goods)">
- <text v-if="goods.check" class="iconfont icon-xuanzhong1"></text>
- <text v-else class="iconfont icon-weixuanzhong"></text>
- </view>
- <view v-else class="checkbox">
- <text class="iconfont icon-weixuanzhong disabled"></text>
- </view>
-
- <view class='pictrue'>
- <image :src='goods.cart_info.product.image'></image>
- </view>
- <view class='text'>
- <view class='line1 name'>{{goods.cart_info.product.store_name}}</view>
- <view class='money acea-row row-middle'>
- <text>¥{{goods.cart_info.productAttr.price}}</text>
- </view>
- <view class="callate_bom acea-row row-between">
- <view class="callate_text refund_text">x{{goods.product_num}}</view>
- <view class='carnum acea-row row-center-wrapper'>
- <view class="reduce" :class="(goods.numSub || goods.refund_num == 1) ? 'on' : ''" @click.stop='subCart(goods)'>-</view>
- <view class='num'>{{goods.refund_num}}</view>
- <view class="plus" :class="(goods.max_count == goods.refund_num || goods.numAdd) ? 'on' : ''" @click.stop='addCart(goods)'>+</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class='footer acea-row row-between-wrapper' v-if="orderList.length > 0">
- <view>
- <view class="allcheckbox" @click.stop="checkboxAllChange">
- <text v-if="!isAllSelect" class="iconfont icon-weixuanzhong"></text>
- <text v-else class="iconfont icon-xuanzhong1"></text>
- 全选
- </view>
- </view>
- <view class='money acea-row row-middle'>
- <form @submit="goCallate" report-submit='true'>
- <button class='placeOrder' formType="submit">立即核销</button>
- </form>
- </view>
- </view>
- </view>
- <view v-else>
- <emptyPage title="暂无订单信息~"></emptyPage>
- </view>
- </view>
- </template>
- <script>
-
-
-
-
-
-
-
-
-
- import {
- verifierOrder, orderVerific
- } from '@/api/admin.js';
- import { getProductHot } from '@/api/store.js';
- import { mapGetters } from "vuex";
- import { toLogin } from '@/libs/login.js';
- import emptyPage from '@/components/emptyPage.vue'
- import { configMap } from '@/utils';
- const app = getApp();
- export default {
- components: {
- emptyPage
- },
- data() {
- return {
- loading: false, //是否加载中
- loadend: false, //是否加载完毕
- loadTitle: '加载更多', //提示语
- cartCount: 0,
- hostProduct: [],
- orderData: {},
- orderList: [],
- verify_code: '',
- mer_id: '',
- isAllSelect: true,
- selectValue: [],
- selectCountPrice: 0.00,
- isScan: 0,
- };
- },
- computed: mapGetters(['isLogin']),
- onReady(){},
- mounted: function() {},
- onLoad: function(options) {
- let that = this;
- that.verify_code = options.cal_code
- that.mer_id = options.mer_id
- that.isScan = options.is_jump
- },
- onShow: function() {
- if (this.isLogin == true) {
- this.getOrderData();
- }else{
- setTimeout(() =>{
- toLogin()
- }, 300);
- }
- },
- methods: {
- goBack: function() {
- if(this.isScan==1){
- uni.navigateTo({
- url: '/pages/admin/order_cancellation/index?mer_id='+this.mer_id
- });
- }else{
- uni.navigateBack();
- }
-
- },
- getOrderData(){
- let that = this
- verifierOrder(that.mer_id,that.verify_code)
- .then(res => {
- that.orderData = res.data
- that.orderList = res.data.orderProduct
- that.orderList.forEach((item) => {
- item.max_count = item.refund_num
- this.$set(item, "check", true);
- })
- }).catch(res => {
- that.$util.Tips({
- title: res
- });
- setTimeout(()=>{
- uni.switchTab({
- url: '/pages/user/index'
- });
- },500)
- })
- },
-
- subCart(goods) {
- if(goods.refund_num <= 0){
- return
- }else{
- if (goods.refund_num <= 1) {
- goods.refund_num = 1;
- goods.numSub = true;
- } else {
- goods.refund_num--
- goods.numAdd = false;
- }
- }
- },
-
- addCart(goods) {
- if(goods.max_count <= goods.refund_num){
- goods.refund_num = goods.max_count
- goods.numAdd = true;
- }else{
- goods.refund_num++
- goods.numSub = false;
- }
- },
- goCallate() {
- let that = this;
- let products = that.getSelectedProduct();
- if(products.length == 0){
- that.$util.Tips({
- title: '请勾选商品'
- });
- {
- // url: '/pages/admin/order_cancellation/index?mer_id='+that.mer_id
- // });
- }else{
- orderVerific(that.mer_id,that.orderData.order_id,{verify_code: that.verify_code,data: products})
- .then(res => {
- that.$util.Tips({
- title: res.message
- });
- that.getOrderData();
- })
- .catch(res => {
- that.$util.Tips({
- title: res
- });
- setTimeout(()=>{
- uni.navigateTo({
- url: '/pages/admin/order_cancellation/index?mer_id='+that.mer_id
- });
- },500)
- });
- }
-
- },
-
- getSelectedProduct(){
- let arr = []
- this.orderList.forEach((item) => {
- if(item.check && item.refund_num !=0){
- arr.push({id: item.order_product_id, num: item.refund_num})
- }
- })
- return arr
- },
-
- goodsCheck(goods) {
- goods.check = !goods.check
- this.cartAllCheck('goodsCheck')
- },
-
- checkboxAllChange() {
- this.isAllSelect = !this.isAllSelect
- this.cartAllCheck('allCheck')
- },
-
- cartAllCheck(type) {
- let tempArr = [], calArr = [];
- this.orderList.forEach((item) => {
- if((this.orderData.status == 0 && item.refund_num > 0)){
- calArr.push(item)
- }
- })
- if (type == 'goodsCheck') {
- tempArr = calArr.filter(item => {
- return item.check
- })
- this.isAllSelect = calArr.length == tempArr.length
- } else {
- calArr.forEach((item) => {
- item.check = this.isAllSelect
- if(item.check)tempArr.push(item)
- })
- }
-
- this.isAllSelect = tempArr.length == calArr.length ? true : false
- },
- },
- onReachBottom() {
-
- },
-
- onPageScroll(e) {
- // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
- uni.$emit('scroll');
- }
- }
- </script>
- <style scoped lang="scss">
- page {
- background: #F5F5F5;
- }
- .cancellate {
- margin-top: 20rpx;
- padding: 0 30rpx;
- .order {
- background: #fff;
- height: 90rpx;
- border-radius: 16rpx;
- padding: 0 30rpx;
- align-items: center;
- color: #282828;
- font-size: 28rpx;
- .btn{
- width: 124rpx;
- height: 48rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- border: 1px solid #707070;
- border-radius: 25rpx;
- }
- }
- .list{
- background: #fff;
- border-radius: 16rpx;
- margin-top: 20rpx;
- .header{
- height: 88rpx;
- line-height: 88rpx;
- padding: 0 30rpx;
- border-bottom: 1px solid #f0f0f0;
- .info{
- color: #282828;
- text{
- color: #999;
- }
- }
- .coupon-btn{
- color: #666;
- font-size: 24rpx;
- .iconfont{
- font-size: 20rpx;
- }
- }
- }
- }
- .item{
- padding: 20rpx;
- }
- .picTxt {
- width: 100%;
- position: relative;
- align-items: center;
- margin-bottom: 30rpx;
- .checkbox {
- width: 60rpx;
- .iconfont {
- font-size: 40rpx;
- color: #CCCCCC;
- border-radius: 100%;
- &.disabled{
- background: #f3f3f3;
- }
- }
- .icon-xuanzhong1 {
- color: #2291F8;
- }
- }
- .pictrue {
- width: 160rpx;
- height: 160rpx;
- image {
- width: 100%;
- height: 100%;
- border-radius: 6rpx;
- }
- }
- .text {
- width: 410rpx;
- margin-left: 20rpx;
- font-size: 28rpx;
- color: #282828;
- }
- .text .money {
- font-size: 26rpx;
- color: #282828;
- margin-top: 8rpx;
- }
- .callate_bom{
- margin-top: 20rpx;
- align-items: center;
- .callate_text{
- font-size: 26rpx;
- color: #999;
- &.refund_text{
- color: #FF9600;
- }
- &.uncall_text{
- color: #2291F8;
- }
- }
- }
- .carnum {
- height: 47rpx;
- }
- .carnum view {
- border: 1px solid #a4a4a4;
- min-width: 66rpx;
- text-align: center;
- height: 100%;
- line-height: 46rpx;
- font-size: 28rpx;
- color: #a4a4a4;
- }
- .reduce {
- border-right: 0;
- border-radius: 3rpx 0 0 3rpx;
- &.on{
- border-color: #e3e3e3;
- color: #dedede;
- }
- }
- .plus {
- border-left: 0;
- border-radius: 0 3rpx 3rpx 0;
- &.on{
- border-color: #e3e3e3;
- color: #dedede;
- }
- }
- .carnum .num {
- color: #282828;
- }
- }
- }
- .footer {
- z-index: 9;
- width: 100%;
- height: 96rpx;
- background-color: #fafafa;
- position: fixed;
- padding: 0 30rpx;
- box-sizing: border-box;
- border-top: 1px solid #eee;
- bottom: 0;
- }
- .footer .checkAll {
- font-size: 28rpx;
- color: #282828;
- margin-left: 16rpx;
- }
- .footer .placeOrder {
- color: #fff;
- font-size: 30rpx;
- width: 226rpx;
- height: 70rpx;
- border-radius: 50rpx;
- text-align: center;
- line-height: 70rpx;
- margin-left: 22rpx;
- background-color: #2291F8;
- }
- .allcheckbox {
- display: flex;
- align-items: center;
- width: 260rpx;
- .iconfont {
- margin-right: 20rpx;
- font-size: 40rpx;
- color: #CCCCCC;
- }
- .icon-xuanzhong1 {
- color: #2291F8;
- }
- }
- .footer .button .bnt {
- font-size: 28rpx;
- color: #999;
- border-radius: 50rpx;
- border: 1px solid #999;
- width: 160rpx;
- height: 60rpx;
- text-align: center;
- line-height: 60rpx;
- &.bt-color {
- color: #2291F8;
- border: 1px solid #2291F8;
- }
- }
- </style>
|