| | |
| | | <template> |
| | | <view :data-theme='theme()' :class="theme() || ''"> |
| | | <view :data-theme='theme()' :class="theme() || ''"> |
| | | <!-- #ifdef APP-PLUS --> |
| | | <header-bar></header-bar> |
| | | <!-- #endif --> |
| | |
| | | <checkbox color="red" value="cb" class="checkbox" |
| | | :checked="supplier_item.checked" /> |
| | | </label> |
| | | <view class="d-a-c" |
| | | @tap="gotoPage('/pages/shop/shop?shop_supplier_id='+supplier_item.supplier.shop_supplier_id)"> |
| | | <view class="d-a-c" @tap="gotoShopPage(supplier_item.supplier.shop_supplier_id)"> |
| | | <i class="icon iconfont icon-dianpu1"></i> |
| | | <text class="f32 gray3">{{supplier_item.supplier.name}}</text> |
| | | </view> |
| | |
| | | <view class="price"> |
| | | ¥ |
| | | <text class="num">{{ item.product_price }}</text> |
| | | <view v-if="item.service_name">{{ item.service_name }}:¥ {{ item.service_price }}</view> |
| | | <view v-if="item.service_name">{{ item.service_name }}:¥ |
| | | {{ item.service_price }}</view> |
| | | </view> |
| | | <view class="num-wrap"> |
| | | <view class="" @tap.stop="reduceFunc(item)" v-if="item.total_num > 1"> |
| | | <image class="reduce_icon" src="/static/icon/reduce.png" |
| | | mode=""></image> |
| | | <image class="reduce_icon" src="/static/icon/reduce.png" mode=""> |
| | | </image> |
| | | </view> |
| | | <view class="text-wrap">{{item.total_num}}</view> |
| | | <view class="" @tap.stop="addFunc(item)" |
| | |
| | | |
| | | <!--底部按钮--> |
| | | <view class="bottom-btns f28" :class="is_auto?'is_auto':''" v-if="tableData.length > 0"> |
| | | <label class="d-c-c mr20" @tap="onCheckedAll()"> |
| | | <label class="d-c-c mr20" @tap="onCheckedAll()"> |
| | | <!--<checkbox color="red" class="checkbox" :checked="checkedAll" value="cb" /> |
| | | 全选--> |
| | | </label> |
| | | </label> |
| | | <view class="d-e-c pr20" v-if="!isEdit"> |
| | | <view class="total d-s-c flex-1 mr20"> |
| | | <text class="f24 gray9">合计:</text> |
| | |
| | | totalPrice: 0, |
| | | totalProduct: 0, |
| | | store_open: 1, |
| | | is_auto:0, |
| | | activity_id:0, |
| | | longitude:'', |
| | | latitude:'', |
| | | is_auto: 0, |
| | | activity_id: 0, |
| | | longitude: '', |
| | | latitude: '', |
| | | }; |
| | | }, |
| | | onLoad(e) { |
| | | this.activity_id = e.activity_id; |
| | | if(!Object.hasOwn(e, 'activity_id')){ |
| | | this.activity_id = e.activity_id; |
| | | if (!Object.hasOwn(e, 'activity_id')) { |
| | | uni.navigateBack(); |
| | | } |
| | | this.longitude = uni.getStorageSync('userLongitude'); |
| | |
| | | /*获取产品详情*/ |
| | | this.getData(); |
| | | // this.getTabBarLinks(); |
| | | if(uni.getStorageSync('citySupplierRes')){ |
| | | let resData=uni.getStorageSync('citySupplierRes'); |
| | | this.city_supplier_ids=resData.supplier_ids; |
| | | if (uni.getStorageSync('citySupplierRes')) { |
| | | let resData = uni.getStorageSync('citySupplierRes'); |
| | | this.city_supplier_ids = resData.supplier_ids; |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | let self = this; |
| | | self.isloadding = true; |
| | | self._get('branch.activityCart/lists', { |
| | | longitude:self.longitude, |
| | | latitude:self.latitude, |
| | | activity_id:self.activity_id |
| | | longitude: self.longitude, |
| | | latitude: self.latitude, |
| | | activity_id: self.activity_id |
| | | }, function(res) { |
| | | let auto = uni.getStorageSync('TabBar').is_auto && uni.getStorageSync('TabBar').is_auto != 0; |
| | | self.is_auto = auto; |
| | |
| | | //先把其他商户的去掉 by yj 2024.3.11 |
| | | let self = this; |
| | | self.tableData.forEach(item => { |
| | | if(item.shop_supplier_id != this.tableData[supplier_index].shop_supplier_id ){ |
| | | if (item.shop_supplier_id != this.tableData[supplier_index].shop_supplier_id) { |
| | | this.$set(item, 'checked', false); |
| | | item.productList.forEach(product => { |
| | | product.checked = false; |
| | | }); |
| | | } |
| | | |
| | | |
| | | }); |
| | | |
| | | |
| | | e.checked = !e.checked; |
| | | this.$set(this.tableData[supplier_index].productList, index, e); |
| | | console.log(this.tableData) |
| | |
| | | /* 店铺全选 */ |
| | | checkStprItem(itemp, index) { |
| | | let self = this; |
| | | |
| | | |
| | | //先把其他商户的去掉 by yj 2024.3.11 |
| | | self.tableData.forEach(item => { |
| | | this.$set(item, 'checked', false); |
| | |
| | | product.checked = false; |
| | | }); |
| | | }); |
| | | |
| | | |
| | | //console.log(itemp) |
| | | itemp.checked = !itemp.checked; |
| | | itemp.productList.forEach((item, index) => { |
| | | item.checked = itemp.checked; |
| | | }) |
| | | |
| | | |
| | | self.updateTotalPrice(); |
| | | // 更新选中记录 |
| | | self.onUpdateChecked(); |
| | | // 更新全选状态 |
| | | this.checkedAll = this.getCheckedData().length == this.totalProduct; |
| | | }, |
| | | gotoShopPage(shop_supplier_id) { |
| | | uni.setStorageSync('shop_supplier_id', shop_supplier_id) |
| | | this.gotoPage('/pages/shop/shop?shop_supplier_id=' + shop_supplier_id) |
| | | }, |
| | | /*全选*/ |
| | | onCheckedAll() { |
| | |
| | | }); |
| | | return false; |
| | | } |
| | | this.gotoPage('/pages/order/confirm-order?&branch_activity_id='+self.activity_id+'&order_type=cart&cart_ids=' + arrIds); |
| | | this.gotoPage('/pages/order/confirm-order?&branch_activity_id=' + self.activity_id + |
| | | '&order_type=cart&cart_ids=' + arrIds); |
| | | }, |
| | | /*添加*/ |
| | | addFunc(item) { |
| | |
| | | 'branch.activityCart/add', { |
| | | product_id: product_id, |
| | | spec_sku_id: spec_sku_id, |
| | | activity_id:self.activity_id, |
| | | activity_id: self.activity_id, |
| | | total_num: 1, |
| | | longitude:self.longitude, |
| | | latitude:self.latitude |
| | | longitude: self.longitude, |
| | | latitude: self.latitude |
| | | }, |
| | | function(res) { |
| | | uni.hideLoading() |
| | |
| | | /*减少*/ |
| | | reduceFunc(item) { |
| | | let self = this; |
| | | |
| | | |
| | | let product_id = item.product_id; |
| | | let spec_sku_id = item.spec_sku_id; |
| | | let service_index = item.service_index; |
| | |
| | | return; |
| | | } |
| | | //最低起卖个数 |
| | | if(item.min_sell >= item.total_num){ |
| | | if (item.min_sell >= item.total_num) { |
| | | return; |
| | | } |
| | | uni.showLoading({ |
| | |
| | | }); |
| | | self._post( |
| | | 'branch.activityCart/sub', { |
| | | activity_id:self.activity_id, |
| | | activity_id: self.activity_id, |
| | | product_id: product_id, |
| | | spec_sku_id: spec_sku_id, |
| | | longitude:self.longitude, |
| | | latitude:self.latitude |
| | | longitude: self.longitude, |
| | | latitude: self.latitude |
| | | }, |
| | | function(res) { |
| | | self.loadding = false; |
| | |
| | | self._post( |
| | | 'branch.activityCart/delete', { |
| | | cart_id: cartIds, |
| | | activity_id:self.activity_id, |
| | | longitude:self.longitude, |
| | | latitude:self.latitude |
| | | activity_id: self.activity_id, |
| | | longitude: self.longitude, |
| | | latitude: self.latitude |
| | | }, |
| | | function(res) { |
| | | // 删除选中的商品 |
| | |
| | | } |
| | | }); |
| | | }); |
| | | self.$nextTick(()=>{ |
| | | self.$nextTick(() => { |
| | | // 更新选中记录 |
| | | self.onUpdateChecked(); |
| | | }) |
| | | |
| | | |
| | | return true; |
| | | }, |
| | | /** |
| | |
| | | background: #ffffff; |
| | | z-index: 1000; |
| | | } |
| | | |
| | | // .bottom-btns.is_auto { |
| | | // bottom: calc(env(safe-area-inset-bottom) + 98rpx); |
| | | // } |
| | |
| | | width: 32rpx; |
| | | height: 32rpx; |
| | | } |
| | | </style> |
| | | </style> |