购物车加减icon加大

master
gongfuxiang 2024-12-07 21:04:29 +08:00
parent 26bf53f2ab
commit b1aa38cf89
6 changed files with 241 additions and 241 deletions

View File

@ -30,7 +30,7 @@
</block>
<block v-if="(item.is_error || 0) == 0 && is_show_cart">
<view v-if="propOpenCart" class="bg-white right-cart-icon pr" :data-index="index" @tap.stop="goods_cart_event">
<iconfont name="icon-cart-inc" size="40rpx" :color="theme_color"></iconfont>
<iconfont name="icon-cart-inc" size="48rpx" :color="theme_color"></iconfont>
<view class="cart-badge-icon pa">
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
</view>
@ -81,7 +81,7 @@
<block v-else>
<block v-if="(item.is_error || 0) == 0 && is_show_cart">
<view v-if="propOpenCart" class="bg-white pr" :data-index="index" @tap.stop="goods_cart_event">
<iconfont name="icon-cart-inc" size="40rpx" :color="theme_color"></iconfont>
<iconfont name="icon-cart-inc" size="48rpx" :color="theme_color"></iconfont>
<view class="cart-badge-icon pa">
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
</view>

View File

@ -45,11 +45,11 @@
<view class="sales-price text-size-sm single-text dis-inline-block va-m">{{ propCurrencySymbol }}{{ goods.price }}</view>
<view class="tc fr flex-row align-c">
<view v-if="(goods.stock || 0) > 0" class="cp pr top-sm" :data-index="index" data-type="0" @tap.stop="cart_stock_event">
<iconfont name="icon-cart-dec" size="40rpx" :color="theme_color"></iconfont>
<iconfont name="icon-cart-dec" size="48rpx" :color="theme_color"></iconfont>
</view>
<view v-if="(goods.stock || 0) > 0" class="buy-number dis-inline-block cr-black text-size-sm padding-left-xs padding-right-xs va-m">{{ goods.stock }} </view>
<view class="cp pr top-sm" :data-index="index" data-type="1" @tap.stop="cart_stock_event">
<iconfont name="icon-cart-inc" size="40rpx" :color="theme_color"></iconfont>
<iconfont name="icon-cart-inc" size="48rpx" :color="theme_color"></iconfont>
</view>
</view>
</view>

View File

@ -135,13 +135,13 @@
<view v-if="common_site_type != 1" class="buy-opt flex-row align-c tc">
<block v-if="(item.is_error || 0) == 0">
<view v-if="(item.buy_number || 0) > 0" class="cp pr top-sm" :data-index="index" data-type="0" @tap.stop="buy_number_event">
<iconfont name="icon-cart-dec" size="40rpx" :color="theme_color"></iconfont>
<iconfont name="icon-cart-dec" size="48rpx" :color="theme_color"></iconfont>
</view>
<view v-if="(item.buy_number || 0) > 0" class="buy-number cr-black text-size-sm padding-left-xs padding-right-xs">
{{ item.buy_number }}
</view>
<view class="cp pr top-sm" :data-index="index" data-type="1" @tap.stop="buy_number_event">
<iconfont name="icon-cart-inc" size="40rpx" :color="theme_color"></iconfont>
<iconfont name="icon-cart-inc" size="48rpx" :color="theme_color"></iconfont>
</view>
</block>
<block v-else>
@ -304,13 +304,13 @@
<view class="tc fr flex-row align-c">
<block v-if="goods.is_error == 0">
<view v-if="(goods.stock || 0) > 0" class="cp pr top-sm" :data-index="index" data-type="0" @tap.stop="cart_buy_number_event">
<iconfont name="icon-cart-dec" size="40rpx" :color="theme_color"></iconfont>
<iconfont name="icon-cart-dec" size="48rpx" :color="theme_color"></iconfont>
</view>
<view v-if="(goods.stock || 0) > 0" class="buy-number dis-inline-block cr-black text-size-sm padding-left-xs padding-right-xs va-m">
{{ goods.stock }}
</view>
<view class="cp pr top-sm" :data-index="index" data-type="1" @tap.stop="cart_buy_number_event">
<iconfont name="icon-cart-inc" size="40rpx" :color="theme_color"></iconfont>
<iconfont name="icon-cart-inc" size="48rpx" :color="theme_color"></iconfont>
</view>
</block>
<block v-else>

View File

@ -173,13 +173,13 @@
<view v-if="is_base_mode != 1" class="tc flex-row align-c">
<block v-if="(item.is_error || 0) == 0">
<view v-if="(item.buy_number || 0) > 0" class="cp pr top-sm" :data-index="index" data-type="0" @tap.stop="buy_number_event">
<iconfont name="icon-cart-dec" size="40rpx" :color="theme_color"></iconfont>
<iconfont name="icon-cart-dec" size="48rpx" :color="theme_color"></iconfont>
</view>
<view v-if="(item.buy_number || 0) > 0" class="buy-number cr-black text-size-sm padding-left-xs padding-right-xs">
{{ item.buy_number }}
</view>
<view class="cp pr top-sm" :data-index="index" data-type="1" @tap.stop="buy_number_event">
<iconfont name="icon-cart-inc" size="40rpx" :color="theme_color"></iconfont>
<iconfont name="icon-cart-inc" size="48rpx" :color="theme_color"></iconfont>
</view>
</block>
<block v-else>

View File

@ -15,15 +15,15 @@
<text v-if="(item.show_field_original_price_status || 0) == 1 && item.original_price > 0" class="original-price margin-left">{{item.show_price_symbol}}{{item.original_price}}{{item.show_original_price_unit}}</text>
</view>
</view>
</view>
<view class="dis-inline-block pa top-xxxxl right-xxxxl" @tap="cancel_event" :data-value="item.goods_id" :data-index="index">
<iconfont name="icon-ellipsis" size="40rpx" color="#999"></iconfont>
</view>
<view v-if="(item.is_error || 0) == 0" class="dis-inline-block pa right-xxxxl bottom-xxxxl" :data-index="index" @tap.stop="goods_cart_event">
<iconfont name="icon-cart-inc" size="40rpx" :color="theme_color"></iconfont>
<view class="pa top-0-xxxl right-xs">
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
</view>
</view>
<view class="dis-inline-block pa top-xxxxl right-xxxxl" @tap="cancel_event" :data-value="item.goods_id" :data-index="index">
<iconfont name="icon-ellipsis" size="40rpx" color="#999"></iconfont>
</view>
<view v-if="(item.is_error || 0) == 0" class="dis-inline-block pa right-xxxxl bottom-xxxxl" :data-index="index" @tap.stop="goods_cart_event">
<iconfont name="icon-cart-inc" size="48rpx" :color="theme_color"></iconfont>
<view class="pa top-0-xxxl right-xs">
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
</view>
</view>
</view>
</view>
@ -33,9 +33,9 @@
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 商品购买 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 商品购买 -->
<component-goods-buy ref="goods_buy" v-on:CartSuccessEvent="goods_cart_back_event"></component-goods-buy>
</scroll-view>
@ -47,13 +47,13 @@
const app = getApp();
import componentCommon from '@/components/common/common';
import componentNoData from "@/components/no-data/no-data";
import componentBottomLine from "@/components/bottom-line/bottom-line";
import componentBadge from '@/components/badge/badge';
import componentBottomLine from "@/components/bottom-line/bottom-line";
import componentBadge from '@/components/badge/badge';
import componentGoodsBuy from '@/components/goods-buy/goods-buy';
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
theme_view: app.globalData.get_theme_value_view(),
theme_color: app.globalData.get_theme_color(),
data_list: [],
data_total: 0,
@ -70,8 +70,8 @@
components: {
componentCommon,
componentNoData,
componentBottomLine,
componentBadge,
componentBottomLine,
componentBadge,
componentGoodsBuy
},
@ -232,89 +232,89 @@
},
//
cancel_event(e) {
var self = this;
wx.showActionSheet({
itemList: [self.$t('cart.cart.87rfg3')],
success (res) {
//
var id = e.currentTarget.dataset.value;
var index = e.currentTarget.dataset.index;
// loding
uni.showLoading({
title: self.$t('common.processing_in_text')
});
uni.request({
url: app.globalData.get_request_url("cancel", "usergoodsfavor"),
method: 'POST',
data: {
id: id
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
var temp_data_list = self.data_list;
temp_data_list.splice(index, 1);
self.setData({
data_list: temp_data_list
});
if (temp_data_list.length == 0) {
self.setData({
data_list_loding_status: 0,
data_bottom_line_status: false
});
}
app.globalData.showToast(res.data.msg, 'success');
} else {
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast(self.$t('common.internet_error_tips'));
}
});
}
cancel_event(e) {
var self = this;
wx.showActionSheet({
itemList: [self.$t('cart.cart.87rfg3')],
success (res) {
//
var id = e.currentTarget.dataset.value;
var index = e.currentTarget.dataset.index;
// loding
uni.showLoading({
title: self.$t('common.processing_in_text')
});
uni.request({
url: app.globalData.get_request_url("cancel", "usergoodsfavor"),
method: 'POST',
data: {
id: id
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
var temp_data_list = self.data_list;
temp_data_list.splice(index, 1);
self.setData({
data_list: temp_data_list
});
if (temp_data_list.length == 0) {
self.setData({
data_list_loding_status: 0,
data_bottom_line_status: false
});
}
app.globalData.showToast(res.data.msg, 'success');
} else {
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast(self.$t('common.internet_error_tips'));
}
});
}
});
},
//
goods_cart_event(e) {
if ((this.$refs.goods_buy || null) != null) {
var index = e.currentTarget.dataset.index || 0;
var goods = this.data_list[index];
goods['id'] = goods.goods_id;
this.$refs.goods_buy.init(
goods,
{
buy_event_type: 'cart',
is_direct_cart: 1,
},
{
index: index,
pos: e,
}
);
}
},
//
goods_cart_back_event(e) {
//
var back = e.back_data;
var temp_data_list = this.data_list;
var goods = temp_data_list[back.index];
goods['user_cart_count'] = parseInt(goods['user_cart_count'] || 0) + parseInt(e.stock);
if (goods['user_cart_count'] > 99) {
goods['user_cart_count'] = '99+';
}
temp_data_list[back.index] = goods;
this.setData({
data_list: temp_data_list,
});
//
app.globalData.set_tab_bar_badge('cart', e.cart_number || 0);
},
//
goods_cart_event(e) {
if ((this.$refs.goods_buy || null) != null) {
var index = e.currentTarget.dataset.index || 0;
var goods = this.data_list[index];
goods['id'] = goods.goods_id;
this.$refs.goods_buy.init(
goods,
{
buy_event_type: 'cart',
is_direct_cart: 1,
},
{
index: index,
pos: e,
}
);
}
},
//
goods_cart_back_event(e) {
//
var back = e.back_data;
var temp_data_list = this.data_list;
var goods = temp_data_list[back.index];
goods['user_cart_count'] = parseInt(goods['user_cart_count'] || 0) + parseInt(e.stock);
if (goods['user_cart_count'] > 99) {
goods['user_cart_count'] = '99+';
}
temp_data_list[back.index] = goods;
this.setData({
data_list: temp_data_list,
});
//
app.globalData.set_tab_bar_badge('cart', e.cart_number || 0);
},
// url

View File

@ -15,15 +15,15 @@
<text v-if="(item.show_field_original_price_status || 0) == 1 && item.original_price > 0" class="original-price margin-left">{{item.show_price_symbol}}{{item.original_price}}{{item.show_original_price_unit}}</text>
</view>
</view>
</view>
<view class="dis-inline-block pa top-xxxxl right-xxxxl" @tap="item_event" :data-value="item.id" :data-index="index">
<iconfont name="icon-ellipsis" size="40rpx" color="#999"></iconfont>
</view>
<view v-if="(item.is_error || 0) == 0" class="dis-inline-block pa right-xxxxl bottom-xxxxl" :data-index="index" @tap.stop="goods_cart_event">
<iconfont name="icon-cart-inc" size="40rpx" :color="theme_color"></iconfont>
<view class="pa top-0-xxxl right-xs">
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
</view>
</view>
<view class="dis-inline-block pa top-xxxxl right-xxxxl" @tap="item_event" :data-value="item.id" :data-index="index">
<iconfont name="icon-ellipsis" size="40rpx" color="#999"></iconfont>
</view>
<view v-if="(item.is_error || 0) == 0" class="dis-inline-block pa right-xxxxl bottom-xxxxl" :data-index="index" @tap.stop="goods_cart_event">
<iconfont name="icon-cart-inc" size="48rpx" :color="theme_color"></iconfont>
<view class="pa top-0-xxxl right-xs">
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
</view>
</view>
</view>
</view>
@ -33,9 +33,9 @@
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 商品购买 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 商品购买 -->
<component-goods-buy ref="goods_buy" v-on:CartSuccessEvent="goods_cart_back_event"></component-goods-buy>
</scroll-view>
@ -47,13 +47,13 @@
const app = getApp();
import componentCommon from '@/components/common/common';
import componentNoData from "@/components/no-data/no-data";
import componentBottomLine from "@/components/bottom-line/bottom-line";
import componentBadge from '@/components/badge/badge';
import componentBottomLine from "@/components/bottom-line/bottom-line";
import componentBadge from '@/components/badge/badge';
import componentGoodsBuy from '@/components/goods-buy/goods-buy';
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
theme_view: app.globalData.get_theme_value_view(),
theme_color: app.globalData.get_theme_color(),
data_list: [],
data_total: 0,
@ -70,8 +70,8 @@
components: {
componentCommon,
componentNoData,
componentBottomLine,
componentBadge,
componentBottomLine,
componentBadge,
componentGoodsBuy
},
@ -232,124 +232,124 @@
},
//
item_event(e) {
var self = this;
wx.showActionSheet({
itemList: [self.$t('cart.cart.8tt78i'), self.$t('common.del_record')],
success (res) {
var id = e.currentTarget.dataset.value;
var index = e.currentTarget.dataset.index;
if(res.tapIndex == 0) {
self.goods_favor_handle(self, id, index);
} else {
self.goods_delete_handle(self, id, index);
item_event(e) {
var self = this;
wx.showActionSheet({
itemList: [self.$t('cart.cart.8tt78i'), self.$t('common.del_record')],
success (res) {
var id = e.currentTarget.dataset.value;
var index = e.currentTarget.dataset.index;
if(res.tapIndex == 0) {
self.goods_favor_handle(self, id, index);
} else {
self.goods_delete_handle(self, id, index);
}
}
});
},
//
goods_delete_handle(self, id, index, success_msg = null) {
uni.showLoading({
title: self.$t('common.processing_in_text')
});
uni.request({
url: app.globalData.get_request_url("delete", "usergoodsbrowse"),
method: 'POST',
data: {
ids: id
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
var temp_data_list = self.data_list;
temp_data_list.splice(index, 1);
self.setData({
data_list: temp_data_list
});
if (temp_data_list.length == 0) {
self.setData({
data_list_loding_status: 0,
data_bottom_line_status: false
});
}
app.globalData.showToast(success_msg || res.data.msg, 'success');
} else {
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast(self.$t('common.internet_error_tips'));
}
});
},
//
goods_favor_handle(self, id, index) {
uni.showLoading({
title: self.$t('common.processing_in_text'),
});
uni.request({
url: app.globalData.get_request_url('favor', 'goods'),
method: 'POST',
data: {
id: self.data_list[index]['goods_id'],
is_mandatory_favor: 1
},
dataType: 'json',
success: (res) => {
uni.hideLoading();
if (res.data.code == 0) {
self.goods_delete_handle(self, id, index, res.data.msg);
} else {
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast(self.$t('common.internet_error_tips'));
},
});
},
//
goods_cart_event(e) {
if ((this.$refs.goods_buy || null) != null) {
var index = e.currentTarget.dataset.index || 0;
var goods = this.data_list[index];
goods['id'] = goods.goods_id;
this.$refs.goods_buy.init(
goods,
{
buy_event_type: 'cart',
is_direct_cart: 1,
},
{
index: index,
pos: e,
}
);
}
},
//
goods_cart_back_event(e) {
//
var back = e.back_data;
var temp_data_list = this.data_list;
var goods = temp_data_list[back.index];
goods['user_cart_count'] = parseInt(goods['user_cart_count'] || 0) + parseInt(e.stock);
if (goods['user_cart_count'] > 99) {
goods['user_cart_count'] = '99+';
}
temp_data_list[back.index] = goods;
this.setData({
data_list: temp_data_list,
});
//
app.globalData.set_tab_bar_badge('cart', e.cart_number || 0);
},
//
goods_delete_handle(self, id, index, success_msg = null) {
uni.showLoading({
title: self.$t('common.processing_in_text')
});
uni.request({
url: app.globalData.get_request_url("delete", "usergoodsbrowse"),
method: 'POST',
data: {
ids: id
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
var temp_data_list = self.data_list;
temp_data_list.splice(index, 1);
self.setData({
data_list: temp_data_list
});
if (temp_data_list.length == 0) {
self.setData({
data_list_loding_status: 0,
data_bottom_line_status: false
});
}
app.globalData.showToast(success_msg || res.data.msg, 'success');
} else {
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast(self.$t('common.internet_error_tips'));
}
});
},
//
goods_favor_handle(self, id, index) {
uni.showLoading({
title: self.$t('common.processing_in_text'),
});
uni.request({
url: app.globalData.get_request_url('favor', 'goods'),
method: 'POST',
data: {
id: self.data_list[index]['goods_id'],
is_mandatory_favor: 1
},
dataType: 'json',
success: (res) => {
uni.hideLoading();
if (res.data.code == 0) {
self.goods_delete_handle(self, id, index, res.data.msg);
} else {
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast(self.$t('common.internet_error_tips'));
},
});
},
//
goods_cart_event(e) {
if ((this.$refs.goods_buy || null) != null) {
var index = e.currentTarget.dataset.index || 0;
var goods = this.data_list[index];
goods['id'] = goods.goods_id;
this.$refs.goods_buy.init(
goods,
{
buy_event_type: 'cart',
is_direct_cart: 1,
},
{
index: index,
pos: e,
}
);
}
},
//
goods_cart_back_event(e) {
//
var back = e.back_data;
var temp_data_list = this.data_list;
var goods = temp_data_list[back.index];
goods['user_cart_count'] = parseInt(goods['user_cart_count'] || 0) + parseInt(e.stock);
if (goods['user_cart_count'] > 99) {
goods['user_cart_count'] = '99+';
}
temp_data_list[back.index] = goods;
this.setData({
data_list: temp_data_list,
});
//
app.globalData.set_tab_bar_badge('cart', e.cart_number || 0);
},
// url